<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.zevenseas.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.zevenseas.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><!--RSS generated by Windows SharePoint Services V3 RSS Generator on 7/23/2008 8:59:01 PM--><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Robin | zevenseas | SharePoint Blog</title><link>http://community.zevenseas.com/Blogs/Robin</link><description>RSS feed for the Posts list.</description><lastBuildDate>Thu, 24 Jul 2008 03:59:01 GMT</lastBuildDate><generator>SharePoint CKS:EBE</generator><ttl>60</ttl><image><title>Robin | zevenseas | SharePoint Blog</title><url>http://community.zevenseas.com/Blogs/Robin/_layouts/images/homepage.gif</url><link>http://community.zevenseas.com/Blogs/Robin</link></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.zevenseas.com/blogs_robin" type="application/rss+xml" /><feedburner:emailServiceId>1686768</feedburner:emailServiceId><feedburner:feedburnerHostname>http://www.feedburner.com</feedburner:feedburnerHostname><item><title>Creating and configuring sites programmatically.. I love it!</title><link>http://feeds.zevenseas.com/~r/blogs_robin/~3/338128621/creating-and-configuring-sites-programmatically-i-love-it.aspx</link><guid isPermaLink="false">/Blogs/Robin/archive/2008/07/17/creating-and-configuring-sites-programmatically-i-love-it.aspx</guid><description>&lt;div class="ExternalClassA373902AA1B249C3B06E2479BE51D876"&gt;&lt;p&gt;In this week I was busy with creating a webservice that automatically would create new sitecollections and subsites for a given webapplication and other parameters. Nothing fancy here right? Well.. building a webservice and hosting it in SharePoint (in my case in the LAYOUTS folder) wasn’t that easy, unless you figure out how to do it ;) The steps you have to go through, are the following :&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Add a reference to your custom assembly in the markup of the webservice page as follows&lt;/li&gt;    &lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ WebService Language=&amp;quot;C#&amp;quot; CodeBehind=&amp;quot;CustomWebService.asmx.cs&amp;quot; Class=&amp;quot;zevenseas.SharePoint.WebServices.CustomWebService&amp;quot; %&amp;gt;&lt;/span&gt;
&lt;span class="asp"&gt;&amp;lt;%@ Assembly Name=&amp;quot;zevenseas.SharePoint.WebServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=00000000000&amp;quot; %&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;style&gt;
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode, .ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode pre
{font-size:small;color:black;font-family:consolas, &amp;quot;Courier New&amp;quot;, courier, monospace;background-color:#ffffff;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode pre
{margin:0em;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .rem
{color:#008000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .kwrd
{color:#0000ff;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .str
{color:#006080;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .op
{color:#0000c0;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .preproc
{color:#cc6633;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .asp
{background-color:#ffff00;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .html
{color:#800000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .attr
{color:#ff0000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .alt
{background-color:#f4f4f4;width:100%;margin:0em;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .lnum
{color:#606060;}
&lt;/style&gt;

  &lt;li&gt;Deploy the webservice to the LAYOUTS folder, download the tool &lt;a href="http://www.codeproject.com/KB/XML/wss_web_service_helper.aspx"&gt;WSSWebServicePackager&lt;/a&gt; and make sure you have the &lt;a href="http://msdn.microsoft.com/en-us/library/cy2a3ybs(VS.80).aspx"&gt;Disco&lt;/a&gt; tool nearby (I had to download the first VS2005 SDK to get it) and put the created WSDL and Disco .ASPX’s next to the webservice. &lt;/li&gt;

  &lt;li&gt;Create a console application, add a web reference to your custom webservice and you can use the custom webservice!&lt;/li&gt;

  &lt;li&gt;(optional : every time you modify the webservice you have to repeat step 2 to get it working)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, since we have the webservice setup properly we can build something beautiful! I created the following methods:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;CreateNewSitecollection&lt;/li&gt;

  &lt;li&gt;CreateNewSite&lt;/li&gt;

  &lt;li&gt;UpdateSite&lt;/li&gt;

  &lt;li&gt;DeleteSite&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;During the creation of a site, I make use of a custom sitedefinition that contains some document libraries and a contact list. Now the requirement was to have a lookup column in each document library to the contacts list. Plus some additional columns were required as well. Doing this using a sitedefinition is quite hard so I decided to by it code and I was surprised how easy it was. Check the code below to see how it works :&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; UpdateDocumentLibrary(SPList documentLibrary, List&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; choices)
{
    &lt;span class="rem"&gt;//Here we add the columns to the document library, the first one is a 'simple' choice column         &lt;/span&gt;
    documentLibrary.Fields.Add(fieldInternalNameSoort, SPFieldType.Choice, &lt;span class="kwrd"&gt;true&lt;/span&gt;);                            
    SPFieldChoice soortField = (SPFieldChoice)documentLibrary.Fields[fieldInternalNameSoort];
    &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (&lt;span class="kwrd"&gt;string&lt;/span&gt; choice &lt;span class="kwrd"&gt;in&lt;/span&gt; choices)
    {
        soortField.Choices.Add(choice);               
    }
    soortField.Update();

    &lt;span class="rem"&gt;//This is the tricky bit, adding a lookup column to an existing list&lt;/span&gt;
    SPList contactList = documentLibrary.ParentWeb.Lists[&lt;span class="str"&gt;&amp;quot;Contacts&amp;quot;&lt;/span&gt;];
    documentLibrary.Fields.AddLookup(&lt;span class="str"&gt;&amp;quot;Contacts&amp;quot;&lt;/span&gt;, contactList.ID, &lt;span class="kwrd"&gt;false&lt;/span&gt;);            
    SPFieldLookup contactLookUp = (SPFieldLookup)documentLibrary.Fields[&lt;span class="str"&gt;&amp;quot;Contacts&amp;quot;&lt;/span&gt;];
    contactLookUp.LookupField = contactList.Fields[&lt;span class="str"&gt;&amp;quot;Last Name&amp;quot;&lt;/span&gt;].Title;

    &lt;span class="rem"&gt;//We update the document library to make sure that the columns are added&lt;/span&gt;
    documentLibrary.Update();

    &lt;span class="rem"&gt;//Now to add the columns to the default view of the document library we do the following            &lt;/span&gt;
    SPView addSoortColumnTodefaultView = documentLibrary.DefaultView;
    addSoortColumnTodefaultView.ViewFields.Add(fieldInternalNameSoort);
    addSoortColumnTodefaultView.Update();

    SPView addContactsColumnTodefaultView = documentLibrary.DefaultView;
    addContactsColumnTodefaultView.ViewFields.Add(fieldInternalNameContact);
    addContactsColumnTodefaultView.Update();
}&lt;/pre&gt;
&lt;style&gt;
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode, .ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode pre
{font-size:small;color:black;font-family:consolas, &amp;quot;Courier New&amp;quot;, courier, monospace;background-color:#ffffff;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode pre
{margin:0em;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .rem
{color:#008000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .kwrd
{color:#0000ff;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .str
{color:#006080;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .op
{color:#0000c0;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .preproc
{color:#cc6633;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .asp
{background-color:#ffff00;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .html
{color:#800000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .attr
{color:#ff0000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .alt
{background-color:#f4f4f4;width:100%;margin:0em;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .lnum
{color:#606060;}
&lt;/style&gt;

&lt;p&gt;The thing that I was struggling with the longest was to add the newly created columns to the default view. Thanks to &lt;a href="http://sharepoint.bryanfriedman.com"&gt;Bryan Friedman&lt;/a&gt; I managed to solve it, check out his post on &lt;a title="Permanent Link to Con-view-sed" href="http://sharepoint.bryanfriedman.com/index.php/2008/04/09/con-view-sed/"&gt;how to do this&lt;/a&gt;. Thanks Bryan! ;)&lt;/p&gt;

&lt;p&gt;Next thing I wanted to do was adding some custom webparts to the default.aspx page instead of using the sitedefinition. This also was fairly easy.. I did this thing back in the 2003 days but back then you had to add the whole xml definition of the webpart (correct me if I’m wrong btw). But now you can create a reference to a webpart and add this using the limited webpart manager as such :&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; AddWebParts(SPWeb currentWeb)
{
    &lt;span class="kwrd"&gt;bool&lt;/span&gt; webpartsInPlace = &lt;span class="kwrd"&gt;false&lt;/span&gt;;   
    &lt;span class="kwrd"&gt;try&lt;/span&gt;
    {
        
        SPLimitedWebPartManager wm = currentWeb.GetLimitedWebPartManager(&lt;span class="str"&gt;&amp;quot;default.aspx&amp;quot;&lt;/span&gt;, System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared);

        &lt;span class="rem"&gt;//Creating a new instance of a custom navigation webpart&lt;/span&gt;
        NavigationWebPart navWp = &lt;span class="kwrd"&gt;new&lt;/span&gt; NavigationWebPart();
        navWp.Title = &lt;span class="str"&gt;&amp;quot;Site Structure&amp;quot;&lt;/span&gt;;
        
        &lt;span class="rem"&gt;//Creating a new instance of a cusotm aggregation webpart&lt;/span&gt;
        WhatsNewWebpart whatsnewWp = &lt;span class="kwrd"&gt;new&lt;/span&gt; WhatsNewWebpart();
        whatsnewWp.Title = &lt;span class="str"&gt;&amp;quot;What's new&amp;quot;&lt;/span&gt;;
        whatsnewWp.ListType = 101;

        &lt;span class="rem"&gt;//Defining some properties of the webpart&lt;/span&gt;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (currentWeb.WebTemplateId == 13000)
        {
            whatsnewWp.Scope = WhatsNewWebpart.ScopeEnum.Site;
            whatsnewWp.ViewSiteColumn = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
        }
        &lt;span class="kwrd"&gt;else&lt;/span&gt;
        {
            whatsnewWp.Scope = WhatsNewWebpart.ScopeEnum.Web;
        }

        whatsnewWp.Limit = 10;
        whatsnewWp.ViewCreatedColumn = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
        whatsnewWp.ViewListColumn = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
        whatsnewWp.ViewModifiedColumn = &lt;span class="kwrd"&gt;true&lt;/span&gt;;

        &lt;span class="rem"&gt;//Here we are actually adding the webparts to the site using the webpartzoneID's and the webpartOrder&lt;/span&gt;
        currentWeb.AllowUnsafeUpdates = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
        wm.AddWebPart(navWp, &lt;span class="str"&gt;&amp;quot;Left&amp;quot;&lt;/span&gt;, 1);
        wm.AddWebPart(whatsnewWp, &lt;span class="str"&gt;&amp;quot;Left&amp;quot;&lt;/span&gt;, 2);
        currentWeb.Update();
        currentWeb.AllowUnsafeUpdates = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
        
        webpartsInPlace = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
        
    }
    &lt;span class="kwrd"&gt;catch&lt;/span&gt; (Exception e)
    {

    }
    &lt;span class="kwrd"&gt;return&lt;/span&gt; webpartsInPlace;
}   &lt;/pre&gt;
&lt;style&gt;
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode, .ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode pre
{font-size:small;color:black;font-family:consolas, &amp;quot;Courier New&amp;quot;, courier, monospace;background-color:#ffffff;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode pre
{margin:0em;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .rem
{color:#008000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .kwrd
{color:#0000ff;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .str
{color:#006080;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .op
{color:#0000c0;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .preproc
{color:#cc6633;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .asp
{background-color:#ffff00;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .html
{color:#800000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .attr
{color:#ff0000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .alt
{background-color:#f4f4f4;width:100%;margin:0em;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .lnum
{color:#606060;}
&lt;/style&gt;

&lt;p&gt;Right.. so next on the requirements list was to have the MOSS Search active. Meaning that the searchscopes were not to be only “This site” or “This List” but also “All Sites” and having a redirect to the Searchcenter for the results. Now in the UI this is a simple setting (Site Actions –&amp;gt; Search Settings –&amp;gt; put in the url of SearchCenter –&amp;gt; Done) but doing this programmatically is a different story. In short, there is no method or function you can use that is in the SPWeb or SPSite object. Using reflector I found out that when clicking on the Ok button in the UI the following was happening :&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;this&lt;/span&gt;._rootWeb.AllProperties[&lt;span class="str"&gt;&amp;quot;SRCH_ENH_FTR_URL&amp;quot;&lt;/span&gt;] = &lt;span class="kwrd"&gt;this&lt;/span&gt;.urlTextBox.Text.Trim(); &lt;/pre&gt;
&lt;style&gt;
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode, .ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode pre
{font-size:small;color:black;font-family:consolas, &amp;quot;Courier New&amp;quot;, courier, monospace;background-color:#ffffff;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode pre
{margin:0em;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .rem
{color:#008000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .kwrd
{color:#0000ff;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .str
{color:#006080;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .op
{color:#0000c0;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .preproc
{color:#cc6633;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .asp
{background-color:#ffff00;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .html
{color:#800000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .attr
{color:#ff0000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .alt
{background-color:#f4f4f4;width:100%;margin:0em;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .lnum
{color:#606060;}
&lt;/style&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;Not very pretty eh? But if it works.. it works! ;)&lt;/p&gt;

&lt;p&gt;Next requirement please! Defining managed paths in code.. hmm.. well this one is pretty funny actually.. the first hit in Google was a &lt;a href="http://hristopavlov.wordpress.com/2008/07/17/managing-managed-paths-through-code/"&gt;blogpost&lt;/a&gt; by &lt;a href="http://hristopavlov.wordpress.com/"&gt;Hristo Pavlov&lt;/a&gt; that was published today describing exactly what I needed :) It seems that on the WebApplication class there is a “Prefixes” collection that holds all the managed paths. To add a managed path you have to do the following :&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; ModifyWebApplication(SPWebApplication webApplication)
{
    &lt;span class="kwrd"&gt;bool&lt;/span&gt; isModified = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
    &lt;span class="kwrd"&gt;try&lt;/span&gt;
    {
        webApplication.Prefixes.Add(&lt;span class="str"&gt;&amp;quot;blogs&amp;quot;&lt;/span&gt;, SPPrefixType.WildcardInclusion);
        webApplication.Update(&lt;span class="kwrd"&gt;true&lt;/span&gt;);
        isModified = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
    }

    &lt;span class="kwrd"&gt;catch&lt;/span&gt; (Exception error)
    { }

    &lt;span class="kwrd"&gt;return&lt;/span&gt; isModified;
}&lt;/pre&gt;
&lt;style&gt;
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode, .ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode pre
{font-size:small;color:black;font-family:consolas, &amp;quot;Courier New&amp;quot;, courier, monospace;background-color:#ffffff;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode pre
{margin:0em;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .rem
{color:#008000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .kwrd
{color:#0000ff;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .str
{color:#006080;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .op
{color:#0000c0;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .preproc
{color:#cc6633;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .asp
{background-color:#ffff00;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .html
{color:#800000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .attr
{color:#ff0000;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .alt
{background-color:#f4f4f4;width:100%;margin:0em;}
.ExternalClassA373902AA1B249C3B06E2479BE51D876 .csharpcode .lnum
{color:#606060;}
&lt;/style&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;So there you go.. creating and configuring sites by only using code is pretty cool and not that hard to do!&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=0skyrJ"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=0skyrJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=WYhBxj"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=WYhBxj" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=XTkQDJ"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=XTkQDJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=TKQ99j"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=TKQ99j" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.zevenseas.com/~r/blogs_robin/~4/338128621" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Meure</dc:creator><pubDate>Thu, 17 Jul 2008 17:08:42 GMT</pubDate><feedburner:origLink>http://community.zevenseas.com/Blogs/Robin/archive/2008/07/17/creating-and-configuring-sites-programmatically-i-love-it.aspx</feedburner:origLink></item><item><title>Can you guess what happened today?</title><link>http://feeds.zevenseas.com/~r/blogs_robin/~3/337423662/can-you-guess-what-happened-today.aspx</link><guid isPermaLink="false">/Blogs/Robin/archive/2008/07/16/can-you-guess-what-happened-today.aspx</guid><description>&lt;div class="ExternalClass77D36933937A40F6BCF8BE3C071ED143"&gt;&lt;p&gt;&lt;a href="http://community.zevenseas.com/Blogs/Robin/Lists/Posts/Attachments/46/whathappenedtoday_2_n8vr9Q.jpg"&gt;&lt;img title="whathappenedtoday" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height="323" alt="whathappenedtoday" src="http://community.zevenseas.com/Blogs/Robin/Lists/Posts/Attachments/46/whathappenedtoday_thumb_ge12hw.jpg" width="644" border="0"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I guess the picture is self explanatory.. it’s just like when SP1 came out. If the Product team announces something the whole community blogs about is as well but there is really no point in blogging about it &lt;strong&gt;again &lt;/strong&gt;now is there? I know, I did in the past as well but I can’t imagine people not being subscribed to their blog these days right? ;) &lt;/p&gt;  &lt;p&gt;Sorry if I upset someone by this post but I just had to write this of my chest! &lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=BKNF3J"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=BKNF3J" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=4bF0lj"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=4bF0lj" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=nMwKyJ"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=nMwKyJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=P4B5Hj"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=P4B5Hj" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.zevenseas.com/~r/blogs_robin/~4/337423662" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Meure</dc:creator><pubDate>Wed, 16 Jul 2008 22:54:43 GMT</pubDate><feedburner:origLink>http://community.zevenseas.com/Blogs/Robin/archive/2008/07/16/can-you-guess-what-happened-today.aspx</feedburner:origLink></item><item><title>We are looking, for people who are looking, for the right change</title><link>http://feeds.zevenseas.com/~r/blogs_robin/~3/335028087/we-are-looking-for-people-who-are-looking-for-the-right-change.aspx</link><guid isPermaLink="false">/Blogs/Robin/archive/2008/07/14/we-are-looking-for-people-who-are-looking-for-the-right-change.aspx</guid><description>&lt;div class="ExternalClassE7299437292242A4AC9BA8B3A97B4D03"&gt;&lt;p&gt;As my mate Daniel &lt;a href="http://community.zevenseas.com/Blogs/Daniel/archive/2008/07/11/we-are-looking-for-people-who-are-looking-for-the-right-change.aspx"&gt;posted&lt;/a&gt;, we are looking for people who are willing to make a change in their professional career : &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;…&lt;a href="http://www.zevenseas.com/"&gt;zevenseas&lt;/a&gt; is a new, small company, dedicated to SharePoint, and dedicated to making consulting the high value profession it once was.&lt;/p&gt;    &lt;p&gt;In the last 6 months we have been crafting out a boutique organisation that allows us to do the things we think are important. Things like attending &lt;a href="http://www.zevenseas.com/zevents/seattle/default.aspx"&gt;key international conferences&lt;/a&gt; and supporting the community via &lt;a href="http://community.zevenseas.com/Blogs/default.aspx"&gt;blogs&lt;/a&gt; and &lt;a href="http://www.codeplex.com/zevenseas"&gt;cool&lt;/a&gt; &lt;a href="http://www.codeplex.com/MOSSSearchCoder"&gt;tools&lt;/a&gt;. We are an organisation that always works as a team, meeting each and every Friday through our Fridays@Sea concept, providing all of us with an opportunity to share experience, work collaboratively on problems, and most importantly, ensure we never feel we are out there on our own. &lt;/p&gt;    &lt;p&gt;As SharePoint specialists we are able to focus on the product that excites us most, digging deep into the technology to ensure the best possible outcome for our customers. We bring a pragmatic, experienced and business focused approach to solving the problems our customers share with us, making the most of the strong platform SharePoint has become… &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;Now let me tell you how my experience has been since I decided to be a part of this lovely company. I’ve joined zevenseas at the beginning and I’ve seen it grow within 6 months as a great company with a very promising future. The chemistry between each of us is so great it’s barely describable but we seek more people who carry the same chemistry. So if you are looking for a kick-ass place to work, want to be involved in all the business decisions we make, don’t mind to be with a really good bunch of people every Friday and of course (if you aren’t already) be a very good SharePoint developer/consultant/architect then please mail me at &lt;a href="mailto:robin@zevenseas.com"&gt;robin@zevenseas.com&lt;/a&gt; and I’ll buy you a beer ;)&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=ctYlqJ"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=ctYlqJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=O7V0yj"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=O7V0yj" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=T4dPQJ"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=T4dPQJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=227C0j"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=227C0j" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.zevenseas.com/~r/blogs_robin/~4/335028087" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Meure</dc:creator><pubDate>Mon, 14 Jul 2008 13:40:51 GMT</pubDate><feedburner:origLink>http://community.zevenseas.com/Blogs/Robin/archive/2008/07/14/we-are-looking-for-people-who-are-looking-for-the-right-change.aspx</feedburner:origLink></item><item><title>The zevenseas Choice Column Filter Web Part</title><link>http://feeds.zevenseas.com/~r/blogs_robin/~3/331520409/the-zevenseas-choice-column-filter-web-part.aspx</link><guid isPermaLink="false">/Blogs/Robin/archive/2008/07/10/the-zevenseas-choice-column-filter-web-part.aspx</guid><description>&lt;div class="ExternalClass794C4E1CD04246AFB03D6E56A004D992"&gt;&lt;p&gt;  &lt;p&gt;Well my mate &lt;a href="http://community.zevenseas.com/Blogs/Daniel"&gt;Daniel&lt;/a&gt; is &lt;a href="http://feeds.daniel.mcpherson.name/~r/dmcblog/~3/331030371/"&gt;probably still wet behind his ears&lt;/a&gt; but he managed to built another lovely webpart. This webpart is called the “Choice Column Filter WebPart”. The question is of course.. what does it do?&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;1. First I added a new column called “CompanyName” to the standard “Contacts” list in SharePoint as follows:&lt;/p&gt;    &lt;blockquote&gt;     &lt;p&gt;&lt;a href="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_2_7fO6hg.png"&gt;&lt;img title="image" height="277" alt="image" src="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_thumb_2yTFFg.png" width="201" border="0"&gt;&lt;/a&gt;&lt;/p&gt;   &lt;/blockquote&gt;    &lt;p&gt;2. Then I added in some sample data, and added a List View Web part for the list onto a new Web Part Page like so:&lt;/p&gt;    &lt;p&gt;&lt;a href="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_4_HwYtCA.png"&gt;&lt;img title="image" height="331" alt="image" src="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_thumb_1_eghcRw.png" width="582" border="0"&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;3. Everything is pretty simple so far, but his is where the Choice Filter web part comes in. The Choice Filter web part is attached to the “CompanyName” column, pulling out its values, creating a list of option boxes, and allowing you to sort the list at a single click. Here we add the Web Part, and the open the tool pane:&lt;/p&gt;    &lt;p&gt;&lt;a href="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_6_qWKqzA.png"&gt;&lt;img title="image" height="244" alt="image" src="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_thumb_2_WcsEeA.png" width="241" border="0"&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;4. At the top of the tool pane we can select the list we want to attach to, and then any Choice fields that exist within the list, here we have changed it to point to our Contacts list:&lt;/p&gt;    &lt;p&gt;&lt;a href="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_8_O1AU6g.png"&gt;&lt;img title="image" height="184" alt="image" src="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_thumb_3_uA936w.png" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;5. When you have finished, click on “OK” to save the changes. The Choice Filter web part will now render with each choice appearing as an Option button:&lt;/p&gt;    &lt;p&gt;&lt;a href="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_10_VXe7Rw.png"&gt;&lt;img title="image" height="186" alt="image" src="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_thumb_4_sP0Pg.png" width="339" border="0"&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;6. All that remains is to connect up our new Choice Filter web part to the existing “Contacts” list view web part. First, make sure the page is in “Edit Mode”, then click on the “Choice Filter” edit drop down and select the following meni tree: “Connections” –&amp;gt; “Send Choice Filter To” –&amp;gt; “Contacts”, you will then have the following pop-up appear:&lt;/p&gt;    &lt;p&gt;&lt;a href="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_12_QwpZcg.png"&gt;&lt;img title="image" height="164" alt="image" src="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_thumb_5_je796Q.png" width="327" border="0"&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;7. Match the “Choice Value” to the field you connected to earlier, in this case “CompanyName” and you are ready to go. &lt;/p&gt;    &lt;p&gt;&lt;a href="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_16_ORzl5A.png"&gt;&lt;img title="image" height="229" alt="image" src="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_thumb_7_SlniCg.png" width="469" border="0"&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_18_X00Ing.png"&gt;&lt;img title="image" height="154" alt="image" src="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/33/image_thumb_8_w4JZlw.png" width="473" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;  &lt;p&gt;Pretty impressive eh? You can download it from our &lt;a href="http://www.codeplex.com/zevenseas"&gt;CodePlex community solution site&lt;/a&gt;, and please let us know what you think of it!&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=KXtYcJ"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=KXtYcJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=2pGuTj"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=2pGuTj" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=F0mVlJ"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=F0mVlJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=BrMWQj"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=BrMWQj" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.zevenseas.com/~r/blogs_robin/~4/331520409" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Meure</dc:creator><pubDate>Thu, 10 Jul 2008 09:55:35 GMT</pubDate><feedburner:origLink>http://community.zevenseas.com/Blogs/Robin/archive/2008/07/10/the-zevenseas-choice-column-filter-web-part.aspx</feedburner:origLink></item><item><title>Lessons learned with Windows Workflow Foundation</title><link>http://feeds.zevenseas.com/~r/blogs_robin/~3/328802920/lessons-learned-with-windows-workflow-foundation.aspx</link><guid isPermaLink="false">/Blogs/Robin/archive/2008/07/07/lessons-learned-with-windows-workflow-foundation.aspx</guid><description>&lt;div class="ExternalClass561A8C78EBC541D791BA70D71F18DAE9"&gt;&lt;p&gt;At my last project I was asked to develop a workflow that was quite complex. Now I have my fair experience of building workflow's using SharePoint Designer and custom workflow activities but I didn’t have any experience in building workflow's in VS. First thing to decide was whether to use a sequential or a state machine workflow. I decided to go for a state machine workflow so let me explain why I opted for that type of workflow and let me begin by briefly describe what the workflow is supposed to do :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Automatically create sites&lt;/li&gt;    &lt;li&gt;Handle the user registration process&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;If it’s the first user then do ‘code A’&lt;/li&gt;      &lt;li&gt;If it’s the second user .. eleventh user then do ‘code B’, etc&lt;/li&gt;      &lt;li&gt;If the first user didn’t respond within 2 months than do ‘code C’&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Automatically modify sites if there are an X number of users who have registered, after a X period of time modify the site again&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So to me, this looked like a state machine. The first state is ‘creating the site’ , second state is ‘user registers’ and the final state is ‘modifying the site’. As always I googled for some (simple) &lt;a href="http://www.odetocode.com/Articles/460.aspx"&gt;tutorials&lt;/a&gt; who lead me the way and I started off with a console state machine workflow and within minutes I had a nice little workflow running  :) &lt;/p&gt;  &lt;p&gt;I decided to put this little workflow into our SharePoint environment which meant that the &lt;strong&gt;console&lt;/strong&gt; workflow was running in an &lt;strong&gt;ASP.NET&lt;/strong&gt; environment. This is where I got my first struggle with the Workflow Foundation. I wasn’t aware of the fact that the workflow was having it’s own scheduler and was running asynchronously. In order to run the workflow synchronously with the ASP.NET process you have to define the ManualWorkflowScheduler. The following articles pointed me in the right direction :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a title="http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx" href="http://developers.de/blogs/damir_dobric/archive/2007/12/10/manualworkflowschedulerservice-and-delayactivity.aspx"&gt;ManualWorkflowSchedulerService and DelayActivity&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a title="http://developers.de/blogs/damir_dobric/archive/2008/06/19/about-manually-scheduling-and-persistance-of-workflows.aspx" href="http://developers.de/blogs/damir_dobric/archive/2008/06/19/about-manually-scheduling-and-persistance-of-workflows.aspx"&gt;About manually scheduling and persistence of workflow&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a title="http://www.codeproject.com/KB/cs/wfstatemachineaspnet.aspx" href="http://www.codeproject.com/KB/cs/wfstatemachineaspnet.aspx"&gt;Windows Workflow Foundation ASP.Net State Machine&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So after tackling that, the next ‘problem’ was facing me. I was very keen on using the persistency and tracking functionality since that gave the end-user/administrator the ability to quickly see in which state the workflow was running and what has happened in the past. Unfortunately this meant that the workflow could not be modified while running. Since the workflow could run for over a couple of months and having the requirement that a couple of variables could be changed (like the period of waiting or how many users are required) this was not an option. This was also not an option because when the workflow would wait for a couple of days it meant that an user could not register because the instance was waiting. So I had to drop that functionality and I had to modify the workflow so every time ‘something’ happened in the system which would fire the workflow, the workflow would create a new instance. Here are some articles which describe a bit more what I’m talking about :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a title="http://geekswithblogs.net/cenvy/archive/2005/11/08/59482.aspx" href="http://geekswithblogs.net/cenvy/archive/2005/11/08/59482.aspx"&gt;Developer Walkthrough: Event Driven Sequential Workflow for Windows Workflow Foundation&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a title="http://www.tqcblog.com/archive/2008/05/21/changing-timeoutduration-with-initializetimeoutduration.aspx" href="http://www.tqcblog.com/archive/2008/05/21/changing-timeoutduration-with-initializetimeoutduration.aspx"&gt;Changing TimeoutDuration with InitializeTimeoutDuration&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a title="http://blogs.infosupport.com/blogs/jonathan/archive/2008/04/28/State-machine-workflows.aspx" href="http://blogs.infosupport.com/blogs/jonathan/archive/2008/04/28/State-machine-workflows.aspx"&gt;State machine workflows&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So after a whole lot of iterations the workflow actually got more and more sequential.. And instead of a ‘site’ lifecycle it became an ‘user per site’ lifecycle. My lessons learned are the following :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;There is a huge difference between console applications and ASP.NET application that utilitize the workflow foundation.&lt;/li&gt;    &lt;li&gt;Spend more time in defining the workflow and make good choices between state machine and sequential. An process workflow that is defined in the functional phase could be very different in the technical phase&lt;/li&gt;    &lt;li&gt;Make a choice in having one instance or several instances of a workflow in terms of ‘waiting’ workflow’s. Next to that, running instances can not be versioned. So if you have long running workflows (eg. the lifecycle of a SharePoint site) and you want to make some changes to the workflow you simply cannot. &lt;/li&gt; &lt;/ul&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=gMfvHJ"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=gMfvHJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=xyQOIj"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=xyQOIj" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=1JJfvJ"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=1JJfvJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=OzLp3j"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=OzLp3j" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.zevenseas.com/~r/blogs_robin/~4/328802920" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Meure</dc:creator><pubDate>Mon, 07 Jul 2008 13:19:02 GMT</pubDate><feedburner:origLink>http://community.zevenseas.com/Blogs/Robin/archive/2008/07/07/lessons-learned-with-windows-workflow-foundation.aspx</feedburner:origLink></item><item><title>Displaying workflow's that are waiting on approval</title><link>http://feeds.zevenseas.com/~r/blogs_robin/~3/328261230/displaying-workflows-that-are-waiting-on-approval.aspx</link><guid isPermaLink="false">/Blogs/Robin/archive/2008/07/06/displaying-workflows-that-are-waiting-on-approval.aspx</guid><description>&lt;div class="ExternalClass9EE2C009B25A414D9B61208601B899FD"&gt;&lt;p&gt;This week I was at a customer who was having some ‘pain’ in retrieving the status of a an approval workflow per submitted form. Their wish was to have a simple overview of all running workflow's that were waiting for a period longer than 14 days. With that overview they could see which approver was causing the delay and thus measurers could be taken. &lt;/p&gt;  &lt;p&gt;My first hunch was to use a calculated column to determine when the form was last modified (since an approval caused a modification on the form) and combining that with the current date. But given the fact you cannot use the [Today] function in a calculated column this approach was not the answer. Next hunch was to use a dataview webpart, by using conditional formatting I could hide the forms that didn’t match the expression and showed the forms that did. Unfortunately I don’t have much experience using this webpart and creating an useful expression took too much time. Plus the fact that the customer wanted to have a little more information about the workflow itself I decided to do this by code ;)&lt;/p&gt;  &lt;p&gt;Now every time something happens in the workflow, this event is registered in the workflow history list (which is a hidden list). Every list-item in that list has a reference to the formitem that it belongs to. So basically what I need to do is the following :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Get the workflow instances per form-item &lt;/li&gt;    &lt;li&gt;Per instance, get the workflow history list&lt;/li&gt;    &lt;li&gt;Per form-item, get the last history item and get the workflow message/description&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So in code it looks like this :&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; List&amp;lt;WaitingWorkflowItem&amp;gt; GetWorklowHistoryForList(SPList formList)
{
    List&amp;lt;WaitingWorkflowItem&amp;gt; waitingWorklowItems = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;WaitingWorkflowItem&amp;gt;();

    &lt;span class="rem"&gt;//Getting metadata from the form&lt;/span&gt;
    SPWeb web = SPContext.GetContext(&lt;span class="kwrd"&gt;this&lt;/span&gt;.Context).Web;

    SPQuery getRunningWorkflows = &lt;span class="kwrd"&gt;new&lt;/span&gt; SPQuery();
    getRunningWorkflows.Query = &lt;span class="str"&gt;&amp;quot;&amp;lt;Where&amp;gt;&amp;lt;Eq&amp;gt;&amp;lt;FieldRef Name=\&amp;quot;_ModerationStatus\&amp;quot; /&amp;gt;&amp;lt;Value Type=\&amp;quot;ModStat\&amp;quot;&amp;gt;Pending&amp;lt;/Value&amp;gt;&amp;lt;/Eq&amp;gt;&amp;lt;/Where&amp;gt;&amp;quot;&lt;/span&gt;;

    SPListItemCollection coll = formList.GetItems(getRunningWorkflows);

    &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (SPListItem formItem &lt;span class="kwrd"&gt;in&lt;/span&gt; coll)
    {
        DateTime modified = (DateTime)formItem[&lt;span class="str"&gt;&amp;quot;Modified&amp;quot;&lt;/span&gt;];

        &lt;span class="rem"&gt;//We are only interested in the forms that are waiting for more than 14 days&lt;/span&gt;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (modified.AddDays(numberOfDays) == DateTime.Today)
        {
            &lt;span class="rem"&gt;//Storing the data about the form in our own class&lt;/span&gt;
            WaitingWorkflowItem waitingWorkflowItem = &lt;span class="kwrd"&gt;new&lt;/span&gt; WaitingWorkflowItem();
            waitingWorkflowItem.Title = formItem.Name;
            waitingWorkflowItem.LinkToForm = formItem.Url;

            &lt;span class="rem"&gt;//If a form is waiting for more then 14 days, we want to know how many days it is waiting&lt;/span&gt;
            TimeSpan ts = &lt;span class="kwrd"&gt;new&lt;/span&gt; TimeSpan(DateTime.Today.Ticks - modified.AddDays(numberOfDays).Ticks);
            waitingWorkflowItem.NumberOfDays = ts.Days.ToString();

            &lt;span class="rem"&gt;//Here we are retrieving all running workflows on the item&lt;/span&gt;
            Collection&amp;lt;Guid&amp;gt; instanceCollection = formItem.Workflows.GetInstanceIds();
            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (Guid instance &lt;span class="kwrd"&gt;in&lt;/span&gt; instanceCollection)
            {
                &lt;span class="rem"&gt;//It could be that every workflow has it's own history list, so therefore we are retrieving &lt;/span&gt;
                &lt;span class="rem"&gt;//the status using the workklow instance&lt;/span&gt;
                SPWorkflow workflow = (SPWorkflow)formItem.Workflows[instance];
                SPList historyList = workflow.HistoryList;

                &lt;span class="rem"&gt;//Getting the workflowhistory for the current form item&lt;/span&gt;
                SPQuery getSpecificWorkflowHistory = &lt;span class="kwrd"&gt;new&lt;/span&gt; SPQuery();
                getSpecificWorkflowHistory.Query =
                     &lt;span class="str"&gt;&amp;quot;&amp;lt;Where&amp;gt;&amp;lt;Eq&amp;gt;&amp;lt;FieldRef Name='Item' /&amp;gt;&amp;quot;&lt;/span&gt; +
                     &lt;span class="str"&gt;&amp;quot;&amp;lt;Value Type='Integer'&amp;gt;&amp;quot;&lt;/span&gt; + formItem.ID +
                     &lt;span class="str"&gt;&amp;quot;&amp;lt;/Value&amp;gt;&amp;lt;/Eq&amp;gt;&amp;lt;/Where&amp;gt;&amp;quot;&lt;/span&gt;;

                SPListItemCollection workflowItems = historyList.GetItems(getSpecificWorkflowHistory);
                SPListItem workflowItem = workflowItems[workflowItems.Count - 1];

                &lt;span class="rem"&gt;//Storing the last description of the workflow&lt;/span&gt;
                waitingWorkflowItem.Status += workflowItem[&lt;span class="str"&gt;&amp;quot;Description&amp;quot;&lt;/span&gt;].ToString();
            }

            waitingWorklowItems.Add(waitingWorkflowItem);
        }
    }
&lt;span class="kwrd"&gt;return&lt;/span&gt; waitingWorklowItems;
}&lt;/pre&gt;

&lt;p&gt;&lt;style&gt;
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode, .ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode pre
{font-size:small;color:black;font-family:consolas, &amp;quot;Courier New&amp;quot;, courier, monospace;background-color:#ffffff;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode pre
{margin:0em;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .rem
{color:#008000;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .kwrd
{color:#0000ff;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .str
{color:#006080;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .op
{color:#0000c0;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .preproc
{color:#cc6633;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .asp
{background-color:#ffff00;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .html
{color:#800000;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .attr
{color:#ff0000;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .alt
{background-color:#f4f4f4;width:100%;margin:0em;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .lnum
{color:#606060;}
&lt;/style&gt;With our own WaitingWorklflow class that looks like this :&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; WaitingWorkflowItem
{
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; title = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; linkToForm = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; numberOfDays = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; status = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty;

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Title
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; title;
        }
        set
        {
            title = &lt;span class="kwrd"&gt;value&lt;/span&gt;;
        }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; LinkToForm
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; linkToForm;
        }
        set
        {
            linkToForm = &lt;span class="kwrd"&gt;value&lt;/span&gt;;
        }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; NumberOfDays
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; numberOfDays;
        }
        set
        {
            numberOfDays = &lt;span class="kwrd"&gt;value&lt;/span&gt;;
        }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Status
    {
        get
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; status;
        }
        set
        {
            status = &lt;span class="kwrd"&gt;value&lt;/span&gt;;
        }
    }
}&lt;/pre&gt;

&lt;p&gt;&lt;style&gt;
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode, .ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode pre
{font-size:small;color:black;font-family:consolas, &amp;quot;Courier New&amp;quot;, courier, monospace;background-color:#ffffff;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode pre
{margin:0em;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .rem
{color:#008000;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .kwrd
{color:#0000ff;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .str
{color:#006080;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .op
{color:#0000c0;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .preproc
{color:#cc6633;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .asp
{background-color:#ffff00;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .html
{color:#800000;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .attr
{color:#ff0000;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .alt
{background-color:#f4f4f4;width:100%;margin:0em;}
.ExternalClass9EE2C009B25A414D9B61208601B899FD .csharpcode .lnum
{color:#606060;}
&lt;/style&gt;So all we have to do is bind the Collection what we retrieve from the function to a DataGrid (or any other gridview-like control) and put it all in a simple WebPart and it will look like this :&lt;/p&gt;

&lt;p&gt;&lt;a href="http://community.zevenseas.com/Blogs/Robin/Lists/Posts/Attachments/42/longwaitingworkflwos_2_fDiBow.jpg"&gt;&lt;img title="longwaitingworkflwos" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height="137" alt="longwaitingworkflwos" src="http://community.zevenseas.com/Blogs/Robin/Lists/Posts/Attachments/42/longwaitingworkflwos_thumb_i3Itnw.jpg" width="604" border="0"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Can you see the possibilities? :) Maybe some conditional formatting based on the amount of “NumberOfDays” that the workflow is waiting. Or putting in a email link so the person who must approve get’s another email, reminding the person that the approval is urgent. Another benefit of this type of reports is that you can see if workflow's are properly running or not. In this customer’s case some workflow's didn’t update the approval status of the form although the workflow was complete. &lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=pctjrJ"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=pctjrJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=F6B09j"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=F6B09j" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=pI5V7J"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=pI5V7J" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=30cXgj"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=30cXgj" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.zevenseas.com/~r/blogs_robin/~4/328261230" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Meure</dc:creator><pubDate>Sun, 06 Jul 2008 21:39:16 GMT</pubDate><feedburner:origLink>http://community.zevenseas.com/Blogs/Robin/archive/2008/07/06/displaying-workflows-that-are-waiting-on-approval.aspx</feedburner:origLink></item><item><title>Catching up on some good blogposts..</title><link>http://feeds.zevenseas.com/~r/blogs_robin/~3/328124625/catching-up-on-some-good-blogposts-.aspx</link><guid isPermaLink="false">/Blogs/Robin/archive/2008/07/06/catching-up-on-some-good-blogposts-.aspx</guid><description>&lt;div class="ExternalClass32ABB3C3AA2D480A8D069232A36DE1E9"&gt;&lt;p&gt;After not reading my RSS feed for a couple of days I was stumbled with all the good posts out there.. Here is a summary of the posts that immediately caught my attention :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a title="Permanent Link to Best Practices for developing accessible web sites in Microsoft Office SharePo" href="http://blog.mastykarz.nl/2008/07/02/best-practices-for-developing-accessible-web-sites-in-microsoft-office-sharepoint-server-2007/"&gt;Best Practices for developing accessible web sites in Microsoft Office SharePoint Server 2007&lt;/a&gt; by &lt;a href="http://blog.mastykarz.nl/"&gt;Waldek Mastykarz&lt;/a&gt;. Very interesting whitepaper, I  learned a lot while reading this document.. So highly recommended!&lt;/li&gt;    &lt;li&gt;&lt;a title="SharePoint 101- Managed Paths" href="http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=30"&gt;SharePoint 101- Managed Paths&lt;/a&gt; by &lt;a title="Zach Rosenfield" href="http://sharepoint.microsoft.com/blogs/zach/"&gt;Zach Rosenfield&lt;/a&gt;. An excellent explanation on Managed Paths. &lt;/li&gt;    &lt;li&gt;&lt;a title="Designing browser-enabled forms for performance in InfoPath Forms Services (Part 1)" href="http://blogs.msdn.com/infopath/archive/2008/05/09/designing-browser-enabled-forms-for-performance-in-infopath-forms-services.aspx"&gt;Designing browser-enabled forms for performance in InfoPath Forms Services (Part 1)&lt;/a&gt; , &lt;a title="Designing browser-enabled forms for performance in InfoPath Forms Services (Part 2)" href="http://blogs.msdn.com/infopath/archive/2008/06/19/designing-browser-enabled-forms-for-performance-in-infopath-forms-services-part-2.aspx"&gt;Part 2&lt;/a&gt;, &lt;a title="Designing browser-enabled forms for performance in InfoPath Forms Services (Part 3)" href="http://blogs.msdn.com/infopath/archive/2008/06/24/designing-browser-enabled-forms-for-performance-in-infopath-forms-services-part-3.aspx"&gt;Part 3&lt;/a&gt;, &lt;a title="Designing browser-enabled forms for performance in InfoPath Forms Services (Part 4)" href="http://blogs.msdn.com/infopath/archive/2008/06/25/designing-browser-enabled-forms-for-performance-in-infopath-forms-services-part-4.aspx"&gt;Part 4&lt;/a&gt;, &lt;a title="Designing browser-enabled forms for performance in InfoPath Forms Services (Part 5)" href="http://blogs.msdn.com/infopath/archive/2008/06/26/designing-browser-enabled-forms-for-performance-in-infopath-forms-services-part-5.aspx"&gt;Part 5&lt;/a&gt;, &lt;a title="Designing browser-enabled forms for performance in InfoPath Forms Services (Part 6)" href="http://blogs.msdn.com/infopath/archive/2008/06/30/designing-browser-enabled-forms-for-performance-in-infopath-forms-services-part-6.aspx"&gt;Part 6&lt;/a&gt;. If you are starting to build forms using InfoPath 2007 to be browser-enabled (or like me, you have some experience with it), please read these blogposts by the InfoPath Team. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/spdsupport/archive/2008/07/03/how-to-fix-multipage-meeting-workspace-will-not-display-items-copied-created-by-sharepoint-designer-workflows.aspx"&gt;How to fix: Multipage Meeting Workspace will not display items copied / created by SharePoint Designer workflows&lt;/a&gt;, post from the &lt;a href="http://blogs.msdn.com/spdsupport/default.aspx"&gt;SharePoint Designer Support blog&lt;/a&gt; (makes you wonder though.. there is an actual support blog for SharePoint &lt;strong&gt;Designer &lt;/strong&gt;(even SharePoint itself does not have it’s own support blog) to fix the problem when you are utilizing the copy list item when copying a document from one library to another.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/spdsupport/archive/2008/07/03/how-to-fix-custom-list-forms-will-not-insert-or-show-up-on-the-design-surface-of-sharepoint-designer.aspx"&gt;How to fix: Custom List Forms will not insert or show up on the Design surface of SharePoint Designer&lt;/a&gt;, another post by the SPD Support blog when you come across this behavior.&lt;/li&gt;    &lt;li&gt;&lt;a title="Adding Copy and Paste to SharePoint with the SmartTools" href="http://weblogs.asp.net/jan/archive/2008/06/14/adding-copy-and-paste-to-sharepoint-with-the-smarttools.aspx"&gt;Adding Copy and Paste to SharePoint with the SmartTools&lt;/a&gt;, &lt;a href="http://weblogs.asp.net/jan/"&gt;Jan ‘the man’ Tielens&lt;/a&gt; has it done it again! Adding the functionality what is used most in every environment and that is copy &amp;amp; pasting! Check it out here &lt;a title="CopyPaste Wiki page on CodePlex" href="http://www.codeplex.com/smarttools/Wiki/View.aspx?title=Copy Paste"&gt;CopyPaste Wiki page on CodePlex&lt;/a&gt; :)&lt;/li&gt; &lt;/ul&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=0n48OJ"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=0n48OJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=g2hv4j"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=g2hv4j" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=sBS6DJ"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=sBS6DJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=TqYaIj"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=TqYaIj" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.zevenseas.com/~r/blogs_robin/~4/328124625" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Meure</dc:creator><pubDate>Sun, 06 Jul 2008 17:27:41 GMT</pubDate><feedburner:origLink>http://community.zevenseas.com/Blogs/Robin/archive/2008/07/06/catching-up-on-some-good-blogposts-.aspx</feedburner:origLink></item><item><title>Using the PeoplePicker in your custom webpart</title><link>http://feeds.zevenseas.com/~r/blogs_robin/~3/313785117/using-the-peoplepicker-in-your-custom-webpart.aspx</link><guid isPermaLink="false">/Blogs/Robin/archive/2008/06/17/using-the-peoplepicker-in-your-custom-webpart.aspx</guid><description>&lt;div class="ExternalClass846C8B8237C14933B102BC5A8925ED7F"&gt;&lt;p&gt;  &lt;p&gt;In my current project I wanted to create a webpart where I could add users to a certain group in a site from a single adminstration site. Furthermore I wanted to use the nice and elegant People Picker. This control is called “PeopleEditor” which belongs to the Microsoft.SharePoint.WebControls namespace. This is how it looks like when ran in a webpart :&lt;/p&gt;  &lt;p&gt;&lt;a href="http://community.zevenseas.com/Blogs/Robin/_attach/peoplepicker_2_zyIPrw.jpg"&gt;&lt;img title="peoplepicker" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height="134" alt="peoplepicker" src="http://community.zevenseas.com/Blogs/Robin/_attach/peoplepicker_thumb_KZwDkQ.jpg" width="644" border="0"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Here is the code to get the values from the control :&lt;/p&gt;  &lt;pre class="csharpcode"&gt;PeopleEditor _peoplePicker = &lt;span class="kwrd"&gt;new&lt;/span&gt; PeopleEditor();
_peoplePicker.AllowTypeIn = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
_peoplePicker.AllowEmpty = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
_peoplePicker.MultiSelect = &lt;span class="kwrd"&gt;false&lt;/span&gt;;

SPWeb web = &lt;span class="kwrd"&gt;new&lt;/span&gt; SPSite(&lt;span class="str"&gt;&amp;quot;urlToWeb&amp;quot;&lt;/span&gt;).OpenWeb();
SPGroup group = web.SiteGroups[&lt;span class="str"&gt;&amp;quot;groupname&amp;quot;&lt;/span&gt;];

web.AllowUnsafeUpdates = &lt;span class="kwrd"&gt;true&lt;/span&gt;;

&lt;span class="kwrd"&gt;if&lt;/span&gt; (Group.Users.Count &amp;gt; 0)
{
      SPUserCollection users = group.Users;
      &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (SPUser user &lt;span class="kwrd"&gt;in&lt;/span&gt; users)
      {
           group.Users.Remove(user.LoginName);
           group.Update();
      }
}
   
            
&lt;span class="kwrd"&gt;try&lt;/span&gt;
{
      group.AddUser(_peoplePicker.Accounts[0].ToString(), &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;);
      group.Update();
}

&lt;span class="kwrd"&gt;catch&lt;/span&gt; (ArgumentException error)
{
      &lt;span class="rem"&gt;//Do ErrorHandling here&lt;/span&gt;
}

&lt;span class="kwrd"&gt;finally&lt;/span&gt;
{
     web.AllowUnsafeUpdates = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
     web.Close();
     web.Dispose();
}&lt;/pre&gt;
&lt;style&gt;
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode, .ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode pre
{font-size:small;color:black;font-family:consolas, &amp;quot;Courier New&amp;quot;, courier, monospace;background-color:#ffffff;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode pre
{margin:0em;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .rem
{color:#008000;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .kwrd
{color:#0000ff;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .str
{color:#006080;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .op
{color:#0000c0;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .preproc
{color:#cc6633;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .asp
{background-color:#ffff00;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .html
{color:#800000;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .attr
{color:#ff0000;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .alt
{background-color:#f4f4f4;width:100%;margin:0em;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .lnum
{color:#606060;}
&lt;/style&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;And here is the code to set the values from the control :&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (group.Users.Count &amp;gt; 0)
{                
      &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (SPUser user &lt;span class="kwrd"&gt;in&lt;/span&gt; group.Users)
      {                   
             _peoplePicker.CommaSeparatedAccounts= user.LoginName;                
      }                
}&lt;/pre&gt;
&lt;style&gt;
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode, .ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode pre
{font-size:small;color:black;font-family:consolas, &amp;quot;Courier New&amp;quot;, courier, monospace;background-color:#ffffff;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode pre
{margin:0em;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .rem
{color:#008000;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .kwrd
{color:#0000ff;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .str
{color:#006080;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .op
{color:#0000c0;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .preproc
{color:#cc6633;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .asp
{background-color:#ffff00;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .html
{color:#800000;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .attr
{color:#ff0000;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .alt
{background-color:#f4f4f4;width:100%;margin:0em;}
.ExternalClass846C8B8237C14933B102BC5A8925ED7F .csharpcode .lnum
{color:#606060;}
&lt;/style&gt;

&lt;p&gt;Took me a couple of hours to find out I had to use the CommaSeperatedAccount property. Since you are getting the values using the Accounts or the Entities properties, it seems a bit odd to use this method to set the values. &lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=j4A7sI"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=j4A7sI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=Pa8rBi"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=Pa8rBi" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=48SskI"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=48SskI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=OQONGi"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=OQONGi" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.zevenseas.com/~r/blogs_robin/~4/313785117" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Meure</dc:creator><pubDate>Tue, 17 Jun 2008 14:57:59 GMT</pubDate><feedburner:origLink>http://community.zevenseas.com/Blogs/Robin/archive/2008/06/17/using-the-peoplepicker-in-your-custom-webpart.aspx</feedburner:origLink></item><item><title>Want to know why SharePoint loads up very slowly during the first request?</title><link>http://feeds.zevenseas.com/~r/blogs_robin/~3/305241011/want-to-know-why-sharepoint-loads-up-very-slowly-during-the-first-request.aspx</link><guid isPermaLink="false">/Blogs/Robin/archive/2008/06/05/want-to-know-why-sharepoint-loads-up-very-slowly-during-the-first-request.aspx</guid><description>&lt;div class="ExternalClass8A2361242858462BBD75B4DC12B380BB"&gt;&lt;p&gt;&lt;strong&gt;&amp;lt;Update&amp;gt;&lt;/strong&gt;SharePoint is very slowly the first time because it compiles all the libraries and after that they are cached. SharePoint is extremely slowly if this is done on a system which has no internet access because something else occurs during compilation! When I read the article about &lt;a href="http://msdn.microsoft.com/en-us/library/bb727371.aspx"&gt;How to Optimize a SharePoint Server 2007 Web Content Management Site for Performance&lt;/a&gt; I stumbled upon a comment from &lt;a href="http://jritmeijer.spaces.live.com/blog"&gt;Jeroen Ritmeijer&lt;/a&gt; who did some investigation upon the slow load times. Here is his comment and a link on what’s really going on: &lt;strong&gt;&amp;lt;/Update&amp;gt;&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Ever since SharePoint 2007 was introduced I have been really disappointed with the 2 minute spin-up time of the sites and the 30 second wait when launching STSADM. &lt;/p&gt;    &lt;p&gt;As it turns out this problem does not occur on all SharePoint installations, it only happens under a certain combination of circumstances. Fortunately I have identified the root cause as well as a solution. &lt;/p&gt;    &lt;p&gt;Some symptoms: &lt;/p&gt;    &lt;p&gt;STSADM:      &lt;br&gt;* You start STSADM without any parameters       &lt;br&gt;* There is a delay of about 30 seconds       &lt;br&gt;* There is no CPU activity, swapping or significant network traffic.&lt;/p&gt;    &lt;p&gt;SharePoint web requests      &lt;br&gt;* You recycle the app pool / perform an IISRESET.       &lt;br&gt;* Request a SharePoint page       &lt;br&gt;* There is a delay of about 2 minutes       &lt;br&gt;* There is no CPU activity, swapping or significant network traffic.&lt;/p&gt;    &lt;p&gt;After quite some investigation I have found that this is related to CRL (Certificate Revocation List) lookups when assemblies are being loaded. I have added a list of possible workarounds to the following blog posting:&lt;/p&gt;    &lt;p&gt;&lt;a href="http://jritmeijer.spaces.live.com/blog/cns!8A48A27460FB898A!965.entry"&gt;http://jritmeijer.spaces.live.com/blog/cns!8A48A27460FB898A!965.entry&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Thanks Jeroen ;)&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=DvrBNI"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=DvrBNI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=KUPRQi"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=KUPRQi" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=UFYaWI"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=UFYaWI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=rl7Rzi"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=rl7Rzi" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.zevenseas.com/~r/blogs_robin/~4/305241011" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Meure</dc:creator><pubDate>Thu, 05 Jun 2008 12:44:38 GMT</pubDate><feedburner:origLink>http://community.zevenseas.com/Blogs/Robin/archive/2008/06/05/want-to-know-why-sharepoint-loads-up-very-slowly-during-the-first-request.aspx</feedburner:origLink></item><item><title>Want to write MOSS Search queries ?</title><link>http://feeds.zevenseas.com/~r/blogs_robin/~3/304697448/want-to-write-moss-search-queries.aspx</link><guid isPermaLink="false">/Blogs/Robin/archive/2008/06/04/want-to-write-moss-search-queries.aspx</guid><description>&lt;div class="ExternalClassAB6C2358EEBF4DA29AF9F1103BAB21A1"&gt;&lt;p&gt;Just like you cannot live without U2U’s CAML Query builder, you also cannot live without &lt;a href="http://community.zevenseas.com/Blogs/Daniel/archive/2008/06/04/announcing-moss-sql-searchcoder.aspx"&gt;MOSS SQL SearchCoder&lt;/a&gt;! Developed by my mate &lt;a href="http://community.zevenseas.com/Blogs/Daniel"&gt;Daniel&lt;/a&gt;, comes this tool that lets you write your custom search queries in a really easy way. See the following screenshot on how easy it is.. &lt;/p&gt;  &lt;p&gt;&lt;img src="http://community.zevenseas.com/blogs/daniel/Lists/Posts/Attachments/25/image_thumb_2.png"&gt; &lt;/p&gt;  &lt;p&gt;Brilliant stuff eh? Go get it from &lt;a href="http://www.codeplex.com/MOSSSearchCoder"&gt;CodePlex&lt;/a&gt; and let us know what you think of it and how we (well.. actually only Daniel..) can improve it :)&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=cBWisI"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=cBWisI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=BFQEKi"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=BFQEKi" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=egHiZI"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=egHiZI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.zevenseas.com/~f/blogs_robin?a=T5nXqi"&gt;&lt;img src="http://feeds.zevenseas.com/~f/blogs_robin?i=T5nXqi" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.zevenseas.com/~r/blogs_robin/~4/304697448" height="1" width="1"/&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Meure</dc:creator><pubDate>Wed, 04 Jun 2008 19:32:18 GMT</pubDate><feedburner:origLink>http://community.zevenseas.com/Blogs/Robin/archive/2008/06/04/want-to-write-moss-search-queries.aspx</feedburner:origLink></item></channel></rss>
