net.sf.jooreports.templates
Class AbstractDocumentTemplate

java.lang.Object
  extended by net.sf.jooreports.templates.AbstractDocumentTemplate
All Implemented Interfaces:
DocumentTemplate
Direct Known Subclasses:
UnzippedDocumentTemplate, ZippedDocumentTemplate

public abstract class AbstractDocumentTemplate
extends java.lang.Object
implements DocumentTemplate


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.jooreports.templates.DocumentTemplate
DocumentTemplate.ContentWrapper
 
Constructor Summary
AbstractDocumentTemplate()
           
AbstractDocumentTemplate(freemarker.template.Configuration freemarkerConfiguration)
           
 
Method Summary
 void createDocument(java.lang.Object model, java.io.OutputStream output)
          Merge the data model into this template and create the output document.
 java.util.Map getConfigurations()
           
protected abstract  OpenDocumentArchive getOpenDocumentArchive()
           
 void setContentWrapper(DocumentTemplate.ContentWrapper contentWrapper)
          Hook to set custom FreeMarker directives on each XML entry.
 void setOpenDocumentSettings(java.util.Map openDocumentSettings)
           
 void setXmlEntries(java.lang.String[] xmlEntries)
          Set which XML entries in the ODT template can contain templating instructions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDocumentTemplate

public AbstractDocumentTemplate()

AbstractDocumentTemplate

public AbstractDocumentTemplate(freemarker.template.Configuration freemarkerConfiguration)
Method Detail

setXmlEntries

public void setXmlEntries(java.lang.String[] xmlEntries)
Description copied from interface: DocumentTemplate
Set which XML entries in the ODT template can contain templating instructions.

By default they are content.xml and styles.xml.

To add all possible XML entries use

 template.setXmlEntries(new String[] {
     "content.xml",
     "meta.xml",
     "settings.xml",
     "styles.xml"
 });
 

Specified by:
setXmlEntries in interface DocumentTemplate

setContentWrapper

public void setContentWrapper(DocumentTemplate.ContentWrapper contentWrapper)
Description copied from interface: DocumentTemplate
Hook to set custom FreeMarker directives on each XML entry.

The default implementation escapes XML entities and converts newline characters into line-break tags.

Specified by:
setContentWrapper in interface DocumentTemplate

getOpenDocumentArchive

protected abstract OpenDocumentArchive getOpenDocumentArchive()

setOpenDocumentSettings

public void setOpenDocumentSettings(java.util.Map openDocumentSettings)
Specified by:
setOpenDocumentSettings in interface DocumentTemplate

createDocument

public void createDocument(java.lang.Object model,
                           java.io.OutputStream output)
                    throws java.io.IOException,
                           DocumentTemplateException
Description copied from interface: DocumentTemplate
Merge the data model into this template and create the output document.

Specified by:
createDocument in interface DocumentTemplate
Throws:
java.io.IOException
DocumentTemplateException

getConfigurations

public java.util.Map getConfigurations()
Specified by:
getConfigurations in interface DocumentTemplate