Namespace: ITHit.WebDAV.Server.DeltaV
In your 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 this method method GetCurrentVersion must return the created version.
The code below is part of 'WebDAVServer.DeltaV' sample provided with the SDK.
public string CheckIn() { string newVersionUrl; RequireHasToken(); if (this.VersionHistory != null) { // Create new version. Copy content and properties from this item to new version. IVersion v = this.VersionHistory.GetCurrentVersion(); Version version = v as Version; Debug.Assert(version != null); int newVersionNumber = version.VersionNumber + 1; string newVersionPath = Version.CreateVersionPath(Path, newVersionNumber); Guid newId = Guid.NewGuid(); // Create new version. string command = @"INSERT INTO Version (ItemId, VersionId, VersionNumber, Name, Comment, CreatorDisplayName, Content, ContentType, Created, SerialNumber) SELECT @ItemId, @Identity, @VersionNumber, Name, Comment, IsNull(@CreatorDisplayName, CreatorDisplayName), Content, ContentType, GETUTCDATE(), COALESCE(SerialNumber, 1) FROM Item WHERE ItemId = @ItemId"; // COALESCE returns the first nonnull expression among its arguments. Context.ExecuteNonQuery( command, "@ItemId", ItemId, "@VersionNumber", newVersionNumber, "@CreatorDisplayName", string.IsNullOrEmpty(CurrentUserName) ? (object)DBNull.Value : CurrentUserName, "@Identity", newId); Context.ExecuteNonQuery( "UPDATE Item SET Comment = '' WHERE ItemId = @ItemId", "@ItemId", ItemId); // Copy properties to new version string copyCommand = @"INSERT INTO VersionProperty( VersionId, Name, Namespace, PropVal) SELECT @VersionId, Name, Namespace, PropVal FROM Property WHERE ItemID = @ItemID"; Context.ExecuteNonQuery( copyCommand, "@VersionId", newId, "@ItemId", ItemId); // Copy content to new version newVersionUrl = newVersionPath; } else { newVersionUrl = this.Path; } setFileCheckedOut(false, false); return newVersionUrl; }