Friday, March 12, 2010

Onet.xml

Onet.xml
When you install Windows SharePoint Services 3.0, six Onet.xml files are placed within the setup directory, one in \Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\GLOBAL\XML that applies globally to the deployment, and five in different folders within ...\TEMPLATE\SiteTemplates that apply to each of the five site definitions that ship with Windows SharePoint Services 3.0. They are Blog sites, the central administration site, Wiki sites, Meeting Workspace sites, and team SharePoint sites. Only the last two of these families contain more than one site definition configuration in Windows SharePoint Services 3.0.

The global Onet.xml file defines list templates for hidden lists, list base types, a default definition configuration, and modules that apply globally to the deployment. The five Onet.xml files in the \SiteTemplates directory define navigational areas, list templates, document templates, configurations, modules, components, and server e-mail footer sections used in the five site definitions.

Functions of Onet.xml
Depending on its particular use, an Onet.xml file can serve multiple functions, such as the following:

Define the top and side navigation areas that appear on the home page and in list views for a site definition.

Specify the list definitions that are used in each site definition and whether they are available for creating lists on the Create page.

Specify document templates that are available in the site definition for creating document library lists on the New page, and specify the files used in the document templates.

Define the base list types from which default Windows SharePoint Services lists are derived. (Only the global Onet.xml file serves this function.)

Specify the configurations of lists and modules that are used within each site definition.

Specify Windows SharePoint Services components.

Define the footer section used in server e-mail.

Web Site Definition Tasks with Onet.xml
The following kinds of tasks can be performed in a custom Onet.xml to create a custom site definition:

Specify an alternate cascading style sheet (CSS) file, JavaScript file, or ASPX header file for a site definition.

Modify navigation areas for the home page and list pages.

Add a list definition as an option to the Create page.

Add a document template for creating document libraries.

Define one or more configurations for the site definition, specifying the lists, modules, files, and Web Parts that are included when a site definition configuration is instantiated.

Caution:
Making changes to an originally installed Onet.xml file on a server running Windows SharePoint Services can break existing sites, and the changes may be overwritten when you install updates or service packs for Windows SharePoint Services, or when you upgrade an installation to the next product version. Always create a new Onet.xml; do not modify the original file. For more information, see How to: Create a Custom Site Definition and Configuration.

Ref: http://msdn.microsoft.com/en-us/library/ms474369.aspx
------------------------------------
Site Definition (Onet.xml) Files
In an Onet.xml file, the Feature element is used within a site definition configuration to contain a reference to a Feature instance and default property values. The Configuration element specifies lists and modules to use when creating SharePoint sites. For information about the format and elements used in site definitions, see Site Schema.

The site definition file format for Windows SharePoint Services 3.0 retains full backwards compatibility with the site definition file format of Onet.xml in Windows SharePoint Services 2.0.

Windows SharePoint Services activates Features specified within the Onet.xml file in the order that they are listed. Consequently, you must specify Features that are depended upon before Features that depend upon them.

Example
The following example shows the Feature element used to specify Features and Feature properties in a site definition configuration.

Ref: http://msdn.microsoft.com/en-us/library/ms432370.aspx

------------------------------------

Working with Features

Features reduce the complexity involved in making simple site customizations, and are robust when upgrades are applied to a deployment. Features eliminate the need to copy large chunks of code to change simple functionality. Features thus reduce versioning and inconsistency issues that may arise among front-end Web servers. Features make it easier to activate or deactivate functionality in the course of a deployment, and administrators can easily transform the template or definition of a site by simply toggling a particular Feature on or off in the user interface. Features provide the following capabilities:

Scoping semantics for determining where custom code runs

Pluggable behavior for installing or uninstalling Features within a deployment

Pluggable behavior for activating or deactivating Features at a given scope

A scoped property bag for storing data required by a Feature within its scope

The basis of a unified framework for distributed deployment of Windows SharePoint Services solutions

Feature Implementation
To implement a Feature you add a subfolder containing a Feature definition within the Features setup directory (Local_Drive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES). The Feature subfolder includes a Feature.xml file that defines the base properties of the Feature and lists elements bound to it, such as XML files containing element manifests and any other supporting files. A Feature folder may contain only a Feature.xml file, or it may contain a Feature.xml file and any number of supporting element files, including XML files, but also .aspx, .htm, .xsn, .resx, .dll, and other file types.

Note:
When you create a folder within the Features directory through Windows Explorer by right-clicking a folder, pointing to New, and then clicking Folder, the new folder does not have inherited permissions. If you deploy a Feature in the folder, then some Windows SharePoint Services pages, such as for site settings or list views, throw an exception. You can fix this problem by right-clicking the new folder, click Properties, click Security, and then click Advanced. On the Permissions tab, delete uninherited permissions from the folder. You can also fix this problem by creating the new folder at the command prompt through the md command.

After creating the Feature folder, you can install and activate the Feature through command-line operations of stsadm.exe, or through the object model. You can also activate a Feature through the user interface. Installing a Feature makes its definition and elements known throughout a server farm, and activating the Feature makes the feature available at a particular scope.

Ref: http://msdn.microsoft.com/en-us/library/ms460318.aspx
------------------------------------
Understanding Onet.xml Files[This documentation is preliminary and is subject to change.]

When SharePoint Foundation is installed, several Onet.xml files are installed, one in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\GLOBAL\XML that applies globally to the deployment, and several in different folders within %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\SiteTemplates. Each in the latter group corresponds to a site definition that ships with SharePoint Foundation. They include, for example, Blog sites, the central administration site, Meeting Workspace sites, and team SharePoint sites. Only the last two of these families contain more than one site definition configuration.

The global Onet.xml file defines list templates for hidden lists, list base types, a default definition configuration, and modules that apply globally to the deployment. Each Onet.xml file in a subdirectory of the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\SiteTemplates directory can define navigational areas, list templates, document templates, configurations, modules, components, and server e-mail footers used in the site definition to which it corresponds.

Ref: http://msdn.microsoft.com/en-us/library/ms474369(office.14).aspx 
------------------------------------

No comments:

Post a Comment