<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://community.bartdesmet.net/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>B# .NET Blog : IW stuff - Office, SharePoint, IBF</title><link>http://community.bartdesmet.net/blogs/bart/archive/tags/IW+stuff+-+Office_2C00_+SharePoint_2C00_+IBF/default.aspx</link><description>Tags: IW stuff - Office, SharePoint, IBF</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20423.869)</generator><item><title>LINQ to SharePoint - 0.1.2.0 Alpha release available now</title><link>http://community.bartdesmet.net/blogs/bart/archive/2007/04/22/linq-to-sharepoint-0-1-2-0-alpha-release-available-now.aspx</link><pubDate>Sun, 22 Apr 2007 23:43:18 GMT</pubDate><guid isPermaLink="false">863c5522-913f-4a64-ac0a-bd5f05abad0f:12473</guid><dc:creator>bart</dc:creator><slash:comments>14</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://community.bartdesmet.net/blogs/bart/rsscomments.aspx?PostID=12473</wfw:commentRss><comments>http://community.bartdesmet.net/blogs/bart/archive/2007/04/22/linq-to-sharepoint-0-1-2-0-alpha-release-available-now.aspx#comments</comments><description>&lt;p&gt;It's been a long ten days since the first &lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2007/04/13/coming-soon-the-return-of-iqueryable-t-linq-to-sharepoint.aspx"&gt;announcement&lt;/a&gt; of the LINQ to SharePoint&amp;nbsp;project, with lots of implementation and testing work but tonight I'm very excited to announce the availability of the &lt;strong&gt;&lt;font color="#008000"&gt;first public alpha&lt;/font&gt;&lt;/strong&gt; of the &lt;a href="http://www.codeplex.com/LINQtoSharePoint/"&gt;LINQ to SharePoint&lt;/a&gt; project. A few highlights of this release:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Supports writing LINQ queries for SharePoint lists in both &lt;strong&gt;C# 3.0 &lt;/strong&gt;and &lt;strong&gt;Visual Basic 9.0&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;The &lt;strong&gt;SpMetal&lt;/strong&gt; entity type creation tool supports both C# 3.0 and Visual Basic 9.0&lt;/li&gt; &lt;li&gt;Talks to SharePoint over &lt;strong&gt;web services&lt;/strong&gt; or though the &lt;strong&gt;SharePoint Object Model&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;Most &lt;strong&gt;CAML&lt;/strong&gt; query constructs are&amp;nbsp;available via LINQ&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;The current alpha release is built for the &lt;strong&gt;&lt;font color="#008000"&gt;Orcas March 07 CTP&lt;/font&gt;&lt;/strong&gt;. An update for Orcas Beta 1 will follow later.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;For more information, visit the following pages:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.codeplex.com/LINQtoSharePoint/"&gt;LINQ to SharePoint homepage&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.codeplex.com/LINQtoSharePoint/Wiki/View.aspx?title=Samples&amp;amp;referringTitle=Home"&gt;Samples and getting started&lt;/a&gt;&amp;nbsp;(&lt;font color="#008000"&gt;&lt;font color="#000000"&gt;watch the &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;getting started videos&lt;/strong&gt;&lt;/font&gt;)&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.codeplex.com/LINQtoSharePoint/Release/ProjectReleases.aspx?ReleaseId=3637"&gt;Download the 0.1.2.0 release&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.codeplex.com/LINQtoSharePoint/Project/License.aspx"&gt;Licensing information&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;Warning:&lt;/strong&gt; This release is an alpha release; use it at your own risk. You shouldn't use the alpha release in any production environment whatsoever.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;A little &lt;strong&gt;&lt;font color="#0000ff"&gt;sample&lt;/font&gt;&lt;/strong&gt; of a (very simple) LINQ to SharePoint query in C# and VB:&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:949e92bc-a995-457e-9d63-fb6b9173fd8c" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;C# 3.0 LINQ-to-SharePoint query&lt;pre style="width:100%;"&gt;&lt;div&gt;&lt;span style="color:#999999;"&gt; 1&lt;/span&gt; &lt;span style="color:#000000;"&gt;var users &lt;/span&gt;&lt;span style="color:#000000;"&gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;new&lt;/span&gt;&lt;span style="color:#000000;"&gt; SharePointDataSource&lt;/span&gt;&lt;span style="color:#000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;User&lt;/span&gt;&lt;span style="color:#000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;(&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;new&lt;/span&gt;&lt;span style="color:#000000;"&gt; Uri(&lt;/span&gt;&lt;span style="color:#800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#800000;"&gt;http://wss.mycompany.local&lt;/span&gt;&lt;span style="color:#800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#000000;"&gt;));
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 2&lt;/span&gt; &lt;span style="color:#000000;"&gt;
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 3&lt;/span&gt; &lt;span style="color:#000000;"&gt;var res &lt;/span&gt;&lt;span style="color:#000000;"&gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; from u &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;in&lt;/span&gt;&lt;span style="color:#000000;"&gt; users
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 4&lt;/span&gt; &lt;span style="color:#000000;"&gt;          orderby u.Birthdate descending
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 5&lt;/span&gt; &lt;span style="color:#000000;"&gt;          &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;where&lt;/span&gt;&lt;span style="color:#000000;"&gt; u.FirstName.StartsWith(&lt;/span&gt;&lt;span style="color:#800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#800000;"&gt;B&lt;/span&gt;&lt;span style="color:#800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#000000;"&gt;) &lt;/span&gt;&lt;span style="color:#000000;"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style="color:#000000;"&gt; u.Age &lt;/span&gt;&lt;span style="color:#000000;"&gt;&amp;gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#800080;"&gt;24&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style="color:#000000;"&gt; u.FavoriteFood &lt;/span&gt;&lt;span style="color:#000000;"&gt;==&lt;/span&gt;&lt;span style="color:#000000;"&gt; FavoriteFood.Pizza
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 6&lt;/span&gt; &lt;span style="color:#000000;"&gt;          select &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;new&lt;/span&gt;&lt;span style="color:#000000;"&gt; { u.FullName, u.Age, Interest &lt;/span&gt;&lt;span style="color:#000000;"&gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; u.AccountBalance &lt;/span&gt;&lt;span style="color:#000000;"&gt;*&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#800080;"&gt;0.07&lt;/span&gt;&lt;span style="color:#000000;"&gt; };
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 7&lt;/span&gt; &lt;span style="color:#000000;"&gt; 
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 8&lt;/span&gt; &lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;foreach&lt;/span&gt;&lt;span style="color:#000000;"&gt; (var u &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;in&lt;/span&gt;&lt;span style="color:#000000;"&gt; res)
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 9&lt;/span&gt; &lt;span style="color:#000000;"&gt;    Console.WriteLine(u);
&lt;/span&gt;&lt;span style="color:#999999;"&gt;10&lt;/span&gt; &lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
&lt;div class="wlWriterSmartContent" id="F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:b27fd13c-93ac-4780-ac16-f51c2e89587c" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;VB 9.0 LINQ-to-SharePoint query&lt;pre style="width:100%;"&gt;&lt;div&gt;&lt;span style="color:#999999;"&gt; 1&lt;/span&gt; &lt;span style="color:#0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color:#000000;"&gt; users &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;As&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;New&lt;/span&gt;&lt;span style="color:#000000;"&gt; SharePointDataSource(&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;Of&lt;/span&gt;&lt;span style="color:#000000;"&gt; User)(&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;New&lt;/span&gt;&lt;span style="color:#000000;"&gt; Uri(&lt;/span&gt;&lt;span style="color:#800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#800000;"&gt;http://wss.mycompany.local&lt;/span&gt;&lt;span style="color:#800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#000000;"&gt;))
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 2&lt;/span&gt; &lt;span style="color:#000000;"&gt;
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 3&lt;/span&gt; &lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color:#000000;"&gt; res &lt;/span&gt;&lt;span style="color:#000000;"&gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; From u &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;In&lt;/span&gt;&lt;span style="color:#000000;"&gt; users _
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 4&lt;/span&gt; &lt;span style="color:#000000;"&gt;          Order By u.Birthdate Descending _
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 5&lt;/span&gt; &lt;span style="color:#000000;"&gt;          Where u.FirstName.StartsWith(&lt;/span&gt;&lt;span style="color:#800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#800000;"&gt;B&lt;/span&gt;&lt;span style="color:#800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#000000;"&gt;) &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;And&lt;/span&gt;&lt;span style="color:#000000;"&gt; u.Age &lt;/span&gt;&lt;span style="color:#000000;"&gt;&amp;gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#800080;"&gt;24&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;And&lt;/span&gt;&lt;span style="color:#000000;"&gt; u.FavoriteFood.Value &lt;/span&gt;&lt;span style="color:#000000;"&gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; FavoriteFood.Pizza _
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 6&lt;/span&gt; &lt;span style="color:#000000;"&gt;          &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;Select&lt;/span&gt;&lt;span style="color:#000000;"&gt; u.FullName, u.Age, Interest &lt;/span&gt;&lt;span style="color:#000000;"&gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt; u.AccountBalance.Value &lt;/span&gt;&lt;span style="color:#000000;"&gt;*&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#800080;"&gt;0.07&lt;/span&gt;&lt;span style="color:#000000;"&gt;
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 7&lt;/span&gt; &lt;span style="color:#000000;"&gt;
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 8&lt;/span&gt; &lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;For&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;Each&lt;/span&gt;&lt;span style="color:#000000;"&gt; u &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;In&lt;/span&gt;&lt;span style="color:#000000;"&gt; res
&lt;/span&gt;&lt;span style="color:#999999;"&gt; 9&lt;/span&gt; &lt;span style="color:#000000;"&gt;    Console.WriteLine(u)
&lt;/span&gt;&lt;span style="color:#999999;"&gt;10&lt;/span&gt; &lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;Next&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Much more complicated queries are supported though, allowing you to focus on the query itself rather than on the &lt;strong&gt;&lt;font color="#ff8000"&gt;CAML plumbing&lt;/font&gt;&lt;/strong&gt;. A list of a few complexities that LINQ-to-SharePoint can deal with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Recursive parsing of query trees and translation of boolean negation into normal forms using De Morgan's laws.&lt;/li&gt;
&lt;li&gt;Analysis of projection operations to create a list of required fields in the query to reduce bandwith.&lt;/li&gt;
&lt;li&gt;Condition analysis and validation required for translation to supported CAML constructs.&lt;/li&gt;
&lt;li&gt;Nullable type support language differences between VB and C#.&lt;/li&gt;
&lt;li&gt;MultiChoice-to-enum mapping and support for fill-in choices.&lt;/li&gt;
&lt;li&gt;Visual Basic's runtime libraries for string comparisons.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;&lt;/font&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;Please report any issues with the software via the project website. You feedback is highly appreciated!&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://community.bartdesmet.net/aggbug.aspx?PostID=12473" width="1" height="1"&gt;</description><category domain="http://community.bartdesmet.net/blogs/bart/archive/tags/IW+stuff+-+Office_2C00_+SharePoint_2C00_+IBF/default.aspx">IW stuff - Office, SharePoint, IBF</category><category domain="http://community.bartdesmet.net/blogs/bart/archive/tags/C_2300_+3.0/default.aspx">C# 3.0</category><category domain="http://community.bartdesmet.net/blogs/bart/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://community.bartdesmet.net/blogs/bart/archive/tags/LINQ/default.aspx">LINQ</category></item><item><title>About "My Network Places", Nethood, target.lnk and attrib</title><link>http://community.bartdesmet.net/blogs/bart/archive/2005/09/23/3554.aspx</link><pubDate>Fri, 23 Sep 2005 08:17:00 GMT</pubDate><guid isPermaLink="false">863c5522-913f-4a64-ac0a-bd5f05abad0f:3554</guid><dc:creator>bart</dc:creator><slash:comments>8</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://community.bartdesmet.net/blogs/bart/rsscomments.aspx?PostID=3554</wfw:commentRss><comments>http://community.bartdesmet.net/blogs/bart/archive/2005/09/23/3554.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Today I've been playing around to find a mechanism to update the My Network Places folder in a network environment to contain links to all SharePoint Document Libraries on a given server. I still have to put pieces together and fill in missing links, but here are some frustrating things I've been sailing around :o. Notice that all of the following only works on a machine with Office 2003 (maybe earlier releases too) to introduce the notion of "web folders" in the shell.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;1. My Network Places contains links to - guess what - network locations. These are stored in %HOMEPATH%\Nethood under a user's profile in the form of folders (which have the name of the link that appears in the list in Windows Explorer) containing two files: target.lnk and desktop.ini&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;2. target.lnk is the hardest one to get right. Up till now, I've not found a way to create such a link programmatically (doing a lot of P/Invoke and interop stuff in C#). The pieces of the puzzle are called &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/ishelllink/ishelllink.asp"&gt;IShellLink&lt;/A&gt;, it's method &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/ishelllink/SetIDList.asp"&gt;SetIDList&lt;/A&gt;, &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/namespace.asp"&gt;PIDL&lt;/A&gt;&amp;nbsp;and &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shgetfolderlocation.asp"&gt;SHGetFolderLocation&lt;/A&gt;&amp;nbsp;and CSIDL_NETHOOD. If someone finds a way to create a .lnk file to a web folder using these pieces of the puzzle, let me know (C# managed code preferred, but WSH/VBScript or C++ solutions are also welcome). In most cases, the file was renamed to a .url file which is handled by IE.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;3. desktop.ini contains the following:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;[.ShellClassInfo]&lt;BR&gt;CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}&lt;BR&gt;Flags=2&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;4. Retrieving all document libraries in all subwebs of a given SharePoint site was a piece of cake using the SharePoint .asmx files. You can find the code of my "crawler" over here in a zip file: &lt;A href="http://www.bartdesmet.net/download/SharePointWebCrawler.zip"&gt;sharepointwebcrawler.zip&lt;/A&gt;. It retrieves the title and url of every document library it can find recursively. Please notice this code can be improved further, especially the tricky part to extract the document library's base URL.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;5. Once you have the list of all document libraries (URL + title) you need to create the target.lnk files and the folders. Right now, this is the missing link in my solution (see point&amp;nbsp;2 above) and requires manual interaction.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;6. Deploy the created .lnk files to all target machines. If you thought it was as easy as doing xcopy of the entire Nethood folder, you're wrong. Okay, it's basically that but first you should not forget to copy the hidden desktop.ini file too, and second, &lt;U&gt;all folders need to be marked as read-only&lt;/U&gt; (otherwise these don't appear as "shortcuts" but as normal folders containing a target.lnk file). I did end up with something like this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;cd %USERPROFILE%\Nethood&lt;BR&gt;xcopy /E /H&amp;nbsp;%SOURCEDIR% .&lt;BR&gt;attrib +R /D /S .*&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;What a nightmare :s. Dreaming of .lnk files to become XML-files :-).&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://community.bartdesmet.net/aggbug.aspx?PostID=3554" width="1" height="1"&gt;</description><category domain="http://community.bartdesmet.net/blogs/bart/archive/tags/IW+stuff+-+Office_2C00_+SharePoint_2C00_+IBF/default.aspx">IW stuff - Office, SharePoint, IBF</category></item><item><title>SharePoint Web Services - Obtain a collection of lists</title><link>http://community.bartdesmet.net/blogs/bart/archive/2005/08/10/3442.aspx</link><pubDate>Wed, 10 Aug 2005 23:03:00 GMT</pubDate><guid isPermaLink="false">863c5522-913f-4a64-ac0a-bd5f05abad0f:3442</guid><dc:creator>bart</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://community.bartdesmet.net/blogs/bart/rsscomments.aspx?PostID=3442</wfw:commentRss><comments>http://community.bartdesmet.net/blogs/bart/archive/2005/08/10/3442.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Since a couple of weeks now I'm involved in a SharePoint development project for a local company based in Belgium. Dedicated to this topic, I've create a post category called &lt;A href="http://community.bartdesmet.net/blogs/bart/category/50.aspx"&gt;"IW stuff - Office, SharePoint, IBF"&lt;/A&gt; where I'll post some useful information in. Today I'll kick off with a very simple piece of code to obtain a collection of the lists on a Windows SharePoint Services site using the SharePoint Web Services.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;First of all, if you've not done so yet, please download the SharePoint Products and Technologies 2003 SDK over &lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=aa3e7fe5-daee-4d10-980f-789b827967b0&amp;amp;displaylang=en"&gt;here&lt;/A&gt;. This API contains a single chm file called spptsdk.chm with a lot of documentation in it. You'll certainly find this useful (I, as a SharePoint development newbie, do).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;SharePoint provides a series of web services that can be used to interact with a SharePoint-driven website for administration and management tasks. I grabbed the following table directly from the API:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH&gt;&lt;FONT face=Arial size=2&gt;Service&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH&gt;&lt;FONT face=Arial size=2&gt;Description&lt;/FONT&gt;&lt;/TH&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Administration&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides methods for managing a deployment ofWindows SharePoint Services, such as for creating or deleting sites.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Alerts&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides methods for working with alerts for list items in a SharePoint site.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Document Workspace&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Exposes the Document Workspace Web service and its eleven methods for managing Document Workspace sites and the data they contain.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Forms&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides methods for returning forms used in the user interface when working with the contents of a list.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Imaging&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides methods that enable you to create and manage picture libraries.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;List Data Retrieval&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides a method for performing queries against lists in Microsoft Windows SharePoint Services.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Lists&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides methods for working with lists and list data.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Meetings&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides methods that enable you to create and manage Meeting Workspace sites.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Permissions&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides methods for working with the permissions for a site or list.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Site Data&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides methods that return metadata or list data from sites or lists in Microsoft Windows SharePoint Services. &lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Sites&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides a method for returning information about the site templates for a site collection.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Users and Groups&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides methods for working with users, site groups, and cross-site groups.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Versions&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides methods for working with file versions.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Views&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides methods for working with views of lists.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Web Part Pages&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides the methods to send information to and retrieve information from XML Web services.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B class=bterm&gt;&lt;FONT face=Arial size=1&gt;Webs&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;FONT face=Arial size=1&gt;Provides methods for working with sites and subsites.&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;As I'm currently interested in the Lists stuff, I'll focus on this in this first SharePoint-related post. On my development machine, I created a http://sharepointdev website for all of my experiments. The web services can be found in the _vti_bin folder which is actually a virtual directory to the %programfiles%\Common Files\Microsoft Shared\Web Server Extensions\60\isapi folder on your system. You won't find very useful information in the .asmx files over there, as these are just stubs for a code-behind implementation, but it's nice to know where these files physically reside on the system. Now, go to Visual Studio .NET and add a Web Reference to http://sharepointdev/_vti_bin/Lists.asmx (well, do substitute the host part of the URL as needed of course). Over here, I'm using a Windows Forms C# project to visualize the data as a first test. The following code assumes there is a DataGrid control on the form (Dock = Fill) named "dataGrid1":&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//Create the proxy object&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#008000 size=2&gt;//&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;sharepointdev.Lists l = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; sharepointdev.Lists();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;//&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//Integrated Windows authentication credentials&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;l.Credentials = CredentialCache.DefaultCredentials;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;//&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//Query the service for a collection of lists&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;XmlNode node = l.GetListCollection();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;//&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//Create a reader to populate a DataSet&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#008000 size=2&gt;//&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;XmlTextReader r = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; XmlTextReader(node.OuterXml, XmlNodeType.Document, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;null&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;);&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;//&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//Create a DataSet and populate it using the constructed XmlReader&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#008000 size=2&gt;//&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;DataSet ds = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt; DataSet();&lt;BR&gt;ds.ReadXml(r);&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#008000 size=2&gt;//For sake of demo, just bind the DataSet's first (and only) table to a DataGrid control&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#008000 size=2&gt;//&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;dataGrid1.DataSource = ds.Tables[0];&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;What this does is pretty basic: it just populates a DataSet with&amp;nbsp;information about the lists on the SharePoint website. Not so exciting but nevertheless pretty cool as a first SharePoint Web Services development adventures sample. I already have some nice ideas to interact with SharePoint through these services. Check out my&amp;nbsp;&lt;A href="http://community.bartdesmet.net/blogs/bart/category/50.aspx"&gt;"IW stuff - Office, SharePoint, IBF"&lt;/A&gt; blog post category regularly to keep on track!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://community.bartdesmet.net/aggbug.aspx?PostID=3442" width="1" height="1"&gt;</description><category domain="http://community.bartdesmet.net/blogs/bart/archive/tags/IW+stuff+-+Office_2C00_+SharePoint_2C00_+IBF/default.aspx">IW stuff - Office, SharePoint, IBF</category></item></channel></rss>