Interface RenditionService

All Known Implementing Classes:
RenditionServiceImpl

public interface RenditionService
Service handling Rendition Definitions and actual render based on a Rendition Definition
Since:
5.4.1
Author:
Thomas Roger, Tiry
  • Method Details

    • getDeclaredRenditionDefinitions

      List<RenditionDefinition> getDeclaredRenditionDefinitions()
      Returns a List of registered RenditionDefinition. The order of the List does not depend on the registering order.
    • getAvailableRenditionDefinitions

      List<RenditionDefinition> getAvailableRenditionDefinitions(DocumentModel doc)
      Returns a List of RenditionDefinition available on the given Document. The order of the List does not depend on the registering order.
    • getAvailableRenditionDefinition

      RenditionDefinition getAvailableRenditionDefinition(DocumentModel doc, String renditionName)
      Returns the RenditionDefinition available on the given document for the given rendition definition name.
      Since:
      10.10
    • 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, Map<String,Serializable> extendedInfos)
      Same as getDefaultRendition(DocumentModel, String, boolean, Map) with store parameter set to false.
      Parameters:
      doc - the document to render
      reason - the reason the rendition is being rendered (optional)
      extendedInfos - map of extended info added in the default rendition computation (optional)
      Returns:
      the default Rendition object
      Since:
      9.10
    • 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<Rendition> getAvailableRenditions(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<Rendition> getAvailableRenditions(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