How to combine elements from the bug tracking application template with an existing site definition to create a new custom site definition in Windows SharePoint Services 3.0

Article translations Article translations
Article ID: 940973 - View products that this article applies to.
Expand all | Collapse all

On This Page

INTRODUCTION

This article describes how to combine elements from the bug tracking application template with an existing site definition to create a new custom site definition in Windows SharePoint Services. This article also describes how to perform tasks that are related to the bug tracking application template.

Note The bug tracking application template assumes that the following Web solution packages (WSP) have been installed and deployed to the computer that is running Windows SharePoint Services:
  • ApplicationTemplateCore.wsp
  • BugDatabase.wsp

MORE INFORMATION

The application templates for Windows SharePoint Services 3.0 are a set of 20 site definitions and 20 site templates that address common horizontal scenarios and common vertical scenarios. The following are the main components of the application templates for the 20 site definitions for Windows SharePoint Services 3.0.
Collapse this tableExpand this table
ComponentDescription
WebTemp.xmlThis component is a file that registers a new site definition in a collection.
Onet.xmlThis component is a file that specifies the navigation bar, the document templates, and the active features.
Features.xmlThis component is a file that specifies the features for list definitions, for list instances, for event receivers, and for modules.

How to create a new .xml file that registers the new site definition

  1. On the front-end server, locate the following folder:
    Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\Locale ID (LCID) for your site definitions language\XML
  2. Create a new text file, and then save the file as WebTempUnique_Name.xml. In the file name, replace the Unique_Name placeholder so that the file name is unique within the Windows SharePoint Services installation. In this example, the file is named WebTempPlusBug.xml.
  3. Modify the file in a text editor such as Notepad. Add the following code to the file.
    <?xml version="1.0" encoding="utf-8"?>
    <Templates xmlns:ows="Microsoft SharePoint">
      <Template Name="PlusBug" ID="10001" SetupPath="SiteTemplates\PlusBug" >
        <Configuration ID="0" Title="My Site Definition" 
                       ImageUrl="/_layouts/images/stsprev.png"
                       Description="My Site Definition Description"
                       DisplayCategory="My Custom Category" >
        </Configuration>
      </Template>
    </Templates>
    Notes
    • The value of the ID attribute for the Template element has to be unique in the Windows SharePoint Services installation. We recommend that you use an integer value that is between 10000 and 99999.
    • The Title attribute and the Description attribute set the title and the description of the site definition of the new home page of the SharePoint Server site. Microsoft SharePoint Server creates this page at the following address:
      http://server/site/_layouts/newsbweb.aspx
    • The DisplayCategory attribute is an optional attribute. This attribute sets the tab on which the custom site definition appears on the home page of the SharePoint Server site.

How to create a new .xml file for the custom site definition

  1. On the front-end server, locate the following folder:
    Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\SiteTemplates
  2. Copy the folder that contains the existing site definition that you want to integrate with the bug tracking features. Windows SharePoint Services does not let you modify site definitions that are being used.

    Important Make sure that you copy the folder, and make sure that you modify only the contents of the copied folder.
  3. Rename the folder that you created to PlusBug. The name of the folder must match the name that is specified in the SetupPath attribute in the WebTemp file that you created.
  4. Locate the following folder:
    Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\SiteTemplates\plusbug\xml
  5. Open the Onet.xml file in a text editor such as Notepad.
  6. Find the NavBars element, and then add the values that are related to bug tracking for the Quick Launch bar.
    <NavBars>
        ...
      <!-- Bug tracking category -->
      <NavBar Name="$Resources:tsa,BugTracking_ProjectName;" 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="1010" Url="default.aspx">
        <NavBarLink Name="$Resources:tsa,MyBugs;" Url="$Resources:core,lists_Folder;/Bugs/MyItems.aspx"/>
        <NavBarLink Name="$Resources:tsa,UnassignedBugs;" Url="$Resources:core,lists_Folder;/Bugs/Unassigned.aspx"/>
        <NavBarLink Name="$Resources:tsa,BugsIOpened;" Url="$Resources:core,lists_Folder;/Bugs/OpenedByMe.aspx"/>
      </NavBar>
      <!-- Common actions category -->
      <NavBar Name="$Resources:tsa,commonActions;" ID="1011">
        <NavBarLink Name="$Resources:tsa,logABug;" Url="$Resources:core,lists_Folder;/Bugs/NewForm.aspx"/>
        <NavBarLink Name="$Resources:tsa,createABugCategory;" Url="$Resources:core,lists_Folder;/Bug Categories/NewForm.aspx"/>
      </NavBar>
    
        ...
        ...
        ...
    </NavBars>
  7. Find the Configuration element that represents the site definition that you want to integrate with the bug tracking features, and then delete all the other configurations. Modify the attributes of the Configuration element to contain the following values.
    <Configurations>
      <Configuration ID="0" Name="PlusBug" >
        ...
        ...
        ...
      </Configuration>
    </Configurations>
  8. Add the Application Template Types feature to the SiteFeatures element, as follows.
    <Configuration ID="0" Name="PlusBug">
        ...
        ...
      <SiteFeatures>
        ...
        ...
        <!-- Application template types -->
        <Feature ID="75A0FEA7-CD50-401e-AF0E-782F3662A299" />
      </SiteFeatures>
  9. Add the features that are related to bug tracking to the WebFeatures element, as follows.
    <Configuration ID="0" Name="PlusBug">
        ...
        ...
    
    <WebFeatures>
        ...
        ...
      <!-- Bug tracking categories list -->
      <Feature ID="75A0FEA7-42E8-4527-8313-F63C4C49A7E6" />
      <!-- Bug tracking bugs list -->
      <Feature ID="75A0FEA7-2D1E-451a-B445-16BC346D7D8E" />
      <!-- Bug tracking list instances -->
      <Feature ID="75A0FEA7-37D2-484b-B362-DCFF1538E2A4" />
      <!-- List property handler -->
      <Feature ID="75A0FEA7-FE65-41c3-A965-C5DF83FB098B">
        <Properties>
          <Property Key="$Resources:tsa,bugsList;" Value="EnableVersioning,true"/>
        </Properties>
      </Feature>
      <!-- Bug tracking modules -->
      <Feature ID="75A0FEA7-9D96-4f02-A800-A3512154EFCD" />
      <!-- TSA image -->
      <Feature ID="75A0FEA7-C54F-46b9-86B1-2E103A8FEDBA" />
      <!-- Post-provisioning event handler -->
      <Feature ID="75A0FEA7-B0EF-434e-90D6-CE997D970564">
        <Properties>
          <Property Key="ZonedWebPartsUrlList" Value="$Resources:core,lists_Folder;/Bugs/Resolve.aspx, $Resources:core,lists_Folder;/Bugs/Activate.aspx, $Resources:core,lists_Folder;/Bugs/Close.aspx"/>
        </Properties>
      </Feature>
    </WebFeatures>
    Note The order in which the features appear is important. All the List features and all the List Instance features must appear first. The post-provisioning event handler has to be the last feature. If your site definitions already contain any of the features, do not add them two times. If your site definition already contains the post-provisioning event handler, add the contents of the Value attribute to the existing feature.
  10. Create a new GUID, and then set the value of the ID attribute for the bug-tracking module feature to the new GUID.

How to author a new feature that is based on the bug-tracking module feature

  1. On the front-end server, locate the following folder:
    Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\BugPlusModules
  2. Copy the Bugtrackingmodules folder.
  3. Rename the copy of this folder to BugPlusModules.
  4. Locate the following folder:
    Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\BugPlusModules
  5. Open the Feature.xml file in a text editor such as Notepad.
  6. Replace the value of the Id attribute by using the GUID that you created in step 10 in the "How to create a new .xml file for the custom site definition" section.
  7. Open the Module.xml file, and then search for the following:
    Url="default.aspx"
    You should find a section that resembles the following code.
    <Module Name="Default" Url="" Path="">
      <File Url="default.aspx" NavBarHome="True">
        <View List="$Resources:core,lists_Folder;/Bugs" BaseViewID="0" WebPartZoneID="Left" WebPartOrder="1">
        ...
        </View>
        <View List="$Resources:core,lists_Folder;/Bugs" BaseViewID="8" WebPartZoneID="Left" WebPartOrder="2">
        ...
        </View>
        <View List="$Resources:core,lists_Folder;/Bugs" BaseViewID="4" WebPartZoneID="Right" WebPartOrder="3">
        ...
        </View>
        <AllUsersWebPart WebPartOrder="1" WebPartZoneID="Right">
        ...
        </AllUsersWebPart>
        <AllUsersWebPart WebPartZoneID="Right" WebPartOrder="2">
        ...
        </AllUsersWebPart>
        <NavBarPage Name="$Resources:core,nav_Home;" ID="1002" Position="Start"/>
        <NavBarPage Name="$Resources:core,nav_Home;" ID="0" Position="Start"/>
      </File>
        ...
        ...
    </Module>
  8. Determine whether other parts of the site definition are trying to provision the Default.aspx page. To do this, check the following locations:
    • In the Onet.xml file, search for default.aspx.
    • Search in the element manifest files of the other module-related features. The names of the folders that contain the application templates for Windows SharePoint Services consistently contain the word "module." Also, the application templates also name the element manifest file Module.xml. Other custom features may have different naming conventions.
  9. If other parts of the site definition are provisioning the Default.aspx page, copy the following inner elements:
    • View
    • AllUsersWebPart
  10. Paste these inner elements as inner elements under the File element in the Module.xml file in the BugPlusModules folder. Both elements represent the Web parts that will provision the Default.aspx page.

    Notes
    • If you copied elements from the Onet.xml file, delete the File element in the Onet.xml file.
    • If you copied the elements from an existing feature, also copy all the other modules that are defined by that feature. Then, paste them at the bottom of the Module.xml file in the BugPlusModules folder. Remove the reference to the Source feature from the Onet.xml file in the BugPlusModules folder. You also have to copy any of the files that are referenced by the Source feature into the BugPlusModules folder.
    • Instead of moving the module content, you can also copy and then modify the existing feature. To do this, follow these steps:
      1. Create a new GUID, and then set the value of the ID attribute for the bug-tracking module feature to the new GUID.
      2. Follow step 1 through step 6 in the “How to author a new feature that is based on the bug-tracking module feature" section.
  11. You may opt not to keep all the Web parts in your module. To remove a Web part, delete the View element or the AllUserWebPart element for that Web part. You can also rearrange the Web parts by setting the WebPartOrder attribute and the WebPartZoneID attribute. These attributes determine the order and the zone in which each Web part appears.

How to enable the new feature

  1. Install the feature on the server. To do this, open the following folder at the command prompt:
    Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN
  2. Run the following command:
    stsadm -o installfeature -filename bugplusmodules\feature.xml
  3. To review your changes, type iisreset at the command prompt, and then press ENTER. Then, in Internet Explorer, open the SharePoint Portal Server site.
  4. In the Web browser, click Site Actions, and then click Create. On the Create page, click Sites and Workspaces. The new site definition should be displayed in the list of available templates.

Other deployment notes

To better support farm deployment, we recommend that you package all the contents of your custom template in a Web solution package. For more information about how to create a Web solution package, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/aa543741.aspx

Properties

Article ID: 940973 - Last Review: January 30, 2008 - Revision: 1.0
APPLIES TO
  • Microsoft Office SharePoint Server 2007
  • Microsoft Windows SharePoint Services 3.0
Keywords: 
kbhowto kbinfo kbexpertiseadvanced KB940973

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com