the singularity of being and nothingness
Posts tagged ColdFusion

Getting Web Site Screenshots with ColdFusion…and a Little Help
Jan 17th
For those of you who don't know, I am the owner and occassional operator (!) of CSS {Imagine}, a simple, but relatively well-visited web design gallery. One of the requirements I had for this site when I built it was that I did NOT want to have to do any work of manually grabbing screenshots and cropping thumbnails for the sites that are submitted to the site. So using a combination of a third-party screen-capture service and CF8's super-awesome image editing tools, I've built an entirely automated process for handling of all this less-than-fun work. Heck, all I have to do to kick off the process is to click a link in a notification e-mail…:)
One of the downsides to using the third-party service is that the results are VERY inconsistent. Some of the images are garbled, while others simply fail. However, the biggest issue I have is that the service has–reasonably enough–a finite amount of servers to process all the request. Therefore, there are several occassions (daily) that I have to wait to kick off the process until the screen shot service has reached my requests in the queue. I know, I know, not a huge deal. However, it would 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 >

ColdFusion input=datefield Gotcha
Feb 5th
Another quick post 🙂
If you're using ColdFusion 8's datefield input AND are using a table for laying out the form, make sure that the cfform element is OUTSIDE of the table element.
This, of course, should be done anyway…however, tonight I was modifying some old, embarassing code and upgraded to the datefield. The page kept throwing an unhelpful JS error. After about 20 minutes of getting angry, I reversed the order of the table and form elements, and voila, it worked again.
Urgh.
Share this:
Coming Soon…Very Soon!
Jun 10th
Remember the CSS Gallery I wrote about a while ago? Yes, the one that I'm building? Well, IT'S ALMOST DONE!!
I am incredibly excited. The design, I feel, really came together, and the final result is something simple and sleek, but still (at least IMO) memorable.
One of the most exciting things about this project for me is that it's allowed me to flex some ColdFusion 8 muscles–muscles that I have had not yet really had a chance to use until now.
What kind of features are there going to be? I'm glad you asked!
On the client side, I completely Web 2.0-ified the site submission process. When you click "Submit", instead of getting redirected to a form page, I'm using Thickbox to present the form. The form itself is pretty sweet, too. First, there's a fairly interesting hint tool that I developed. But the power of the form is that not only does it check the XHTML and CSS validation on the site you enter while you're finishing up the form, but even the form submission itself is AJAXed. No stupid submit and refresh here!
Once a site submission is approved and live, each site will have comments attached, as well as a rating mechanism. As More >

ColdFusion and Twitter
May 28th
Over the last several months, I've gotten into Twitter ALOT. I find it to not only be fun, but it is also an interesting social experiment. I've been surprised by how many great resources I've come across because of my followers quickly twittering something they think is cool/helpful.
Naturally, the next stage in my relationship with Twitter is to crack into its API to manipulate from my own applications. Turns out this is surprisingly easy to do. All of Twitter's functions are relatively simple and require very little to accomplish what you want to do.
So my case study was the most obvious: post an update to my "status." In ColdFusion, the entire process takes 6 lines. 6 LINES! Here they are, in all their simplistic glory:
<cfset update = "Hey, this is an update to my twitter status"><cfhttp url="http://twitter.com/statuses/update.xml" method="POST" charset="utf-8" username="existdissolve" password="mypassword"> <cfhttpparam name="user" value="existdissolve" type="formfield"> <cfhttpparam name="password" value="mypassword" type="formfield"> <cfhttpparam name="status" value="#update#" type="formfield"></cfhttp>
For this function, you do have to create a basic authentication, which merely requires passing your username and password along with the status message. Very simple, but very cool!
So yeah, that's about it. There's a whole slew of functions in Twitter's API, but hopefully this shows More >

I'm Building a CSS-Gallery
May 23rd
Yeah, yeah, I know. There are already a billion and 3 CSS showcase galleries out there. Why re-invent the wheel, you surely say?
Well, I'm actually not…well, not really. I have a few projects that are hovering on the horizon for which I am going to be using a few features I've never built before, such as a rating system, and a tagging system. While I feel confident that they will be no big deal, I figure something like this could provide a good playground for working those things out now, rather than later.
One thing I am going to do with my CSS gallery, however, is auto-generated thumbnails. I really want to do nothing but approve or deny submissions, so the thought of taking time to open the RAM-whore Photoshop CS3 to crop up a bunch of images is not appealing!
In thinking about this, I snooped around the Intrablog for some free services that would provide this. One of them, Websnapr, has an extremely easy to use API…the only problem is that they slap a stupid watermark on the thumbnails that are generated. So obviously, I moved on. The next one I found (and stuck with, incidentally), was ShrinkTheWeb.com. Their web More >

Web 2.0 Goodness – Adobe's Spry Framework
Mar 24th
Ok, so as everyone who reads this blog knows (or should know…), I am a web designer/web developer. On the development side, I am best at ColdFusion , one of the under-appreciated programming langugages out there. While ColdFusion is awesome, one of the drawbacks of it (as well as of PHP, .NET, etc.) is that it is a server-side technology, meaning (surprise, surprise) that all of the code processing done is accomplished on the server. So, any of the cool Web 2.0 stuff out there, like asynchronous form submission, has to use Javascript.
While ColdFusion 8 has some seriously cool AJAX features built into it that handle alot of this kind of thing with ease, it is not free and wonderful hosting companies (like GoDaddy) are slow to upgrade their servers to the newest version. Therefore, the onus is upon the developer to utilize the various work-arounds until ColdFusion 8 is firmly entrenched.
One tool that makes life significantly easier is Adobe's Spry Framework . While Spry includes a lot of the cool effects of other Javascript frameworks, one of the best parts of it is the easy way in which it allows Spry to make server-side calls to allow applications to harness More >

ColdFusion and Technorati – A Quick Example
Dec 16th
Today, a client of mine (deviantmonk.com ) contacted me and requested that I set up a way for Technorati to be updated when posts are created and updated.
Although I have certainly heard of Technorati , until today I had not had any exposure to everything that it does. One feature is that it acts as a blog aggregator of sorts. Admittedly, it has some nice functionality: besides displaying posts from blogs, it also includes comments and is smart enough to get username and avatar information. The downside is that Technorati–like Google and other content aggregators–only update sites as their bots get to them. Obviously, left to itself, this can take some time, and posts which were made yesterday could not appear for several days (or longer).
Fortunately, Technorati has a nice webservice that allows users to ping the server to alert it to changes to the blog content. Admittedly, the update still takes about 10 minutes, but that is still better than the unacceptable alternative…
So anyway, the webservice is extremely simple. I wrapped up the relevant code in a nice ColdFusion function and simply invoked it on the end of my normal post processing. The enitrety of the code is as follows:
<cffunction More >
Quickly Falling in Love with Flex
Nov 6th
The last several weeks, readers will note that the majority of my posts have been devoted to AJAX, particluarly Adobe's Spry Framework. My main infatuation is that AJAX allows for clunky page-reload based web activity to be replaced with instant, on-the-fly interaction, not only with constituent portions of the website, but more importantly, with server-side processes (especially databases).
All this time, I have flirted around with Adobe's Flex 2, an incredibly rich platform for developing ActionScript 3.0 applications. While I have played around with it from time to time (basically, when I get a new computre–the trial period is only 30 days), I have not really gotten into significant development…until now.
One of the issues with Flex is that, like javascript, it has not native way to interact with a database. For this, one needs an application server of some kind, or to create myriad XML files to store data. Now I've always known that Flex could integrate nicely with ColdFusion, allowing the developer to access independant ColdFusion components to leverage processing logic and database interaction. However, I did not know how ridiculously simple it was.
So one might wonder what the big deal is. So Flex can easily connect to More >

Webservices in ColdFusion
Sep 18th
Today, for work, my boss asked for me to create a bit of functionality that would allow users to return lists of people from a database who live within [x] miles of an entered zip code. I've never created something like this before, but I've been around long enough to know that this kind of functionality requires gigantic databases of zip codes, trigonometric calculations, etc. simply to return the distance between two zip codes.
Fortunately, others have created such things and have kindly sydicated them as webservices. Webservices are very simple–they are a collection of functions that are remotely accessible to developers. So, if you want to create a search for Amazon books on your website, you hook up to Amazon's book-syndication service, call the appropriate method (like "getBooks()" or something) and use whichever programming language you is using to parse out the information in a usable fashion. Here's the one I'm using:
http://webservices.imacination.com/distance/Distance.jws?wsdl
ColdFusion makes stuff like this ridiculously easy within its "cfinvoke" tag. In about 4 lines of code, you call the method, pass in the method's require arguments, and create a variable for usage later on.
<cfinvoke webservice="http://webservices.imacination.com/distance/Distance.jws?wsdl" method="getDistance" returnvariable="distance">The zip code webservice required two arguments, "fromZip" and More >