Class ReportWizard
java.lang.Object
io.jmix.reportsflowui.view.reportwizard.ReportWizard
-
Field Summary
Modifier and TypeFieldDescriptionprotected DataSetFactory
protected static final String
protected static final String
protected static final String
protected static final String
protected EntityTreeModelBuilder
protected ExtendedEntities
protected FetchPlans
protected Messages
protected Metadata
protected MetadataTools
protected ReportsPersistence
protected ReportsProperties
protected ReportsSerialization
protected ReportsUtils
static final String
protected TemplateGenerator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildEntityTree
(MetaClass metaClass) protected Set<BandDefinition>
createBands
(Report report, BandDefinition rootReportBandDefinition, ReportData reportData, ReportInputParameter mainParameter) protected BandDefinition
createDataBand
(Report report, BandDefinition rootBandDefinition, String name, int bandDefPos) protected void
createDefaultFormats
(Report report, ReportData reportData, ReportRegion reportRegion) protected ReportTemplate
createDefaultTemplate
(Report report, ReportData reportData) protected void
createEntityDataSet
(ReportData reportData, ReportRegion reportRegion, BandDefinition dataBand, ReportInputParameter mainParameter, FetchPlan parameterFetchPlan) createFetchPlanByReportRegions
(EntityTreeNode entityTreeRootNode, List<ReportRegion> reportRegions) protected BandDefinition
createHeaderBand
(Report report, BandDefinition rootReportBandDefinition, int bandDefPos, ReportRegion reportRegion) protected void
createJpqlDataSet
(ReportData reportData, ReportRegion reportRegion, BandDefinition dataBand) protected ReportInputParameter
createMainInputParameter
(Report report, ReportData reportData) protected ReportInputParameter
createParameter
(Report report, int position) protected ReportInputParameter
createParameters
(ReportData reportData, Report report) protected Report
createReport
(ReportData reportData, boolean isTmp) createReportRegionByFetchPlan
(EntityTree entityTree, boolean isTabulated, FetchPlan fetchPlan, String collectionPropertyName) Create report region using fetch plan and whole entity model as entityTree param For creating tabulated report region for collection of entity (when used # in alias of dataset) fetch plan and parameters must to be non-nul values because otherwise necessary ReportRegion.regionPropertiesRootNode field value will be null.protected BandDefinition
createRootBand
(Report report) protected FetchPlanBuilder
ensureParentFetchPlansExist
(EntityTreeNode entityTreeNode, Map<EntityTreeNode, FetchPlanBuilder> fetchPlansForNodes) Search for fetch plan for parent node If does not exists - createDataSet it and add property to parent of parent fetch planbyte[]
generateTemplate
(ReportData reportData, TemplateFileType templateFileType) getEffectiveEntities
(List<String> entitiesList) boolean
isEntityAllowedForReportWizard
(MetaClass effectiveMetaClass) boolean
isPropertyAllowedForReportWizard
(MetaClass metaClass, MetaProperty metaProperty) protected void
iterateFetchPlanAndCreatePropertiesForRegion
(boolean scalarOnly, FetchPlan parentFetchPlan, Map<String, EntityTreeNode> allNodesAndHierarchicalPathsMap, List<RegionProperty> regionProperties, String pathFromParentFetchPlan, long propertyOrderNum) protected void
nodesToMap
(EntityTreeNode node, Map<String, EntityTreeNode> allNodesAndHierarchicalPathsMap) toReport
(ReportData reportData, boolean temporary)
-
Field Details
-
ROOT_BAND_DEFINITION_NAME
- See Also:
-
DEFAULT_SINGLE_ENTITY_NAME
- See Also:
-
DEFAULT_LIST_OF_ENTITIES_NAME
- See Also:
-
DEFAULT_SINGLE_ENTITY_ALIAS
- See Also:
-
DEFAULT_LIST_OF_ENTITIES_ALIAS
- See Also:
-
metadata
-
reportsPersistence
-
reportsUtils
-
reportsSerialization
-
reportsProperties
-
extendedEntities
-
dataSetFactory
-
messages
-
metadataTools
-
templateGenerator
-
entityTreeModelBuilderApiProvider
-
fetchPlans
-
-
Constructor Details
-
ReportWizard
public ReportWizard()
-
-
Method Details
-
toReport
-
createBands
protected Set<BandDefinition> createBands(Report report, BandDefinition rootReportBandDefinition, ReportData reportData, ReportInputParameter mainParameter) -
createParameters
-
createReport
-
createJpqlDataSet
protected void createJpqlDataSet(ReportData reportData, ReportRegion reportRegion, BandDefinition dataBand) -
createEntityDataSet
protected void createEntityDataSet(ReportData reportData, ReportRegion reportRegion, BandDefinition dataBand, ReportInputParameter mainParameter, FetchPlan parameterFetchPlan) -
createRootBand
-
createMainInputParameter
-
createParameter
-
createDefaultTemplate
-
createDataBand
protected BandDefinition createDataBand(Report report, BandDefinition rootBandDefinition, String name, int bandDefPos) -
createDefaultFormats
protected void createDefaultFormats(Report report, ReportData reportData, ReportRegion reportRegion) -
createHeaderBand
protected BandDefinition createHeaderBand(Report report, BandDefinition rootReportBandDefinition, int bandDefPos, ReportRegion reportRegion) -
createFetchPlanByReportRegions
public FetchPlan createFetchPlanByReportRegions(EntityTreeNode entityTreeRootNode, List<ReportRegion> reportRegions) -
createReportRegionByFetchPlan
public ReportRegion createReportRegionByFetchPlan(EntityTree entityTree, boolean isTabulated, @Nullable FetchPlan fetchPlan, @Nullable String collectionPropertyName) Create report region using fetch plan and whole entity model as entityTree param For creating tabulated report region for collection of entity (when used # in alias of dataset) fetch plan and parameters must to be non-nul values because otherwise necessary ReportRegion.regionPropertiesRootNode field value will be null. That value is determined by that fetch plan.- Parameters:
entityTree
- the whole entity tree modelisTabulated
- determine which region will be createdfetchPlan
- by that fetch plan the region will be createdcollectionPropertyName
- must to be non-null for a tabulated region- Returns:
- report region
-
ensureParentFetchPlansExist
@Nullable protected FetchPlanBuilder ensureParentFetchPlansExist(EntityTreeNode entityTreeNode, Map<EntityTreeNode, FetchPlanBuilder> fetchPlansForNodes) Search for fetch plan for parent node If does not exists - createDataSet it and add property to parent of parent fetch plan- Parameters:
entityTreeNode
- entity tree nodefetchPlansForNodes
- fetch plans for previous nodes- Returns:
- fetch plan builder
-
iterateFetchPlanAndCreatePropertiesForRegion
protected void iterateFetchPlanAndCreatePropertiesForRegion(boolean scalarOnly, FetchPlan parentFetchPlan, Map<String, EntityTreeNode> allNodesAndHierarchicalPathsMap, List<RegionProperty> regionProperties, @Nullable String pathFromParentFetchPlan, long propertyOrderNum) -
nodesToMap
protected void nodesToMap(EntityTreeNode node, Map<String, EntityTreeNode> allNodesAndHierarchicalPathsMap) -
isEntityAllowedForReportWizard
-
isPropertyAllowedForReportWizard
-
generateTemplate
public byte[] generateTemplate(ReportData reportData, TemplateFileType templateFileType) throws TemplateGenerationException - Throws:
TemplateGenerationException
-
buildEntityTree
-
getWizardBlackListedEntities
-
getWizardWhiteListedEntities
-
getEffectiveEntities
-
getWizardBlackListedProperties
-
getWizardPropertiesExcludedBlackList
-