We have received a few requests for how to modify the default team project settings recently. So I’m writing this post to share the steps of modifying a site template.
As we already know, when we create a new team project, the corresponding portal in SharePoint is also created. The portal is created with the SharePoint template referenced in the process template. After we download a process template, we can open the WssTasks.XML. Then we will find a <site> element which specifies the SharePoint site template and language id. Until now, the SharePoint site template can not be edited in the Process Editor from TFS power tool.
When TFS is installed, the SharePoint site templates for MSF for Agile and MSF for CMMI are uploaded to SharePoint. You can find these template in %ProgramFiles%\Microsoft Visual Studio 2008 Team Foundation Server\Tools\Templates. The below steps are for how to modify the portal site template. The MSFAgile.stp is for WSS 2.0 and MSFAgile30.stp is for WSS 3.0.
Configure an existing team portal and save the portal as an template.
- Open an existing team portal and modify settings such as time zone.
- In the portal, click Site Actions->Site Settings->Save site as template.
- Since the process template already contains the default document libraries, so we uncheck the Include Content checkbox.
- Click OK and MyTemplate is created in Site Template Gallery.
- Go to Site Actions->Site Settings->Site templates and download MyTemplate.stp to a local folder.
Sometimes, you need to modify the MyTemplate.stp manually. Skip these steps if you don’t need to do that.
- Install Microsoft Cabinet Software Development Kit. The portal template for a team project is just cab files. We can use the CABARC.EXE in the SDK to extract and recreate the template files.
- Login the TFS server and navigate to %ProgramFiles%\Microsoft Visual Studio 2008 Team Foundation Server\Tools\Templates.
- Find the template you want to modify. Make a back up of it and change the extension from .stp to .cab. Then you can open the .cab file with Windows Explorer. Copy all contents to a folder, say C:\TemplateExtract.
- Modify the settings in the manefist.xml based on your requirement and save.
- Recreate the .stp template file with CABARC.EXE. For example: CABARC N “C:\MyTemplate.stp C:\TemplateExtract\*.*”, then MyTemplate.stp should be created in C: drive.
Upload the portal site template to SharePoint.
- List the global template with stsadm -o enumtemplates. stsadm.exe is usually located in %ProgramFiles%\common files\microsoft shared\web server extensions\12\bin. Remember the tile of the site template you want to modify.
- If you want to add a new template, you can skip this step. If you want to update and existing site template, you need to first delete the old template with stsadm –o deletetemplate and then upload the template with the same title. For example: stsadm –o deletetemplate –title VSTS_MSFAgile.
- Add the template with stsadm –o addtemplate command. For example: stsadm –o addtemplate –filename C:\MyTemplate.stp –title VSTS_MSFAgile. Since a process template references the site template by template title. If you are replacing an existing template, make sure the title is the same as displayed when run enumtemplates in the previous step.
- Run iisreset to restart the IIS.
Finally, you can create a new team project to test the newly uploaded site template.