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
  • Field Details

  • Constructor Details

    • RenditionService2Impl

      public RenditionService2Impl()
  • Method Details

    • setTransactionService

      public void setTransactionService(TransactionService transactionService)
    • setNodeService

      public void setNodeService(NodeService nodeService)
    • setContentService

      public void setContentService(ContentService contentService)
    • setRenditionPreventionRegistry

      public void setRenditionPreventionRegistry(RenditionPreventionRegistry renditionPreventionRegistry)
    • setRenditionDefinitionRegistry2

      public void setRenditionDefinitionRegistry2(RenditionDefinitionRegistry2 renditionDefinitionRegistry2)
    • getRenditionDefinitionRegistry2

      public RenditionDefinitionRegistry2 getRenditionDefinitionRegistry2()
      Specified by:
      getRenditionDefinitionRegistry2 in interface RenditionService2
      Returns:
      the RenditionDefinitionRegistry2 being used by the service.
    • setTransformClient

      public void setTransformClient(TransformClient transformClient)
    • setPolicyComponent

      public void setPolicyComponent(PolicyComponent policyComponent)
    • setBehaviourFilter

      public void setBehaviourFilter(BehaviourFilter behaviourFilter)
    • setRuleService

      public void setRuleService(RuleService ruleService)
    • setRenditionRequestSheduler

      public void setRenditionRequestSheduler(PostTxnCallbackScheduler renditionRequestSheduler)
    • setTransformReplyProvider

      public void setTransformReplyProvider(TransformReplyProvider transformReplyProvider)
    • setAsynchronousExtractor

      public void setAsynchronousExtractor(AsynchronousExtractor asynchronousExtractor)
    • setEnabled

      public void setEnabled(boolean enabled)
    • setThumbnailsEnabled

      public void setThumbnailsEnabled(boolean thumbnailsEnabled)
    • isThumbnailsEnabled

      public boolean isThumbnailsEnabled()
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • transform

      public void transform(NodeRef sourceNodeRef, TransformDefinition transformDefinition)
      Description copied from interface: RenditionService2
      This method asynchronously transforms content to a target mimetype with transform options supplied in the transformDefinition. 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 transformDefinition extends RenditionDefinition2, but is not stored in a RenditionDefinitionRegistry2, as it is transient in nature.

      Specified by:
      transform in interface RenditionService2
      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

      public void render(NodeRef sourceNodeRef, String renditionName)
      Description copied from interface: RenditionService2
      This method asynchronously renders content as specified by the renditionName. The content to be rendered is provided by sourceNodeRef.
      Specified by:
      render in interface RenditionService2
      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

      public boolean isCreatedByRenditionService2(NodeRef sourceNodeRef, String renditionName)
    • deleteRendition

      public void deleteRendition(NodeRef sourceNodeRef, String renditionName)
    • clearRenditionContentData

      public void clearRenditionContentData(NodeRef sourceNodeRef, String renditionName)
      Clears source nodeRef rendition content and content hash code using supplied rendition name
      Parameters:
      sourceNodeRef -
      renditionName -
    • getRenditions

      public List<ChildAssociationRef> getRenditions(NodeRef sourceNodeRef)
      Description copied from interface: RenditionService2
      This method gets all the renditions of the sourceNodeRef.
      Specified by:
      getRenditions in interface RenditionService2
      Returns:
      a list of ChildAssociationRefs which link the sourceNodeRef to the renditions.
    • isRenditionAvailable

      public boolean isRenditionAvailable(NodeRef sourceNodeRef, NodeRef renditionNode)
      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

      public ChildAssociationRef getRenditionByName(NodeRef sourceNodeRef, String renditionName)
      Description copied from interface: RenditionService2
      This method gets the rendition of the sourceNodeRef identified by its name.
      Specified by:
      getRenditionByName in interface RenditionService2
      Parameters:
      sourceNodeRef - the source node for the renditions
      renditionName - the renditionName used to identify a rendition.
      Returns:
      the ChildAssociationRef which links the source node to the rendition or null if there is no rendition or it is not up to date.
    • clearRenditionContentDataInTransaction

      public void clearRenditionContentDataInTransaction(NodeRef renditionNode)
      Description copied from interface: RenditionService2
      This method clears source nodeRef rendition content and content hash code using supplied rendition name.
      Specified by:
      clearRenditionContentDataInTransaction in interface RenditionService2
      Parameters:
      renditionNode - the rendition node
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: RenditionService2
      Indicates if renditions are enabled. Set using the system.thumbnail.generate value.
      Specified by:
      isEnabled in interface RenditionService2
    • onContentUpdate

      public void onContentUpdate(NodeRef sourceNodeRef, boolean newContent)
      Specified by:
      onContentUpdate in interface ContentServicePolicies.OnContentUpdatePolicy
      Parameters:
      sourceNodeRef - the node reference
    • forceRenditionsContentHashCode

      public void forceRenditionsContentHashCode(NodeRef sourceNodeRef)
      Description copied from interface: RenditionService2
      This method forces the content hash code for every sourceNodeRef renditions.
      Specified by:
      forceRenditionsContentHashCode in interface RenditionService2
      Parameters:
      sourceNodeRef - the source node to update renditions hash code