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

Published by

Bjørn Furuknap

I previously did SharePoint. These days, I try new things to see where I can find the passion. If you have great ideas, cool projects, or is in general an awesome person, get in touch and we might find out together.

One thought on “Finding source file for provisioned file in SharePoint”

  1. there is a property of pagelayout SetupPath.

    When this is blank status is None and not Customized/Uncustomized.

    When it finds setup path it tries to find vti_hasdefaultcontent and then returns status as Customized/Uncustomized

    Right now few of our page layouts do have blank SetupPath and thats why status as None and wsp can not update those pagelayouts.

    We are now trying to set setuppath of those pagelayouts and but vti_setuppath is not getting updated…

    ——————————————————————————–

Leave a Reply

Your email address will not be published.