|
SYS-CON.TV Webcasts
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Top Links You Must Click On
Hot Story Creating Custom Site Definitions in Microsoft Windows SharePoint Services
Basic Process and Best Practices
By: Kris Syverstad
Feb. 9, 2005 12:00 AM
Microsoft Windows SharePoint Services and Microsoft Office SharePoint Portal Server provide a lot of functionality out of the box. After installation you can begin creating portal and team sites. These newly minted sites can be customized; content can be created and managed, color themes can be modified, and pages for the site can be edited. All of this is great, however many attempts to create a portal within an organization fail because little or no consideration is given to user acceptance. The most important reason for creating a custom site definition is to address user acceptance issues. Identifying a problem domain and designing a site definition that addresses specific issues within that domain will greatly increase the likely success of your portal. Even though you could edit the files that have been distributed with SharePoint to meet these requirements, you shouldn't. Files that are part of the SharePoint installation are vulnerable to change through upgrades and patches. By creating a custom site definition you are isolating yourself from some, but not all, upgrade issues. Another approach to customizing SharePoint is to use the SharePoint user interface to modify the structure of your site and FrontPage to edit the look and feel. This approach is good when you are looking for a quick and easy solution. Custom site definitions are best suited for problems that require a more rigorous development model. This article will describe the basic process for creating custom site definitions and will explore some best practices. We are going to build a site definition that could be used as a template for project management sites. Before creating a custom site definition, you should figure out what site definition within SharePoint most resembles your needs. Custom Site Definitions are not typically written from the ground up; it is much easier to start with a working example and add/remove/update functionality in small amounts until you get all of your requirements implemented. The Team Site (STS) site definition seems like the most common starting point and the one we will use as our baseline.
Getting Started drive:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\STS 2. Rename the new directory. For this example we will use PROJMAN. drive:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\PROJMAN 3. Create a WebTemp XML file for the new site definition. Copy the existing WEBTEMP.XML. drive:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\XML\WEBTEMP.XML 4. Rename the new file WEBTEMP. [folder_name].xml. Replace folder_name with the name of the folder that you created in step two. For this example we will use WEBTEMP.projman.xml. You don't have to use the dot notation, nor do you have to include the folder name.
drive:\Program Files\Common Files\Microsoft Shared\web server 5. Edit the WEBTEMP file in order to specify unique values for the template Name and ID attributes. For this example we have used PROJMAN and 10791 respectively for these values. (Microsoft recommends a value larger than 10,000 to avoid conflicts).
<Template Name="PROJMAN" ID="10791"> WEBTEMP files are XML configuration files that SharePoint aggregates in order to determine what site definitions are available for use. For example, all of the SharePoint Portal templates are located in the WEBTEMPSPS.XML file. Moreover, the WEBTEMP file can be used to create additional configurations that are available for use within the site definition. For this example we will just use the default configuration. To enable SharePoint to detect the new site definition you will need to restart IIS. To test the new site definition use the create site page. Once you verify that the site definition works, it would be wise to get these files checked into a configuration management tool. From this point on we are going to be editing files that can be difficult to debug if problems occur, so it is good idea to make small changes, test them by creating a new site, and check in significant improvements.
Build Script
UI Changes CAML is an XML language that SharePoint uses to describe data structures for lists as well as for the presentation of data. Although CAML is XML and should be treated as such, it is not parsed as XML by SharePoint. This can cause problems if your XML isn't well structured. It is more than likely SharePoint will just ignore broken elements and you won't receive an error message. It's a good idea to open your CAML documents using a tool like Internet Explorer, Visual Studio, or FrontPage that will validate the structure and provide an interface for expanding and collapsing the document. Internet Explorer is an ideal tool to use to become familiar with CAML because it allows you to expand and collapse the elements and doesn't let you change the file. Reader Feedback: Page 1 of 1
Your Feedback
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||