Package com.day.cq.dam.api
Interface Revision
-
public interface Revision
Defines the interface of a CQ asset revision. TheRevision
wraps aVersion
, 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 theAssetManager
.- 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 byNode.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 ofItem.getName()
if no history labels are present.ValueMap
getMetadataProperties()
Returns aValueMap
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 aValueMap
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 aValueMap
containing the content properties of the node addressed via therelPath
parameter.java.lang.String
getRenditionPath(java.lang.String renditionName)
Return the path to the renditionjava.lang.String
getTitle()
Returns thedc:title
of the asset ornull
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 aValueMap
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 aValueMap
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:
Asset.getMetadata()
,Asset.getMetadata(String)
,Asset.getMetadataValue(String)
-
getProperties
ValueMap getProperties(java.lang.String relPath)
Returns aValueMap
containing the content properties of the node addressed via therelPath
parameter. TherelPath
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 ofItem.getName()
if no history labels are present.- Returns:
- version label
-
getId
java.lang.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:
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 thedc:title
of the asset ornull
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
-
-