Finding source file for provisioned file in SharePoint

Question by email:

Is it possible to see where the actual physical file exists from the sharepoint manager 2007 tool?
Meaning, say I have a feature that adds a masterpage to a site collection master page gallery.
If I drill down in the spm tool I can see that it is uncustomized and exists at location “_catalogs/whatever”
But I don’t see anything about it actually pointing to the file in the features directory.

To find out where a file is stored you should first check the SPFile.CustomizedPageStatus of the file in question to determine if the file is still linked to the source file or has been customized and now resides in the database. For a master page you would get the correct SPFile object either by using SPWeb.GetFile([url_of_masterpage]). Checking the CustomizedPageStatus will return an SPCustomizedPageStatus enum that tell you if the file has been customized (SPCustomizedPageStatus.Customized) or is un-customized (SPCustomizedPageStatus.Uncustomized).

If the file is uncustomized, what was previously known as ghosted, you can check the masterpage’s SPFile.Properties collection for the vti_setuppath property.

Of course, all of these properties are browsable using SPM 2007. Remember, however, that the SPFile objects are stored in the root folder SPFolder of the web, and that you must browse your way down to the correct file in the folder structure (_catalogs/masterpages/default.master for example). Expand that file and you will see the properties collection and the vti_setuppath property specifically.

Note that the vti_setuppath is always relative to the [12]\TEMPLATE folder, even if you deploy your module and file using the Path method of addressing storage.

.b

Found this article valuable? Want to show your appreciation? Here are some options:

a) Click on the banners anywhere on the site to visit my blog's sponsors. They are all hand-picked and are selected based on providing great products and services to the SharePoint community.

b) Donate Bitcoins! I love Bitcoins, and you can donate if you'd like by clicking the button below.

c) Spread the word! Below, you should find links to sharing this article on your favorite social media sites. I'm an attention junkie, so sharing is caring in my book!

Pin It

John Holliday just made my day: CAML.Intellisense improves SharePoint development experience

If you’ve read my old post on getting intellisense in onet.xml, or about a gazillion other articles on the web, you know how to set up your system so that you get the default CAML intellisense based on the wss.xsd schema that ships with SharePoint. However, you will soon discover that the default wss.xsd isn’t all that it could have been. Several attributes are missing, you’ll notice missing elements, especially when you get funky with custom view development, and you’ll even find outright errors.

Enter CAML.Intellisense. Now, I’ve been a fan of John Holliday’s CAML.net for a long time. I even describe CAML.net and its uses in my SharePoint book, and this time he has conjured up a much improved version of a SharePoint CAML schema file that you can use instead of the default wss.xsd.

One particularly impressive and helpful feature is the annotations in the schema, which effectively gives you a helping text when intellisense auto-complete pops up. I haven’t had the time to review everything, and, unless I live to be a million years old, I never will, but chances are that Mr. Holliday will put this on CodePlex (won’t you, John?) and allow others to collaborate on this magnificent tool.

Installing is also a breeze, but as mentioned on the announcement page, remember to remove your old catalog files, and, if required, re-attach your XML files to the new schema file.

I’ll leave the rest of the description to the man of the month: John Holliday. Take it away, John, and thanks from all of us…

.b

Pin It

(Almost) Back from the US

I’m almost back from the US now, but of course, the entire United Kingdom got shut down just as we landed due to a few inches of snow. Better hope the terrorists don’t buy a snow cannon…

In any case, after I get a few days of catching up, I will get back to writing new articles and post information. In the meantime, there were several people that approached me regarding various issues at the SPTechCon conference. If you have questions for me or wanted to contact me for other reasons, feel free to email me at furuknap<[at]>gmail.com. I’ll get back in touch as soon as time permits.

.b

Pin It