Real Error Reporting from ColdFusion 8 Server

Totally stumpled on this by accident. I wrote a statement using the NumberFormat() function, and accidentally placed my mask before the value. Being backwards this threw an unexpected error, which not only told me what I had done wrong (basically told me that the value I had passed was not a valid mask), but also gave me a chart of what the valid mask syntax would be.

Now, this is in my test environment, so robust exception info is probably selected (I haven't checked), but I'm wondering why I'm receiving such outstanding and informative error reporting for this function I barely use, but I can't even get the correct line number of a query error (which it used to do)?

Learning Ext JS Released, and Getting Press

It's been a busy week, with a flood of feedback coming in on the newly released Learning Ext JS. In fact, I've been so busy that I forgot to tell my own readers that it was released! Peter, Steve, and J.J. all put up posts about the book coming out, for which I am grateful. Then Aaron followed after the release, with a post on the Press Release that my employer put out about my involvement with the book. Shea and Colin both have put up entries on the book, including a breakdown of the chapters. Then Shea announced it within the Ext JS Forums, which really brought some positive response, and led to the first review on Amazon.

Learning Ext JS Book Cover (photo)But for me, the biggest thing about this rollercoaster was when my copies of the book came in on Friday. I was at work, but my wife calls, and she and my daughter are in tears after reading the book's dedication. When I came home that night, Teresa put the book in my hands and said "You did it!" It's an odd moment, standing there with this book in my hands, just staring at this cover with my name on the bottom. One of the coolest things. I IM'd about it with Ray on Saturday morning, who I had asked authoring advice of before taking on the project, and he said "The hard copy makes it real."

So, now I'm on to finishing off a huge side project. I'm "eating my own dogfood", so to speak, as it's a rather large application with a single page Ext interface, communicating with ColdFusion via Ajax. I hope everyone enjoys the book as much as Shea, Colin, and myself enjoyed writing it. Let us know what you think.

ColdFusion Query Json Custom Data Reader For ExtJS

Adobe's implementation of JSON return for ColdFusion is great, and frustrating. They use a non-standard return in that, instead of the expected name/value pairs, they return first a COLUMNS element, listing the column names only once, and then the DATA array of the record set values. The column names are listed in the order with which the data is listed in each array element. This is great, in the fact that the data packets are much smaller than the traditional return (traditional meaning, that which is returned by most other app servers), but the down side is, it isn't traditional.

John Wilson wrote a custom Data Reader for the Ext JS library, to help with parsing the ColdFusion return. However, although it created records within a Data Store, it didn't handle the column aliasing you are usually capable of when defining fields, nor did it properly cast variables as it should. I finally had a chance to run it through Firebug, and step through the process, at which point I also really had a chance to review the custom extension.

While it worked, it really wasn't using the best tool for the job. The extension extended the Ext.data.DataReader base component. The ColdFusion return basically gives you an Array of records (the DATA), and Ext JS already provides an Ext.data.ArrayReader object that extends the JsonReader. So, after some refactoring and general tinkering, I now release the CFQueryReader custom Ext data reader.

Inspired by the CFJsonReader, originally writtin by John Wilson (Daemach).

This Custom Data Reader will take the JSON return of a ColdFusion Query object, rather returned straight up, or via the ColdFusion QueryForGrid() method.

The CFQueryReader constructor takes two arguments @meta : object containing single key/value pair for the 'id' of each record, equating to the 'mapping' of the column @recordType : field mapping object

The recordType object allows you to alias the returned ColdFusion column name (which is always passed in upper case) to any 'name' you wish, as well as assign a data type, which your ExtJS app will attempt to cast whenever the value is referenced.

ColdFusion's JSON return, for a ColdFusion Query object, will appear in the following format:

view plain print about
1{"COLUMNS":["INTVENDORTYPEID","STRVENDORTYPE","INTEXPENSECATEGORIESID",
2"STREXPENSECATEGORIES"],"DATA" :[[2,"Carpet Cleaning",1,"Cleaining"],
3[1,"Cleaning Service",1,"Cleaining"]]}

The ColdFusion JSON return on any query that is first passed through ColdFusion's QueryForGrid() method will return the object in the following format:

view plain print about
1{"TOTALROWCOUNT":3, "QUERY":{"COLUMNS":["MYIDFIELD","DATA1","DATA2"],
2"DATA":[[1,"Bob","Smith"],[6,"Jim","Brown"]]}}

The Ext.data.CFQueryReader is designed to accomodate either format automatically. You would create your reader instance in much the same way as the CFJsonReader was created:

view plain print about
1var myDataModel = [
2    {name: 'myIdField', mapping: 'MYIDFIELD'},
3    {name: 'data1', mapping: 'DATA1'},
4    {name: 'data2', mapping: 'DATA2'}
5];
6
7var myCFReader = new Ext.data.CFQueryReader({id:'MYIDFIELD'},myDataModel);

Notice that the 'id' value mirrors the alias 'name' of the record's field.

The CFQueryReader is available from the below download link. Anyone having any issues just post a comment. You may also find information on the Ext JS Forum Post.

Hurdles For ColdFusion Hosting Providers

One thing that we, the ColdFusion community, have been hearing since the release of ColdFusion 8 is that hosting costs should come down. Adobe has been working hard to strike deals with hosting providers to provide hosting solutions that are as competitive as hosting for other server-side languages, such as .NET or PHP. They've been doing this by doing things like changing their EULA agreement to support multi-procs, disaster recovery backups, and VM hosting, as well as through special licensing deals. Unfortunately, outside forces are working against them in this.

>Hosting services contain a lot of other costs, that are generally hidden to the end user. One such cost is in server administration. Any developer, setting up their own development environment, will realize that the real manual labor is spent in IIS or Apache administration, DNS management, SQL configuration and the like. Most hosting companies utilize third party software to help automate a lot of these tasks, cutting maintenance time significantly. There haven't been many software control panels that support ColdFusion. Chief among these, for some time, has been Parallels Plesk Control Panel. This software is brought to you by the same folks who bring the popular VM used on Macs to virtualize Windows. It's an extremely nice piece of software, allowing a very nice interface that integrates with several key technologies used by most any hosting provider.

So you might be asking "What's the problem?" Well, the suits at Parallels have moved to a Software As A Service model, and the pricing structure has changed significantly. There were other options out there, like Ensim Pro, Helm, and H-Sphere, but Parallels bought them all up, effectively taking over the market for hosting Control Panels that support ColdFusion. Nice monopoly they have now, at least within our space.

Outside of the community banding together to write their own software, their aren't any other options currently available for a ColdFusion hosting Control Panel. There is a very nice package for Windows based systems called dotnetpanel, but they do not currently support ColdFusion. They are considering support, pending justification to build it. My friend Emmet McGovern, of Full City Media (the kind folks who host this blog, and who always have my thanks), is on a mission to give dotnetpanel that justification. He started a Forum Thread, on the dotnetpanel forum, to gather feedback from the CF community for dotnetpanel to add ColdFusion support to their Control Panel product. To anyone out there that acts as a hosting provider, and even to you CFers who've been waiting on lower cost ColdFusion hosting, I urge you to stop by their site and put in your vote.

Upcoming Book: Learning ExtJS

I've been rather quiet for quite a while now. I have a rather large side project I've been working on, written entirely with an ExtJS front-end and ColdFusion on the back-end. I'm hoping to get that into a QA phase in the next week or two. I also just celebrated my 39th birthday, my 8th wedding anniversary, my daughter is the rock star of the 1st grade (pulling straight A pluses in every category), and the holiday's are coming.

On top of everything else, I'm putting the final touches on Learning Ext JS, to go to press at the end of the week/beginning of next, and due out in December. I've stayed relatively quiet on this, as I wanted to wait until PackT, my publisher, officially released information on the book. Let me start by saying that a few years ago I never would have thought I'd be doing this much client-side development again. And I definitely wouldn't have imagined me contributing to a book about client-side development.

I began looking at ExtJS quite a while back, while contemplating how to "jazz up" and modernize some dated interfaces I was supporting. I thought that ExtJS was an exceptionally well thought out library of rich, consistant components and functionality. While I use JQuery almost exclusively for DOM queries and manipulation, I really didn't find enough consistency in the visual plugins at the time (this has improved with the latest round of the JQuery UI plugins). I began to learn of the real power of ExtJS, and became an even bigger fan when it was announced that Adobe was including it in Scorpio, the codename for ColdFusion 8, Adobe's first implementation of the ColdFusion web application platform since it's acquisition with the Macromedia merger. Sweet! A total win-win for me.

Back in June, PackT contacted me. It seems they had started to develop a book, but the primary author, Shea Frederick, had gotten bogged down in other commitments before being able to complete the project. Some Googling on their part led them to Colin Ramsay and myself, through Cutter's Crossing. So they contacted me to find out if I was interested. The timing on this was awful. I was just starting the previously mentioned side project, my daughter was on her very first summer vacation, and just a lot of things going on. But it was too good to pass up. Aside from the fame and glory (yeah, right!), I knew that there weren't any other books out there on ExtJS, and it would be an excellent book to get out there for all the people trying to learn this exciting library. After talking the pros and cons with Aaron West, and getting sign off from my family, I finally contacted the Jedi himself, Ray Camden, to get some info on the writing process. We talked about time (a lot), commitment (more), and fame (maybe a little) and fortune (nearly none). I finally went ahead and said I would do it.

So, here it is almost six months later. I took on the final three chapters of the book: working with data stores (think like browser cached data table sets), extending Ext objects to build your own custom components, and the book wrap-up, which covers all the little stuff many people miss because they aren't typically visible. Only one chapter has any server-side code (the data stores). PackT originally wanted to convert my ColdFusion examples to PHP, to conform with the rest of the book. This morning the publisher told me that they want to keep my ColdFusion examples, to show that the ExtJS library can work with any server-side technology.

So, they're taking pre-order now, just in time for the holidays. Let me know what you think.

ColdFusion For Educational Use

Adobe has posted the site for registering ColdFusion 8 For Education. This is an exciting development within the ColdFusion community, that will hopefully help to propogate ColdFusion, both as a platform as well as CFML as a language.

ExtJS 2.2 Released

As many of my readers already know, I am a huge fan of ExtJS, the wildly popular JavaScript cross-browser component and Ajax library. ExtJS 1.1 is the underlying library used by ColdFusion 8 in it's new Ajax controls, so I latched on to the concept of rapid application prototyping and then extending it through custom ExtJS development.

Well, Monday the ExtJS team released 2.2. Much more than a minor dot release, 2.2 addresses several bug fixes, nice increases in perfomance, better support for Firefox 3, and several new components and examples.

Some of the new components include CheckBoxGroups and RadioGroups for forms, a new History object for managing the back button (a common issue in RIAs), a new FileUploadField, and even an XMLTreeLoader to automatically create Tree components from an XML Document. There are several new examples, to show developers how to use these new components, better information on how to implement Drag and Drop, and more.

ExtJS 2.2 is fully backwards compatible with the 2.1 release. I tested several applications last night, seeing definite speed increases. Really well done. (There also appears to be some speed improvements when implementing ExtJS within Adobe AIR applications as well, from my testing.)

I'll have a lot more info on ExtJS coming in the near future, so watch this space;)

Caught By The Bug

The dreaded BlogCFC curse. After 30 days without a post you see the message 'Sorry, no post' (more or less).

I'm busy. Way busy. Several side projects, fun at work with servers, and a few hush-hush things...I'm beat. I can't go into a ton of particulars on anything, but there are things coming. I am working on a custom asset manager written in ColdFusion and Ext, that I'll be open sourcing, but it's taken a side burner for now. Ext is a blast, and I hope to continue to create and release Ext custom components, but I will always be using ColdFusion for my server-side code examples.

Speaking of code, I still owe everyone my sample code from my WebManiacs Presentation. With all this activity, I am way behind the eight ball on rolling some of this up. I hope to get it out sometime within the week. I'm also hoping to get a chance, soon, to re-record the presentation. I had done it once before WebManiacs, for the Nashville ColdFusion User Group, but the recording was a wash. We'll try to get that scheduled soon, and get it out there for everyone.

And, speaking of NCFUG, Mark Mandel is presenting Thursday night, July 31st on Transfer. Details can be found on the NCFUG Meeting page.

That's all for now. I'll try not to let it go so long between posts this month.

Build Applications That Scale

For over two months now, we've been preparing to migrate our services to a new datacenter. This has been, without a doubt, the most important project within the history of our company, for a number of reasons. We sell, host, and support websites for a single vertical market. A few thousand sites, all operating off a single shared framework/codebase. This is up from the few hundred sites we were hosting when I joined the company almost three years back. Our sites have been a testament to the power of the ColdFusion server platform, and I thought it important to share with you all the importance of our move, the challenges we overcame, and the benefits we've incurred.

I want to give you a little background here, so that you'll have an understanding on the history and growth of our application, and how critical it is to think in terms of scale. In talking with several developers, while at WebManiacs, I was surprised to find out just how many had come across similar issues at one time or another.

[More]

WebManiacs Follow-Up

After WebManiacs, I thought it would be good to jot down some thoughts on conferences, and ColdFusion development in general. I was asked to speak at WebManiacs, which was my first conference speaking engagement, and although my session was somewhat small (last session that day), I had a great group who seemed to really enjoy my presentation, with a lot of questions, comments, and discussion afterwards. All in all a lot of fun. That being said, the conference was... lacking a little. Now, in all fairness, it was the first of it's kind, the first for FigLeaf (of this size), and a learning experience for everyone involved.

[More]

Previous Entries / More Entries