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 Detail

      • getVersion

        Version getVersion()
        Returns the underlying version.
        the JCR version
      • 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).
        a value map
      • 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");
        relPath - relative path to the content
        a value map
        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.
        version label
      • isDeleted

        boolean isDeleted()
        Return a flag indicating whether this revision belongs to a deleted asset.
        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).
        asset name
      • getParentPath

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

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

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

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

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

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