- September
- 27
- 2007
Going Down The Rabbit Hole – The MOSS 2007 Publishing Site Definition
Posted by sezai
No Comments »
THIS BLOG HAS MOVED!!!
THE UPDATED POST CAN BE FOUND HERE – http://sharepoint-sezai-moss-2007.blogspot.com/2008/02/going-down-rabbit-hole-moss-2007.html
It has been well over a year since I started developing on MOSS 2007, I started development with just using SharePoint Designer, and manually deploying assemblies and artifacts without features and solutions.
Soon after I realised the trouble and pain you could get yourself into if you don't use the feature and solution framework. In the aim to work 'fast' and finish your development tasks quickly, you can fall into a massive trap and realise that although it takes plenty of effort to develop Features, in the long term you are better off because of RE-USE of features and ease of DEPLOYMENT. All developers love reusing their work, it saves time in the long run, and you don't have to constantly re-do the same thing like a robot. When you deploy you customisations to a production system, you don't always have SharePoint Designer available to hookup to the site, and you don't want to have to remember a dozen manual steps to repeat, more robot action, it also leaves room for human error, and the Network/Systems Admin guys won't be happy with you, they want an atomic deployment process.
You can go one step further, develop your own Custom Site Definition, so you can allow users to create *custom* sites pre-populated with your Lists and other files, and the sites can have YOUR features enabled AUTOMATICALLY, sounds nice hey?
In the last few months I have been doing just that, so I thought I would document the following to help myself (and now YOU) understand what happens when sites are created in SharePoint and how the Features are enabled.
So what actually happens when you create a new Publishing Site ?
Whenever you create any site in SharePoint, XML files in the 12 Hive are used in the process to create the site, the various XML files contain information and settings needed to provision sites as well as references to dependent Features that are also activated on Site Collection creation or Web Creation. The Folder '12-hive'TEMPLATE1033XML Contains the file webtempsps.xmlThe file contains some of the following related to Publishing Sites, the BLANKINTERNETCONTAINER template is used to create a new Publishing Site Collection
<Template Name="BLANKINTERNET" ID="53"> <Configuration ID="0" Title="Publishing Site" Hidden="TRUE" ImageUrl="/_layouts/1033/images/IPPT.gif" Description="This template creates a site for publishing Web pages on a schedule, with workflow features enabled. By default, only Publishing subsites can be created under this site. A Document and Picture Library are included for storing Web publishing assets." SubWebOnly="TRUE" DisplayCategory="Publishing"> </Configuration> <Configuration ID="1" Title="Press Releases Site" Hidden="TRUE" ImageUrl="/_layouts/1033/images/IPPT.gif" Description="This template creates the Press Releases subsite for an Internet-facing corporate presence website." SubWebOnly="TRUE" DisplayCategory="Publishing" VisibilityFeatureDependency="F6924D36-2FA8-4f0b-B16D-06B7250180FA"> </Configuration> <Configuration ID="2" Title="Publishing Site with Workflow" Hidden="FALSE" ImageUrl="/_layouts/1033/images/PublishingSite.gif" Description="A site for publishing Web pages on a schedule by using approval workflows. It includes document and image libraries for storing Web publishing assets. By default, only sites with this template can be created under this site." FilterCategories="PublishingSiteTemplate" SubWebOnly="TRUE" DisplayCategory="Publishing" VisibilityFeatureDependency="F6924D36-2FA8-4f0b-B16D-06B7250180FA"> </Configuration> </Template><Template Name="BLANKINTERNETCONTAINER" ID="52"> <Configuration ID="0" Title="Publishing Portal" Hidden="FALSE" ImageUrl="/_layouts/1033/images/IPPT.gif" Description="A starter site hierarchy for an Internet-facing site or a large intranet portal. This site can be customized easily with distinctive branding. It includes a home page, a sample press releases subsite, a Search Center, and a login page. Typically, this site has many more readers than contributors, and it is used to publish Web pages with approval workflows." ProvisionAssembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" ProvisionClass="Microsoft.SharePoint.Publishing.PortalProvisioningProvider" ProvisionData="xml\InternetBlank.xml" RootWebOnly="TRUE" DisplayCategory="Publishing" VisibilityFeatureDependency="97A2485F-EF4B-401f-9167-FA4FE177C6F6"> </Configuration> </Template>
What is VisibilityFeatureDependency ?
There are Feature IDs referenced in the VisibilityFeatureDependency attribute
The F6924D36-2FA8-4f0b-B16D-06B7250180FA Feature ID refers to the PublishingSite feature and Feature ID 97A2485F-EF4B-401f-9167-FA4FE177C6F6 refers to the BaseSiteStapling feature.
F6924D36-2FA8-4f0b-B16D-06B7250180FA – PublishingSite
This is the PublishingSite feature. This feature does nothing more than Activate four other features, it has the following ActivationDependencies
<ActivationDependencies> <ActivationDependency FeatureId="A392DA98-270B-4e85-9769-04C0FDE267AA" /> <ActivationDependency FeatureId="AEBC918D-B20F-4a11-A1DB-9ED84D79C87E" /> <ActivationDependency FeatureId="89E0306D-453B-4ec5-8D68-42067CDBF98E" /> <ActivationDependency FeatureId="D3F51BE2-38A8-4e44-BA84-940D35BE1566" /> </ActivationDependencies>
More feature IDs to lookup !
A392DA98-270B-4e85-9769-04C0FDE267AA – PublishingPrerequisites
This is the PublishingPrerequisites feature which hooks up a Feature Event receiver.
AEBC918D-B20F-4a11-A1DB-9ED84D79C87E – PublishingResources
This is the PublishingResources feature which provisions Site Columns, Content Types, Files and Resource settings
<ElementManifests> <ElementManifest Location="PublishingColumns.xml"/> <ElementManifest Location="PublishingContentTypes.xml"/> <ElementManifest Location="ProvisionedFiles.xml"/> <ElementManifest Location="PublishingResourcesSiteSettings.xml"/>
</ElementManifests>
89E0306D-453B-4ec5-8D68-42067CDBF98E – Navigation
This is the Navigation feature which provisions custom actions and controls for Navigation
D3F51BE2-38A8-4e44-BA84-940D35BE1566 – PublishingLayouts
This is the PublishingLayouts feature which provisions files into the site. It provisions all Publishing Page Layouts, Master Pages, Page Layout Preview Images, Style library Images and Style Library CSS
97A2485F-EF4B-401f-9167-FA4FE177C6F6 – BaseSiteStapling
This is the BaseSiteStapling feature, it will staple several features to site definitions listed in the feature, it contains dozens of FeatureSiteTemplateAssociation nodes, it is interesting to note that :
Feature B21B090C-C796-4b0f-AC0F-7EF1659C20AE (BaseSite) is stapled to the following site templates :
STS#0 , STS#2 , MPS#0 , MPS#1 , MPS#2 , MPS#3 , MPS#4 , WIKI#0 , BLOG#0 , BDR#0 , EAWF#0 , OFFILE#0 , OFFILE#1 , PWA#0 , PWS#0 , SPS#0 , SPSMSITE#0 , SPSTOC#0 , SPSTOPIC#0 , SPSNEWS#0 , SPSNHOME#0 , SPSSITES#0 , SPSBWEB#0 , SPSCOMMU#0 , SPSREPORTCENTER#0 , SPSPORTAL#0 , SRCHCEN#0 , PROFILES#0 , CMSPUBLISHING#0
The BaseSite Feature is an ActivationDependency feature and activates the following Features
<ActivationDependency FeatureId="E978B1A6-8DE7-49d0-8600-09A250354E14" /> LocalSiteDirectorySettingsLink Feature <ActivationDependency FeatureId="14AAFD3A-FCB9-4bb7-9AD7-D8E36B663BBD" /> LocalSiteDirectoryControl Feature <ActivationDependency FeatureId="5F3B0127-2F1D-4cfd-8DD2-85AD1FB00BFC" /> PortalLayouts Feature <ActivationDependency FeatureId="2ED1C45E-A73B-4779-AE81-1524E4DE467A" /> WebPartAdderGroups Feature
Feature 99FE402E-89A0-45aa-9163-85342E865DC8 (BaseWeb) is stapled to the following site templates :
STS#0 , STS#2 , MPS#0 , MPS#1 , MPS#2 , MPS#3 , MPS#4 , WIKI#0 , BLOG#0 , BDR#0 , EAWF#0 , OFFILE#0 , OFFILE#1 , PWA#0 , PWS#0 , SPS#0 , SPSMSITE#0 , SPSTOC#0 , SPSTOPIC#0 , SPSNEWS#0 , SPSNHOME#0 , SPSSITES#0 , SPSBWEB#0 , SPSCOMMU#0 , SPSREPORTCENTER#0" , SPSPORTAL#0 , SRCHCEN#0 , PROFILES#0 , CMSPUBLISHING#0
The BaseWeb Feature is also an ActivationDependency feature and activates the following Features
<ActivationDependency FeatureId="E8734BB6-BE8E-48A1-B036-5A40FF0B8A81" /> RelatedLinksScopeSettingsLink Feature <ActivationDependency FeatureId="56DD7FE7-A155-4283-B5E6-6147560601EE" /> AnalyticsLinks Feature
<ActivationDependency FeatureId="0BE49FE9-9BC9-409d-ABF9-702753BD878D" /> FeatureStapling Feature
Feature 541F5F57-C847-4e16-B59A-B31E90E6F9EA (NavigationProperties) is stapled to the SRCHCENTERLITE#1 site template with the following properties within the FeatureSiteTemplateAssociation
<Property Key="IncludeInGlobalNavigation" Value="false" />
<Property Key="IncludeInCurrentNavigation" Value="false" />
<Property Key="InheritCurrentNavigation" Value="true" />
<Property Key="IncludePages" Value="false" />
Which explains why the Search Centre Lite Navigation is different to navigation in all other site templates!
We have now traced through the VisibilityFeatureDendencies in webtempsps.xml, let us now get back to this file and continue this journey down the rabbit hole by exploring the SiteTemplates referenced.
<Template Name="BLANKINTERNETCONTAINER" ID="52"> <Configuration ID="0" Title="Publishing Portal" /> </Template> <Template Name="BLANKINTERNET" ID="53"> <Configuration ID="0" Title="Publishing Site" /><Configuration ID="1" Title="Press Releases Site" /><Configuration ID="2" Title="Publishing Site with Workflow" />
</Template>
The Folder '12-hive'TEMPLATESiteTemplates Contains a folder for each Site Template in the site. One such folder is BLANKINTERNET which contains an XML folder that contains a ONET.xml file.
This file contains the following configuration nodes, which contain Feature ids, so even more features can be activate on site creation, there are Site Features activated on Site Collection Creation and Web Features activated on Web (sub-site) Creation.
<Configurations> <Configuration ID="-1" Name="NewWeb"/> <Configuration ID="1" Name="BLANKINTERNET"> NOTE : THIS SPECIFIC CONFIGURATION HAS SITE FEATURES AND WEB FEATURES<SiteFeatures> <!– Workflow Features –> <!– Workflow Expiration –> <Feature ID="C85E5759-F323-4EFB-B548-443D2216EFB5" /> <!– Workflow Review –> <Feature ID="02464C6A-9D07-4F30-BA04-E9035CF54392" /> <!– Workflow Signature –> <Feature ID="6C09612B-46AF-4B2F-8DFC-59185C962A29" /> <!– Workflow Translation –> <Feature ID="C6561405-EA03-40A9-A57F-F25472942A22" /> <Feature ID="A392DA98-270B-4e85-9769-04C0FDE267AA"> <!– PublishingPrerequisites –> </Feature> <Feature ID="7C637B23-06C4-472d-9A9A-7C175762C5C4"> <!– ViewFormPagesLockDown –> </Feature> <Feature ID="AEBC918D-B20F-4a11-A1DB-9ED84D79C87E"> <!– PublishingResources –> <Properties xmlns="http://schemas.microsoft.com/sharepoint/"> <Property Key="AllowRss" Value="false"/> <Property Key="SimplePublishing" Value="false" /> </Properties> </Feature> <Feature ID="F6924D36-2FA8-4f0b-B16D-06B7250180FA"> <!– Office SharePoint Server Publishing –> </Feature> <!– SearchCenter Url feature –> <Feature ID="7AC8CC56-D28E-41f5-AD04-D95109EB987A" > <Properties xmlns="http://schemas.microsoft.com/sharepoint/"> <Property Key="SearchCenterUrl" Value="~SiteCollection/Search/" /> </Properties> </Feature> </SiteFeatures><WebFeatures> <!– Include the common WSSListTemplateFeatures used by CMS –> <Feature ID="00BFEA71-DE22-43B2-A848-C05709900100" > </Feature> <Feature ID="00BFEA71-E717-4E80-AA17-D0C71B360101" > </Feature> <Feature ID="00BFEA71-52D4-45B3-B544-B1C71B620109" > </Feature> <Feature ID="00BFEA71-A83E-497E-9BA0-7A5C597D0107" > </Feature> <Feature ID="00BFEA71-4EA5-48D4-A4AD-305CF7030140" > </Feature> <Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416"> <!– Publishing –> <Properties xmlns="http://schemas.microsoft.com/sharepoint/"> <Property Key="ChromeMasterUrl" Value="~SiteCollection/_catalogs/masterpage/BlueBand.master"/> <Property Key="WelcomePageUrl" Value="$Resources:cmscore,List_Pages_UrlName;/default.aspx"/> <Property Key="PagesListUrl" Value=""/> <Property Key="AvailableWebTemplates" Value="*-BLANKINTERNET#2"/> <Property Key="AvailablePageLayouts" Value=""/> <Property Key="AlternateCssUrl" Value="" /> <Property Key="SimplePublishing" Value="false" /> </Properties> </Feature> <Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA"> <!– Per-Web Portal Navigation Properties–> <Properties xmlns="http://schemas.microsoft.com/sharepoint/"> <Property Key="InheritGlobalNavigation" Value="true"/> <Property Key="IncludeSubSites" Value="true"/> </Properties> </Feature> <Feature ID="94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB"> <!– Office SharePoint Server Publishing –> </Feature> </WebFeatures></Configuration><Configuration ID="0" Name="BLANKINTERNET"><WebFeatures> <!– Include the common WSSListTemplateFeatures used by CMS –> <Feature ID="00BFEA71-DE22-43B2-A848-C05709900100" > </Feature> <Feature ID="00BFEA71-E717-4E80-AA17-D0C71B360101" > </Feature> <Feature ID="00BFEA71-52D4-45B3-B544-B1C71B620109" > </Feature> <Feature ID="00BFEA71-A83E-497E-9BA0-7A5C597D0107" > </Feature> <Feature ID="00BFEA71-4EA5-48D4-A4AD-305CF7030140" > </Feature> <Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416"> <!– Publishing –> <Properties xmlns="http://schemas.microsoft.com/sharepoint/"> <Property Key="ChromeMasterUrl" Value=""/> <Property Key="WelcomePageUrl" Value="$Resources:cmscore,List_Pages_UrlName;/default.aspx"/> <Property Key="PagesListUrl" Value=""/> <Property Key="AvailableWebTemplates" Value=""/> <Property Key="AvailablePageLayouts" Value=""/> <Property Key="AlternateCssUrl" Value="" /> <Property Key="SimplePublishing" Value="false" /> </Properties> </Feature> <Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA"> <!– Per-Web Portal Navigation Properties–> <Properties xmlns="http://schemas.microsoft.com/sharepoint/"> <Property Key="InheritGlobalNavigation" Value="true"/> <Property Key="ShowSiblings" Value="true"/> <Property Key="IncludeSubSites" Value="true"/> </Properties> </Feature> <Feature ID="94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB"> <!– Office SharePoint Server Publishing –> </Feature> </WebFeatures></Configuration><Configuration ID="2" Name="BLANKINTERNET"><WebFeatures> <!– Include the common WSSListTemplateFeatures used by CMS –> <Feature ID="00BFEA71-DE22-43B2-A848-C05709900100" > </Feature> <Feature ID="00BFEA71-E717-4E80-AA17-D0C71B360101" > </Feature> <Feature ID="00BFEA71-52D4-45B3-B544-B1C71B620109" > </Feature> <Feature ID="00BFEA71-A83E-497E-9BA0-7A5C597D0107" > </Feature> <Feature ID="00BFEA71-4EA5-48D4-A4AD-305CF7030140" > </Feature> <Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416"> <!– Publishing –> <Properties xmlns="http://schemas.microsoft.com/sharepoint/"> <Property Key="ChromeMasterUrl" Value=""/> <Property Key="WelcomePageUrl" Value="$Resources:cmscore,List_Pages_UrlName;/default.aspx"/> <Property Key="PagesListUrl" Value=""/> <Property Key="AvailableWebTemplates" Value=""/> <Property Key="AvailablePageLayouts" Value=""/> <Property Key="AlternateCssUrl" Value="" /> <Property Key="SimplePublishing" Value="false" /> </Properties> </Feature> <Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA"> <!– Per-Web Portal Navigation Properties–> <Properties xmlns="http://schemas.microsoft.com/sharepoint/"> <Property Key="InheritGlobalNavigation" Value="true"/> <Property Key="ShowSiblings" Value="true"/> <Property Key="IncludeSubSites" Value="true"/> </Properties> </Feature> <Feature ID="94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB"> <!– Office SharePoint Server Publishing –> </Feature> </WebFeatures></Configuration></Configurations>
Publishing Site Features
The following are site features activated on Site Collection creation
C85E5759-F323-4EFB-B548-443D2216EFB5 ExpirationWorkflow Feature
02464C6A-9D07-4F30-BA04-E9035CF54392 ReviewWorkflows Feature
6C09612B-46AF-4B2F-8DFC-59185C962A29 SignaturesWorkflow Feature
C6561405-EA03-40A9-A57F-F25472942A22 TranslationWorkflow Feature
A392DA98-270B-4e85-9769-04C0FDE267AA PublishingPrerequisites Feature
7C637B23-06C4-472d-9A9A-7C175762C5C4 ViewFormPagesLockDown Feature
AEBC918D-B20F-4a11-A1DB-9ED84D79C87E PublishingResources Feature
F6924D36-2FA8-4f0b-B16D-06B7250180FA PublishingSite Feature
7AC8CC56-D28E-41f5-AD04-D95109EB987A OSSSearchCenterUrlSiteFeature Feature
Publishing Web Features
The following is a list of all Web Features in the onet.xml file
00BFEA71-DE22-43B2-A848-C05709900100 CustomList Feature
00BFEA71-E717-4E80-AA17-D0C71B360101 DocumentLibrary Feature
00BFEA71-52D4-45B3-B544-B1C71B620109 PictureLibrary Feature
00BFEA71-A83E-497E-9BA0-7A5C597D0107 TasksList Feature
00BFEA71-4EA5-48D4-A4AD-305CF7030140 WorkflowHistoryList Feature
22A9EF51-737B-4ff2-9346-694633FE4416 Publishing Feature
541F5F57-C847-4e16-B59A-B31E90E6F9EA NavigationProperties Feature
94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB PublishingWeb Feature
Summary
This investigation demonstrates what actually happens when you create a publishing site in MOSS 2007. In summary, a series of features are enabled on the site collection, in a specific order. Features are also enabled when creating subsites.
Why do we need this information ?
To create YOUR OWN Custom Publishing Site Definitions, so you have full control over what features are activated in your site, you can get into trouble if you do not activate features in the correct order, such as activating a feature that contains Page Layouts referencing a Content Type, if the Page Layout feature is enabled before the Content Type feature then the pages created will not be created correctly because of the dependency issue.
THIS BLOG HAS MOVED!!!
THE UPDATED POST CAN BE FOUND HERE – http://sharepoint-sezai-moss-2007.blogspot.com/2008/02/going-down-rabbit-hole-moss-2007.html