Coldfusion 9 Sharepoint Integration - ListCollection
ColdFusion 9 saw the release of quite a bit of new functionality none so little blogged about as the new cfsharepoint tag. Not all surprising really since in order to use the cfsharepoint tag you need to have a Microsoft Sharepoint server at your disposal. Another reason it's probably not so often blogged about is that Sharepoint integration is going to be typically going on behind the scenes, integration projects with corporate Intranets and perhaps not really all that interesting for the masses.
Never the less I have decided to start a small series of blog posts on some of the different things you can do with the cfsharepoint tag. I will only be concentrating on document lists as that is where, in my opinion, most of the integration is going to be centered around.
Authenticating
An important point to remember is that the cfsharepoint tag supports basic authentication only. This means no https and no NTLM.You must send the login credentials with each and every request. You can either use the tag attributes: username,password,and domain, or create a structure with the keys username,password,and domain and pass it in the login attribute.
The domain is the url (without http) to the home location in Sharepoint including server name (ip) and port (if you installed sharepoint on a non standard port).
List Collections
The list collection is a method exposed by the lists webservice, you can view all the available methods of the lists webservice by visiting http://sharepoinserver/home/_vti_bin/Lists.asmx adding ?WSDL to the end will give you the full WSDL of the lists webservice. Note that the cfsharepoint tag only supports a limited subset of the available methods.
If you are a masochist you can use cfinvoke to invoke the webservice methods not supported by the cfsharepoint tag.
To get the a list collection run the following code against your sharepoint server substituting the username, domain and password for your environment.
<cfsharepoint action="getlistcollection"
username="#username#"
domain="sharepointserver/home/"
password="#password#"
name="listCollection"/>
A structure containing two keys will be returned, resultflag and lists. The resultflag should return SUCCESS if everything went well. The lists key contains an array of all the available lists. Since we are only interested in document lists we will need to filter out all the non-document related lists. Document lists have a ServerTemplate id of 101. Unfortunately we can't send a CAML query with the getlistcollection method in order to reduce the returned list with only the list types we are interested in.
The list collection contains a heck of a lot of information about the available lists, but other than the ServerTemplate and the ID or Name we don't really need much more information.
The ID or Name attribute of a Sharepoint List is a UUID for example:{A3EA94F4-9F1B-43A0-B197-085BA1E258C9} this is what we will use to get additional information about a list we are interested in.
Whats Next
Now that we have our list collection we can start working towards retrieving information about a particular list such as what meta-data a user wishes to see for the desired list via Views (ViewCollection) and how to retrieve specific information based on a view using QueryOptions and ViewFields. And finally we will get the list items using the getListItems action.
Happy Coding...

Subscribe
Subscribe via RSS
Follow me on Twitter
Or, Receive daily updates via email.
Tags
adobe air ajax apple cf community cfml coldfusion examples ext flash flex google javascript max2007 max2008 misc open source programming railo software technology ui
Recent Entries
No recent entries.
Blogroll
An Architect's View
CFSilence
Rey Bango
TalkingTree

Either way, thanks for sharing your experiences with the cfsharepoint tag.
Brian
It may take a week or so but at the end of the series you should at least be able to provide a user an interactive means to import or retrieve files (and metadata) from sharepoint