Developing against the SharePoint's 2007 lists (SPList) or document libraries (SPDocumentLibrary), allow you see item's proprieties hidden into fields that are unaccessible from the user interface (your browser). This post will simply list all the fields that are accessible from code (hidden or not). and can be a useful reference when you need to obtain some more information from your items. If you want to easly see all the fields that are hidden by yourself, you need to lunch this simple console application in debug mode and set a breakpoint just after the SPListItem istance:
private static void ReadSpListItemsProperties(string listUrl)
{
using (SPSite site = new SPSite(listUrl))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.GetListFromUrl(listUrl);
if (list.Items.Count == 0)
{
return;
}
SPListItem item = list.Items[0];
} // set your breakpoint here!
}
}
Now using the quickwatch tool in Visual Studio you can see all the hidden fields:
A basic document library has at least 66 fields in MOSS and a SharePoint's list has 48. It's more than you have expected right?
Ok, here's the list:
All Fieds into Moss Document Library:
|
["ContentType"]
["xd_Signature"]
["_UIVersion"]
["RepairDocument"]
["GUID"]
["ScopeId"]
["SelectFilename"]
["Modified"]
["PermMask"]
["InstanceID"]
["_EditMenuTableEnd"]
["LinkCheckedOutTitle"]
["CheckedOutUserId"]
["Created_x0020_By"]
["FSObjType"]
["owshiddenversion"]
["WorkflowVersion"]
["CheckoutUser"]
["_UIVersionString"]
["ProgId"]
["HTML_x0020_File_x0020_Type"]
["Title"]
["IsCheckedoutToLocal"]
["ParentLeafName"]
["File_x0020_Type"]
["ID"]
["TemplateUrl"]
["ParentVersionString"]
["File_x0020_Size"]
["FileSizeDisplay"]
["_SharedFileIndex"]
["VirusStatus"]
["_ModerationComments"]
|
["_IsCurrentVersion"]
["FileDirRef"]
["Combine"]
["_ModerationStatus"]
["ServerUrl"]
["_EditMenuTableStart"]
["LinkFilenameNoMenu"]
["_Level"]
["Created_x0020_Date"]
["LinkFilename"]
["FileLeafRef"]
["_CheckinComment"]
["Order"]
["Last_x0020_Modified"]
["MetaInfo"]
["xd_ProgID"]
["Editor"]
["_HasCopyDestinations"]
["UniqueId"]
["EncodedAbsUrl"]
["CheckedOutTitle"]
["WorkflowInstanceID"]
["DocIcon"]
["FileRef"]
["_SourceUrl"]
["_CopySource"]
["Created"]
["SelectTitle"]
["Modified_x0020_By"]
["Edit"]
["BaseName"]
["ContentTypeId"]
["Author"]
|
All Fieds into Moss List:
|
["ContentType"]
["ID"]
["Attachments"]
["_UIVersion"]
["GUID"]
["ScopeId"]
["Modified"]
["PermMask"]
["InstanceID"]
["owshiddenversion"]
["ProgId"]
["WorkflowVersion"]
["FSObjType"]
["LinkFilename"]
["_Level"]
["_UIVersionString"]
["EncodedAbsUrl"]
["HTML_x0020_File_x0020_Type"]
["Title"]
["LinkTitleNoMenu"]
["File_x0020_Type"]
["ServerUrl"]
["_ModerationComments"]
["_IsCurrentVersion"]
|
["_ModerationStatus"]
["FileDirRef"]
["Last_x0020_Modified"]
["_EditMenuTableStart"]
["LinkFilenameNoMenu"]
["Editor"]
["Created_x0020_Date"]
["Order"]
["FileLeafRef"]
["DocIcon"]
["MetaInfo"]
["_HasCopyDestinations"]
["UniqueId"]
["WorkflowInstanceID"]
["FileRef"]
["_CopySource"]
["Created"]
["LinkTitle"]
["SelectTitle"]
["Edit"]
["BaseName"]
["_EditMenuTableEnd"]
["ContentTypeId"]
["Author"]
|
Immagine that you need to overwrite an item's sensitive informations such as who modified it or create it.
A simple implementation could be:
item["Author"] = yourAuthor;
item["Created"] = yourDate;
item["Editor"] = yourEditor;
item["Modified"] = yourDate2;
item.UpdateOverwriteVersion();
Now that you learned how to perform a dirty update in Moss, you can try to mess around a little more with your SharePoint 2007.