public class WebTemplateProcessor extends AbstractProcessor
A web template may be a Freemarker template (out-of-the-box) but may also be an alternative template format. This may include the PHP template processor that is provided as a Webscripts Addon.
| Modifier and Type | Field and Description |
|---|---|
static String |
PREFIX_CLASSPATH |
processorModelHelper| Constructor and Description |
|---|
WebTemplateProcessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
executeBody(ProcessorContext pc,
ModelObject object)
Execute template Body.
|
void |
executeHeader(ProcessorContext pc,
ModelObject object)
Execute Template header
|
void |
executeScriptBodyExtensions(RequestContext context,
String scriptPath,
Map<String,Object> scriptModel,
Map<String,Object> resultModel,
ModelObject object)
Executes controller scripts that have been provided to extend the template being rendered.
|
boolean |
exists(ProcessorContext pc,
ModelObject object)
Indicates whether the engine responsible for processing
the body of the processor exists.
|
org.springframework.extensions.webscripts.ScriptProcessorRegistry |
getScriptProcessorRegistry()
Gets the script processor registry.
|
org.springframework.extensions.webscripts.TemplateProcessorRegistry |
getTemplateProcessorRegistry()
Gets the template processor registry.
|
protected String |
loadTemplateStringFromPath(String templatePath) |
void |
setScriptObjects(Map<String,Object> scriptObjects)
Set any additional objects to be applied to the script model when executing any JavaScript
attached to the template.
|
void |
setScriptProcessorRegistry(org.springframework.extensions.webscripts.ScriptProcessorRegistry scriptProcessorRegistry)
Sets the script processor registry.
|
void |
setTemplateProcessorRegistry(org.springframework.extensions.webscripts.TemplateProcessorRegistry templateProcessorRegistry)
Sets the template processor registry.
|
void |
setWebFrameworkConfigElement(WebFrameworkConfigElement webFrameworkConfigElement)
This accessor method is required for Spring to set the
WebFrameworkConfigElement required by this
WebTemplateProcessor. |
execute, getProperty, getRenderingDescriptor, setProcessorModelHelperpublic static final String PREFIX_CLASSPATH
public void setWebFrameworkConfigElement(WebFrameworkConfigElement webFrameworkConfigElement)
This accessor method is required for Spring to set the WebFrameworkConfigElement required by this
WebTemplateProcessor.
webFrameworkConfigElement - WebFrameworkConfigElementpublic void setTemplateProcessorRegistry(org.springframework.extensions.webscripts.TemplateProcessorRegistry templateProcessorRegistry)
templateProcessorRegistry - the new template processor registrypublic org.springframework.extensions.webscripts.TemplateProcessorRegistry getTemplateProcessorRegistry()
public void setScriptProcessorRegistry(org.springframework.extensions.webscripts.ScriptProcessorRegistry scriptProcessorRegistry)
scriptProcessorRegistry - the new script processor registrypublic org.springframework.extensions.webscripts.ScriptProcessorRegistry getScriptProcessorRegistry()
public void setScriptObjects(Map<String,Object> scriptObjects)
scriptObjects - Mappublic void executeHeader(ProcessorContext pc, ModelObject object) throws RendererExecutionException
executeHeader in interface ProcessorexecuteHeader in class AbstractProcessorpc - the processor contextRendererExecutionException - the renderer execution exceptionpublic void executeScriptBodyExtensions(RequestContext context, String scriptPath, Map<String,Object> scriptModel, Map<String,Object> resultModel, ModelObject object)
Executes controller scripts that have been provided to extend the template being rendered.
context - The current RequestContext.scriptPath - The path of the script being executed. This script does not need to exist for extensions to be processed.scriptModel - The current model for the script to use. If this argument is null then a new model will be built.resultModel - The result model of executing the script.object - The ModelObject being rendered, this will almost certainly be a TemplateInstance. This is only required
if the scriptModel argument is nullpublic void executeBody(ProcessorContext pc, ModelObject object) throws RendererExecutionException
executeBody in interface ProcessorexecuteBody in class AbstractProcessorpc - the processor contextRendererExecutionException - the renderer execution exceptionpublic boolean exists(ProcessorContext pc, ModelObject object)
Processorpc - ProcessorContextobject - ModelObjectprotected String loadTemplateStringFromPath(String templatePath) throws IOException
IOExceptionCopyright © 2005–2016 Alfresco Software. All rights reserved.