fr.opensagres.xdocreport.document.preprocessor
Interface IXDocPreprocessor

All Known Implementing Classes:
AbstractXDocPreprocessor, DocxContentTypesPreprocessor, DocxDocumentPreprocessor, DocxDocumentXMLRelsPreprocessor, DocxEndnotesPreprocessor, DocxFootnotesPreprocessor, DocxNumberingPreprocessor, DocxPreprocessor, DocxStylesPreprocessor, DOMFontsPreprocessor, DOMPreprocessor, ODTManifestXMLProcessor, ODTPreprocessor, ODTStylesPreprocessor, PPTXSlidePreprocessor, SAXXDocPreprocessor

public interface IXDocPreprocessor

XML document preprocessor is used to modify the content of the original document from the archive of the XML document (odt, docx...). For instance loop management in table managed with FieldsMetadata implements an IXDocPreprocessor to add directive template engine (#foreach for velocity, [#list for freemarker) in the table row.


Method Summary
 boolean create(String entryName, XDocArchive outputArchive, FieldsMetadata fieldsMetadata, IDocumentFormatter formatter, Map<String,Object> sharedContext)
          Create the XML file identify with te entry name from the archive.
 void preprocess(String entryName, XDocArchive outputArchive, FieldsMetadata fieldsMetadata, IDocumentFormatter formatter, Map<String,Object> sharedContext)
          Modify the XML file identify with te entry name from the archive.
 

Method Detail

preprocess

void preprocess(String entryName,
                XDocArchive outputArchive,
                FieldsMetadata fieldsMetadata,
                IDocumentFormatter formatter,
                Map<String,Object> sharedContext)
                throws XDocReportException,
                       IOException
Modify the XML file identify with te entry name from the archive.

Parameters:
entryName - Zip entry name fo the XML file to modify.
outputArchive - the zip of the XML document.
fieldsMetadata - metdata fields.
formater - used to generate directive template engine
sharedContext - shared context between the whole processor to execute. This Map can be used to share information between processors (according the order of the processor registration).
Throws:
XDocReportException
IOException

create

boolean create(String entryName,
               XDocArchive outputArchive,
               FieldsMetadata fieldsMetadata,
               IDocumentFormatter formatter,
               Map<String,Object> sharedContext)
               throws XDocReportException,
                      IOException
Create the XML file identify with te entry name from the archive.

Parameters:
entryName - Zip entry name fo the XML file to modify.
outputArchive - the zip of the XML document.
fieldsMetadata - metdata fields.
formater - used to generate directive template engine
sharedContext - shared context between the whole processor to execute. This Map can be used to share information between processors (according the order of the processor registration).
Returns:
true if processing can create entry and false otherwise.
Throws:
XDocReportException
IOException


Copyright © 2013. All rights reserved.