@Test public void testPrepareMasterReport() { MasterReport masterReport = NewReportAction.prepareMasterReport(); assertTrue( masterReport.getAutoSort() ); assertNull( masterReport.getQuery() ); assertTrue( masterReport.isQueryLimitInherited() ); assertTrue( (Boolean) masterReport.getRelationalGroup( 0 ).getHeader().getAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE ) ); assertTrue( (Boolean) masterReport.getRelationalGroup( 0 ).getFooter().getAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE ) ); assertTrue( (Boolean) masterReport.getDetailsFooter().getAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE ) ); assertTrue( (Boolean) masterReport.getDetailsHeader().getAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE ) ); assertTrue( (Boolean) masterReport.getNoDataBand().getAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE ) ); assertTrue( (Boolean) masterReport.getWatermark().getAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE ) ); }
public static MasterReport prepareMasterReport() { final MasterReport report = new MasterReport(); report.setAutoSort( Boolean.TRUE ); report.setDataFactory( new CompoundDataFactory() ); report.setQuery( null ); report.setQueryLimitInheritance( Boolean.TRUE ); report.getRelationalGroup( 0 ).getHeader() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getRelationalGroup( 0 ).getFooter() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getDetailsFooter() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getDetailsHeader() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getNoDataBand() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getWatermark() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); try { final MemoryDocumentBundle bundle = (MemoryDocumentBundle) report.getBundle(); if ( bundle.isEntryExists( TRANSLATIONS_PROPERTIES ) == false ) { final String defaultMessage = ActionMessages.getString( "Translations.DefaultContent" ); final OutputStream outputStream = bundle.createEntry( TRANSLATIONS_PROPERTIES, "text/plain" ); outputStream.write( defaultMessage.getBytes( "ISO-8859-1" ) ); outputStream.close(); bundle.getWriteableDocumentMetaData() .setEntryAttribute( TRANSLATIONS_PROPERTIES, BundleUtilities.STICKY_FLAG, "true" ); } } catch ( Exception ex ) { DebugLog.log( "Failed to created default translation entry", ex ); } return report; }
NewReportAction extends AbstractDesignerContextAction { public static MasterReport prepareMasterReport() { final MasterReport report = new MasterReport(); report.setAutoSort( Boolean.TRUE ); report.setDataFactory( new CompoundDataFactory() ); report.setQuery( null ); report.setQueryLimitInheritance( Boolean.TRUE ); report.getRelationalGroup( 0 ).getHeader() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getRelationalGroup( 0 ).getFooter() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getDetailsFooter() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getDetailsHeader() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getNoDataBand() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getWatermark() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); try { final MemoryDocumentBundle bundle = (MemoryDocumentBundle) report.getBundle(); if ( bundle.isEntryExists( TRANSLATIONS_PROPERTIES ) == false ) { final String defaultMessage = ActionMessages.getString( "Translations.DefaultContent" ); final OutputStream outputStream = bundle.createEntry( TRANSLATIONS_PROPERTIES, "text/plain" ); outputStream.write( defaultMessage.getBytes( "ISO-8859-1" ) ); outputStream.close(); bundle.getWriteableDocumentMetaData() .setEntryAttribute( TRANSLATIONS_PROPERTIES, BundleUtilities.STICKY_FLAG, "true" ); } } catch ( Exception ex ) { DebugLog.log( "Failed to created default translation entry", ex ); } return report; } }
NewReportAction extends AbstractDesignerContextAction { public static MasterReport prepareMasterReport() { final MasterReport report = new MasterReport(); report.setAutoSort( Boolean.TRUE ); report.setDataFactory( new CompoundDataFactory() ); report.setQuery( null ); report.setQueryLimitInheritance( Boolean.TRUE ); report.getRelationalGroup( 0 ).getHeader() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getRelationalGroup( 0 ).getFooter() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getDetailsFooter() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getDetailsHeader() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getNoDataBand() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getWatermark() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); try { final MemoryDocumentBundle bundle = (MemoryDocumentBundle) report.getBundle(); if ( bundle.isEntryExists( TRANSLATIONS_PROPERTIES ) == false ) { final String defaultMessage = ActionMessages.getString( "Translations.DefaultContent" ); final OutputStream outputStream = bundle.createEntry( TRANSLATIONS_PROPERTIES, "text/plain" ); outputStream.write( defaultMessage.getBytes( "ISO-8859-1" ) ); outputStream.close(); bundle.getWriteableDocumentMetaData() .setEntryAttribute( TRANSLATIONS_PROPERTIES, BundleUtilities.STICKY_FLAG, "true" ); } } catch ( Exception ex ) { DebugLog.log( "Failed to created default translation entry", ex ); } return report; } NewReportAction(); }
NewReportAction extends AbstractDesignerContextAction { public static MasterReport prepareMasterReport() { final MasterReport report = new MasterReport(); report.setAutoSort( Boolean.TRUE ); report.setDataFactory( new CompoundDataFactory() ); report.setQuery( null ); report.setQueryLimitInheritance( Boolean.TRUE ); report.getRelationalGroup( 0 ).getHeader() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getRelationalGroup( 0 ).getFooter() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getDetailsFooter() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getDetailsHeader() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getNoDataBand() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getWatermark() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); try { final MemoryDocumentBundle bundle = (MemoryDocumentBundle) report.getBundle(); if ( bundle.isEntryExists( TRANSLATIONS_PROPERTIES ) == false ) { final String defaultMessage = ActionMessages.getString( "Translations.DefaultContent" ); final OutputStream outputStream = bundle.createEntry( TRANSLATIONS_PROPERTIES, "text/plain" ); outputStream.write( defaultMessage.getBytes( "ISO-8859-1" ) ); outputStream.close(); bundle.getWriteableDocumentMetaData() .setEntryAttribute( TRANSLATIONS_PROPERTIES, BundleUtilities.STICKY_FLAG, "true" ); } } catch ( Exception ex ) { DebugLog.log( "Failed to created default translation entry", ex ); } return report; } NewReportAction(); void actionPerformed( final ActionEvent e ); static MasterReport prepareMasterReport(); }
NewReportAction extends AbstractDesignerContextAction { public static MasterReport prepareMasterReport() { final MasterReport report = new MasterReport(); report.setAutoSort( Boolean.TRUE ); report.setDataFactory( new CompoundDataFactory() ); report.setQuery( null ); report.setQueryLimitInheritance( Boolean.TRUE ); report.getRelationalGroup( 0 ).getHeader() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getRelationalGroup( 0 ).getFooter() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getDetailsFooter() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getDetailsHeader() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getNoDataBand() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); report.getWatermark() .setAttribute( ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE ); try { final MemoryDocumentBundle bundle = (MemoryDocumentBundle) report.getBundle(); if ( bundle.isEntryExists( TRANSLATIONS_PROPERTIES ) == false ) { final String defaultMessage = ActionMessages.getString( "Translations.DefaultContent" ); final OutputStream outputStream = bundle.createEntry( TRANSLATIONS_PROPERTIES, "text/plain" ); outputStream.write( defaultMessage.getBytes( "ISO-8859-1" ) ); outputStream.close(); bundle.getWriteableDocumentMetaData() .setEntryAttribute( TRANSLATIONS_PROPERTIES, BundleUtilities.STICKY_FLAG, "true" ); } } catch ( Exception ex ) { DebugLog.log( "Failed to created default translation entry", ex ); } return report; } NewReportAction(); void actionPerformed( final ActionEvent e ); static MasterReport prepareMasterReport();  }