|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.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)
Generate report and Convert it to another format (PDF, XHTML, etc). |
|
void |
convert(Map<String,Object> contextMap,
Options options,
OutputStream out)
Generate report and Convert it to another format (PDF, XHTML, etc). |
|
IContext |
createContext()
Create an empty context to register Java model. |
|
IContext |
createContext(Map<String,Object> contextMap)
Create a new instance of IContext to put the 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 |
dump(IContext context,
DumperOptions options,
OutputStream out)
Dump |
|
void |
dump(IContext context,
InputStream documentIn,
DumperOptions options,
OutputStream out)
Dump |
|
void |
extractFields(FieldsExtractor extractor)
Extract declared fields which use syntax of the template egine of the report. |
|
void |
extractFields(FieldsExtractor extractor,
ITemplateEngine templateEngine)
Extract declared fields which use syntax of the given template egine of the report. |
|
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... |
|
IDumper |
getDumper(DumperOptions options)
Returns the dumper for the given options. |
|
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. |
|
void |
process(Map<String,Object> contextMap,
OutputStream out)
Merge the docx, odt document with Java model from the context Map and register the result to the output stream. |
|
void |
process(Map<String,Object> contextMap,
String entryName,
OutputStream out)
Merge the docx, odt document with Java model from the context Map and register the entryName transformed to the 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()
IXDocReport
IXDocReport
. This id is used to cache an instance of IXDocReport
with
{@link XDocReportRegistry#loadReport(InputStream) and get instance from cache with
getId
in interface IXDocReport
IXDocReport
public void setId(String id)
IXDocReport
IXDocReport
. This id is used to cache an instance of IXDocReport
with
{@link XDocReportRegistry#loadReport(InputStream) and get instance from cache with
setId
in interface IXDocReport
id
- of the IXDocReport
public void load(InputStream sourceStream) throws IOException, XDocReportException
IXDocReport
load
in interface IXDocReport
sourceStream
- 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 IXDocReport
documentArchive
- XDocArchive
.
XDocReportException
- when preprocessing with IXDocPreprocessor
cannot be done.
IOException
public XDocArchive getOriginalDocumentArchive()
IXDocReport
IXDocReport.setCacheOriginalDocument(boolean)
.
getOriginalDocumentArchive
in interface IXDocReport
public XDocArchive getPreprocessedDocumentArchive()
IXDocReport
getPreprocessedDocumentArchive
in interface IXDocReport
public ITemplateEngine getTemplateEngine()
getXMLEntries()
.
getTemplateEngine
in interface IXDocReport
public void setTemplateEngine(ITemplateEngine templateEngine)
getXMLEntries()
.
setTemplateEngine
in interface IXDocReport
public void addPreprocessor(String entryName, IXDocPreprocessor preprocessor)
addPreprocessor
in interface IXDocReport
entryName
- preprocessor
- public void removePreprocessor(String entryName)
removePreprocessor
in interface IXDocReport
entryName
- public void removeAllPreprocessors()
removeAllPreprocessors
in interface IXDocReport
public void setFieldsMetadata(FieldsMetadata fieldsMetadata)
setFieldsMetadata
in interface IXDocReport
public FieldsMetadata getFieldsMetadata()
getFieldsMetadata
in interface IXDocReport
public FieldsMetadata createFieldsMetadata()
createFieldsMetadata
in interface IXDocReport
public void preprocess() throws XDocReportException, IOException
IXDocReport
preprocess
in interface IXDocReport
XDocReportException
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
-
XDocReportException
public String[] getXMLEntries()
public void setXMLEntries(String[] xmlEntries)
xmlEntries
- public IContext createContext() throws XDocReportException
createContext
in interface IXDocReport
XDocReportException
public IContext createContext(Map<String,Object> contextMap) throws XDocReportException
IXDocReport
IContext
to put the Java model.
createContext
in interface IXDocReport
XDocReportException
public void process(Map<String,Object> contextMap, OutputStream out) throws XDocReportException, IOException
IXDocReport
process
in interface IXDocReport
out
- output stream where merge must be saved.
XDocReportException
IOException
public void process(Map<String,Object> contextMap, String entryName, OutputStream out) throws XDocReportException, IOException
IXDocReport
process
in interface IXDocReport
entryName
- entry name
XDocReportException
IOException
public void process(IContext context, OutputStream out) throws XDocReportException, IOException
IXDocReport
process
in interface IXDocReport
context
- 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 IXDocReport
context
- of the Java model.entryName
- entry name
XDocReportException
IOException
protected void doPostprocessIfNeeded(XDocArchive outputArchive)
public void save(ProcessState processState, OutputStream out) throws IOException, XDocReportException
IXDocReport
save
in interface IXDocReport
IOException
XDocReportException
public void saveEntry(String entryName, ProcessState processState, OutputStream out) throws IOException, XDocReportException
IXDocReport
saveEntry
in interface IXDocReport
IOException
XDocReportException
public void extractFields(FieldsExtractor extractor) throws XDocReportException, IOException
IXDocReport
extractFields
in interface IXDocReport
extractor
- the fields extractor.
XDocReportException
IOException
public void extractFields(FieldsExtractor extractor, ITemplateEngine templateEngine) throws XDocReportException, IOException
IXDocReport
extractFields
in interface IXDocReport
extractor
- the fields extractor.templateEngine
- the template engine.
XDocReportException
IOException
public IConverter getConverter(Options options) throws XDocConverterException
IXDocReport
getConverter
in interface IXDocReport
XDocConverterException
public void convert(Map<String,Object> contextMap, Options options, OutputStream out) throws XDocReportException, XDocConverterException, IOException
IXDocReport
convert
in interface IXDocReport
XDocReportException
XDocConverterException
IOException
public void convert(IContext context, Options options, OutputStream out) throws XDocReportException, XDocConverterException, IOException
IXDocReport
convert
in interface IXDocReport
XDocReportException
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
-
XDocReportException
protected abstract String[] getDefaultXMLEntries()
public void setData(String key, Object value)
getDefaultXMLEntries()
are used.
setData
in interface IXDocReport
public <T> T getData(String key)
IXDocReport
getData
in interface IXDocReport
public void clearData(String key)
IXDocReport
clearData
in interface IXDocReport
public void setCacheOriginalDocument(boolean cacheOriginalDocument)
IXDocReport
setCacheOriginalDocument
in interface IXDocReport
protected abstract void registerPreprocessors()
public boolean isPreprocessed()
isPreprocessed
in interface IXDocReport
public long getLastModified()
getLastModified
in interface IXDocReport
protected abstract IImageRegistry createImageRegistry(IEntryReaderProvider readerProvider, IEntryWriterProvider writerProvider, IEntryOutputStreamProvider outputStreamProvider)
public void dump(IContext context, DumperOptions options, OutputStream out) throws IOException, XDocReportException
IXDocReport
dump
in interface IXDocReport
IOException
XDocReportException
public void dump(IContext context, InputStream documentIn, DumperOptions options, OutputStream out) throws IOException, XDocReportException
IXDocReport
dump
in interface IXDocReport
IOException
XDocReportException
public IDumper getDumper(DumperOptions options) throws XDocReportException
IXDocReport
getDumper
in interface IXDocReport
XDocReportException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |