Click or drag to resize

IVersionableItemAsync Interface

IT Hit WebDAV Classes Reference
This interface must be implemented on items that support versioning.

Namespace:  ITHit.WebDAV.Server.DeltaV
Assembly:  ITHit.WebDAV.Server (in ITHit.WebDAV.Server.dll) Version: 9.1.5460-Beta
Syntax
public interface IVersionableItemAsync : IDeltaVItemAsync, 
	IHierarchyItemAsync, IHierarchyItemBaseAsync

The IVersionableItemAsync type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleCreated
Gets the creation date of the item in repository expressed as the coordinated universal time (UTC).
(Inherited from IHierarchyItemBaseAsync.)
Public propertyIsAutoCheckedOut
Gets a value indicating whether the item was check-out automatically by engine without explicit request from client.
Public propertyIsCheckedOut
Gets a value indicating whether the item is in checked-in or checked-out state.
Public propertyCode exampleModified
Gets the last modification date of the item in repository expressed as the coordinated universal time (UTC).
(Inherited from IHierarchyItemBaseAsync.)
Public propertyCode exampleName
Gets the name of the item in repository.
(Inherited from IHierarchyItemBaseAsync.)
Public propertyCode examplePath
Unique item path in the repository relative to storage root.
(Inherited from IHierarchyItemBaseAsync.)
Public propertyVersionHistory
Current item version history. Null, if item is not under version control.
Top
Methods
  NameDescription
Public methodCheckInAsync
Creates new version. Copies all properties and content from this item.
Public methodCheckOutAsync
Allow modifications to the content and properties of this version-controlled item.
Public methodCode exampleCopyToAsync
Creates a copy of this item with a new name in the destination folder.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleDeleteAsync
Deletes this item.
(Inherited from IHierarchyItemAsync.)
Public methodGetAutoVersionAsync
Retrieves property which determines how checked-in item responds to WebDAV client attempts to modify its content or properties.
Public methodGetCommentAsync
Retrieves a brief comment about a file that is suitable for presentation to a user.
(Inherited from IDeltaVItemAsync.)
Public methodGetCreatorDisplayNameAsync
Retrieves display name of the user that created this item.
(Inherited from IDeltaVItemAsync.)
Public methodCode exampleGetPropertiesAsync
Gets values of all properties or selected properties for this item.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleGetPropertyNamesAsync
Gets names of all properties for this item.
(Inherited from IHierarchyItemAsync.)
Public methodCode exampleMoveToAsync
Moves this item to the destination folder under a new name.
(Inherited from IHierarchyItemAsync.)
Public methodPutUnderVersionControlAsync
Puts or removes current item from version control.
Public methodSetAutoVersionAsync
Sets property which determines how checked-in item responds to WebDAV client attempts to modify its content or properties.
Public methodSetCommentAsync
Sets a brief comment about a file that is suitable for presentation to a user.
(Inherited from IDeltaVItemAsync.)
Public methodSetCreatorDisplayNameAsync
Sets display name of the user that created this item.
(Inherited from IDeltaVItemAsync.)
Public methodUnCheckOutAsync
Cancels the checkout and restores the pre-checkout state of the version-controlled item.
Public methodCode exampleUpdatePropertiesAsync
Adds, modifies and removes properties for this item.
(Inherited from IHierarchyItemAsync.)
Public methodUpdateToVersionAsync
Updates content and properties of the item to those identified by version parameter.
Top
Remarks

By default items in the repository are not under version control. When item is being put under version control engine calls PutUnderVersionControlAsync(Boolean) method passing true as a parameter. In your PutUnderVersionControlAsync(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 PutUnderVersionControlAsync(Boolean)VersionHistory property must point to the object implementing IHistoryAsync interface that will contain single version. The IsCheckedOut property 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 CheckOutAsync(Boolean) 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 CheckInAsync 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 UnCheckOutAsync 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:

  1. Engine calls PutUnderVersionControlAsync(Boolean). Create new version, copy content and properties from this item to new version.
  2. Engine calls CheckOutAsync(Boolean). Mark item as checked-out.
  3. Engine calls [!:IContentAsync.WriteAsync] or UpdatePropertiesAsync(IListPropertyValue, IListPropertyName, MultistatusException). Modify item content and properties.
  4. Engine calls CheckInAsync or UnCheckOutAsync. For CheckInAsync - create new version, copy content and properties from this item to new version. For UnCheckOutAsync - copy content and properties from current version to this item. Mark item as checked-in.

In your UpdateToVersionAsync(IVersionAsync) implementation you will create a new version and copy content and properties from IVersionAsync 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 UpdateToVersionAsync(IVersionAsync) method can only be called when item is in check-in state.

When item is being removed from version control engine calls PutUnderVersionControlAsync(Boolean) method passing false as a parameter. In your implementation you will usually delete all versions. VersionHistory property must return null after this call.

See Also