@ProviderType
public interface Versionable
Modifier and Type | Method and Description |
---|---|
VersionDef |
createVersion(java.lang.String label,
java.lang.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 provided
VersionDef . |
java.util.Iterator<VersionDef> |
listVersions()
Creates an iterator on the versions that are available for the implementing
element.
|
VersionDef createVersion(java.lang.String label, java.lang.String comment) throws ContentFragmentException
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
.
label
- The labelcomment
- A commentContentFragmentException
- if the element could not be versionedjava.lang.IllegalStateException
- if the required transactional prerequisites are not
met, for example if the respective
ResourceResolver
has pending/uncommitted changesjava.util.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.
ContentFragmentException
- if the version history could not be createdVersionedContent 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 by
listVersions()
.
version
- The version definitionContentFragmentException
- if the version content could not be determined or an
invalid version definition was providedCopyright © 2010 - 2020 Adobe. All Rights Reserved