public Locale getLocale() { final MasterReport report = getReportJob(); if ( report != null ) { final Locale bundleLocale = report.getResourceBundleFactory().getLocale(); if ( bundleLocale != null ) { return bundleLocale; } return report.getReportEnvironment().getLocale(); } return Locale.getDefault(); }
public Locale getLocale() { final MasterReport report = getReportJob(); if ( report != null ) { final Locale bundleLocale = report.getResourceBundleFactory().getLocale(); if ( bundleLocale != null ) { return bundleLocale; } return report.getReportEnvironment().getLocale(); } return Locale.getDefault(); }
public DesignTimeDataFactoryContext( final MasterReport report ) { this( report.getConfiguration(), report.getResourceManager(), report.getContentBase(), MasterReport .computeAndInitResourceBundleFactory( report.getResourceBundleFactory(), report.getReportEnvironment() ), report.getDataFactory() ); }
public static ReportParameterValues computeParameterValueSet( final MasterReport report, final ReportParameterValues parameterValues ) throws ReportProcessingException { final ReportParameterValues retval = new ReportParameterValues(); retval.putAll( parameterValues ); final Configuration config = report.getConfiguration(); if ( "true".equals( config .getConfigProperty( "org.pentaho.reporting.engine.classic.core.legacy.ReportNameAsProperty" ) ) ) { retval.put( "report.name", report.getName() ); } final ReportEnvironment reportEnvironment = report.getReportEnvironment(); final Object property = reportEnvironment.getEnvironmentProperty( "::internal::report.date" ); if ( property instanceof Date == false ) { retval.put( MasterReport.REPORT_DATE_PROPERTY, new Date() ); } else { retval.put( MasterReport.REPORT_DATE_PROPERTY, property ); } return retval; }
public DefaultParameterContext( final MasterReport report, final ReportParameterValues parameterValues ) throws ReportProcessingException { if ( report == null ) { throw new NullPointerException( "Report parameter must not be null" ); } if ( parameterValues == null ) { throw new NullPointerException( "ParameterValues parameter must not be null" ); } this.configuration = report.getConfiguration(); this.resourceBundleFactory = MasterReport.computeAndInitResourceBundleFactory( report.getResourceBundleFactory(), report .getReportEnvironment() ); this.contentBase = report.getContentBase(); this.resourceManager = report.getResourceManager(); this.reportEnvironment = report.getReportEnvironment(); final Object dataCacheEnabledRaw = report.getAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.DATA_CACHE ); final boolean dataCacheEnabled = Boolean.FALSE.equals( dataCacheEnabledRaw ) == false; this.dataFactory = new CachingDataFactory( report.getDataFactory(), dataCacheEnabled ); final DocumentBundle bundle = report.getBundle(); if ( bundle != null ) { this.documentMetaData = bundle.getMetaData(); } this.dataFactory.initialize( new DesignTimeDataFactoryContext( configuration, resourceManager, contentBase, resourceBundleFactory, dataFactory ) ); final ReportEnvironmentDataRow envDataRow = new ReportEnvironmentDataRow( reportEnvironment ); this.parameterValues = new CompoundDataRow( envDataRow, parameterValues ); }
public DefaultProcessingContext( final MasterReport report, final OutputProcessorMetaData metaData ) throws ReportProcessingException { this( metaData, report.getResourceBundleFactory(), report.getConfiguration(), report.getResourceManager(), report .getContentBase(), report.getBundle().getMetaData(), report.getReportEnvironment(), -1 ); final Integer comLev = report.getCompatibilityLevel(); if ( comLev != null ) { compatibilityLevel = comLev; } }
protected DefaultProcessingContext createProcessingContext() throws ReportProcessingException { final OutputProcessorMetaData metaData = getOutputProcessorMetaData(); final MasterReport report = getReport(); final DocumentMetaData documentMetaData; final DocumentBundle bundle = report.getBundle(); if ( bundle != null ) { documentMetaData = bundle.getMetaData(); } else { documentMetaData = new MemoryDocumentMetaData(); } final Integer compatibilityLevel = report.getCompatibilityLevel(); final int cLevel; if ( compatibilityLevel == null ) { cLevel = -1; } else { cLevel = compatibilityLevel; } return new DefaultProcessingContext( metaData, report.getResourceBundleFactory(), report.getConfiguration(), report .getResourceManager(), report.getContentBase(), documentMetaData, report.getReportEnvironment(), cLevel ); }
this.resourceBundleFactory = MasterReport.computeAndInitResourceBundleFactory( report.getResourceBundleFactory(), report .getReportEnvironment() ); this.reportEnvironment = report.getReportEnvironment(); this.configuration = report.getConfiguration(); final ReportEnvironmentDataRow envDataRow = new ReportEnvironmentDataRow( reportEnvironment );
final DataSchema dataSchema = dataSchemaCompiler.compile( reportData, expressions, parameterRow, parameterDefinitions, masterReport .getReportEnvironment() ); final DataSchema dataSchema = dataSchemaCompiler.compile( reportData, expressions, parameterRow, parameterDefinitions, getMasterReportElement().getReportEnvironment() ); this.dataFactoryException = e; return dataSchema;
contentBase = masterReport.getContentBase(); configuration = masterReport.getConfiguration(); reportEnvironment = masterReport.getReportEnvironment(); reportDataFactory = masterReport.getDataFactory(); resourceManager = masterReport.getResourceManager();