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 org.alfresco.repo.content.MimetypeMap |
mimetypeMap |
protected org.alfresco.service.cmr.repository.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, publicAction
adhocPropertiesAllowed, DISPLAY_LABEL, runtimeActionService
name
PARAM_RESULT
Constructor and Description |
---|
AbstractRenderingEngine() |
AbstractRenderingEngine(NodeLocator temporaryParentNodeLocator,
org.alfresco.service.namespace.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(org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef) |
protected ActionDefinition |
createActionDefinition(String definitionName)
This method returns an instance of an ActionDefinition implementation class.
|
protected void |
executeImpl(Action action,
org.alfresco.service.cmr.repository.NodeRef sourceNode)
Execute the action implementation
|
protected void |
executeImpl(RenditionDefinition renditionDef,
org.alfresco.service.cmr.repository.NodeRef sourceNode) |
protected void |
executeRenditionImpl(Action action,
org.alfresco.service.cmr.repository.NodeRef sourceNode) |
static <T> T |
getCheckedParam(String paramName,
Class<T> clazz,
RenditionDefinition definition)
Gets the value for the named parameter.
|
protected org.alfresco.service.namespace.QName |
getDefaultRenditionContentProp()
This method returns the QName of the property that defines the location
of the rendition content.
|
protected org.alfresco.service.namespace.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 org.alfresco.service.namespace.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,
org.alfresco.service.cmr.repository.ChildAssociationRef result) |
protected abstract void |
render(AbstractRenderingEngine.RenderingContext context) |
protected RenditionLocation |
resolveRenditionLocation(org.alfresco.service.cmr.repository.NodeRef sourceNode,
RenditionDefinition definition,
org.alfresco.service.cmr.repository.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(org.alfresco.repo.content.MimetypeMap mimetypeMap) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Injects the nodeService bean.
|
void |
setRenditionLocationResolver(RenditionLocationResolver renditionLocationResolver) |
void |
setRenditionService(RenditionService renditionService)
Injects the renditionService bean.
|
protected void |
switchToFinalRenditionNode(RenditionDefinition renditionDef,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef) |
protected void |
tagSourceNodeAsRenditioned(RenditionDefinition renditionDef,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef) |
protected void |
throwWrappedException(Throwable t) |
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
protected static final String CONTENT_READER_NOT_FOUND_MESSAGE
protected static final String DEFAULT_RUN_AS_NAME
protected ContentService contentService
protected org.alfresco.repo.content.MimetypeMap mimetypeMap
protected ActionTrackingService actionTrackingService
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 org.alfresco.service.cmr.repository.NodeService nodeService
public AbstractRenderingEngine(NodeLocator temporaryParentNodeLocator, org.alfresco.service.namespace.QName temporaryRenditionLinkType)
public AbstractRenderingEngine()
public void setNodeService(org.alfresco.service.cmr.repository.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 setDefaultRenditionNodeType(String type)
type
- Stringprotected org.alfresco.service.namespace.QName getDefaultRenditionNodeType()
protected String getTargetMimeType(AbstractRenderingEngine.RenderingContext context)
protected String getTargetEncoding(AbstractRenderingEngine.RenderingContext context)
public void setDefaultRenditionContentProp(String prop)
prop
- Stringprotected org.alfresco.service.namespace.QName getDefaultRenditionContentProp()
public void setContentService(ContentService contentService)
contentService
- the content servicepublic void setMimetypeMap(org.alfresco.repo.content.MimetypeMap mimetypeMap)
public void setActionTrackingService(ActionTrackingService actionTrackingService)
protected ActionDefinition createActionDefinition(String definitionName)
ActionExecuterAbstractBase
ActionDefinitionImpl
, but this could be overridden.createActionDefinition
in class ActionExecuterAbstractBase
protected void executeImpl(Action action, org.alfresco.service.cmr.repository.NodeRef sourceNode)
ActionExecuterAbstractBase
executeImpl
in class ActionExecuterAbstractBase
action
- the actionsourceNode
- the actioned upon nodeprotected void executeImpl(RenditionDefinition renditionDef, org.alfresco.service.cmr.repository.NodeRef sourceNode)
protected void executeRenditionImpl(Action action, org.alfresco.service.cmr.repository.NodeRef sourceNode)
protected void checkParameterValues(Action action)
protected org.alfresco.service.namespace.QName getRenditionContentProperty(RenditionDefinition renditionDefinition)
renditionDefinition
- RenditionDefinitionprotected abstract void render(AbstractRenderingEngine.RenderingContext context)
protected void checkSourceNodeExists(org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
actionedUponNodeRef
- NodeRefprotected RenditionDefinition checkActionIsRenditionDefinition(Action action)
action
- Actionprotected final void addParameterDefinitions(List<ParameterDefinition> paramList)
ParameterizedItemAbstractBase
addParameterDefinitions
in class ParameterizedItemAbstractBase
paramList
- the parameter definitions listprotected String getParamDisplayLabel(String paramName)
getParamDisplayLabel
in class ParameterizedItemAbstractBase
paramName
- 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 null
paramName
- 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 null
T
- TparamName
- StringdefaultValue
- Tdefinition
- RenditionDefinitionprotected void tagSourceNodeAsRenditioned(RenditionDefinition renditionDef, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
protected void switchToFinalRenditionNode(RenditionDefinition renditionDef, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
protected void notifyCallbackOfException(RenditionDefinition renditionDefinition, Throwable t)
protected void throwWrappedException(Throwable t)
protected void notifyCallbackOfResult(RenditionDefinition renditionDefinition, org.alfresco.service.cmr.repository.ChildAssociationRef result)
protected RenditionLocation resolveRenditionLocation(org.alfresco.service.cmr.repository.NodeRef sourceNode, RenditionDefinition definition, org.alfresco.service.cmr.repository.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–2017 Alfresco Software. All rights reserved.