Updating a versioned document |
This example shows how to update a versioned document (document with workflow). Workflow and the versioning are very closely connected, there should be always a new document version created if you edit a document that is under workflow.
The basic version management operations are provided by the class DocumentHelper in the methods mentioned in the previous chapter (InsertDocument, …). In order to manage the document versions, use VersionManager class methods.
Here are some examples how to work with versioned documents:
Getting the document
You always need to work with the latest document version, use DocumentHelper.GetDocument instead of just simple TreeProvider.SelectSingleNode.
[C#]
Checking out the document
If you edit the document, you should check it out to create a new document version and lock the document to avoid editing by someone else. Use VersionManager.CheckOut method to check out the document.
[C#]
Updating current document version
Use DocumentHelper.UpdateDocument method to update current document version.
[C#]
Check in the document
After you edit the document, you should check it in to allow other users to edit it or allow the workflow process to continue. Use VersionManager.CheckIn to do so.
[C#]
|