Skip to content

Commit

Permalink
FINERACT-1345: Fixing support for parameterType reports
Browse files Browse the repository at this point in the history
  • Loading branch information
ptuomola committed May 16, 2021
1 parent bd177bd commit f87b66d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public Response runReport(@PathParam("reportName") @Parameter(description = "rep
// Pass through isSelfServiceUserReport so that ReportingProcessService implementations can use it
queryParams.putSingle(IS_SELF_SERVICE_USER_REPORT_PARAMETER, Boolean.toString(isSelfServiceUserReport));

String reportType = this.readExtraDataAndReportingService.getReportType(reportName, isSelfServiceUserReport);
String reportType = this.readExtraDataAndReportingService.getReportType(reportName, isSelfServiceUserReport, parameterType);
ReportingProcessService reportingProcessService = this.reportingProcessServiceProvider.findReportingProcessService(reportType);
if (reportingProcessService == null) {
throw new PlatformServiceUnavailableException("err.msg.report.service.implementation.missing",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public interface ReadReportingService {

ReportData retrieveReport(Long id);

String getReportType(String reportName, boolean isSelfServiceUserReport);
String getReportType(String reportName, boolean isSelfServiceUserReport, boolean isParameterType);

Collection<ReportParameterData> getAllowedParameters();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ private String getSql(final String name, final String type) {
}

@Override
public String getReportType(final String reportName, final boolean isSelfServiceUserReport) {
public String getReportType(final String reportName, final boolean isSelfServiceUserReport, final boolean isParameterType) {
if (isParameterType) {
return "Table";
}

final String sql = "SELECT ifNull(report_type,'') AS report_type FROM `stretchy_report` WHERE report_name = ? AND self_service_user_report = ?";

final String sqlWrapped = this.genericDataService.wrapSQL(sql);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ private StringBuilder generateReportOutputStream(final ReportMailingJob reportMa

try {
final boolean isSelfServiceUserReport = false;
final String reportType = this.readReportingService.getReportType(reportName, isSelfServiceUserReport);
final String reportType = this.readReportingService.getReportType(reportName, isSelfServiceUserReport, false);
final ReportingProcessService reportingProcessService = this.reportingProcessServiceProvider
.findReportingProcessService(reportType);

Expand Down

0 comments on commit f87b66d

Please sign in to comment.