| By Kris Syverstad | Article Rating: |
|
| February 9, 2005 12:00 AM EST | Reads: |
54,642 |
ONET
The ONET.XML file located in the XML directory of your site definition folder serves as a repository for all available resources within the site definition. This file is used to register the available BaseTypes, NavBars, ListTemplates, DocumentTemplates, and Modules that can be used with instances of the site. Additionally the ONET.XML file contains a section for defining the various configurations that are available for sites built using the definition. In order for anything to actually be included in your custom site definition it must be registered in the ONET.XML file.
Ghosted vs. Unghosted
Site definitions are comprised of pages and list schemas stored on the file system. These files get cached by the server, but the actual content does not; the content gets retrieved from the database before being displayed. The files stored on the file system are referred to as "Ghosted." A site can get "Unghosted" if it is customized using FrontPage after it has been created. Most often, when you create a custom site definition you are trying to enforce consistency across all of the sites created with your site definition. Ghosted pages allow you to update pages in your site definition and have all of the sites updated. This is not possible if a site has been Unghosted, since it will not reflect changes made to files on the file system. After a site has been Unghosted it is nearly impossible for it to be re-Ghosted. You should take these issues into consideration before deploying your site definition, and consider disabling the feature that allows users to edit the site in FrontPage. To accomplish this use the DisableWebDesignFeatures attribute in the ONET.XML file.
<Project Title="Project Management Site" ListDir="Lists" xmlns:ows="Microsoft SharePoint"
DisableWebDesignFeatures="wdfopensite">
Modules
If you wish to add pages to a site definition they will have to be registered in the ONET.XML. Ghosted pages cannot be added once a site is created, so you might consider adding some empty pages to your site definition to allow for future expansion. To add a page to a site definition you must create the page and place it in the directory for the site definition, or in a subdirectory and register in the ONET file by adding the Module element to the appropriate configuration and then defining the module within the Modules element (see Listing 1). Defining the module in this manner allows for it to be used in multiple configurations within the ONET.XML file.
Default Lists
Often there is a need to create an instance of a list when a new site is created. It is more than likely there will already be a few of these in the site definition you start with. Since we used the STS site definition as a starting point, we automatically get the following lists created:
- Shared Documents
- Announcements
- Contacts
- Events
- Links
- Tasks
- General Discussions
<List Title="Issues"
Url="Lists/Issues"
QuickLaunchUrl="Lists/Issues/AllItems.aspx"
Type="1100" />
Creating a Custom List
The process for creating a custom list is similar to creating a custom site definition. It is much easier to start with an existing list than it is to create one from scratch. To start, find a list that comes close to matching the requirements for the new list. Any list can be used; you are not limited to lists that currently exist in your site definition. It is important to use the proper base type for your list. Some lists have special functionality built into the base type that you don't want to build yourself. Image Libraries, Document Libraries, Discussions, and Tasks Lists all have special behaviors. Most custom lists will use the Custlist definition, however, don't be afraid to create your own definition using one of the other base types if you are looking for similar functionality.
For this example we will create a new document library that will be used for managing change requests. The steps for creating a custom list are as follows.
1. Copy the entire directory for the list definition that you are using as a baseline from the LISTS folder. For this example we will use the DOCLIB definition.
2. Rename the new directory. For this example we will use CHNGREQ.
drive:\Program Files\Common Files\Microsoft Shared\web server
extensions\60\TEMPLATE\1033\PROJMAN\LISTS\CHNGREQ
3. Edit the ONET.XML file for the site definition to add the new list template to the ListTemplates element. Make sure that you give the new list a unique Type ID. (Microsoft documentation states that the ID for a list template must be less than 1,000.)
<ListTemplate Name="chngreq" DisplayName="Change Requests" Type="901" BaseType="1" OnQuickLaunch="TRUE"
SecurityBits="11" Description="Library of Change Requests for the project."
Image="/_layouts/images/itdl.gif" DocumentTemplate="101"></ListTemplate>
4. Edit the SCHEMA.XML file (located in the root folder for the list) to provide unique functionality for the list. We will add a new field for our document metadata source. To accomplish this all we need to do is add a Field to the Fields collection.
<Field Type="Text" Name="Source" DisplayName="Source" Sealed="TRUE" />
The SCHEMA.XML file allows for more than just specifying a base list type and defining fields; it also allows for views and forms to be defined. Views are intended to be used as a mechanism for displaying multiple items from the list, whereas forms are intended to display only one list item. Typically a list will have an All Items view and three forms: NewForm, EditForm, and DisplayForm. Some lists will provide additional views. When customizing a list you can modify existing views and forms or create new ones.
Published February 9, 2005 Reads 54,642
Copyright © 2005 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Kris Syverstad
Kris Syverstad is a Microsoft Most Valuable Professional (MVP) for SharePoint Portal Server and a member of the Microsoft Collaboration &
Portals Developer Advisory Council. He leads the Rocky Mountain SharePoint
Users Group, and has been invited to present on SharePoint Best Practices to Microsoft Product Teams and at Microsoft's Architectural Summit.
![]() |
shirley 11/04/08 01:03:31 AM EST | |||
We can assist here as we specialize in developing and implementing SharePoint – that’s all we do. There is more information on this at http://www.nsynergy.com/Services/Pages/default.aspx or mail to Mark.Davis@nsynergy.com |
||||
![]() |
Gery D. Dorazio 03/22/05 07:08:02 PM EST | |||
Kris, |
||||
![]() |
Amrita 02/21/05 01:09:36 AM EST | |||
Perfect,real nice explanation. |
||||
- Kindle 2 vs Nook
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- Confessions of a Ulitzer Addict
- Cloud Computing Best Practices
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Windows 7 – Microsoft’s First Step to the Cloud
- Cloud Computing & Federal IT - What Does the Future Hold?
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Cloud Expo and the End of Tech Recession
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- Confessions of a Ulitzer Addict
- Cloud Computing Best Practices
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Eval JavaScript in a Global Context
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Windows 7 – Microsoft’s First Step to the Cloud
- Google Maps and ASP.NET
- Crystal Reports XI & How It Has Changed
- Converting VB6 to VB.NET, Part I
- Creating Controls for.NET Compact Framework in Visual Studio 2005
- Where Are RIA Technologies Headed in 2008?
- How to Write High-Performance C# Code
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Implementing Tab Navigation with ASP.NET 2.0
- i-Technology Photo Exclusive: Bill Gates & Steve Jobs In "Nerds"
- .NET Archives: Getting Reacquainted with the Father of C#
- i-Technology Viewpoint: "SOA Sucks"
- Programmatically Posting Data to ASP .NET Web Applications




































