the singularity of being and nothingness
Posts tagged SharePoint
Headin' to Vegas!
Oct 17th
Tomorrow morning, I jump on a flight (fortunately non-stop) for the Microsoft SharePoint Conference [09]. I'll either be not blogging at all, or very regularly…it's tough to tell at these kinds of conferences.
Things I'm hoping to learn:
- This conference will unveil the newest release of SharePoint–I'm interested to see if there have been significant changes over the current version. I've heard that there are some cool new features, but you never really know about this kind of stuff until you see it, especially when early reports come from fanboys 🙂
- I've been getting into XAML and Flex a little bit recently, so I'm interested to see what's going on in the world of Silverlight. It's very rarely spoken of in the circles I frequent (the cool ones, of course!), so it will be nice to see what the status of SL development is.
- Now that we're getting close to a more or less stable architecture at work, we'll be getting to place pretty soon where we'll be able to start building on top of SharePoint. Several of the sessions are devoted to UI/Social Networking/Pretty, so hopefully I can come away with some decent/fun/workable ideas.
- Other stuff/how not to get mugged in Las Vegas
While I'm away, More >
CFSharePoint: Copy Items from One Folder to Another
Sep 12th
In a previous post, I wrote about watching out for data type mismatches when using the CFSharePoint tag. While this is all well and good, much of my post was based on a misconception of how an "inout parameter" works. While I can't claim great knowledge of this, I think I have a better understanding.
From what I understand, an inout parameter expects a specifically named parameter–let's say "Result"–to be passed in. When you pass this parameter to the web service, the value, or "out", should be the variable that you want returned. So if I want the "results" parameter to return its value as "finalResults", you could do something like:results="finalResults"
In the last post, I was under the impression that the initial value of "results" HAD to be a ColdFusion data type, like a structure or array. This is not correct. Sure, I can pass in the appropriate data type with the "results" parameter; however, whatever structure I pass in will overwrite the "out". This is why if you run the example I provided in the last post, copying an "About.doc" file from one folder to another will really just create a new "About.doc" with the value of the binary object More >
CFSharePoint: Adding Groups…and Users to Them :)
Aug 4th
Enough of lists! The last few posts, I’ve been dealing with the same old boring lists, and I’ve grown tired of that. So today, I want to show a quick example of how to use some of the Users and Groups web services to handle user and group management.
So let’s say I have a brand new user. They have astounding technical skills, so I decide that I want to add her to a special group of users that I’ll call “Super Users”. The only issue, however, is that this group does not exist. So to check all the items off my list and call it a day, I need to:
- Create the “Super Users” group;
- Add Maria to this group; and
- Add some missing user information about Maria
The first thing we need is to create the new SharePoint group. This is easy:
<cfsharepoint action="addgroup" domain="localhost" userName="un" password="pwd" name="theresult" wsdl="http://localhost/_vti_bin/UserGroup.asmx?wsdl" params="#{groupName="Super Users", ownerIdentifier="mycomp\joel", ownerType="user", defaultUserLoginName="mycomp\joel", description="A group of really cool, really powerful users :)" }#" />
Regarding the info being passed, there’s nothing really to speak of. However, you should notice that the method “addgroup” is not listed in the CF9 reference as being supported by the <cfsharepoint> tag (and believe me, a quick test reveals More >
CFSharePoint: Adding List Items with Attachments
Aug 3rd
In my last post, I showed how simple it is to post a list item to a SharePoint list from Coldfusion 9. In this post, I want to expand a bit, showing how to add an attachment to a newly created list item. I also thought it would be a bit more fun to use form data, rather than hardcoding everything…so here goes 🙂
<cfif isDefined('FORM.submit')> <cfsavecontent variable="xml"> <Batch OnError='Return'> <cfoutput> <Method ID='1' Cmd='New'> <Field Name='ID'>New</Field> <Field Name='Title'>#FORM.title#</Field> <Field Name='Favorite_x0020_Color' #FORM.color#</Field> </Method> </cfoutput> </Batch> </cfsavecontent> <cfset newItem = xmlParse(xml)> <!---Be sure to get the actual field name from the URL, not from the display in SharePoint---> <cfsharepoint action="updatelistitems" domain="domain" userName="username" password="password" name="theresult" params="#{listName="AAC20C17-A87D-4985-BA1D-9DD511EE9B9A",updates="#newItem#"}#" /> <cfset theID = theresult.result[2].ows_ID /> <cfset attach = filereadbinary(FORM.myfile)> <cfsharepoint action="addattachment" domain="domain" userName="username" password="password" params="#{listName="AAC20C17-A87D-4985-BA1D-9DD511EE9B9A", listItemID="#theID#", fileName="#filename#", attachment="#attach#" }#" /> </cfif> <cfform name="myform" method="post" enctype="multipart/form-data" target="addlistwithattachment.cfm"> Title: <cfinput type="text" name="title" /><br /> Fav Color: <cfinput type="text" name="color" /><br /> Filename: <cfinput type="text" name="filename" /><br /> File: <cfinput type="file" name="myfile" id="myfile" /><br /> <cfinput type="submit" name="submit" value="Submit" /></cfform>
So really, here we have another easy bit of code. The insert method (updatelistitems) is unchanged, except that I’ve tied the field values More >
CFSharePoint: Adding List Items
Aug 2nd
After pretty exciting results with retrieving list data from SharePoint using ColdFusion 9, I’ve been quite eager to try out some of the other methods exposed by ColdFusion. However, retrieving lists is one thing; testing out methods that could actually modify data is another entirely. So, I broke down and spent several hours installing WSS and SQL Server 2008 on my local machine. Interestingly enough, there are ways to get it to run on a 32-bit Vista machine, so if you’re curious how, let me know ;).
Anyway, once I got SharePoint installed, I immediately created a simple list. It’s incredibly simple–it only has two fields, “Title” and “Favorite Color.”
The first method I wanted to try out was to add a list item to this list, a name and a color. As with the list retrieval web service, the “updateListItems” method is just as simple to implement. Here’s the code I used:
<cfsavecontent variable="xml"> <Batch OnError='Return'> <Method ID='1' Cmd='New'> <Field Name='ID'>New</Field> <Field Name='Title'>Monkey</Field> <Field Name='Favorite_x0020_Color'>Pink</Field> </Method> </Batch> </cfsavecontent> <cfset newItem = xmlParse(xml)> <cfsharepoint action="updatelistitems" domain="localhost" userName="username" password="password" name="newitems" params="#{listName="AAC20C17-A87D-4985-BA1D-9DD511EE9B9A", updates="#newItem#"}#" /> <cfdump var="#newitems#" />
This is super straight-forward. First, you create a “Batch” element. Basically, this allows you to define any number of “methods” More >