Package org.nuxeo.template.processors.fm
Class FreeMarkerProcessor
- java.lang.Object
-
- org.nuxeo.template.processors.AbstractTemplateProcessor
-
- org.nuxeo.template.processors.fm.FreeMarkerProcessor
-
- All Implemented Interfaces:
TemplateProcessor
public class FreeMarkerProcessor extends AbstractTemplateProcessor implements TemplateProcessor
-
-
Field Summary
Fields Modifier and Type Field Description protected FMContextBuilder
fmContextBuilder
protected FreemarkerEngine
fmEngine
protected static Pattern
HtmlTagPattern
protected freemarker.cache.StringTemplateLoader
loader
protected static Pattern
XMLStartPattern
-
Fields inherited from class org.nuxeo.template.processors.AbstractTemplateProcessor
BUFFER_SIZE, log
-
-
Constructor Summary
Constructors Constructor Description FreeMarkerProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FreemarkerEngine
getEngine()
List<TemplateInput>
getInitialParametersDefinition(Blob blob)
Extract parameters from the Template file.protected String
guessMimeType(Blob result, MimetypeRegistry mreg)
Blob
renderTemplate(TemplateBasedDocument templateBasedDocument, String templateName)
Perform rendering of the named template against theTemplateBasedDocument
protected void
setBlobAttributes(Blob result, TemplateBasedDocument templateBasedDocument)
-
Methods inherited from class org.nuxeo.template.processors.AbstractTemplateProcessor
getSourceTemplateBlob, getWorkingDir
-
-
-
-
Field Detail
-
loader
protected freemarker.cache.StringTemplateLoader loader
-
fmEngine
protected FreemarkerEngine fmEngine
-
fmContextBuilder
protected FMContextBuilder fmContextBuilder
-
XMLStartPattern
protected static final Pattern XMLStartPattern
-
HtmlTagPattern
protected static final Pattern HtmlTagPattern
-
-
Method Detail
-
getEngine
protected FreemarkerEngine getEngine()
-
guessMimeType
protected String guessMimeType(Blob result, MimetypeRegistry mreg)
-
setBlobAttributes
protected void setBlobAttributes(Blob result, TemplateBasedDocument templateBasedDocument)
-
renderTemplate
public Blob renderTemplate(TemplateBasedDocument templateBasedDocument, String templateName) throws IOException
Description copied from interface:TemplateProcessor
Perform rendering of the named template against theTemplateBasedDocument
- Specified by:
renderTemplate
in interfaceTemplateProcessor
- Throws:
IOException
-
getInitialParametersDefinition
public List<TemplateInput> getInitialParametersDefinition(Blob blob) throws IOException
Description copied from interface:TemplateProcessor
Extract parameters from the Template file.- Specified by:
getInitialParametersDefinition
in interfaceTemplateProcessor
- Returns:
- List of parameters for this template
- Throws:
IOException
-
-