U2U Blog

for developers and other creative minds

SharePoint Lists.asmx UpdateListItems: RootFolder

This week I read Jeffrey's post on how you can update a list item located in a sub folder using the RootFolder attribute on the UpdateListItems method of the Lists.asmx web service.

It seemed interesting enough to me to get this working in the U2U CAML Query Builder (windows version and feature version) so I started to implement it but I discovered that the truth about RootFolder is not as simple as it seems from this post.

Jeffrey states that the following code should work:

<Batch OnError="Continue" PreCalc="TRUE" ListVersion="0" RootFolder="Lists/Contacts/Work">
<Method ID="1" Cmd="Update">
<Field Name="ID">47821</Field>
<Field Name="RefID">479485</Field>
<Field Name="CustomerNumber">59613</Field>
</Batch>

I think that this code works because a valid ID is specified (in which case you even don't have to specify a RootFolder attribute: the item located in a sub folder can be updated specifying a valid ID). When I try this out without an ID I get an "Invalid URL" error.

The first thing I found out is that you have to make a difference between a list and a document library. In case of a list the root folder is indeed Lists, but you have to prefix it with a "/":

<Batch PreCalc="TRUE" OnError="Continue" RootFolder="/Lists/Cities/Europe/Belgium">
   <Method ID="1" Cmd="New">
      <Field Name="Title">Gent</Field>
      <Field Name="PostalCode">9000</Field>
      <Field Name="TelephoneZone">09</Field>
   </Method>
</Batch>

In case of a document library the root folder is the name of the document library, but it also needs to be prefixed with a "/":

<Batch PreCalc="TRUE" OnError="Continue"
    RootFolder="/Folders Doclib/2008/January">
   <Method ID="1" Cmd="New">
      <Field Name="Title">Document 2</Field>
      <Field Name="Income">2500</Field>
   </Method>
</Batch>

In case someone disagrees with this or if you have reasons to believe that even this is not complete, please let me know by posting a comment.

A new version of the U2U CAML Query Builder (windows version) will be ready to release end of this week. A new version of the feature version will be released a few weeks later. I keep you posted :)

Silverlight BluePrint for SharePoint

Finally the Silverlight Blueprint for SharePoint kit is out! It is released today and will be presented this week at MIX in Las Vegas and at the SharePoint Developers Conference in Seattle.

To make you a little curious, here is a screenshot of one of the samples:

image

You can take a look at the samples here but you will need Silverlight 2.0 installed. Yes,this means that all samples are developed with Silverlight 2.0. You can download the source code and documentation of the different samples.

The kit does not only explain how to develop web parts, but first of all, how to configure SharePoint so that it can host Silverlight applications, and even how to develop custom fields and application pages.

But my favorite one is the slider control: it's a custom field that you can use in surveys for example:

image

The silverlight slider looks as follows in your survey:

image

Silverlight is beautiful on its own but it really rocks in combination with SharePoint! I'm convinced that it can be very useful within SharePoint.

Have fun with it!

Silverlight BluePrint for SharePoint

The word is out, finally! For months we have worked with a small team at U2U creating 6 samples that illustrate how to integrate SharePoint with Silverlight. The past week has been very busy getting all of the sample code, the screencasts, the solutions and the documentation ready for publication. A couple of minutes ago, all went live and you can view the result at http://www.ssblueprints.net/sharepoint/. I want to congratulate the team and especially Karine for the all of the work. Also thanks to the design team in the States (Look and Feel) for shaping our XAML and to Rob Barker for the opportunity. Tomorrow, I'll have the pleasure of presenting all of this. Also, during the session, ComponentOne will showcase the work they have done based on the training kit. Enjoy!

SmartPart Version 1.3 Released

One of the most popular community tools for SharePoint, the SmartPart, is updated again. Jan T. has done it again updating the SmartPart so that you have better support for AJAX and now also support for 64bit environments. Awesome... love this dude :). Read more here and download it from here.

5 times 3 in 2007

Yeah, Jan thinks his blog isn't read anymore. Luckily there are things like Technorati and RSS Feeds that keep you informed when he wakes up  :)

Okay, here we go...

3 artists I (re)discovered this year:

  • Amy Whinehouse: I think she has one of the most beautiful voices. I hope to see her live on stage in the near future.
  • Foo Fighters: They have a fantastic new album!
  • Mega Mindy

3 stupid things I did in 2007:

  • I had a really really really stupid idea for a joke at TechEd Barcelona, for which I still am very very very sorry. I'm sure this one counts for three...

3 things I won't forget:

  • My beautiful 3 years old daughter dancing on "Butterflies & Hurricanes" of Muse, telling me that it's such a great music (she heard this song almost every day when I was pregnant of her).
  • My wonderful son saying "mama" for the first time
  • my stupid stupid stupid joke

3 things I'm proud of:

  • I still continue developing my CAML Query Builder feature, for which I get a lot of credit.
  • In september I started working on a Silverlight/SharePoint integration project. It's not yet published but we already got some very positive feedback.
  • When working I sometimes forget that I'm a mum of 2 small kids. I hope they can forgive me the hours I spent behind my pc. In the summer months I took 6 weeks off to spent time with my kids. We had a fantastic time together so I will continue doing this the coming years.

3 things I bought or received:

  • I received a fantastic present for my birthday from my husband (but I'm not going to tell you what).
  • I received a mail from the most far away part of the world.
  • I received an error that crashed the core of my feature when the second version of my CAML Query Builder feature was in a final stage.

3 people who will get this stick (this way I can check that they really read my blog, as they say they do... ;) ):

Profke 

Serge Luca

Stefaan Rillaert (I suppose he will soon restart blogging because he starts working on an interesting project between two slides on his ass somewhere in the North of Europe)

Have fun and keep up the good work in 2008!