Sunday, June 29, 2008

ONET.XML

Onet.xml
  • It supports multiple configurations

  • It also supports feature associations: not feature stapling, rather these are sections where you can specify the features that will be activated whenever an instance of the site definition is created.

  • It also contains a section for document templates

  • You get some support for customising navigation

  • It also can create list instances of all the different types of lists depending on the features that you have associated with the template.

  • You can deploy files with it.

  • You can also specify web part zone contents

Elements of Onet.xml

1) Project

  • Top level element

  • Title of the site definition

  • ListDir
    • Required

    • Default list directory is Lists

  • You can also specify AlternateCSS

    • This specifies an alternate to core.css. Since you can use theme, this AlternateCSS is not quite useful.

  • CustomJSUrl

    • This one is not defined in the schema

    • If you specified this, the web controls which are included in the master pages can also reference your own javascript.

  • DisableWebDesignFeatures
    • Prevent your users from doing things in Sharepoint designer

2) DocumentTemplates

  • Specifies all of the available document templates

  • This is also used to fill document template choices whenever a new library is created

  • You can optionally specify actual template file

  • Team site templates are located at 12\TEMPLATE\1033\STS\DOCTEMP

3) Configurations

  • This supports variations on a definition

  • It must match the webtemp

  • In the STS configurations
    • You get a Team site

    • Blank site

    • Document Workspace

  • Vary
    • List instances

    • Features

    • Modules (Modules are collections of files that are going to be deployed into the template)

4) Features

  • Defines site features: features that are going to be activated on the site
  • Defines web features
  • Missing features will prevent provisioning, include all the features which are depended on other features

5) List Instances

  • You can also create list instances using ListInstances element. List instances are specified by
    • A FeatureID
    • A Type
    • And Url
  • It allows
    • Rows and data
    • You can specify the list to appear on the quick launch
    • It also support versioning configuration (check in/out, version rules, approval for lists)

6) Modules

  • This allows you to place files into a list as well as create a folder.
    • You can also in this element specifying a file to appear on the navigation bar using NavBarPage decoration
  • If the file is a web part page, you can specify different
    • Views
      • List view in web part zone
    • AllUsersWebPart: you can also add web parts for all users
Here is a copy of the ONET.xml of team site located in 12\TEMPLATE\SiteTemplates\sts\xml:

<?xml version="1.0" encoding="utf-8"?>

<Project Title="$Resources:onet_TeamWebSite;" Revision="2" ListDir="$Resources:core,lists_Folder;" xmlns:ows="Microsoft SharePoint"><!-- _locID@Title="camlidonet1" _locComment="{StringCategory=HTX}" -->

<NavBars>

<NavBar Name="$Resources:core,category_Top;" Separator="&amp;nbsp;&amp;nbsp;&amp;nbsp;" Body="&lt;a ID='onettopnavbar#LABEL_ID#' href='#URL#' accesskey='J'&gt;#LABEL#&lt;/a&gt;" ID="1002" />

<NavBar Name="$Resources:core,category_Documents;" Prefix="&lt;table border=0 cellpadding=4 cellspacing=0&gt;" Body="&lt;tr&gt;&lt;td&gt;&lt;table border=0 cellpadding=0 cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;&lt;img src='/_layouts/images/blank.gif' ID='100' alt='' border=0&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign=top&gt;&lt;a ID=onetleftnavbar#LABEL_ID# href='#URL#'&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;" Suffix="&lt;/table&gt;" ID="1004" />

<NavBar Name="$Resources:core,category_Lists;" Prefix="&lt;table border=0 cellpadding=4 cellspacing=0&gt;" Body="&lt;tr&gt;&lt;td&gt;&lt;table border=0 cellpadding=0 cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;&lt;img src='/_layouts/images/blank.gif' ID='100' alt='' border=0&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign=top&gt;&lt;a ID=onetleftnavbar#LABEL_ID# href='#URL#'&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;" Suffix="&lt;/table&gt;" ID="1003" />

<NavBar Name="$Resources:core,category_Discussions;" Prefix="&lt;table border=0 cellpadding=4 cellspacing=0&gt;" Body="&lt;tr&gt;&lt;td&gt;&lt;table border=0 cellpadding=0 cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;&lt;img src='/_layouts/images/blank.gif' ID='100' alt='' border=0&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign=top&gt;&lt;a ID=onetleftnavbar#LABEL_ID# href='#URL#'&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;" Suffix="&lt;/table&gt;" ID="1006" />

<NavBar Name="$Resources:core,category_Sites;" Prefix="&lt;table border=0 cellpadding=4 cellspacing=0&gt;" Body="&lt;tr&gt;&lt;td&gt;&lt;table border=0 cellpadding=0 cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;&lt;img src='/_layouts/images/blank.gif' ID='100' alt='' border=0&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign=top&gt;&lt;a ID=onetleftnavbar#LABEL_ID# href='#URL#'&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;" Suffix="&lt;/table&gt;" ID="1026" />

<NavBar Name="$Resources:core,category_People;" Prefix="&lt;table border=0 cellpadding=4 cellspacing=0&gt;" Body="&lt;tr&gt;&lt;td&gt;&lt;table border=0 cellpadding=0 cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;&lt;img src='/_layouts/images/blank.gif' ID='100' alt='' border=0&gt;&amp;nbsp;&lt;/td&gt;&lt;td valign=top&gt;&lt;a ID=onetleftnavbar#LABEL_ID# href='#URL#'&gt;#LABEL#&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;" Suffix="&lt;/table&gt;" ID="1027" />

</NavBars>

<ListTemplates>

</ListTemplates>

<DocumentTemplates>

<DocumentTemplate Path="STS" Name="" DisplayName="$Resources:core,doctemp_None;" Type="100" Default="FALSE" Description="$Resources:core,doctemp_None_Desc;" />

<DocumentTemplate Path="STS" DisplayName="$Resources:core,doctemp_Word97;" Type="101" Default="TRUE" Description="$Resources:core,doctemp_Word97_Desc;">

<DocumentTemplateFiles>

<DocumentTemplateFile Name="doctemp\word\wdtmpl.doc" TargetName="Forms/template.doc" Default="TRUE" />

</DocumentTemplateFiles>

</DocumentTemplate>

<DocumentTemplate Path="STS" DisplayName="$Resources:core,doctemp_Excel97;" Type="103" Description="$Resources:core,doctemp_Excel97_Desc;">

<DocumentTemplateFiles>

<DocumentTemplateFile Name="doctemp\xl\xltmpl.xls" TargetName="Forms/template.xls" Default="TRUE" />

</DocumentTemplateFiles>

</DocumentTemplate>

<DocumentTemplate Path="STS" DisplayName="$Resources:core,doctemp_Powerpoint97;" Type="104" Description="$Resources:core,doctemp_Powerpoint97_Desc;">

<DocumentTemplateFiles>

<DocumentTemplateFile Name="doctemp\ppt\pptmpl.pot" TargetName="Forms/template.pot" Default="TRUE" />

</DocumentTemplateFiles>

</DocumentTemplate>

<DocumentTemplate Path="STS" DisplayName="$Resources:core,doctemp_Word;" Type="121" Default="TRUE" Description="$Resources:core,doctemp_Word_Desc;">

<DocumentTemplateFiles>

<DocumentTemplateFile Name="doctemp\word\wdtmpl.dotx" TargetName="Forms/template.dotx" Default="TRUE" />

</DocumentTemplateFiles>

</DocumentTemplate>

<DocumentTemplate Path="STS" DisplayName="$Resources:core,doctemp_Excel;" Type="122" Description="$Resources:core,doctemp_Excel_Desc;">

<DocumentTemplateFiles>

<DocumentTemplateFile Name="doctemp\xl\xltmpl.xlsx" TargetName="Forms/template.xlsx" Default="TRUE" />

</DocumentTemplateFiles>

</DocumentTemplate>

<DocumentTemplate Path="STS" DisplayName="$Resources:core,doctemp_Powerpoint;" Type="123" Description="$Resources:core,doctemp_Powerpoint_Desc;">

<DocumentTemplateFiles>

<DocumentTemplateFile Name="doctemp\ppt\pptmpl.pptx" TargetName="Forms/template.pptx" Default="TRUE" />

</DocumentTemplateFiles>

</DocumentTemplate>

<DocumentTemplate Path="STS" DisplayName="$Resources:core,doctemp_OneNote;" Type="111" Description="$Resources:core,doctemp_OneNote_Desc;">

<DocumentTemplateFiles>

<DocumentTemplateFile Name="doctemp\onenote\template.one" TargetName="Forms/template.one" Default="TRUE" />

</DocumentTemplateFiles>

</DocumentTemplate>

<DocumentTemplate Path="STS" DisplayName="$Resources:core,doctemp_FP;" Type="102" Description="$Resources:core,doctemp_FP_Desc;">

<DocumentTemplateFiles>

<DocumentTemplateFile Name="doctemp\fp\fptmpl.htm" TargetName="Forms/template.htm" Default="TRUE" />

</DocumentTemplateFiles>

</DocumentTemplate>

<DocumentTemplate Path="STS" DisplayName="$Resources:core,doctemp_BasicPage;" Type="105" Description="$Resources:core,doctemp_BasicPage_Desc;">

<DocumentTemplateFiles>

<DocumentTemplateFile Name="doctemp\blankpgs\_basicpage.htm" TargetName="Forms/_basicpage.htm" Default="TRUE" />

</DocumentTemplateFiles>

</DocumentTemplate>

<DocumentTemplate Path="STS" DisplayName="$Resources:core,doctemp_WebPartPage;" Type="106" Description="$Resources:core,doctemp_WebPartPage_Desc;">

<DocumentTemplateFiles>

<DocumentTemplateFile Name="doctemp\smartpgs\_webpartpage.htm" TargetName="Forms/_webpartpage.htm" Default="TRUE" />

</DocumentTemplateFiles>

</DocumentTemplate>

<DocumentTemplate XMLForm="TRUE" Path="STS" DisplayName="$Resources:core,doctemp_BlankForm;" Type="1000" Default="TRUE" Description="$Resources:core,doctemp_BlankForm_Desc;">

<DocumentTemplateFiles>

<DocumentTemplateFile Name="doctemp\xmlforms\blank\template.xml" TargetName="Forms/template.xml" Default="TRUE" />

</DocumentTemplateFiles>

</DocumentTemplate>

</DocumentTemplates>

<Configurations>

<Configuration ID="-1" Name="NewWeb" />

<Configuration ID="0" Name="Default">

<Lists>

<List FeatureId="00BFEA71-E717-4E80-AA17-D0C71B360101" Type="101" Title="$Resources:core,shareddocuments_Title;" Url="$Resources:core,shareddocuments_Folder;" QuickLaunchUrl="$Resources:core,shareddocuments_Folder;/Forms/AllItems.aspx" />

<List FeatureId="00BFEA71-6A49-43FA-B535-D15C05500108" Type="108" Title="$Resources:core,discussions_Title;" Url="$Resources:core,lists_Folder;/$Resources:core,discussions_Folder;" QuickLaunchUrl="$Resources:core,lists_Folder;/$Resources:core,discussions_Folder;/AllItems.aspx" EmailAlias="$Resources:core,discussions_EmailAlias;" />

<List FeatureId="00BFEA71-D1CE-42de-9C63-A44004CE0104" Type="104" Title="$Resources:core,announceList;" Url="$Resources:core,lists_Folder;/$Resources:core,announce_Folder;">

<Data>

<Rows>

<Row>

<Field Name="Title">$Resources:onetid11;</Field>

<Field Name="Body">$Resources:onetid12;</Field>

<Field Name="Expires">&lt;ows:TodayISO/&gt;</Field>

</Row>

</Rows>

</Data>

</List>

<List FeatureId="00BFEA71-2062-426C-90BF-714C59600103" Type="103" Title="$Resources:core,linksList;" Url="$Resources:core,lists_Folder;/$Resources:core,links_Folder;" />

<List FeatureId="00BFEA71-EC85-4903-972D-EBE475780106" Type="106" Title="$Resources:core,calendarList;" Url="$Resources:core,lists_Folder;/$Resources:core,calendar_Folder;" QuickLaunchUrl="$Resources:core,lists_Folder;/$Resources:core,calendar_Folder;/Calendar.aspx" EmailAlias="$Resources:core,calendar_EmailAlias;" />

<List FeatureId="00BFEA71-A83E-497E-9BA0-7A5C597D0107" Type="107" Title="$Resources:core,taskList;" Url="$Resources:core,lists_Folder;/$Resources:core,tasks_Folder;" QuickLaunchUrl="$Resources:core,lists_Folder;/$Resources:core,tasks_Folder;/AllItems.aspx" />

</Lists>

<Modules>

<Module Name="Default" />

</Modules>

<SiteFeatures>

<!-- BasicWebParts Feature -->

<Feature ID="00BFEA71-1C5E-4A24-B310-BA51C3EB7A57" />

<!-- Three-state Workflow Feature -->

<Feature ID="FDE5D850-671E-4143-950A-87B473922DC7" />

</SiteFeatures>

<WebFeatures>

<Feature ID="00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5" />

<!-- TeamCollab Feature -->

<Feature ID="F41CC668-37E5-4743-B4A8-74D1DB3FD8A4" />

<!-- MobilityRedirect -->

</WebFeatures>

</Configuration>

<Configuration ID="1" Name="Blank">

<Lists />

<Modules>

<Module Name="DefaultBlank" />

</Modules>

<SiteFeatures>

<!-- BasicWebParts Feature -->

<Feature ID="00BFEA71-1C5E-4A24-B310-BA51C3EB7A57" />

<!-- Three-state Workflow Feature -->

<Feature ID="FDE5D850-671E-4143-950A-87B473922DC7" />

</SiteFeatures>

<WebFeatures>

<Feature ID="00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5" />

<!-- TeamCollab Feature -->

<Feature ID="F41CC668-37E5-4743-B4A8-74D1DB3FD8A4" />

<!-- MobilityRedirect -->

</WebFeatures>

</Configuration>

<Configuration ID="2" Name="DWS">

<Lists>

<List FeatureId="00BFEA71-E717-4E80-AA17-D0C71B360101" Type="101" Title="$Resources:core,shareddocuments_Title;" Url="$Resources:core,shareddocuments_Folder;" />

<List FeatureId="00BFEA71-6A49-43FA-B535-D15C05500108" Type="108" Title="$Resources:core,discussions_Title;" Url="$Resources:core,lists_Folder;/$Resources:core,discussions_Folder;" QuickLaunchUrl="$Resources:core,lists_Folder;/$Resources:core,discussions_Folder;" />

<List FeatureId="00BFEA71-D1CE-42de-9C63-A44004CE0104" Type="104" Title="$Resources:core,announceList;" Url="$Resources:core,lists_Folder;/$Resources:core,announce_Folder;">

<Data>

<Rows>

<Row>

<Field Name="Title">$Resources:onetid11;</Field>

<Field Name="Body">$Resources:onetid12;</Field>

<Field Name="Expires">&lt;ows:TodayISO/&gt;</Field>

</Row>

</Rows>

</Data>

</List>

<List FeatureId="00BFEA71-2062-426C-90BF-714C59600103" Type="103" Title="$Resources:core,linksList;" Url="$Resources:core,lists_Folder;/$Resources:core,links_Folder;" />

<List FeatureId="00BFEA71-EC85-4903-972D-EBE475780106" Type="106" Title="$Resources:core,calendarList;" Url="$Resources:core,lists_Folder;/$Resources:core,calendar_Folder;" QuickLaunchUrl="$Resources:core,lists_Folder;/$Resources:core,calendar_Folder;/Calendar.aspx" />

<List FeatureId="00BFEA71-A83E-497E-9BA0-7A5C597D0107" Type="107" Title="$Resources:core,taskList;" Url="$Resources:core,lists_Folder;/$Resources:core,tasks_Folder;" />

</Lists>

<Modules>

<Module Name="DWS" />

</Modules>

<SiteFeatures>

<!-- BasicWebParts Feature -->

<Feature ID="00BFEA71-1C5E-4A24-B310-BA51C3EB7A57" />

<!-- Three-state Workflow Feature -->

<Feature ID="FDE5D850-671E-4143-950A-87B473922DC7" />

</SiteFeatures>

<WebFeatures>

<Feature ID="00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5" />

<!-- TeamCollab Feature -->

<Feature ID="F41CC668-37E5-4743-B4A8-74D1DB3FD8A4" />

<!-- MobilityRedirect -->

</WebFeatures>

</Configuration>

</Configurations>

<Modules>

<Module Name="Default" Url="" Path="">

<File Url="default.aspx" NavBarHome="True">

<View List="$Resources:core,lists_Folder;/$Resources:core,announce_Folder;" BaseViewID="0" WebPartZoneID="Left" />

<View List="$Resources:core,lists_Folder;/$Resources:core,calendar_Folder;" BaseViewID="0" RecurrenceRowset="TRUE" WebPartZoneID="Left" WebPartOrder="2" />

<AllUsersWebPart WebPartZoneID="Right" WebPartOrder="1"><![CDATA[

<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" xmlns:iwp="http://schemas.microsoft.com/WebPart/v2/Image">

<Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>

<TypeName>Microsoft.SharePoint.WebPartPages.ImageWebPart</TypeName>

<FrameType>None</FrameType>

<Title>$Resources:wp_SiteImage;</Title>

<iwp:ImageLink>/_layouts/images/homepage.gif</iwp:ImageLink>

<iwp:AlternativeText>$Resources:core,sitelogo_wss;</iwp:AlternativeText>

</WebPart>

]]></AllUsersWebPart>

<View List="$Resources:core,lists_Folder;/$Resources:core,links_Folder;" BaseViewID="0" WebPartZoneID="Right" WebPartOrder="2" />

<NavBarPage Name="$Resources:core,nav_Home;" ID="1002" Position="Start" />

<NavBarPage Name="$Resources:core,nav_Home;" ID="0" Position="Start" />

</File>

</Module>

<Module Name="DefaultBlank" Url="" Path="">

<File Url="default.aspx" NavBarHome="True" Type="Ghostable">

<AllUsersWebPart WebPartZoneID="Right" WebPartOrder="1"><![CDATA[

<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" xmlns:iwp="http://schemas.microsoft.com/WebPart/v2/Image">

<Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>

<TypeName>Microsoft.SharePoint.WebPartPages.ImageWebPart</TypeName>

<FrameType>None</FrameType>

<Title>$Resources:wp_SiteImage;</Title>

<iwp:ImageLink>/_layouts/images/homepage.gif</iwp:ImageLink>

<iwp:AlternativeText>$Resources:core,sitelogo_wss;</iwp:AlternativeText>

</WebPart>

]]></AllUsersWebPart>

<NavBarPage Name="$Resources:core,nav_Home;" ID="1002" Position="Start" />

<NavBarPage Name="$Resources:core,nav_Home;" ID="0" Position="Start" />

</File>

</Module>

<Module Name="DWS" Url="">

<File Url="defaultdws.aspx" Name="default.aspx">

<View List="$Resources:core,lists_Folder;/$Resources:core,announce_Folder;" BaseViewID="3" WebPartZoneID="Top" />

<View List="$Resources:core,lists_Folder;/$Resources:core,links_Folder;" BaseViewID="3" WebPartZoneID="Right" WebPartOrder="2" />

<View List="$Resources:core,shareddocuments_Folder;" BaseViewID="6" WebPartZoneID="Left" />

<View List="$Resources:core,lists_Folder;/$Resources:core,tasks_Folder;" BaseViewID="7" WebPartZoneID="Left" WebPartOrder="2" />

<AllUsersWebPart WebPartZoneID="Right" WebPartOrder="1"><![CDATA[

<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">

<Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>

<TypeName>Microsoft.SharePoint.WebPartPages.MembersWebPart</TypeName>

<Title>$Resources:wp_Members;</Title>

<Description>$Resources:wp_Members_Desc;</Description>

<FrameType>Standard</FrameType>

<IsVisible>true</IsVisible>

</WebPart>

]]></AllUsersWebPart>

<NavBarPage Name="$Resources:core,nav_Home;" ID="1002" Position="Start" />

<NavBarPage Name="$Resources:core,nav_Home;" ID="0" Position="Start" />

</File>

</Module>

</Modules>

<ServerEmailFooter>$Resources:ServerEmailFooter;</ServerEmailFooter>

</Project>

blog comments powered by Disqus