Interface Revision


  • public interface Revision
    Defines the interface of a CQ asset revision. The Revision wraps a Version, providing easy access to the contained content (properties) and convenience methods for accessing often used asset properties, such as e.g. the title.

    Revisions of an asset are created via the Asset interface. Access to existing versions and restoring versions are handled via the AssetManager.

    See Also:
    Asset.createRevision(String, String)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getComment()
      Return the optional comment for this revision.
      java.util.Calendar getCreated()
      Return the creation date.
      java.lang.String getDescription()
      Returns the description of this resource.
      java.lang.String getId()
      Return the unique version id (as provided by Node.getIdentifier()).
      java.lang.String getLabel()
      Return the concatenated labels of the history for this version, as entered by the user during version creation, or the value of Item.getName() if no history labels are present.
      ValueMap getMetadataProperties()
      Returns a ValueMap containing the asset's metadata properties as frozen in this revision (formerly the <asset-path>/jcr:content/metadata properties).
      java.lang.String getName()
      Returns the name of the asset.
      java.lang.String getParentPath()
      Return the parent path of the asset.
      ValueMap getProperties()
      Returns a ValueMap containing the asset's main content properties as frozen in this revision (formerly the <asset-path>/jcr:content properties).
      ValueMap getProperties​(java.lang.String relPath)
      Returns a ValueMap containing the content properties of the node addressed via the relPath parameter.
      java.lang.String getRenditionPath​(java.lang.String renditionName)
      Return the path to the rendition
      java.lang.String getTitle()
      Returns the dc:title of the asset or null if none defined.
      Version getVersion()
      Returns the underlying version.
      boolean isDeleted()
      Return a flag indicating whether this revision belongs to a deleted asset.
    • Method Detail

      • getVersion

        Version getVersion()
        Returns the underlying version.
        Returns:
        the JCR version
        Since:
        5.5
      • getProperties

        ValueMap getProperties()
        Returns a ValueMap containing the asset's main content properties as frozen in this revision (formerly the <asset-path>/jcr:content properties).
        Returns:
        a value map
      • getProperties

        ValueMap getProperties​(java.lang.String relPath)
        Returns a ValueMap containing the content properties of the node addressed via the relPath parameter. The relPath parameter must be a relative path (must not start with a "/").

        For example the content properties of one of the renditions contained in the asset's revision would be addressed as follows:

          ...
          ValueMap properties = revision.getProperties("renditions/original/jcr:content");
          ...
         
        Parameters:
        relPath - relative path to the content
        Returns:
        a value map
        Throws:
        java.lang.IllegalArgumentException - Thrown if the given path is not relative.
      • getLabel

        java.lang.String getLabel()
        Return the concatenated labels of the history for this version, as entered by the user during version creation, or the value of Item.getName() if no history labels are present.
        Returns:
        version label
      • getId

        java.lang.String getId()
        Return the unique version id (as provided by Node.getIdentifier()).
        Returns:
        version id
      • isDeleted

        boolean isDeleted()
        Return a flag indicating whether this revision belongs to a deleted asset.
        Returns:
        true if the associated asset is deleted; false otherwise
      • getName

        java.lang.String getName()
        Returns the name of the asset. This is the last path segment of the asset path (file name).
        Returns:
        asset name
      • getParentPath

        java.lang.String getParentPath()
        Return the parent path of the asset.
        Returns:
        parent path
      • getTitle

        java.lang.String getTitle()
        Returns the dc:title of the asset or null if none defined.
        Returns:
        title of the asset
      • getDescription

        java.lang.String getDescription()
        Returns the description of this resource.
        Returns:
        the description of this resource or null if not defined.
      • getCreated

        java.util.Calendar getCreated()
        Return the creation date.
        Returns:
        creation date
      • getComment

        java.lang.String getComment()
        Return the optional comment for this revision.
        Returns:
        comment or null
      • getRenditionPath

        java.lang.String getRenditionPath​(java.lang.String renditionName)
        Return the path to the rendition
        Parameters:
        renditionName - name of rendition
        Returns:
        path of rendition or null if path does not exist