public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractRenderingEngine.RenderingContext |
| Modifier and Type | Field and Description |
|---|---|
protected ActionTrackingService |
actionTrackingService |
protected static String |
CONTENT_READER_NOT_FOUND_MESSAGE |
protected ContentService |
contentService |
protected static String |
DEFAULT_RUN_AS_NAME |
protected MimetypeMap |
mimetypeMap |
protected NamespaceService |
namespaceService |
protected NodeService |
nodeService |
static String |
PARAM_ENCODING
This optional
String paramter specifies the encoding used to
create the rendition content. |
static String |
PARAM_MIME_TYPE
This optional
String parameter specifies the mime type of the
rendition content. |
static String |
PARAM_PLACEHOLDER_RESOURCE_PATH
This optional
String parameter specifies the location of a
classpath resource which can be used as a placeholder while a rendition
is being generated. |
static String |
PARAM_RUN_AS
This optional
String parameter specifies what user permissions
are used when creating a rendition. |
static String |
PARAM_SOURCE_CONTENT_PROPERTY
This optional
QName parameter specifies which property the
Rendering Engine uses to read content from the source node in order to
create a rendition. |
static String |
PARAM_TARGET_CONTENT_PROPERTY
This optional
QName parameter specifies which property the
Rendering Engine uses to write content to the rendition node. |
static String |
PARAM_UPDATE_RENDITIONS_ON_ANY_PROPERTY_CHANGE
This optional
Boolean flag property specifies whether a rendition
should be updated automatically if the source node changes. |
actionDefinition, applicableTypes, publicActionadhocPropertiesAllowed, DISPLAY_LABEL, runtimeActionServicenamePARAM_RESULT| Constructor and Description |
|---|
AbstractRenderingEngine() |
AbstractRenderingEngine(NodeLocator temporaryParentNodeLocator,
QName temporaryRenditionLinkType) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addParameterDefinitions(List<ParameterDefinition> paramList)
Adds the parameter definitions to the list
|
protected RenditionDefinition |
checkActionIsRenditionDefinition(Action action) |
protected void |
checkParameterValues(Action action)
This method can be overridden by subclasses to provide checking of parameter
values.
|
protected void |
checkSourceNodeExists(NodeRef actionedUponNodeRef) |
protected ActionDefinition |
createActionDefinition(String definitionName)
This method returns an instance of an ActionDefinition implementation class.
|
protected void |
executeImpl(Action action,
NodeRef sourceNode)
Execute the action implementation
|
protected void |
executeImpl(RenditionDefinition renditionDef,
NodeRef sourceNode) |
protected void |
executeRenditionImpl(Action action,
NodeRef sourceNode) |
static <T> T |
getCheckedParam(String paramName,
Class<T> clazz,
RenditionDefinition definition)
Gets the value for the named parameter.
|
protected QName |
getDefaultRenditionContentProp()
This method returns the QName of the property that defines the location
of the rendition content.
|
protected QName |
getDefaultRenditionNodeType()
This method returns the type of the default rendition node type.
|
protected ExecutionSummary |
getExecutionSummary(AbstractRenderingEngine.RenderingContext renderingContext)
|
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.
|
static <T> T |
getParamWithDefault(String paramName,
T defaultValue,
RenditionDefinition definition)
Gets the value for the named parameter.
|
protected QName |
getRenditionContentProperty(RenditionDefinition renditionDefinition) |
protected String |
getTargetEncoding(AbstractRenderingEngine.RenderingContext context) |
protected String |
getTargetMimeType(AbstractRenderingEngine.RenderingContext context) |
protected void |
notifyCallbackOfException(RenditionDefinition renditionDefinition,
Throwable t) |
protected void |
notifyCallbackOfResult(RenditionDefinition renditionDefinition,
ChildAssociationRef result) |
protected abstract void |
render(AbstractRenderingEngine.RenderingContext context) |
protected RenditionLocation |
resolveRenditionLocation(NodeRef sourceNode,
RenditionDefinition definition,
NodeRef tempRendition)
Given a rendition definition, a source node and a temporary rendition node, this method uses a
RenditionLocationResolver to calculate the RenditionLocation of the rendition. |
void |
setActionTrackingService(ActionTrackingService actionTrackingService) |
void |
setBehaviourFilter(BehaviourFilter behaviourFilter) |
void |
setContentService(ContentService contentService)
Set the content service
|
void |
setDefaultRenditionContentProp(String prop)
Sets the default rendition content property.
|
void |
setDefaultRenditionNodeType(String type)
Sets the default rendition-node type.
|
void |
setMimetypeMap(MimetypeMap mimetypeMap) |
void |
setNamespaceService(NamespaceService namespaceService) |
void |
setNodeService(NodeService nodeService)
Injects the nodeService bean.
|
void |
setRenditionLocationResolver(RenditionLocationResolver renditionLocationResolver) |
void |
setRenditionService(RenditionService renditionService)
Injects the renditionService bean.
|
protected void |
switchToFinalRenditionNode(RenditionDefinition renditionDef,
NodeRef actionedUponNodeRef) |
protected void |
tagSourceNodeAsRenditioned(RenditionDefinition renditionDef,
NodeRef actionedUponNodeRef) |
protected void |
throwWrappedException(Throwable t) |
execute, getActionDefinition, getIgnoreLock, getQueueName, getTrackStatus, init, isApplicableType, onLogException, setApplicableTypes, setBaseNodeService, setDictionaryService, setIgnoreLock, setLockService, setMlAwareNodeService, setPublicAction, setQueueName, setTrackStatuscheckMandatoryProperties, getAdhocPropertiesAllowed, getDescriptionKey, getLocalizedParameterDefinitions, getParamDisplayLabel, getParameterDefintions, getTitleKey, setAdhocPropertiesAllowed, setLocales, setRuntimeActionService, toStringsetBeanNameprotected static final String CONTENT_READER_NOT_FOUND_MESSAGE
protected static final String DEFAULT_RUN_AS_NAME
protected ContentService contentService
protected MimetypeMap mimetypeMap
protected ActionTrackingService actionTrackingService
protected NamespaceService namespaceService
public static final String PARAM_PLACEHOLDER_RESOURCE_PATH
String parameter specifies the location of a
classpath resource which can be used as a placeholder while a rendition
is being generated. For example, this might be a simple icon to indicate
a rendition is not yet available. This is intended to be used in
conjunction with asynchronous generation of renditions.public static final String PARAM_SOURCE_CONTENT_PROPERTY
QName parameter specifies which property the
Rendering Engine uses to read content from the source node in order to
create a rendition. By default this property will be cm:content.public static final String PARAM_TARGET_CONTENT_PROPERTY
QName parameter specifies which property the
Rendering Engine uses to write content to the rendition node. By default
the property used is cm:content.public static final String PARAM_UPDATE_RENDITIONS_ON_ANY_PROPERTY_CHANGE
Boolean flag property specifies whether a rendition
should be updated automatically if the source node changes. If set to
true then the rendition will be re-rendered any time any
property changes occur on the source node. This parameter defaults to
false.public static final String PARAM_RUN_AS
String parameter specifies what user permissions
are used when creating a rendition. By default the system user is used.public static final String PARAM_MIME_TYPE
String parameter specifies the mime type of the
rendition content. This defaults to the mime type of the source node
content.public static final String PARAM_ENCODING
String paramter specifies the encoding used to
create the rendition content. The derfault encoding is UTF-8.protected NodeService nodeService
public AbstractRenderingEngine(NodeLocator temporaryParentNodeLocator, QName temporaryRenditionLinkType)
public AbstractRenderingEngine()
public void setNodeService(NodeService nodeService)
nodeService - the nodeService.public void setRenditionService(RenditionService renditionService)
renditionService - RenditionServicepublic void setBehaviourFilter(BehaviourFilter behaviourFilter)
behaviourFilter - policy behaviour filterpublic void setRenditionLocationResolver(RenditionLocationResolver renditionLocationResolver)
public void setNamespaceService(NamespaceService namespaceService)
public void setDefaultRenditionNodeType(String type)
type - Stringprotected QName getDefaultRenditionNodeType()
protected String getTargetMimeType(AbstractRenderingEngine.RenderingContext context)
protected String getTargetEncoding(AbstractRenderingEngine.RenderingContext context)
public void setDefaultRenditionContentProp(String prop)
prop - Stringprotected QName getDefaultRenditionContentProp()
public void setContentService(ContentService contentService)
contentService - the content servicepublic void setMimetypeMap(MimetypeMap mimetypeMap)
public void setActionTrackingService(ActionTrackingService actionTrackingService)
protected ActionDefinition createActionDefinition(String definitionName)
ActionExecuterAbstractBaseActionDefinitionImpl, but this could be overridden.createActionDefinition in class ActionExecuterAbstractBaseprotected void executeImpl(Action action, NodeRef sourceNode)
ActionExecuterAbstractBaseexecuteImpl in class ActionExecuterAbstractBaseaction - the actionsourceNode - the actioned upon nodeprotected void executeImpl(RenditionDefinition renditionDef, NodeRef sourceNode)
protected void checkParameterValues(Action action)
protected QName getRenditionContentProperty(RenditionDefinition renditionDefinition)
renditionDefinition - RenditionDefinitionprotected abstract void render(AbstractRenderingEngine.RenderingContext context)
protected void checkSourceNodeExists(NodeRef actionedUponNodeRef)
actionedUponNodeRef - NodeRefprotected RenditionDefinition checkActionIsRenditionDefinition(Action action)
action - Actionprotected final void addParameterDefinitions(List<ParameterDefinition> paramList)
ParameterizedItemAbstractBaseaddParameterDefinitions in class ParameterizedItemAbstractBaseparamList - the parameter definitions listprotected String getParamDisplayLabel(String paramName)
getParamDisplayLabel in class ParameterizedItemAbstractBaseparamName - the name of the parameterprotected Collection<ParameterDefinition> getParameterDefinitions()
public static <T> T getCheckedParam(String paramName, Class<T> clazz, RenditionDefinition definition)
RenditionServiceException if it isn't.
Returns null if the parameter value is nullparamName - the name of the parameter being checked.clazz - the expected Class of the parameter value.definition - the RenditionDefinition containing the
parameters.null.public static <T> T getParamWithDefault(String paramName, T defaultValue, RenditionDefinition definition)
defaultValue and throws a
RenditionServiceException if it isn't. Returns
defaultValue if the parameter value is nullT - TparamName - StringdefaultValue - Tdefinition - RenditionDefinitionprotected void tagSourceNodeAsRenditioned(RenditionDefinition renditionDef, NodeRef actionedUponNodeRef)
protected void switchToFinalRenditionNode(RenditionDefinition renditionDef, NodeRef actionedUponNodeRef)
protected void notifyCallbackOfException(RenditionDefinition renditionDefinition, Throwable t)
protected void throwWrappedException(Throwable t)
protected void notifyCallbackOfResult(RenditionDefinition renditionDefinition, ChildAssociationRef result)
protected RenditionLocation resolveRenditionLocation(NodeRef sourceNode, RenditionDefinition definition, NodeRef tempRendition)
RenditionLocationResolver to calculate the RenditionLocation of the rendition.protected ExecutionSummary getExecutionSummary(AbstractRenderingEngine.RenderingContext renderingContext)
ExecutionSummary for the given renderingContext
from the ActionTrackingService.
Note that multiple summaries of the same action instance are not currently supported.
renderingContext - the rendering contextCopyright © 2005–2020 Alfresco Software. All rights reserved.