the singularity of being and nothingness
Posts tagged ColdFusion 9
Quick Update to Gloss
Jan 27th
Based on feedback from several users (thanks to Charlie and Tyler!), I’ve updated the search interface to Gloss a bit. It’s still a work in progress, but this newest fix has resolved the issue of lack of keyboard navigation to search results from the search field. Here’s what has changed:
- You can now tab out of the search field to the first search result, and then tab to subsequent search results.
- You can strike Enter or Spacebar on a highlighted search result to load its respective page
I do have a question for users regarding the “post-load” behavior. Currently, if you select a search result to load a page, focus is taken away from the search result and given to the item in the navigation tree that correlates to the search result. Is this desirable behavior, or would you rather have focus be retained on the search result?
Perhaps I’ll install a new configuration option to give the choice…:)
Thanks to everyone who uses the tool, and please feel free to let me know of any ideas/improvements/bugs/whatever.
Share this:ColdFusion 9 and Ternary Operation
Jun 23rd
Just a quickie 🙂
I learned about ternary operators in JavaScript probably about 6 months ago, and absolutely fell in love with it. After all, who doesn’t love to convert something bulky to something clean and able to fit on one line?
THEN:
var myidea = ''; if(thething=='yes) { myidea = 'great'; } else { myidea = 'lame'; }
NOW:
var myidea = thething=='yes' ? 'great' : 'lame';
The other day, I was busting out some <cfscript>, and came across a bit of evaluation where a ternary operator would be PERFECT. Having no idea whether or not it would work, I gave it a shot and voila!, it’s magic!
<cfscript> myidea = thething=='yes' ? 'great' : 'lame'; </cfscript>
Now after a bit more investigating, turns out this is in the “only works for CF9” domain. Nonetheless, pretty nice–I love saving keystrokes!
Share this:Update Miscellany
Mar 29th
Wow, it's been far too long since I've posted. I've been quite busy as of late, and have been putting the finishing touches on a couple of pretty decent sized projects.
But perhaps most interesting to followers of this site is the fact that I'll be working with a friend of mine over the next couple of months to completely revamp a site that we think will be pretty sweet in a couple of months. But the coolest part is that we're going to be creating this site–as much as possible–using exclusively ColdFusion ORM. As we make progress, I'm going to do my best to regularly blog about our experiences as we tap into this extremely cool technology that is available in CF9.
So anyway, stay tuned…I hope to have some killer posts up very soon 🙂
Share this: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…Yes!
Jul 21st
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 >
ColdFusion 9…Here I Come!
Dec 8th
Oh yeah! I just received email confirmation today that I have been accepted to participate in the Centaur (ColdFusion 9) alpha release! Additionally, I am going to be able to beta Bolt, a new Eclipse-based IDE being developed by Adobe to be used in conjunction with ColdFusion.
This is going to be fun 🙂
Share this: