public static void resetTemplate( final MasterReport report ) { resetDocumentMetaData( report ); report.setContentBase( null ); }
protected Object finishResult( final Object res, final ResourceManager manager, final ResourceData data, final ResourceKey context ) throws ResourceCreationException, ResourceLoadingException { final MasterReport report = (MasterReport) res; if ( report == null ) { throw new ResourceCreationException( "Report has not been parsed." ); } if ( context != null ) { report.setContentBase( context ); } else { report.setContentBase( data.getKey() ); } report.setDefinitionSource( data.getKey() ); report.setResourceManager( manager ); report.updateLegacyConfiguration(); return report; }
final DocumentBundle newDocumentBundle = (DocumentBundle) value; final ResourceManager resourceManager = newDocumentBundle.getResourceManager(); report.setContentBase( newDocumentBundle.getBundleKey() ); report.setResourceManager( resourceManager );
/** * The default constructor. Creates an empty but fully initialized report. */ public MasterReport() { setElementType( new MasterReportType() ); setResourceBundleFactory( new LibLoaderResourceBundleFactory() ); this.reportConfiguration = new HierarchicalConfiguration( ClassicEngineBoot.getInstance().getGlobalConfig() ); this.parameterValues = new ReportParameterValues(); setPageDefinition( null ); final TableDataFactory dataFactory = new TableDataFactory(); dataFactory.addTable( "default", new DefaultTableModel() ); this.dataFactory = dataFactory; setQuery( "default" ); // Add a listener that will handle keeping the ResourceManager in sync with changes to the Document Bundle addReportModelListener( new DocumentBundleChangeHandler() ); this.reportEnvironment = new DefaultReportEnvironment( getConfiguration() ); this.parameterDefinition = new DefaultParameterDefinition(); final MemoryDocumentBundle documentBundle = new MemoryDocumentBundle(); documentBundle.getWriteableDocumentMetaData().setBundleType( ClassicEngineBoot.BUNDLE_TYPE ); documentBundle.getWriteableDocumentMetaData().setBundleAttribute( ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.CREATION_DATE, new Date() ); setBundle( documentBundle ); setContentBase( documentBundle.getBundleMainKey() ); addReportModelListener( new ResourceBundleChangeHandler() ); updateResourceBundleFactoryInternal(); }