<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Peter Gerritsen&#039;s blog &#187; Document Sets</title>
	<atom:link href="http://blog.petergerritsen.nl/tag/document-sets/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.petergerritsen.nl</link>
	<description>about .Net and application platform development</description>
	<lastBuildDate>Tue, 03 Jan 2012 08:03:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Provisioning a Document Set</title>
		<link>http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 17:32:27 +0000</pubDate>
		<dc:creator>Peter Gerritsen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Document Sets]]></category>
		<category><![CDATA[SP2010]]></category>

		<guid isPermaLink="false">http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/</guid>
		<description><![CDATA[In this post I’ll show you how to create a project in Visual Studio 2010 with the new SharePoint project and item templates to provision a Document Set from a feature. DISCLAIMER: The examples are build on and tested against a Beta 1 build of SharePoint 2010 and a Beta 1 build of Visual Studio 2010, so [...]<p><a href="http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/">Provisioning a Document Set</a> is a post from: <a href="http://blog.petergerritsen.nl">Peter Gerritsen&#039;s blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>In this post I’ll show you how to create a project in Visual Studio 2010 with the new SharePoint project and item templates to provision a Document Set from a feature.</p>
<p>DISCLAIMER: The examples are build on and tested against a Beta 1 build of SharePoint 2010 and a Beta 1 build of Visual Studio 2010, so there is no guarantee this will work on later versions or even on the Beta 1 build you&#8217;re running.</p>
<p>A Document Set is basically a content type just like all the others you can find in SharePoint, it derives from the Folder content type. So the steps you need to take to provision a Document Set content type are not that different as well.</p>
<p>We’ll start out by creating an empty SharePoint project in Visual Studio 2010 and work from there.</p>
<p>First we’ll add a Content Type item to the project. In the elements.xml file we place the following content:</p>
<pre class="brush: xml">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;elements xmlns=&quot;http://schemas.microsoft.com/sharepoint/&quot;&gt;
&lt;contentType ID=&quot;0x0120D520002228EBDE71841343B23171CE351F7D39&quot; Name=&quot;Test Doc Set&quot; Group=&quot;Document Set Content Types&quot; Version=&quot;2&quot; ProgId=&quot;SharePoint.DocumentSet&quot;&gt;
&lt;folder TargetName=&quot;_cts/Test Doc Set&quot; /&gt;
&lt;fieldRefs&gt;
&lt;fieldRef ID=&quot;{038d1503-4629-40f6-adaf-b47d1ab2d4fe}&quot; Name=&quot;Company&quot; /&gt;
&lt;/fieldRefs&gt;
&lt;xmlDocuments&gt;
&lt;xmlDocument NamespaceURI=&quot;http://schemas.microsoft.com/sharepoint/events&quot;&gt;
&lt;spe:Receivers xmlns:spe=&quot;http://schemas.microsoft.com/sharepoint/events&quot;&gt;
&lt;receiver&gt;
&lt;name&gt;DocumentSet ItemUpdated&lt;/name&gt;
&lt;synchronization&gt;Synchronous&lt;/synchronization&gt;
&lt;type&gt;10002&lt;/type&gt;
&lt;sequenceNumber&gt;100&lt;/sequenceNumber&gt;
&lt;assembly&gt;Microsoft.Office.DocumentManagement, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&lt;/assembly&gt;
&lt;class&gt;Microsoft.Office.DocumentManagement.DocumentSets.DocumentSetEventReceiver&lt;/class&gt;
&lt;data /&gt;
&lt;filter /&gt;
&lt;/receiver&gt;
&lt;receiver&gt;
&lt;name&gt;DocumentSet ItemAdded&lt;/name&gt;
&lt;synchronization&gt;Synchronous&lt;/synchronization&gt;
&lt;type&gt;10001&lt;/type&gt;
&lt;sequenceNumber&gt;100&lt;/sequenceNumber&gt;
&lt;assembly&gt;Microsoft.Office.DocumentManagement, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&lt;/assembly&gt;
&lt;class&gt;Microsoft.Office.DocumentManagement.DocumentSets.DocumentSetItemsEventReceiver&lt;/class&gt;
&lt;data /&gt;
&lt;filter /&gt;
&lt;/receiver&gt;
&lt;/spe:Receivers&gt;
&lt;/xmlDocument&gt;
&lt;xmlDocument NamespaceURI=&quot;http://schemas.microsoft.com/office/documentsets/allowedcontenttypes&quot;&gt;
&lt;act:AllowedContentTypes xmlns:act=&quot;http://schemas.microsoft.com/office/documentsets/allowedcontenttypes&quot; LastModified=&quot;11/4/2009 3:30:17 PM&quot;&gt;
&lt;allowedContentType id=&quot;0x0101&quot; /&gt;
&lt;/act:AllowedContentTypes&gt;
&lt;/xmlDocument&gt;
&lt;xmlDocument NamespaceURI=&quot;http://schemas.microsoft.com/office/documentsets/sharedfields&quot;&gt;
&lt;sf:SharedFields xmlns:sf=&quot;http://schemas.microsoft.com/office/documentsets/sharedfields&quot; LastModified=&quot;11/4/2009 3:31:50 PM&quot;&gt;
&lt;sharedField id=&quot;cbb92da4-fd46-4c7d-af6c-3128c2a5576e&quot; /&gt;
&lt;sharedField id=&quot;038d1503-4629-40f6-adaf-b47d1ab2d4fe&quot; /&gt;
&lt;/sf:SharedFields&gt;
&lt;/xmlDocument&gt;
&lt;xmlDocument NamespaceURI=&quot;http://schemas.microsoft.com/office/documentsets/welcomepagefields&quot;&gt;
&lt;wpf:AllowedContentTypes xmlns:wpf=&quot;http://schemas.microsoft.com/office/documentsets/welcomepagefields&quot; LastModified=&quot;11/4/2009 3:31:50 PM&quot;&gt;
&lt;welcomePageField id=&quot;038d1503-4629-40f6-adaf-b47d1ab2d4fe&quot; /&gt;
&lt;/wpf:AllowedContentTypes&gt;
&lt;/xmlDocument&gt;
&lt;xmlDocument NamespaceURI=&quot;http://schemas.microsoft.com/office/documentsets/defaultdocuments&quot;&gt;
&lt;dd:DefaultDocuments xmlns:dd=&quot;http://schemas.microsoft.com/office/documentsets/defaultdocuments&quot; LastModified=&quot;11/5/2009 8:39:24 AM&quot; AddSetName=&quot;True&quot;&gt;
&lt;defaultDocument name=&quot;Enterprise Content Management.docx&quot; idContentType=&quot;0x0101&quot; /&gt;
&lt;defaultDocument name=&quot;Extending Search.docx&quot; idContentType=&quot;0x0101&quot; /&gt;
&lt;/dd:DefaultDocuments&gt;
&lt;/xmlDocument&gt;
&lt;xmlDocument NamespaceURI=&quot;http://schemas.microsoft.com/sharepoint/v3/contenttype/forms&quot;&gt;
&lt;formTemplates xmlns=&quot;http://schemas.microsoft.com/sharepoint/v3/contenttype/forms&quot;&gt;
&lt;display&gt;DocSetDisplayForm&lt;/display&gt;
&lt;edit&gt;ListForm&lt;/edit&gt;
&lt;new&gt;DocSetDisplayForm&lt;/new&gt;
&lt;/formTemplates&gt;
&lt;/xmlDocument&gt;
&lt;xmlDocument NamespaceURI=&quot;http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url&quot;&gt;
&lt;formUrls xmlns=&quot;http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url&quot;&gt;
&lt;new&gt;_layouts/NewDocSet.aspx&lt;/new&gt;
&lt;/formUrls&gt;
&lt;/xmlDocument&gt;
&lt;/xmlDocuments&gt;
&lt;/contentType&gt;
&lt;/elements&gt;
</pre>
<p>As you can see, the basics are the same as for any content type. The main difference is in all the XmlDocument elements in there:</p>
<ul>
<li> Some event handlers are hooked up to make sure the metadata gets pushed down into the child documents (plus some other stuff)</li>
<li> The content types that users are allowed to add to the set are specified</li>
<li> We specify which fields are shared between the documents the set contains</li>
<li> The fields that are shown on the welcome page are defined as well</li>
<li> We then specify if there’s default content to add when a new Document Set is created</li>
</ul>
<p>After we’ve created the basic plumbing for the Document Set content type, we’ll need to make sure that the files that are required are created in the right place as well. In order to accomplish this we’ll add a SharePoint Module item to the solution. This module will create the welcome page and default content in the right location in the site collection. The element.xml file will contain the following content:</p>
<pre class="brush: xml">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;elements xmlns=&quot;http://schemas.microsoft.com/sharepoint/&quot;&gt;
&lt;module Name=&quot;_ctsTest Doc Set_&quot; HyperlinkBaseUrl=&quot;http://moss.contoso.com/sites/docsettest&quot; Path=&quot;WelcomePages\Files\_cts\Test Doc Set&quot; Url=&quot;_cts/Test Doc Set&quot;&gt;
&lt;file Url=&quot;docsethomepage.aspx&quot; Path=&quot;docsethomepage.aspx&quot;&gt;
&lt;allUsersWebPart WebPartOrder=&quot;0&quot; WebPartZoneID=&quot;WebPartZone_TopLeft&quot; ID=&quot;g_ae6da3d4_9233_45d6_b9fd_6300815e16c6&quot;&gt;
&lt;![CDATA[Content omitted]]&gt;
&lt;/allUsersWebPart&gt;
&lt;allUsersWebPart WebPartOrder=&quot;0&quot; WebPartZoneID=&quot;WebPartZone_CenterMain&quot; ID=&quot;g_d8062545_cc87_4e82_9c55_cae80486ffea&quot;&gt;
&lt;![CDATA[Content omitted]]&gt;
&lt;/allUsersWebPart&gt;
&lt;allUsersWebPart WebPartOrder=&quot;0&quot; WebPartZoneID=&quot;WebPartZone_Top&quot; ID=&quot;g_651be1ba_c8bb_4d29_87b0_87c769cd5179&quot;&gt;
&lt;![CDATA[Content omitted]]&gt;
&lt;/allUsersWebPart&gt;
&lt;/file&gt;
&lt;file Path=&quot;Enterprise Content Management.docx&quot; Url=&quot;Enterprise Content Management.docx&quot; /&gt;
&lt;file Path=&quot;Extending Search.docx&quot; Url=&quot;Extending Search.docx&quot; /&gt;
&lt;/module&gt;
&lt;/elements&gt;
</pre>
<p>We see that the page layout for the document set homepage is created in the _cts folder for the content type. The web parts that are placed on the page are configured here as well, so any modifications and additions will be used on the welcome page of all document sets based in this content type. Also the two documents for the default content are placed in the corresponding _cts folder in the site collection.</p>
<p>The final Visual Studio solution will look like this:</p>
<p><a  href="http://blog.petergerritsen.nl/wp-content/uploads/snipping10.png" class="thickbox no_icon" rel="gallery-540" title="image"><img style="display: inline; border-width: 0px;" title="image" src="http://blog.petergerritsen.nl/wp-content/uploads/snipping11.png" border="0" alt="image" /></a></p>
<p>After deploying the solution and activating the feature, which is very easy to do with the new SharePoint stuff in Visual Studio (just press ctrl + f5), we can see that the _cts folder will be created in the site collection:</p>
<p><a  href="http://blog.petergerritsen.nl/wp-content/uploads/snipping12.png" class="thickbox no_icon" rel="gallery-540" title="image"><img style="display: inline; border-width: 0px;" title="image" src="http://blog.petergerritsen.nl/wp-content/uploads/snipping13.png" border="0" alt="image" /></a></p>
<p>After we add the content type to a document library and create a new item based on the content type we’ll be presented with the following:</p>
<p><a  href="http://blog.petergerritsen.nl/wp-content/uploads/snipping14.png" class="thickbox no_icon" rel="gallery-540" title="image"><img style="display: inline; border-width: 0px;" title="image" src="http://blog.petergerritsen.nl/wp-content/uploads/snipping15.png" border="0" alt="image" /></a></p>
<p>You can download the sample solution here: <a  href="http://blog.petergerritsen.nl/wp-content/uploads/DocSetProvisioning.zip">DocSetProvisioning.zip (62,88 KB)</a></p>
<p>DISCLAIMER: This hasn&#8217;t been properly tested, so there&#8217;s is no guarantee it will work. If it f***s up your farm, the most you can expect as support from me, is an email wishing you good luck with restoring it.</p>
<!-- RO Social Bookmarks BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home?status=http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/" title="Add 'Provisioning a Document Set' to Twitter"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/twitter.png" title="Add 'Provisioning a Document Set' to Twitter" alt="Add 'Provisioning a Document Set' to Twitter" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Provisioning+a+Document+Set&#038;c=http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/" title="Add 'Provisioning a Document Set' to MySpace"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/myspace.png" title="Add 'Provisioning a Document Set' to MySpace" alt="Add 'Provisioning a Document Set' to MySpace" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/&#038;title=Provisioning+a+Document+Set" title="Add 'Provisioning a Document Set' to Del.icio.us"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/delicious.png" title="Add 'Provisioning a Document Set' to Del.icio.us" alt="Add 'Provisioning a Document Set' to Del.icio.us" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&#038;url=http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/&#038;title=Provisioning+a+Document+Set" title="Add 'Provisioning a Document Set' to digg"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/digg.png" title="Add 'Provisioning a Document Set' to digg" alt="Add 'Provisioning a Document Set' to digg" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/&#038;title=Provisioning+a+Document+Set" title="Add 'Provisioning a Document Set' to reddit"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/reddit.png" title="Add 'Provisioning a Document Set' to reddit" alt="Add 'Provisioning a Document Set' to reddit" /></a><br /><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/&#038;t=Provisioning+a+Document+Set" title="Add 'Provisioning a Document Set' to FaceBook"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/facebook.png" title="Add 'Provisioning a Document Set' to FaceBook" alt="Add 'Provisioning a Document Set' to FaceBook" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/" title="Add 'Provisioning a Document Set' to Technorati"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/technorati.png" title="Add 'Provisioning a Document Set' to Technorati" alt="Add 'Provisioning a Document Set' to Technorati" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/&#038;title=Provisioning+a+Document+Set" title="Add 'Provisioning a Document Set' to Stumble Upon"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/stumbleupon.png" title="Add 'Provisioning a Document Set' to Stumble Upon" alt="Add 'Provisioning a Document Set' to Stumble Upon" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&#038;output=popup&#038;bkmk=http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/&#038;title=Provisioning+a+Document+Set" title="Add 'Provisioning a Document Set' to Google Bookmarks"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/google.png" title="Add 'Provisioning a Document Set' to Google Bookmarks" alt="Add 'Provisioning a Document Set' to Google Bookmarks" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=Provisioning+a+Document+Set&#038;url=http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/" title="Add 'Provisioning a Document Set' to SlashDot"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/slashdot.png" title="Add 'Provisioning a Document Set' to SlashDot" alt="Add 'Provisioning a Document Set' to SlashDot" /></a></div><div id="dwcredit"><a  id="dwlogo" href="http://www.dream-webdesign.ro" title="Web design">web design</a></div>
<!-- RO Social Bookmarks END --><p><a  href="http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/">Provisioning a Document Set</a> is a post from: <a  href="http://blog.petergerritsen.nl">Peter Gerritsen&#039;s blog</a></p>
<div class="fblike" style="height:25px; height:25px; overflow:hidden;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.petergerritsen.nl%2F2009%2F11%2F06%2Fsp2010-provisioning-a-document-set%2F&amp;layout=standard&amp;show_faces=false&amp;width=320&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allow Transparency="true" style="border:none; overflow:hidden; width:320px;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://blog.petergerritsen.nl/2009/11/06/sp2010-provisioning-a-document-set/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Coding against a Document Set</title>
		<link>http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rss</link>
		<comments>http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 16:56:31 +0000</pubDate>
		<dc:creator>Peter Gerritsen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Document Sets]]></category>
		<category><![CDATA[Object Model]]></category>
		<category><![CDATA[SP2010]]></category>

		<guid isPermaLink="false">http://blog.petergerritsen.nl/2009/11/06/sp2010-coding-against-a-document-set/</guid>
		<description><![CDATA[I’ve just had a 5 day training on development for SharePoint 2010. We’ve seen some cool stuff, were able to do some Hands on Labs and talk to other SharePoint experts about the new stuff that is coming up. One of the best things though about this training was the ability to try some stuff [...]<p><a href="http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/">Coding against a Document Set</a> is a post from: <a href="http://blog.petergerritsen.nl">Peter Gerritsen&#039;s blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I’ve just had a 5 day training on development for SharePoint 2010. We’ve seen some cool stuff, were able to do some Hands on Labs and talk to other SharePoint experts about the new stuff that is coming up.</p>
<p>One of the best things though about this training was the ability to try some stuff out for yourself. The fact that no project managers or customers were bothering me for a week allowed me to finally take the time to look around in the object model, the central admin and the new front end interfaces.</p>
<p>Over the next few week I’ll be publishing some post on the things I’ve tried out.I hope to publish a lot more posts about SP2010 once Beta 2 comes available.</p>
<p>DISCLAIMER: The examples are build on and tested against a Beta 1 build of SharePoint 2010 and a Beta 1 build of Visual Studio 2010, so there is no guarantee this will work on later versions.</p>
<p>One of the things I was eager to try out is the new Document Sets feature. Document Sets allow you to group related documents together and share metadata between those docs. When you view a document set in a library, you are presented with a welcome page that shows the metadata of the set and the contents. The welcome page in itself is something you’re able to customize. So you can add web parts and other controls through the interface or SharePoint Designer to the welcome page.</p>
<p>First let me start by giving you some code you can use to show extra information about<br />
the document set in a web part you can place on the welcome page:</p>
<pre class="brush: csharp">
try
{
     SPListItem item = SPContext.Current.ListItem;

     DocumentSet set = DocumentSet.GetDocumentSet(item.Folder);

     writer.WriteLine(&quot;ContentType: {0}&lt;br/&gt;&quot;, item.ContentType.Name);
     writer.WriteLine(&quot;Title: {0}&lt;br/&gt;&quot;, item.Title);
     writer.WriteLine(&quot;WelcomePageUrl: {0}&lt;br/&gt;&quot;, set.WelcomePageUrl);
     writer.WriteLine(&quot;ItemCount: {0}&lt;br/&gt;&quot;, set.Folder.ItemCount);
     writer.WriteLine(&quot;Welcomepage Fields:&lt;br/&gt;&quot;);
     DocumentSetTemplate template = set.ContentTypeTemplate;
     WelcomePageFieldCollection fields = template.WelcomePageFields;
     foreach (SPField field in fields)
     {
         writer.WriteLine(&quot;{0}&lt;br/&gt;&quot;, field.Title);
     }
}
catch (Exception)
{ }
</pre>
<p>First we get a reference to the current List Item through the SPContext. This list item is the main item for the document set that contains the metadata that is pushed into the child documents.</p>
<p>We then can get a reference to the DocumentSet by passing in the SPFolder of the item into a static method of the DocumentSet class. The DocumentSet class is stored in the Microsoft.Office.DocumentManagement.dll in the DocumentSets namespace.</p>
<p>The DocumentSetTemplate in turn contains more information about the fields that are shared or shown on the Welcome page.</p>
<p>In the next post I’ll show you how to provision a document set from a feature. Something that is quite easy to do with the new SharePoint project and item templates for Visual Studio 2010.</p>
<!-- RO Social Bookmarks BEGIN --><div class="social_bookmark"><em>Bookmark to:</em><br /><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home?status=http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/" title="Add 'Coding against a Document Set' to Twitter"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/twitter.png" title="Add 'Coding against a Document Set' to Twitter" alt="Add 'Coding against a Document Set' to Twitter" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Coding+against+a+Document+Set&#038;c=http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/" title="Add 'Coding against a Document Set' to MySpace"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/myspace.png" title="Add 'Coding against a Document Set' to MySpace" alt="Add 'Coding against a Document Set' to MySpace" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/&#038;title=Coding+against+a+Document+Set" title="Add 'Coding against a Document Set' to Del.icio.us"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/delicious.png" title="Add 'Coding against a Document Set' to Del.icio.us" alt="Add 'Coding against a Document Set' to Del.icio.us" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&#038;url=http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/&#038;title=Coding+against+a+Document+Set" title="Add 'Coding against a Document Set' to digg"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/digg.png" title="Add 'Coding against a Document Set' to digg" alt="Add 'Coding against a Document Set' to digg" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/&#038;title=Coding+against+a+Document+Set" title="Add 'Coding against a Document Set' to reddit"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/reddit.png" title="Add 'Coding against a Document Set' to reddit" alt="Add 'Coding against a Document Set' to reddit" /></a><br /><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/&#038;t=Coding+against+a+Document+Set" title="Add 'Coding against a Document Set' to FaceBook"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/facebook.png" title="Add 'Coding against a Document Set' to FaceBook" alt="Add 'Coding against a Document Set' to FaceBook" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/" title="Add 'Coding against a Document Set' to Technorati"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/technorati.png" title="Add 'Coding against a Document Set' to Technorati" alt="Add 'Coding against a Document Set' to Technorati" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/&#038;title=Coding+against+a+Document+Set" title="Add 'Coding against a Document Set' to Stumble Upon"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/stumbleupon.png" title="Add 'Coding against a Document Set' to Stumble Upon" alt="Add 'Coding against a Document Set' to Stumble Upon" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&#038;output=popup&#038;bkmk=http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/&#038;title=Coding+against+a+Document+Set" title="Add 'Coding against a Document Set' to Google Bookmarks"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/google.png" title="Add 'Coding against a Document Set' to Google Bookmarks" alt="Add 'Coding against a Document Set' to Google Bookmarks" /></a><a  class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=Coding+against+a+Document+Set&#038;url=http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/" title="Add 'Coding against a Document Set' to SlashDot"><img src="http://blog.petergerritsen.nl/wp-content/plugins/ro-social-bookmarks/slashdot.png" title="Add 'Coding against a Document Set' to SlashDot" alt="Add 'Coding against a Document Set' to SlashDot" /></a></div><div id="dwcredit"><a  id="dwlogo" href="http://www.dream-webdesign.ro" title="Web design">web design</a></div>
<!-- RO Social Bookmarks END --><p><a  href="http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/">Coding against a Document Set</a> is a post from: <a  href="http://blog.petergerritsen.nl">Peter Gerritsen&#039;s blog</a></p>
<div class="fblike" style="height:25px; height:25px; overflow:hidden;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.petergerritsen.nl%2F2009%2F11%2F06%2Fcoding-against-a-document-set%2F&amp;layout=standard&amp;show_faces=false&amp;width=320&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allow Transparency="true" style="border:none; overflow:hidden; width:320px;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://blog.petergerritsen.nl/2009/11/06/coding-against-a-document-set/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

