fr.opensagres.xdocreport.template
Class AbstractTemplateEngine

java.lang.Object
  extended by fr.opensagres.xdocreport.template.AbstractTemplateEngine
All Implemented Interfaces:
ITemplateEngine
Direct Known Subclasses:
FreemarkerTemplateEngine, VelocityTemplateEngine

public abstract class AbstractTemplateEngine
extends Object
implements ITemplateEngine


Constructor Summary
AbstractTemplateEngine()
           
 
Method Summary
 void extractFields(IEntryReaderProvider readerProvider, String entryName, FieldsExtractor extractor)
           
 ITemplateEngineConfiguration getConfiguration()
           
 ITemplateCacheInfoProvider getTemplateCacheInfoProvider()
           
protected  boolean isUseTemplateCache(String reportId)
           
 void process(String entryName, IContext context, Reader reader, Writer writer)
          Merge Java model coming from the given context with the given reader and register the merge result in the given writer.
 void process(String reportId, String entryName, IEntryReaderProvider readerProvider, IEntryWriterProvider writerProvider, IContext context)
          Merge Java model coming from the given context with the XML file entryName of the given document archive and modify the entry of the document archive.
 void process(String reportId, String entryName, IEntryReaderProvider readerProvider, Writer writer, IContext context)
           
protected abstract  void processNoCache(String entryName, IContext context, Reader reader, Writer writer)
           
protected abstract  void processWithCache(String templateName, IContext context, Writer writer)
           
 void setConfiguration(ITemplateEngineConfiguration configuration)
           
 void setTemplateCacheInfoProvider(ITemplateCacheInfoProvider templateCacheInfoProvider)
           
 
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.template.ITemplateEngine
createContext, createContext, extractFields, getDocumentFormatter, getId, getKind, isFieldNameStartsWithUpperCase, process
 

Constructor Detail

AbstractTemplateEngine

public AbstractTemplateEngine()
Method Detail

getTemplateCacheInfoProvider

public ITemplateCacheInfoProvider getTemplateCacheInfoProvider()
Specified by:
getTemplateCacheInfoProvider in interface ITemplateEngine

setTemplateCacheInfoProvider

public void setTemplateCacheInfoProvider(ITemplateCacheInfoProvider templateCacheInfoProvider)
Specified by:
setTemplateCacheInfoProvider in interface ITemplateEngine

getConfiguration

public ITemplateEngineConfiguration getConfiguration()
Specified by:
getConfiguration in interface ITemplateEngine

setConfiguration

public void setConfiguration(ITemplateEngineConfiguration configuration)
Specified by:
setConfiguration in interface ITemplateEngine

process

public void process(String reportId,
                    String entryName,
                    IEntryReaderProvider readerProvider,
                    IEntryWriterProvider writerProvider,
                    IContext context)
             throws XDocReportException,
                    IOException
Description copied from interface: ITemplateEngine
Merge Java model coming from the given context with the XML file entryName of the given document archive and modify the entry of the document archive.

Specified by:
process in interface ITemplateEngine
Parameters:
reportId - IXDocReport#getId().
entryName - entry name of the XML file from the document archive which must be merged. This XML file is the template.
readerProvider - entry reader provider.
context - Java model context
Throws:
XDocReportException
IOException

process

public void process(String reportId,
                    String entryName,
                    IEntryReaderProvider readerProvider,
                    Writer writer,
                    IContext context)
             throws XDocReportException,
                    IOException
Specified by:
process in interface ITemplateEngine
Throws:
XDocReportException
IOException

process

public void process(String entryName,
                    IContext context,
                    Reader reader,
                    Writer writer)
             throws XDocReportException,
                    IOException
Description copied from interface: ITemplateEngine
Merge Java model coming from the given context with the given reader and register the merge result in the given writer.

Specified by:
process in interface ITemplateEngine
Parameters:
entryName - template name
context - Java model context
reader - template reader to merge
writer - merge result writer
Throws:
XDocReportException
IOException

extractFields

public void extractFields(IEntryReaderProvider readerProvider,
                          String entryName,
                          FieldsExtractor extractor)
                   throws XDocReportException
Specified by:
extractFields in interface ITemplateEngine
Throws:
XDocReportException

isUseTemplateCache

protected boolean isUseTemplateCache(String reportId)

processWithCache

protected abstract void processWithCache(String templateName,
                                         IContext context,
                                         Writer writer)
                                  throws XDocReportException,
                                         IOException
Throws:
XDocReportException
IOException

processNoCache

protected abstract void processNoCache(String entryName,
                                       IContext context,
                                       Reader reader,
                                       Writer writer)
                                throws XDocReportException,
                                       IOException
Throws:
XDocReportException
IOException


Copyright © 2013. All rights reserved.