private void updateResourceBundleFactoryInternal() { if ( resourceBundleFactory instanceof ExtendedResourceBundleFactory ) { final ExtendedResourceBundleFactory erbf = (ExtendedResourceBundleFactory) resourceBundleFactory; erbf.setResourceLoader( getResourceManager(), getContentBase() ); } }
public static boolean isEmbeddedKey( final MasterReport report, final ResourceKey resourceKey ) { final ResourceKey contentBase = report.getContentBase(); if ( contentBase == null ) { return false; } ResourceKey bundleKey = contentBase.getParent(); while ( bundleKey != null ) { if ( bundleKey.equals( resourceKey.getParent() ) ) { return true; } bundleKey = bundleKey.getParent(); } return false; }
/** * Builds a default configuration from a given report definition object. * <p/> * This will only create a valid definition, if the report has a valid content base object set. * * @param report * the report for which to create the writer configuration. * @return the generated configuration. */ public static Configuration createDefaultConfiguration( final MasterReport report ) { final ModifiableConfiguration repConf = new HierarchicalConfiguration( report.getReportConfiguration() ); final ResourceKey contentBase = report.getContentBase(); if ( contentBase != null ) { final ResourceManager resourceManager = report.getResourceManager(); final URL value = resourceManager.toURL( contentBase ); if ( value != null ) { repConf.setConfigProperty( AbstractXmlResourceFactory.CONTENTBASE_KEY, value.toExternalForm() ); } } return repConf; }
public DesignTimeDataFactoryContext( final MasterReport report ) { this( report.getConfiguration(), report.getResourceManager(), report.getContentBase(), MasterReport .computeAndInitResourceBundleFactory( report.getResourceBundleFactory(), report.getReportEnvironment() ), report.getDataFactory() ); }
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; } }
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 ); }
final DocumentBundle bundle = (DocumentBundle) bundleResource.getResource(); final MemoryDocumentBundle mem = new MemoryDocumentBundle( getContentBase() ); BundleUtilities.copyStickyInto( mem, bundle ); BundleUtilities.copyInto( mem, bundle, LegacyBundleResourceRegistry.getInstance().getRegisteredFiles(), true );
if ( resourceBundleFactory instanceof LibLoaderResourceBundleFactory ) { LibLoaderResourceBundleFactory ll = (LibLoaderResourceBundleFactory) resourceBundleFactory; ll.setResourceLoader( mgr, report.getContentBase() );
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 ); }
resourceBundleFactory = new LibLoaderResourceBundleFactory(); } else { contentBase = masterReport.getContentBase(); configuration = masterReport.getConfiguration(); reportEnvironment = masterReport.getReportEnvironment();
} else { this.resourceManager = report.getResourceManager(); this.contentBase = report.getContentBase(); final Object dataCacheEnabledRaw = report.getAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.DATA_CACHE );