<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>11001000.com</title>
	<atom:link href="http://www.11001000.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.11001000.com</link>
	<description>OK200.info</description>
	<lastBuildDate>Mon, 03 Jan 2011 19:13:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Understanding the various Coldfusion JSON responses and how to use them.</title>
		<link>http://www.11001000.com/?p=50</link>
		<comments>http://www.11001000.com/?p=50#comments</comments>
		<pubDate>Mon, 03 Jan 2011 19:06:25 +0000</pubDate>
		<dc:creator>sbenjamin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[ExtJS]]></category>

		<guid isPermaLink="false">http://www.11001000.com/?p=50</guid>
		<description><![CDATA[This tutorial address some of the challenges that Coldfusion developers face when integrating the ExtJS client side framework with Coldfusion JSON responses. There are many examples of ExtJS integration with php, java, .net and other languages that respond with a well formatted Row based JSON object. But I haven't seen any Coldfusion examples,
so I thought I would give it a try here.]]></description>
			<content:encoded><![CDATA[<style>
		body{font-family:Arial, Helvetica, sans-serif; font-size:12px;}
		.para1{font-family:Arial, Helvetica, sans-serif; font-size:15px; width:715px;}
		.code{font-family:"Courier New", Courier, monospace; font-size:11px; font-weight:bold; color:#333333; width:710px; background-color:#FFFFCC; border:#FFCC00 thin solid;}
		.header{font-weight:bold;}
	</style>
<p><iframe src="http://player.vimeo.com/video/18110016" width="715" height="402" frameborder="0"></iframe>
<p><a href="http://vimeo.com/18110016">ExtJS Data grid with Coldfusion JSON Responses</a> from <a href="http://vimeo.com/user4469560">Steven Benjamin</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>This tutorial address some of the challenges that Coldfusion developers face when integrating the ExtJS client side framework with Coldfusion JSON responses. There are many examples of ExtJS integration with php, java, .net and other languages that respond with a well formatted Row based JSON object. But I haven't seen any Coldfusion examples,<br />
so I thought I would give it a try here.<br/></p>
<div class="header">Row based JSON object:</div>
<div class="code">
    {"ROWS":[</p>
<div style="margin-left: 30px;">
        {"FIRSTNAME":"Steven","STATE":"AZ","ZIP":85251.0,"MEMBERID":1,"ADDRESS":"4906 N 74th St","CITY":"Scottsdale","LASTNAME":"Benjamin"},<br />
        {"FIRSTNAME":"Arnold","STATE":"NY","ZIP":10022.0,"MEMBERID":2,"ADDRESS":"235 W 49st.","CITY":"New York","LASTNAME":"Greenburg"},<br />
        {"FIRSTNAME":"Arnold","STATE":"IL","ZIP":60618.0,"MEMBERID":3,"ADDRESS":"344 West Main St.","CITY":"Chicago","LASTNAME":"Mulder"},<br />
        {"FIRSTNAME":"Charlie","STATE":"CA","ZIP":90245.0,"MEMBERID":4,"ADDRESS":"272 Monticello Ave.","CITY":"San Francisco","LASTNAME":"Davidson"},<br />
        {"FIRSTNAME":"Charlie","STATE":"AZ","ZIP":85415.0,"MEMBERID":5,"ADDRESS":"49 West Cholla St.","CITY":"Phoenix","LASTNAME":"Handley"},<br />
        {"FIRSTNAME":"Chris","STATE":"IL","ZIP":60652.0,"MEMBERID":6,"ADDRESS":"45 Surf St.","CITY":"Chicago","LASTNAME":"Greenburg"},<br />
        {"FIRSTNAME":"Chris ","STATE":"CO","ZIP":51455.0,"MEMBERID":7,"ADDRESS":"2929 Braodway","CITY":"Denver","LASTNAME":"Stabler"},<br />
        {"FIRSTNAME":"Dawn","STATE":"NY","ZIP":10522.0,"MEMBERID":8,"ADDRESS":"34 Cliff St.","CITY":"Dobbs Ferry","LASTNAME":"Goldstein"},<br />
        {"FIRSTNAME":"Amy","STATE":"OD","ZIP":41544.0,"MEMBERID":9,"ADDRESS":"564 Main St.","CITY":"Toledo","LASTNAME":"Matson"},<br />
        {"FIRSTNAME":"Matt","STATE":"NY","ZIP":10236.0,"MEMBERID":10,"ADDRESS":"342 W. 73 St.","CITY":"New York","LASTNAME":"Gold"}
    </div>
<div style="margin-left: 15px;">],</div>
<div>"RECORDCOUNT":10}</div>
</div>
<p>This Row based JSON object has two properties: ROWS and RECORDCOUNT.<br />
ROWS is an array of objects. Each object represents a database row. Within each object is a list of name / value pairs. Each pair is the column name paired with the row value for that column separated by a colon. Each name / value pair is separated by commas. The JSON standard specifies double quotes around all string values, numeric and Boolean values are optional. It is important to note that some earlier libraries accepted single quotes, but this is a risky because jQuery will not read JSON objects with single quoted strings. The second property is RECORDCOUNT, this is the total number or objects in the ROWS array. RECORDCOUNT combined with start and limit pointers are used for paging grids and other ExtJS components. The row based JSON objects are larger than column based JSON objects because the column name is repeated within each row object. However row based JSON objects are more widely used across multiple client side libraries and frameworks.</p>
<div class="header">Column based JSON object:</div>
<div class="code">
        {</p>
<div style="margin-left: 30px;">"COLUMNS":["MEMBERID","FIRSTNAME","LASTNAME","ADDRESS","CITY","STATE","ZIP"],</div>
<div style="margin-left: 51px;">"DATA":[</div>
<div style="margin-left: 120px;">[1,"Steven","Benjamin","4906 N 74th St","Scottsdale","AZ",85251.0],</div>
<div style="margin-left: 120px;">[2,"Arnold","Greenburg","235 W 49st.","New York","NY",10022.0],</div>
<div style="margin-left: 120px;">[3,"Arnold","Mulder","344 West Main St.","Chicago","IL",60618.0],</div>
<div style="margin-left: 120px;">[4,"Charlie","Davidson","272 Monticello Ave.","San Francisco","CA",90245.0],</div>
<div style="margin-left: 120px;">[5,"Charlie","Handley","49 West Cholla St.","Phoenix","AZ",85415.0],</div>
<div style="margin-left: 120px;">[6,"Chris","Greenburg","45 Surf St.","Chicago","IL",60652.0],</div>
<div style="margin-left: 120px;">[7,"Chris ","Stabler","2929 Braodway","Denver","CO",51455.0],</div>
<div style="margin-left: 120px;">[8,"Dawn","Goldstein","34 Cliff St.","Dobbs Ferry","NY",10522.0],</div>
<div style="margin-left: 120px;">[9,"Amy","Matson","564 Main St.","Toledo","OD",41544.0],</div>
<div style="margin-left: 120px;">[10,"Matt","Gold","342 W. 73 St.","New York","NY",10236.0]</div>
<div style="margin-left: 95px;">]</div>
<p>}
</p></div>
<p>This Column based JSON object has two properties: COLUMNS and DATA.<br />
COLUMNS is an array of column names, separated by commas.<br />
DATA is an array or arrays. Each array is the row data ordered by the column name array. Each item in the data row array are separated by commas. Column based JSON object are smaller and more efficient to transmit over the wire. Column based JSON object are only supported by a limited number of javascript libraries, such as spry. The ExtJS library does not support Column based JSON objects, but a custom JSON reader (cfQueryReader) may be used to add the column based JSON functionality. </p>
<p><br/></p>
<div class="header" style="text-decoration:underline;">Server Side Solution: Convert the Query to an array of structs.</div>
<p>ReturnFormat="JSON" (CFC) and serializedJSON() (CFM) return both column based and row based JSON objects. The returned JSON type depends on the input object. A query set is converted to COLUMN based JSON. An array or struct (including combination of nested arrays and structs ) are converted to ROW based JSON </p>
<div style="font-style: italic;">
A popular practice is to convert the query set to an array of structs and convert to ROW based JSON.</div>
<p>The following are two example Coldfusion Component Examples.<br/></p>
<div class="header">Example 1.:</div>
<p>This example is based on Ben Nadel's QueryToStruct function (cfscript): This function accepts a query argument and returns a row based JSON struct.<br/><br />
<iframe src="http://pastebin.com/embed_iframe.php?i=ETZwLj8e" style="border:none; width:715px;height:500px;"></iframe></p>
<hr style="width:715px;float:left;"/><br/><br />
</p>
<div style="width:715px;">
<div class="header">Example 2:</div>
<p>This function accepts a query argument and returns a row based JSON struct. This example accepts additional arguments to set the starting row number and the number of rows to return. (used for paging grids). This example also accepts a Boolean argument: cleanStringsForJson, that call an additional function that cleans JSON string data that might corrupt the well formatted JSON object without escaping special characters.</p></div>
<p><iframe src="http://pastebin.com/embed_iframe.php?i=ZbkBm6Cb" style="border:none; width:715px;height:500px;"></iframe></p>
<p></p>
<div class="header" style="text-decoration:underline; margin-bottom:5px;">Additional functions demonstrated in the video:</div>
<p><iframe src="http://pastebin.com/embed_iframe.php?i=24twUdpV" style="border:none; width:715px;height:423px;"></iframe><br />
<br/></p>
<div class="header" style="text-decoration:underline;">Client Side Solution: Read the Column Based JSON response.</div>
<div style="border:1px black solid; width:715px;">
<iframe src="http://pastebin.com/embed_iframe.php?i=F9AhpPjV" style="border:none; width:715px;height:500px;"></iframe>
</div>
<p><br/></p>
<div class="header" style="text-decoration:underline;">Client Side Solution: Read the Row Based JSON response.</div>
<p><iframe src="http://pastebin.com/embed_iframe.php?i=5g55N6ZX" style="border:none; width:715px;height:500px;"></iframe><br />
</p>
<div class="header">Corrections:</div>
<div class="para1">
In the video I forgot the name of the gentleman who Cutter references' his work of cfQueryReader is based on. cfQueryReader was inspired by the CFJsonReader, originally writtin by John Wilson (Daemach).<br />
In the video: dao.cfc: Line 94 was legacy code and should have been omited.<br/><br />
<cfset temp = arrayAppend(LOCAL.DataArray,1)>
</div>
<div class="header">References:</div>
<div class="para1">
Sencha : <a href="http://www.sencha.com" target="_blank">Sencha</a><br />
Getting started with ExtJS: <a href="http://www.11001000.com/?p=23" target="_blank">http://www.11001000.com/?p=23</a><br />
cfQueryReader Sencha Forum Entry: <a href="http://www.sencha.com/forum/showthread.php?53271-ColdFusion-Query-Data-Reader" target="_blank">click here:</a><br />
cfQueryReader on RIAforge: <a href="http://cfqueryreader.riaforge.org/" target="_blank">http://cfqueryreader.riaforge.org/</a><br />
Cutter's Blog: <a href="http://blog.cutterscrossing.com/" target="_blank">http://blog.cutterscrossing.com/</a>
</div>
<p><br/></p>
<div class="header">Additional Resources:</div>
<p>ExtJS in Action by Jay Garcia: <a href="http://extjsinaction.com/" target="_blank">ExtJS in Action</a><br />
<em>(I have read just about every book on the topic of ExtJS, and by a long shot, this book is the most valuable learning tool I have found to date.)</em><br />
Jay Garcia has many wonderful screen cast on his blog: <a href="http://tdg-i.com/" target="_blank">http://tdg-i.com/</a><br />
ExtJS.tv is new but rapidly growing. <a href="http://www.extjs.tv/" target="_blank">http://www.extjs.tv/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.11001000.com/?feed=rss2&amp;p=50</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intro to ExtJS</title>
		<link>http://www.11001000.com/?p=23</link>
		<comments>http://www.11001000.com/?p=23#comments</comments>
		<pubDate>Wed, 01 Dec 2010 21:49:31 +0000</pubDate>
		<dc:creator>sbenjamin</dc:creator>
				<category><![CDATA[ExtJS]]></category>

		<guid isPermaLink="false">http://www.11001000.com/?p=23</guid>
		<description><![CDATA[After many weeks of procrastinating, I woke up this morning with a bad cold and a damn the torpedoes attitude. I am pleased to finally get my blog launched, but I have to confess that although I was sitting in a room alone, I still suffer from mic fright. I have found it difficult to [...]]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/17375812" width="715" height="535" frameborder="0"></iframe><br />
<br />
After many weeks of procrastinating, I woke up this morning with a bad cold and a damn the torpedoes attitude.<br />
I am pleased to finally get my blog launched, but I have to confess that although I was sitting in a room alone,<br />
I still suffer from mic fright. I have found it difficult to record tutorials with out feeling nervous, so I apologize for<br />
the choppy presentation in advance. Additionally, The vocabulary word "method" somehow got deleted from my<br />
memory as I was making this recording. To be concise, javascript object that can be called as constructors have<br />
properties (what the object knows.) and methods (what the object does.). In the video I frequently refer to methods<br />
as functions, this is not entirely incorrect, but the terminology is none the less odd.</p>
<p>Thank you, and enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.11001000.com/?feed=rss2&amp;p=23</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Welcome</title>
		<link>http://www.11001000.com/?p=1</link>
		<comments>http://www.11001000.com/?p=1#comments</comments>
		<pubDate>Mon, 22 Nov 2010 02:29:23 +0000</pubDate>
		<dc:creator>sbenjamin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.11001000.com/?p=1</guid>
		<description><![CDATA[ok200.info is a non commercial blog with the goal of sharing programming tips and tricks related to the integration of client side libraries and frameworks such as jQuery, ExtJS, YUI and other APIs. The focus is on Coldfusion, but other server side languages will be integrated in to future demos. The demonstrations will presented with [...]]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/17197320" width="400" height="300" frameborder="0"></iframe><br />
ok200.info  is a non commercial blog with the goal of sharing programming tips and tricks related to the integration of client side libraries and frameworks such as jQuery, ExtJS, YUI and other APIs. The focus is on Coldfusion, but other server side languages will be integrated in to future demos. The demonstrations will presented with an emphasis on JSON packet communication, so as long as you understand how to serialize and decode json packets within your choice of server application language, you should find this information helpful. Above all I strive to make this blog a 2 way conversation with the goal of exploring programming ideas and sharing knowledge.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.11001000.com/?feed=rss2&amp;p=1</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

