<?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>SPSherm.MyBlog &#187; Reference</title>
	<atom:link href="http://spsherm.uptempoconsulting.com/tag/reference/feed/" rel="self" type="application/rss+xml" />
	<link>http://spsherm.uptempoconsulting.com</link>
	<description>SharePoint, of course.</description>
	<lastBuildDate>Mon, 03 Oct 2011 03:01:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Event Receivers</title>
		<link>http://spsherm.uptempoconsulting.com/2010/01/event-receivers/</link>
		<comments>http://spsherm.uptempoconsulting.com/2010/01/event-receivers/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 17:44:13 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SP2007]]></category>
		<category><![CDATA[Event Receivers]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=164</guid>
		<description><![CDATA[Two excellent resources for ramping up on SharePoint 2007 event receivers. http://blogs.msdn.com/brianwilson/archive/2007/03/05/part-1-event-handlers-everything-you-need-to-know-about-microsoft-office-sharepoint-portal-server-moss-event-handlers.aspx http://www.davehunter.co.uk/Blog/Lists/Posts/Post.aspx?ID=69]]></description>
			<content:encoded><![CDATA[<p>Two excellent resources for ramping up on SharePoint 2007 event receivers.</p>
<ul>
<li><a href="http://blogs.msdn.com/brianwilson/archive/2007/03/05/part-1-event-handlers-everything-you-need-to-know-about-microsoft-office-sharepoint-portal-server-moss-event-handlers.aspx">http://blogs.msdn.com/brianwilson/archive/2007/03/05/part-1-event-handlers-everything-you-need-to-know-about-microsoft-office-sharepoint-portal-server-moss-event-handlers.aspx</a></li>
<li><a href="http://www.davehunter.co.uk/Blog/Lists/Posts/Post.aspx?ID=69">http://www.davehunter.co.uk/Blog/Lists/Posts/Post.aspx?ID=69</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2010/01/event-receivers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PortalSiteMapProvider Properties: IncludePages, DynamicChildLimit</title>
		<link>http://spsherm.uptempoconsulting.com/2007/10/portalsitemapprovider-properties-includepages-dynamicchildlimit/</link>
		<comments>http://spsherm.uptempoconsulting.com/2007/10/portalsitemapprovider-properties-includepages-dynamicchildlimit/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 02:51:32 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SP2007]]></category>
		<category><![CDATA[Navigation]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=127</guid>
		<description><![CDATA[The PortalSiteMapProvider class is the base provider used by the four default &#8220;CMS&#8221; SiteMapProviders: GlobalNavSiteMapProvider CombinedNavSiteMapProvider CurrentNavSiteMapProvider CurrentNavSiteMapProviderNoEncode That is, all of these SiteMapProviders use the same base code to generate a data source, but their &#8220;output&#8221; differs slightly due to the different attributes that are applied. Recently, we wanted to filter out the pages [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://msdn2.microsoft.com/en-us/library/ms582344.aspx" target="_blank">PortalSiteMapProvider</a> class is the base provider used by the four default &#8220;CMS&#8221; SiteMapProviders:</p>
<ul>
<li>GlobalNavSiteMapProvider</li>
<li>CombinedNavSiteMapProvider</li>
<li>CurrentNavSiteMapProvider</li>
<li>CurrentNavSiteMapProviderNoEncode</li>
</ul>
<p>That is, all of these SiteMapProviders use the same base code to generate a data source, but their &#8220;output&#8221; differs slightly due to the different attributes that are applied.</p>
<p>Recently, we wanted to filter out the pages from showing up in our left-navigation. You can do this at the rendering stage, but since the PortalSiteMapProvder gives us an <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.publishing.navigation.portalsitemapprovider.includepages.aspx" target="_blank">IncludePages</a> property, we can simply create a new entry in <code>web.config</code> for our &#8220;custom&#8221; provider, like this:</p>
<pre class="brush: xml; title: ; notranslate">&lt;add name=&quot;CurrentNavNoPagesSiteMapProvider&quot; description=&quot;CMS provider for Current navigation&quot; type=&quot;Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; NavigationType=&quot;Current&quot; EncodeOutput=&quot;true&quot; IncludePages=&quot;Never&quot; /&gt;</pre>
<p>By default, there is also a 50 returned-items limit; we can set the <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.publishing.navigation.portalsitemapprovider.dynamicchildlimit.aspx" target="_blank">DynamicChildLimit</a> to &#8220;0&#8243; to override this.</p>
<pre class="brush: xml; title: ; notranslate">&lt;add name=&quot;CurrentNavNoLimitSiteMapProvider&quot; description=&quot;CMS provider for Current navigation&quot; type=&quot;Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; NavigationType=&quot;Current&quot; EncodeOutput=&quot;true&quot; DynamicChildLimit=&quot;0&quot; /&gt;</pre>
<p>Of course, you can combine the different properties to come up with a combination you need. The next thing we would need to do is reference these new providers, and voila!</p>
<p>And if you haven&#8217;t read Chris Richard&#8217;s series of articles about <a href="http://blogs.msdn.com/ecm/archive/2007/02/10/moss-navigation-deep-dive-part-1.aspx" target="_blank">MOSS Navigation</a> and <a href="http://blogs.msdn.com/ecm/archive/2007/05/23/increased-performance-for-moss-apps-using-the-portalsitemapprovider.aspx" target="_blank">how to get better performance using the PortalSiteMapProvider</a>, you really should&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2007/10/portalsitemapprovider-properties-includepages-dynamicchildlimit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SPSite vs. SPWeb</title>
		<link>http://spsherm.uptempoconsulting.com/2007/08/spsite-vs-spweb/</link>
		<comments>http://spsherm.uptempoconsulting.com/2007/08/spsite-vs-spweb/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 12:06:34 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SP2007]]></category>
		<category><![CDATA[Reference]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=72</guid>
		<description><![CDATA[We had a discussion amongst the developers in our group recently: what is an SPSite, what is an SPWeb, and what is the difference? Which once should I work with in my code? Looking at MSDN for the SPSite class, we see this description: SPSite Represents a collection of sites on a virtual server, including [...]]]></description>
			<content:encoded><![CDATA[<p>We had a discussion amongst the developers in our group recently: what is an SPSite, what is an SPWeb, and what is the difference? Which once should I work with in my code? Looking at MSDN for the SPSite class, we see this description:</p>
<p><strong>SPSite</strong> Represents a collection of sites on a virtual server, including a top-level site and all its subsites. Each SPSite object, or site collection, is represented within an SPSiteCollection object that consists of the collection of all site collections on the virtual server.</p>
<p>Mmmmm&#8230; ooo-kay&#8230; what does that mean?</p>
<p>The <strong>SPWeb</strong> class simply says:</p>
<p>Represents a SharePoint Web site.</p>
<p>Wow. Enlightening. Looking back to my first experiences working with the SharePoint object model in WSS2/SPS2003, I must say this was one of the more confusing points for me. And it&#8217;s easy to see why it can be such a confusing/frustrating experience for developers working with the API for the first time. Now that I&#8217;ve worked with WSS3/MOSS code more closely, specifically with Publishing Sites where there are many child &#8220;sites&#8221;, I&#8217;ve come to understand the world of SPSite and SPWeb objects.</p>
<p>The problem lies with the difference in terms used between the SharePoint user-interface and the object model. When we are speaking to end-users, they are familiar with the term &#8220;creating SharePoint team sites&#8221;. However, everytime you create a &#8220;site&#8221; from the UI, an SPWeb object was created.</p>
<p>It doesn&#8217;t help that the MSDN documentation uses the following type of naming conventions in their code samples:</p>
<pre class="brush: csharp; title: ; notranslate">
SPSite mySiteCollection = new SPSite(&quot;http://servername/&quot;);
SPWeb mySite = mySiteCollection.AllWebs[&quot;Site_Name&quot;];
SPWeb myRootSite = mySiteCollection.RootWeb;
</pre>
<p>For me, it would have been much clearer if they wrote something like this instead:</p>
<pre class="brush: csharp; title: ; notranslate">
SPSite mySite = new SPSite(&quot;http://servername/&quot;);
SPWeb myWeb = mySite.AllWebs[&quot;Site_Name&quot;];
SPWeb myRootWeb = mySite.RootWeb;
</pre>
<p>While the description for SPSite may be valid, a typical SharePoint application web site only has one top-level site collection. Therefore, in this url <code>http://servername/site1/site1a/</code>, there are actually three SPWeb objects, and only one SPSite object.</p>
<pre class="brush: csharp; title: ; notranslate">
SPSite site1 = new SPSite(&quot;http://servername/site1/&quot;);
SPSite site1a = new SPSite(&quot;http://servername/site1/site1a/&quot;);
bool sitesAreEqual = site1.Equals(site1a);  // sitesAreEqual should evaluate to true.

SPWeb web1 = site1.OpenWeb();
SPWeb web1a = site1a.OpenWeb();
SPWeb rootWeb = site1.RootWeb; // or site1a.RootWeb; would return same instance.
</pre>
<p>See the <code>SPSite.OpenWeb()</code> method for more examples: <a href="http://msdn2.microsoft.com/en-us/library/ms474633.aspx">http://msdn2.microsoft.com/en-us/library/ms474633.aspx</a>.</p>
<p>SPSite itself is not a &#8220;collection&#8221; in the sense that comes from CollectionBase, for example. In fact, both SPSite and SPWeb inherit directly from System.Object. Therefore, to use a name such as mySiteCollection is confusing/misleading.</p>
<p>The key thing to keep in mind is that as developers, we need to use the technically accurate terms when speaking with each other (even if MSDN doesn&#8217;t), and reserve the marketing/UI terms when speaking with people who would never see the object model. (Note: there are examples of these kinds of terminology differences all over the place in SharePoint 2007.)</p>
<p>I hope this clears things up a bit&#8230;if you find something that is not correct/accurate, please let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2007/08/spsite-vs-spweb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSDN Link: SharePoint Best Practices &#8211; Disposing WSS Objects</title>
		<link>http://spsherm.uptempoconsulting.com/2007/08/msdn-link-sharepoint-best-practices-disposing-wss-objects/</link>
		<comments>http://spsherm.uptempoconsulting.com/2007/08/msdn-link-sharepoint-best-practices-disposing-wss-objects/#comments</comments>
		<pubDate>Thu, 02 Aug 2007 23:28:52 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Best Practice]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[SP2007]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=40</guid>
		<description><![CDATA[ Might as well dive right in and make the inaugural posting useful&#8230;  Anyone who&#8217;s done some development work with SharePoint probably already knows about this article, but I wanted to place it here for reference: Best Practices: Using Disposable Windows SharePoint Services Objects Review the article very carefully&#8230; there are things we do often such [...]]]></description>
			<content:encoded><![CDATA[<p> <em>Might as well dive right in and make the inaugural posting useful&#8230;</em> </p>
<p>Anyone who&#8217;s done some development work with SharePoint probably already knows about this article, but I wanted to place it here for reference:</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/aa973248.aspx" target="_blank">Best Practices: Using Disposable Windows SharePoint Services Objects</a></p>
<p>Review the article very carefully&#8230; there are things we do often such as getting to an SPSite&#8217;s RootWeb, like this:</p>
<pre class="brush: csharp; light: true; title: ; notranslate">SPSite site = SPControl.GetContextSite(HttpContext.Current);
SPWeb rootWeb = site.RootWeb;</pre>
<p>In this case, it&#8217;s pretty obvious (based on the article) that we need to call:</p>
<pre class="brush: csharp; light: true; title: ; notranslate">rootWeb.Dispose();</pre>
<p>However, if you were to access a property like this:</p>
<pre class="brush: csharp; light: true; title: ; notranslate">string rootWebTitle = site.RootWeb.Title;</pre>
<p>the article states that you should call</p>
<pre class="brush: csharp; light: true; title: ; notranslate">site.RootWeb.Dispose();</pre>
<p>which is not obvious, in my opinion. So to keep/ensure your SharePoint site/application runs as smoothly as possible, clean up after yourself! </p>
<p>EDIT (September 2008):</p>
<p>This is kind of old news by now, but here is another article from Andrew Woodward (which references 3 articles other than MSDN). Worthy to note that we need to properly Close() all PublishingWeb objects as well.<br />
<a href="http://www.21apps.com/2008/02/sharepoint-ate-all-my-memory-dealing.html">http://www.21apps.com/2008/02/sharepoint-ate-all-my-memory-dealing.html</a></p>
<p>Roger Lamb&#8217;s blog has some really good examples. Also make sure to read the comments.<br />
<a href="http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx">http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx</a></p>
<p>Stefan Gossner gives a pretty good in-depth look at how memory is consumed.<br />
<a href="http://blogs.technet.com/stefan_gossner/archive/2007/11/26/dealing-with-memory-pressure-problems-in-moss-wss.aspx">http://blogs.technet.com/stefan_gossner/archive/2007/11/26/dealing-with-memory-pressure-problems-in-moss-wss.aspx</a></p>
<p>Finally, a post about application pool/worker process recycling and SharePoint.<br />
<a href="http://blogs.msdn.com/steveshe/archive/2007/12/17/overlapped-recycling-and-sharepoint-why-sharepoint-requires-it.aspx">http://blogs.msdn.com/steveshe/archive/2007/12/17/overlapped-recycling-and-sharepoint-why-sharepoint-requires-it.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2007/08/msdn-link-sharepoint-best-practices-disposing-wss-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

