SharePoint Integration |
In SharePoint, document locking can be done through the CheckOut and CheckIn functionality. Similar to the Rename AgilePart, you could implement a CheckIn/CheckOut AgilePart that handles the document locking and releasing mechanism.
The following are some code snippets of using the SharePoint SDK to implement the CheckOut and CheckIn operation:
public void CheckOut() { SPWeb web = new SPSite("http://virtual:101/sites/s1/s1/a37").OpenWeb(); SPFile file = web.GetFile("http://virtual:101/sites/s1/s1/a37/cdl1/test.htm"); file.CheckOut(); Console.WriteLine("Checked Out"); } public void CheckIn() { SPWeb web = new SPSite("http://virtual:101/sites/s1/s1/a37").OpenWeb(); SPFile file = web.GetFile("http://virtual:101/sites/s1/s1/a37/cdl1/test.htm"); file.CheckIn("This is the check in comment by console app."); Console.WriteLine("Checked In"); }