1 /* 2 * Copyright (c) 2002-2020, City of Paris 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright notice 10 * and the following disclaimer. 11 * 12 * 2. Redistributions in binary form must reproduce the above copyright notice 13 * and the following disclaimer in the documentation and/or other materials 14 * provided with the distribution. 15 * 16 * 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its 17 * contributors may be used to endorse or promote products derived from 18 * this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * POSSIBILITY OF SUCH DAMAGE. 31 * 32 * License 1.0 33 */ 34 package fr.paris.lutece.plugins.jasper.service; 35 36 import java.util.Map; 37 38 import javax.servlet.http.HttpServletRequest; 39 40 import net.sf.jasperreports.engine.JRDataSource; 41 import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; 42 43 /** 44 * Interface to generate a Jasper report 45 * 46 */ 47 public interface ILinkJasperReport extends Cloneable 48 { 49 /** 50 * Gives the link used to generate the report 51 * 52 * @param strReportCode 53 * the report id 54 * @return the link 55 */ 56 String getLink( String strReportCode ); 57 58 /** 59 * Gives the data generated by Jasper 60 * 61 * @param strReportCode 62 * the report id 63 * @param request 64 * the request 65 * @return the data 66 */ 67 byte [ ] getBuffer( String strReportCode, HttpServletRequest request ); 68 69 /** 70 * Gives the data generated by Jasper 71 * 72 * @param strReportCode 73 * the report id 74 * @param dataSource 75 * the datasource 76 * @param parameters 77 * parameters to set 78 * @param request 79 * the httprequest 80 * @return the data 81 */ 82 byte [ ] getBuffer( String strReportCode, JRBeanCollectionDataSource dataSource, Map<String, Object> parameters, HttpServletRequest request ); 83 84 /** 85 * Gives the data generated by Jasper 86 * 87 * @param strReportCode 88 * the report id 89 * @param dataSource 90 * the datasource 91 * @param parameters 92 * parameters to set 93 * @param request 94 * the httprequest 95 * @return the data 96 */ 97 byte [ ] getBuffer( String strReportCode, JRDataSource dataSource, Map<String, Object> parameters, HttpServletRequest request ); 98 99 /** 100 * Gives the data generated by Jasper 101 * 102 * @param report 103 * the report object 104 * @param dataSource 105 * the datasource 106 * @param parameters 107 * parameters to set 108 * @param request 109 * the httprequest 110 * @return the data 111 */ 112 byte [ ] getBuffer( fr.paris.lutece.plugins.jasper.business.JasperReport report, JRBeanCollectionDataSource dataSource, Map<String, Object> parameters, 113 HttpServletRequest request ); 114 115 /** 116 * Gives the data generated by Jasper 117 * 118 * @param report 119 * the report object 120 * @param dataSource 121 * the datasource 122 * @param parameters 123 * parameters to set 124 * @param request 125 * the httprequest 126 * @return the data 127 */ 128 byte [ ] getBuffer( fr.paris.lutece.plugins.jasper.business.JasperReport report, JRDataSource dataSource, Map<String, Object> parameters, 129 HttpServletRequest request ); 130 131 /** 132 * Gives the name of the file generated by Jasper 133 * 134 * @param strReportCode 135 * the report code 136 * @return the file name 137 */ 138 String getFileName( String strReportCode ); 139 140 /** 141 * Gives the type of the file generated by Jasper 142 * 143 * @return the file type 144 */ 145 String getFileType( ); 146 }