|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.action.CommonResourceAbstractBase
org.alfresco.repo.action.ParameterizedItemAbstractBase
org.alfresco.repo.action.executer.ActionExecuterAbstractBase
org.alfresco.repo.rendition.executer.AbstractRenderingEngine
public abstract class AbstractRenderingEngine
This class adds some new behaviour to the standard ActionExecuterAbstractBase in order to support the RenditionService.
Nested Class Summary | |
---|---|
protected class |
AbstractRenderingEngine.RenderingContext
|
Field Summary | |
---|---|
protected static java.lang.String |
CONTENT_READER_NOT_FOUND_MESSAGE
|
protected ContentService |
contentService
|
protected org.alfresco.repo.content.MimetypeMap |
mimetypeMap
|
protected org.alfresco.service.cmr.repository.NodeService |
nodeService
|
static java.lang.String |
PARAM_ENCODING
This optional String paramter specifies the encoding used to
create the rendition content. |
static java.lang.String |
PARAM_MIME_TYPE
This optional String parameter specifies the mime type of the
rendition content. |
static java.lang.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 java.lang.String |
PARAM_RUN_AS
This optional String parameter specifies what user permissions
are used when creating a rendition. |
static java.lang.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 java.lang.String |
PARAM_TARGET_CONTENT_PROPERTY
This optional QName parameter specifies which property the
Rendering Engine uses to write content to the rendition node. |
static java.lang.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. |
Fields inherited from class org.alfresco.repo.action.executer.ActionExecuterAbstractBase |
---|
actionDefinition, applicableTypes, publicAction |
Fields inherited from class org.alfresco.repo.action.ParameterizedItemAbstractBase |
---|
DISPLAY_LABEL, runtimeActionService |
Fields inherited from class org.alfresco.repo.action.CommonResourceAbstractBase |
---|
name |
Fields inherited from interface org.alfresco.repo.action.executer.ActionExecuter |
---|
PARAM_RESULT |
Constructor Summary | |
---|---|
AbstractRenderingEngine()
|
|
AbstractRenderingEngine(NodeLocator temporaryParentNodeLocator,
org.alfresco.service.namespace.QName temporaryRenditionLinkType)
|
Method Summary | |
---|---|
protected void |
addParameterDefinitions(java.util.List 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(java.lang.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 java.lang.Object |
getCheckedParam(java.lang.String paramName,
java.lang.Class 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 java.lang.String |
getParamDisplayLabel(java.lang.String paramName)
This method gets the parameter definition display label from the properties file. |
protected java.util.Collection |
getParameterDefinitions()
Supplies the list of parameters required by this rendering engine. |
static java.lang.Object |
getParamWithDefault(java.lang.String paramName,
java.lang.Object defaultValue,
RenditionDefinition definition)
Gets the value for the named parameter. |
protected org.alfresco.service.namespace.QName |
getRenditionContentProperty(RenditionDefinition renditionDefinition)
|
protected java.lang.String |
getTargetEncoding(AbstractRenderingEngine.RenderingContext context)
|
protected java.lang.String |
getTargetMimeType(AbstractRenderingEngine.RenderingContext context)
|
protected void |
notifyCallbackOfException(RenditionDefinition renditionDefinition,
java.lang.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 |
setBehaviourFilter(BehaviourFilter behaviourFilter)
|
void |
setContentService(ContentService contentService)
Set the content service |
void |
setDefaultRenditionContentProp(java.lang.String prop)
Sets the default rendition content property. |
void |
setDefaultRenditionNodeType(java.lang.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(java.lang.Throwable t)
|
Methods inherited from class org.alfresco.repo.action.executer.ActionExecuterAbstractBase |
---|
execute, getActionDefinition, getIgnoreLock, getQueueName, getTrackStatus, init, setApplicableTypes, setBaseNodeService, setIgnoreLock, setLockService, setPublicAction, setQueueName, setTrackStatus |
Methods inherited from class org.alfresco.repo.action.ParameterizedItemAbstractBase |
---|
checkMandatoryProperties, getAdhocPropertiesAllowed, getDescriptionKey, getParameterDefintions, getTitleKey, setRuntimeActionService, toString |
Methods inherited from class org.alfresco.repo.action.CommonResourceAbstractBase |
---|
setBeanName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String CONTENT_READER_NOT_FOUND_MESSAGE
protected ContentService contentService
protected org.alfresco.repo.content.MimetypeMap mimetypeMap
public static final java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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
Constructor Detail |
---|
public AbstractRenderingEngine(NodeLocator temporaryParentNodeLocator, org.alfresco.service.namespace.QName temporaryRenditionLinkType)
public AbstractRenderingEngine()
Method Detail |
---|
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- the nodeService.public void setRenditionService(RenditionService renditionService)
renditionService
- public void setBehaviourFilter(BehaviourFilter behaviourFilter)
behaviourFilter
- policy behaviour filterpublic void setRenditionLocationResolver(RenditionLocationResolver renditionLocationResolver)
public void setDefaultRenditionNodeType(java.lang.String type)
type
- protected org.alfresco.service.namespace.QName getDefaultRenditionNodeType()
protected java.lang.String getTargetMimeType(AbstractRenderingEngine.RenderingContext context)
protected java.lang.String getTargetEncoding(AbstractRenderingEngine.RenderingContext context)
public void setDefaultRenditionContentProp(java.lang.String prop)
prop
- protected org.alfresco.service.namespace.QName getDefaultRenditionContentProp()
public void setContentService(ContentService contentService)
contentService
- the content servicepublic void setMimetypeMap(org.alfresco.repo.content.MimetypeMap mimetypeMap)
protected ActionDefinition createActionDefinition(java.lang.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
-
protected abstract void render(AbstractRenderingEngine.RenderingContext context)
protected void checkSourceNodeExists(org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
actionedUponNodeRef
- protected RenditionDefinition checkActionIsRenditionDefinition(Action action)
action
- protected final void addParameterDefinitions(java.util.List paramList)
ParameterizedItemAbstractBase
addParameterDefinitions
in class ParameterizedItemAbstractBase
paramList
- the parameter definitions listprotected java.lang.String getParamDisplayLabel(java.lang.String paramName)
getParamDisplayLabel
in class ParameterizedItemAbstractBase
paramName
- the name of the parameter
protected java.util.Collection getParameterDefinitions()
public static java.lang.Object getCheckedParam(java.lang.String paramName, java.lang.Class 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 java.lang.Object getParamWithDefault(java.lang.String paramName, java.lang.Object defaultValue, RenditionDefinition definition)
defaultValue
and throws a
RenditionServiceException
if it isn't. Returns
defaultValue
if the parameter value is null
paramName
- defaultValue
- definition
-
protected 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, java.lang.Throwable t)
protected void throwWrappedException(java.lang.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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |