|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.opensagres.xdocreport.document.AbstractXDocReport
public abstract class AbstractXDocReport
Abstract class for IXDocReport to implement to manage docx, odt...
| Constructor Summary | |
|---|---|
protected |
AbstractXDocReport()
|
| Method Summary | ||
|---|---|---|
void |
addPreprocessor(String entryName,
IXDocPreprocessor preprocessor)
Register a processor for the entry name. |
|
void |
clearData(String key)
Clear data. |
|
void |
convert(IContext context,
Options options,
OutputStream out)
Convert report. |
|
IContext |
createContext()
Create an empty context to register Java model. |
|
FieldsMetadata |
createFieldsMetadata()
Create fields metadata. |
|
protected abstract IImageRegistry |
createImageRegistry(IEntryReaderProvider readerProvider,
IEntryWriterProvider writerProvider,
IEntryOutputStreamProvider outputStreamProvider)
Create an image registry. |
|
protected void |
doPostprocessIfNeeded(XDocArchive outputArchive)
|
|
void |
extractFields(FieldsExtractor extractor)
|
|
void |
extractFields(FieldsExtractor extractor,
ITemplateEngine templateEngine)
|
|
IConverter |
getConverter(Options options)
Returns converter for the report and options. |
|
|
getData(String key)
Returns custom data. |
|
protected abstract String[] |
getDefaultXMLEntries()
Returns default entries which define XML document to merge with Java model with template engine for odt, docx... |
|
FieldsMetadata |
getFieldsMetadata()
Returns fields metadata used to manage lazy loop for table row. |
|
String |
getId()
Returns the id of the IXDocReport. |
|
long |
getLastModified()
Returns the last modified time when the report is loaded. |
|
XDocArchive |
getOriginalDocumentArchive()
Returns the original zipped XML document (odt, docx...) and null if : no load was done. |
|
XDocArchive |
getPreprocessedDocumentArchive()
Returns the preprocessed zipped XML document (odt, docx...) and null if no load was done. |
|
ITemplateEngine |
getTemplateEngine()
Returns template engine (velocity, freemarker..) to use to merge Java model with the XML files of the from entries of the zipped XML Document (odt, docx...) defined by getXMLEntries(). |
|
String[] |
getXMLEntries()
Returns XML entries which define XML document to merge with Java model with template engine. |
|
boolean |
isPreprocessed()
Returns true if report was processed and false otherwise. |
|
void |
load(InputStream sourceStream)
Load XML document (odt, docx...) from input stream. |
|
protected void |
onAfterPreprocessing(Map<String,Object> sharedContext,
XDocArchive preprocessedArchive)
On after preprocessing. |
|
protected void |
onAfterProcessTemplateEngine(IContext context,
XDocArchive outputArchive)
On after process template engine. |
|
protected void |
onBeforePreprocessing(Map<String,Object> sharedContext,
XDocArchive preprocessedArchive)
On before preprocessing. |
|
protected void |
onBeforeProcessTemplateEngine(IContext context,
XDocArchive outputArchive)
On before process template engine. |
|
void |
preprocess()
Force the preprocessing step. |
|
void |
process(IContext context,
OutputStream out)
Merge the docx, odt document with Java model from the context and register the result to the output stream. |
|
void |
process(IContext context,
String entryName,
OutputStream out)
Generate report by merging Java model frm the context with XML Document (odt, docx...) preprocessed and store the result into output stream. |
|
protected abstract void |
registerPreprocessors()
Register preprocessors. |
|
void |
removeAllPreprocessors()
Clear processor. |
|
void |
removePreprocessor(String entryName)
Remove processor for the entry name. |
|
void |
save(ProcessState processState,
OutputStream out)
Save original|preprocessed XML document archive in the given output stream. |
|
void |
saveEntry(String entryName,
ProcessState processState,
OutputStream out)
Save original|preprocessed entryName from XML document archive in the given output stream. |
|
void |
setCacheOriginalDocument(boolean cacheOriginalDocument)
Set cache or not for original document archive. |
|
void |
setData(String key,
Object value)
Returns XML entries which define XML document to merge with Java model with template engine. |
|
void |
setDocumentArchive(XDocArchive documentArchive)
Returns the zipped XML document (odt, docx...). |
|
void |
setFieldsMetadata(FieldsMetadata fieldsMetadata)
Set fields metadata used to manage lazy loop for table row. |
|
void |
setId(String id)
Set the id of the IXDocReport. |
|
void |
setTemplateEngine(ITemplateEngine templateEngine)
Register template engine (velocity, freemarker..) to use to merge Java model with the XML files of the from entries of the zipped XML Document (odt, docx...) defined by getXMLEntries(). |
|
void |
setXMLEntries(String[] xmlEntries)
Set XML entries which define XML document to merge with Java model with template engine. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface fr.opensagres.xdocreport.document.IXDocReport |
|---|
getKind, getMimeMapping |
| Constructor Detail |
|---|
protected AbstractXDocReport()
| Method Detail |
|---|
public String getId()
IXDocReportIXDocReport. This id is used to cache an instance of IXDocReport with
{@link XDocReportRegistry#loadReport(InputStream) and get instance from cache with
getId in interface IXDocReportIXDocReportpublic void setId(String id)
IXDocReportIXDocReport. This id is used to cache an instance of IXDocReport with
{@link XDocReportRegistry#loadReport(InputStream) and get instance from cache with
setId in interface IXDocReportid - of the IXDocReport
public void load(InputStream sourceStream)
throws IOException,
XDocReportException
IXDocReport
load in interface IXDocReportsourceStream - stream of the XML Document zip (odt, docx...).
IOException - when XML Document zip (odt, docx...) cannot be read.
XDocReportException - when preprocessing with IXDocPreprocessor cannot be done.
public void setDocumentArchive(XDocArchive documentArchive)
throws IOException,
XDocReportException
IXDocReport
setDocumentArchive in interface IXDocReportdocumentArchive - XDocArchive.
XDocReportException - when preprocessing with IXDocPreprocessor cannot be done.
IOExceptionpublic XDocArchive getOriginalDocumentArchive()
IXDocReportIXDocReport.setCacheOriginalDocument(boolean).
getOriginalDocumentArchive in interface IXDocReportpublic XDocArchive getPreprocessedDocumentArchive()
IXDocReport
getPreprocessedDocumentArchive in interface IXDocReportpublic ITemplateEngine getTemplateEngine()
getXMLEntries().
getTemplateEngine in interface IXDocReportpublic void setTemplateEngine(ITemplateEngine templateEngine)
getXMLEntries().
setTemplateEngine in interface IXDocReport
public void addPreprocessor(String entryName,
IXDocPreprocessor preprocessor)
addPreprocessor in interface IXDocReportentryName - preprocessor - public void removePreprocessor(String entryName)
removePreprocessor in interface IXDocReportentryName - public void removeAllPreprocessors()
removeAllPreprocessors in interface IXDocReportpublic void setFieldsMetadata(FieldsMetadata fieldsMetadata)
setFieldsMetadata in interface IXDocReportpublic FieldsMetadata getFieldsMetadata()
getFieldsMetadata in interface IXDocReportpublic FieldsMetadata createFieldsMetadata()
createFieldsMetadata in interface IXDocReport
public void preprocess()
throws XDocReportException,
IOException
IXDocReport
preprocess in interface IXDocReportXDocReportException
IOException
protected void onBeforePreprocessing(Map<String,Object> sharedContext,
XDocArchive preprocessedArchive)
throws XDocReportException
sharedContext - preprocessedArchive -
XDocReportException
protected void onAfterPreprocessing(Map<String,Object> sharedContext,
XDocArchive preprocessedArchive)
throws XDocReportException
sharedContext - preprocessedArchive -
XDocReportExceptionpublic String[] getXMLEntries()
public void setXMLEntries(String[] xmlEntries)
xmlEntries -
public IContext createContext()
throws XDocReportException
createContext in interface IXDocReportXDocReportException
public void process(IContext context,
OutputStream out)
throws XDocReportException,
IOException
IXDocReport
process in interface IXDocReportcontext - of the Java model.out - output stream where merge must be saved.
XDocReportException
IOException
public void process(IContext context,
String entryName,
OutputStream out)
throws XDocReportException,
IOException
process in interface IXDocReportcontext - of the Java model.entryName - entry name
XDocReportException
IOExceptionprotected void doPostprocessIfNeeded(XDocArchive outputArchive)
public void save(ProcessState processState,
OutputStream out)
throws IOException,
XDocReportException
IXDocReport
save in interface IXDocReportIOException
XDocReportException
public void saveEntry(String entryName,
ProcessState processState,
OutputStream out)
throws IOException,
XDocReportException
IXDocReport
saveEntry in interface IXDocReportIOException
XDocReportException
public void extractFields(FieldsExtractor extractor)
throws XDocReportException
extractFields in interface IXDocReportXDocReportException
public void extractFields(FieldsExtractor extractor,
ITemplateEngine templateEngine)
throws XDocReportException
extractFields in interface IXDocReportXDocReportException
public IConverter getConverter(Options options)
throws XDocConverterException
IXDocReport
getConverter in interface IXDocReportXDocConverterException
public void convert(IContext context,
Options options,
OutputStream out)
throws XDocReportException,
XDocConverterException,
IOException
IXDocReport
convert in interface IXDocReportXDocReportException
XDocConverterException
IOException
protected void onBeforeProcessTemplateEngine(IContext context,
XDocArchive outputArchive)
throws XDocReportException
context - outputArchive -
XDocReportException
protected void onAfterProcessTemplateEngine(IContext context,
XDocArchive outputArchive)
throws XDocReportException
context - outputArchive -
XDocReportExceptionprotected abstract String[] getDefaultXMLEntries()
public void setData(String key,
Object value)
getDefaultXMLEntries() are used.
setData in interface IXDocReportpublic <T> T getData(String key)
IXDocReport
getData in interface IXDocReportpublic void clearData(String key)
IXDocReport
clearData in interface IXDocReportpublic void setCacheOriginalDocument(boolean cacheOriginalDocument)
IXDocReport
setCacheOriginalDocument in interface IXDocReportprotected abstract void registerPreprocessors()
public boolean isPreprocessed()
isPreprocessed in interface IXDocReportpublic long getLastModified()
getLastModified in interface IXDocReport
protected abstract IImageRegistry createImageRegistry(IEntryReaderProvider readerProvider,
IEntryWriterProvider writerProvider,
IEntryOutputStreamProvider outputStreamProvider)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||