Class DefaultProcessingContext
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.layout.output.DefaultProcessingContext
-
- All Implemented Interfaces:
ProcessingContext
public class DefaultProcessingContext extends Object implements ProcessingContext
-
-
Constructor Summary
Constructors Constructor Description DefaultProcessingContext()
This constructor exists for test-case use only.DefaultProcessingContext(OutputProcessorMetaData outputProcessorMetaData, ResourceBundleFactory resourceBundleFactory, org.pentaho.reporting.libraries.base.config.Configuration configuration, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager, org.pentaho.reporting.libraries.resourceloader.ResourceKey contentBase, org.pentaho.reporting.libraries.docbundle.DocumentMetaData metaData, ReportEnvironment environment, int compatibilityLevel)
DefaultProcessingContext(MasterReport report)
DefaultProcessingContext(MasterReport report, OutputProcessorMetaData metaData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCompatibilityLevel()
org.pentaho.reporting.libraries.base.config.Configuration
getConfiguration()
Returns the initial master-report's configuration.org.pentaho.reporting.libraries.resourceloader.ResourceKey
getContentBase()
Returns the content base of the initial master-report.org.pentaho.reporting.libraries.docbundle.DocumentMetaData
getDocumentMetaData()
Returns the outermost master-report's document meta-data.ReportEnvironment
getEnvironment()
String
getExportDescriptor()
Returns the export descriptor from the output-target.org.pentaho.reporting.libraries.formula.FormulaContext
getFormulaContext()
Returns the formula context of this report process.OutputProcessorMetaData
getOutputProcessorMetaData()
int
getProcessingLevel()
The processing-level is used for dependency tracking.int
getProgressLevel()
Returns the current progress level.int
getProgressLevelCount()
Returns the total number of different activities the report will process.long
getReportProcessingStartTime()
ResourceBundleFactory
getResourceBundleFactory()
The resource-bundle factory encapsulates all locale specific resources and provides a system-independent way to create Resource-Bundles.org.pentaho.reporting.libraries.resourceloader.ResourceManager
getResourceManager()
Returns the initial master-report's resource manager.boolean
isPrepareRun()
Returns true, if the current processing run is a prepare-run.protected void
setOutputProcessorMetaData(OutputProcessorMetaData outputProcessorMetaData)
void
setPrepareRun(boolean prepareRun)
void
setProcessingLevel(int processingLevel)
void
setProgressLevel(int progressLevel)
void
setProgressLevelCount(int progressLevelCount)
-
-
-
Constructor Detail
-
DefaultProcessingContext
public DefaultProcessingContext()
This constructor exists for test-case use only. If you use this to process a real report, most of the settings of the report will be ignored and your export will not work as expected.
-
DefaultProcessingContext
public DefaultProcessingContext(MasterReport report) throws ReportProcessingException
- Throws:
ReportProcessingException
-
DefaultProcessingContext
public DefaultProcessingContext(MasterReport report, OutputProcessorMetaData metaData) throws ReportProcessingException
- Throws:
ReportProcessingException
-
DefaultProcessingContext
public DefaultProcessingContext(OutputProcessorMetaData outputProcessorMetaData, ResourceBundleFactory resourceBundleFactory, org.pentaho.reporting.libraries.base.config.Configuration configuration, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager, org.pentaho.reporting.libraries.resourceloader.ResourceKey contentBase, org.pentaho.reporting.libraries.docbundle.DocumentMetaData metaData, ReportEnvironment environment, int compatibilityLevel) throws ReportProcessingException
- Parameters:
outputProcessorMetaData
-resourceBundleFactory
-configuration
-resourceManager
-contentBase
- the content base, from where to load additional resources. (Can be null).metaData
-- Throws:
ReportProcessingException
-
-
Method Detail
-
getResourceManager
public org.pentaho.reporting.libraries.resourceloader.ResourceManager getResourceManager()
Description copied from interface:ProcessingContext
Returns the initial master-report's resource manager. The resource manager can be used to load external resources in a system-independent way.- Specified by:
getResourceManager
in interfaceProcessingContext
- Returns:
- the master-report's resourcemanager.
-
getContentBase
public org.pentaho.reporting.libraries.resourceloader.ResourceKey getContentBase()
Description copied from interface:ProcessingContext
Returns the content base of the initial master-report. The content-base resource-key can be used to resolve relative paths.- Specified by:
getContentBase
in interfaceProcessingContext
- Returns:
- the initial content base or null, if there is no content-base.
-
getProgressLevel
public int getProgressLevel()
Description copied from interface:ProcessingContext
Returns the current progress level. The number itself has no meaning and is only used to measure the progress of the report processing.- Specified by:
getProgressLevel
in interfaceProcessingContext
- Returns:
- the progress level.
-
setProgressLevel
public void setProgressLevel(int progressLevel)
-
getProgressLevelCount
public int getProgressLevelCount()
Description copied from interface:ProcessingContext
Returns the total number of different activities the report will process.- Specified by:
getProgressLevelCount
in interfaceProcessingContext
- Returns:
- the number of different progress levels.
-
setProgressLevelCount
public void setProgressLevelCount(int progressLevelCount)
-
setProcessingLevel
public void setProcessingLevel(int processingLevel)
-
getProcessingLevel
public int getProcessingLevel()
Description copied from interface:ProcessingContext
The processing-level is used for dependency tracking. A function that precomputes values should use this level value to determine its current activity.- Specified by:
getProcessingLevel
in interfaceProcessingContext
- Returns:
- the processing level.
- See Also:
Expression.getDependencyLevel()
-
getFormulaContext
public org.pentaho.reporting.libraries.formula.FormulaContext getFormulaContext()
Description copied from interface:ProcessingContext
Returns the formula context of this report process. The formula context is required to evaluate inline expression with LibFormula.- Specified by:
getFormulaContext
in interfaceProcessingContext
- Returns:
- the current formula context.
-
setPrepareRun
public void setPrepareRun(boolean prepareRun)
-
isPrepareRun
public boolean isPrepareRun()
Description copied from interface:ProcessingContext
Returns true, if the current processing run is a prepare-run. A prepare run does not generate content, but will be needed to compute the layout. This flag can be used to possibly optimize the content computation. If in doubt on how to interpret the flag, then please ignore this flag. The process may be slightly slower, but at least it will work all the time.- Specified by:
isPrepareRun
in interfaceProcessingContext
- Returns:
- true, if this is a prepare-run, false if this is a content processing run.
-
getExportDescriptor
public String getExportDescriptor()
Description copied from interface:ProcessingContext
Returns the export descriptor from the output-target.- Specified by:
getExportDescriptor
in interfaceProcessingContext
- Returns:
- the export descriptor string.
- See Also:
OutputProcessorMetaData.getExportDescriptor()
-
getOutputProcessorMetaData
public OutputProcessorMetaData getOutputProcessorMetaData()
- Specified by:
getOutputProcessorMetaData
in interfaceProcessingContext
-
setOutputProcessorMetaData
protected void setOutputProcessorMetaData(OutputProcessorMetaData outputProcessorMetaData)
-
getResourceBundleFactory
public ResourceBundleFactory getResourceBundleFactory()
Description copied from interface:ProcessingContext
The resource-bundle factory encapsulates all locale specific resources and provides a system-independent way to create Resource-Bundles. This returns the initial master-report's resource-bundle factory.- Specified by:
getResourceBundleFactory
in interfaceProcessingContext
- Returns:
- the report's resource-bundle factory.
-
getConfiguration
public org.pentaho.reporting.libraries.base.config.Configuration getConfiguration()
Description copied from interface:ProcessingContext
Returns the initial master-report's configuration. The initial configuration is used for all subreports.- Specified by:
getConfiguration
in interfaceProcessingContext
- Returns:
- the global report configuration.
-
getDocumentMetaData
public org.pentaho.reporting.libraries.docbundle.DocumentMetaData getDocumentMetaData()
Returns the outermost master-report's document meta-data.- Specified by:
getDocumentMetaData
in interfaceProcessingContext
- Returns:
- the document meta-data.
-
getEnvironment
public ReportEnvironment getEnvironment()
- Specified by:
getEnvironment
in interfaceProcessingContext
-
getReportProcessingStartTime
public long getReportProcessingStartTime()
- Specified by:
getReportProcessingStartTime
in interfaceProcessingContext
-
getCompatibilityLevel
public int getCompatibilityLevel()
- Specified by:
getCompatibilityLevel
in interfaceProcessingContext
-
-