temp pentaho parameter added

This commit is contained in:
John Woodlock
2013-03-09 15:28:31 +00:00
parent b407f282d0
commit b975da0d45
@@ -18,6 +18,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import javax.sql.DataSource;
import javax.sql.rowset.CachedRowSet; import javax.sql.rowset.CachedRowSet;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput; import javax.ws.rs.core.StreamingOutput;
@@ -25,6 +26,7 @@ import javax.ws.rs.core.StreamingOutput;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.mifosplatform.infrastructure.core.exception.PlatformDataIntegrityException; import org.mifosplatform.infrastructure.core.exception.PlatformDataIntegrityException;
import org.mifosplatform.infrastructure.core.service.FileUtils; import org.mifosplatform.infrastructure.core.service.FileUtils;
import org.mifosplatform.infrastructure.core.service.TenantAwareRoutingDataSource;
import org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil; import org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil;
import org.mifosplatform.infrastructure.dataqueries.data.GenericResultsetData; import org.mifosplatform.infrastructure.dataqueries.data.GenericResultsetData;
import org.mifosplatform.infrastructure.dataqueries.data.ResultsetColumnHeader; import org.mifosplatform.infrastructure.dataqueries.data.ResultsetColumnHeader;
@@ -58,26 +60,30 @@ import com.lowagie.text.pdf.PdfWriter;
@Service @Service
public class ReadReportingServiceImpl implements ReadReportingService { public class ReadReportingServiceImpl implements ReadReportingService {
private final DataSource dataSource;
private final PlatformSecurityContext context; private final PlatformSecurityContext context;
private final static Logger logger = LoggerFactory.getLogger(ReadReportingServiceImpl.class); private final static Logger logger = LoggerFactory
.getLogger(ReadReportingServiceImpl.class);
private Boolean noPentaho = false; private Boolean noPentaho = false;
@Autowired @Autowired
public ReadReportingServiceImpl(final PlatformSecurityContext context) { public ReadReportingServiceImpl(final PlatformSecurityContext context, final TenantAwareRoutingDataSource dataSource) {
// kick off pentaho reports server // kick off pentaho reports server
ClassicEngineBoot.getInstance().start(); ClassicEngineBoot.getInstance().start();
noPentaho = false; noPentaho = false;
this.context = context; this.context = context;
this.dataSource = dataSource;
} }
@Autowired @Autowired
private GenericDataService genericDataService; private GenericDataService genericDataService;
@Override @Override
public StreamingOutput retrieveReportCSV(final String name, final String type, final Map<String, String> queryParams) { public StreamingOutput retrieveReportCSV(final String name,
final String type, final Map<String, String> queryParams) {
return new StreamingOutput() { return new StreamingOutput() {
@@ -85,10 +91,12 @@ public class ReadReportingServiceImpl implements ReadReportingService {
public void write(final OutputStream out) { public void write(final OutputStream out) {
try { try {
GenericResultsetData result = retrieveGenericResultset(name, type, queryParams); GenericResultsetData result = retrieveGenericResultset(
name, type, queryParams);
StringBuffer sb = generateCsvFileBuffer(result); StringBuffer sb = generateCsvFileBuffer(result);
InputStream in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8")); InputStream in = new ByteArrayInputStream(sb.toString()
.getBytes("UTF-8"));
byte[] outputByte = new byte[4096]; byte[] outputByte = new byte[4096];
Integer readLen = in.read(outputByte, 0, 4096); Integer readLen = in.read(outputByte, 0, 4096);
@@ -101,7 +109,8 @@ public class ReadReportingServiceImpl implements ReadReportingService {
// out.flush(); // out.flush();
// out.close(); // out.close();
} catch (Exception e) { } catch (Exception e) {
throw new PlatformDataIntegrityException("error.msg.exception.error", e.getMessage()); throw new PlatformDataIntegrityException(
"error.msg.exception.error", e.getMessage());
} }
} }
}; };
@@ -116,7 +125,8 @@ public class ReadReportingServiceImpl implements ReadReportingService {
Integer chSize = columnHeaders.size(); Integer chSize = columnHeaders.size();
for (int i = 0; i < chSize; i++) { for (int i = 0; i < chSize; i++) {
writer.append('"' + columnHeaders.get(i).getColumnName() + '"'); writer.append('"' + columnHeaders.get(i).getColumnName() + '"');
if (i < (chSize - 1)) writer.append(","); if (i < (chSize - 1))
writer.append(",");
} }
writer.append('\n'); writer.append('\n');
@@ -137,14 +147,19 @@ public class ReadReportingServiceImpl implements ReadReportingService {
currColType = columnHeaders.get(j).getColumnType(); currColType = columnHeaders.get(j).getColumnType();
currVal = row.get(j); currVal = row.get(j);
if (currVal != null) { if (currVal != null) {
if (currColType.equals("DECIMAL") || currColType.equals("DOUBLE") || currColType.equals("BIGINT") if (currColType.equals("DECIMAL")
|| currColType.equals("SMALLINT") || currColType.equals("INT")) || currColType.equals("DOUBLE")
|| currColType.equals("BIGINT")
|| currColType.equals("SMALLINT")
|| currColType.equals("INT"))
writer.append(currVal); writer.append(currVal);
else else
writer.append('"' + genericDataService.replace(currVal, doubleQuote, twoDoubleQuotes) + '"'); writer.append('"' + genericDataService.replace(currVal,
doubleQuote, twoDoubleQuotes) + '"');
} }
if (j < (rSize - 1)) writer.append(","); if (j < (rSize - 1))
writer.append(",");
} }
writer.append('\n'); writer.append('\n');
} }
@@ -153,7 +168,8 @@ public class ReadReportingServiceImpl implements ReadReportingService {
} }
@Override @Override
public GenericResultsetData retrieveGenericResultset(final String name, final String type, final Map<String, String> queryParams) { public GenericResultsetData retrieveGenericResultset(final String name,
final String type, final Map<String, String> queryParams) {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
logger.info("STARTING REPORT: " + name + " Type: " + type); logger.info("STARTING REPORT: " + name + " Type: " + type);
@@ -165,26 +181,35 @@ public class ReadReportingServiceImpl implements ReadReportingService {
// need to provide an api that does bring back 'permitted' reports // need to provide an api that does bring back 'permitted' reports
// PERMITTED REPORTS SQL // PERMITTED REPORTS SQL
sql = "select r.report_id, r.report_name, r.report_type, r.report_subtype, r.report_category," sql = "select r.report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,"
+ " rp.parameter_id, rp.report_parameter_name, p.parameter_name" + " from stretchy_report r" + " rp.parameter_id, rp.report_parameter_name, p.parameter_name"
+ " from stretchy_report r"
+ " left join stretchy_report_parameter rp on rp.report_id = r.report_id" + " left join stretchy_report_parameter rp on rp.report_id = r.report_id"
+ " left join stretchy_parameter p on p.parameter_id = rp.parameter_id" + " where exists" + " (select 'f'" + " left join stretchy_parameter p on p.parameter_id = rp.parameter_id"
+ " from m_appuser_role ur " + " join m_role r on r.id = ur.role_id" + " where exists"
+ " left join m_role_permission rp on rp.role_id = r.id" + " left join m_permission p on p.id = rp.permission_id" + " (select 'f'"
+ " where ur.appuser_id = " + context.authenticatedUser().getId() + " from m_appuser_role ur "
+ " join m_role r on r.id = ur.role_id"
+ " left join m_role_permission rp on rp.role_id = r.id"
+ " left join m_permission p on p.id = rp.permission_id"
+ " where ur.appuser_id = "
+ context.authenticatedUser().getId()
+ " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('READ_', r.report_name))) " + " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('READ_', r.report_name))) "
+ " order by r.report_name, rp.parameter_id"; + " order by r.report_name, rp.parameter_id";
} else { } else {
sql = getSQLtoRun(name, type, queryParams); sql = getSQLtoRun(name, type, queryParams);
} }
GenericResultsetData result = genericDataService.fillGenericResultSet(sql); GenericResultsetData result = genericDataService
.fillGenericResultSet(sql);
long elapsed = System.currentTimeMillis() - startTime; long elapsed = System.currentTimeMillis() - startTime;
logger.info("FINISHING Report/Request Name: " + name + " - " + type + " Elapsed Time: " + elapsed); logger.info("FINISHING Report/Request Name: " + name + " - " + type
+ " Elapsed Time: " + elapsed);
return result; return result;
} }
private String getSQLtoRun(final String name, final String type, final Map<String, String> queryParams) { private String getSQLtoRun(final String name, final String type,
final Map<String, String> queryParams) {
String sql = getSql(name, type); String sql = getSql(name, type);
@@ -197,11 +222,13 @@ public class ReadReportingServiceImpl implements ReadReportingService {
AppUser currentUser = context.authenticatedUser(); AppUser currentUser = context.authenticatedUser();
// Allows sql query to restrict data by office hierarchy if required // Allows sql query to restrict data by office hierarchy if required
sql = genericDataService.replace(sql, "${currentUserHierarchy}", currentUser.getOffice().getHierarchy()); sql = genericDataService.replace(sql, "${currentUserHierarchy}",
currentUser.getOffice().getHierarchy());
// Allows sql query to restrict data by current user Id if required // Allows sql query to restrict data by current user Id if required
// (typically used to return report lists containing only reports // (typically used to return report lists containing only reports
// permitted to be run by the user // permitted to be run by the user
sql = genericDataService.replace(sql, "${currentUserId}", currentUser.getId().toString()); sql = genericDataService.replace(sql, "${currentUserId}", currentUser
.getId().toString());
sql = genericDataService.wrapSQL(sql); sql = genericDataService.wrapSQL(sql);
@@ -211,63 +238,82 @@ public class ReadReportingServiceImpl implements ReadReportingService {
private String getSql(final String name, final String type) { private String getSql(final String name, final String type) {
String inputSql = "select " + type + "_sql as the_sql from stretchy_" + type + " where " + type + "_name = '" + name + "'"; String inputSql = "select " + type + "_sql as the_sql from stretchy_"
+ type + " where " + type + "_name = '" + name + "'";
inputSql = genericDataService.wrapSQL(inputSql); inputSql = genericDataService.wrapSQL(inputSql);
String sqlErrorMsg = "Sql: " + inputSql; String sqlErrorMsg = "Sql: " + inputSql;
CachedRowSet rs = genericDataService.getCachedResultSet(inputSql, sqlErrorMsg); CachedRowSet rs = genericDataService.getCachedResultSet(inputSql,
sqlErrorMsg);
try { try {
if (rs.next()) { return rs.getString("the_sql"); } if (rs.next()) {
return rs.getString("the_sql");
}
throw new ReportNotFoundException(inputSql); throw new ReportNotFoundException(inputSql);
} catch (SQLException e) { } catch (SQLException e) {
logger.info("msg: " + e.getMessage() + " sql: " + inputSql); logger.info("msg: " + e.getMessage() + " sql: " + inputSql);
throw new PlatformDataIntegrityException("error.msg.sql.error", e.getMessage(), sqlErrorMsg); throw new PlatformDataIntegrityException("error.msg.sql.error",
e.getMessage(), sqlErrorMsg);
} }
} }
@Override @Override
public String getReportType(final String reportName) { public String getReportType(final String reportName) {
String sql = "SELECT ifnull(report_type,'') as report_type FROM `stretchy_report` where report_name = '" + reportName + "'"; String sql = "SELECT ifnull(report_type,'') as report_type FROM `stretchy_report` where report_name = '"
+ reportName + "'";
sql = genericDataService.wrapSQL(sql); sql = genericDataService.wrapSQL(sql);
String sqlErrorMsg = "Report Name: " + reportName + " Sql: " + sql; String sqlErrorMsg = "Report Name: " + reportName + " Sql: " + sql;
CachedRowSet rs = genericDataService.getCachedResultSet(sql, sqlErrorMsg); CachedRowSet rs = genericDataService.getCachedResultSet(sql,
sqlErrorMsg);
try { try {
if (rs.next()) { return rs.getString("report_type"); } if (rs.next()) {
return rs.getString("report_type");
}
throw new ReportNotFoundException(sql); throw new ReportNotFoundException(sql);
} catch (SQLException e) { } catch (SQLException e) {
throw new PlatformDataIntegrityException("error.msg.sql.error", e.getMessage(), sqlErrorMsg); throw new PlatformDataIntegrityException("error.msg.sql.error",
e.getMessage(), sqlErrorMsg);
} }
} }
@Override @Override
public Response processPentahoRequest(final String reportName, final String outputTypeParam, final Map<String, String> queryParams) { public Response processPentahoRequest(final String reportName,
final String outputTypeParam, final Map<String, String> queryParams) {
String outputType = "HTML"; String outputType = "HTML";
if (StringUtils.isNotBlank(outputTypeParam)) outputType = outputTypeParam; if (StringUtils.isNotBlank(outputTypeParam))
outputType = outputTypeParam;
if (!(outputType.equalsIgnoreCase("HTML") || outputType.equalsIgnoreCase("PDF") || outputType.equalsIgnoreCase("XLS") || outputType if (!(outputType.equalsIgnoreCase("HTML")
|| outputType.equalsIgnoreCase("PDF")
|| outputType.equalsIgnoreCase("XLS") || outputType
.equalsIgnoreCase("CSV"))) .equalsIgnoreCase("CSV")))
throw new PlatformDataIntegrityException("error.msg.invalid.outputType", "No matching Output Type: " + outputType); throw new PlatformDataIntegrityException(
"error.msg.invalid.outputType", "No matching Output Type: "
+ outputType);
if (noPentaho) if (noPentaho)
throw new PlatformDataIntegrityException("error.msg.no.pentaho", "Pentaho is not enabled", "Pentaho is not enabled"); throw new PlatformDataIntegrityException("error.msg.no.pentaho",
"Pentaho is not enabled", "Pentaho is not enabled");
// TODO - JW - use pentaho location finder like Pawel does in Mifos // TODO - JW - use pentaho location finder like Pawel does in Mifos
// String reportPath = // String reportPath =
// "C:\\dev\\apache-tomcat-7.0.25\\webapps\\ROOT\\PentahoReports\\" // "C:\\dev\\apache-tomcat-7.0.25\\webapps\\ROOT\\PentahoReports\\"
// + reportName + ".prpt"; // + reportName + ".prpt";
String reportPath = FileUtils.MIFOSX_BASE_DIR + File.separator String reportPath = FileUtils.MIFOSX_BASE_DIR
+ ThreadLocalContextUtil.getTenant().getName().replaceAll(" ", "").trim() + File.separator + "reports" + File.separator + File.separator
+ reportName + ".prpt"; + ThreadLocalContextUtil.getTenant().getName()
.replaceAll(" ", "").trim() + File.separator
+ "reports" + File.separator + reportName + ".prpt";
logger.info("Report path: " + reportPath); logger.info("Report path: " + reportPath);
// load report definition // load report definition
@@ -285,87 +331,127 @@ public class ReadReportingServiceImpl implements ReadReportingService {
if ("PDF".equalsIgnoreCase(outputType)) { if ("PDF".equalsIgnoreCase(outputType)) {
PdfReportUtil.createPDF(masterReport, baos); PdfReportUtil.createPDF(masterReport, baos);
return Response.ok().entity(baos.toByteArray()).type("application/pdf").build(); return Response.ok().entity(baos.toByteArray())
.type("application/pdf").build();
} }
if ("XLS".equalsIgnoreCase(outputType)) { if ("XLS".equalsIgnoreCase(outputType)) {
ExcelReportUtil.createXLS(masterReport, baos); ExcelReportUtil.createXLS(masterReport, baos);
return Response.ok().entity(baos.toByteArray()).type("application/vnd.ms-excel") return Response
.header("Content-Disposition", "attachment;filename=" + reportName.replaceAll(" ", "") + ".xls").build(); .ok()
.entity(baos.toByteArray())
.type("application/vnd.ms-excel")
.header("Content-Disposition",
"attachment;filename="
+ reportName.replaceAll(" ", "")
+ ".xls").build();
} }
if ("CSV".equalsIgnoreCase(outputType)) { if ("CSV".equalsIgnoreCase(outputType)) {
CSVReportUtil.createCSV(masterReport, baos, "UTF-8"); CSVReportUtil.createCSV(masterReport, baos, "UTF-8");
return Response.ok().entity(baos.toByteArray()).type("application/x-msdownload") return Response
.header("Content-Disposition", "attachment;filename=" + reportName.replaceAll(" ", "") + ".csv").build(); .ok()
.entity(baos.toByteArray())
.type("application/x-msdownload")
.header("Content-Disposition",
"attachment;filename="
+ reportName.replaceAll(" ", "")
+ ".csv").build();
} }
if ("HTML".equalsIgnoreCase(outputType)) { if ("HTML".equalsIgnoreCase(outputType)) {
HtmlReportUtil.createStreamHTML(masterReport, baos); HtmlReportUtil.createStreamHTML(masterReport, baos);
return Response.ok().entity(baos.toByteArray()).type("text/html").build(); return Response.ok().entity(baos.toByteArray())
.type("text/html").build();
} }
} catch (ResourceException e) { } catch (ResourceException e) {
throw new PlatformDataIntegrityException("error.msg.reporting.error", e.getMessage()); throw new PlatformDataIntegrityException(
"error.msg.reporting.error", e.getMessage());
} catch (ReportProcessingException e) { } catch (ReportProcessingException e) {
throw new PlatformDataIntegrityException("error.msg.reporting.error", e.getMessage()); throw new PlatformDataIntegrityException(
"error.msg.reporting.error", e.getMessage());
} catch (IOException e) { } catch (IOException e) {
throw new PlatformDataIntegrityException("error.msg.reporting.error", e.getMessage()); throw new PlatformDataIntegrityException(
"error.msg.reporting.error", e.getMessage());
} }
throw new PlatformDataIntegrityException("error.msg.invalid.outputType", "No matching Output Type: " + outputType); throw new PlatformDataIntegrityException(
"error.msg.invalid.outputType", "No matching Output Type: "
+ outputType);
} }
private void addParametersToReport(final MasterReport report, final Map<String, String> queryParams) { private void addParametersToReport(final MasterReport report,
final Map<String, String> queryParams) {
//AppUser currentUser = context.authenticatedUser();
try { try {
ReportParameterValues rptParamValues = report.getParameterValues(); ReportParameterValues rptParamValues = report.getParameterValues();
ReportParameterDefinition paramsDefinition = report.getParameterDefinition(); ReportParameterDefinition paramsDefinition = report
.getParameterDefinition();
/* /*
* only allow integer, long, date and string parameter types and assume all * only allow integer, long, date and string parameter types and
* mandatory - could go more detailed like Pawel did in Mifos later * assume all mandatory - could go more detailed like Pawel did in
* and could match incoming and pentaho parameters better... * Mifos later and could match incoming and pentaho parameters
* currently assuming they come in ok... and if not an error * better... currently assuming they come in ok... and if not an
* error
*/ */
for (ParameterDefinitionEntry paramDefEntry : paramsDefinition.getParameterDefinitions()) { for (ParameterDefinitionEntry paramDefEntry : paramsDefinition
.getParameterDefinitions()) {
String paramName = paramDefEntry.getName(); String paramName = paramDefEntry.getName();
if (paramName != "tenantdb") {
String pValue = queryParams.get(paramName); String pValue = queryParams.get(paramName);
if (StringUtils.isBlank(pValue)) if (StringUtils.isBlank(pValue))
throw new PlatformDataIntegrityException("error.msg.reporting.error", "Pentaho Parameter: " + paramName throw new PlatformDataIntegrityException(
"error.msg.reporting.error",
"Pentaho Parameter: " + paramName
+ " - not Provided"); + " - not Provided");
Class<?> clazz = paramDefEntry.getValueType(); Class<?> clazz = paramDefEntry.getValueType();
logger.info("addParametersToReport(" + paramName + " : " + pValue + " : " + clazz.getCanonicalName() + ")"); logger.info("addParametersToReport(" + paramName + " : "
if (clazz.getCanonicalName().equalsIgnoreCase("java.lang.Integer")) + pValue + " : " + clazz.getCanonicalName() + ")");
if (clazz.getCanonicalName().equalsIgnoreCase(
"java.lang.Integer"))
rptParamValues.put(paramName, Integer.parseInt(pValue)); rptParamValues.put(paramName, Integer.parseInt(pValue));
else if (clazz.getCanonicalName().equalsIgnoreCase("java.lang.Long")) else if (clazz.getCanonicalName().equalsIgnoreCase(
"java.lang.Long"))
rptParamValues.put(paramName, Long.parseLong(pValue)); rptParamValues.put(paramName, Long.parseLong(pValue));
else if (clazz.getCanonicalName().equalsIgnoreCase("java.sql.Date")) else if (clazz.getCanonicalName().equalsIgnoreCase(
"java.sql.Date"))
rptParamValues.put(paramName, Date.valueOf(pValue)); rptParamValues.put(paramName, Date.valueOf(pValue));
else else
rptParamValues.put(paramName, pValue); rptParamValues.put(paramName, pValue);
} }
logger.info("db name:" + dataSource.getConnection().getCatalog());
rptParamValues.put("tenantdb", "mifostenants-heavensfamily" /*dataSource.getConnection().getCatalog()*/);
}
} catch (Exception e) { } catch (Exception e) {
throw new PlatformDataIntegrityException("error.msg.reporting.error", e.getMessage()); throw new PlatformDataIntegrityException(
"error.msg.reporting.error", e.getMessage());
} }
} }
@Override @Override
public String retrieveReportPDF(final String reportName, final String type, final Map<String, String> queryParams) { public String retrieveReportPDF(final String reportName, final String type,
final Map<String, String> queryParams) {
String fileLocation = FileUtils.MIFOSX_BASE_DIR + File.separator + ""; String fileLocation = FileUtils.MIFOSX_BASE_DIR + File.separator + "";
if (!new File(fileLocation).isDirectory()) { if (!new File(fileLocation).isDirectory()) {
new File(fileLocation).mkdirs(); new File(fileLocation).mkdirs();
} }
String genaratePdf = fileLocation + File.separator + reportName + ".pdf"; String genaratePdf = fileLocation + File.separator + reportName
+ ".pdf";
try { try {
GenericResultsetData result = retrieveGenericResultset(reportName, type, queryParams); GenericResultsetData result = retrieveGenericResultset(reportName,
type, queryParams);
List<ResultsetColumnHeader> columnHeaders = result.getColumnHeaders(); List<ResultsetColumnHeader> columnHeaders = result
.getColumnHeaders();
List<ResultsetDataRow> data = result.getData(); List<ResultsetDataRow> data = result.getData();
List<String> row; List<String> row;
@@ -374,7 +460,8 @@ public class ReadReportingServiceImpl implements ReadReportingService {
Document document = new Document(PageSize.B0.rotate()); Document document = new Document(PageSize.B0.rotate());
PdfWriter.getInstance(document, new FileOutputStream(new File(fileLocation + reportName + ".pdf"))); PdfWriter.getInstance(document, new FileOutputStream(new File(
fileLocation + reportName + ".pdf")));
document.open(); document.open();
PdfPTable table = new PdfPTable(chSize); PdfPTable table = new PdfPTable(chSize);
@@ -398,8 +485,11 @@ public class ReadReportingServiceImpl implements ReadReportingService {
currColType = columnHeaders.get(j).getColumnType(); currColType = columnHeaders.get(j).getColumnType();
currVal = row.get(j); currVal = row.get(j);
if (currVal != null) { if (currVal != null) {
if (currColType.equals("DECIMAL") || currColType.equals("DOUBLE") || currColType.equals("BIGINT") if (currColType.equals("DECIMAL")
|| currColType.equals("SMALLINT") || currColType.equals("INT")) { || currColType.equals("DOUBLE")
|| currColType.equals("BIGINT")
|| currColType.equals("SMALLINT")
|| currColType.equals("INT")) {
table.addCell(currVal.toString()); table.addCell(currVal.toString());
} else { } else {
@@ -412,9 +502,9 @@ public class ReadReportingServiceImpl implements ReadReportingService {
document.add(table); document.add(table);
document.close(); document.close();
return genaratePdf; return genaratePdf;
} } catch (Exception e) {
catch (Exception e) { throw new PlatformDataIntegrityException(
throw new PlatformDataIntegrityException("error.msg.exception.error", e.getMessage()); "error.msg.exception.error", e.getMessage());
} }
} }
} }