<?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; SharePoint</title>
	<atom:link href="http://spsherm.uptempoconsulting.com/category/sharepoint/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>Deleting a SharePoint List using Powershell</title>
		<link>http://spsherm.uptempoconsulting.com/2011/08/deleting-a-sharepoint-list-using-powershell/</link>
		<comments>http://spsherm.uptempoconsulting.com/2011/08/deleting-a-sharepoint-list-using-powershell/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 17:10:41 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SP2010]]></category>
		<category><![CDATA[Delete]]></category>
		<category><![CDATA[List]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=180</guid>
		<description><![CDATA[When I&#8217;m doing development tasks, there are times I need to quickly create and delete SharePoint content. Lists are one of those. Documenting a few different ways to delete a SharePoint 2010 list using Powershell. Two lines: One line: or]]></description>
			<content:encoded><![CDATA[<p>When I&#8217;m doing development tasks, there are times I need to quickly create and delete SharePoint content. Lists are one of those. Documenting a few different ways to delete a SharePoint 2010 list using Powershell.</p>
<p>Two lines:</p>
<pre class="brush: powershell; title: ; notranslate">
$w = Get-SPWeb &quot;http://sps2010&quot;
$w.Lists.Delete([System.Guid]$w.Lists[&quot;My Custom List&quot;].ID)
</pre>
<p>One line:</p>
<pre class="brush: powershell; title: ; notranslate">
Get-SPWeb &quot;http://sps2010&quot; | Where-Object { $_.Lists.Delete([System.Guid]$_.Lists[&quot;My Custom List&quot;].ID) }
</pre>
<p>or</p>
<pre class="brush: powershell; title: ; notranslate">
Get-SPWeb &quot;http://sps2010&quot; | % { $_.Lists.Delete([System.Guid]$_.Lists[&quot;My Custom List&quot;].ID) }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2011/08/deleting-a-sharepoint-list-using-powershell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>IIS7 Application Pool Reset</title>
		<link>http://spsherm.uptempoconsulting.com/2010/01/iis7-application-pool-reset/</link>
		<comments>http://spsherm.uptempoconsulting.com/2010/01/iis7-application-pool-reset/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 21:21:16 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[Reference]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Application Pool]]></category>
		<category><![CDATA[Command]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=160</guid>
		<description><![CDATA[In IIS6 on Windows Server 2003, we could recyle the application pool that hosted our SharePoint site in order to force the web application to perform a JIT compile. This would then reload any DLLs it required. This saved a considerable amount of time over an IISRESET. That command is: (Note that the first time you run [...]]]></description>
			<content:encoded><![CDATA[<p>In IIS6 on Windows Server 2003, we could recyle the application pool that hosted our SharePoint site in order to force the web application to perform a JIT compile. This would then reload any DLLs it required. This saved a considerable amount of time over an IISRESET.</p>
<p>That command is:</p>
<pre class="brush: plain; title: ; notranslate">C:\windows\system32\IISApp.vbs /a &quot;SP Site App Pool&quot; /r</pre>
<p>(Note that the first time you run IISAPP.vbs, you&#8217;ll get a few confirmation prompts.)</p>
<p>This VBS script does not exist in IIS7 on Windows Server 2008, but the good news is there is an even better command:</p>
<pre class="brush: plain; title: ; notranslate">c:\windows\system32\inetsrv\AppCmd Recycle AppPool &quot;SP Site App Pool&quot;</pre>
<p>Type &#8220;AppCmd /?&#8221; for a list of all the useful actions you might want perform against your IIS7 installation.</p>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2010/01/iis7-application-pool-reset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SPC09 Recap</title>
		<link>http://spsherm.uptempoconsulting.com/2009/11/spc09-recap/</link>
		<comments>http://spsherm.uptempoconsulting.com/2009/11/spc09-recap/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 04:26:27 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SPC09]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=155</guid>
		<description><![CDATA[Better late than never&#8230; It&#8217;s about time I wrote about the experiences of what was the SharePoint Conference, 2009 edition, in Las Vegas. By now many others have had their recap, and with my own experiences being somewhat similar, I shall try to keep mine succint, but entertaining. My first major Microsoft conference was the [...]]]></description>
			<content:encoded><![CDATA[<p>Better late than never&#8230;</p>
<p>It&#8217;s about time I wrote about the experiences of what was the SharePoint Conference, 2009 edition, in Las Vegas. By now many others have had their recap, and with my own experiences being somewhat similar, I shall try to keep mine succint, but entertaining.</p>
<p>My first major Microsoft conference was the Office/SharePoint conference in Redmond (or was it Bellevue) in March 2005. I had just started with <a href="http://www.habaneros.com" target="_blank">Habañero Consulting Group</a>, had just gone through a nasty learning experience on a custom &#8220;workflow&#8221; type issues and tasks solutions on SharePoint 2003 (which was NOT fun for many reasons), and so was pretty wide-eyed and overwhelmed when I attended the sessions. Aside from the two co-workers I went with, I knew no one else, didn&#8217;t know any of the &#8220;big names&#8221;, and didn&#8217;t really have any sort of game-plan whatsoever. We heard a lot of ideas, I saw some code, saw some bad presentations, and concluded the conference with pretty much a &#8220;meh&#8221;. The most exciting part was the road trip from Vancouver in my car, and I&#8217;ll never forget the &#8220;thud&#8221; that my car had to endure as I drove it off a curb because my &#8220;navigator&#8221; (she will remain nameless, for now&#8230;) missed the exit, it was dark, and I was desperate to turn around and find the hotel.</p>
<p>SharePoint Conference 2008 came to Seattle in February, if i recall correctly. Due to the success the product had in 2007, it was going to be a big deal for SharePoint 2007, with which I&#8217;d been working since the summer of 2006 (Beta 2). Having spent two years prior on MCMS 2002, I was fortunate to be involved in a WCM solution in the summer of 2007. By then, I had learned a lot through discovery, but also through reading the content of others. I also attended the first running of <a href="http://www.andrewconnell.com" target="_blank">Andrew Connell</a>&#8216;s <a href="http://www.criticalpathtraining.com/Courses/Pages/DevelopingPublishingSiteswithSharePointServer2007WebContentManagementWebcast.aspx" target="_blank">WCM401</a> online class. I had a bit of a game plan this time, but it mostly involved the sessions, attending them as strategically as I could, trying to learn things outside of my SharePoint comfort zone. I learned some new things, saw better presentations, but generally didn&#8217;t feel as out of place as I did in 2005. I attended SharePint, met a few people throughout the conference, but pretty much stayed with my co-workers and didn&#8217;t realize the social aspect of these conferences. Since the two MOSS exams were available for free, I decided to give them a shot and passed both. Cool. The stay at the W was also a nice luxury that Habanero generously provided.</p>
<p>Throughout 2007 and 2008, I was focussed primarily on SharePoint projects. I learned more and more with each one (as one should), became more confident, and looked forward to the next conference. Soon after it was announced, I bought an early-bird ticket. Throughout 2009, I grasped on to Twitter, started following a few SharePoint people, and once in a while would engage in some sort of &#8220;conversation&#8221; with people whom I&#8217;ve never met. It was very cool. Heading down to Las Vegas for SPC09 I decided I would try to meet as many people as I could, to personally thank them for the work they have put into the community over the last few years from whom I&#8217;ve benefitted directly as well. I decided to splurge a bit and stayed at THEhotel, attended SharePint at EyeCandy, and throughout the conference just shook hands and tried to track down a few people to say &#8220;hi&#8221; and &#8220;thanks&#8221;. I had never been to Vegas before, but it wasn&#8217;t until Tuesday evening (after the 80s party with Huey Lewis and the News) that I even stepped outside of the Mandalay Bay Center.</p>
<p>It was a great conference with a lot of content (overload), but what made it really special for me was the chance to meet many of the cool people in the SharePoint community of which I&#8217;m proud to be part of.</p>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2009/11/spc09-recap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Registering a CSS File in SharePoint</title>
		<link>http://spsherm.uptempoconsulting.com/2008/06/registering-a-css-file-in-sharepoint/</link>
		<comments>http://spsherm.uptempoconsulting.com/2008/06/registering-a-css-file-in-sharepoint/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 00:26:50 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SP2007]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[WCM]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=135</guid>
		<description><![CDATA[I have a custom publishing site definition. It was, of course, based off the default publishing site definition. I re-organized some features around, and added custom versions of required features just so I could control everything a little more to my liking. Anytime we do this, however, we run the risk of &#8220;what did I break?&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>I have a custom publishing site definition. It was, of course, based off the default publishing site definition. I re-organized some features around, and added custom versions of required features just so I could control everything a little more to my liking. Anytime we do this, however, we run the risk of &#8220;what did I break?&#8221; syndrome.</p>
<p>One of my clients was using the Content Editor Web Part on one of her page layouts (instead of using a RichHtmlField &#8211; long story). She noted that she could not select the &#8220;Use Predefined Table Format&#8221; in the Table Editor web dialog. Hmmm&#8230; I didn&#8217;t do anything specific to <em>disable</em> that capability, so I needed to do some digging.</p>
<p>Since I was using a custom publishing site definition, I needed to determine if this behaviour was happening with the default Publishing Portal definition. Sure enough, adding a CEWP to the home page of the Publishing Portal yielded the same effect: I could not use the predefined table formats. I then check the Press Releases default page, which does have a RichHtmlField for me to play with. I <em>can</em> use the predefined formats here. I proceeded to add a CEWP to the zone at the bottom of the page, and here I can also use the predefined formats. Interesting&#8230;</p>
<p>I fired up my favourite search engine, and came across this posting from Microsoft: <a title="http://support.microsoft.com/kb/948320" href="http://support.microsoft.com/kb/948320">How to enable the &#8220;Use Predefined Table Format&#8221; setting when you use a Windows SharePoint Services template in SharePoint Server 2007</a>. Cool! But note the location of the CSS: /_LAYOUTS/1033/STYLES/HtmlEditorTableFormats.css. In my case, I have the French language pack installed, which means I have to account for the 1036 LCID also.</p>
<p>I checked the master pages and page layouts that PublishingLayouts feature use, and note that there is <em>not</em> a reference to that CSS. Nor is it in the page layouts found in the PublishingResources feature. What gives? What&#8217;s the correct syntax?</p>
<p>No matter. I&#8217;ll just add a link to the CSS by building out the path to the right LCID folder, using something like System.Threading.Thread.CurrentThread.CurrentUICulture to get the LCID. After some frustrations (which I won&#8217;t get into here), I quickly realized that this would not work in my scenario (Canadian English is not 1033) either.</p>
<p>I looked at the source code for my out-of-the-box publishing portal (the Press Releases page). I noticed that core.css also comes from the LAYOUTS/1033/Styles folder. Some more digging, and I realized that I did not need to specify the full path, like this example taken from BlueBand.master:</p>
<pre class="brush: xml; title: ; notranslate">&lt;SharePoint:CssRegistration name=&quot;&lt;% $SPUrl:~sitecollection/Style Library/~language/Core Styles/controls.css %&gt;&quot; runat=&quot;server&quot;/&gt;</pre>
<p>but instead I needed simply this:</p>
<pre class="brush: xml; title: ; notranslate">&lt;SharePoint:CssRegistration name=&quot;HtmlEditorTableFormats.css&quot; runat=&quot;server&quot; /&gt;</pre>
<p>and SharePoint takes care of the rest, building out the path to the appropriate Styles as required, like this:  </p>
<pre class="brush: xml; title: ; notranslate">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/_layouts/1033/styles/Htmleditortableformats.css?rev=guYGdUBUxQit03E2jhSdvA&quot; /&gt;</pre>
<p><a title="http://blog.mastykarz.nl/tag/rich-text-editor/" href="http://blog.mastykarz.nl/tag/rich-text-editor/">Here is a great post which talks about what&#8217;s going on</a>, and what renders HtmlEditorTableFormats links. It explains why I could not find it in any of the master pages or page layouts: the RichHtmlField web control inserts CSS links to HtmlEditorTableFormats.css and HtmlEditorCustomStyles.css OnLoad() . &lt;groan! /&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2008/06/registering-a-css-file-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ContentTypeID Syntax/Structure</title>
		<link>http://spsherm.uptempoconsulting.com/2008/02/contenttypeid-syntaxstructure/</link>
		<comments>http://spsherm.uptempoconsulting.com/2008/02/contenttypeid-syntaxstructure/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 22:24:16 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SP2007]]></category>
		<category><![CDATA[ContentTypeID]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=141</guid>
		<description><![CDATA[There is a more efficient way to do content type IDS than we have done in the past: http://msdn2.microsoft.com/en-us/library/aa543822.aspx Say we wanted to inherit from &#8220;Page&#8221;, our content type used to look something this (I&#8217;ve split up the lines so it will display properly): 0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900 188024C0FF7F45CFB85EBB43980DACF5 Meaning, inherit from &#8220;Page&#8221; (the red part), include a [...]]]></description>
			<content:encoded><![CDATA[<p>There is a more efficient way to do content type IDS than we have done in the past: <a title="http://msdn2.microsoft.com/en-us/library/aa543822.aspx" href="http://msdn2.microsoft.com/en-us/library/aa543822.aspx" target="_blank">http://msdn2.microsoft.com/en-us/library/aa543822.aspx</a></p>
<p>Say we wanted to inherit from &#8220;Page&#8221;, our content type used to look something this (I&#8217;ve split up the lines so it will display properly):</p>
<pre><span style="color: #ff0000;">0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39</span><strong>00</strong>
<span style="color: #0000ff;">188024C0FF7F45CFB85EBB43980DACF5</span></pre>
<p>Meaning, inherit from &#8220;Page&#8221; (the red part), include a delimiter (<strong>00</strong>), and then append a GUID.</p>
<p>If we then wanted to extend this content type, we could do this:</p>
<pre><span style="color: #ff0000;">0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39</span><strong>00</strong>
<span style="color: #0000ff;">188024C0FF7F45CFB85EBB43980DACF5<strong><span style="color: #000000;">00</span></strong>DFA39D91C06D48BDBC415E7CE80A95CD</span></pre>
<p>And so on&#8230; You can imagine how hairy-scary the ContentTypeIDs can get if you wanted your inheritance to go a few levels deep.</p>
<p>As per the article, there is a more efficient way; the second ContentTypeID above could become:</p>
<pre><span style="color: #ff0000;">0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39</span><strong>00</strong>
<span style="color: #0000ff;">188024C0FF7F45CFB85EBB43980DACF5<strong><span style="color: #ff6600;">01</span></strong></span></pre>
<p>Where the tail <strong>01 </strong>is the extended content type. Thus, we could have:</p>
<pre><span style="color: #ff0000;">0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39</span><strong>00</strong>
<span style="color: #0000ff;">188024C0FF7F45CFB85EBB43980DACF5<strong><span style="color: #ff6600;">01</span></strong></span>
<span style="color: #ff0000;">0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39</span><strong>00</strong>
<span style="color: #0000ff;">188024C0FF7F45CFB85EBB43980DACF5<strong><span style="color: #ff6600;">02</span></strong></span>
<span style="color: #ff0000;">0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39</span><strong>00</strong>
<span style="color: #0000ff;">188024C0FF7F45CFB85EBB43980DACF5<strong><span style="color: #ff6600;">03</span></strong></span></pre>
<p>etc.</p>
<p>And then to extend from either of these:</p>
<pre><span style="color: #ff0000;">0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39</span><strong>00</strong>
<span style="color: #0000ff;">188024C0FF7F45CFB85EBB43980DACF5<strong><span style="color: #ff6600;">01<span style="color: #00ff00;">01</span></span></strong></span>
<span style="color: #ff0000;">0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39</span><strong>00</strong>
<span style="color: #0000ff;">188024C0FF7F45CFB85EBB43980DACF5<strong><span style="color: #ff6600;">01<span style="color: #00ff00;">02</span></span></strong></span>
<span style="color: #ff0000;">0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39</span><strong>00</strong>
<span style="color: #0000ff;">188024C0FF7F45CFB85EBB43980DACF5<strong><span style="color: #ff6600;">02<span style="color: #00ff00;">01</span></span></strong></span></pre>
<p>etc.</p>
<p>IMO, this makes the ContentTypeIDs much easier to work with (and read), and we run less risk of running into URL length issues within SharePoint.</p>
<p>PS. The GUIDs used in the above examples have been changed to protect the coder. Any resemblance to any existing ContentTypeIDs are purely coincidental.</p>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2008/02/contenttypeid-syntaxstructure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Web Parts can &#8220;break&#8221; Variations process.</title>
		<link>http://spsherm.uptempoconsulting.com/2007/10/custom-web-parts-can-break-variations-process/</link>
		<comments>http://spsherm.uptempoconsulting.com/2007/10/custom-web-parts-can-break-variations-process/#comments</comments>
		<pubDate>Wed, 24 Oct 2007 19:39:24 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SP2007]]></category>
		<category><![CDATA[Variations]]></category>
		<category><![CDATA[Web Parts]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=133</guid>
		<description><![CDATA[Ok, the title is vague, but there&#8217;s only so much I can put in a title, right? As per MSDN&#8217;s documentation for the Microsoft.SharePoint.WebPartPages class and Andrew&#8217;s post on v3 web parts, we should now inherit from System.Web.UI.WebControls.WebParts.WebPart when we are building custom web parts, except in the four scenarios he mentions (repeating here for my [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, the title is vague, but there&#8217;s only so much I can put in a title, right? <img src='http://www.uptempoconsulting.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>As per MSDN&#8217;s documentation for the <a href="http://msdn2.microsoft.com/en-us/library/ms461685.aspx" target="_blank">Microsoft.SharePoint.WebPartPages</a> class and <a href="http://andrewconnell.com/blog/archive/2006/05/20/3131.aspx" target="_blank">Andrew&#8217;s post on v3 web parts</a>, we should now inherit from <a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpart(VS.80).aspx" target="_blank">System.Web.UI.WebControls.WebParts.WebPart</a> when we are building custom web parts, <em>except </em>in the four scenarios he mentions (repeating here for my own records):</p>
<ol>
<li>Cross page connections</li>
<li>Connections between Web Parts that are outside of a Web Part zone</li>
<li>Client-side connections (Web Part Page Services Component)</li>
<li>A data caching infrastructure that allows caching to the content database</li>
</ol>
<p>However, I came across a situation recently whereby a very simple custom web part (all it did was render a &#8220;Get Adobe Acrobat&#8221; link, essentially) threw a SharePoint error to the screen when used in conjunction with Variations. Here&#8217;s the steps to replicate:</p>
<ol>
<li>
<div>Create your custom web part, inheriting from <code>System.Web.UI.WebControls.WebParts.WebPart</code>. Keep it simple; &#8220;Hello World&#8221; is fine.</div>
</li>
<li>
<div>Build/deploy, etc. Use it in one of your page layouts. Of course, Variations has to be set up/enabled, <strong>but turn off automatic creation of target pages</strong>.</div>
</li>
<li>
<div>Once the new page has been created, select either &#8220;Update Variations&#8221; from the Tools menu.</div>
</li>
<li>
<div>SharePoint will start a long running operation, and then eventually throw an error to the screen.</div>
</li>
<li>
<div>The target variation page is actually created, but this error message is annoying, and probably discomforting to the authors.</div>
</li>
</ol>
<p>It took me a while to figure out what was causing the problem. I finally had a thorough look in the SharePoint logs, and found the message that told me the cause. If you are using <a href="http://www.spsdev.com/ulsreader.aspx" target="_blank">SpsDev&#8217;s ULS Log Reader</a>, filter by Area:CMS, Category:Publishing, or just look for the message &#8220;Unable to cast&#8221;. The relevant part of the message is:</p>
<p><code>Unable to cast object of type '******.Website.SharePoint.WebParts.AdobeLinkWebPart' to type 'Microsoft.SharePoint.WebPartPages.WebPart'</code></p>
<p>Um, what? Why does it want to do that? So&#8230;</p>
<ol>
<li>
<div>Re-write the web part to inherit from <code>Microsoft.SharePoint.WebPartPages.WebPart</code>.</div>
</li>
<li>
<div>Create a new DWP file to match.</div>
</li>
<li>
<div>Deploy, etc; re-test.</div>
</li>
<li>
<div>Of course, it works without the error.</div>
</li>
</ol>
<p>Microsoft&#8217;s own web parts that inherit from <code>System.Web.UI.WebControls.WebParts.WebPart</code> don&#8217;t seem to have the same behaviour. Nevertheless, I believe this to be a bug, but one that you should know about when using custom web parts in conjunction with Variations.</p>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2007/10/custom-web-parts-can-break-variations-process/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>Improving Performance: BlobCache</title>
		<link>http://spsherm.uptempoconsulting.com/2007/08/improving-performance-blobcache/</link>
		<comments>http://spsherm.uptempoconsulting.com/2007/08/improving-performance-blobcache/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 01:25:45 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SP2007]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=91</guid>
		<description><![CDATA[When a SharePoint is application is created, a web.config file is created in the application folder you specified. One of the entries inside the SharePoint element is BlobCache. By default, it looks like this: In order to improve the performance of your site, the BlobCache should be enabled. The maxSize attribute is in GigaBytes, so [...]]]></description>
			<content:encoded><![CDATA[<p>When a SharePoint is application is created, a web.config file is created in the application folder you specified. One of the entries inside the SharePoint element is BlobCache. By default, it looks like this:</p>
<pre class="brush: xml; title: ; notranslate">&lt;BlobCache location=&quot;C:\BlobCache&quot; path=&quot;.(gif|jpg|png|css|js)$&quot; maxSize=&quot;10&quot; enabled=&quot;FALSE&quot; /&gt;</pre>
<p>In order to improve the performance of your site, the BlobCache should be enabled.</p>
<pre class="brush: xml; title: ; notranslate">&lt;BlobCache location=&quot;C:\BlobCache&quot; path=&quot;.(gif|jpg|png|css|js)$&quot; maxSize=&quot;10&quot; enabled=&quot;TRUE&quot; /&gt;</pre>
<p>The maxSize attribute is in GigaBytes, so make sure you have enough room at the location.</p>
<p>Pop quiz: why is it off by default?!</p>
<p>See this article for more information about other caching techniques: <a href="http://blogs.msdn.com/ecm/archive/2006/11/08/how-to-make-your-moss-2007-web-site-faster-with-caching.aspx">http://blogs.msdn.com/ecm/archive/2006/11/08/how-to-make-your-moss-2007-web-site-faster-with-caching.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2007/08/improving-performance-blobcache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SPFormContext</title>
		<link>http://spsherm.uptempoconsulting.com/2007/08/spformcontext/</link>
		<comments>http://spsherm.uptempoconsulting.com/2007/08/spformcontext/#comments</comments>
		<pubDate>Sat, 18 Aug 2007 11:06:31 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SP2007]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=102</guid>
		<description><![CDATA[Argh, Sezai beat me to this post about SPFormContext and SPControlMode by a few hours! I have to admit my sentiment is the same as his - I&#8217;m super stoked to have found this class. Oftentimes, we need some code to execute, but only in the &#8220;published&#8221; state (old MCMS terminology). We might want a component to run [...]]]></description>
			<content:encoded><![CDATA[<p>Argh, <a title="Sezai's Blog" href="/sezai/" target="Sezai">Sezai</a> beat me to this post about <a title="Sezai: FormContext" href="/sezai/archive/2007/08/29/spcontext-current-formcontext.aspx" target="Sezai">SPFormContext and SPControlMode</a> by a few hours! I have to admit my sentiment is the same as his - I&#8217;m super stoked to have found this <a title="MSDN" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spformcontext.aspx" target="MSDN">class</a>.</p>
<p>Oftentimes, we need some code to execute, but only in the &#8220;published&#8221; state (old MCMS terminology). We might want a component to run certain logic, but it&#8217;s really only relevant if the page is in a live/published state. In other words, the logic does not matter when we are viewing the page as authors, editors, or administrators &#8211; we either don&#8217;t care, or we just don&#8217;t want the logic to execute. (Could be vice-versa; execute some code only if we&#8217;re NOT in published state.) </p>
<p>For example, my UE developer asked me to hide all mark-up surrounding a publishing site field. After all, if there isn&#8217;t any content to display, then why bother rendering the DIV tags, or possibly some heading (H) tags? By performing a check for content, we can avoid a situation where a &#8220;News&#8221; header appears, but there&#8217;s nothing it. So, I created a control that wraps around all the mark-up that comprises a UI element/section. If there is no content, the control, and its children, will not render. However, we <em>always</em> want it to render in editing mode; otherwise, we can&#8217;t add content back in! </p>
<p>This scenario was fairly simple to solve: write a control that inherits from <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.basefieldcontrol.aspx">Microsoft.SharePoint.WebControls.BaseFieldControl</a>, and only run the code to check for content if we are in published mode:</p>
<pre class="brush: csharp; title: ; notranslate">if (this.ControlMode == SPControlMode.Display)
{
    // do something.
} 
</pre>
<p>This is all fine and well, since BaseFieldControl can be traced back to <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.formcomponent.aspx" target="_blank">Microsoft.SharePoint.WebControls.FormComponent</a>, which is the last point in the hierarchy that has the ControlMode property. If you go further up the tree, <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.spcontrol.aspx">Microsoft.SharePoint.WebControls.SPControl</a> <em>does not</em> have the ControlMode property&#8230; I have no idea why not.</p>
<p>Why is this a problem? Well, my UE developer wanted to check <em>multiple</em> fields. I could not inherit from BaseFieldControl any longer, since it is meant to represent a single field, not multiple fields. So I decided to inherit from SPControl instead. (In the end, I probably could have inherited from <span style="text-decoration: underline;">System.Web.UI.WebControls.WebControl</span>, but it seemed to make sense to stick within the SharePoint namespace.)</p>
<p>After much searching, including spending a lot of time in Reflector, specifically searching for <span style="text-decoration: underline;">Microsoft.SharePoint.Publishing.WebControls.PageDisplayMode</span> and <span style="text-decoration: underline;">Microsoft.SharePoint.Publishing.WebControls.SPControlMode</span> (both enums), I <em>finally</em> came across this *internal* and *sealed* class in the <span style="text-decoration: underline;">Microsoft.Office.Server.Utilities</span> namespace: <strong>PageUtility</strong>. But we can&#8217;t use it! However, inside PageUtility is a method called <strong>IsPageCurrentlyInSomeEditMode()</strong> (nice, huh?) and more importantly, a property called <strong>FormContextMode</strong>, which returns an SPControlMode object&#8230; interesting.</p>
<p>Looking closer, I saw a line (similar to) SPContext.Current.FormContext.FormMode (!!). As Sezai pointed out, FormContext is an <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spformcontext.aspx">SPFormContext</a> object, which contains two (potentially) very useful properties: <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spformcontext.formmode.aspx">FormMode</a> and <a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spformcontext.fieldcontrolcollection.aspx">FieldControlCollection</a>: </p>
<ul>
<li>
<div><strong>FormMode</strong> gives us a way to check against the enum SPControlMode to determine what &#8220;state&#8221; we&#8217;re in.</div>
</li>
<li>
<div><strong>FieldControlCollection</strong> returns an ArrayList of field controls (skipping all the other server controls on the page).</div>
</li>
</ul>
<p>Now, I can do a check like this: </p>
<pre class="brush: csharp; title: ; notranslate">if (SPContext.Current.FormContext.FormMode == SPControlMode.Display)
{
    // do something.
}</pre>
<p>Also, with <strong>FieldControlCollection</strong>, I can iterate over the list of defined fields for the current page, looking for some specified fields. Nice! SPFormContext is definitely useful, and I&#8217;m surprised there hasn&#8217;t been any postings about it until Sezai came along (try searching for SPFormContext&#8230;).</p>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2007/08/spformcontext/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

