Package org.alfresco.repo.rendition2
Interface RenditionService2
- All Known Implementing Classes:
RenditionService2Impl
public interface RenditionService2
The Async Rendition service. Replaces the original rendition services which included synchronous renditions and asynchronous methods with Java call backs.
Renditions are defined as
RenditionDefinition2s and may be registered and looked by the associated RenditionDefinitionRegistry2.
Unlike the original RenditionService this service, it:
- Performs async renditions without a Java callback, as another node in the cluster may complete the rendition. The current node requests a transform, but another node might take the resulting transform and turn it into a rendition if the external Transform Service is used.
- Reduces the configurable options to do with with the associations of rendition nodes, their type. They are identical to 'hidden' (not normally seen as nodes in their own right in a UI) renditions produced by the original service. So, they are always directly under the source node connected by a rn:rendition association with the name of the rendition.
- The rendition nodes additionally have a rn:rendition2 aspect and a contentUrlHashCode property. This property contains a value that allows the service to work out if it holds a rendition of the source node's current content.
- Failures are handled by setting the rendition node's content to null.
- When a rendition is requested via the REST API, only the newer service is used.
- Where possible old service renditions migrate automatically over to the new service when content on a source node is updated.
- Author:
- adavis
-
Method Summary
Modifier and TypeMethodDescriptionvoidclearRenditionContentDataInTransaction(NodeRef renditionNode) This method clears source nodeRef rendition content and content hash code using supplied rendition name.voidforceRenditionsContentHashCode(NodeRef sourceNodeRef) This method forces the content hash code for everysourceNodeRefrenditions.getRenditionByName(NodeRef sourceNodeRef, String renditionName) This method gets the rendition of thesourceNodeRefidentified by its name.getRenditions(NodeRef sourceNodeRef) This method gets all the renditions of thesourceNodeRef.booleanIndicates if renditions are enabled.voidThis method asynchronously renders content as specified by therenditionName.voidtransform(NodeRef sourceNodeRef, TransformDefinition transformDefinition) This method asynchronously transforms content to a target mimetype with transform options supplied in thetransformDefinition.
-
Method Details
-
getRenditionDefinitionRegistry2
RenditionDefinitionRegistry2 getRenditionDefinitionRegistry2()- Returns:
- the
RenditionDefinitionRegistry2being used by the service.
-
transform
This method asynchronously transforms content to a target mimetype with transform options supplied in thetransformDefinition. A response is set on a message queue once the transform is complete or fails, together with some client supplied data. The response queue and client data are also included in the transformDefinition.This method does not create a rendition node, but uses the same code as renditions to perform the transform. The
transformDefinitionextendsRenditionDefinition2, but is not stored in aRenditionDefinitionRegistry2, as it is transient in nature.- Parameters:
sourceNodeRef- the node from which the content is retrieved.transformDefinition- which defines the transform, where to sent the response and some client specified data.- Throws:
UnsupportedOperationException- if the transform is not supported.
-
render
This method asynchronously renders content as specified by therenditionName. The content to be rendered is provided bysourceNodeRef.- Parameters:
sourceNodeRef- the node from which the content is retrieved.renditionName- the rendition to be performed.- Throws:
UnsupportedOperationException- if the transform is not supported AND the rendition has not been created before.
-
getRenditions
This method gets all the renditions of thesourceNodeRef.- Returns:
- a list of
ChildAssociationRefs which link thesourceNodeRefto the renditions.
-
getRenditionByName
This method gets the rendition of thesourceNodeRefidentified by its name.- Parameters:
sourceNodeRef- the source node for the renditionsrenditionName- the renditionName used to identify a rendition.- Returns:
- the
ChildAssociationRefwhich links the source node to the rendition ornullif there is no rendition or it is not up to date.
-
clearRenditionContentDataInTransaction
This method clears source nodeRef rendition content and content hash code using supplied rendition name.- Parameters:
renditionNode- the rendition node
-
isEnabled
boolean isEnabled()Indicates if renditions are enabled. Set using thesystem.thumbnail.generatevalue. -
forceRenditionsContentHashCode
This method forces the content hash code for everysourceNodeRefrenditions.- Parameters:
sourceNodeRef- the source node to update renditions hash code
-