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 Detail

      • transform

        @NotAuditable
        void transform​(NodeRef sourceNodeRef,
                       TransformDefinition transformDefinition)
        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.

        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

        @NotAuditable
        void render​(NodeRef sourceNodeRef,
                    String renditionName)
        This method asynchronously renders content as specified by the renditionName. The content to be rendered is provided by sourceNodeRef.
        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.
      • getRenditionByName

        @NotAuditable
        ChildAssociationRef getRenditionByName​(NodeRef sourceNodeRef,
                                               String renditionName)
        This method gets the rendition of the sourceNodeRef identified by its name.
        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.
      • isEnabled

        boolean isEnabled()
        Indicates if renditions are enabled. Set using the system.thumbnail.generate value.