Sep 30, 2009

ColdFusion and CFML sites

Have a ColdFusion / CFML powered site? Add it to the list. There are 2 lists I know of:

http://www.gotcfm.com

and

http://www.coldfusionsites.com


ColdFusion sites is new but seams to work fairly well.

Let me know if there are more CFML site listings.

Sep 23, 2009

Do you close your ColdFusion tags

Do you close your ColdFusion tags?

I do I like it, it looks cleaner and I know where code blocks end.  When I see code that is unclosed I can't help but "fix" it.

eg

or

Thoughts?

Sep 21, 2009

Another new ColdFusion podcast

A few weeks ago I came across RIAPodCast this weekend I saw that another new ColdFusion podcast was released.

This week in ColdFusion by Brian Carr, Micky Dionisio and Mike Chandle.

The first episode was a good listen and I felt exactly how these guys feel about cfscript in ColdFusion 9. My 2 favorite comments were "ColdFusion 9 is ColdFusion all grown up" and "script bases cfc's were on average 18% less key strokes".

Script is probably my most anticipated feature of ColdFusion 9 and I have mentioned this before here.

Make sure you check it out. Great stuff guys.


Sep 18, 2009

ColdFusion 9s ORM and Flex with a simple demo

It's been a while since I revisited a small issue I had with the ORM and Flex in ColdFusion 9. I made a simple example to try send actionscript VO's to ColdFusion 9 and treat the VO as a object the ORM can understand and perform its magic.

Thanks to Rupesh who contacted me over night I realized I missed adding:

unsavedvalue='0';

to the id of the component I was trying to save. The ORM kept thinking the VO I sent from Flex was an ID that didn't match to any ID in the actual database and was throwing errors. I added the missing attribute restarted the Application and I'm in business.

I didn't create a single line of SQL I let the ORM handle that but here is what was created in SQL 2008 in ~20 line of ColdFusion code:



Here is a small demo ( You Need Flash Player 10 ). You can right click to view the source. I'll also mention once more how nice it is to use script only notice that I don't have a single tag in my ColdFusion Code. The demo is very basic but demonstrates how simple a basic CRUD ( Create Update Delete ) could be.

Bring on CF9!



This demo is hosted on Hostek's ColdFusion 9's Beta plan.

Sep 17, 2009

Google App Engine Twitter OpenBD and Flex

Yesterday I talked about CFML, Flex and Google app engine however I failed to mention how I was actually using OpenBD ( cfml ) and Flex on GAE all together. Unless you actually viewed the source code what I mentioned looked like simply hosting a swf on GAE but there was more to it.

I put together a second small example last night to demonstrate this and used everyone favorite examples and that is Twitter.

Have you every tried to pull down Twitter data via the API from Flex or Air? Well you know that you can't due to Twitter crossdomain policy. It's a pain and it means you have to proxy everything via your own server. So if we are forced to proxy why not let google handle this for us?

Twitter_Proxy.cfm:



Sample App:
( Be warned that the API is having 503 issues so you might need to try a few times before results show )

By default with no search term it will search for ColdFusion



View source.

Here are my recent posts on Google App Engine and OpenBD ( CFML ):
Gettign Started with OpenBD and Google App Engine
OpenBD cfc's and Google Appengines Data store
Googles DataStore and how to view your data ( Enterprise Manager for GAE )
Flex OpenBD and GAE part 1

Sep 16, 2009

Google App Engine Flex OpenBD and ColdFusion

So now we have CFML running on Google app engine can I also get a flex application up there aswell?

Why yes you can and its really very easy.

Simply compile and export for Flex application and copy it to {eclipseGAEProjectName}\war\{flexName} or just put it in the root {eclipseGAEProjectName}\war\

See below:



OpenBD doesn't have BlazeDS remoting to Flex ( yet ) so I just used http service in this example but webservices will work aswell. Of course you could always add a crossdomain policy and use remoting back to a ColdFusion/Railo server if you need to and just host the swf on GAE.

Here is a follow up.

Here is a demo app:
This is actually sitting on Google App Engine just embedded into the blog. You can put in and RSS/Atom feed and it "should" load up in the DataGrid. By Default it gets ColdFusion Bloggers feed.

Here is the real link if your interested.



Here is the source its nothing fancy just a demo app.

BTW it is possible to get BlazeDS on GAE and I am looking in to this. From what I can tell its only amf with java right now though.

Here are my recent posts on Google App Engine and OpenBD ( CFML ):
Gettign Started with OpenBD and Google App Engine
OpenBD cfc's and Google Appengines Data store
Googles DataStore and how to view your data ( Enterprise Manager for GAE )

Sep 12, 2009

How to add Virtual hosts in Snow Leopard OSX

I wiped my Old(ish) Macbook and upgraded to Snow Leopard this gave my Core Duo 1.8ghz 2g ram macbook a lease of new life. I needed to re-setup my local dev enviroment and noticed a few people where unsure how to setup vhosts with apache default install with OSX 10.6/10.5/10.4 so here it is step by step.

Edit the hosts file to add a local DNS entry.


Add the domain name you wish to use 127.0.0.1 is the loopback IP do not change this IP.


Create the folders and files for the local website. I chose to place the log files for apache in the site folder and the website content under a sub folder www.


Edit httpd.conf I used path finder here to show the locations.


You can also use VI or any text editor


On line 465 uncomment: Include /private/etc/apache2/extra/httpd-vhosts.conf and save the file.


Edit: /etc/apache2/extra/httpd-vhosts.conf


Add in the details of the new virtual host and save:
( I'm running Railo on Tomcat locally so I have so additional parameters )

I also set my logging levels to log as much as possible.

Notice the location of the logs files matched the access.log and error.log files created earlier



Run: apachectl -t
to confirm there are no syntax errors.
I choose to leave the example sites, they cause a warning but it wont stop apache.
Then restart apache: sudo apachectl restart


Create a test file in the new folder for the virtual host ( /Users/Paul/Sites/paulsDev/www )


Confirm the new virtual host works:


If you'd like to watch the logs in a terminal you can use tail:
tail -f /the/Path/to/the/log/file


BTW Dave made a great How-to on setting up Tomcat and Railo on OSX which you can view here.

Sep 11, 2009

OpenBD cfcs the Datastore and an Enterprise Manager on Google App Engine

The dataStore is nice it works well for storing cfc's but what do you do if you need to visually inspect the data without writing code. Ie Whats the "Enterprise manager" for the datastore?

Well it's actually built into the admin console in you google app engine account. Before I took some time to explore my admin console I was saving data and it was effectively lost to me ( test data ) but now I am able to review/edit/delete the data.

You can also run GQL:

GQL is a SQL-like query language suitable for querying the App Engine datastore. For a complete discussion of the GQL syntax and features, see the GQL Reference.


Here is the OpenBD DataStore documentation.

Interestingly the SQL is slightly different between the admin console and the cfml code:



Here is how to Setup Open BD on GAE and here is the sample app on GAE

Admin Console:



Select the "Collection/Table"



GQL:



Edit:

Sep 9, 2009

OpenBD Google App Engine and cfc's

In my previous OpenBD on Google App Engine post I mention there is no relational database ( yet ) for OpenBD on GAE. There is however the ability to write and save objects directly to Googles Data Store. This sort of feels like working with an ORM but it's even more abstracted as there is not actual database that we can see but we can put objects in this place and run simple queries against the data sets.

Here is a code snippet:

Persisting Data:


Notice I must use variable.VariableName rather then cfproperty name="variableName this is explained here.

Here is a small application to demonstrate this in action:

Click Here for a live demo.
( Yes it looks like UniCode just works :) )

Being that it lives on Googles servers the application should be very fast and I expect Googles connections to be very fast you'll notice I do a cfhttp call in every page request you almost don't even notice it's happening.

I really have no metrics to judge/comment on the performance of the datastore but I am working on a project with Rob Parkhill which will make use of the datastore or the SQL engine that's being built so I may have something to report in a few weeks/months.

Here is the official OpenBD wiki entries on the datastore.

Here is the sample app code:




Visitor.cfc

Sep 6, 2009

ColdFusion on Google App Engine with OpenBD

I guess there hasn't been 'alot' of publicity on it but Open Blue Dragon ( a free Open Source CFML engine ) runs on Googles Java App Engine.

What Is Google App Engine?
Google App Engine lets you run your web applications on Google's infrastructure. App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs grow. With App Engine, there are no servers to maintain: You just upload your application, and it's ready to serve your users.

I have had an app engine account for quite some time but it sat idle until recently. It's actually quite easy to get an application running in CFML ( That's real ColdFusion/CFML code ) on google's servers and I have put together a short ( < 5min screen cast of the process ).

The process is the same for OSX Windows and Linux. There are restrictions and several things don't work( yet ). The most notable is the lack of a relational database but there are options ( next post ).

**Note In the screen cast I delete the web-inf folder. DO NOT do this. Several people have contacted me reporting that they did exactly as I did. I re-did the total process on Windows and deleting web-inf caused the application to not launch. Instead simply copy over the folder.

There is sound to this as I talk through the process.
 

URLs:

Google App Engine
Eclipse
Google App Engine Plugin for Eclipse
Open Blue Dragon

This is the actual demo code running just withing an iFrame you can click here for the actual URL.

Sep 4, 2009

New(ish) ColdFusion - RIA Podcast

I listen to CFConversations and CFHour as soon as the episodes come out but I only just learned of RIA Podcast.

Check it out here - http://www.riapodcast.com/blog

I'm not sure if its on iTunes I don't have it installed on this PC but its worth listening to and has some stand out talent.

Great to see/hear a 3rd ColdFusion podcast.

I also heard a rumor that Matt Woodward might be starting up a new podcast aswell.

Sep 1, 2009

Inline Java compilation in ColdFusion 9s VFS with java loader

I was reading over the changes in Mark Mandels latest release of JavaLoader and noticed that it can now compile .java on the fly. That was pretty cool in itself but got me thinking.

I could now theoretically write java code inline, write it out to a file and let javaloader compile and load the class for me then clean up the file for the next run. I tried it and it worked.

I then ask Mark if it works with ColdFusion 9's VFS ( Virtual File System ). Mark hadn't tried this and wasn't sure so I gave it a go.

Guess what. Yep it works perfectly.

Here is the code and an image of the output:



Here is the actual code Running:

http://cf9.kukiel.net/demos/java/