Chapter 2. Site Definitions


Site definition templates, like custom templates (Chapter 1), define the look and function of a site. A site definition is simply a collection of one or more site definition templates in a single package. SharePoint aggregates templates in this way to group similarly themed templates to facilitate component reuse.

Site definitions are primarily composed of presentation (ASPX) and configuration (XML) files. The most significant configuration files are ONET.XML and WEBTEMP.XML. ONET.XML defines the templates and their construction within the site definition. WEBTEMP.XML defines all the site definition templates accessible to a SharePoint user. These and other significant site definition configuration files are listed in Table 2.1.

Table 2.1. Site Definition Configuration Files

File

Description

BASE.XML

Defines the schema and views for the base set of listslists of lists, documents, and user information. This file is not technically part of a site definition but is referenced by it. This file should not be modified.

FLDTYPES.XML

Used during site and list creation to define how field types are rendered. This file is not technically part of a site definition but is referenced by it. This file should not be modified.

ONET.XML

Defines the templates and their construction within the site definition.

SCHEMA.XML

Each list/library is defined within its own folder within a site definition. Each list/library definition has one SCHEMA.XML file that defines its schema and its display.

STDVIEW.XML

Defines the base view from which list/library views are constructed.

VWSTYLES.XML

Defines the various view styles with which a list/library can be formatted. The most common view style is a row style. However, VWSTYLES.XML can be used to display your list's information in a thumbnail view or any other style desired.

WEBTEMP.XML

Defines all the site definition templates exposed by SharePoint to the user.


As implied by the configuration files referenced in Table 2.1, site definitions provide more flexibility than the custom site templates discussed in Chapter 1. However, with this finer level of control comes a greater amount of effort required to construct a site definition.

By default, site definitions are stored in the following location: C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\<LCID>, where <LCID> is 1033 for the English version of SharePoint.

The default WSS installation contains three folders in that directory: MPS, STS, and XML. MPS holds the default meeting workspace site definition templates, STS holds the other default site definition templates, and XML holds several configuration files.

Creating a new site definition is rather straightforward. The process begins by making a copy of an existing site definitionusually one of the Microsoft-provided site definitions. Although possible, the option of creating one from scratch is extremely unappetizing. The developer then modifies the configuration and presentation files appropriately. The developer must also add a configuration file to the XML folder (C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\XML) to inform SharePoint of the additional site definition.

This chapter focuses on the SharePoint's interaction with WEBTEMP.XML and ONET.XML. We walk through an example of creating a new site definition while concentrating our discussion on site definition elements that are affected by WEBTEMP.XML and ONET.XML.




SharePoint 2003 Advanced Concepts. Site Definitions, Custom Templates, and Global Customizations
SharePoint 2003 Advanced Concepts: Site Definitions, Custom Templates, and Global Customizations
ISBN: 0321336615
EAN: 2147483647
Year: 2006
Pages: 64

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net