org.pentaho.reporting.engine.classic.core.modules.parser.bundle.writer
Class BundleWriter

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.modules.parser.bundle.writer.BundleWriter

public class BundleWriter
extends Object

The bundle-frontend. This class orchestrates the writing process.

In the absence of template files, it will simply serialize the whole report into a XML file and will fail if there are non-serializable or unrecognized elements. Unlike the old ext-writer, this class does not try to write all report-definitions. The report definitions fed into this writer must use ElementType implementation to be written correctly.

In this very first implementation, we ignore the global bundle and write everything into the target bundle. To make selective writing work, we have to tag each shared element as shared.

Author:
Thomas Morgner

Constructor Summary
BundleWriter()
           
 
Method Summary
 void writeReport(org.pentaho.reporting.libraries.docbundle.WriteableDocumentBundle bundle, MasterReport report)
           
 void writeReport(org.pentaho.reporting.libraries.docbundle.WriteableDocumentBundle bundle, MasterReport report, org.pentaho.reporting.libraries.docbundle.DocumentBundle globalBundle)
           
static void writeReportToDirectory(MasterReport report, File file)
           
static void writeReportToZipFile(MasterReport report, File file)
           
static void writeReportToZipStream(MasterReport report, OutputStream out)
           
 void writeSubReport(org.pentaho.reporting.libraries.docbundle.WriteableDocumentBundle bundle, BundleWriterState state)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleWriter

public BundleWriter()
Method Detail

writeReport

public void writeReport(org.pentaho.reporting.libraries.docbundle.WriteableDocumentBundle bundle,
                        MasterReport report)
                 throws IOException,
                        BundleWriterException
Throws:
IOException
BundleWriterException

writeReport

public void writeReport(org.pentaho.reporting.libraries.docbundle.WriteableDocumentBundle bundle,
                        MasterReport report,
                        org.pentaho.reporting.libraries.docbundle.DocumentBundle globalBundle)
                 throws IOException,
                        BundleWriterException
Throws:
IOException
BundleWriterException

writeSubReport

public void writeSubReport(org.pentaho.reporting.libraries.docbundle.WriteableDocumentBundle bundle,
                           BundleWriterState state)
                    throws IOException,
                           BundleWriterException
Throws:
IOException
BundleWriterException

writeReportToZipFile

public static void writeReportToZipFile(MasterReport report,
                                        File file)
                                 throws IOException,
                                        BundleWriterException,
                                        org.pentaho.reporting.libraries.repository.ContentIOException
Throws:
IOException
BundleWriterException
org.pentaho.reporting.libraries.repository.ContentIOException

writeReportToZipStream

public static void writeReportToZipStream(MasterReport report,
                                          OutputStream out)
                                   throws IOException,
                                          BundleWriterException,
                                          org.pentaho.reporting.libraries.repository.ContentIOException
Throws:
IOException
BundleWriterException
org.pentaho.reporting.libraries.repository.ContentIOException

writeReportToDirectory

public static void writeReportToDirectory(MasterReport report,
                                          File file)
                                   throws IOException,
                                          BundleWriterException,
                                          org.pentaho.reporting.libraries.repository.ContentIOException
Throws:
IOException
BundleWriterException
org.pentaho.reporting.libraries.repository.ContentIOException