Class UiReportRunnerImpl
java.lang.Object
io.jmix.reportsflowui.runner.impl.UiReportRunnerImpl
- All Implemented Interfaces:
UiReportRunner
@Component("report_UiReportRunner")
public class UiReportRunnerImpl
extends Object
implements UiReportRunner
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Dialogsprotected final DialogWindowsprotected final Downloaderprotected final org.springframework.beans.factory.ObjectProvider<FluentUiReportRunner>protected final Messagesprotected final MetadataToolsprotected final Notificationsprotected final ReportRunnerprotected final ReportsClientPropertiesprotected final ReportsUtilsprotected final ReportZipUtils -
Constructor Summary
ConstructorsConstructorDescriptionUiReportRunnerImpl(ReportRunner reportRunner, DialogWindows dialogWindows, Downloader downloader, MetadataTools metadataTools, Messages messages, Dialogs dialogs, ReportZipUtils reportZipUtils, ReportsUtils reportsUtils, org.springframework.beans.factory.ObjectProvider<FluentUiReportRunner> fluentUiReportRunners, Notifications notifications, ReportsClientProperties reportsClientProperties) -
Method Summary
Modifier and TypeMethodDescriptionbyReportCode(String reportCode) Creates an instance ofFluentUiReportRunnerfor a report with specified code.byReportEntity(Report report) Creates an instance ofFluentUiReportRunnerfor specified report.protected booleancontainsVisibleInputParameters(Report report) protected voiddownloadZipArchive(List<ReportOutputDocument> outputDocuments) protected ReportTemplategetDefaultTemplate(Report report) protected ReportInputParametergetInputParameter(UiReportRunContext uiReportRunContext, String multiParamAlias) protected ReportgetReportForPrinting(Report report) protected StringgetTemplateCode(UiReportRunContext context) protected List<ReportOutputDocument>multiRunSync(UiReportRunContext uiReportRunContext, String multiParamName, Collection<Object> multiParamValues) protected booleanneedToShowParamsDialog(UiReportRunContext uiReportRunContext) protected voidopenReportParamsDialog(UiReportRunContext context, ReportInputParameter inputParameter, boolean bulkPrint) protected voidprepareContext(UiReportRunContext context) voidrunAndShow(UiReportRunContext context) Runs the report based on the information from theUiReportRunContextand shows the result.protected voidrunInBackground(UiReportRunContext context, View hostScreen) voidrunMultipleReports(UiReportRunContext context, String multiParamAlias, Collection multiParamValue) Runs a report for each object from the specified collection.protected <T> voidshowDialog(BackgroundTask<Integer, T> task) protected voidshowResult(ReportOutputDocument document, UiReportRunContext context)
-
Field Details
-
reportRunner
-
dialogWindows
-
downloader
-
metadataTools
-
messages
-
dialogs
-
reportZipUtils
-
reportsUtils
-
fluentUiReportRunners
protected final org.springframework.beans.factory.ObjectProvider<FluentUiReportRunner> fluentUiReportRunners -
notifications
-
reportsClientProperties
-
-
Constructor Details
-
UiReportRunnerImpl
public UiReportRunnerImpl(ReportRunner reportRunner, DialogWindows dialogWindows, Downloader downloader, MetadataTools metadataTools, Messages messages, Dialogs dialogs, ReportZipUtils reportZipUtils, ReportsUtils reportsUtils, org.springframework.beans.factory.ObjectProvider<FluentUiReportRunner> fluentUiReportRunners, Notifications notifications, ReportsClientProperties reportsClientProperties)
-
-
Method Details
-
runAndShow
Description copied from interface:UiReportRunnerRuns the report based on the information from theUiReportRunContextand shows the result. The run context may be created manually using the constructor or using theFluentUiReportRunner.- Specified by:
runAndShowin interfaceUiReportRunner- Parameters:
context- the object that contains all information required to run the report from UI
-
runMultipleReports
public void runMultipleReports(UiReportRunContext context, String multiParamAlias, Collection multiParamValue) Description copied from interface:UiReportRunnerRuns a report for each object from the specified collection. Objects in the collection should have the same type as an input parameter with specified alias. If the report has other parameters besides the specified one, values for these parameters are copied for each report run. As result, the ZIP archive with executed reports is downloaded.
For example, a report has an input parameter with alias "name" and the String type:UiReportRunContext context = new UiReportRunContext(report) .setOutputType(ReportOutputType.PDF); uiReportRunner.runMultipleReports(context, "name", namesList);The report will be executed for each string from the "namesList" collection.- Specified by:
runMultipleReportsin interfaceUiReportRunner- Parameters:
context- the object that contains all information required to run the report from UImultiParamAlias- alias of the parameter for which a value from the collection is used for report executionmultiParamValue- collection of values
-
downloadZipArchive
-
multiRunSync
protected List<ReportOutputDocument> multiRunSync(UiReportRunContext uiReportRunContext, String multiParamName, Collection<Object> multiParamValues) -
byReportCode
Description copied from interface:UiReportRunnerCreates an instance ofFluentUiReportRunnerfor a report with specified code.
Usage examples:UiReportRunContext context = uiReportRunner.byReportCode("orders-report") .withTemplateCode("order-template") .withOutputNamePattern("Orders") .withParametersDialogShowMode(ParametersDialogShowMode.IF_REQUIRED) .inBackground(screen) .buildContext(); uiReportRunner.byReportCode("orders-report") .addParam("orders", ordersList) .withParametersDialogShowMode(ParametersDialogShowMode.NO) .runAndShow(); uiReportRunner.byReportCode("orders-report") .addParam("orders", ordersList) .withParametersDialogShowMode(ParametersDialogShowMode.YES) .runAndShow(); uiReportRunner.byReportCode("customer-orders-report") .addParam("minOrdersDate", date) .withOutputType(ReportOutputType.PDF) .withTemplateCode(""orders-template"") .runMultipleReports("customer", customersList);- Specified by:
byReportCodein interfaceUiReportRunner- Parameters:
reportCode- report code- Returns:
- instance of
FluentUiReportRunner
-
byReportEntity
Description copied from interface:UiReportRunnerCreates an instance ofFluentUiReportRunnerfor specified report.
Usage examples:UiReportRunContext context = uiReportRunner.byReportEntity(report) .withTemplateCode("order-template") .withOutputNamePattern("Orders") .withParametersDialogShowMode(ParametersDialogShowMode.IF_REQUIRED) .inBackground(screen) .buildContext(); uiReportRunner.byReportEntity(report) .addParam("orders", ordersList) .withParametersDialogShowMode(ParametersDialogShowMode.NO) .runAndShow(); uiReportRunner.byReportEntity(report) .withTemplate(template) .addParam("orders", ordersList) .withParametersDialogShowMode(ParametersDialogShowMode.YES) .runAndShow(); uiReportRunner.byReportEntity(report) .addParam("minOrdersDate", date) .withOutputType(ReportOutputType.PDF) .withTemplateCode(""orders-template"") .runMultipleReports("customer", customersList);- Specified by:
byReportEntityin interfaceUiReportRunner- Parameters:
report- report entity- Returns:
- instance of
FluentUiReportRunner
-
runInBackground
-
showDialog
-
openReportParamsDialog
protected void openReportParamsDialog(UiReportRunContext context, @Nullable ReportInputParameter inputParameter, boolean bulkPrint) -
getReportForPrinting
-
showResult
-
getTemplateCode
-
prepareContext
-
getDefaultTemplate
-
needToShowParamsDialog
-
getInputParameter
protected ReportInputParameter getInputParameter(UiReportRunContext uiReportRunContext, String multiParamAlias) -
containsVisibleInputParameters
-