Package com.day.cq.dam.api
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 Summary
Modifier and TypeMethodDescriptionReturn the optional comment for this revision.Return the creation date.Returns the description of this resource.getId()Return the unique version id (as provided byNode.getIdentifier()).getLabel()Return the concatenated labels of the history for this version, as entered by the user during version creation, or the value ofItem.getName()if no history labels are present.Returns aValueMapcontaining the asset's metadata properties as frozen in this revision (formerly the <asset-path>/jcr:content/metadata properties).getName()Returns the name of the asset.Return the parent path of the asset.Returns aValueMapcontaining the asset's main content properties as frozen in this revision (formerly the <asset-path>/jcr:content properties).getProperties(String relPath) Returns aValueMapcontaining the content properties of the node addressed via therelPathparameter.getRenditionPath(String renditionName) Return the path to the renditiongetTitle()Returns thedc:titleof the asset ornullif none defined.Returns the underlying version.booleanReturn a flag indicating whether this revision belongs to a deleted asset.
-
Method Details
-
getVersion
Version getVersion()Returns the underlying version.- Returns:
- the JCR version
- Since:
- 5.5
-
getProperties
ValueMap getProperties()Returns aValueMapcontaining 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 aValueMapcontaining 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
Returns aValueMapcontaining the content properties of the node addressed via therelPathparameter. TherelPathparameter 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 ofItem.getName()if no history labels are present.- Returns:
- version label
-
getId
String getId()Return the unique version id (as provided byNode.getIdentifier()).- Returns:
- version id
-
isDeleted
boolean isDeleted()Return a flag indicating whether this revision belongs to a deleted asset.- Returns:
trueif the associated asset is deleted;falseotherwise
-
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 thedc:titleof the asset ornullif none defined.- Returns:
- title of the asset
-
getDescription
String getDescription()Returns the description of this resource.- Returns:
- the description of this resource or
nullif 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
Return the path to the rendition- Parameters:
renditionName- name of rendition- Returns:
- path of rendition or
nullif path does not exist
-