views:

319

answers:

1

Is it possible to have a custom document workspace for documents created in a specific document library? I don't need every document library to have this custom workspace, just a single document library.

For example, assume there is a "Movies" document library. I'd like to have a customized document workspace for any documents created in the "Movies" document library.

Is this possible? If so, what is the level of effort?

A: 

Hello,

The simplest answer would be to create an event receiver and attach that to either the library or to the content types if you use those.

I've written an event receiver primer at http://furuknap.blogspot.com/2008/08/automating-business-processes-in%5F18.html that might get you started. From that, simply create a new Document Workspace site in the ItemAdded method.

Let me know if you need me to detail further, but this entire exercise shouldn't take you more than an hour.

.b

Bjørn Furuknap
Thanks! I'll give this a shot today. But, I'm still not grasphing how the custom document worskpace is created. I see there is a CreateDws() method available via the Document Workspace web service (http://msdn.microsoft.com/en-us/library/ms772546.aspx). But, that doesn't seem to specify a template (for customization). I'm looking around for a method to create a site based on template - so far no luck. Ideas?Also, if I get the site to be created, how would you wire up the document to the workspace/site so it can be published back to the source correctly?Thanks for the help!
mcollier
Hello again,The code SPWeb newWeb = web.Webs.Add("NewDocumentSite", "My new document workspace", "My description", 1033, "STS#2", false, false);will create a new document workspace under whatever site the web object references. The STS#2 is the key to deciding which template to use. I've elaborated on this in the SharePoint Magazine article here:http://sharepointmagazine.net/technical/development/customizing-the-user-experience-of-sharepoint-overview-of-the-default-sharepoint-interface-from-a-technical-point-of-view-part-1-of-6.b
Bjørn Furuknap
Ok - so I am able to create a new document workspace based on a template I specify when I add a document to a certain document library. I'm using the event receiver like you suggested.What I'm not clear on, however, is how to make the customized document workspace be used instead of the default one MOSS uses. I'd like to find a way to use my new workspace instead of what MOSS uses by default. Suggestions?
mcollier
Yes, start a new question on how to reference custom site definitions or templates :-)
Bjørn Furuknap