I know that if I find my required data/information from SharePoint database then there must be some way to find same thing from object model. So I started debugging SPFile object and tried to see what are the properties exposed by object model, but I didn’t see any properties from code, then I have found some hidden properties which match with ALLDOCS table schema, properties names are "vti_hasdefaultcontent", "vti_setuppath", so after using those hidden SPFile properties, I got my results which match with query results,
Example Code:
SPFile objFile;
string bDefaultContent = (string)objFile.Properties["vti_hasdefaultcontent"];
string strSetupPath = (string)objFile.Properties["vti_setuppath"];
if (strSetupPath == null && bDefaultContent == null)
{
//If code executed and comes into this loop then current Page/File status is customized
//then I can take objFile.File and objFile.URL values
}
Reference Links:
I have found one hidden property name from object model for checking page/site customization
http://stsadm.blogspot.com/2007/09/re-ghosting-pages.html
Hidden Property name from file object
http://www.eggheadcafe.com/conversation.aspx?messageid=29277607&threadid=29254168
Comments are always welcome!!!
[...] How to find page/site customization status – Part 2 – with the help of SharePoint object mo... [...]
ReplyDeleteThis one is really interesting post. Thanks for posting.
ReplyDeleteYeah, so far it's one of the challenging work into my assignment.
ReplyDelete