<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Thomas Conté - Microsoft France : MOSS</title><link>http://blogs.msdn.com/tconte/archive/tags/MOSS/default.aspx</link><description>Tags: MOSS</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>AJAX SharePoint picture gallery using Highslide</title><link>http://blogs.msdn.com/tconte/archive/2009/04/01/ajax-sharepoint-picture-gallery-using-highslide.aspx</link><pubDate>Wed, 01 Apr 2009 16:46:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9526674</guid><dc:creator>tconte</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/tconte/comments/9526674.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tconte/commentrss.aspx?PostID=9526674</wfw:commentRss><description>&lt;p&gt;Do you like &lt;a href="http://highslide.com/"&gt;Highslide&lt;/a&gt;? It’s a pretty neat JavaScript library that allows you to create AJAX thumbnail viewers and pop-up image galleries. It’s a really easy way to add some Web 2.0 flair to your site instead of displaying boring thumbnails.&lt;/p&gt;  &lt;p&gt;Now, SharePoint has an embedded “This week in pictures” Web Part but it’s pretty boring. There are a lot of Silverlight options out there, but I think &lt;a href="http://highslide.com/"&gt;Highslide&lt;/a&gt; is much simpler to implement… You don’t need to install any code on the server, you can do everything using SharePoint Designer!&lt;/p&gt;  &lt;p&gt;The trick is of course to use the Swiss Army knife of SharePoint Web Parts: the Data View! The idea is to point a Data View to a standard SharePoint picture library, and then tweak the XSLT in order to display the markup for Highslide.&lt;/p&gt;  &lt;p&gt;First, you need to &lt;a href="http://highslide.com/download.php"&gt;download Highslide&lt;/a&gt; and install it on your SharePoint. Just use SharePoint Designer to drop the “highslide” directory in any document library. In this example, I used my My Site as a sandbox, so I copied Highslide to the “My Pages” library.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/AJAXSharePointpicturegalleryusingHighsli_D6EF/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/AJAXSharePointpicturegalleryusingHighsli_D6EF/image_thumb.png" width="661" height="363" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then, you need to reference the library in your Master Page or your custom ASPX page. If you are working in a custom ASPX page, insert the code below into the “PlaceHolderAdditionalPageHead” placeholder. If you are working in a Master Page, just insert the code in the page header.&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/sites/tconte/My%20Pages/highslide/highslide-with-gallery.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/sites/tconte/My%20Pages/highslide/highslide.css&amp;quot; /&amp;gt;&lt;/pre&gt;

&lt;p&gt;Then, you will add some JavaScript configuration code. You can find &lt;a href="http://highslide.com/index.htm"&gt;many examples&lt;/a&gt; on the Highslide site, but here is what I use. Of course, make sure to change graphicsDir to point to the location where you installed Highslide!&lt;/p&gt;

&lt;pre class="brush: js;"&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    hs.graphicsDir = '/sites/tconte/My%20Pages/highslide/graphics/';
    hs.align = 'center';
    hs.transitions = ['expand', 'crossfade'];
    hs.outlineType = 'rounded-white';
    hs.fadeInOut = true;
    hs.numberPosition = 'caption';
    hs.dimmingOpacity = 0.75;
 
    // Add the controlbar
    if (hs.addSlideshow) hs.addSlideshow({
        //slideshowGroup: 'group1',
        interval: 5000,
        repeat: false,
        useControls: true,
        fixedControls: 'fit',
        overlayOptions: {
            opacity: .75,
            position: 'bottom center',
            hideOnMouseOut: true
        }
    });
&amp;lt;/script&amp;gt;&lt;/pre&gt;

&lt;p&gt;Next, you need to create the Data View Web Part. You will create it in SharePoint Designer: create an empty ASPX page, go to Data View –&amp;gt; Insert Data View, and a new Task Pane will open on the right hand side. It should show all the libraries in your SharePoint site. Select an image library, and select Show Data.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/AJAXSharePointpicturegalleryusingHighsli_D6EF/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/AJAXSharePointpicturegalleryusingHighsli_D6EF/image_thumb_1.png" width="281" height="458" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;In the Data Source Details pane that opens, you don’t need to do much because we will write most of the XSLT by hand anyway! Just select one field, like ID, and then do Insert Select Fields as… Multiple Item View. This will insert the basic control and parameters we need to then tweak the Data View by hand.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/AJAXSharePointpicturegalleryusingHighsli_D6EF/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/AJAXSharePointpicturegalleryusingHighsli_D6EF/image_thumb_2.png" width="262" height="256" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now, switch directly to Code view! You can have a look at the generated XSLT, it’s pretty simple. All we need to do is generate some really simple HTML that references the magic Highslide classes. Here’s an example:&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;xsl:stylesheet xmlns:x=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:d=&amp;quot;http://schemas.microsoft.com/sharepoint/dsp&amp;quot; version=&amp;quot;1.0&amp;quot; exclude-result-prefixes=&amp;quot;xsl msxsl ddwrt&amp;quot; xmlns:ddwrt=&amp;quot;http://schemas.microsoft.com/WebParts/v2/DataView/runtime&amp;quot; xmlns:asp=&amp;quot;http://schemas.microsoft.com/ASPNET/20&amp;quot; xmlns:__designer=&amp;quot;http://schemas.microsoft.com/WebParts/v2/DataView/designer&amp;quot; xmlns:xsl=&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot; xmlns:msxsl=&amp;quot;urn:schemas-microsoft-com:xslt&amp;quot; xmlns:SharePoint=&amp;quot;Microsoft.SharePoint.WebControls&amp;quot; xmlns:ddwrt2=&amp;quot;urn:frontpage:internal&amp;quot;&amp;gt;
&amp;lt;xsl:output method=&amp;quot;html&amp;quot; indent=&amp;quot;no&amp;quot;/&amp;gt;
&amp;lt;xsl:decimal-format NaN=&amp;quot;&amp;quot;/&amp;gt;
    &amp;lt;xsl:param name=&amp;quot;dvt_apos&amp;quot;&amp;gt;&amp;amp;apos;&amp;lt;/xsl:param&amp;gt;
    &amp;lt;xsl:variable name=&amp;quot;dvt_1_automode&amp;quot;&amp;gt;0&amp;lt;/xsl:variable&amp;gt;
    &amp;lt;xsl:template match=&amp;quot;/&amp;quot;&amp;gt;
        &amp;lt;xsl:call-template name=&amp;quot;dvt_1&amp;quot;/&amp;gt;
    &amp;lt;/xsl:template&amp;gt;
    &amp;lt;xsl:template name=&amp;quot;dvt_1&amp;quot;&amp;gt;
        &amp;lt;xsl:call-template name=&amp;quot;dvt_1.body&amp;quot;&amp;gt;
            &amp;lt;xsl:with-param name=&amp;quot;Rows&amp;quot; select=&amp;quot;/dsQueryResponse/Rows/Row[1]&amp;quot; /&amp;gt;
        &amp;lt;/xsl:call-template&amp;gt;
        &amp;lt;div class=&amp;quot;hidden-container&amp;quot;&amp;gt;
        &amp;lt;xsl:call-template name=&amp;quot;dvt_1.body&amp;quot;&amp;gt;
            &amp;lt;xsl:with-param name=&amp;quot;Rows&amp;quot; select=&amp;quot;/dsQueryResponse/Rows/Row[position()&amp;amp;gt;1]&amp;quot; /&amp;gt;
        &amp;lt;/xsl:call-template&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/xsl:template&amp;gt;
    &amp;lt;xsl:template name=&amp;quot;dvt_1.body&amp;quot;&amp;gt;
        &amp;lt;xsl:param name=&amp;quot;Rows&amp;quot; /&amp;gt;
        &amp;lt;xsl:for-each select=&amp;quot;$Rows&amp;quot;&amp;gt;
            &amp;lt;xsl:call-template name=&amp;quot;dvt_1.rowview&amp;quot; /&amp;gt;
        &amp;lt;/xsl:for-each&amp;gt;
    &amp;lt;/xsl:template&amp;gt;
    &amp;lt;xsl:template name=&amp;quot;dvt_1.rowview&amp;quot;&amp;gt;
        &amp;lt;a href=&amp;quot;{@FileRef}&amp;quot; class=&amp;quot;highslide&amp;quot; onclick=&amp;quot;return hs.expand(this)&amp;quot;&amp;gt;&amp;lt;img border=&amp;quot;0&amp;quot; src=&amp;quot;{concat('/',@FileDirRef,'/_t/',substring(@LinkFilenameNoMenu,1,string-length(@LinkFilenameNoMenu)-4),'_',@FileType,'.jpg')}&amp;quot; alt=&amp;quot;{@NameOrTitle}&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;
        &amp;lt;div class=&amp;quot;highslide-caption&amp;quot;&amp;gt;&amp;lt;xsl:value-of select=&amp;quot;@NameOrTitle&amp;quot;/&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;/xsl:template&amp;gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;/pre&gt;

&lt;p&gt;Here are a few clues as to what this XSLT does:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;It just displays thumbnails of all the images in the image library&lt;/li&gt;

  &lt;li&gt;The thumbnails are taken from the SharePoint image gallery, using the magic formula:&lt;/li&gt;

  &lt;ul&gt;
    &lt;li&gt;concat('/',@FileDirRef,'/_t/',substring(@LinkFilenameNoMenu,1,string-length(@LinkFilenameNoMenu)-4),'_',@FileType,'.jpg')&lt;/li&gt;

    &lt;li&gt;(XSLT is so obfuscated, it reminds me of Perl regular expressions!)&lt;/li&gt;
  &lt;/ul&gt;

  &lt;li&gt;The first picture is treated separately and becomes the thumbnail for the gallery; the following pictures are enclosed in a specific div that is handled by Highslide.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This should get your mostly started! You may need to perform additional configuration on the Data View, such as filterting or sorting stuff so that you get exactly the pictures you want.&lt;/p&gt;

&lt;p&gt;And of course the final result:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/AJAXSharePointpicturegalleryusingHighsli_D6EF/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/AJAXSharePointpicturegalleryusingHighsli_D6EF/image_thumb_3.png" width="607" height="484" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9526674" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tconte/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>Porting the Silverlight Blueprints for SharePoint to Silverlight 2 Beta2</title><link>http://blogs.msdn.com/tconte/archive/2008/06/16/porting-the-silverlight-blueprints-for-sharepoint-to-silverlight-2-beta2.aspx</link><pubDate>Mon, 16 Jun 2008 19:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8605922</guid><dc:creator>tconte</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/tconte/comments/8605922.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tconte/commentrss.aspx?PostID=8605922</wfw:commentRss><description>&lt;P&gt;The &lt;A href="http://weblogs.asp.net/scottgu/archive/2008/06/06/silverlight-2-beta2-released.aspx" mce_href="http://weblogs.asp.net/scottgu/archive/2008/06/06/silverlight-2-beta2-released.aspx"&gt;recently released Beta2 of Silverlight 2&lt;/A&gt; has unfortunately broken the &lt;A href="http://www.ssblueprints.net/sharepoint/" mce_href="http://www.ssblueprints.net/sharepoint/"&gt;Silverlight Blueprints for SharePoint&lt;/A&gt;. The team has announced on their CodePlex site that they will release a new version for Beta2, but in the meantime, here's a summary of what I changed to make the Blueprints run on Beta2.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/PortingtheSilverlightBlueprintsforShareP_1024D/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/PortingtheSilverlightBlueprintsforShareP_1024D/image_2.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=484 alt="Yup, running on Beta2" src="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/PortingtheSilverlightBlueprintsforShareP_1024D/image_thumb.png" width=405 border=0 mce_src="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/PortingtheSilverlightBlueprintsforShareP_1024D/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;First, a caveat: I only ported the MediaViewer control, a.k.a. the "Picture Viewer Sample" because that's what I needed. Other samples may require more work!&lt;/P&gt;
&lt;P&gt;The main problem I had when I upgraded to Beta2 is the change to HttpWebRequest behavior: its delegates are now called on a background thread, which means you have to change the way it is used in the current Blueprints code (which was written for Beta1, where HttpWebRequest delegates were called on the main UI thread).&lt;/P&gt;
&lt;P&gt;Thanks to scorb's &lt;A href="http://scorbs.com/2008/04/05/silverlight-http-networking-stack-part-1-site-of-origin-communication/" mce_href="http://scorbs.com/2008/04/05/silverlight-http-networking-stack-part-1-site-of-origin-communication/"&gt;great post on Silverlight HTTP networking&lt;/A&gt;, here's what I changed:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Moved the call to request.BeginGetResponse()&amp;nbsp;from BuildPreviewBar() to the end of RequestCallback(), so that it is called on the background thread&lt;/LI&gt;
&lt;LI&gt;Hacked the ResponseCallback() method so that it calls back to the main UI thread to set up the thumbnails etc. (using System.Threading.SynchronizationContext)&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;And that's about it!&lt;/P&gt;
&lt;P&gt;Attached to this post: the modified source code for Page.xaml.cs in SL.XAML.MediaViewer.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8605922" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/tconte/attachment/8605922.ashx" length="13906" type="text/plain" /><category domain="http://blogs.msdn.com/tconte/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>Live Search Web Part, Part 2</title><link>http://blogs.msdn.com/tconte/archive/2007/10/02/live-search-web-part-part-2.aspx</link><pubDate>Tue, 02 Oct 2007 14:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5241529</guid><dc:creator>tconte</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/tconte/comments/5241529.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tconte/commentrss.aspx?PostID=5241529</wfw:commentRss><description>&lt;P&gt;I realized that it may not be immediately obvious to everybody how you can customize the MOSS Search Center to add the Live Search Web Part I blogged about. It is really very simple.&lt;/P&gt;
&lt;P&gt;The Theory: all you need to do is to create new "Live" tabs on the Search Center (one for Search and one for Results), plus the corresponding "Search" and "Results" pages (all from the Web interface). Don't forget to modify the Search Boxes to point to the corresponding new pages. Then, you just import the attached Web Part on to your Results pages, and it will automatically use the current query and display the results in the Search Center.&lt;/P&gt;
&lt;P&gt;The Practice: here's a quick screencast that shows how to do it: &lt;A href="http://screencast.com/t/CYzcXjXULng" mce_href="http://screencast.com/t/CYzcXjXULng"&gt;configuring the Live Search Web Part&lt;/A&gt; on screencast.com!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5241529" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tconte/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>Live Search Web Part</title><link>http://blogs.msdn.com/tconte/archive/2007/10/02/live-search-web-part.aspx</link><pubDate>Tue, 02 Oct 2007 14:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5241281</guid><dc:creator>tconte</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/tconte/comments/5241281.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tconte/commentrss.aspx?PostID=5241281</wfw:commentRss><description>&lt;p&gt;I have pre-configured a Web Part for MOSS that you can just drop on to a Search Center results page. It will run the current query on Live Search and display the results. It is built using SharePoint Designer, the Data Form Web Part, and the &lt;a href="http://msdn2.microsoft.com/en-us/library/bb251794.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb251794.aspx"&gt;Live Search SOAP API&lt;/a&gt;. It automatically retrieves the current search keywords from the Query String, and you can also edit a couple of static parameters in the .webpart file.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/LiveSearchWebPart_AA42/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/LiveSearchWebPart_AA42/image_2.png"&gt;&lt;img src="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/LiveSearchWebPart_AA42/image_thumb.png" style="border-width: 0px;" alt="image" mce_src="http://blogs.msdn.com/blogfiles/tconte/WindowsLiveWriter/LiveSearchWebPart_AA42/image_thumb.png" border="0" height="484" width="573"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Nota bene: the Web Part is contained in the MSN_Search_Service.webpart file attached to this post: 8 KB only, and no code required!&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5241281" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/tconte/attachment/5241281.ashx" length="8542" type="application/octet-stream" /><category domain="http://blogs.msdn.com/tconte/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>Batch loading InfoPath Forms in SharePoint 2007</title><link>http://blogs.msdn.com/tconte/archive/2007/09/14/batch-loading-infopath-forms-in-sharepoint-2007.aspx</link><pubDate>Fri, 14 Sep 2007 14:59:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4909459</guid><dc:creator>tconte</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/tconte/comments/4909459.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tconte/commentrss.aspx?PostID=4909459</wfw:commentRss><description>&lt;p&gt;I have recently been asked to batch load a bunch of InfoPath Forms into a SharePoint Server for access via Forms Server. The customer had a database extract, in the form of a CSV file, and they wanted to convert this data into pre-filled forms, and then load the forms into SharePoint Server. They also wanted to apply some specific ACLs on the forms, because they contained some confidential content.&lt;/p&gt; &lt;p&gt;I looked a little bit around for a ready-made solution, but couldn't find an easy way to use CSV data to pre-generate InfoPath Forms &amp;amp; upload them to SharePoint, so I decided to write a little C# program to solve the problem.&lt;/p&gt; &lt;p&gt;Basically, I divided the problem in 3 chunks:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Convert the CSV file into generic XML  &lt;li&gt;Convert the generic XML into proper InfoPath XML using an XSLT  &lt;li&gt;Upload the generated XML file into SharePoint and modify the ACLs programmatically &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;1. Converting the CSV into XML&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I could probably just use Excel's XML capabilities to do this, but I wanted to automate all the steps in a single program. After digging a bit around the Web, I found this simple solution: &lt;a href="http://msdn2.microsoft.com/en-us/library/aa302293.aspx"&gt;XmlCsvReader&lt;/a&gt; on MSDN (and a &lt;a href="http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=DDE579F1-836A-4562-A3CB-57A7DBBEBAE0"&gt;slightly newer&lt;/a&gt; version on CodePlex). It's an implementation of an XmlReader that reads CSV input and generates an XML stream. It's really nifty and allows you to convert from CSV to XML very simply:&lt;/p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;pre class="csharpcode"&gt;XmlDocument doc = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlDocument();
XmlCsvReader reader = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlCsvReader(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;"file:///C:/temp/StatusReportData.csv"&lt;/span&gt;), Encoding.UTF8, doc.NameTable);
reader.FirstRowHasColumnNames = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
doc.Load(reader);&lt;/pre&gt;
&lt;p&gt;I started with this data:&lt;/p&gt;&lt;pre&gt;Date,Project,Prepared By,Manager,E-Mail,Department
1-1-2007,1,Thomas Conté,Harry Cover,tconte@microsoft.com,Finance
2-1-2007,2,Bernard Barnier,Harry Cover,bbarnier@microsoft.com,Finance
3-1-2007,3,Charles Duchemin,Harry Cover,cduchemin@microsoft.com,Finance
4-1-2007,1,Ludovic Cruchot,Harry Cover,lcruchot@microsoft.com,HR
5-1-2007,2,Claude Ratinier,Harry Cover,cratinier@microsoft.com,HR
6-1-2007,3,Jean Durand,Paul Dugenou,jdurand@microsoft.com,HR
7-1-2007,1,Paul Martin,Paul Dugenou,pmartin@microsoft.com,HR
8-1-2007,2,Gaston Lagaffe,Paul Dugenou,glagaffe@microsoft.com,IT
9-1-2007,3,Paul Marcel,Paul Dugenou,pmarcel@microsoft.com,IT
10-1-2007,1,Marcel Paul,Paul Dugenou,mpaul@microsoft.com,IT
&lt;/pre&gt;
&lt;p&gt;And XmlCsvReader generates an XML document that looks like this:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&amp;lt;root&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;row&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Date&amp;gt;1-1-2007&amp;lt;/Date&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Project&amp;gt;1&amp;lt;/Project&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Prepared_x0020_By&amp;gt;Thomas Conté&amp;lt;/Prepared_x0020_By&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Manager&amp;gt;Harry Cover&amp;lt;/Manager&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;E-Mail&amp;gt;tconte@microsoft.com&amp;lt;/E-Mail&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Department&amp;gt;Finance&amp;lt;/Department&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/row&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;row&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Date&amp;gt;2-1-2007&amp;lt;/Date&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Project&amp;gt;2&amp;lt;/Project&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Prepared_x0020_By&amp;gt;Bernard Barnier&amp;lt;/Prepared_x0020_By&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Manager&amp;gt;Harry Cover&amp;lt;/Manager&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;E-Mail&amp;gt;bbarnier@microsoft.com&amp;lt;/E-Mail&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Department&amp;gt;Finance&amp;lt;/Department&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/row&amp;gt;&lt;br&gt;&amp;lt;/root&amp;gt;&lt;/pre&gt;
&lt;p&gt;The complete document contains one row element for each line in the original CSV file. Now I need to break up this document in chunks, and convert each row element into a properly formatted InfoPath XML document.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;2. Converting the XML into an InfoPath document&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;An InfoPath document, or form, is just a regular XML file, with a couple of XML Processing Instructions that indicate that the XML file is indeed an InfoPath form. These two expressions, that must be present at the top of the XML file, are:&lt;/p&gt;&lt;pre&gt;&amp;lt;?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.2"&amp;gt;&lt;/pre&gt;
&lt;p&gt;and the mso-infoPathSolution instruction that indicates, among other things, the location of the for template.&lt;/p&gt;
&lt;p&gt;Now, our base data being XML and the target InfoPath document being XML as well, the easiest way to convert from one to the other is of course to use an XSL Transformation (XSLT). This XSLT will simply output the InfoPath XML document, while inserting the data from our generic XML file in the right places. The easiest way to create the XSLT is to start from the target InfoPath XML: use the InfoPath client (or SharePoint Forms Server) to create an empty form. Then open the resulting XML file using your favorite text editor, and copy the whole XML skeleton into the body of your XSLT. The result, including the processing instructions, will look like this:&lt;/p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="html"&gt;xml&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;encoding&lt;/span&gt;&lt;span class="kwrd"&gt;="UTF-8"&lt;/span&gt; ?&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:stylesheet&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:xsl&lt;/span&gt;&lt;span class="kwrd"&gt;="http://www.w3.org/1999/XSL/Transform"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:template&lt;/span&gt; &lt;span class="attr"&gt;match&lt;/span&gt;&lt;span class="kwrd"&gt;="row"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:processing-instruction&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="mso-infoPathSolution"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:text&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;name="urn:schemas-microsoft-com:office:infopath:Status-Reports:-myXSD-2005-09-22T20-42-56" solutionVersion="1.0.0.3" productVersion="12.0.0.0" PIVersion="1.0.0.0" href="http://w2k3sp2-spdev/SiteDirectory/infopath/Status%20Reports/Forms/template.xsn"&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;xsl:text&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;xsl:processing-instruction&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:processing-instruction&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="mso-application"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:text&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;progid="InfoPath.Document" versionProgid="InfoPath.Document.2"&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;xsl:text&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;xsl:processing-instruction&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;my:statusReport&lt;/span&gt; &lt;span class="attr"&gt;xmlns:xsi&lt;/span&gt;&lt;span class="kwrd"&gt;="http://www.w3.org/2001/XMLSchema-instance"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:xhtml&lt;/span&gt;&lt;span class="kwrd"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:my&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-09-22T20:42:56"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:xd&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/office/infopath/2003"&lt;/span&gt; &lt;span class="attr"&gt;xml:lang&lt;/span&gt;&lt;span class="kwrd"&gt;="en-US"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;my:reportDate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:value-of&lt;/span&gt; &lt;span class="attr"&gt;select&lt;/span&gt;&lt;span class="kwrd"&gt;="Date"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;my:reportDate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;my:projectName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:value-of&lt;/span&gt; &lt;span class="attr"&gt;select&lt;/span&gt;&lt;span class="kwrd"&gt;="Project"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;my:projectName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;my:preparedBy&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:value-of&lt;/span&gt; &lt;span class="attr"&gt;select&lt;/span&gt;&lt;span class="kwrd"&gt;="Prepared_x0020_By"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;my:preparedBy&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;my:emailAddress&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:value-of&lt;/span&gt; &lt;span class="attr"&gt;select&lt;/span&gt;&lt;span class="kwrd"&gt;="E-Mail"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;my:emailAddress&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;my:managerName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:value-of&lt;/span&gt; &lt;span class="attr"&gt;select&lt;/span&gt;&lt;span class="kwrd"&gt;="Manager"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;my:managerName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;my:departmentName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:value-of&lt;/span&gt; &lt;span class="attr"&gt;select&lt;/span&gt;&lt;span class="kwrd"&gt;="Department"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;my:departmentName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;my:summary&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;my:summary&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;Note that we insert our original XML file element values into the XSLT output, using xsl:value-of in the right places. Now, all we need to do is to actually apply this XSLT to our XML document:&lt;/p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;pre class="csharpcode"&gt;            XslCompiledTransform transform = &lt;span class="kwrd"&gt;new&lt;/span&gt; XslCompiledTransform();
            transform.Load(&lt;span class="str"&gt;"CSV2InfoPath.xslt"&lt;/span&gt;);

            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (XmlNode n &lt;span class="kwrd"&gt;in&lt;/span&gt; doc.DocumentElement.ChildNodes)
            {
                &lt;span class="kwrd"&gt;string&lt;/span&gt; fileName = n.ChildNodes[2].InnerText + &lt;span class="str"&gt;".xml"&lt;/span&gt;;
                &lt;span class="kwrd"&gt;string&lt;/span&gt; filePath = "C:\\temp\\" + fileName;
                StreamWriter writer = &lt;span class="kwrd"&gt;new&lt;/span&gt; StreamWriter(filePath);
                transform.Transform(n, &lt;span class="kwrd"&gt;null&lt;/span&gt;, writer);
                writer.Close();
&lt;/pre&gt;
&lt;p&gt;The key here is the XslCompiledTransform.Transform() method, that actually executes the transformation. Note that we iterate over our document's child nodes (i.e. row elements) and apply the XSLT to each chunk. In this example, the result is written to a temporary file on the disk, so that you can actually test the result by opening it with InfoPath.&lt;/p&gt;
&lt;p&gt;Congratulations, you just converted a CSV data export into a bunch of InfoPath forms!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;3. Upload the forms to SharePoint&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The last part of our little operation is to actually publish the forms to a SharePoint Server, so that employees can open and update the forms using Forms Server (allowing them to complete these tasks using a Web browser, instead of having to edit the form on their desktop with the InfoPath client).&lt;/p&gt;
&lt;p&gt;Since my batch program was intended to run on the SharePoint server itself, I was able to use the SharePoint API directly to upload the form. The code is fairly straightforward:&lt;/p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;pre class="csharpcode"&gt;                SPWeb web = &lt;span class="kwrd"&gt;new&lt;/span&gt; SPSite(&lt;span class="str"&gt;"http://w2k3sp2-spdev/SiteDirectory/infopath"&lt;/span&gt;).OpenWeb();

                FileStream fStream = File.OpenRead(filePath);
                &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] contents = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[fStream.Length];
                fStream.Read(contents, 0, (&lt;span class="kwrd"&gt;int&lt;/span&gt;)fStream.Length);
                fStream.Close();

                web.Files.Add(&lt;span class="str"&gt;"Status%20Reports/"&lt;/span&gt; + fileName, contents);
&lt;/pre&gt;
&lt;p&gt;The last part is a bit more tricky: using SharePoint 2007 new Role Assignment API to automatically apply security settings on the uploaded forms; the idea being, for example, to make sure each form can only be edited by the corresponding employee. The code will look like this:&lt;/p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;pre class="csharpcode"&gt;                SPFile newFile = web.GetFile(&lt;span class="str"&gt;"Status%20Reports/"&lt;/span&gt; + fileName);
                newFile.Item.BreakRoleInheritance(&lt;span class="kwrd"&gt;false&lt;/span&gt;);
                SPRoleDefinitionCollection roleDefs = web.RoleDefinitions;
                SPRoleAssignmentCollection roleAssignments = newFile.Item.RoleAssignments;
                SPRoleAssignment newAssignment = &lt;span class="kwrd"&gt;new&lt;/span&gt; SPRoleAssignment(&lt;span class="str"&gt;"W2K3SP2-SPDEV\\SPUser"&lt;/span&gt;, &lt;span class="str"&gt;"email@toto.com"&lt;/span&gt;, &lt;span class="str"&gt;"SP User"&lt;/span&gt;, &lt;span class="str"&gt;""&lt;/span&gt;);
                newAssignment.RoleDefinitionBindings.Add(roleDefs[&lt;span class="str"&gt;"Read"&lt;/span&gt;]);
                roleAssignments.Add(newAssignment);
&lt;/pre&gt;
&lt;p&gt;In this code, we first use BreakRoleInheritance() to stop inheriting the ACLs from the library. We then retrieve the current site Role Definitions (i.e. "Read", "Contribute", "Full Control", etc.) We then create a new Role Assignment (for a test user called SPUser), apply the "Read" role to it, and add it to the RoleAssignments collection for the form we just uploaded.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4909459" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tconte/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>Outils &amp; techniques de développement sous WSS 3.0</title><link>http://blogs.msdn.com/tconte/archive/2007/06/20/outils-techniques-de-d-veloppement-sous-wss-3-0.aspx</link><pubDate>Wed, 20 Jun 2007 23:43:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3431058</guid><dc:creator>tconte</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/tconte/comments/3431058.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tconte/commentrss.aspx?PostID=3431058</wfw:commentRss><description>&lt;P&gt;Deux articles indispensables pour le développeur SharePoint viennent d'être publiés sur MSDN. En résumé, vous trouverez dans les première partie des informations sur les différences par rapport au développement pur ASP.NET, l'organisation de l'environnement de développement, et l'utilisation des Extensions Visual Studio 2005 pour WSS 3.0. La deuxième partie détaille la mise en oeuvre des "solutions" SharePoint pour packager, déployer mettre à jour des développements WSS.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/bb530302.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb530302.aspx"&gt;Première partie&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/bb530301.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb530301.aspx"&gt;Deuxième partie&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3431058" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tconte/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>SharePoint 2007 Membership Provider &amp;amp; Role Provider</title><link>http://blogs.msdn.com/tconte/archive/2007/02/24/sharepoint-2007-membership-provider-role-provider.aspx</link><pubDate>Sat, 24 Feb 2007 16:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1752495</guid><dc:creator>tconte</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/tconte/comments/1752495.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tconte/commentrss.aspx?PostID=1752495</wfw:commentRss><description>&lt;P&gt;I have recently had to implement custom authentication providers for MOSS 2007 (&lt;EM&gt;MembershipProvider&lt;/EM&gt; &amp;amp; &lt;EM&gt;RoleProvider&lt;/EM&gt;). While I found a lot of excellent information on the Web to help me with this task, I learned a couple of interesting snippets of information that I wanted to share here.&lt;/P&gt;
&lt;P&gt;First, let me summarize the different blog entries that helped me with the implementation:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Steve Peschka's entry, &lt;FONT size=2&gt;"&lt;A class="" href="http://blogs.msdn.com/sharepoint/archive/2006/08/16/702010.aspx" mce_href="http://blogs.msdn.com/sharepoint/archive/2006/08/16/702010.aspx"&gt;Configuring Multiple Authentication Providers for SharePoint 2007&lt;/A&gt;", is a good and detailed general article about MOSS authentication providers.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size=2&gt;Liam Cleary's series of articles (&lt;FONT size=2&gt;"Write your own Custom Authentication Provider") is even more detailed and contains step-by-step instructions: &lt;A class="" href="http://www.sharepointblogs.com/helloitsliam/archive/2006/12/11/16842.aspx" mce_href="http://www.sharepointblogs.com/helloitsliam/archive/2006/12/11/16842.aspx"&gt;Part 1&lt;/A&gt;, &lt;A class="" href="http://www.sharepointblogs.com/helloitsliam/archive/2006/12/12/16887.aspx" mce_href="http://www.sharepointblogs.com/helloitsliam/archive/2006/12/12/16887.aspx"&gt;Part 2&lt;/A&gt;, &lt;A class="" href="http://www.sharepointblogs.com/helloitsliam/archive/2006/12/14/16973.aspx" mce_href="http://www.sharepointblogs.com/helloitsliam/archive/2006/12/14/16973.aspx"&gt;Part 3&lt;/A&gt;, &lt;A class="" href="http://www.sharepointblogs.com/helloitsliam/archive/2006/12/16/17010.aspx" mce_href="http://www.sharepointblogs.com/helloitsliam/archive/2006/12/16/17010.aspx"&gt;Part 4&lt;/A&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt;Harshawardhan Chiplonkar4s entry, &lt;FONT size=2&gt;"&lt;A class="" href="http://blogs.msdn.com/harsh/archive/2007/01/10/forms-based-authentication-in-moss.aspx" mce_href="http://blogs.msdn.com/harsh/archive/2007/01/10/forms-based-authentication-in-moss.aspx"&gt;Forms Based Authentication in MOSS&lt;/A&gt;"&lt;/FONT&gt;,&amp;nbsp;contains a complete series of web.config examples.&lt;/LI&gt;&lt;/UL&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;One thing that wasn't clear to me is the minimal set of methods that I needed to implement in my custom providers to get MOSS to work. ASP.NET providers are very flexible and offer many entry points, but not all of them make sense in the SharePoint context; yet I couldn't find a definitive list of the methods SharePoint requires. After experimenting a bit and exchanging a few e-mails on internal mailing lists, here's what I gathered.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;The minimal set of methods to implement for a SharePoint Server 2007 MembershipProvider:&lt;/U&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;GetUser()&lt;/LI&gt;
&lt;LI&gt;GetUserNameByEmail()&lt;/LI&gt;
&lt;LI&gt;ValidateUser()&lt;/LI&gt;
&lt;LI&gt;FindUsersByEmail()&lt;/LI&gt;
&lt;LI&gt;FindUsersByName()&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;U&gt;The minimal set of methods to implement for a SharePoint Server 2007 RoleProvider:&lt;/U&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;GetRolesForUser()&lt;/LI&gt;
&lt;LI&gt;RoleExists()&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;TODO: call sequence, which methods are called when -- at login time, at rights assignment time&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;The last thing I learned is how the ASP.NET providers and MOSS interact to handle login names and display names. The trick here is that ASP.NET's MembershipUser class, which is used to represent users, does not include a "display name" property, which means that you have no way to pass a nice display name up to MOSS (e.g. "Thomas Conté"). So, the MOSS "Display Name" property ends up being equal to the MembershipProvider "UserName" property (e.g. "tconte"), which is not as nice. The other little detail to remember is that, because MOSS can deal with multiple custom authentication providers, it has to make your LoginName unique. In order to achieve that, it will prefix the UserName with the Provider Name property, e.g. "mycustomprovider:tconte".&lt;/P&gt;
&lt;P mce_keep="true"&gt;Hope this helps!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1752495" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tconte/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>Microsoft parmi les 10 meilleurs intranets de l'année</title><link>http://blogs.msdn.com/tconte/archive/2007/01/21/microsoft-parmi-les-10-meilleurs-intranets-de-l-ann-e.aspx</link><pubDate>Mon, 22 Jan 2007 00:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1504137</guid><dc:creator>tconte</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/tconte/comments/1504137.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tconte/commentrss.aspx?PostID=1504137</wfw:commentRss><description>&lt;P&gt;Microsoft est l'un des lauréats du prix du &lt;A class="" href="http://www.useit.com/alertbox/intranet_design.html" mce_href="http://www.useit.com/alertbox/intranet_design.html"&gt;meilleur intranet de l'année 2007&lt;/A&gt; décerné par &lt;A class="" href="http://www.useit.com/jakob/" mce_href="http://www.useit.com/jakob/"&gt;Jakob Nielsen&lt;/A&gt;, grand gourou de &lt;A class="" href="http://fr.wikipedia.org/wiki/Utilisabilit%C3%A9" mce_href="http://fr.wikipedia.org/wiki/Utilisabilit%C3%A9"&gt;l'utilisabilité&lt;/A&gt;. Le &lt;A class="" href="http://www.nngroup.com/reports/intranet/design/" mce_href="http://www.nngroup.com/reports/intranet/design/"&gt;rapport complet&lt;/A&gt; est payant, mais semble très riche en détails sur les fonctionnalités de ces différents intranets.&lt;/P&gt;
&lt;P&gt;Ce classement illustre évidemment la qualité des résultats que nous avons obtenu en interne en implémentant nos propres technologies, notamment Office SharePoint Server 2007. Mais si l'on regarde également&amp;nbsp;la liste des plate-formes technologiques les plus utilisées par l'ensemble de ces intranets, l'on voit que les technos Microsoft sont très bien représentées: Windows Server, SharePoint, SQL Server.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1504137" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tconte/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>Programmatically adding Web Parts to a page</title><link>http://blogs.msdn.com/tconte/archive/2007/01/18/programmatically-adding-web-parts-to-a-page.aspx</link><pubDate>Thu, 18 Jan 2007 23:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1490207</guid><dc:creator>tconte</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/tconte/comments/1490207.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tconte/commentrss.aspx?PostID=1490207</wfw:commentRss><description>&lt;P&gt;I have recently had to come up with a way to programmatically add a Web Part to a large number of existing publishing pages. It took me a little while to find the exact way to do it, so I thought I would post the source code here.&lt;/P&gt;
&lt;P&gt;Attached is the C# code that will iterate over a bunch of pages in a bunch of sites, and then add a doclib Web Part on all those pages, in a specific Web Part Zone. The meat of the code is this:&lt;/P&gt;&lt;CODE&gt;SPSite mySiteCollection = new SPSite("&lt;A href="http://sharepoint/" mce_href="http://sharepoint"&gt;http://sharepoint&lt;/A&gt;");&lt;BR&gt;SPWeb w = mySiteCollection.AllWebs["/whatever"];&lt;BR&gt;SPFile f = w.GetFile("Pages/Page.aspx");&lt;BR&gt;SPLimitedWebPartManager wpm = f.GetLimitedWebPartManager(PersonalizationScope.Shared);&lt;BR&gt;SPList l = w.Lists["Documents"];&lt;BR&gt;ListViewWebPart wp = new ListViewWebPart();&lt;BR&gt;wp.ListName = l.ID.ToString("B").ToUpper();&lt;BR&gt;wp.ViewGuid = l.DefaultView.ID.ToString("B").ToUpper();&lt;BR&gt;wpm.AddWebPart(wp, "Zone 1", 1);&lt;BR&gt;f.Publish("Added Web Part");&lt;BR&gt;f.Approve("Web Part addition approved");&lt;/CODE&gt; 
&lt;P mce_keep="true"&gt;This bit of code uses an SPLimitedWebPartManager to add the ListViewWebPart to the "Zone 1" Web Part Zone. The page is then published and approved.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1490207" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/tconte/attachment/1490207.ashx" length="2142" type="text/plain" /><category domain="http://blogs.msdn.com/tconte/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>SharePoint Test Data Load Tool</title><link>http://blogs.msdn.com/tconte/archive/2007/01/17/sharepoint-test-data-load-tool.aspx</link><pubDate>Wed, 17 Jan 2007 18:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1484115</guid><dc:creator>tconte</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/tconte/comments/1484115.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tconte/commentrss.aspx?PostID=1484115</wfw:commentRss><description>&lt;P&gt;A couple weeks ago, the SharePoint product team &lt;A class="" href="http://blogs.msdn.com/sharepoint/archive/2007/01/05/performance-updates-and-tool.aspx" mce_href="http://blogs.msdn.com/sharepoint/archive/2007/01/05/performance-updates-and-tool.aspx"&gt;announced&lt;/A&gt; the SharePoint Test Data Load Tool. You can find a brief &lt;A class="" href="http://technet2.microsoft.com/Office/en-us/library/301ed832-95da-4251-b266-7be6288f7ea01033.mspx?mfr=true" mce_href="http://technet2.microsoft.com/Office/en-us/library/301ed832-95da-4251-b266-7be6288f7ea01033.mspx?mfr=true"&gt;article on TechNet&lt;/A&gt; and &lt;A class="" href="http://www.codeplex.com/sptdatapop" mce_href="http://www.codeplex.com/sptdatapop"&gt;download the tool&lt;/A&gt; from CodePlex (as well as the full source code!)&lt;/P&gt;
&lt;P&gt;I have used a preliminary release of this tool on a recent project, and it's absolutely invaluable when you need to automatically generate large datasets (i.e. sites, document libraries, documents,&amp;nbsp;pages, etc.)&amp;nbsp;for performance testing. Of course, you could leverage the SharePoint API and write the provisioning code yourself, but this tool will allow you to use XML files to describe the data you want to generate, which makes the task much easier.&lt;/P&gt;
&lt;P&gt;For example, here's how you can create a hundred sites, and assign unique permissions to each of them:&lt;/P&gt;&lt;CODE&gt;&amp;lt;WSSDWLib&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;ForLoop name="i" start="1" end="100"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Webs name="site$i$" title="Site $i$" template="SiteBase.stp" uniqueperms="true"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;RoleAssigns name="SNCF\user$i$" roledefs="Reader" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/Webs&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;/ForLoop&amp;gt;&lt;BR&gt;&amp;lt;/WSSDWLib&amp;gt;&lt;BR&gt;&lt;/CODE&gt;
&lt;P mce_keep="true"&gt;Of course, you can also describe much more complex sets of actions; here's another one I used:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&amp;lt;WSSDWLib&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;SetVar count="0" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;ForLoop name="j" values="Sites1-10,Sites11-20,Sites21-30,Sites31-40,Sites41-50,Sites51-60,Sites61-70,Sites71-80,Sites81-90,Sites91-100"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Webs name="$j$" openmode="openexisting"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ForLoop name="i" start="1" end="10"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;SetVarEqu n="%count%+$i$" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Webs name="Site%n%" openmode="openexisting"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Lists name="Documents" openmode="openexisting"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Files sourcedir="C:\wsscollab\wssdataloading\WSSCollabCPData\testfiles\OfficeDocs" checkin="true" publish="true" approve="true" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Lists&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Webs&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/ForLoop&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/Webs&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;SetVarEqu count="%count%+10" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;/ForLoop&amp;gt;&lt;BR&gt;&amp;lt;/WSSDWLib&amp;gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;It iterates over a two-level hierarchy of a hundred sites, opens the Documents doclib in each of them, uploads a bunch of files, and then checks them in, approves them, and publishes them.&lt;/P&gt;
&lt;P mce_keep="true"&gt;You will find many more examples in the samples on CodePlex.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1484115" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tconte/archive/tags/MOSS/default.aspx">MOSS</category></item><item><title>OWA Web Part with single sign-on</title><link>http://blogs.msdn.com/tconte/archive/2007/01/17/owa-web-part-with-single-sign-on.aspx</link><pubDate>Wed, 17 Jan 2007 14:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1483099</guid><dc:creator>tconte</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/tconte/comments/1483099.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tconte/commentrss.aspx?PostID=1483099</wfw:commentRss><description>&lt;P&gt;Office SharePoint Server 2007 (aka MOSS2007), like SharePoint Portal Server 2003 before it, offers a built-in Web Part for integration with Outlook Web Access (aka OWA). Unfortunately, this Web Part has a number of limitations:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;It needs to be configured manually by the user in order to specify the OWA URL as well as the Inbox name&lt;/LI&gt;
&lt;LI&gt;It requires Windows Integrated Authentification for single sign-on (SSO) between SharePoint and OWA; this is fine in Intranet environments, but less practical in Extranet scenarios, where you will probably be using Forms or even Basic&amp;nbsp;authentication&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;There are already some good posts on the subject, for example &lt;A class="" title="Using OWA in a SharePoint Site." href="http://blog.spsclerics.com/archive/2005/11/04/22659.aspx" mce_href="http://blog.spsclerics.com/archive/2005/11/04/22659.aspx"&gt;this post on Renaud Comte's blog&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a recent project, I have written a couple of Web Parts that try to solve this problem. The approach I have used is a bit devious: both Web Parts will simulate an actual OWA login (in an IFrame) by filling in an HTML form replicating all the input fields of the original OWA login form; the form is automatically submitted using JavaScript, and the user is automatically signed in to OWA.&lt;/P&gt;
&lt;P mce_keep="true"&gt;The first Web Part will use the credentials from the HTTP Basic authentication headers.&lt;/P&gt;
&lt;P mce_keep="true"&gt;The second Web Part leverages MOSS' SSO service. It requires that you already have configured the SSO service, with a service name of "OWA" (but you can easily change that in the source code).&lt;/P&gt;
&lt;P mce_keep="true"&gt;Beware: both Web Parts will currently transmit the credentials to the IFrame in the clear, in the URL (as GET parameters).&lt;/P&gt;
&lt;P mce_keep="true"&gt;The attached ZIP file contains the Visual Studio 2005 project.&lt;/P&gt;
&lt;P mce_keep="true"&gt;You will find in the root directory two HTML files containing the OWA login forms, that are used by the Web Parts as the target of the IFrame. You should copy the appropriate file (either OWARedirect_2003.htm or OWARedirect_2007.htm) to your SharePoint's "layouts" directory, and rename the file to OWARedirect.htm. Don't forget to point the target for the form to your own OWA URL!&lt;/P&gt;
&lt;P mce_keep="true"&gt;This is obviously a hack, but here's hoping it will help somebody one day :-)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1483099" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/tconte/attachment/1483099.ashx" length="39883" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/tconte/archive/tags/MOSS/default.aspx">MOSS</category></item></channel></rss>