My new blog

My blog has moved to www.davehunter.co.uk/blog see you there.

Monday 16 July 2007

SPS Site Template - Is it really obsolete?

Venkat Varkala discusses in his post whether the SPS site template is infact obsolete. In the webtempsps.xml you have the following:

<Template Name="SPS" ID="20">
<Configuration ID="0" Title="SharePoint Portal Server Site" Type="0" Hidden="TRUE" ImageUrl="../images/spshome.gif" Description="This template is obsolete."></Configuration>
</Template>
When Microsoft refer to this template being obselete they mean it's obselete from the create site template picker page and shouldn't be set to visible. The "SPS" folder is still an integral part of portal site creation.

The SPSPORTAL site template (declaration below) doesn't have a folder in the 12 Hive (under 12\template\sitetemplates). This could be classed as a virtual site definition.
<Template Name="SPSPORTAL" ID="47">
<Configuration ID="0" Title="Collaboration Portal" Type="0" Hidden="FALSE" ImageUrl="/_layouts/1033/images/template_corp_intranet.png" Description="A starter site hierarchy for an intranet divisional portal. It includes a home page, a News site, a Site Directory, a Document Center, and a Search Center with Tabs. Typically, this site has nearly as many contributors as readers and is used to host team sites." ProvisionAssembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" ProvisionClass="Microsoft.SharePoint.Publishing.PortalProvisioningProvider" ProvisionData="SiteTemplates\\WebManifest\\PortalWebManifest.xml" RootWebOnly="TRUE" DisplayCategory="Publishing" VisibilityFeatureDependency="97A2485F-EF4B-401f-9167-FA4FE177C6F6">
</Configuration>
</Template>
This template uses the files from the "SPS" folder when the site is created. The definition and structure of the site is defined by ther webmanifest.xml. The webmanifest.xml defines the Site Definition the virtual Site Template should be based on and what sub sites should be created.
<portal xmlns="PortalTemplate.xsd"><web name="Home" siteDefinition="SPS" displayName="$Resources:spscore,PortalManifest_Home_DisplayName;" description="$Resources:spscore,PortalManifest_Home_Description;">
<webs>
<web name="News" siteDefinition="SPSNHOME" displayName="$Resources:spscore,PortalManifest_News_DisplayName;" description="$Resources:spscore,PortalManifest_News_Description;" />
<web name="SiteDirectory" siteDefinition="SPSSITES" displayName="$Resources:spscore,PortalManifest_SiteDirectory_DisplayName;" description="$Resources:spscore,PortalManifest_SiteDirectory_Description;" />
<web name="SearchCenter" siteDefinition="SRCHCEN" displayName="$Resources:spscore,PortalManifest_SearchCenter_DisplayName;" description="$Resources:spscore,PortalManifest_SearchCenter_Description;" />
<web name="Docs" siteDefinition="BDR" displayName="$Resources:spscore,PortalManifest_DocumentCenter_DisplayName;" description="$Resources:spscore,PortalManifest_DocumentCenter_Description;" />
</webs>
</web>
</portal>
Sites are created this way so that they are built the "supported way". Microsoft also say that you shouldn't modify the MySite template on the file system, you should modify the template by using Feature Stapling (see the Microsoft post). Feature stapling involving creating:
  • A Staplee - This feature does the work. For example it could provision files in the MySite.
  • A Stapler - This feature activates the Staplee feature when a site of a particular site is created.

The following xml is an example of the feature.xml for a Stapler

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<FeatureSiteTemplateAssociation Id="4DEFA336-EDC4-43cb-9560-FE2E27E76DFB" TemplateName="SPSPERS#0"/></Elements>

So when customising a portal template you should use feature stapling and site provisioning using the webmanifest.xml.

No comments: