<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Keith Richie</title>
	<atom:link href="http://blog.krichie.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.krichie.com</link>
	<description>Random musings</description>
	<lastBuildDate>Fri, 27 Jan 2012 19:26:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.krichie.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/3619741251beccd2366b17c7698737c6?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Keith Richie</title>
		<link>http://blog.krichie.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.krichie.com/osd.xml" title="Keith Richie" />
	<atom:link rel='hub' href='http://blog.krichie.com/?pushpress=hub'/>
		<item>
		<title>Reorder new Content Type fields on the fly</title>
		<link>http://blog.krichie.com/2011/11/10/reorder-new-content-type-fields-on-the-fly/</link>
		<comments>http://blog.krichie.com/2011/11/10/reorder-new-content-type-fields-on-the-fly/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 18:45:15 +0000</pubDate>
		<dc:creator>Keith Richie</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">https://krichie.wordpress.com/2011/11/10/reorder-new-content-type-fields-on-the-fly/</guid>
		<description><![CDATA[At some point in time you will inevitably need to add a new field to an existing content type programmatically.&#160; For example, adding Lookup column to a Content Type.&#160; You can’t do it within the Content Type CAML if the target list doesn’t exist. It’s common to add the lookup within a FeatureActivated event after [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=268&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>At some point in time you will inevitably need to add a new field to an existing content type programmatically.&#160; For example, adding Lookup column to a Content Type.&#160; You can’t do it within the Content Type CAML if the target list doesn’t exist. It’s common to add the lookup within a FeatureActivated event after the list is created.</p>
<p>This is accomplished quite easily using the Add method of the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontenttype.fieldlinks.aspx">FieldLinks</a> property on the Content Type itself.&#160; The draw back is that the new field is always added to the end of the list, and from a presentation standpoint, this may not be desired.</p>
<p>For example, adding lookups to the content type like so:</p>
<p>&#160;</p>
<pre>
private void CreateDigitalReleasesList(SPWeb web)
{
  SPList list = web.Lists.TryGetList(Constants.DigitalReleasesList_Name);
  if (list == null)
  {
    Guid listID = web.Lists.Add(Constants.DigitalReleasesList_UrlName,
      &quot;Used to record Digital Distributor Releases&quot;,
      SPListTemplateType.GenericList);
    list = web.Lists[listID];
    list.Title = Constants.DigitalReleasesList_Name;
    list.OnQuickLaunch = true;
    list.Update();

    SPList ddList = web.Lists.TryGetList(DistributorsList_Name);
    SPList relList = web.Lists.TryGetList(ReleasesList_Name);

    if (ddList != null &amp;&amp; relList != null)
    {
       SPFieldLookup ddLookup =
         (SPFieldLookup) web.Fields[fieldName_DistributorLookup];
       SPFieldLookup relLookup =
         (SPFieldLookup) web.Fields[fieldName_ReleaseLookup];

       AddFieldToContentType(web,
         contentType_DigitalRelease, ddLookup);
       AddFieldToContentType(web,
         contentType_DigitalRelease, relLookup);
    }

    AssociateContentType(web, Constants.DigitalReleasesList_Name,
      Types.Constants.contentType_DigitalRelease);
  }
}

public static void AddFieldToContentType(SPWeb web, string contentType, SPField field)
{
  SPContentTypeId ctId = new SPContentTypeId(contentType);
  SPContentType ct = web.ContentTypes[ctId];
  ct.FieldLinks.Add(new SPFieldLink(field));
  ct.Update();
}</pre>
<p>Results in the presentation of the fields at the bottom of the form like so:</p>
<p><a href="http://krichie.files.wordpress.com/2011/11/capture.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Capture" border="0" alt="Capture" src="http://krichie.files.wordpress.com/2011/11/capture_thumb.png?w=446&#038;h=429" width="446" height="429" /></a></p>
<p>&#160;</p>
<p>The solution, is to use the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldlinkcollection.reorder.aspx">Reorder</a> method on the FieldLinks collection, however this requires you to layout the names of each field in the array in the order that you want.&#160; If you were to construct this array using literals, that could easily result in unnecessary maintenance of the code when you need to make a change to the column names, etc. during development or updates.</p>
<p>It would be easier to just specify the order of the new field at the time that you link it and be completely generic and frankly agnostic of the field names as much as possible.&#160; Therefore here’s a modified version of the sample code exposed above. Pay particular attention to the modification of AddFieldToContentType.</p>
<pre>
private void CreateDigitalReleasesList(SPWeb web)
{
  SPList list = web.Lists.TryGetList(Constants.DigitalReleasesList_Name);
  if (list == null)
  {
    Guid listID = web.Lists.Add(Constants.DigitalReleasesList_UrlName,
      &quot;Used to record Digital Distributor Releases&quot;,
      SPListTemplateType.GenericList);
    list = web.Lists[listID];
    list.Title = Constants.DigitalReleasesList_Name;
    list.OnQuickLaunch = true;
    list.Update();

    SPList ddList = web.Lists.TryGetList(DistributorsList_Name);
    SPList relList = web.Lists.TryGetList(ReleasesList_Name);

    if (ddList != null &amp;&amp; relList != null)
    {
       SPFieldLookup ddLookup =
         (SPFieldLookup) web.Fields[fieldName_DistributorLookup];
       SPFieldLookup relLookup =
         (SPFieldLookup) web.Fields[fieldName_ReleaseLookup];

       AddFieldToContentType(web,
         contentType_DigitalRelease, ddLookup, 2);
       AddFieldToContentType(web,
         contentType_DigitalRelease, relLookup, 3);
    }

    AssociateContentType(web, Constants.DigitalReleasesList_Name,
      Types.Constants.contentType_DigitalRelease);
  }
}

public static void AddFieldToContentType(SPWeb web, string contentType, SPField field, int order)
{
  SPContentTypeId ctId = new SPContentTypeId(contentType);
  SPContentType ct = web.ContentTypes[ctId];

  // Generate a string array with the existing order of the fields.
  List fieldOrder = new List();
  for (int i = 0; i &lt; ct.FieldLinks.Count; i++)
  {
    fieldOrder.Add(ct.FieldLinks[i].Name);
  }

  // Add the new field.
  ct.FieldLinks.Add(new SPFieldLink(field));
  ct.Update();

  // Now insert the new field in the proper order.
  // You might think you want to decrement the value of order,
  // since the generic list array is zero based, but the first
  // item in the array is the actual &quot;ContentType&quot; field
  // so no decrement is necessary.
  fieldOrder.Insert(order, field.InternalName);
  ct.FieldLinks.Reorder(fieldOrder.ToArray());
  ct.Update();
}</pre>
<p>The end result is similar to the following:</p>
<p><a href="http://krichie.files.wordpress.com/2011/11/capture1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Capture" border="0" alt="Capture" src="http://krichie.files.wordpress.com/2011/11/capture_thumb1.png?w=456&#038;h=438" width="456" height="438" /></a></p>
<p>Hope you find this helpful!</p>
<p>- Keith</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krichie.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krichie.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krichie.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krichie.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krichie.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krichie.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krichie.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krichie.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krichie.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krichie.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krichie.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krichie.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krichie.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krichie.wordpress.com/268/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=268&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.krichie.com/2011/11/10/reorder-new-content-type-fields-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd531eeac5e55ea423271560279c7ada?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Keith Richie</media:title>
		</media:content>

		<media:content url="http://krichie.files.wordpress.com/2011/11/capture_thumb.png" medium="image">
			<media:title type="html">Capture</media:title>
		</media:content>

		<media:content url="http://krichie.files.wordpress.com/2011/11/capture_thumb1.png" medium="image">
			<media:title type="html">Capture</media:title>
		</media:content>
	</item>
		<item>
		<title>When death finds you</title>
		<link>http://blog.krichie.com/2011/10/31/when-death-find-you/</link>
		<comments>http://blog.krichie.com/2011/10/31/when-death-find-you/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 17:53:40 +0000</pubDate>
		<dc:creator>Keith Richie</dc:creator>
		
		<guid isPermaLink="false">https://krichie.wordpress.com/2011/10/31/when-death-find-you/</guid>
		<description><![CDATA[I lie waiting throughout the year, For that one day when I rise, and screams are what I hear. Rising from my grave; ripping through the webbed mesh, As worms burrow through my aging dead flesh. My sinew is your fear, as I wait for you to sleep, Rotting flesh and dripping blood are the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=261&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://krichie.files.wordpress.com/2011/10/death-ipad-wallpaper.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:left;padding-top:0;border-width:0;margin:5px 5px 0 0;" title="death-ipad-wallpaper" border="0" alt="death-ipad-wallpaper" align="left" src="http://krichie.files.wordpress.com/2011/10/death-ipad-wallpaper_thumb.jpg?w=244&#038;h=244" width="244" height="244" /></a>I lie waiting throughout the year,</p>
<p>For that one day when I rise, and screams are what I hear.</p>
<p>Rising from my grave; ripping through the webbed mesh,</p>
<p>As worms burrow through my aging dead flesh.</p>
<p>My sinew is your fear, as I wait for you to sleep,</p>
<p>Rotting flesh and dripping blood are the companions that I keep.</p>
<p>I creep to your home, crawling through the night,</p>
<p>I sneak my way in, and slowly turn out the light.</p>
<p>Your fear of things that go bump in the night,</p>
<p>Leads me to you, drawn close by your fright.</p>
<p>Rotting flesh, crackling bones, and all things of gore,</p>
<p>Fill your dreams, as I slip through your darkened door.</p>
<p>A deathly cold breath, a smell rancid and stale,</p>
<p>Your eyes slowly open, your life leaves in your exhale.</p>
<p>I salivate as I drag you back to my hole,</p>
<p>And I savor, the sweet taste of your innocent soul.</p>
<p>&#160;</p>
<p>Happy Halloween!</p>
<p>Be safe folks!</p>
<p>- Keith</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krichie.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krichie.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krichie.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krichie.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krichie.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krichie.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krichie.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krichie.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krichie.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krichie.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krichie.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krichie.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krichie.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krichie.wordpress.com/261/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=261&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.krichie.com/2011/10/31/when-death-find-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd531eeac5e55ea423271560279c7ada?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Keith Richie</media:title>
		</media:content>

		<media:content url="http://krichie.files.wordpress.com/2011/10/death-ipad-wallpaper_thumb.jpg" medium="image">
			<media:title type="html">death-ipad-wallpaper</media:title>
		</media:content>
	</item>
		<item>
		<title>La Famille Du Sol&#233;no&#239;de &#8211;A Review</title>
		<link>http://blog.krichie.com/2011/10/17/la-famille-du-solnode-a-review/</link>
		<comments>http://blog.krichie.com/2011/10/17/la-famille-du-solnode-a-review/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 11:50:10 +0000</pubDate>
		<dc:creator>Keith Richie</dc:creator>
				<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">https://krichie.wordpress.com/2011/10/17/la-famille-du-solnode-a-review/</guid>
		<description><![CDATA[Sean McDonough recently posted a review of my La Famille Du Solénoïde release on Amazon.&#160; Excerpt: “I&#8217;ve been listening to this release for the last few weeks while I&#8217;ve been working, and I&#8217;ve enjoyed it greatly. I continue to find myself stopping to listen to sections and segments that catch my attention.” Thanks for the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=254&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sean McDonough recently <a href="http://www.amazon.com/review/RFCZUPV7ICQNS/ref=cm_sw_r_fa_asr_e5NHC.0MBBYM1">posted a review</a> of my <a href="http://www.amazon.com/La-Famille-Du-Sol%C3%A9no%C3%AFde/dp/B0019UQB9Y/ref=cm_rdp_product">La Famille Du Solénoïde</a> release on Amazon.&#160; </p>
<p>Excerpt:</p>
<blockquote><p>“I&#8217;ve been listening to this release for the last few weeks while I&#8217;ve been working, and I&#8217;ve enjoyed it greatly. I continue to find myself stopping to listen to sections and segments that catch my attention.”</p>
</blockquote>
<p>Thanks for the kind words Sean!</p>
<p><a href="http://www.amazon.com/review/RFCZUPV7ICQNS/ref=cm_sw_r_fa_asr_e5NHC.0MBBYM1">Read the entire review here!</a> </p>
<p><a href="http://www.amazon.com/La-Famille-Du-Sol%C3%A9no%C3%AFde/dp/B0019UQB9Y/ref=cm_rdp_product">La Famille Du Solénoïde</a> (and other releases) are also available on the majority of Digital Music services such as (but not limited to)</p>
<ul>
<li>Zune</li>
<li>iTunes</li>
<li>Amazon MP3</li>
<li>Spotify</li>
<li>Last.FM</li>
<li>Rhapsody</li>
</ul>
<p>Enjoy!</p>
<p> &#8211; Keith</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krichie.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krichie.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krichie.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krichie.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krichie.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krichie.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krichie.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krichie.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krichie.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krichie.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krichie.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krichie.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krichie.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krichie.wordpress.com/254/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=254&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.krichie.com/2011/10/17/la-famille-du-solnode-a-review/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd531eeac5e55ea423271560279c7ada?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Keith Richie</media:title>
		</media:content>
	</item>
		<item>
		<title>Programmatically waiting on SharePoint Solutions to deploy</title>
		<link>http://blog.krichie.com/2011/09/02/programmatically-waiting-on-sharepoint-solutions-to-deploy/</link>
		<comments>http://blog.krichie.com/2011/09/02/programmatically-waiting-on-sharepoint-solutions-to-deploy/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 18:24:56 +0000</pubDate>
		<dc:creator>Keith Richie</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">https://krichie.wordpress.com/2011/09/02/programmatically-waiting-on-sharepoint-solutions-to-deploy/</guid>
		<description><![CDATA[I recently had the need to deploy multiple solutions via the object model, but of course had to wait for each solution to successfully deploy before moving to the next, etc.&#160; Another requirement is that I needed a common code base that would work on either SharePoint 2007 or SharePoint 2010.&#160; And of course, needed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=245&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently had the need to deploy multiple solutions via the object model, but of course had to wait for each solution to successfully deploy before moving to the next, etc.&#160; Another requirement is that I needed a common code base that would work on either SharePoint 2007 or SharePoint 2010.&#160; And of course, needed to work for a single server installation or a farm.</p>
<p>There are multiple posts out there about interfacing with and examining the running jobs on all servers via the timer service etc., but none of them seemed to work perfectly for me.</p>
<p>One would immediately think just to check SPSolution.Deployed and wait for it to be true before moving on to the next.</p>
<p>In my testing, this works great on SharePoint 2010 in my test environments, but not so well on SharePoint 2007.</p>
<p>For me, I found that not only did I need to check SPSolution.Deployed, but also check SPSolution.JobExists immediately afterwards.&#160; I couldn’t just rely on SPSolution.JobExists, because at times it would be false right after adding the solution (Perhaps because the Job had yet to actually start).</p>
<p>So for me, it was best to first wait until SPSolution.Deployed was true, then wait for SPSolution.JobExists to be false.</p>
<p>This seemed like the simplest method for ensuring the solution was deployed and complete before moving on.</p>
<p>So here’s a bit of a code snippet to show you basically what I’m doing.&#160; The following code assumes you have no specific web application you&#8217;re deploying to</p>
<pre>SPSolution solution =
  SPFarm.Local.Solutions.Add(&quot;pathtomysolution.wsp&quot;);

solution.Deploy(DateTime.Now, true, true);
bool deployed = solution.Deployed;

while (!deployed)
{
  Thread.Sleep(1000);
  deployed = solution.Deployed;
}

bool jobexists = solution.JobExists;

while (jobexists)
{
  Thread.Sleep(1000);
  jobexists = solution.JobExists;
}</pre>
<p>&#160;</p>
<p>With this, I don’t have to muck around with poking at the timer job service on every single server in the farm etc.</p>
<p>I’m curious how this might work in your environments and hope this helps!</p>
<p> &#8211; Keith</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krichie.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krichie.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krichie.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krichie.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krichie.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krichie.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krichie.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krichie.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krichie.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krichie.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krichie.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krichie.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krichie.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krichie.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=245&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.krichie.com/2011/09/02/programmatically-waiting-on-sharepoint-solutions-to-deploy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd531eeac5e55ea423271560279c7ada?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Keith Richie</media:title>
		</media:content>
	</item>
		<item>
		<title>SPIEFolder for SharePoint 2007/2010</title>
		<link>http://blog.krichie.com/2011/08/26/spiefolder-for-sharepoint-20072010/</link>
		<comments>http://blog.krichie.com/2011/08/26/spiefolder-for-sharepoint-20072010/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 23:13:11 +0000</pubDate>
		<dc:creator>Keith Richie</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[My Free Tools]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">https://krichie.wordpress.com/2011/08/26/spiefolder-for-sharepoint-20072010/</guid>
		<description><![CDATA[Due to popular demand, I have now included a compiled version of SPIEFolder 2.0 for Windows SharePoint Services 3.0/Microsoft Office SharePoint Server 2007 along with SharePoint Foundation 2010/SharePoint Server 2010 in the download package for SPIEFolder. For details on this version, see my previous blog post here Hope you enjoy! &#8211; Keith<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=242&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Due to popular demand, I have now included a compiled version of SPIEFolder 2.0 for Windows SharePoint Services 3.0/Microsoft Office SharePoint Server 2007 along with SharePoint Foundation 2010/SharePoint Server 2010 in the <a href="http://blog.krichie.com/my-sharepoint-tools/#spiefolder" target="_blank">download package for SPIEFolder</a>.</p>
<p>For details on this version, see my <a href="http://blog.krichie.com/2011/06/02/spiefolder-for-sharepoint-2010/" target="_blank">previous blog post here</a> </p>
<p>Hope you enjoy!</p>
<p> &#8211; Keith</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krichie.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krichie.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krichie.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krichie.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krichie.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krichie.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krichie.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krichie.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krichie.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krichie.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krichie.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krichie.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krichie.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krichie.wordpress.com/242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=242&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.krichie.com/2011/08/26/spiefolder-for-sharepoint-20072010/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd531eeac5e55ea423271560279c7ada?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Keith Richie</media:title>
		</media:content>
	</item>
		<item>
		<title>You are the weakest link! Not really, I&#8217;m just doing Social Service cleanup.</title>
		<link>http://blog.krichie.com/2011/08/18/you-are-the-weakest-link-not-really-im-just-doing-social-service-cleanup/</link>
		<comments>http://blog.krichie.com/2011/08/18/you-are-the-weakest-link-not-really-im-just-doing-social-service-cleanup/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 18:34:59 +0000</pubDate>
		<dc:creator>Keith Richie</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">https://krichie.wordpress.com/2011/08/18/you-are-the-weakest-link-not-really-im-just-doing-social-service-cleanup/</guid>
		<description><![CDATA[I once questioned myself all the time about what types of content I would put on my primary blog.&#160; Would it all be technical content? Or would it include personal content also, such as my music, etc.&#160; I finally decided that for my primary blog (http://blog.krichie.com) It would be a mix of both, and I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=238&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I once questioned myself all the time about what types of content I would put on my primary blog.&#160; Would it all be technical content? Or would it include personal content also, such as my music, etc.&#160; I finally decided that for my primary blog (<a href="http://blog.krichie.com">http://blog.krichie.com</a>) It would be a mix of both, and I would use appropriate content tagging so you could easily filter on what you wanted to see.&#160; As well, a lot of folks way back when told me they enjoyed seeing the lighter side of me, so I stood with&#160; that.</p>
<p>If you haven’t visited my blog in a while, you may have noticed that it no longer states “That SharePoint Guy” as it once did.&#160; Instead I just changed it to “Random Musings”. I did that for a couple of reasons:</p>
<ul>
<li>For a long time, I was not even doing much SharePoint work.&#160; It didn’t make sense to proclaim myself as that “SharePoint Guy” any longer.</li>
<li>I’d say 50% of my content has nothing to do with SharePoint.</li>
</ul>
<p>Now this doesn’t mean that I’m not going to continue to post SharePoint content, by all means, when I feel I’ve got something to say about the subject I most certainly will.&#160; The folks that follow me in the SharePoint field there, have done so for a long time, and when I post SharePoint content there, it’s not to win some popularity contest, but to rather share my findings and hopefully help others.&#160; I do however, get a kick on how some of my SharePoint posts are either a) trackbacked, b) found helpful, c) used to answer forum questions, d) completely repurposed and plagiarized at times.</p>
<p>Regardless, I think the new branding represents me better than the last. Which brings me to the subject of this post.&#160; </p>
<blockquote><p><strong>“How does one define the reason behind the use of any given Social Service?”</strong></p>
</blockquote>
<p>I’ve decided over months of debating about it, to clean up my Facebook friends list.&#160; The reason?&#160; I don’t really know half the people in my friends list there.</p>
<p>When I first joined Facebook, literally none of my family or non-technical friends had any presence there.&#160; I joined simply because all of my other SharePoint peeps where there.&#160; I used it as an addition to my “Technical/Professional” presence in the web-sphere.&#160; I would accept almost any friend request from someone in the SharePoint field.</p>
<p>Of course over time, my family and non-technical friends jumped on the bandwagon with Facebook, etc… but I continued to almost just automatically “Add” some one based on their request, because I saw they were a member of the SharePoint community.</p>
<p>Here’s the problem though…I no longer use Facebook as a primary professional/technical representation of me.&#160; It’s completely casual.&#160; Does anyone in the SharePoint field truly get ANY kind of real value from my Facebook page?&#160; I doubt it very seriously, unless it’s simply a note post from my SharePoint blog postings, or twitter copy from a SharePoint related tweet I’ve made.</p>
<p>Another reason, is there is just too much noise in my Facebook feed from people.&#160; Sure, I could utilize custom feeds/lists in Facebook more, but that is just WAY too much trouble to do, to individually select people, remove people, sort those lists etc.&#160; But I DO enjoy leaving the page open, and occasionally seeing interesting tidbits…but I have to filter through a lot of crap, from people I just don’t really know before I see it.</p>
<p>I’ve decided to go ahead and start trimming down my list.&#160;&#160; I made the following post on my wall on Facebook this morning as this:</p>
<blockquote><p><strong>“Hmm, thinking of cleaning up my friends list. I have a lot of people on the list whom have added me simply because they are in my field, but I don&#8217;t really know them. No offense, but if you get removed, don&#8217;t take it personally. It probably means we haven&#8217;t interacted at all since being added. I won&#8217;t be so eager to hit that accept from folks in the future, just because I see your involved in the SharePoint field. Besides, for any real SharePoint content from me, just see my blog.”</strong></p>
</blockquote>
<p>It’s been interesting seeing some of the comments show up, and the emails I’ve gotten going “Why, but why!”</p>
<p>Well, like I said…Don’t take it personally!&#160; I just want to trim it some.&#160; If by chance you get removed, just simply send me another request..BUT when you do, include the reason why you’re requesting?&#160; Is it somewhere along the lines of:</p>
<ul>
<li>Hey, remember me? We met at that SharePoint event back in, blah blah.&#160; I’d like to be added back, because I enjoy seeing your wild and crazy posts”</li>
<li>Hey, we used to work together at Microsoft, or this, or that.</li>
<li>Some other good reason on how I know you, or we’ve interacted with in the past.</li>
</ul>
<p>I’m not opposed to adding you back in, but I can’t remember half the names that are there.&#160; It’s not a YOU thing, it’s a me thing.&#160; If you find my wall posts on Facebook enjoyable, etc, or can give me a reason why we should be friends, by all means, send me a request.</p>
<p>Otherwise, if it’s just because your interested in my SharePoint related stuff, simply follow me on this blog, or twitter.</p>
<p>The bottom line is, I’m no longer using Facebook as one of my primary Professional/Technical content source points.&#160; If I don’t really know you, I don’t see a reason to have you listed.&#160; I don’t need to have 2000 friends on Facebook.</p>
<p>For instance, look at LinkedIn.&#160; I don’t think I have it configured for ANY content consumption from Twitter, etc.&#160; It’s just a standalone professional footprint for me.</p>
<p>As far as Twitter?&#160; I dual purpose it for professional/personal and for the most part, I don’t see a drop in my followers. </p>
<p>Bottom line, for my complete professional representation, I would look to my LinkedIn and Blog sites.&#160; The rest might just be noise for you.</p>
<p>Some may still find this harsh, and I don’t mean it to be that way.&#160; It’s just me re-aligning my social services the way I feel they are best suited.</p>
<p>You are NOT the weakest link <img style="border-style:none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://krichie.files.wordpress.com/2011/08/wlemoticon-smile.png?w=600" /> I’m just doing some social service cleanup.</p>
<p>I’m curious to how you use the various social services at your disposal?</p>
<p>- Keith</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krichie.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krichie.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krichie.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krichie.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krichie.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krichie.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krichie.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krichie.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krichie.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krichie.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krichie.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krichie.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krichie.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krichie.wordpress.com/238/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=238&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.krichie.com/2011/08/18/you-are-the-weakest-link-not-really-im-just-doing-social-service-cleanup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd531eeac5e55ea423271560279c7ada?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Keith Richie</media:title>
		</media:content>

		<media:content url="http://krichie.files.wordpress.com/2011/08/wlemoticon-smile.png" medium="image">
			<media:title type="html">Smile</media:title>
		</media:content>
	</item>
		<item>
		<title>Carbon Based Lifeforms&#8211;Music to code by</title>
		<link>http://blog.krichie.com/2011/07/22/carbon-based-lifeformsmusic-to-code-by/</link>
		<comments>http://blog.krichie.com/2011/07/22/carbon-based-lifeformsmusic-to-code-by/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 13:58:36 +0000</pubDate>
		<dc:creator>Keith Richie</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">https://krichie.wordpress.com/2011/07/22/carbon-based-lifeformsmusic-to-code-by/</guid>
		<description><![CDATA[Every once and a while you come across a band that seems to just click with you. It was about this time last year when I discovered Carbon Based Lifeforms (CBL), and I have been completely hooked on them ever since.&#160; In fact, I like a lot of the stuff from the groups signed with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=233&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;float:left;border-top:0;border-right:0;padding-top:0;margin:5px 10px 5px 5px;" border="0" align="left" src="http://userserve-ak.last.fm/serve/500/236162/Carbon+Based+Lifeforms.jpg" width="221" height="221" />Every once and a while you come across a band that seems to just click with you. It was about this time last year when I discovered <a href="http://en.wikipedia.org/wiki/Carbon_Based_Lifeforms" target="_blank">Carbon Based Lifeforms</a> (CBL), and I have been completely hooked on them ever since.&#160; In fact, I like a lot of the stuff from the groups signed with <a href="http://www.ultimae.com/en/composers/index.html" target="_blank">Ultimae</a>, but it’s CBL I sink most of my money into.&#160; It’s been a long time that just about every single release of a given group has moved me the way CBL has.&#160; For me, they are just frakin’ awesome.</p>
<p>&#160;</p>
<p>&#160;</p>
<p>It was a post <a href="http://en.wikipedia.org/wiki/Bassic" target="_blank">Martin Lindhe</a> (a.k.a. Bassic) had posted on his Facebook wall that turned me onto CBL.&#160; It went something to the effect of “Can’t seem to get Interloper by CBL out of constant rotation lately”, or something like that.&#160; So I went and checked out <a href="http://www.amazon.com/Interloper/dp/B003L0NXV4/ref=ntt_mus_dp_dpt_1" target="_blank">Interloper</a> and I was hooked.&#160; I immediately turned back around and swooped up <a href="http://www.amazon.com/World-Of-Sleepers/dp/B000ZST792/ref=pd_sim_dmusic_a_1" target="_blank">World of Sleepers</a> and <a href="http://www.amazon.com/Hydroponic-Garden/dp/B000YOT9XG/ref=pd_sim_dmusic_a_2" target="_blank">Hydroponic Garden</a>.&#160; And I’m dying to get my hands on <a href="http://www.amazon.com/Twentythree/dp/B005DBQZ5U/ref=sr_shvl_album_2?ie=UTF8&amp;qid=1311342493&amp;sr=301-2" target="_blank">Twentythree</a>.</p>
<p>I can honestly say, that at some point during each day when I’m coding, I shuffle up my collection of CBL to code by.</p>
<p>If you are into Ambient Music, I highly recommend you check them out.</p>
<p>I certainly like all their tracks, but probably my favorites are listed below if you want a direct sampling of their music:</p>
<ul>
<li><a href="http://www.youtube.com/watch?v=UtPTvyjtx3g" target="_blank">MOS 6581</a></li>
<li><a href="http://www.youtube.com/watch?v=zrduIntJN10" target="_blank">Interloper</a></li>
<li><a href="http://www.youtube.com/watch?v=v1LjzzyKCLc" target="_blank">Supersede</a></li>
<li><a href="http://www.youtube.com/watch?v=eo_QkSO4AJg" target="_blank">Init</a></li>
<li><a href="http://www.youtube.com/watch?v=DYTRjYC44PU" target="_blank">Frog</a> (Absolutely LOVE this one)</li>
<li><a href="http://www.youtube.com/watch?v=9eyg3QydFhE" target="_blank">Polyrytmi</a></li>
<li><a href="http://www.youtube.com/watch?v=LoKt4vhJ-c0" target="_blank">Abiogenesis</a></li>
<li><a href="http://www.youtube.com/watch?v=IE3UmlvM63Y" target="_blank">Vortex</a></li>
<li><a href="http://www.youtube.com/watch?v=13w3WDaGHTo" target="_blank">Set Theory</a></li>
<li><a href="http://www.youtube.com/watch?v=QF-753xKWC4" target="_blank">Gryning</a></li>
<li><a href="http://www.youtube.com/watch?v=HJe7oT3J798" target="_blank">Betula Pendula</a></li>
</ul>
<p>I hope you enjoy!</p>
<p> &#8211; Keith</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krichie.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krichie.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krichie.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krichie.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krichie.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krichie.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krichie.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krichie.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krichie.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krichie.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krichie.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krichie.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krichie.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krichie.wordpress.com/233/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=233&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.krichie.com/2011/07/22/carbon-based-lifeformsmusic-to-code-by/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd531eeac5e55ea423271560279c7ada?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Keith Richie</media:title>
		</media:content>

		<media:content url="http://userserve-ak.last.fm/serve/500/236162/Carbon+Based+Lifeforms.jpg" medium="image" />
	</item>
		<item>
		<title>Celebrating the Ultimate Answer to Life, The Universe and Everything.</title>
		<link>http://blog.krichie.com/2011/07/06/celebrating-the-ultimate-answer-to-life-the-universe-and-everything/</link>
		<comments>http://blog.krichie.com/2011/07/06/celebrating-the-ultimate-answer-to-life-the-universe-and-everything/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 14:28:28 +0000</pubDate>
		<dc:creator>Keith Richie</dc:creator>
		
		<guid isPermaLink="false">https://krichie.wordpress.com/2011/07/06/celebrating-the-ultimate-answer-to-life-the-universe-and-everything/</guid>
		<description><![CDATA[Most people have New Years Resolutions, but not really me.&#160; Instead, each year on this day, is when I take a moment and plan my goals for the next year ahead of me. This particular year, I get to celebrate the Ultimate Answer to Life, The Universe and Everything. Every year (primarily on this day) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=230&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Most people have New Years Resolutions, but not really me.&#160; </p>
<p>Instead, each year on this day, is when I take a moment and plan my goals for the next year ahead of me.</p>
<p>This particular year, I get to celebrate the <a href="http://www.facebook.com/l.php?u=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DLtm583i6Gek%26t%3D4m2s&amp;h=eAQCXao3Y" target="_blank">Ultimate Answer to Life, The Universe and Everything</a>.</p>
<p>Every year (primarily on this day) but also on Christmas, I hop into my car; take a long drive; pass through the neighborhood I grew up in; and <a href="http://www.youtube.com/watch?v=mm96sE8PkIk" target="_blank">listen to one of the most inspirational (in my opinion of course) music releases in my collection.</a>&#160;&#160; When I’m finished with that one, I immediately plug in the <a href="http://www.amazon.com/Pacific-Coast-Highway-Christopher-Franke/dp/B00000636M" target="_blank">second most inspirational one</a> (And always end with <a href="http://www.youtube.com/watch?v=XN9xJrapy9c" target="_blank">this very special track</a>).</p>
<p>It’s something I’ve done now for nearly 30 years.</p>
<p>So I got up early this morning, to try to get most of my work for the day done.&#160; Clearing my “todo” list so that I can head out with a clear mind; to drive; to meditate; to reflect; to look at where I’ve been; and to look forward to what the future has in store for me.</p>
<p>Generally during my ritual drive, I think of many of the bad things that have happened, and the many mistakes I’ve made throughout life.&#160; Those bring me down a bit.&#160; But I put a concentrated effort to focus on ALL of the MANY positive things that have occurred.</p>
<p>As I sit here writing this, I’m waiting on my youngest child to get dressed to take her off to daycare for the day, and then head out for my “trip” down memory lane.&#160; And I’m reminded by the ultimate positive thing in my life.&#160; The fact that I have two very wonderful daughters in my life.&#160; And many, many more.</p>
<p>Do YOU have a ritual you perform every year? I’m curious to know.</p>
<p> &#8211; Keith</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krichie.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krichie.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krichie.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krichie.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krichie.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krichie.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krichie.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krichie.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krichie.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krichie.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krichie.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krichie.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krichie.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krichie.wordpress.com/230/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=230&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.krichie.com/2011/07/06/celebrating-the-ultimate-answer-to-life-the-universe-and-everything/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd531eeac5e55ea423271560279c7ada?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Keith Richie</media:title>
		</media:content>
	</item>
		<item>
		<title>Programmatically reading SharePoint Designer Workflow XOML files at run time.</title>
		<link>http://blog.krichie.com/2011/07/05/programmatically-reading-sharepoint-designer-workflow-xoml-files-at-run-time/</link>
		<comments>http://blog.krichie.com/2011/07/05/programmatically-reading-sharepoint-designer-workflow-xoml-files-at-run-time/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 17:25:48 +0000</pubDate>
		<dc:creator>Keith Richie</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">https://krichie.wordpress.com/2011/07/05/programmatically-reading-sharepoint-designer-workflow-xoml-files-at-run-time/</guid>
		<description><![CDATA[I’m working on a project where I need to read the actual XOML file for a SharePoint Designer workflow at runtime during a few of my custom activities I’m developing.&#160; The reason, is that I have to enumerate and inspect all the workflow variables the end user has defined.&#160; The only way to do this, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=228&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I’m working on a project where I need to read the actual XOML file for a SharePoint Designer workflow at runtime during a few of my custom activities I’m developing.&#160; The reason, is that I have to enumerate and inspect all the workflow variables the end user has defined.&#160; The only way to do this, is to actually peek back into the XOML file for the workflow.</p>
<p>After poking around and searching for a few days without any luck, I ran across this posting from Joe Zamora: “<a href="http://c--shark.blogspot.com/2010/03/queryenumerate-all-declarative-workflow.html" target="_blank">Query/enumerate all declarative workflow templates in an SPWeb and programmatically read the XOML files</a>”</p>
<p>Perfect! I thought.&#160; This was exactly what I was looking for. I took his sample, cleaned it up a bit, and wrote a method to get to the XOML file.&#160; </p>
<p>&#160;</p>
<pre>public static string
  GetXOMLFromWorkflowInstance(SPListItem item, Guid wfInstanceId)
  {
    SPWorkflow wf = new SPWorkflow(item, wfInstanceId);
    SPWorkflowAssociation assoc =
      item.ParentList.WorkflowAssociations[wf.AssociationId];

    XmlDocument doc = new XmlDocument();
    doc.Load(new StringReader(assoc.SoapXml));

    XmlNode node = doc.SelectSingleNode(&quot;/WorkflowTemplate&quot;);
    XmlAttribute attribute = node.Attributes[&quot;Name&quot;];
    string wfName = attribute.Value.Replace(&quot; &quot;, &quot;%20&quot;);
    string webRelativeFolder = &quot;Workflows/&quot; + wfName;
    string xomlFileName = wfName + &quot;.xoml&quot;;

    SPFolder wfFolder = assoc.ParentWeb.GetFolder(webRelativeFolder);
    SPFile xomlFile = wfFolder.Files[xomlFileName];

    doc = new XmlDocument();
    using (Stream xomlStream = xomlFile.OpenBinaryStream())
    {
      doc.Load(xomlStream);
    }
    return doc.OuterXml;
  }</pre>
<p>&#160;</p>
<p>As you can see the workflow’s folder and file names, when initially saved, utilize the name you defined in SharePoint Designer. So, if I create a workflow and call it “My Cool Workflow”, then a folder get’s created in the Workflows folder of the site with the name “My Cool Workflow”, and it’s resulting .xoml file is stored within that folder with the name.&#160; So it’s pretty easy to construct the path to the xoml file from that.</p>
<p>All was grand for about 1 hour.</p>
<p>And then….</p>
<p>While demonstrating the latest build to a customer, we renamed the workflow between a test, and everything broke.&#160; After a bit of debugging, I figured out what the problem was.</p>
<p>The method above depends on the “Name” attribute within the WorkflowTemplate element to derive it’s path to the underlying XOML file in the site.&#160; The problem, as I mentioned above, revealed itself when we renamed the workflow.&#160; The name attribute could no longer be relied on as it possibly will NOT match the underlying workflow folder container, etc.&#160; The workflow folder/.xoml etc will always keep the original name.&#160; So, taking the example of the workflow originally being named “My Cool Workflow” and changing it to anything else doesn’t change the fact that the workflow will forever be stored in a folder called “My Cool Workflow”.</p>
<p>So, back to the drawing board for a few days trying once again to figure out HOW to get back to the XOML file itself.&#160; As Joe found, the Object Model just doesn’t do a very good job of actually letting you determine that (that I know of), but then I noticed something in the SoapXml of the workflow association.&#160; Aha!&#160;&#160; It contains an Instantiation_FormURI element that has the path to the xsn of the instantiation form.&#160; Well hey!&#160; We can just use that, replace .xsn with .xoml and we’re back in the game.</p>
<p>&#160;</p>
<pre>public static string
  GetXOMLFromWorkflowInstance(SPListItem item, Guid wfInstanceId)
  {
    SPWorkflow wf = new SPWorkflow(item, wfInstanceId);
    SPWorkflowAssociation assoc =
      item.ParentList.WorkflowAssociations[wf.AssociationId];

    XmlDocument doc = new XmlDocument();
    doc.Load(new StringReader(assoc.SoapXml));

    XmlNode node =
     doc.SelectSingleNode(&quot;/WorkflowTemplate/Metadata/Instantiation_FormURI/string&quot;);

    string xsnPath = node.InnerText;
    xsnPath = xsnPath.Replace(&quot; &quot;, &quot;%20&quot;);

    string webRelativeFolder =
      xsnPath.Substring(0, xsnPath.LastIndexOf('/'));
    string xomlFileName =
      xsnPath.Substring(xsnPath.LastIndexOf('/') + 1);
    xomlFileName =
      xomlFileName.Replace(&quot;.xsn&quot;, &quot;.xoml&quot;);

    SPFolder wfFolder = assoc.ParentWeb.GetFolder(webRelativeFolder);
    SPFile xomlFile = wfFolder.Files[xomlFileName];

    doc = new XmlDocument();
    using (Stream xomlStream = xomlFile.OpenBinaryStream())
    {
      doc.Load(xomlStream);
    }
    return doc.OuterXml;
  }</pre>
<p>The only concern I had with this approach, is what if there wasn’t an instantiation form?&#160; Well, it turns out that SharePoint Designer won’t ALLOW you to not have one, even if it doesn’t contain anything.&#160; If you delete the instantiation form, then save the workflow again, it will just generating it one more time.&#160; So we’re guaranteed to have an Instantiation_FormURI element within SPWorkflowAssociation.SoapXml.</p>
<p>Hope this helps someone else!</p>
<p><font color="#ff0000"><strong>[Update: 07/08/2011]</strong></font></p>
<p>Well apparently the mandatory instantiation form does <strong>NOT</strong> exist by default in SharePoint Designer 2007 workflows, so it currently is NOT a reliable way for it.</p>
<p><font color="#ff0000"><strong>[Update: 07/20/2011]</strong></font></p>
<p>For SharePoint Designer 2007 workflows, it looks like you can depend on the “InitiationUrl” attribute.</p>
<p>The updated method I wrote for 2007 looks similar to this:</p>
<p>&#160;</p>
<pre>public static string
  GetXOMLFromWorkflowInstance(SPListItem item, Guid wfInstanceId)
  {
    SPWorkflow wf = new SPWorkflow(item, wfInstanceId);
    SPWorkflowAssociation assoc =
      item.ParentList.WorkflowAssociations[wf.AssociationId];

    XmlDocument doc = new XmlDocument();
    doc.Load(new StringReader(assoc.SoapXml));

    XmlNode node = doc.SelectSingleNode(&quot;/WorkflowTemplate&quot;);

    string xsnPath = node.Attributes[&quot;InstantiationUrl&quot;].Value;
    xsnPath = xsnPath.Replace(&quot; &quot;, &quot;%20&quot;);

    string webRelativeFolder =
      xsnPath.Substring(0, xsnPath.LastIndexOf('/'));
    string xomlFileName =
      xsnPath.Substring(xsnPath.LastIndexOf('/') + 1);
    xomlFileName = xomlFileName.Replace(&quot;.aspx&quot;, &quot;.xoml&quot;);

    SPFolder wfFolder = assoc.ParentWeb.GetFolder(webRelativeFolder);
    SPFile xomlFile = wfFolder.Files[xomlFileName];

    doc = new XmlDocument();
    using (Stream xomlStream = xomlFile.OpenBinaryStream())
    {
      doc.Load(xomlStream);
    }
    return doc.OuterXml;
  }</pre>
<p>- Keith</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krichie.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krichie.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krichie.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krichie.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krichie.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krichie.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krichie.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krichie.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krichie.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krichie.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krichie.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krichie.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krichie.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krichie.wordpress.com/228/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=228&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.krichie.com/2011/07/05/programmatically-reading-sharepoint-designer-workflow-xoml-files-at-run-time/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd531eeac5e55ea423271560279c7ada?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Keith Richie</media:title>
		</media:content>
	</item>
		<item>
		<title>SPIEFolder for SharePoint 2010</title>
		<link>http://blog.krichie.com/2011/06/02/spiefolder-for-sharepoint-2010/</link>
		<comments>http://blog.krichie.com/2011/06/02/spiefolder-for-sharepoint-2010/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 00:13:04 +0000</pubDate>
		<dc:creator>Keith Richie</dc:creator>
				<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">https://krichie.wordpress.com/2011/06/02/spiefolder-for-sharepoint-2010/</guid>
		<description><![CDATA[In between Scarborough on Saturday, setting up a new pool on Sunday, and finishing a good roast in the sun on Memorial Day, I put the final touches on an update to one of my older tools SPIEFolder. This tool allows you to either Import a file system folder (And all files and optionally subfolders) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=220&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In between Scarborough on Saturday, setting up a new pool on Sunday, and finishing a good roast in the sun on Memorial Day, I put the final touches on an update to one of my older tools <a href="http://blog.krichie.com/my-sharepoint-tools/#spiefolder" target="_blank">SPIEFolder</a>. </p>
<p>This tool allows you to either Import a file system folder (And all files and optionally subfolders) into a SharePoint Document Library, and also export a SharePoint Document Library or a complete site’s content to the file system for SharePoint Foundation 2010 and SharePoint Server 2010. This tool completely replicates the document libraries folder hierarchy to the file system when exporting, and replicates the folder hierarchy from the file system to the document library when importing.</p>
<p>I noticed a backlog of requests on the old location for it, so I tried to incorporate most that I could, as well as updating the user interface to be a bit more consistent with everything else I’ve written.</p>
<p>The new features for SPIEFolder 2.0 are as follows:</p>
<ul>
<li>Reworked interface and built for SharePoint 2010. </li>
<li>Added –recursive as an option, previous version always ran recursively</li>
<li>Added –overwrite switch to allow files to be overwritten. Previous version would always warn.</li>
<li>Added –quiet switch to suppress output.</li>
</ul>
<p>The 2.0 release is also only released in binary form.</p>
<p>I was also going to create PowerShell Cmdlets for the import/export features in this release but have decided to hold off on that for a bit, as I’m considering re-working most of my tools into a shared set of objects/cmdlets within a larger toolset (More information on that at a later time).</p>
<p>As well, I’ve created a new page on my blog as the current source point to get to all of my free tools, etc.&#160; See <a href="http://blog.krichie.com/my-sharepoint-tools/" target="_blank">My SharePoint Tools</a>.&#160; From this page you can get a brief synopsis on my current toolset, along with links to the location of said tools.&#160; To get to the direct reference for SPIEFolder and the link to download, <a href="http://blog.krichie.com/my-sharepoint-tools/#spiefolder" target="_blank">just click here</a>.</p>
<p>I’d love to hear your feedback on this version of SPIEFolder!&#160; Let me know what you think!</p>
<p>- Keith</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/krichie.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/krichie.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/krichie.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/krichie.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/krichie.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/krichie.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/krichie.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/krichie.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/krichie.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/krichie.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/krichie.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/krichie.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/krichie.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/krichie.wordpress.com/220/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.krichie.com&amp;blog=617816&amp;post=220&amp;subd=krichie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.krichie.com/2011/06/02/spiefolder-for-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cd531eeac5e55ea423271560279c7ada?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Keith Richie</media:title>
		</media:content>
	</item>
	</channel>
</rss>
