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 FMContextBuilderfmContextBuilderprotected FreemarkerEnginefmEngineprotected static PatternHtmlTagPatternprotected freemarker.cache.StringTemplateLoaderloaderprotected static PatternXMLStartPattern-
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 FreemarkerEnginegetEngine()List<TemplateInput>getInitialParametersDefinition(Blob blob)Extract parameters from the Template file.protected StringguessMimeType(Blob result, MimetypeRegistry mreg)BlobrenderTemplate(TemplateBasedDocument templateBasedDocument, String templateName)Perform rendering of the named template against theTemplateBasedDocumentprotected voidsetBlobAttributes(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:TemplateProcessorPerform rendering of the named template against theTemplateBasedDocument- Specified by:
renderTemplatein interfaceTemplateProcessor- Throws:
IOException
-
getInitialParametersDefinition
public List<TemplateInput> getInitialParametersDefinition(Blob blob) throws IOException
Description copied from interface:TemplateProcessorExtract parameters from the Template file.- Specified by:
getInitialParametersDefinitionin interfaceTemplateProcessor- Returns:
- List of parameters for this template
- Throws:
IOException
-
-