04 May, 2011
During a project we found that packaging custom document sets in SharePoint was not as straight-forward as we thought. In this post, I will share lessons learned and solutions for packaging and deploying custom document sets.
“Document Sets is a new feature in SharePoint Server 2010 that enables an organization to manage a single deliverable, or work product, which can include multiple documents or files. A Document Set is a special kind of folder that combines unique Document Set attributes, the attributes and behavior of folders and documents, and provides a user interface (UI), metadata, and object model elements to help manage all aspects of the work product.
Document Sets planning (SharePoint Server 2010) (TechNet): http://technet.microsoft.com/en-us/library/ff603637.aspx
When creating a new document set and customizing the document set properties, these work well in SharePoint but are hard to package and export.
Create and manage document sets (Microsoft): http://office.microsoft.com/en-us/sharepoint-server-help/create-and-manage-document-sets-HA101782480.aspx
You can try to export the document set as:
None of the solutions will allow us to control the document property settings. On top of that, importing the content type in Visual Studio does not even generate XML that is valid according to the schema.
The issue is that, inheriting directly from this code, the web parts on the welcome page will be provisioned each time the feature is activated, making upgrades a tad hard. Also, when the feature deactivates a check is made to see if the document set content type is in use and then cancels the deactivation process. This is not what we want to do.
I have posted the solution on MSDN Snippets Gallery instead of adding all the source code in this post.
Provisioning Event Handler for Custom Document Set Features in SharePoint 2010 (MSDN Code Snippets) http://code.msdn.microsoft.com/Custom-Document-Set-eb3fbcfd