public class RenditionServiceImpl extends Object implements RenditionService, RenditionDefinitionPersister, CheckOutCheckInServicePolicies.BeforeCheckOut, LockServicePolicies.BeforeLock
Policy.Arg
PARAM_DESTINATION_NODE, PARAM_DESTINATION_PATH_TEMPLATE, PARAM_IS_COMPONENT_RENDITION, PARAM_ORPHAN_EXISTING_RENDITION, PARAM_RENDITION_NODETYPE
QNAME
QNAME
Constructor and Description |
---|
RenditionServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
beforeCheckOut(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.cmr.repository.NodeRef destinationParentNodeRef,
org.alfresco.service.namespace.QName destinationAssocTypeQName,
org.alfresco.service.namespace.QName destinationAssocQName) |
void |
beforeLock(org.alfresco.service.cmr.repository.NodeRef nodeRef,
LockType lockType)
Called before an attempt to lock the given node is made.
|
void |
cancelRenditions(org.alfresco.service.cmr.repository.NodeRef sourceNode)
Cancels all known cancellable running renditions for the given
NodeRef via the ActionTrackingService . |
void |
cancelRenditions(org.alfresco.service.cmr.repository.NodeRef sourceNode,
String type)
Cancels all known cancellable running renditions for the given
NodeRef and type via the ActionTrackingService . |
CompositeRenditionDefinition |
createCompositeRenditionDefinition(org.alfresco.service.namespace.QName renditionName)
Creates a new
CompositeRenditionDefinition and sets the rendition
name and the rendering engine name to the specified values. |
RenditionDefinition |
createRenditionDefinition(org.alfresco.service.namespace.QName renditionDefinitionName,
String renderingEngineName)
Creates a new
RenditionDefinition and sets the rendition name and
the rendering engine name to the specified values. |
RenderingEngineDefinition |
getRenderingEngineDefinition(String name)
Returns the
RenderingEngineDefinition associated with the
specified rendering engine name. |
List<RenderingEngineDefinition> |
getRenderingEngineDefinitions() |
org.alfresco.service.cmr.repository.ChildAssociationRef |
getRenditionByName(org.alfresco.service.cmr.repository.NodeRef node,
org.alfresco.service.namespace.QName renditionName)
This method gets the rendition of the specified node identified by
the provided rendition name.
|
List<org.alfresco.service.cmr.repository.ChildAssociationRef> |
getRenditions(org.alfresco.service.cmr.repository.NodeRef node)
This method gets all the renditions of the specified node.
|
List<org.alfresco.service.cmr.repository.ChildAssociationRef> |
getRenditions(org.alfresco.service.cmr.repository.NodeRef node,
String mimeTypePrefix)
This method gets all the renditions of the specified node filtered by
MIME-type prefix.
|
org.alfresco.service.cmr.repository.ChildAssociationRef |
getSourceNode(org.alfresco.service.cmr.repository.NodeRef renditionNode)
This method gets the source node for the specified rendition node.
|
void |
init() |
boolean |
isRendition(org.alfresco.service.cmr.repository.NodeRef node)
This method returns
true if the specified NodeRef is a valid
rendition node, else false . |
RenditionDefinition |
loadRenditionDefinition(org.alfresco.service.namespace.QName renditionDefinitionName)
This method retrieves a
RenditionDefinition that has been stored
in the repository using the save() method. |
List<RenditionDefinition> |
loadRenditionDefinitions()
This method retrieves the
RenditionDefinition s that have been
stored in the repository using the save() method. |
List<RenditionDefinition> |
loadRenditionDefinitions(String renditionEngineName)
This method retrieves the stored
RenditionDefinition s that have
been registered for the specified rendering engine name. |
org.alfresco.service.cmr.repository.ChildAssociationRef |
render(org.alfresco.service.cmr.repository.NodeRef sourceNode,
org.alfresco.service.namespace.QName renditionDefinitionQName)
This method synchronously renders content as specified by the given
rendition name . |
void |
render(org.alfresco.service.cmr.repository.NodeRef sourceNode,
org.alfresco.service.namespace.QName renditionDefinitionQName,
RenderCallback callback)
This method asynchronously renders content as specified by the given
rendition definition name . |
org.alfresco.service.cmr.repository.ChildAssociationRef |
render(org.alfresco.service.cmr.repository.NodeRef sourceNode,
RenditionDefinition definition)
This method synchronously renders content as specified by the given
RenditionDefinition . |
void |
render(org.alfresco.service.cmr.repository.NodeRef sourceNode,
RenditionDefinition definition,
RenderCallback callback)
This method asynchronously renders content as specified by the given
RenditionDefinition . |
void |
saveRenditionDefinition(RenditionDefinition renderingAction)
This method serializes the
RenditionDefinition and stores it in
the repository. |
void |
setActionService(ActionService actionService)
Injects the ActionService bean.
|
void |
setActionTrackingService(ActionTrackingService actionTrackingService)
Injects the ActionTrackingService bean.
|
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Injects the DictionaryService bean.
|
void |
setKnownCancellableActionTypes(List<String> knownCancellableActionTypes)
Sets the list of known cancellable actions used by
cancelRenditions(NodeRef) . |
void |
setPolicyComponent(PolicyComponent policyComponent)
Injects the PolicyComponent bean.
|
void |
setRenditionDefinitionPersister(RenditionDefinitionPersister renditionDefinitionPersister)
Injects the RenditionDefinitionPersister bean.
|
void |
setRenditionPreventionRegistry(RenditionPreventionRegistry registry) |
void |
setServiceRegistry(ServiceRegistry serviceRegistry)
Injects the ServiceRegistry bean.
|
public void setRenditionDefinitionPersister(RenditionDefinitionPersister renditionDefinitionPersister)
renditionDefinitionPersister
- RenditionDefinitionPersisterpublic void setRenditionPreventionRegistry(RenditionPreventionRegistry registry)
public void setServiceRegistry(ServiceRegistry serviceRegistry)
serviceRegistry
- ServiceRegistrypublic void setActionService(ActionService actionService)
actionService
- ActionServicepublic void setActionTrackingService(ActionTrackingService actionTrackingService)
actionTrackingService
- ActionTrackingServicepublic void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
dictionaryService
- DictionaryServicepublic void setPolicyComponent(PolicyComponent policyComponent)
policyComponent
- PolicyComponentpublic void setKnownCancellableActionTypes(List<String> knownCancellableActionTypes)
cancelRenditions(NodeRef)
.public void init()
public RenderingEngineDefinition getRenderingEngineDefinition(String name)
RenditionService
RenderingEngineDefinition
associated with the
specified rendering engine name.getRenderingEngineDefinition
in interface RenditionService
name
- The rendering engine name.RenderingEngineDefinition
or null.public List<RenderingEngineDefinition> getRenderingEngineDefinitions()
getRenderingEngineDefinitions
in interface RenditionService
List
of all available RenderingEngineDefinition
s.public RenditionDefinition createRenditionDefinition(org.alfresco.service.namespace.QName renditionDefinitionName, String renderingEngineName)
RenditionService
RenditionDefinition
and sets the rendition name and
the rendering engine name to the specified values.createRenditionDefinition
in interface RenditionService
renditionDefinitionName
- A unique identifier used to specify the created
RenditionDefinition
.renderingEngineName
- The name of the rendering engine associated
with this RenditionDefinition
.RenditionDefinition
.public CompositeRenditionDefinition createCompositeRenditionDefinition(org.alfresco.service.namespace.QName renditionName)
RenditionService
CompositeRenditionDefinition
and sets the rendition
name and the rendering engine name to the specified values.createCompositeRenditionDefinition
in interface RenditionService
renditionName
- A unique identifier used to specify the created
RenditionDefinition
.CompositeRenditionDefinition
.public org.alfresco.service.cmr.repository.ChildAssociationRef render(org.alfresco.service.cmr.repository.NodeRef sourceNode, RenditionDefinition definition)
RenditionService
RenditionDefinition
. The content to be rendered is provided by
the specified source node.render
in interface RenditionService
sourceNode
- the node from which the content is retrieved.definition
- this fully specifies the rendition which is to
be performed.public void render(org.alfresco.service.cmr.repository.NodeRef sourceNode, RenditionDefinition definition, RenderCallback callback)
RenditionService
RenditionDefinition
. The content to be rendered is provided by
the specified source node.render
in interface RenditionService
sourceNode
- the node from which the content is retrieved.definition
- this fully specifies the rendition which is to
be performed.callback
- a callback object to handle the ultimate result of the rendition.public org.alfresco.service.cmr.repository.ChildAssociationRef render(org.alfresco.service.cmr.repository.NodeRef sourceNode, org.alfresco.service.namespace.QName renditionDefinitionQName)
RenditionService
rendition name
.
The content to be rendered is provided by the specified source node.
The Rendition Definition will be loaded from the standard location as system
thus allowing rendition definitions to be used even when the Data Dictionary
has restricted read access.render
in interface RenditionService
sourceNode
- the node from which the content is retrieved.renditionDefinitionQName
- the rendition definition which is to
be performed.public void render(org.alfresco.service.cmr.repository.NodeRef sourceNode, org.alfresco.service.namespace.QName renditionDefinitionQName, RenderCallback callback)
RenditionService
rendition definition name
.
The content to be rendered is provided by the specified source node.
The Rendition Definition will be loaded from the standard location as system
thus allowing rendition definitions to be used even when the Data Dictionary
has restricted read access.render
in interface RenditionService
sourceNode
- the node from which the content is retrieved.renditionDefinitionQName
- the rendition definition which is to
be performed.callback
- a callback object to handle the ultimate result of the rendition.public void saveRenditionDefinition(RenditionDefinition renderingAction)
RenditionDefinitionPersister
RenditionDefinition
and stores it in
the repository. RenditionDefinition
s saved in this way may be
retrieved using the load()
method.saveRenditionDefinition
in interface RenditionDefinitionPersister
renderingAction
- The RenditionDefinition
to be
persisted.public RenditionDefinition loadRenditionDefinition(org.alfresco.service.namespace.QName renditionDefinitionName)
RenditionDefinitionPersister
RenditionDefinition
that has been stored
in the repository using the save()
method. If no
RenditionDefinition
exists in the repository with the specified
rendition name then this method returns null.loadRenditionDefinition
in interface RenditionDefinitionPersister
renditionDefinitionName
- The unique identifier used to specify the
RenditionDefinition
to retrieve.RenditionDefinition
or null.public List<RenditionDefinition> loadRenditionDefinitions()
RenditionDefinitionPersister
RenditionDefinition
s that have been
stored in the repository using the save()
method.
If there are no such RenditionDefinition
s, an empty list is
returned.loadRenditionDefinitions
in interface RenditionDefinitionPersister
RenditionDefinition
s.public List<RenditionDefinition> loadRenditionDefinitions(String renditionEngineName)
RenditionDefinitionPersister
RenditionDefinition
s that have
been registered for the specified rendering engine name.
If there are no such rendering RenditionDefinition
s, an empty
list is returned.loadRenditionDefinitions
in interface RenditionDefinitionPersister
renditionEngineName
- the name of a rendering engine. This is
usually the spring bean name.RenditionDefinition
s.RenditionDefinitionPersister.saveRenditionDefinition(RenditionDefinition)
public List<org.alfresco.service.cmr.repository.ChildAssociationRef> getRenditions(org.alfresco.service.cmr.repository.NodeRef node)
RenditionService
getRenditions
in interface RenditionService
public List<org.alfresco.service.cmr.repository.ChildAssociationRef> getRenditions(org.alfresco.service.cmr.repository.NodeRef node, String mimeTypePrefix)
RenditionService
getRenditions
in interface RenditionService
node
- the source node for the renditionsmimeTypePrefix
- a prefix to check against the rendition MIME-types.
This must not be null and must not be an empty Stringpublic org.alfresco.service.cmr.repository.ChildAssociationRef getRenditionByName(org.alfresco.service.cmr.repository.NodeRef node, org.alfresco.service.namespace.QName renditionName)
RenditionService
getRenditionByName
in interface RenditionService
node
- the source node for the renditionsrenditionName
- the renditionName used to identify a rendition.null
if there is no such rendition.public boolean isRendition(org.alfresco.service.cmr.repository.NodeRef node)
RenditionService
true
if the specified NodeRef is a valid
rendition node, else false
. A nodeRef is a rendition node
if it has the rn:rendition aspect (or sub-aspect) applied.isRendition
in interface RenditionService
node
- NodeReftrue
if a rendition, else false
public org.alfresco.service.cmr.repository.ChildAssociationRef getSourceNode(org.alfresco.service.cmr.repository.NodeRef renditionNode)
RenditionService
getSourceNode
in interface RenditionService
renditionNode
- the nodeRef holding the rendition.null
if there is no source node.RenditionService.isRendition(NodeRef)
public void cancelRenditions(org.alfresco.service.cmr.repository.NodeRef sourceNode)
RenditionService
NodeRef
via the ActionTrackingService
.cancelRenditions
in interface RenditionService
sourceNode
- the NodeRef
the action is acting onpublic void cancelRenditions(org.alfresco.service.cmr.repository.NodeRef sourceNode, String type)
RenditionService
NodeRef
and type via the ActionTrackingService
.cancelRenditions
in interface RenditionService
sourceNode
- the NodeRef
the action is acting ontype
- the rendition type (rending engine name)public void beforeCheckOut(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef destinationParentNodeRef, org.alfresco.service.namespace.QName destinationAssocTypeQName, org.alfresco.service.namespace.QName destinationAssocQName)
beforeCheckOut
in interface CheckOutCheckInServicePolicies.BeforeCheckOut
nodeRef
- NodeRefdestinationParentNodeRef
- NodeRefdestinationAssocTypeQName
- QNamedestinationAssocQName
- QNamepublic void beforeLock(org.alfresco.service.cmr.repository.NodeRef nodeRef, LockType lockType)
LockServicePolicies.BeforeLock
beforeLock
in interface LockServicePolicies.BeforeLock
nodeRef
- NodeReflockType
- LockTypeCopyright © 2005–2017 Alfresco Software. All rights reserved.