The other day, I downloaded the beta for ColdFusion 9.  While waiting for the download, I was looking through some of the marketing copy that Adobe had on their site about the new features for this release.  I about fell off my chair when I saw that not only has ColdFusion 9 increased connectivity to Microsoft’s SharePoint, but they have even built a tag to wrap up the functionality into one nice little package: <cfsharepoint />.

This one little tag is incredibly powerful.  It knocks out all of the painful and cumbersome web services wrappings required to deal with SharePoint’s WSDLs.  Besides having over 50 built-in functions to deal with lists, document libraries, and the like, you can optionally point to other (or custom) WSDLs to access whatever <cfsharepoint> can’t get at by default.

So after reading about this, I just HAD to try it out.  Not surprisingly, ColdFusion makes a routine task like retrieving a list extremely simple.  Here’s my test:

<cfset viewFields = xmlParse("
      <ViewFields>
            <FieldRef Name='Title'/>
            <FieldRef Name='ID'/></ViewFields>
")>
<cfset query = xmlParse("
     <Query>
          <OrderBy>
               <FieldRef Name='ID'/>
          </OrderBy>
     </Query>
")>
<cfset queryOptions = xmlParse("<QueryOptions></QueryOptions>")>

<cfsharepoint action="getlistitems"
              domain="domain.com"
              name="spVar"
              userName="myusername"
              password="mypassword"
              params="#{listName="546585D2-7AC4-493F-8DC5-F089B9EEB0AD",
                        viewName="A8720E14-A847-4255-8527-055D2DD97868",
                        query="#query#",
                        rowLimit="20",
                        viewFields="#viewFields#",
                        queryOptions="#queryOptions#",
                        webID=""
                       }#"
/>

<cfset More >