in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Ton Stegeman [MVP] weblog

I have moved my blog to http://www.tonstegeman.com/blog. If you have a blogpost at sharepointblogs that does not display all the content on the right hand side, please go to the new blog. It has all the posts that are on this blog as well. I you have any feedback, please send me a message through the contact form.

SiteDefinitions in SharePoint 2007

MOSS 2007 still uses site definitions, as in SharePoint 2003 technologies. The basic structure of these site definitions is still the same, although there have been a lot of changes. In this post I will decribe a number of these changes.

Features
A lot of the options of a site are now added to the sitedefinition by activating features. This makes the onet.xml and the filestructure of the site definition much cleaner. Registering ListTemplates in a site definition for example, only requires a specific feature to be activated from the onet.xml. The <Configuration> element in onet.xml now contains an element <WebFeatures>. Registering the listtemplate for the Document Library is now done by adding this line to this element:
<Feature ID="00BFEA71-E717-4E80-AA17-D0C71B360101" >
In SharePoint 2003, the schema files for the list had to be in the LISTS folder in every site definition, and the ListTemplate had to be registered in every onet.xml. Now you register schema of the list and the registration are part of a feature, that you activate from onet. Much cleaner, because there is only 1 place where the list is defined and registered.

“Virtual” Site Definitions
In SharePoint 2003, a sitedefinition is a folder named “SPS[your_name]” in the SPS folder \60\TEMPLATE\1033 and a registration in webtempsps.xml (or any other file called “webtemp*”. In SharePoint 2007, the folders for site definitions have moved to a special folder called “SiteTemplates”. Their name no longer needs to start with “SPS”. Apart from that you can now have ‘virtual’ site definitions. Such site definitions are a registration of a number of webs that will be provisioned the the site definitions is used. The “Corporate Intanet Site” and the “Internet Presence Web Site” are examples of such a site definition. They do not point to a specific folder, but to a manifest file (which is set in the “ProvisionData” attribute).
In case of the Corporate Intranet Portal, this is a reference to the file called “PortalWebManifest.xml”. This file contains xml like the sample below:

<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;" />
        </webs>
    </web>
</portal>

When this site definition is used, a site called “Home” is created, and for this site the subsites that are referenced in the <webs> element will be created. Nice way of packaging a number of sites into 1 single site definitions.

ASPX pages

The aspx pages in a site definition no longer contain code/HTML. They use SharePoint masterpages and page layouts. So instead of changing a lot of aspx pages on the file system, you just make your changes to the page layout or the masterpage. Nice! 

Comments

No Comments

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts