Login

    Register

PROJECT CATEGORIES

 

CFQueryReader
Project Home Blog Forums Known Issues External Project Link Contact Project

Author: Cutter (All RIAForge projects by this author)
Last Updated: November 17, 2009 3:54 PM
Version: 1.2
Views: 5,189
Downloads: 434
Demo URL: http://cfqueryreader.cutterscrossing.com
License: Apache License, Version 2

Description:

Adobe's implementation of JSON return for ColdFusion is great, and frustrating. They use a non-standard JSON return format of query objects 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.

(This build includes an example of using an Ext.Direct API, using DirectCFM to build the data API. It is a very simple example. For more details, see the DirectCFM thread on the Ext Forums: http://extjs.com/forum/showthread.php?t=67983)

Requirements:

ColdFusion 8+
ExtJs 2.x or 3.x

Issue Tracker:

ID ISSUE STATUS UPDATED
2 ExtJs 3.0.3 update breaks reader Closed 11/17/09 1:12 PM
1 Column Names in JSON Fixed 11/09/09 2:42 PM

View All Issues

To enter issues for this (or any other) project, you must be logged in.

Subversion Access:

You may access this project's Subversion repository with your client here: http://svn.riaforge.org/cfqueryreader.

To view files and changelists associated with this repository, go here: http://cfqueryreader.riaforge.org/index.cfm?event=page.svnbrowse.

You may download the latest set of files from Subversion as a zip file.

Anonymous users have read access to the repository while the administrator has write access.

This project is sharing its code via Subversion. Subversion is an open source source control method. You may find more information about Subversion here: http://subversion.tigris.org/