Class XDocReport
java.lang.Object
fr.opensagres.xdocreport.document.XDocReport
Helper class to generate report and convert it if needed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IXDocReportgenerateReport(InputStream sourceStream, String templateEngineKind, fr.opensagres.xdocreport.template.formatter.FieldsMetadata metadata, Map<String, Object> contextMap, OutputStream out) Generate report without cache.static IXDocReportgenerateReport(InputStream sourceStream, String templateEngineKind, fr.opensagres.xdocreport.template.formatter.FieldsMetadata metadata, Map<String, Object> contextMap, OutputStream out, XDocReportRegistry registry) Generate report without cache by setting the registry.static IXDocReportgenerateReport(String reportId, IXDocReportController controller, Map<String, Object> contextMap, OutputStream out) Generate report by using controller to load report.static IXDocReportgenerateReport(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 IXDocReportgenerateReport(String reportId, IXDocReportLoader reportLoader, Map<String, Object> contextMap, OutputStream out) Generate report by using report loader to load report.static IXDocReportgenerateReport(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 IXDocReportgenerateReportAndConvert(InputStream sourceStream, String templateEngineKind, fr.opensagres.xdocreport.template.formatter.FieldsMetadata metadata, Map<String, Object> contextMap, fr.opensagres.xdocreport.converter.Options options, OutputStream out) Generate report and convert it to another format (PDF, XHTML) without cache.static IXDocReportgenerateReportAndConvert(InputStream sourceStream, String templateEngineKind, fr.opensagres.xdocreport.template.formatter.FieldsMetadata metadata, Map<String, Object> contextMap, fr.opensagres.xdocreport.converter.Options options, OutputStream out, XDocReportRegistry registry) Generate report and convert it to another format (PDF, XHTML) without cache by setting the registry.static IXDocReportgenerateReportAndConvert(String reportId, IXDocReportController controller, Map<String, Object> contextMap, fr.opensagres.xdocreport.converter.Options options, OutputStream out) Generate report and convert it by using controller to load report.static IXDocReportgenerateReportAndConvert(String reportId, IXDocReportController controller, Map<String, Object> contextMap, fr.opensagres.xdocreport.converter.Options options, OutputStream out, XDocReportRegistry registry) Generate report and convert it by using controller to load report by setting the registry.static IXDocReportgenerateReportAndConvert(String reportId, IXDocReportLoader reportLoader, Map<String, Object> contextMap, fr.opensagres.xdocreport.converter.Options options, OutputStream out) Generate report and convert it by using report loader to load report.static IXDocReportgenerateReportAndConvert(String reportId, IXDocReportLoader reportLoader, Map<String, Object> contextMap, fr.opensagres.xdocreport.converter.Options options, OutputStream out, XDocReportRegistry registry) Generate report and convert it by using report loader to load report by setting the registry.static IXDocReportgetReport(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 IXDocReportgetReport(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 IXDocReportgetReport(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 IXDocReportgetReport(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 IXDocReportloadReport(InputStream sourceStream, String templateEngineKind, fr.opensagres.xdocreport.template.formatter.FieldsMetadata metadata, XDocReportRegistry registry) Load the template report by using the given controller and cache it to the given registrystatic IXDocReportloadReport(String reportId, IXDocReportController controller, XDocReportRegistry registry) Load the template report by using the given controller and cache it to the given registrystatic IXDocReportloadReport(String reportId, IXDocReportLoader reportLoader, XDocReportRegistry registry) Load the template report by using the given report loader and cache it to the given registry
-
Constructor Details
-
XDocReport
public XDocReport()
-
-
Method Details
-
generateReport
public static IXDocReport generateReport(String reportId, IXDocReportController controller, Map<String, Object> contextMap, OutputStream out) throws IOException, fr.opensagres.xdocreport.core.XDocReportExceptionGenerate 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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
generateReport
public static IXDocReport generateReport(String reportId, IXDocReportController controller, Map<String, Object> contextMap, OutputStream out, XDocReportRegistry registry) throws IOException, fr.opensagres.xdocreport.core.XDocReportExceptionGenerate 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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
generateReportAndConvert
public static IXDocReport generateReportAndConvert(String reportId, IXDocReportController controller, Map<String, Object> contextMap, fr.opensagres.xdocreport.converter.Options options, OutputStream out) throws IOException, fr.opensagres.xdocreport.core.XDocReportExceptionGenerate 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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
generateReportAndConvert
public static IXDocReport generateReportAndConvert(String reportId, IXDocReportController controller, Map<String, Object> contextMap, fr.opensagres.xdocreport.converter.Options options, OutputStream out, XDocReportRegistry registry) throws IOException, fr.opensagres.xdocreport.core.XDocReportExceptionGenerate 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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
getReport
public static IXDocReport getReport(String reportId, IXDocReportController controller) throws IOException, fr.opensagres.xdocreport.core.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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
getReport
public static IXDocReport getReport(String reportId, IXDocReportController controller, XDocReportRegistry registry) throws IOException, fr.opensagres.xdocreport.core.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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
loadReport
public static IXDocReport loadReport(String reportId, IXDocReportController controller, XDocReportRegistry registry) throws IOException, fr.opensagres.xdocreport.core.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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
generateReport
public static IXDocReport generateReport(String reportId, IXDocReportLoader reportLoader, Map<String, Object> contextMap, OutputStream out) throws IOException, fr.opensagres.xdocreport.core.XDocReportExceptionGenerate 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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
generateReport
public static IXDocReport generateReport(String reportId, IXDocReportLoader reportLoader, Map<String, Object> contextMap, OutputStream out, XDocReportRegistry registry) throws IOException, fr.opensagres.xdocreport.core.XDocReportExceptionGenerate 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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
generateReportAndConvert
public static IXDocReport generateReportAndConvert(String reportId, IXDocReportLoader reportLoader, Map<String, Object> contextMap, fr.opensagres.xdocreport.converter.Options options, OutputStream out) throws IOException, fr.opensagres.xdocreport.core.XDocReportExceptionGenerate 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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
generateReportAndConvert
public static IXDocReport generateReportAndConvert(String reportId, IXDocReportLoader reportLoader, Map<String, Object> contextMap, fr.opensagres.xdocreport.converter.Options options, OutputStream out, XDocReportRegistry registry) throws IOException, fr.opensagres.xdocreport.core.XDocReportExceptionGenerate 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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
getReport
public static IXDocReport getReport(String reportId, IXDocReportLoader reportLoader) throws IOException, fr.opensagres.xdocreport.core.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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
getReport
public static IXDocReport getReport(String reportId, IXDocReportLoader reportLoader, XDocReportRegistry registry) throws IOException, fr.opensagres.xdocreport.core.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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
loadReport
public static IXDocReport loadReport(String reportId, IXDocReportLoader reportLoader, XDocReportRegistry registry) throws IOException, fr.opensagres.xdocreport.core.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:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-
generateReport
public static IXDocReport generateReport(InputStream sourceStream, String templateEngineKind, fr.opensagres.xdocreport.template.formatter.FieldsMetadata metadata, Map<String, Object> contextMap, OutputStream out) throws fr.opensagres.xdocreport.core.XDocReportException, IOExceptionGenerate 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:
fr.opensagres.xdocreport.core.XDocReportExceptionIOException
-
generateReport
public static IXDocReport generateReport(InputStream sourceStream, String templateEngineKind, fr.opensagres.xdocreport.template.formatter.FieldsMetadata metadata, Map<String, Object> contextMap, OutputStream out, XDocReportRegistry registry) throws fr.opensagres.xdocreport.core.XDocReportException, IOExceptionGenerate 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:
fr.opensagres.xdocreport.core.XDocReportExceptionIOException
-
generateReportAndConvert
public static IXDocReport generateReportAndConvert(InputStream sourceStream, String templateEngineKind, fr.opensagres.xdocreport.template.formatter.FieldsMetadata metadata, Map<String, Object> contextMap, fr.opensagres.xdocreport.converter.Options options, OutputStream out) throws IOException, fr.opensagres.xdocreport.core.XDocReportExceptionGenerate 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:
fr.opensagres.xdocreport.core.XDocReportExceptionIOException
-
generateReportAndConvert
public static IXDocReport generateReportAndConvert(InputStream sourceStream, String templateEngineKind, fr.opensagres.xdocreport.template.formatter.FieldsMetadata metadata, Map<String, Object> contextMap, fr.opensagres.xdocreport.converter.Options options, OutputStream out, XDocReportRegistry registry) throws IOException, fr.opensagres.xdocreport.core.XDocReportExceptionGenerate 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:
fr.opensagres.xdocreport.core.XDocReportExceptionIOException
-
loadReport
public static IXDocReport loadReport(InputStream sourceStream, String templateEngineKind, fr.opensagres.xdocreport.template.formatter.FieldsMetadata metadata, XDocReportRegistry registry) throws IOException, fr.opensagres.xdocreport.core.XDocReportException Load the template report by using the given controller and cache it to the given registry- Parameters:
registry-- Returns:
- an instance of the loaded template report.
- Throws:
IOExceptionfr.opensagres.xdocreport.core.XDocReportException
-