protected ReportProcessor createReportProcessor( OutputStream fout ) throws Exception { final FlowHtmlOutputProcessor outputProcessor = new FlowHtmlOutputProcessor(); final HtmlPrinter printer = new AllItemsHtmlPrinter( report.getResourceManager() ); printer.setContentWriter( targetRoot, new DefaultNameGenerator( targetRoot, filename, suffix ) ); printer.setDataWriter( targetRoot, new DefaultNameGenerator( targetRoot, "content" ) ); printer.setUrlRewriter( new FileSystemURLRewriter() ); outputProcessor.setPrinter( printer ); return new FlowReportProcessor( report, outputProcessor ); } };
protected ReportProcessor createReportProcessor( OutputStream fout ) throws Exception { ReportStructureValidator validator = new ReportStructureValidator(); if ( validator.isValidForFastProcessing( report ) == false ) { final HtmlOutputProcessor outputProcessor = new StreamHtmlOutputProcessor( report.getConfiguration() ); final HtmlPrinter printer = new AllItemsHtmlPrinter( report.getResourceManager() ); printer.setContentWriter( targetRoot, new DefaultNameGenerator( targetRoot, filename, suffix ) ); printer.setDataWriter( null, null ); // $NON-NLS-1$ printer.setUrlRewriter( new FileSystemURLRewriter() ); outputProcessor.setPrinter( printer ); return new StreamReportProcessor( report, outputProcessor ); } else { FastHtmlContentItems printer = new FastHtmlContentItems(); printer.setContentWriter( targetRoot, new DefaultNameGenerator( targetRoot, filename, suffix ) ); printer.setDataWriter( null, null ); // $NON-NLS-1$ printer.setUrlRewriter( new FileSystemURLRewriter() ); return new FastHtmlExportProcessor( report, printer ); } } };
public void render() throws Exception { createReport(); ClassLoader originalClassloader = Thread.currentThread().getContextClassLoader(); try { // we need to change the current classloader for the reporting to find our plugin classes Thread.currentThread().setContextClassLoader( KettleReportBuilder.class.getClassLoader() ); switch ( options.getOutputType() ) { case PDF: PdfReportUtil.createPDF( report, targetFilename ); break; case DOC: RTFReportUtil.createRTF( report, targetFilename ); break; case XLS: ExcelReportUtil.createXLS( report, targetFilename ); break; case HTML: HtmlReportUtil.createDirectoryHTML( report, targetFilename ); break; case CSV: CSVReportUtil.createCSV( report, targetFilename ); break; default: break; } } finally { Thread.currentThread().setContextClassLoader( originalClassloader ); } }
protected HtmlOutputProcessor createOutputProcessor() { if ( "pageable".equals( exportMethod ) ) { //$NON-NLS-1$ return new PageableHtmlOutputProcessor( report.getConfiguration() ); } else if ( "flow".equals( exportMethod ) ) { //$NON-NLS-1$ return new FlowHtmlOutputProcessor(); } else { return new StreamHtmlOutputProcessor( report.getConfiguration() ); } } }
protected void processTableContent( final LogicalPageKey logicalPageKey, final LogicalPageBox logicalPage, final TableContentProducer contentProducer ) throws ContentProcessingException { if ( printer == null ) { return; } printer.print( logicalPageKey, logicalPage, contentProducer, metaData, false ); }
protected HtmlPrinter( final ResourceManager resourceManager ) { super( resourceManager ); assumeZeroMargins = true; assumeZeroBorders = true; assumeZeroPaddings = true; // this primitive implementation assumes that the both repositories are // the same .. urlRewriter = new FileSystemURLRewriter(); }
protected void processingContentFinished() { if ( isContentGeneratable() == false ) { return; } this.metaData.commit(); } }
public String rewriteContentDataItem( final ContentItem item ) throws URLRewriteException { return urlRewriter.rewrite( documentContentItem, item ); }
/** * DefaultConstructor. Loads the module specification. * * @throws org.pentaho.reporting.libraries.base.boot.ModuleInitializeException * if an error occured. */ public HtmlTableModule() throws ModuleInitializeException { loadModuleInfo(); }
public SingleItemHtmlPrinter( final ResourceManager resourceManager, final ContentItem documentContentItem ) { super( resourceManager ); if ( documentContentItem == null ) { throw new NullPointerException(); } setDocumentContentItem( documentContentItem ); }
protected void processingContentFinished() { if ( isContentGeneratable() == false ) { return; } this.metaData.commit(); }
protected void processingContentFinished() { if ( isContentGeneratable() == false ) { return; } this.metaData.commit(); } }
protected HtmlOutputProcessor createOutputProcessor() { if ( "pageable".equals( exportMethod ) ) { //$NON-NLS-1$ return new PageableHtmlOutputProcessor( report.getConfiguration() ); } else if ( "flow".equals( exportMethod ) ) { //$NON-NLS-1$ return new FlowHtmlOutputProcessor(); } else { return new StreamHtmlOutputProcessor( report.getConfiguration() ); } }
protected void processTableContent( final LogicalPageKey logicalPageKey, final LogicalPageBox logicalPage, final TableContentProducer contentProducer ) throws ContentProcessingException { if ( printer == null ) { return; } printer.print( logicalPageKey, logicalPage, contentProducer, metaData, false ); }
public String rewriteContentDataItem( final ContentItem item ) throws URLRewriteException { return contentItems.getUrlRewriter().rewrite( documentContentItem, item ); }
protected void updateTableContent( final LogicalPageKey logicalPageKey, final LogicalPageBox logicalPageBox, final TableContentProducer tableContentProducer, final boolean performOutput ) throws ContentProcessingException { if ( printer == null ) { return; } printer.print( logicalPageKey, logicalPageBox, tableContentProducer, metaData, true ); }
public void print( final LogicalPageKey logicalPageKey, final LogicalPageBox logicalPage, final TableContentProducer contentProducer, final OutputProcessorMetaData metaData, final boolean incremental ) throws ContentProcessingException { if ( printed ) { return; } super.print( logicalPageKey, logicalPage, contentProducer, metaData, incremental ); if ( incremental == false ) { printed = true; } } }
protected void processTableContent( final LogicalPageKey logicalPageKey, final LogicalPageBox logicalPage, final TableContentProducer contentProducer ) throws ContentProcessingException { if ( printer == null ) { return; } printer.print( logicalPageKey, logicalPage, contentProducer, metaData, false ); }
protected void updateTableContent( final LogicalPageKey logicalPageKey, final LogicalPageBox logicalPageBox, final TableContentProducer tableContentProducer, final boolean performOutput ) throws ContentProcessingException { if ( printer == null ) { return; } printer.print( logicalPageKey, logicalPageBox, tableContentProducer, metaData, true ); }
public void print( final LogicalPageKey logicalPageKey, final LogicalPageBox logicalPage, final TableContentProducer contentProducer, final OutputProcessorMetaData metaData, final boolean incremental ) throws ContentProcessingException { try { super.print( logicalPageKey, logicalPage, contentProducer, metaData, incremental ); } catch ( ContentProcessingException ce ) { throw ce; } catch ( Exception e ) { // ignore .. (for now) throw new ContentProcessingException( "Processing content failed", e ); } } }