FINERACT-1345: Fixing support for parameterType reports

This commit is contained in:
Petri Tuomola
2021-05-16 15:57:02 +08:00
committed by Petri Tuomola
parent bd177bd206
commit f87b66d4e1
4 changed files with 8 additions and 4 deletions
@@ -105,7 +105,7 @@ public class RunreportsApiResource {
// 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",
@@ -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();
@@ -212,7 +212,11 @@ public class ReadReportingServiceImpl implements ReadReportingService {
}
@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);
@@ -441,7 +441,7 @@ public class ReportMailingJobWritePlatformServiceImpl implements ReportMailingJo
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);