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>

WEBTEMP.xml

A site definition in Sharepoint consists of two parts:

  • WEBTEMP.xml: This is a collection of templates which are defined by ONET.xml files. The rule here is that as long as the xml files in this folder begins with the 'webtemp', then Sharepoint is gonna see that as a web template.
  • ONET.xml: Contains the bulk of the actual site definition

Here is a copy of the WEBTEMP.xml file located in 12\TEMPLATE\1033\XML:


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

<!-- _lcid="1033" _version="12.0.4518" _dal="1" -->

<!-- _LocalBinding -->

<Templates xmlns:ows="Microsoft SharePoint">

<Template Name="GLOBAL" SetupPath="global" ID="0">

<Configuration ID="0" Title="Global template" Hidden="TRUE" ImageUrl="" Description="This template is used for initializing a new site." > </Configuration>

</Template>

<Template Name="STS" ID="1">

<Configuration ID="0" Title="Team Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="A site for teams to quickly organize, author, and share information. It provides a document library, and lists for managing announcements, calendar items, tasks, and discussions." DisplayCategory="Collaboration" > </Configuration>

<Configuration ID="1" Title="Blank Site" Hidden="FALSE" ImageUrl="/_layouts/images/blankprev.png" Description="A blank site for you to customize based on your requirements." DisplayCategory="Collaboration" AllowGlobalFeatureAssociations="False" > </Configuration>

<Configuration ID="2" Title="Document Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/dwsprev.png" Description="A site for colleagues to work together on a document. It provides a document library for storing the primary document and supporting files, a tasks list for assigning to-do items, and a links list for resources related to the document." DisplayCategory="Collaboration" > </Configuration>

</Template>

<Template Name="MPS" ID="2">

<Configuration ID="0" Title="Basic Meeting Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/mwsprev.png" Description="A site to plan, organize, and capture the results of a meeting. It provides lists for managing the agenda, meeting attendees, and documents." DisplayCategory="Meetings" > </Configuration>

<Configuration ID="1" Title="Blank Meeting Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/blankmwsprev.png" Description="A blank meeting site for you to customize based on your requirements." DisplayCategory="Meetings" > </Configuration>

<Configuration ID="2" Title="Decision Meeting Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/decisionmwsprev.png" Description="A site for meetings that track status or make decisions. It provides lists for creating tasks, storing documents, and recording decisions." DisplayCategory="Meetings" > </Configuration>

<Configuration ID="3" Title="Social Meeting Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/socialmwsprev.png" Description="A site to plan social occasions. It provides lists for tracking attendees, providing directions, and storing pictures of the event." DisplayCategory="Meetings" > </Configuration>

<Configuration ID="4" Title="Multipage Meeting Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/multipagemwsprev.png" Description="A site to plan, organize, and capture the results of a meeting. It provides lists for managing the agenda and meeting attendees in addition to two blank pages for you to customize based on your requirements." DisplayCategory="Meetings" > </Configuration>

</Template>

<Template Name="CENTRALADMIN" ID="3">

<Configuration ID="0" Title="Central Admin Site" Hidden="TRUE" ImageUrl="" Description="A site for central administration. It provides Web pages and links for application and operations management." > </Configuration>

</Template>

<Template Name="WIKI" ID="4">

<Configuration ID="0" Title="Wiki Site" Hidden="FALSE" ImageUrl="/_layouts/images/wikiprev.png" Description="A site for a community to brainstorm and share ideas. It provides Web pages that can be quickly edited to record information and then linked together through keywords" DisplayCategory="Collaboration" > </Configuration>

</Template>

<Template Name="BLOG" ID="9">

<Configuration ID="0" Title="Blog" Hidden="FALSE" ImageUrl="/_layouts/images/blogprev.png" Description="A site for a person or team to post ideas, observations, and expertise that site visitors can comment on." DisplayCategory="Collaboration" > </Configuration>

</Template>

</Templates>


  • If you want to create your own custom site definition, you need to create a WEBTEMP.xml of your own and rename it to something like WEBTEMPCustom.xml
  • In the above WEBTEMP.xml, the top level template is GLOBAL and it is hidden. Even though it is hidden, it still needs to be listed in the WEBTEMP.xml

Elements of WEBTEMP.xml

  • Template Name
    • The Template Name identifies the site definitions directory. For example, the template name = "STS" corresponds to the directory: 12\TEMPLATE\SiteTemplates\sts
    • There is no global folder in the 12\TEMPLATE\SiteTemplates, instead the Global Site Definition is located at 12\TEMPLATE\Global.
  • Configuration ID
    • Allows a base site defintion to support multiple configurations
  • ProvisionAssembly, Class, Data
    • Conceptual equivalent of Feature receiver
    • Used by MOSS to provision portals containing multiple webs

Thursday, June 19, 2008

Simple Excel Service Demo

In this post, I will simple show you on how to share and display a spreadsheet in MOSS.

Steps:

1. Creat a new Document Library called Spreadsheets. Choose the 'Microsoft Office Excel spreadsheet' document template.

2. Go to Shared Services Adminisation of your shared services > Excel Services Settings > Trusted file locations > Add Trusted File Location > Give it an address > In this case I will specify this library which is
http://yourserver/Spreadsheets > leave everything else as default > click ok
3. Go to the excel spreadsheet you want to share and publish it to Excel Services.

4. Specify the file name as the url of the library followed by the spreadsheet name, in this case is TestSheet. You can also specify other options by clicking the 'Excel Services Options', such as using parameters in the spreadsheet. Click Save.

5. Now that the spreadsheet is accessible through the web browser. You can also find the spreadsheet inside of the Spreadsheets document library. If you click the spreadsheet, it will open Office Excel by default. If you want to open it through the browser by default, go to the Spreadsheets document library > Settings > Document Library Settings > Advanced settings > Check 'Display as a Web page' > Click OK

6. You can also add a Excel Web Access web part onto the page where you want to share the spreadsheet.


7. Open the tool pane, select the TestSheet.xlsx from the Spreadsheets document library. Click OK.