public interface VersionableItem extends DeltaVItem
By default items in the repository are not under version control. When item is being put under version control engine calls
putUnderVersionControl(boolean)
method passing true as a parameter. In your putUnderVersionControl(boolean)
implementation you must create a new version. The content and properties of the new version must be copied from this item.
After the call to putUnderVersionControl(boolean)
getVersionHistory()
method must return an object
implementing History
interface that will contain single version. The isCheckedOut()
method must return false.
If item is under version control it mast always have at last one version in its versions list.
After the item had been put under version control client can issue checkout command. In your checkOut()
implementation you will mark item as checked-out and allow item modifications. When item is in check-out state WebDAV client
can issue commands updating item contents and properties.
Finally client issues check-in command or discards changes issuing uncheck-out command. In your checkIn()
implementation you will create a new version. The content and properties of the new version must be copied from this item.
The item must be marked as checked-in.
In your unCheckOut()
implementation you will discard changes and restore pre-checkout state. Content and properties must be
copied from current version to this item. The item must be marked as checked-in.
The typical versioning workflow:
putUnderVersionControl(boolean)
. Create new version, copy content and properties from this item to new version.checkOut()
. Mark item as checked-out.File.read(java.io.OutputStream, long, long)
or HierarchyItem.updateProperties(com.ithit.webdav.server.Property[], com.ithit.webdav.server.Property[])
. Modify item content and properties.checkIn()
or unCheckOut()
. For checkIn()
- create new version, copy content and properties from this item to new version. For unCheckOut()
- copy content and properties from current version to this item. Mark item as checked-in.
In your updateToVersion(com.ithit.webdav.server.deltav.Version)
implementation you will create a new version and copy content and properties from
Version
passed as a parameter to new version. You will also replace content and properties of this item.
The new created version becomes current version. The updateToVersion(com.ithit.webdav.server.deltav.Version)
method can only be called when item is in check-in state.
When item is being removed from version control engine calls putUnderVersionControl(boolean)
method passing false
as a parameter. In your implementation you will usually delete all versions. getVersionHistory()
method must return
null after this call.
Modifier and Type | Method and Description |
---|---|
String |
checkIn()
Creates new version.
|
void |
checkOut()
Allow modifications to the content and properties of this version-controlled item.
|
boolean |
getAutoCheckIn()
Indicates if item will be checked-in by the engine during the unlock request.
|
AutoVersion |
getAutoVersion()
Determines how checked-in item responds to WebDAV client attempts to modify its content or properties.
|
History |
getVersionHistory()
Current item version history.
|
boolean |
isCheckedOut()
Determines whether item is in checked-in or checked-out state.
|
void |
putUnderVersionControl(boolean enable)
Puts or removes current item from version control.
|
void |
setAutoCheckIn(boolean value)
Sets flag which indicates if item will be checked-in by the engine during the unlock request.
|
void |
setAutoVersion(AutoVersion value)
Sets auth versioning mode for this item.
|
void |
unCheckOut()
Cancels the checkout and restores the pre-checkout state of the version-controlled item.
|
void |
updateToVersion(Version version)
Updates content and properties of the item to those identified by version parameter.
|
getComment, getCreatorDisplayName, setComment, setCreatorDisplayName
copyTo, delete, getCreated, getModified, getName, getPath, getProperties, getPropertyNames, moveTo, updateProperties
History getVersionHistory() throws ServerException
Null
, if item is not under version control.
If item is under version control it always has at last one version in its versions list.History
interface or null if item is not under version control.ServerException
- In case of an error.String checkIn() throws ServerException, LockedException
ServerException
- In case of an error.LockedException
void checkOut() throws ServerException, LockedException
ServerException
- in case of an error.LockedException
void unCheckOut() throws ServerException, LockedException
ServerException
- in case of an error.LockedException
void updateToVersion(Version version) throws ServerException, LockedException
version
- Version that contains reference properties and content.ServerException
- in case of an error.LockedException
AutoVersion getAutoVersion() throws ServerException
AutoVersion
enum values.ServerException
- in case of an error.void setAutoVersion(AutoVersion value) throws ServerException, LockedException
value
- Auto versioning mode.ServerException
- in case of an error.LockedException
boolean isCheckedOut() throws ServerException
ServerException
- in case of an error.void putUnderVersionControl(boolean enable) throws ServerException, LockedException
enable
- True to enable version control, false - to disable.ServerException
- in case of an error.LockedException
boolean getAutoCheckIn() throws ServerException
checkIn()
if necessary. This property is required for auto-versioning.ServerException
- in case of an error.void setAutoCheckIn(boolean value) throws ServerException, LockedException
checkIn()
if necessary. This property is required for auto-versioning.value
- Value of the flag.ServerException
- in case of an error.LockedException
Copyright © ITHit. All Rights Reserved.