public abstract class BaseTemplateRenderingEngine extends AbstractRenderingEngine
String
using the
PARAM_TEMPLATE parameter, as a NodeRef
using the PARAM_TEMPLATE_NODE
parameter or as a file path location using the PARAM_TEMPLATE_PATH parameter.
The RenderingEngine reads from these parameters with the following priority:
PARAM_TEMPLATE > PARAM_TEMPLATE_NODE > PARAM_TEMPLATE_PATH.AbstractRenderingEngine.RenderingContext
Modifier and Type | Field and Description |
---|---|
static String |
PARAM_MODEL
This optional
Map <String , Serializable > parameter
can be used to pass additional arguments to the templating engine when processing a
template. |
static String |
PARAM_TEMPLATE
|
static String |
PARAM_TEMPLATE_NODE
This optional
NodeRef parameter specifies a node containing the
template to be processed.If a value is specified for PARAM_TEMPLATE then this parameter will be ignored. If a value is specified for this parameter it will be used in preference to values specified for the PARAM_TEMPLATE_PATH parameter. |
static String |
PARAM_TEMPLATE_PATH
This optional
String parameter specifies a file path location for
the template to be processed.If a value is specified for PARAM_TEMPLATE or PARAM_TEMPLATE_NODE then this parameter will be ignored. |
actionTrackingService, CONTENT_READER_NOT_FOUND_MESSAGE, contentService, DEFAULT_RUN_AS_NAME, mimetypeMap, nodeService, PARAM_ENCODING, PARAM_MIME_TYPE, PARAM_PLACEHOLDER_RESOURCE_PATH, PARAM_RUN_AS, PARAM_SOURCE_CONTENT_PROPERTY, PARAM_TARGET_CONTENT_PROPERTY, PARAM_UPDATE_RENDITIONS_ON_ANY_PROPERTY_CHANGE
actionDefinition, applicableTypes, publicAction
adhocPropertiesAllowed, DISPLAY_LABEL, runtimeActionService
name
PARAM_RESULT
Constructor and Description |
---|
BaseTemplateRenderingEngine() |
Modifier and Type | Method and Description |
---|---|
protected abstract Object |
buildModel(AbstractRenderingEngine.RenderingContext context)
Create the model that will be passed to the template service for rendering
with the appropriate template.
|
protected String |
getParamDisplayLabel(String paramName)
This method gets the parameter definition display label from the properties file.
|
protected Collection<ParameterDefinition> |
getParameterDefinitions()
Supplies the list of parameters required by this rendering engine.
|
org.alfresco.service.cmr.search.SearchService |
getSearchService() |
protected org.alfresco.service.cmr.repository.NodeRef |
getTemplateNode(AbstractRenderingEngine.RenderingContext context) |
TemplateService |
getTemplateService() |
protected abstract String |
getTemplateType()
Get the type of template that is to be used.
|
protected void |
render(AbstractRenderingEngine.RenderingContext context) |
void |
setSearchService(org.alfresco.service.cmr.search.SearchService searchService) |
void |
setTemplateService(TemplateService templateService) |
addParameterDefinitions, checkActionIsRenditionDefinition, checkParameterValues, checkSourceNodeExists, createActionDefinition, executeImpl, executeImpl, executeRenditionImpl, getCheckedParam, getDefaultRenditionContentProp, getDefaultRenditionNodeType, getExecutionSummary, getParamWithDefault, getRenditionContentProperty, getTargetEncoding, getTargetMimeType, notifyCallbackOfException, notifyCallbackOfResult, resolveRenditionLocation, setActionTrackingService, setBehaviourFilter, setContentService, setDefaultRenditionContentProp, setDefaultRenditionNodeType, setMimetypeMap, setNodeService, setRenditionLocationResolver, setRenditionService, switchToFinalRenditionNode, tagSourceNodeAsRenditioned, throwWrappedException
execute, getActionDefinition, getIgnoreLock, getQueueName, getTrackStatus, init, isApplicableType, onLogException, setApplicableTypes, setBaseNodeService, setDictionaryService, setIgnoreLock, setLockService, setMlAwareNodeService, setPublicAction, setQueueName, setTrackStatus
checkMandatoryProperties, getAdhocPropertiesAllowed, getDescriptionKey, getLocalizedParameterDefinitions, getParamDisplayLabel, getParameterDefintions, getTitleKey, setAdhocPropertiesAllowed, setLocales, setRuntimeActionService, toString
setBeanName
public static final String PARAM_MODEL
Map
<String
, Serializable
> parameter
can be used to pass additional arguments to the templating engine when processing a
template.public static final String PARAM_TEMPLATE
String
parameter specifies the template in a simple
String
format.public static final String PARAM_TEMPLATE_NODE
NodeRef
parameter specifies a node containing the
template to be processed.public static final String PARAM_TEMPLATE_PATH
String
parameter specifies a file path location for
the template to be processed.protected void render(AbstractRenderingEngine.RenderingContext context)
render
in class AbstractRenderingEngine
protected org.alfresco.service.cmr.repository.NodeRef getTemplateNode(AbstractRenderingEngine.RenderingContext context)
protected abstract Object buildModel(AbstractRenderingEngine.RenderingContext context)
context
- The context of the rendering requestprotected abstract String getTemplateType()
protected String getParamDisplayLabel(String paramName)
getParamDisplayLabel
in class AbstractRenderingEngine
paramName
- the name of the parameterprotected Collection<ParameterDefinition> getParameterDefinitions()
AbstractRenderingEngine
getParameterDefinitions
in class AbstractRenderingEngine
public void setTemplateService(TemplateService templateService)
templateService
- the templateService to setpublic void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
searchService
- the searchService to setpublic TemplateService getTemplateService()
public org.alfresco.service.cmr.search.SearchService getSearchService()
Copyright © 2005–2017 Alfresco Software. All rights reserved.