Namespace: ITHit.WebDAV.Server.DeltaV
Exception | Condition |
---|---|
LockedException | This item was locked. Client did not provide the lock token. |
NeedPrivilegesException | The user doesn't have enough privileges. |
InsufficientStorageException | Quota limit is reached. |
MultistatusException | Errors has occurred during processing of the subtree. |
DavException | In other cases. |
The code below is part of 'WebDAVServer.DeltaV' sample provided with the SDK.
public void UnCheckOut() { RequireHasToken(); if (this.VersionHistory != null) { // Discard changes. // Copy content and properties from current version to this item. Mark item as checked in. Version version = (Version)VersionHistory.GetCurrentVersion(); // Restore properties. Context.ExecuteNonQuery( "DELETE FROM Property WHERE ItemID = @ItemID", "@ItemId", ItemId); string command = @"INSERT INTO Property(ItemId, Name, Namespace, PropVal) SELECT @ItemId, Name, Namespace, PropVal FROM VersionProperty WHERE VersionId = @VersionId"; Context.ExecuteNonQuery( command, "@VersionId", version.VersionId, "@ItemId", ItemId); string updateItemCommand = @"UPDATE Item SET Content = (SELECT Content FROM [Version] WHERE VersionId = @versionID) WHERE ItemId = @ItemID"; Context.ExecuteNonQuery( updateItemCommand, "@ItemId", ItemId, "@VersionId", version.VersionId); } // Mark item as checked in. setFileCheckedOut(false, false); }