Raymond Camden's Blog Rss

CFLib gets a dose of fresh air...

3

Posted in | Posted on 12-18-2007 | 2,701 views

Yes, the AIR jokes are probably getting a bit old. ;) Yesterday I wrote up a quick demo for a off-site (not offline, but off web site) that demonstrates a CFLib browser. Spry is used to speak to the web site. I used the same code I wrote for the SnipEx service. This meant no back end changes in CFLib, but it also meant I didn't get back as much data as I would like. But as I was just playing, I got over it. I also made use of Paged Datasets and Spry tabs for layout.

I begun my development on my own web server. In order to facilitate moving back and forth between a normal web site and AIR, I used code like so:

view plain print about
1var mode = 'prod';
2if (mode == 'dev') {
3    //dev
4    var liburl = "data.cfm?loc=" + escape('http://www.cflib.org/snipex/snipex.cfc');
5    var udfurl = "data.cfm?loc=" + escape('http://www.cflib.org/snipex/snipex.cfc?method=getlibrary&libid=') + "{libs::@id}";
6}
7else {
8    //air
9    var liburl = "http://www.cflib.org/snipex/snipex.cfc";
10    var udfurl = "http://www.cflib.org/snipex/snipex.cfc?method=getlibrary&libid={libs::@id}";
11}

Basically, in the non AIR mode, I used a proxy CFM, and in AIR, I didn't have to.

I didn't use Aptana's AIR support as I had some issues with it recently. Instead I simply used the command line. I blogged in the past about this, so I won't repeat it, but the process was pretty much the same under AIR Beta 3. The main difference was having to create a self-signed certificate first. It would be nice if AIR supplied a "one step" compile for that, but it wasn't too hard. Obviously if you use something like Dreamweaver it would probably be simpler.

The biggest issue I had was with Spry and AIR. I blogged on that last night. That was the critical thing I was missing. This app represents probably 4 hours of work, of which 3 was me banging my head against the wall on the AIR/Spry stuff. Now that I know though - it definitely makes sense.

So let me know what you think. I know the design sucks, but I kind of like it. I'm considering adding it to my taskbar (yes, I'm considering avoiding my own web site - is that sad?) to force myself to use it and add features to it.

The zip contains my original code plus the AIR installer. Just so it's obvious - I'm still learning this stuff, so don't mistake this for 'best practices' AIR development. ;)

Download attached file

Comments

[Add Comment] [Subscribe to Comments]

Got this message when trying to install the app.

This application requires a version of the Adobe Integrated Runtime (AIR)
which is no longer supported. Please contact the application author for an
updated version.
I used Beta 3. Is that what you are on?
That was it, I was on an earlier version.

Very useful app btw. Thanks.