Package org.alfresco.repo.rendition2
Class RenditionService2Impl
java.lang.Object
org.alfresco.repo.rendition2.RenditionService2Impl
- All Implemented Interfaces:
ContentServicePolicies.OnContentUpdatePolicy,ClassPolicy,Policy,RenditionService2,org.springframework.beans.factory.InitializingBean
public class RenditionService2Impl
extends Object
implements RenditionService2, org.springframework.beans.factory.InitializingBean, ContentServicePolicies.OnContentUpdatePolicy
The Async Rendition service. Replaces the original deprecated RenditionService.
- Author:
- adavis
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final QNamestatic final Stringstatic final Stringstatic final intstatic final intstatic final StringFields inherited from interface org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy
QNAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclearRenditionContentData(NodeRef sourceNodeRef, String renditionName) Clears source nodeRef rendition content and content hash code using supplied rendition namevoidclearRenditionContentDataInTransaction(NodeRef renditionNode) This method clears source nodeRef rendition content and content hash code using supplied rendition name.voidconsume(NodeRef sourceNodeRef, InputStream transformInputStream, RenditionDefinition2 renditionDefinition, int transformContentHashCode) voiddeleteRendition(NodeRef sourceNodeRef, String renditionName) voidfailure(NodeRef sourceNodeRef, RenditionDefinition2 renditionDefinition, int transformContentHashCode) 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.booleanisCreatedByRenditionService2(NodeRef sourceNodeRef, String renditionName) booleanIndicates if renditions are enabled.booleanisRenditionAvailable(NodeRef sourceNodeRef, NodeRef renditionNode) Indicates if the rendition is available.booleanvoidonContentUpdate(NodeRef sourceNodeRef, boolean newContent) voidThis method asynchronously renders content as specified by therenditionName.voidsetAsynchronousExtractor(AsynchronousExtractor asynchronousExtractor) voidsetBehaviourFilter(BehaviourFilter behaviourFilter) voidsetContentService(ContentService contentService) voidsetEnabled(boolean enabled) voidsetNodeService(NodeService nodeService) voidsetPolicyComponent(PolicyComponent policyComponent) voidsetRenditionDefinitionRegistry2(RenditionDefinitionRegistry2 renditionDefinitionRegistry2) voidsetRenditionPreventionRegistry(RenditionPreventionRegistry renditionPreventionRegistry) voidsetRenditionRequestSheduler(PostTxnCallbackScheduler renditionRequestSheduler) voidsetRuleService(RuleService ruleService) voidsetThumbnailsEnabled(boolean thumbnailsEnabled) voidsetTransactionService(TransactionService transactionService) voidsetTransformClient(TransformClient transformClient) voidsetTransformReplyProvider(TransformReplyProvider transformReplyProvider) voidtransform(NodeRef sourceNodeRef, TransformDefinition transformDefinition) This method asynchronously transforms content to a target mimetype with transform options supplied in thetransformDefinition.
-
Field Details
-
TRANSFORMING_ERROR_MESSAGE
- See Also:
-
DEFAULT_RENDITION_CONTENT_PROP
-
DEFAULT_MIMETYPE
- See Also:
-
MIMETYPE_METADATA_EXTRACT
- See Also:
-
MIMETYPE_METADATA_EMBED
- See Also:
-
DEFAULT_ENCODING
- See Also:
-
SOURCE_HAS_NO_CONTENT
public static final int SOURCE_HAS_NO_CONTENT- See Also:
-
RENDITION2_DOES_NOT_EXIST
public static final int RENDITION2_DOES_NOT_EXIST- See Also:
-
-
Constructor Details
-
RenditionService2Impl
public RenditionService2Impl()
-
-
Method Details
-
setTransactionService
-
setNodeService
-
setContentService
-
setRenditionPreventionRegistry
-
setRenditionDefinitionRegistry2
public void setRenditionDefinitionRegistry2(RenditionDefinitionRegistry2 renditionDefinitionRegistry2) -
getRenditionDefinitionRegistry2
- Specified by:
getRenditionDefinitionRegistry2in interfaceRenditionService2- Returns:
- the
RenditionDefinitionRegistry2being used by the service.
-
setTransformClient
-
setPolicyComponent
-
setBehaviourFilter
-
setRuleService
-
setRenditionRequestSheduler
-
setTransformReplyProvider
-
setAsynchronousExtractor
-
setEnabled
public void setEnabled(boolean enabled) -
setThumbnailsEnabled
public void setThumbnailsEnabled(boolean thumbnailsEnabled) -
isThumbnailsEnabled
public boolean isThumbnailsEnabled() -
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
transform
Description copied from interface:RenditionService2This 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.- Specified by:
transformin interfaceRenditionService2- 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.
-
render
Description copied from interface:RenditionService2This method asynchronously renders content as specified by therenditionName. The content to be rendered is provided bysourceNodeRef.- Specified by:
renderin interfaceRenditionService2- Parameters:
sourceNodeRef- the node from which the content is retrieved.renditionName- the rendition to be performed.
-
failure
public void failure(NodeRef sourceNodeRef, RenditionDefinition2 renditionDefinition, int transformContentHashCode) -
consume
public void consume(NodeRef sourceNodeRef, InputStream transformInputStream, RenditionDefinition2 renditionDefinition, int transformContentHashCode) -
isCreatedByRenditionService2
-
deleteRendition
-
clearRenditionContentData
Clears source nodeRef rendition content and content hash code using supplied rendition name- Parameters:
sourceNodeRef-renditionName-
-
getRenditions
Description copied from interface:RenditionService2This method gets all the renditions of thesourceNodeRef.- Specified by:
getRenditionsin interfaceRenditionService2- Returns:
- a list of
ChildAssociationRefs which link thesourceNodeRefto the renditions.
-
isRenditionAvailable
Indicates if the rendition is available. Failed renditions (there was an error) don't have a contentUrl and out of date renditions or those still being created don't have a matching contentHashCode. -
getRenditionByName
Description copied from interface:RenditionService2This method gets the rendition of thesourceNodeRefidentified by its name.- Specified by:
getRenditionByNamein interfaceRenditionService2- 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
Description copied from interface:RenditionService2This method clears source nodeRef rendition content and content hash code using supplied rendition name.- Specified by:
clearRenditionContentDataInTransactionin interfaceRenditionService2- Parameters:
renditionNode- the rendition node
-
isEnabled
public boolean isEnabled()Description copied from interface:RenditionService2Indicates if renditions are enabled. Set using thesystem.thumbnail.generatevalue.- Specified by:
isEnabledin interfaceRenditionService2
-
onContentUpdate
- Specified by:
onContentUpdatein interfaceContentServicePolicies.OnContentUpdatePolicy- Parameters:
sourceNodeRef- the node reference
-
forceRenditionsContentHashCode
Description copied from interface:RenditionService2This method forces the content hash code for everysourceNodeRefrenditions.- Specified by:
forceRenditionsContentHashCodein interfaceRenditionService2- Parameters:
sourceNodeRef- the source node to update renditions hash code
-