Wednesday, March 24, 2010

Publishing Templates

When you are working with MOSS 2007 there are two different templates you need to be able to deploy; application templates (WSP files) and site templates (STP files).

While creating an STP file from a site is easy and it makes it available within SharePoint for use, if you script any of your actions, you need to deploy your STP file globally. To do that you are going to need to download the STP file from the site Gallery and then delete it for the gallery. If you don't delete it you will have duplicate templates when we are done.

Once you have the file downloaded you will need to copy it to your web front end server. Once copied we will do the following from the command line using stsadm:

1. Check if the template already exists:
stsadm -o enumtemplates
2. If the template exists, you will need to delete the current copy:
stsadm -o deletetemplate -title {template title}
3. Now you can add the template:
stsadm -o addtemplate -filename {template filename & location} -title {template title} -description {template description}

It will prompt you that an IIS reset is needed at each of these steps, but in reality it is not required and can wait until a time that works for your environment.

The other deployment that you will need to be able to perform is a GAC deployment of an application template. This is also done on the web front end server using stsadm.

1. Add the application template to the solutions list:
stsadm.exe -o addsolution -filename {template filename & location}
2. Deploy the solution to the GAC:
stsadm.exe -o deploysolution -name {template filename} -immediate -allowgacdeployment
3. Copy the Binary Content:
stsadm -o copyappbincontent


So now you know how to deploy global site templates and applicaion template solutions.

No comments:

Post a Comment