<?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>Nick&#039;s SharePoint Blog</title>
	<atom:link href="http://vspug.com/nicksevens/feed/" rel="self" type="application/rss+xml" />
	<link>http://vspug.com/nicksevens</link>
	<description>Just another VSPUG - Virtual SharePoint User Group weblog</description>
	<lastBuildDate>Tue, 14 Jul 2009 07:06:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SharePoint 2010 sneak peek</title>
		<link>http://vspug.com/nicksevens/2009/07/14/sharepoint-2010-sneak-peek/</link>
		<comments>http://vspug.com/nicksevens/2009/07/14/sharepoint-2010-sneak-peek/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 07:06:00 +0000</pubDate>
		<dc:creator>nsevens</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[Finally Microsoft released some info on the new features for SharePoint 2010.
Though these are not all the features that are going to be in the new version, it certainly sounds promising!
Source: http://officesharepointpro.com/Articles/tabid/149/nodeid/1982/The-Curtain-Rises-(Just-a-Bit)-on-SharePoint-2010.aspx
]]></description>
			<content:encoded><![CDATA[<p>Finally Microsoft released some info on the new features for SharePoint 2010.</p>
<p>Though these are not all the features that are going to be in the new version, it certainly sounds promising!</p>
<p>Source: <a href="http://officesharepointpro.com/Articles/tabid/149/nodeid/1982/The-Curtain-Rises-(Just-a-Bit)-on-SharePoint-2010.aspx">http://officesharepointpro.com/Articles/tabid/149/nodeid/1982/The-Curtain-Rises-(Just-a-Bit)-on-SharePoint-2010.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/nicksevens/2009/07/14/sharepoint-2010-sneak-peek/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SPList.Views does not retrieve hidden views</title>
		<link>http://vspug.com/nicksevens/2009/07/06/splist-views-does-not-retrieve-hidden-views/</link>
		<comments>http://vspug.com/nicksevens/2009/07/06/splist-views-does-not-retrieve-hidden-views/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 09:49:00 +0000</pubDate>
		<dc:creator>nsevens</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[Last week I created a list definition with a couple of hidden Views in it, which would only be used in list view webparts.
The Views were defined like this:
&#160;&#60;View BaseViewID=&#34;101&#34; Hidden=&#34;TRUE&#34; Type=&#34;HTML&#34; WebPartZoneID=&#34;Main&#34; DisplayName=&#34;$Resources:core,objectiv_schema_mwsidcamlidC24;&#34; DefaultView=&#34;FALSE&#34; SetupPath=&#34;pagesviewpage.aspx&#34; ImageUrl=&#34;/_layouts/images/generic.png&#34; Url=&#34;AllItems_Hidden.aspx&#34;&#62;
One of these webparts had to be added programmatically with only the BaseViewID (int) as a reference (101 [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I created a list definition with a couple of hidden Views in it, which would only be used in list view webparts.</p>
<p>The Views were defined like this:</p>
<p>&nbsp;<span style="COLOR:blue;">&lt;</span><span style="COLOR:#a31515;">View</span><span style="COLOR:blue;"> </span><span style="COLOR:red;">BaseViewID</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">101</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">Hidden</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">TRUE</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">Type</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">HTML</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">WebPartZoneID</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">Main</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">DisplayName</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">$Resources:core,objectiv_schema_mwsidcamlidC24;</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">DefaultView</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">FALSE</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">SetupPath</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">pagesviewpage.aspx</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">ImageUrl</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">/_layouts/images/generic.png</span>&quot;<span style="COLOR:blue;"> </span><span style="COLOR:red;">Url</span><span style="COLOR:blue;">=</span>&quot;<span style="COLOR:blue;">AllItems_Hidden.aspx</span>&quot;<span style="COLOR:blue;">&gt;</span></p>
<p>One of these webparts had to be added programmatically with only the BaseViewID (int) as a reference (101 in the above case).</p>
<p>Now, my normal approach would be to retrieve all views from the list by using SPList.Views and loop trough these views untill I come across the BaseViewID I am looking for.</p>
<p>HOWEVER&#8230; When looking in the SPViewCollection retrieved by SPList.Views, the hidden views are nowhere to be found!</p>
<p>Eventually, I found out that we can use the SPList.GetUncustomizedViewByBaseId(int) method, and then get the ViewID out of the PropertiesXml property.</p>
<p>I did it like this:</p>
<div style="font-family:Courier New;background:white;color:black;font-size:10pt;">
<p style="margin:0px;"><span style="color:blue;">private</span> <span style="color:#2b91af;">Guid</span> GetListViewID(<span style="color:#2b91af;">SPList</span> list, <span style="color:blue;">string</span> baseViewID)</p>
<p style="margin:0px;">{</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">string</span> properties = list.GetUncustomizedViewByBaseViewId(<span style="color:#2b91af;">Convert</span>.ToInt32(baseViewID)).PropertiesXml;</p>
<p style="margin:0px;">&nbsp;</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; <span style="color:#2b91af;">XmlDocument</span> doc = <span style="color:blue;">new</span> <span style="color:#2b91af;">XmlDocument</span>();</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; doc.LoadXml(properties);</p>
<p style="margin:0px;">&nbsp;</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; <span style="color:#2b91af;">Guid</span> listViewId = <span style="color:#2b91af;">Guid</span>.Empty;</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">string</span> viewUrl = doc.FirstChild.Attributes[<span style="color:#a31515;">&quot;Url&quot;</span>] != <span style="color:blue;">null</span> ? doc.FirstChild.Attributes[<span style="color:#a31515;">&quot;Url&quot;</span>].Value : <span style="color:#a31515;">&quot;&quot;</span>;</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">if</span> (!<span style="color:blue;">string</span>.IsNullOrEmpty(viewUrl))</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; listViewId = list.ParentWeb.GetViewFromUrl(<span style="color:blue;">string</span>.Format(<span style="color:#a31515;">&quot;{0}/{1}&quot;</span>, list.RootFolder.Url, viewUrl)).ID;</p>
<p style="margin:0px;">&nbsp;</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">return</span> listViewId;</p>
<p style="margin:0px;">}</p>
</div>
<p>I don&#39;t know if anyone else had encountered this issue, but it seems like something strange to me <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Maybe I defined my hidden view in an incorrect way, or maybe there is some property or method I overlooked, I don&#39;t know.</p>
<p>Anyway, this solution seems to work for me to <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  so I hope it helped someone else to <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/nicksevens/2009/07/06/splist-views-does-not-retrieve-hidden-views/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ListInstance and &#8220;Object reference not set to an instance of an object&#8221;</title>
		<link>http://vspug.com/nicksevens/2009/04/29/listinstance-and-object-reference-not-set-to-an-instance-of-an-object/</link>
		<comments>http://vspug.com/nicksevens/2009/04/29/listinstance-and-object-reference-not-set-to-an-instance-of-an-object/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 10:11:00 +0000</pubDate>
		<dc:creator>nsevens</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I had some trouble with a ListInstance feature today, which was activated through a custom site definition. This resulted in quite some frustration, so I was glad to finally find the solution.
Thanks to the blog post on http://sigurbjorn.wordpress.com/2008/07/21/listinstance-and-object-reference-not-set-to-an-instance-of-an-object, It got solved. Thanks Sigurbj&#246;rn&#160;!

DescriptionWhile activating a feature that contains list instances I get an &#8220;Unknown error&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>I had some trouble with a ListInstance feature today, which was activated through a custom site definition. This resulted in quite some frustration, so I was glad to finally find the solution.</p>
<p>Thanks to the blog post on <a href="http://sigurbjorn.wordpress.com/2008/07/21/listinstance-and-object-reference-not-set-to-an-instance-of-an-object">http://sigurbjorn.wordpress.com/2008/07/21/listinstance-and-object-reference-not-set-to-an-instance-of-an-object</a>, It got solved. Thanks Sigurbj&ouml;rn&nbsp;!</p>
<div class="snap_preview" style="background-color:#EEEEEE;">
<p style="padding-left:30px;"><strong>Description</strong><br />While activating a feature that contains list instances I get an &ldquo;Unknown error&rdquo; message in the SharePoint UI.</p>
<p style="padding-left:30px;"><strong>Log Entry<br /></strong>The element &lsquo;NameOfListInstance&rsquo; of type &lsquo;ListInstance&rsquo; for feature &lsquo;MyCompany.SharePoint&rsquo; (id: 00000000-0000-0000-0000-000000000000) threw an exception during activation: Object reference not set to an instance of an object.</p>
<p style="padding-left:30px;"><strong>My solution<br /></strong>After a lot of debugging I noticed that if I remove the&nbsp;RootWebOnly=&rdquo;TRUE&rdquo; attribute&nbsp;from the ListInstance element the error goes away.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/nicksevens/2009/04/29/listinstance-and-object-reference-not-set-to-an-instance-of-an-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a content editor webpart to a site definition</title>
		<link>http://vspug.com/nicksevens/2009/03/11/adding-a-content-editor-webpart-to-a-site-definition/</link>
		<comments>http://vspug.com/nicksevens/2009/03/11/adding-a-content-editor-webpart-to-a-site-definition/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 08:45:00 +0000</pubDate>
		<dc:creator>nsevens</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I was trying to add a content editor webpart, with content of course, to a site definition. However, it took me to much searching to get to the right solution   So I thought I&#39;d write a little post about it  
To add the webpart, add an AllUsersWebPart in a &#60;Module&#62;/&#60;File&#62; tag:

&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to add a content editor webpart, with content of course, to a site definition. However, it took me to much searching to get to the right solution <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  So I thought I&#39;d write a little post about it <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To add the webpart, add an AllUsersWebPart in a &lt;Module&gt;/&lt;File&gt; tag:</p>
<div style="font-size:10pt;background:#eeeeee;color:black;font-family:Courier New;">
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;</span><span style="color:#a31515;">AllUsersWebPart</span><span style="color:blue;"> </span><span style="color:red;">WebPartZoneID</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">Left</span>&quot;<span style="color:blue;"> </span><span style="color:red;">WebPartOrder</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">0</span>&quot;<span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;![CDATA[</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;WebPart</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns=&quot;http://schemas.microsoft.com/WebPart/v2&quot;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:cewp=&quot;http://schemas.microsoft.com/WebPart/v2/ContentEditor&quot;&gt;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Assembly&gt;Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&lt;/Assembly&gt;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;TypeName&gt;Microsoft.SharePoint.WebPartPages.ContentEditorWebPart&lt;/TypeName&gt;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Title&gt;Working with Site Definitions&lt;/Title&gt;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;FrameType&gt;None&lt;/FrameType&gt;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;cewp:Content&gt;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;lt;h2&amp;gt;Welcome to SharePoint&amp;lt;/h2&amp;gt;</span></p>
<p style="margin:0px;"><span style="color:gray;"></span><span style="color:gray;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;lt;p&amp;gt;Use this website to store documents and keep lists of information.&amp;lt;/p&amp;gt;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/cewp:Content&gt;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/WebPart&gt;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:blue;">]]&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/</span><span style="color:#a31515;">AllUsersWebPart</span><span style="color:blue;">&gt;</span></p>
</div>
<p>Also, don&#39;t forget to strip your HTML tags from &lt; to &amp;lt; and &gt; to &amp;gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/nicksevens/2009/03/11/adding-a-content-editor-webpart-to-a-site-definition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add WSP Solutions through the interface</title>
		<link>http://vspug.com/nicksevens/2009/01/12/add-wsp-solutions-through-the-interface/</link>
		<comments>http://vspug.com/nicksevens/2009/01/12/add-wsp-solutions-through-the-interface/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 11:29:00 +0000</pubDate>
		<dc:creator>nsevens</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[One of the things I always missed in SharePoint is the fact that WSP solutions always had to be added through STSADM, and could not be added through the Solution management page &#8230;
So, I created a solution myself which adds a toolbar to the page, which allows to do exectly that.
It&#39;s been done by creating [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things I always missed in SharePoint is the fact that WSP solutions always had to be added through STSADM, and could not be added through the Solution management page &#8230;</p>
<p>So, I created a solution myself which adds a toolbar to the page, which allows to do exectly that.</p>
<p>It&#39;s been done by creating a custom solutions.aspx page (CustomSolutions.aspx), and adding a HttpModule to the web.config of the Central Administrator web application.</p>
<p>The pages ended up to look like this:</p>
<p><img src="/photos/nicksevens/images/24635/original.aspx" title="CustomSolutions.aspx" alt="CustomSolutions.aspx" width="736" height="240" /><br />&nbsp;</p>
<p><img src="/photos/nicksevens/images/24634/original.aspx" title="AddSolution.aspx" alt="AddSolution.aspx" width="617" height="275" />&nbsp;</p>
<p>&nbsp;The WSP and source code both can be found on <a href="http://www.codeplex.com/SPTools/Release/ProjectReleases.aspx?ReleaseId=21692">Codeplex</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/nicksevens/2009/01/12/add-wsp-solutions-through-the-interface/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Automatic removal of lists when deactivating ListInstance feature</title>
		<link>http://vspug.com/nicksevens/2008/11/20/automatic-removal-of-lists-when-deactivating-listinstance-feature/</link>
		<comments>http://vspug.com/nicksevens/2008/11/20/automatic-removal-of-lists-when-deactivating-listinstance-feature/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 07:42:00 +0000</pubDate>
		<dc:creator>nsevens</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[Creating lists using ListInstances is quite easy to do within a feature. However, deleting those lists again when deactivating that feature does not happen automatically (which is understandable, since you don&#39;t want to lose all data in the list when accidentally deactivating the feature &#8230;).
So, I created a feature receiver to do the job for [...]]]></description>
			<content:encoded><![CDATA[<p>Creating lists using ListInstances is quite easy to do within a feature. However, deleting those lists again when deactivating that feature does not happen automatically (which is understandable, since you don&#39;t want to lose all data in the list when accidentally deactivating the feature &#8230;).</p>
<p>So, I created a feature receiver to do the job for you <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  The receiver simple deletes all lists created by a ListInstance tag in the feature.</p>
<p>This is how I did it:</p>
<p><b>1. The feature.xml file<br /></b></p>
<div style="font-size:10pt;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;color:black;font-family:Courier New;">
<p style="margin:0px;"><span></span><span style="color:blue;">&lt;?</span><span>xml</span><span style="color:blue;"> </span><span style="color:red;">version</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">1.0</span>&quot;<span style="color:blue;"> </span><span style="color:red;">encoding</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">utf-8</span>&quot;<span style="color:blue;"> ?&gt;</span></p>
<p style="margin:0px;"><span></span><span style="color:blue;">&lt;</span><span>Feature</span><span style="color:blue;"> </span><span style="color:red;">xmlns</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">http://schemas.microsoft.com/sharepoint/</span>&quot;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </span><span style="color:red;">DefaultResourceFile</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">blog</span>&quot;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </span><span style="color:red;">Id</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">{40B0BD50-8A65-4cc3-99E4-28024DA1A487}</span>&quot;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </span><span style="color:red;">Title</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">Blogging list instances</span>&quot;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </span><span style="color:red;">Description</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">This feature enables the custom list instance definitions.</span>&quot;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </span><span style="color:red;">Version</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">1.0.0.0</span>&quot;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </span><span style="color:red;">Scope</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">Web</span>&quot;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </span><span style="color:red;">ReceiverAssembly</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">SharePoint.Blogging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bc158afeef6140c2</span>&quot;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; </span><span style="color:red;">ReceiverClass</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">SharePoint.Blogging.ListInstanceRemover</span>&quot;<span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &lt;</span><span>ElementManifests</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &nbsp; &lt;</span><span>ElementManifest</span><span style="color:blue;"> </span><span style="color:red;">Location</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">Elements.xml</span>&quot;<span style="color:blue;">/&gt;</span></p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &lt;/</span><span>ElementManifests</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span></span><span style="color:blue;">&lt;/</span><span>Feature</span><span style="color:blue;">&gt;</span></p>
</div>
<p>Notice that I set the <i>DefaultResourceFile</i> property to a self-created resource file, which is deployed in the <i>12/Resources</i> folder.</p>
<p><b>2. The elements.xml file</b></p>
<div style="font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;">
<p style="margin:0px;"><span></span><span style="color:blue;">&lt;?</span><span>xml</span><span style="color:blue;"> </span><span style="color:red;">version</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">1.0</span>&quot;<span style="color:blue;"> </span><span style="color:red;">encoding</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">utf-8</span>&quot;<span style="color:blue;"> ?&gt;</span></p>
<p style="margin:0px;"><span></span><span style="color:blue;">&lt;</span><span>Elements</span><span style="color:blue;"> </span><span style="color:red;">xmlns</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">http://schemas.microsoft.com/sharepoint/</span>&quot;<span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &lt;</span><span>ListInstance</span><span style="color:blue;"> </span><span style="color:red;">Id</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">0</span>&quot;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;">Description</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">A test list for the blogging article.</span>&quot;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;">FeatureId</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">{00BFEA71-DE22-43B2-A848-C05709900100}</span>&quot;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;">OnQuickLaunch</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">TRUE</span>&quot;</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;"></span><span style="color:red;">QuickLaunchUrl</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">/BlogList/AllItems.aspx</span>&quot;</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;"></span><span style="color:blue;"></span><span style="color:red;">TemplateType</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">100</span>&quot;</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;"></span><span style="color:red;">Title</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">$Resources:ListInstances_List_Title</span>&quot;</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;"></span><span style="color:red;">Url</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">BlogList</span>&quot;<span style="color:blue;"> /&gt;</span></p>
<p style="margin:0px;"><span></span><span style="color:blue;">&nbsp; &lt;</span><span>ListInstance</span><span style="color:blue;"> </span><span style="color:red;">Id</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">1</span>&quot;</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;"></span><span style="color:blue;"></span><span style="color:red;">Description</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">A test document library for the blogging article.</span>&quot;</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;"></span><span style="color:red;">FeatureId</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">{00BFEA71-E717-4E80-AA17-D0C71B360101}</span>&quot;</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;"></span><span style="color:blue;"></span><span style="color:red;">OnQuickLaunch</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">TRUE</span>&quot;</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;"></span><span style="color:red;">QuickLaunchUrl</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">/BlogDocLib/Forms/AllItems.aspx</span>&quot;</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;"></span><span style="color:red;">TemplateType</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">101</span>&quot;</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;"></span><span style="color:red;">Title</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">$Resources:blog,ListInstances_DocLib_Title;</span>&quot;</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color:red;"></span><span style="color:red;">Url</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">BlogDocLib</span>&quot;<span style="color:blue;"> /&gt;</span></p>
<p style="margin:0px;"><span></span><span style="color:blue;">&lt;/</span><span>Elements</span><span style="color:blue;">&gt;</span></p>
</div>
<p><b>3. The feature receiver </b>(the important part)</p>
<p>To create a feature receiver, we create a class overriding <i>SPFeatureReceiver</i>.</p>
<div style="font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;">
<p style="margin:0px;"><span></span><span style="color:blue;">using</span> System;</p>
<p style="margin:0px;"><span><br /></span></p>
<p style="margin:0px;"><span></span><span style="color:blue;">using</span> Microsoft.SharePoint;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">using</span> Microsoft.SharePoint.Administration;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">using</span> Microsoft.SharePoint.Utilities;</p>
<p style="margin:0px;"><span></span><span style="color:blue;">using</span> System.Globalization;</p>
<p style="margin:0px;"><span><br /></span></p>
<p style="margin:0px;"><span></span><span style="color:blue;">namespace</span> SharePoint.Blogging</p>
<p style="margin:0px;"><span></span>{</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:blue;">class</span> <span>ListInstanceRemover</span> : <span>SPFeatureReceiver</span></p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:blue;">override</span> <span style="color:blue;">void</span> FeatureDeactivating(<span>SPFeatureReceiverProperties</span> properties)</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span>CultureInfo</span> ci = System.Globalization.<span>CultureInfo</span>.InvariantCulture;</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span>SPElementDefinitionCollection</span> elementFiles = properties.Definition.GetElementDefinitions(ci);</p>
<p style="margin:0px;"><span><br /></span></p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;">foreach</span> (<span>SPElementDefinition</span> elementFile <span style="color:blue;">in</span> elementFiles)</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;">if</span> (elementFile.ElementType == <span>&quot;ListInstance&quot;</span>)</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0px;"><span>&nbsp;</span>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;">string</span> defaultResourceFile = properties.Feature.Definition.DefaultResourceFile;</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;">string</span> listTitle = <span>SPUtility</span>.GetLocalizedString(elementFile.XmlDefinition.Attributes[<span>&quot;Title&quot;</span>].Value, defaultResourceFile, <span>Convert</span>.ToUInt32(ci.LCID));</p>
<p style="margin:0px;"><span><br /></span></p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span>SPWeb</span> web = properties.Feature.Parent <span style="color:blue;">as</span> <span>SPWeb</span>;</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span>SPList</span> list = web.Lists[listTitle];</p>
<p style="margin:0px;"><span><br /></span></p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; list.Delete();</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin:0px;"><span></span></p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:blue;">override</span> <span style="color:blue;">void</span> FeatureActivated(<span>SPFeatureReceiverProperties</span> properties)</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;"></span>}</p>
<p style="margin:0px;"><span>&nbsp;</span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <span style="color:blue;"></span><span style="color:blue;">public</span> <span style="color:blue;">override</span> <span style="color:blue;">void</span> FeatureInstalled(<span>SPFeatureReceiverProperties</span> properties)</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;"></span>{</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;"></span>}</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;"></span><span style="color:blue;">public</span> <span style="color:blue;">override</span> <span style="color:blue;">void</span> FeatureUninstalling(<span>SPFeatureReceiverProperties</span> properties)</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;"></span>{</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;"></span>}</p>
<p style="margin:0px;"><span></span>&nbsp;&nbsp;&nbsp; }</p>
<p style="margin:0px;"><span></span>}</p>
</div>
<p>You might also notice me using the <i>SPUtility.GetLocalizedString</i> method, which actually is very handy to use when dealing with resource files, as it translates the resource string into the localized value.</p>
<p> There, that&#39;s it. I hope it helps someone in some way &#8230; <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/nicksevens/2008/11/20/automatic-removal-of-lists-when-deactivating-listinstance-feature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webpart&#039;s Summary Toolbar view in list definition</title>
		<link>http://vspug.com/nicksevens/2008/10/31/webpart-s-summary-toolbar-view-in-list-definition/</link>
		<comments>http://vspug.com/nicksevens/2008/10/31/webpart-s-summary-toolbar-view-in-list-definition/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 10:34:00 +0000</pubDate>
		<dc:creator>nsevens</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I created a list from a custom list definition, and wanted to add the list as a webpart to a page defined in my custom site definition.
In the sitedefinition, it was enough to declare the BaseViewID property to define which view I wanted the list to display on the webpart.


&#60;View List=&#34;Lists/LinksDocLibs&#34; BaseViewID=&#34;4&#34; WebPartZoneID=&#34;Left&#34; WebPartOrder=&#34;2&#34; /&#62;

Then, [...]]]></description>
			<content:encoded><![CDATA[<p>I created a list from a custom list definition, and wanted to add the list as a webpart to a page defined in my custom site definition.</p>
<p>In the sitedefinition, it was enough to declare the <b>BaseViewID</b> property to define which view I wanted the list to display on the webpart.</p>
</p>
<div style="font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;">
<p style="margin:0px;"><span style="color:blue;">&lt;</span><span>View</span><span style="color:blue;"> </span><span style="color:red;">List</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">Lists/LinksDocLibs</span>&quot;<span style="color:blue;"> </span><b><span style="color:red;">BaseViewID</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">4</span>&quot;</b><span style="color:blue;"> </span><span style="color:red;">WebPartZoneID</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">Left</span>&quot;<span style="color:blue;"> </span><span style="color:red;">WebPartOrder</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">2</span>&quot;<span style="color:blue;"> /&gt;</span></p>
</div>
<p>Then, in the list definition, I modified my selected view to show the <b>FreeForm</b> toolbar, which should only display the &quot;Add new item&quot; link underneath the webpart.</p>
</p>
<div style="font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;">
<p style="margin:0px;"><span style="color:blue;">&lt;</span><span>Toolbar</span><span style="color:blue;"> </span><span style="color:red;">Type</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">FreeForm</span>&quot;<span style="color:blue;"> </span><span style="color:red;">Position</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">After</span>&quot;<span style="color:blue;"> /&gt;</span></p>
</div>
<p>However, when using this, the &quot;Add new item&quot; link is not shown. To accomplish this, we have to insert some HTML into the <b>&lt;Toolbar&gt;</b> tag. Do it like this:</p>
</p>
<div style="font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;">
<p style="margin:0px;"><span style="color:blue;">&lt;</span><span>Toolbar</span><span style="color:blue;"> </span><span style="color:red;">Type</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">FreeForm</span>&quot;<span style="color:blue;"> </span><span style="color:red;">Position</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">After</span>&quot;<span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &lt;</span><span>IfHasRights</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &lt;</span><span>RightsChoices</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;</span><span>RightsGroup</span><span style="color:blue;"> </span><span style="color:red;">PermAddListItems</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">required</span>&quot;<span style="color:blue;">/&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &lt;/</span><span>RightsChoices</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &lt;</span><span>Then</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;</span><span>HTML</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;![CDATA[</span><span style="color:gray;">&lt;table width=100% cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot;&gt;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;ms-partline&quot;&gt;&lt;img src=&quot;/_layouts/images/blank.gif&quot; width=&quot;1&quot; height=&quot;1&quot; alt=&quot;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td class=&quot;ms-addnew&quot; style=&quot;padding-bottom:3px&quot;&gt;&lt;img src=&quot;/layouts/images/rect.gif&quot; alt=&quot;&quot;&gt;</span></p>
<p style="margin:0px;"><span style="color:gray;">&nbsp; &nbsp; &nbsp; &nbsp; &amp;nbsp;&lt;a class=&quot;ms-addnew&quot; ID=&quot;idAddNewItem&quot; href=&quot;</span><span style="color:blue;">]]&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;/</span><span>HTML</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;</span><span>URL</span><span style="color:blue;"> </span><span style="color:red;">Cmd</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">New</span>&quot;<span style="color:blue;">/&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;</span><span>HTML</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;![CDATA[</span><span style="color:gray;">&quot; onclick=&quot;NewItem(&#39;</span><span style="color:blue;">]]&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;/</span><span>HTML</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;</span><span>URL</span><span style="color:blue;"> </span><span style="color:red;">Cmd</span><span style="color:blue;">=</span>&quot;<span style="color:blue;">New</span>&quot;<span style="color:blue;">/&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;</span><span>HTML</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;![CDATA[</span><span style="color:gray;">&#39;,true);return false;&quot; target=&quot;_self&quot;&gt;</span><span style="color:blue;">]]&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;/</span><span>HTML</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;</span><span>HTML</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;">&nbsp; &nbsp; &nbsp; &nbsp; Add a new item</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;/</span><span>HTML</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;</span><span>HTML</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;![CDATA[</span><span style="color:gray;">&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;IMG src=&quot;/_layouts/images/blank.gif&quot; width=1 height=5 alt=&quot;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</span><span style="color:blue;">]]&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &nbsp; &lt;/</span><span>HTML</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &nbsp; &lt;/</span><span>Then</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&nbsp; &lt;/</span><span>IfHasRights</span><span style="color:blue;">&gt;</span></p>
<p style="margin:0px;"><span style="color:blue;">&lt;/</span><span>Toolbar</span><span style="color:blue;">&gt;</span></p>
</div>
<p>There, that should do the trick <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Starting with this, you can also easily customize your layout as you can change the entire HTML markup for the Toolbar template <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Have fun with it <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </p>
<p>&nbsp;</p>
<p><i>Thanks to <a href="http://tippu.blog.co.in">Tippu</a> for the inspiration in <a href="http://tippu.blog.co.in/2008/10/08/how-to-set-a-listviewwebparts-toolbar-type-as-summary-web-part/">this post</a>.</i> </p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/nicksevens/2008/10/31/webpart-s-summary-toolbar-view-in-list-definition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>STSADM Extensions on CodePlex</title>
		<link>http://vspug.com/nicksevens/2008/10/19/stsadm-extensions-on-codeplex/</link>
		<comments>http://vspug.com/nicksevens/2008/10/19/stsadm-extensions-on-codeplex/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 22:09:00 +0000</pubDate>
		<dc:creator>nsevens</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[Last friday I opened a project on CodePlex, in which I, together with some collegues, am going to put some stsadm extensions which are, or seem to be, usefull to us.
If you have any recommendations or ideas to put in them, please leave a comment over there, or in this blog.
You can find the project [...]]]></description>
			<content:encoded><![CDATA[<p>Last friday I opened a project on CodePlex, in which I, together with some collegues, am going to put some stsadm extensions which are, or seem to be, usefull to us.</p>
<p>If you have any recommendations or ideas to put in them, please leave a comment over there, or in this blog.</p>
<p>You can find the project at <a href="http://www.codeplex.com/stsadmextensions%20">http://www.codeplex.com/stsadmextensions</a></p>
<p>The first functionality I added is &quot;resetapplicationpool&quot;, by which you can reset the app pool of a site of which you have to specify the url. Thought it might be easier to use than finding the correct one in inetmgr all the time &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/nicksevens/2008/10/19/stsadm-extensions-on-codeplex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>32-bit color in remote desktop</title>
		<link>http://vspug.com/nicksevens/2008/10/16/32-bit-color-in-remote-desktop/</link>
		<comments>http://vspug.com/nicksevens/2008/10/16/32-bit-color-in-remote-desktop/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 07:34:00 +0000</pubDate>
		<dc:creator>nsevens</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[&#160;I just installed Windows Server 2008 on a VM machine, but was disappointed to see that through a remote connection, it would only show 16-bit colors by default.
I know, I know, it should look good, it should just perform well. But still, I wanted to use 32-bit colors when running the server (I mean, even [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;I just installed Windows Server 2008 on a VM machine, but was disappointed to see that through a remote connection, it would only show 16-bit colors by default.</p>
<p>I know, I know, it should look good, it should just perform well. But still, I wanted to use 32-bit colors when running the server (I mean, even the trashcan icon looked awefull :p)</p>
<p>Now, I did some searching and found the reason that 32bit was not in de choice list in display settings, so here it is:</p>
<p>On your host, do the following: </p>
<p>1. Run GPEDIT.MSC;<br />2. Go to: Local Computer Policy/Computer Configuration/Administrative Templates/Windows Components/Terminal Services/Terminal Server/Remote Session Environment;<br />3. Open the policy &#39;Limit maximum color depth&#39;;<br />4. Set this to Disabled or Enabled (with 32-bit selected under it then)</p>
<p>&nbsp;</p>
<p>I know this isn&#39;t the most important setting in Windows Server <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  but it does look better now :p </p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/nicksevens/2008/10/16/32-bit-color-in-remote-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint content types inheritance fixed</title>
		<link>http://vspug.com/nicksevens/2008/10/14/sharepoint-content-types-inheritance-fixed-by-martin-hatch/</link>
		<comments>http://vspug.com/nicksevens/2008/10/14/sharepoint-content-types-inheritance-fixed-by-martin-hatch/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 09:43:00 +0000</pubDate>
		<dc:creator>nsevens</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I came across a great post from Martin Hatch today, which provides a solution for problems with content types and list definitions in features. 
I tested it and it seems to work great, although i did make a little change, since the handler throws an error when using a RemoveFieldRef node in the CT definition.
So, [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a <a href="http://mkeeper.spaces.live.com/blog/cns%2160F12A60288E5607%21280.entry">great post</a> from <a href="http://mkeeper.spaces.live.com/blog/">Martin Hatch</a> today, which provides a solution for problems with content types and list definitions in features. </p>
<p>I tested it and it seems to work great, although i did make a little change, since the handler throws an error when using a RemoveFieldRef node in the CT definition.</p>
<p>So, i changed this:&nbsp;</p>
<div style="font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;">
<p style="margin:0px;"><span style="color:blue;">foreach</span> (<span>XmlNode</span> fieldRef <span style="color:blue;">in</span> node.ChildNodes)</p>
<p style="margin:0px;">{</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp;&nbsp;&nbsp; #region</span> Loop through FieldRefs</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; <span style="color:green;">//ignore XML comment tags</span></p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">if</span> (fieldRef.Name == <span>&quot;#comment&quot;</span>)</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <span style="color:blue;">continue</span>;</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; }</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">string</span> fieldID = fieldRef.Attributes[<span>&quot;ID&quot;</span>].Value;</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; <span>SPField</span> field = cType.Fields[<span style="color:blue;">new</span> <span>Guid</span>(fieldID)];</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; cType.FieldLinks.Delete(<span style="color:blue;">new</span> <span>Guid</span>(fieldID));</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; cType.Update(<span style="color:blue;">true</span>);</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; cType.FieldLinks.Add(<span style="color:blue;">new</span> <span>SPFieldLink</span>(field));</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; cType.Update(<span style="color:blue;">true</span>); </p>
<p style="margin:0px;"><span style="color:blue;">&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin:0px;">}</p>
</div>
<p>to this:</p>
</p>
<div style="font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;">
<p style="margin:0px;"><span style="color:blue;">foreach</span> (<span>XmlNode</span> fieldRef <span style="color:blue;">in</span> node.ChildNodes)</p>
<p style="margin:0px;">{</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp;&nbsp;&nbsp; #region</span> Loop through FieldRefs</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; <span style="color:green;">//ignore everything but FieldRefs</span></p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">if</span> (fieldRef.Name == <span>&quot;FieldRefs&quot;</span>)</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:blue;">string</span> fieldID = fieldRef.Attributes[<span>&quot;ID&quot;</span>].Value;</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span>SPField</span> field = cType.Fields[<span style="color:blue;">new</span> <span>Guid</span>(fieldID)];</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cType.FieldLinks.Delete(<span style="color:blue;">new</span> <span>Guid</span>(fieldID));</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cType.Update(<span style="color:blue;">true</span>);</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cType.FieldLinks.Add(<span style="color:blue;">new</span> <span>SPFieldLink</span>(field));</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cType.Update(<span style="color:blue;">true</span>);</p>
<p style="margin:0px;">&nbsp;&nbsp;&nbsp; }</p>
<p style="margin:0px;"><span style="color:blue;">&nbsp;&nbsp;&nbsp; #endregion</span></p>
<p style="margin:0px;">}</p>
</div>
<p>Seems to work to me, but if anyone has another suggestion <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  please do let me know <img src='http://vspug.com/nicksevens/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://vspug.com/nicksevens/2008/10/14/sharepoint-content-types-inheritance-fixed-by-martin-hatch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
