Google App Engine with Coldfusion

Today I'm quite satisfied of what I did. Because I can run and deploy Coldfusion Application in Google App Engine with OpenBlueDragon. It's cool that we don't need to buy Coldfusion Server if we want to host our Coldfusion project. It's 100% FOC just like PHP. Unfortunately, 10% of Coldfusion function and tags are not supported in OpenBlueDragon. I've developed RSS Feed reader project and hosted it in Google App Engine

view plain print about
1<cfset source = "http://www.ppshein.net/rss.cfm" />
2<cfhttp url="#source#" />
3<cfset myBlogXMLDoc = xmlParse(cfhttp.filecontent) />
4<cfset BlogNodes = xmlSearch(myBlogXMLDoc,'/rss/channel/item') />

Above coding stands for fetching data from my blog. In Adobe Coldfusion, to read data from RSS, we can use but in OpenBlueDragon, supports only for Create action. That's why I used with .

view plain print about
1<cfoutput>
2    <cfloop from="1" to="10" index="i">
3    <!---
4        The array contents need to parsed
5        so you can easily get '
6        at the child nodes children and attributes.
7    --->

8    <cfset BlogXML = xmlparse(BlogNodes[i]) />
9    <div id="title">#BlogXML.item.title.xmlText#</div>
10    <div id="date">#BlogXML.item.pubDate.xmlText#</div>
11    <div id="description">#BlogXML.item.description.xmlText#</div>
12    <div id="link"><a href="#BlogXML.item.link.xmlText#" target="_blank">Read More</a></div>
13    </cfloop>
14</cfoutput>

Above coding stands for displaying Blog entities from my blog. You can see example here. It's not my wordpress blog. It's just clone.

Google App Engine data manipulation with Coldfusion

Today, I've recently developed one simple project with Coldfusion in Google App Engine. To manipulate data in Google App Engine is complicated because we can use only GQL (Google Query Language) instead of SQL. Likewise, displaying data in Google App Engine with OpenBD is quite different with Adobe Coldfusion. That's why, it's too hard to handle to everything. Ok, I'll show how to create Table in Google App Engine and retrieve data either.

Create Table and Insert Data

view plain print about
1<cfscript>
2    car = StructNew();
3    car["Class"] = "Sedan-Midsize";
4    car["Make"] = "Audi";
5    car["Model"] = "A6";
6    keyString = googleWrite(car, "MyCarLot");
7
</cfscript>

Ref : http://wiki.openbluedragon.org/wiki/index.php/GoogleAppEngine:Datastore

Display data

view plain print about
1<cfquery dbtype="google" name="QryCar">
2    select from MyCarLot
3</cfquery>
4    
5<cfloop from="1" to="#ArrayLen(QryCar)#" index="i">
6    <cfoutput> #getAllTags[i].Class# </cfoutput>
7</cfloop>

Top of Page