Interface RenditionService

    • Method Detail

      • storeRendition

        DocumentRef storeRendition​(DocumentModel sourceDocument,
                                   String renditionDefinitionName)
        Render a document based on the given rendition definition name and returns the stored Rendition DocumentRef.

        Only the user launching the render operation has the Read right on the returned document.

        Parameters:
        sourceDocument - the document to render
        renditionDefinitionName - the rendition definition to use
        Returns:
        the DocumentRef of the newly created Rendition document.
      • getRendition

        Rendition getRendition​(DocumentModel doc,
                               String renditionName)
        Return the Rendition object for the given DocumentModel and a rendition definition name.

        A stored rendition is returned if found and up to date, a new Rendition is created otherwise.

        Parameters:
        doc - the document to render
        renditionName - the name of the rendition definition
        Returns:
        the Rendition object
      • getDefaultRendition

        Rendition getDefaultRendition​(DocumentModel doc,
                                      String reason,
                                      boolean store,
                                      Map<String,​Serializable> extendedInfos)
        Return the default Rendition object for the given DocumentModel.

        A stored rendition is returned if found and up to date, a new Rendition is created otherwise.

        Parameters:
        doc - the document to render
        reason - the reason the rendition is being rendered (optional)
        store - indicates if the rendition must be stored
        extendedInfos - map of extended info added in the default rendition computation (optional)
        Returns:
        the default Rendition object
        Since:
        10.3
      • getRendition

        Rendition getRendition​(DocumentModel doc,
                               String renditionName,
                               boolean store)
        Return the Rendition object for the given DocumentModel and a rendition definition name.

        A stored rendition is returned if found and up to date, a new (live) Rendition is created and returned otherwise.

        If store parameter is true, the new created rendition is stored too unless it is marked as stale.

        Parameters:
        doc - the document to render
        renditionName - the name of the rendition definition
        store - indicates if the rendition must be stored
        Returns:
        the Rendition object
      • getAvailableRenditions

        List<RenditiongetAvailableRenditions​(DocumentModel doc)
        Returns a List of Rendition available on the given Document.

        The order of the List does not depend on the registering order.

        The returned rendition may be live or stored

      • getAvailableRenditions

        List<RenditiongetAvailableRenditions​(DocumentModel doc,
                                               boolean onlyVisible)
        Returns a List of Rendition available on the given Document.

        If onlyVisible is true, returns only the rendition marked as visible.

        The order of the List does not depend on the registering order.

        The returned rendition may be live or stored

        Since:
        7.2
      • deleteStoredRenditions

        void deleteStoredRenditions​(String repositoryName)
        Query and delete stored renditions where the related version or live document does not exist anymore.
        Since:
        8.4
      • publishRendition

        DocumentModel publishRendition​(DocumentModel doc,
                                       DocumentModel target,
                                       String renditionName,
                                       boolean override)
        Publish a document's rendition. If the rendition name is not given, it publishes its default rendition obtained from getDefaultRendition(DocumentModel, String, Map).
        Parameters:
        doc - the document to be published
        target - the location where to publish
        renditionName - the rendition to be published
        override - if true, will remove existing publication of the document
        Returns:
        the published document
        Since:
        10.3