public MasterReport invokePreDataProcessing( final MasterReport report ) throws ReportProcessingException { flowController = startFlowController; processors = StateUtilities.getAllPreProcessors( report, designtime ); DataSchemaDefinition fullDefinition = report.getDataSchemaDefinition(); MasterReport fullReport = report; for ( int i = 0; i < processors.length; i++ ) { final ReportPreProcessor processor = processors[i]; fullReport = processor.performPreDataProcessing( fullReport, flowController ); if ( fullReport.getDataSchemaDefinition() != fullDefinition ) { fullDefinition = fullReport.getDataSchemaDefinition(); flowController = flowController.updateDataSchema( fullDefinition ); } } return fullReport; }
public MasterReport invokePreProcessing( final MasterReport report ) throws ReportProcessingException { flowController = startFlowController; processors = StateUtilities.getAllPreProcessors( report, designtime ); DataSchemaDefinition fullDefinition = report.getDataSchemaDefinition(); MasterReport fullReport = report; for ( int i = 0; i < processors.length; i++ ) { final ReportPreProcessor processor = processors[i]; fullReport = processor.performPreProcessing( fullReport, flowController ); if ( fullReport.getDataSchemaDefinition() != fullDefinition ) { fullDefinition = fullReport.getDataSchemaDefinition(); flowController = flowController.updateDataSchema( fullDefinition ); } } return fullReport; } }
protected DataSchemaDefinition createDataSchemaDefinition( final MasterReport masterReportElement ) { DataSchemaDefinition dataSchemaDefinition = masterReportElement.getDataSchemaDefinition(); if ( dataSchemaDefinition == null ) { return DataSchemaUtility.parseDefaults( masterReportElement.getResourceManager() ); } return dataSchemaDefinition; }
new BufferedOutputStream( bundle.createEntry( contentState.getFileName(), "text/xml" ) ); final MasterReport report = state.getMasterReport(); final DataSchemaDefinition definition = report.getDataSchemaDefinition();
protected MasterReport materializePreData( MasterReport report, ReportPreProcessor reportPreProcessor ) throws ReportProcessingException { final PerformanceMonitorContext pmc = new NoOpPerformanceMonitorContext(); final DefaultProcessingContext processingContext = new DefaultProcessingContext( report ); final DataSchemaDefinition definition = report.getDataSchemaDefinition(); final DefaultFlowController flowController = new DefaultFlowController( processingContext, definition, StateUtilities.computeParameterValueSet( report ), pmc ); return reportPreProcessor.performPreDataProcessing( report, flowController ); } }
/** * Helper method to invoke a pre-processor outside of the report processing. This is strictly for unit-testing only. * * @param report * @param processor * @return * @throws org.pentaho.reporting.engine.classic.core.ReportProcessingException */ protected MasterReport materialize( final MasterReport report, final ReportPreProcessor processor ) throws ReportProcessingException { final PerformanceMonitorContext pmc = new NoOpPerformanceMonitorContext(); final DefaultProcessingContext processingContext = new DefaultProcessingContext( report ); final DataSchemaDefinition definition = report.getDataSchemaDefinition(); final DefaultFlowController flowController = new DefaultFlowController( processingContext, definition, StateUtilities.computeParameterValueSet( report ), pmc ); final CachingDataFactory dataFactory = new CachingDataFactory( report.getDataFactory(), false ); dataFactory.initialize( new ProcessingDataFactoryContext( processingContext, dataFactory ) ); try { final DefaultFlowController postQueryFlowController = flowController.performQuery( dataFactory, report.getQuery(), report.getQueryLimit(), report.getQueryTimeout(), flowController.getMasterRow().getResourceBundleFactory(), Collections.<SortConstraint>emptyList() ); return processor.performPreProcessing( report, postQueryFlowController ); } finally { dataFactory.close(); } }
new DefaultFlowController( processingContext, report.getDataSchemaDefinition(), StateUtilities.computeParameterValueSet( report, parameterValues ), performanceMonitorContext );