Saturday, June 26, 2010

Dissecting Sharepoint 3.0: Invisible documents and the check-out process

The case of the missing Sharepoint documents: If you require document-check-out in your Sharepoint document library, uploads using Windows Explorer or the “Upload Multiple Documents” tool could have surprising results.

In the Sharepoint document library settings, you have the option to “require check out”. If you choose to “require documents to be checked out before they can be edited”, it is important to note the behavior of freshly uploaded documents.

With “require check out” enabled, only the owner (or person who uploaded the document) gets to see a document until it is actually checked in. Using the standard “Upload” button in the document library, users will be prompted to enter comments and then check in the document. However, anyone using the “Upload Multiple Documents” option (available if you have Microsoft Office 2003 or later installed on your machine), will never be asked if they would like to check the documents in (the same goes for uploading documents using Windows Explorer). As a result, the user may have successfully uploaded the documents to the site, but they all remain checked out. A document that has been uploaded but never checked in retains a ghostly and invisible status allowing it to be seen only by the owner.

Someone with Full Control of the document library (such as the site owner) can see a list of these phantom files by going to Shared Documents > Settings > Checked Out Files. Here one can find a list of all of the mysterious files that have never been checked in - (and are therefore invisible to others). If for some reason the original uploader isn’t available to check in the files, this tool can be used to take ownership of the files so that they may be checked in.

Tinkering under the hood:

In the content database for the site, you can see the behavior of checked out files behind the scenes. Looking at the SQL tables, here are some of the fields that can be of interest when investigating Sharepoint document issues:

The AllDocs Table:
- CheckoutUserId: ties to UserInfo table (tp_ID)
- CheckoutDate: Checkout Date (duh)
- Version: Internal version number
- UIVersionString: Display document version
- IsCurrentVersion: (1=yes, 0=no)
- Level: Checkout status of the file (1=checked in, 2=minor version,255=checked out)

The AllUserData Table: (more document versioning/history)
- tp_IsCurrent: When a file is checked out, tp_IsCurrent is set to false on that file’s record, and a new line is created for the checked-out version of the file (wherein tp_IsCurrent becomes true).
- tp_DirName: The parent directory or document library housing the file
- tp_LeafName: The name of the file
- tp_ContentType: In this case, “Document”
- nvarchar1: Username of the last person that modified the file
- nvarchar2: Username of the person that created the file
- nvarchar3: File extension
- tp_level: this indicates the checkout status of the file (1=checked in, 2=minor - version,255=checked out)
- tp_UIVersionString: Display document version

No comments:

Post a Comment