Package io.jmix.reportsflowui.runner
Class ReportPresentationRegistry
java.lang.Object
io.jmix.reportsflowui.runner.ReportPresentationRegistry
@Component("report_ReportPresentationRegistry")
public class ReportPresentationRegistry
extends Object
Registry of all
ReportExecutionPresentation implementations available in the application context.
Used by the report runner to resolve how a specific output channel (download, spreadsheet viewer, table viewer, …) should prepare and display a report result.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<ReportExecutionPresentation> protected final Map<String, ReportExecutionPresentation> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidResolves the default template and output type for the presentation carried by the context and writes them back into the context's underlying run context.protected UiReportRunContextcopyContext(UiReportRunContext sourceContext) createRunContext(UiReportRunContext sourceContext, String presentationId) WrapssourceContextin aPresentationUiReportRunContexttargeting the given presentation.getPresentation(UiReportRunContext context) getPresentation(String presentationId) booleanhasPresentation(String presentationId) protected voidinit()booleanisPresentation(UiReportRunContext context, String presentationId) protected booleanshouldPreserveMissingDefaultTemplate(UiReportRunContext context, ReportExecutionPresentation presentation, @Nullable Report report) booleansupportsReport(@Nullable Report report, String presentationId)
-
Field Details
-
presentations
-
presentationsById
-
-
Constructor Details
-
ReportPresentationRegistry
public ReportPresentationRegistry()
-
-
Method Details
-
init
@PostConstruct protected void init() -
getPresentation
- Returns:
- the presentation associated with the run context, falling back to
ReportExecutionPresentationIds.DEFAULTwhen the context carries no explicit presentation - Throws:
IllegalArgumentException- if the resolved presentation id is not registered
-
getPresentation
- Returns:
- the presentation registered under
presentationId - Throws:
IllegalArgumentException- if no presentation with the given id is registered
-
hasPresentation
- Returns:
trueif a presentation with the given id is registered
-
supportsReport
- Returns:
trueif the presentation is registered and supports the report;falsewhen the presentation is not registered
-
createRunContext
WrapssourceContextin aPresentationUiReportRunContexttargeting the given presentation. Returns the original context unchanged when the presentation isReportExecutionPresentationIds.DEFAULTand the context is not already presentation-aware. -
isPresentation
- Returns:
trueif the run context targets the presentation identified bypresentationId
-
applyPresentationDefaults
Resolves the default template and output type for the presentation carried by the context and writes them back into the context's underlying run context. -
copyContext
-
shouldPreserveMissingDefaultTemplate
protected boolean shouldPreserveMissingDefaultTemplate(UiReportRunContext context, ReportExecutionPresentation presentation, @Nullable Report report)
-