Package com.day.cq.dam.api
Interface Revision
-
public interface RevisionDefines the interface of a CQ asset revision. TheRevisionwraps 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
Assetinterface. 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.StringgetComment()Return the optional comment for this revision.java.util.CalendargetCreated()Return the creation date.java.lang.StringgetDescription()Returns the description of this resource.java.lang.StringgetId()Return the unique version id (as provided byNode.getIdentifier()).java.lang.StringgetLabel()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.ValueMapgetMetadataProperties()Returns aValueMapcontaining the asset's metadata properties as frozen in this revision (formerly the <asset-path>/jcr:content/metadata properties).java.lang.StringgetName()Returns the name of the asset.java.lang.StringgetParentPath()Return the parent path of the asset.ValueMapgetProperties()Returns aValueMapcontaining the asset's main content properties as frozen in this revision (formerly the <asset-path>/jcr:content properties).ValueMapgetProperties(java.lang.String relPath)Returns aValueMapcontaining the content properties of the node addressed via therelPathparameter.java.lang.StringgetRenditionPath(java.lang.String renditionName)Return the path to the renditionjava.lang.StringgetTitle()Returns thedc:titleof the asset ornullif none defined.VersiongetVersion()Returns the underlying version.booleanisDeleted()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 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:
Asset.getMetadata(),Asset.getMetadata(String),Asset.getMetadataValue(String)
-
getProperties
ValueMap getProperties(java.lang.String relPath)
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:
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:
trueif the associated asset is deleted;falseotherwise
-
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:titleof the asset ornullif 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
nullif 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
nullif path does not exist
-
-