Package com.adobe.cq.dam.cfm
Interface Versionable
-
- All Known Subinterfaces:
ContentElement
,ContentFragment
,ContentVariation
public interface Versionable
Implementations of this interface provide means to version their content.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description VersionDef
createVersion(String label, String comment)
Creates a new version of the implementing element.VersionedContent
getVersionedContent(VersionDef version)
Gets the content of the version of the implementing element that is specified by the providedVersionDef
.Iterator<VersionDef>
listVersions()
Creates an iterator on the versions that are available for the implementing element.
-
-
-
Method Detail
-
createVersion
VersionDef createVersion(String label, String comment) throws ContentFragmentException
Creates a new version of the implementing element.Transactional behavior: All previous changes to the entire content fragment need to be committed before this method is called. The method will also commit all required changes, so the caller does not have to explicitly commit the respective
ResourceResolver
.- Parameters:
label
- The labelcomment
- A comment- Returns:
- Definition of the newly created version
- Throws:
ContentFragmentException
- if the element could not be versionedIllegalStateException
- if the required transactional prerequisites are not met, for example if the respectiveResourceResolver
has pending/uncommitted changes
-
listVersions
Iterator<VersionDef> listVersions() throws ContentFragmentException
Creates an iterator on the versions that are available for the implementing element.
The list does not contain the "current" version of the element itself, only archived versions.
- Returns:
- Iterator on available versions
- Throws:
ContentFragmentException
- if the version history could not be created
-
getVersionedContent
VersionedContent getVersionedContent(VersionDef version) throws ContentFragmentException
Gets the content of the version of the implementing element that is specified by the provided
VersionDef
.The
VersionDef
should match one of those returned bylistVersions()
.- Parameters:
version
- The version definition- Returns:
- The versioned content
- Throws:
ContentFragmentException
- if the version content could not be determined or an invalid version definition was provided
-
-