public class FreemarkerEngine extends Object implements RenderingEngine
| Modifier and Type | Field and Description | 
|---|---|
protected freemarker.template.Configuration | 
cfg  | 
protected ResourceTemplateLoader | 
loader  | 
protected LocaleMessagesMethod | 
localeMessages  | 
protected MessagesMethod | 
messages  | 
static String | 
RENDERING_ENGINE_KEY  | 
protected DocumentObjectWrapper | 
wrapper  | 
| 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
protected final freemarker.template.Configuration cfg
protected final DocumentObjectWrapper wrapper
protected final MessagesMethod messages
protected final LocaleMessagesMethod localeMessages
protected ResourceTemplateLoader loader
public FreemarkerEngine()
public FreemarkerEngine(freemarker.template.Configuration cfg, ResourceLocator locator)
public void setMessageBundle(ResourceBundle messages)
setMessageBundle in interface RenderingEnginepublic ResourceBundle getMessageBundle()
getMessageBundle in interface RenderingEnginepublic void setResourceLocator(ResourceLocator locator)
setResourceLocator in interface RenderingEnginepublic ResourceLocator getResourceLocator()
getResourceLocator in interface RenderingEnginepublic ResourceTemplateLoader getLoader()
public void setSharedVariable(String key, Object value)
setSharedVariable in interface RenderingEnginepublic DocumentObjectWrapper getObjectWrapper()
public freemarker.template.Configuration getConfiguration()
public View getView(String path)
getView in interface RenderingEnginepublic View getView(String path, Object object)
getView in interface RenderingEnginepublic void render(String template, Object input, Writer writer) throws RenderingException
RenderingEnginerender in interface RenderingEnginetemplate - input - writer - baseUrl - a base URL used for resolving referenced files in extends directive.RenderingExceptionpublic void flushCache()
flushCache in interface RenderingEngineCopyright © 2019 Nuxeo. All rights reserved.