fr.opensagres.xdocreport.document
Class XDocReport

java.lang.Object
  extended by fr.opensagres.xdocreport.document.XDocReport

public class XDocReport
extends Object

Helper class to generate report and convert it if needed.


Constructor Summary
XDocReport()
           
 
Method Summary
static IXDocReport generateReport(InputStream sourceStream, String templateEngineKind, FieldsMetadata metadata, Map<String,Object> contextMap, OutputStream out)
          Generate report without cache.
static IXDocReport generateReport(InputStream sourceStream, String templateEngineKind, FieldsMetadata metadata, Map<String,Object> contextMap, OutputStream out, XDocReportRegistry registry)
          Generate report without cache by setting the registry.
static IXDocReport generateReport(String reportId, IXDocReportController controller, Map<String,Object> contextMap, OutputStream out)
          Generate report by using controller to load report.
static IXDocReport generateReport(String reportId, IXDocReportController controller, Map<String,Object> contextMap, OutputStream out, XDocReportRegistry registry)
          Generate report by using controller to load report by setting the registry.
static IXDocReport generateReport(String reportId, IXDocReportLoader reportLoader, Map<String,Object> contextMap, OutputStream out)
          Generate report by using report loader to load report.
static IXDocReport generateReport(String reportId, IXDocReportLoader reportLoader, Map<String,Object> contextMap, OutputStream out, XDocReportRegistry registry)
          Generate report by using report loader to load report by setting the registry.
static IXDocReport generateReportAndConvert(InputStream sourceStream, String templateEngineKind, FieldsMetadata metadata, Map<String,Object> contextMap, Options options, OutputStream out)
          Generate report and convert it to another format (PDF, XHTML) without cache.
static IXDocReport generateReportAndConvert(InputStream sourceStream, String templateEngineKind, FieldsMetadata metadata, Map<String,Object> contextMap, Options options, OutputStream out, XDocReportRegistry registry)
          Generate report and convert it to another format (PDF, XHTML) without cache by setting the registry.
static IXDocReport generateReportAndConvert(String reportId, IXDocReportController controller, Map<String,Object> contextMap, Options options, OutputStream out)
          Generate report and convert it by using controller to load report.
static IXDocReport generateReportAndConvert(String reportId, IXDocReportController controller, Map<String,Object> contextMap, Options options, OutputStream out, XDocReportRegistry registry)
          Generate report and convert it by using controller to load report by setting the registry.
static IXDocReport generateReportAndConvert(String reportId, IXDocReportLoader reportLoader, Map<String,Object> contextMap, Options options, OutputStream out)
          Generate report and convert it by using report loader to load report.
static IXDocReport generateReportAndConvert(String reportId, IXDocReportLoader reportLoader, Map<String,Object> contextMap, Options options, OutputStream out, XDocReportRegistry registry)
          Generate report and convert it by using report loader to load report by setting the registry.
static IXDocReport getReport(String reportId, IXDocReportController controller)
          Get the template report from the cache registered with report id and load it if it is not found by using the given controller.
static IXDocReport getReport(String reportId, IXDocReportController controller, XDocReportRegistry registry)
          Get the template report from the cache registered with report id and load it if it is not found by using the given controller by setting the registry.
static IXDocReport getReport(String reportId, IXDocReportLoader reportLoader)
          Get the template report from the cache registered with report id and load it if it is not found by using the given report loader.
static IXDocReport getReport(String reportId, IXDocReportLoader reportLoader, XDocReportRegistry registry)
          Get the template report from the cache registered with report id and load it if it is not found by using the given report loader by setting the registry.
static IXDocReport loadReport(InputStream sourceStream, String templateEngineKind, FieldsMetadata metadata, XDocReportRegistry registry)
          Load the template report by using the given controller and cache it to the given registry
static IXDocReport loadReport(String reportId, IXDocReportController controller, XDocReportRegistry registry)
          Load the template report by using the given controller and cache it to the given registry
static IXDocReport loadReport(String reportId, IXDocReportLoader reportLoader, XDocReportRegistry registry)
          Load the template report by using the given report loader and cache it to the given registry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XDocReport

public XDocReport()
Method Detail

generateReport

public static IXDocReport generateReport(String reportId,
                                         IXDocReportController controller,
                                         Map<String,Object> contextMap,
                                         OutputStream out)
                                  throws IOException,
                                         XDocReportException
Generate report by using controller to load report.

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
controller - the controller used to load the template report if it is not already loaded.
contextMap - the context map values used to replace values of the template report.
out - the output stream where the report must be generated.
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

generateReport

public static IXDocReport generateReport(String reportId,
                                         IXDocReportController controller,
                                         Map<String,Object> contextMap,
                                         OutputStream out,
                                         XDocReportRegistry registry)
                                  throws IOException,
                                         XDocReportException
Generate report by using controller to load report by setting the registry.

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
controller - the controller used to load the template report if it is not already loaded.
contextMap - the context map values used to replace values of the template report.
out - the output stream where the report must be generated.
registry -
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

generateReportAndConvert

public static IXDocReport generateReportAndConvert(String reportId,
                                                   IXDocReportController controller,
                                                   Map<String,Object> contextMap,
                                                   Options options,
                                                   OutputStream out)
                                            throws IOException,
                                                   XDocReportException
Generate report and convert it by using controller to load report.

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
controller - the controller used to load the template report if it is not already loaded.
contextMap - the context map values used to replace values of the template report.
options - the converter options.
out - the output stream where the report must be generated.
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

generateReportAndConvert

public static IXDocReport generateReportAndConvert(String reportId,
                                                   IXDocReportController controller,
                                                   Map<String,Object> contextMap,
                                                   Options options,
                                                   OutputStream out,
                                                   XDocReportRegistry registry)
                                            throws IOException,
                                                   XDocReportException
Generate report and convert it by using controller to load report by setting the registry.

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
controller - the controller used to load the template report if it is not already loaded.
contextMap - the context map values used to replace values of the template report.
options - the converter options.
out - the output stream where the report must be generated.
registry -
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

getReport

public static IXDocReport getReport(String reportId,
                                    IXDocReportController controller)
                             throws IOException,
                                    XDocReportException
Get the template report from the cache registered with report id and load it if it is not found by using the given controller.

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
controller - the controller used to load the template report if it is not already loaded.
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

getReport

public static IXDocReport getReport(String reportId,
                                    IXDocReportController controller,
                                    XDocReportRegistry registry)
                             throws IOException,
                                    XDocReportException
Get the template report from the cache registered with report id and load it if it is not found by using the given controller by setting the registry.

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
controller - the controller used to load the template report if it is not already loaded.
registry -
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

loadReport

public static IXDocReport loadReport(String reportId,
                                     IXDocReportController controller,
                                     XDocReportRegistry registry)
                              throws IOException,
                                     XDocReportException
Load the template report by using the given controller and cache it to the given registry

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
controller - the controller used to load the template report.
registry -
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

generateReport

public static IXDocReport generateReport(String reportId,
                                         IXDocReportLoader reportLoader,
                                         Map<String,Object> contextMap,
                                         OutputStream out)
                                  throws IOException,
                                         XDocReportException
Generate report by using report loader to load report.

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
reportLoader - the reportLoader used to load the template report if it is not already loaded.
contextMap - the context map values used to replace values of the template report.
out - the output stream where the report must be generated.
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

generateReport

public static IXDocReport generateReport(String reportId,
                                         IXDocReportLoader reportLoader,
                                         Map<String,Object> contextMap,
                                         OutputStream out,
                                         XDocReportRegistry registry)
                                  throws IOException,
                                         XDocReportException
Generate report by using report loader to load report by setting the registry.

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
reportLoader - the report loader used to load the template report if it is not already loaded.
contextMap - the context map values used to replace values of the template report.
out - the output stream where the report must be generated.
registry -
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

generateReportAndConvert

public static IXDocReport generateReportAndConvert(String reportId,
                                                   IXDocReportLoader reportLoader,
                                                   Map<String,Object> contextMap,
                                                   Options options,
                                                   OutputStream out)
                                            throws IOException,
                                                   XDocReportException
Generate report and convert it by using report loader to load report.

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
reportLoader - the report loader used to load the template report if it is not already loaded.
contextMap - the context map values used to replace values of the template report.
options - the converter options.
out - the output stream where the report must be generated.
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

generateReportAndConvert

public static IXDocReport generateReportAndConvert(String reportId,
                                                   IXDocReportLoader reportLoader,
                                                   Map<String,Object> contextMap,
                                                   Options options,
                                                   OutputStream out,
                                                   XDocReportRegistry registry)
                                            throws IOException,
                                                   XDocReportException
Generate report and convert it by using report loader to load report by setting the registry.

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
reportLoader - the report loader used to load the template report if it is not already loaded.
contextMap - the context map values used to replace values of the template report.
options - the converter options.
out - the output stream where the report must be generated.
registry -
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

getReport

public static IXDocReport getReport(String reportId,
                                    IXDocReportLoader reportLoader)
                             throws IOException,
                                    XDocReportException
Get the template report from the cache registered with report id and load it if it is not found by using the given report loader.

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
reportLoader - the report loader used to load the template report if it is not already loaded.
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

getReport

public static IXDocReport getReport(String reportId,
                                    IXDocReportLoader reportLoader,
                                    XDocReportRegistry registry)
                             throws IOException,
                                    XDocReportException
Get the template report from the cache registered with report id and load it if it is not found by using the given report loader by setting the registry.

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
reportLoader - the report loader used to load the template report if it is not already loaded.
registry -
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

loadReport

public static IXDocReport loadReport(String reportId,
                                     IXDocReportLoader reportLoader,
                                     XDocReportRegistry registry)
                              throws IOException,
                                     XDocReportException
Load the template report by using the given report loader and cache it to the given registry

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
reportLoader - the report loader used to load the template report.
registry -
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException

generateReport

public static IXDocReport generateReport(InputStream sourceStream,
                                         String templateEngineKind,
                                         FieldsMetadata metadata,
                                         Map<String,Object> contextMap,
                                         OutputStream out)
                                  throws XDocReportException,
                                         IOException
Generate report without cache.

Parameters:
sourceStream - the input stream of the template report (docx, odt, etc).
templateEngineKind - the template engine kind (Velocity, Freemarker).
metadata - the fields metadata or null if no need the fields metadata.
contextMap - the context map values used to replace values of the template report.
out - the output stream where the report must be generated.
Returns:
an instance of the loaded template report.
Throws:
XDocReportException
IOException

generateReport

public static IXDocReport generateReport(InputStream sourceStream,
                                         String templateEngineKind,
                                         FieldsMetadata metadata,
                                         Map<String,Object> contextMap,
                                         OutputStream out,
                                         XDocReportRegistry registry)
                                  throws XDocReportException,
                                         IOException
Generate report without cache by setting the registry.

Parameters:
sourceStream - the input stream of the template report (docx, odt, etc).
templateEngineKind - the template engine kind (Velocity, Freemarker).
metadata - the fields metadata or null if no need the fields metadata.
contextMap - the context map values used to replace values of the template report.
out - the output stream where the report must be generated.
registry -
Returns:
an instance of the loaded template report.
Throws:
XDocReportException
IOException

generateReportAndConvert

public static IXDocReport generateReportAndConvert(InputStream sourceStream,
                                                   String templateEngineKind,
                                                   FieldsMetadata metadata,
                                                   Map<String,Object> contextMap,
                                                   Options options,
                                                   OutputStream out)
                                            throws IOException,
                                                   XDocReportException
Generate report and convert it to another format (PDF, XHTML) without cache.

Parameters:
sourceStream - the input stream of the template report (docx, odt, etc).
templateEngineKind - the template engine kind (Velocity, Freemarker).
metadata - the fields metadata or null if no need the fields metadata.
contextMap - the context map values used to replace values of the template report.
options - the converter options.
out - the output stream where the report must be generated.
Returns:
an instance of the loaded template report.
Throws:
XDocReportException
IOException

generateReportAndConvert

public static IXDocReport generateReportAndConvert(InputStream sourceStream,
                                                   String templateEngineKind,
                                                   FieldsMetadata metadata,
                                                   Map<String,Object> contextMap,
                                                   Options options,
                                                   OutputStream out,
                                                   XDocReportRegistry registry)
                                            throws IOException,
                                                   XDocReportException
Generate report and convert it to another format (PDF, XHTML) without cache by setting the registry.

Parameters:
sourceStream - the input stream of the template report (docx, odt, etc).
templateEngineKind - the template engine kind (Velocity, Freemarker).
metadata - the fields metadata or null if no need the fields metadata.
contextMap - the context map values used to replace values of the template report.
options - the converter options.
out - the output stream where the report must be generated.
registry -
Returns:
an instance of the loaded template report.
Throws:
XDocReportException
IOException

loadReport

public static IXDocReport loadReport(InputStream sourceStream,
                                     String templateEngineKind,
                                     FieldsMetadata metadata,
                                     XDocReportRegistry registry)
                              throws IOException,
                                     XDocReportException
Load the template report by using the given controller and cache it to the given registry

Parameters:
reportId - the report id used to retrieves from the cache the template report if it is already loaded.
controller - the controller used to load the template report.
registry -
Returns:
an instance of the loaded template report.
Throws:
IOException
XDocReportException


Copyright © 2013. All rights reserved.