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:
  • Method Details

    • 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
    • getMetadataProperties

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

      ValueMap getProperties(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:
      IllegalArgumentException - Thrown if the given path is not relative.
    • getLabel

      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

      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

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

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

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

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

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

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

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