public class FreemarkerEngine extends Object implements RenderingEngine
Modifier and Type | Field and Description |
---|---|
static String |
RENDERING_ENGINE_KEY |
Constructor and Description |
---|
FreemarkerEngine() |
FreemarkerEngine(freemarker.template.Configuration cfg,
ResourceLocator locator) |
Modifier and Type | Method and Description |
---|---|
void |
flushCache() |
freemarker.template.Configuration |
getConfiguration() |
ResourceTemplateLoader |
getLoader() |
ResourceBundle |
getMessageBundle() |
DocumentObjectWrapper |
getObjectWrapper() |
ResourceLocator |
getResourceLocator() |
View |
getView(String path) |
View |
getView(String path,
Object object) |
void |
render(String template,
Object input,
Writer writer)
Starts the rendering for the given document context.
|
void |
setMessageBundle(ResourceBundle messages)
set the resource bundle to be used with method message and lmessage.
|
void |
setResourceLocator(ResourceLocator locator) |
void |
setSharedVariable(String key,
Object value) |
public static final String RENDERING_ENGINE_KEY
public FreemarkerEngine()
public FreemarkerEngine(freemarker.template.Configuration cfg, ResourceLocator locator)
public void setMessageBundle(ResourceBundle messages)
setMessageBundle
in interface RenderingEngine
public ResourceBundle getMessageBundle()
getMessageBundle
in interface RenderingEngine
public void setResourceLocator(ResourceLocator locator)
setResourceLocator
in interface RenderingEngine
public ResourceLocator getResourceLocator()
getResourceLocator
in interface RenderingEngine
public ResourceTemplateLoader getLoader()
public void setSharedVariable(String key, Object value)
setSharedVariable
in interface RenderingEngine
public DocumentObjectWrapper getObjectWrapper()
public freemarker.template.Configuration getConfiguration()
public View getView(String path)
getView
in interface RenderingEngine
public View getView(String path, Object object)
getView
in interface RenderingEngine
public void render(String template, Object input, Writer writer) throws RenderingException
RenderingEngine
render
in interface RenderingEngine
template
- input
- writer
- baseUrl
- a base URL used for resolving referenced files in extends
directive.RenderingException
public void flushCache()
flushCache
in interface RenderingEngine
Copyright © 2013 Nuxeo SA. All Rights Reserved.