My CAML has two humps

Pardon the title, but it was the best CAML pun I could think up on short notice. This is my first post of the new year – Happy New Year everyone!

I’ve got a backlog of things I want to post about, but I have been heads down debugging and delivering a site provisioning solution for a customer. The part I just finished is a set of SharePoint Application Pages (that sit in _layouts) for requesting a site (including collecting a lot of business-specific information) in a way that enforces auditing and business rules and allows for an approval process to kick off when the request for a site is created, as well as having the site creation happen automatically once the request is approved. This solution provides a midpoint between the extremes of no-one can create a site and anyone can create a site, and is just what my customer, who is in a highly regulated industry, needed.

I’ve got a lot of advice I need to write up regarding creating SharePoint Application Page applications. This week though, as part of that, I was working with the object model and found that a SPWeb that is a root web has an empty string for a name. I really need to post screen shots in Visual Studio so you can see what I am talking about, so I’ll defer that until later. As part of that same application, I had to check to see if a site already existed, and decided that the easiest way to do this was to see if the URL for the site was already listed in the site directory. It turns out that querying an SPList for the contents of a URL field is not quite as simple as if the field was a text field. See the discussion at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2302141&SiteID=1 . Robert Bogue’s response in that thread was key to the approach that I ended up using, and the U2U CAML Query Builder tool for 2007 at http://www.u2u.info/SharePoint/U2U%20Community%20Tools/Forms/AllItems.aspx was helpful too.

That’s all for now. A good weekend to all!

–Michael