In SPS 2003, In the ECB menu of the documents we get an option “Create Document Workspace”. This link uses the OOB document workspace STS#2 to create the document workspace. There was a requirement to use our own custom template to create the document workspace through this ECB menu link.
We started troubleshooting the issue by following the link in the ows.js. It navigates to the Createws.aspx and this page creates the document workspace using the STS#2 template implicitly. The code behind of the this page is existing in the Microsoft.SharePoint.ApplicationPages.DWSCreatePage and the STS#2 is hard coded in this class.
We can create a custom application page based on the Createws.aspx and implement the method to create a document workspace based on the custom template.
The method to implement in the custom Createws.aspx is as follows :
public partial class Form1 : Form
private void button1_Click(object sender, EventArgs e)
if (CreateSite("<http://ms9:501/sites/501>", "test11", "test1", "tj.stp"))
public static bool CreateSite(string parentSiteURL, string siteURLRequested, string siteTitle, string siteTemplateName)
bool returnCondition = false;
const Int32 LOCALE_ID_ENGLISH = 1033;
using (SPSite siteCollection = new SPSite(parentSiteURL))
SPWeb parentWeb = siteCollection.OpenWeb();
SPWebTemplateCollection Templates = siteCollection.GetWebTemplates(Convert.ToUInt32(LOCALE_ID_ENGLISH));
returnCondition = true;
In MOSS 2007, you will have control over ECB menu of the document item so you can add or remove a link in it which can point to a new page. Right now in SPS2003, we have to modify ows.js to point it to a new page and then we are actually breaking the product. The implementation of the page which will create the document workspace from your template, will be almost similar in MOSS and SPS, code will be the same.
:: Please note that I would have just uploaded my initial code and you might want to consider proper optimization of the code and disposal of objects properly. I might not have updated the latest code here.