Adobe User GroupColdFusion Users Group of WA

AJ Mercer

Blogging at http://webonix.net/
webonix.net :: Exploring the wonderful world of CFML

In search of the Holy Grails of web development

February 10, 2010
In search of the Holy Grails of web development

Two things happened recently that have inspired me to step back from CFML and take a look at a different web development environment. Paul Kukiel post on how to install GlassFish and CF (with link to adding Railo)  and Dan Vega's post about a free Grails book.

A lot of CFML projects have taken inspiration from the JAVA, PHP and Rails world - ColdSpring, Transfer ORM (and more recently CF9 ORM), CFWheels, SplashCMS ... As CFML engines are JAVA based and can utilise JAVA classes easily, I have always thought if I was going to learn something else, it would be from the JAVA side of the fence; but just not JAVA. I have heard a few positive things from CF people about Groovy, and the Rails thing is popular at the moment, so Grails seems like it ticks all the right boxes.

So even if I don't be come a Grails developer, I still this there are 2 useful outcome; well maybe 3, but I am not entertaining that idea at the moment

  1. An understanding of where the CFML projects are coming from and perhaps learn better modeling techniques
  2. More appreciation of what CFML is doing for the developer
  3. A new career choice

So far I have spent a few hours going there the guide and am impressed by what Grails can do. And what is suprising me at the moment is that I am not fussed by the fact I am using command line and a text editor. I know there are IDE's out there, so if I do get serious I know there are better options. But also, using a text editor is a great way to learn new languages. It is too easy to look at code and think you understand it. But it is not until you spend a few minutes tracking badly cased class names or a missing curly bracket will you really learn the syntax.

I have taken a quick peak at the HTML Grails creates and it is not too dissimilar from CFML; there is ${variableName} verses #variableName# and <g:tag /> versed cfTag />.

I also created a war of my web app and dropped it into GlassFish - and what do you know, it run :-)

The other thing I am thinking about, but resisting the urge to get distracted at this early stage, is to call the classes created by Grails from CFML

Read In search of the Holy Grails of web development in full

Server Rebuild - Railo on Tomcat with Apache

January 12, 2010
Server Rebuild - Railo on Tomcat with Apache

I have decided to go with Apache and Tomcat for my Railo server, and so today rebulit the server from scratch. The server is still running Ubuntu 9.10 and I did a LAMP install.

Next I used Viviotech Railo installer - thanks Jordan. This installs Tomcat and Railo and then hooks it up to Apache (using mod_jk). Thanks also to the great people on the Railo list for helping me with Apache and Tomcat configurations for rewrite rules and Aliases.

For the records

Apache site config

<VirtualHost *:80>
    ServerAdmin admin@webonix.net
    ServerName    webonix.net
    ServerAlias    www.webonix.net

    DocumentRoot /path/to/webroot/
    DirectoryIndex index.cfm index.html

    RewriteEngine On
    RewriteCond %{HTTP_HOST} www\.webonix\.net [NC]
    RewriteCond %{HTTP_HOST} !^$
    RewriteRule ^/(.*) http://webonix.net/$1 [L,R]
    RewriteRule ^/post/(.*)$ /post.cfm/$1 [L,PT,QSA]
    RewriteRule ^/archives/(.*)/(.*)/(.*)$ /archives.cfm/$1/$2/$3 [L,PT,QSA]
    RewriteRule ^/archives/(.*)/(.*)$ /archives.cfm/$1/$2 [L,PT,QSA]
    RewriteRule ^/archives/(.*)$ /archives.cfm/$1 [L,PT,QSA]
    RewriteRule ^/page/(.*)$ /page.cfm/$1 [L,PT,QSA]
    RewriteRule ^/author/(.*)$ /author.cfm/$1 [L,PT,QSA]   
    RewriteRule ^/feeds/(.*)$ /feeds/$1.cfm [L,PT,QSA]
</VirtualHost>

/webroot/WEB-INF/web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">
    <!-- The mapping for the Railo servlet -->
    <servlet-mapping>
        <servlet-name>CFMLServlet</servlet-name>
        <url-pattern>/post.cfm/*</url-pattern>
        <url-pattern>/archives.cfm/*</url-pattern>
        <url-pattern>/page.cfm/*</url-pattern>
        <url-pattern>/author.cfm/*</url-pattern>
    </servlet-mapping>
</web-app>

tomcat server.xml

<Host name="webonix.net"
      appBase="webapps"
      unpackWARs="true"
      autoDeploy="true"
      xmlValidation="false"
      xmlNamespaceAware="false">
      <Context path="" docBase="/path/to/webroot" />
</Host>

tomcat web.xml

<!-- The mapping for the Railo servlet -->
<servlet-mapping>
    <servlet-name>CFMLServlet</servlet-name>
    <url-pattern>*.cfm</url-pattern>
    <url-pattern>*.cfml</url-pattern>
    <url-pattern>*.cfc</url-pattern>
</servlet-mapping>

Read Server Rebuild - Railo on Tomcat with Apache in full

Lite Application Frameworks for ColdFusion

November 02, 2009
Lite Application Frameworks for ColdFusion


Recently there seems to have been some backlash against monolithic application for ColdFusion - they are too hard to learn, there require to much effort to set them up ...But probably the works criticism of all, is they take the fun out of ColdFusion development.

In reply to this, a number of 'lite' application frameworks have sprung up. For Example

So I was wondering,

  • how good are these frameworks?
  • can they hold there own again the big Frameworks?
  • and are they really easier to pick up and run with?

I was also wonder how the authors of the 'Lite' frameworks feel about

  • the framework used as a learning tool / stepping stone to a 'real' framework
  • they are for 'Hobbyists', not 'Real developers'

And in the future, will the authors feel the need to implement requests for developers that will turn the 'lite' framework into monolithic application?

Read Lite Application Frameworks for ColdFusion in full

Sign up for a piece of the CF.Objective(ANZ) action

September 07, 2009
Sign up for a piece of the CF.Objective(ANZ) action

The cf.objective(anz) committee have been working around the clock over multiple timezone and international banking laws and are now ready to accept your registration for CF.Objective(ANZ) 2009 in Melbourne, AU on November 12-13. Get in before October 12 for early bird price of $769

The conference speakers and program has been locked in and many Sponsors are getting behind this event.

Read Sign up for a piece of the CF.Objective(ANZ) action in full

A CFML framework for the rest of us - Reclaimed

August 22, 2009
A CFML framework for the rest of us - Reclaimed

After taking a look at FW/1 I posed a blog tittled 'A CFML framework for the rest of us'. Shortly afterwards, I got a comment (slightly tongue in cheek) from Chris Peters say that was ColdFusion on Wheels catch phrase / slogan.

I have not looked a cfwheels for a long time; about when the ownership changed hands and I think it may have had some issues with Railo (v2). So I downloaded and installed on Railo 3.1 and got the welcome page up :-) That motivated me to look at the excellent cfwheels documentation and do through the examples. The tutorials are very basic, but give you a good understanding of the philosophy behind cfwheels (which is based on Ruby on Rails).

I also took the opputunity to take a look at Russ Johnson's CMS built on cfwheels call Splash CMS. So far all I can say, besided saying it looks great, is that it does run on Railo 3.1; which will be no surprise to those that know Russ. I am hoping this will be a good project for me to dig into and see how to build applications with cfwheels and will blog about it shortly.

Read A CFML framework for the rest of us - Reclaimed in full

CF.Objective() Conference in Melbourne, Australia

August 14, 2009
CF.Objective() Conference in Melbourne, Australia

About 12 months ago Mark Mandel approached me and other ColdFusion User Group Managers to see if we would be interested in helping him bring CF.Objective() to Australia. I thought this was a brilliant idea and was happy to do what I could to make this happen. So very quickly a committee of keen Australians and CF.Objective() owners was formed. Then a stray Kiwi made his way into the group and cf.Objective(ANZ) was off the ground.

Adobe came on board as the main sponsor, and committed to sending some speakers. Then very quickly speakers from all over the world signed up to become speakers.

Lots of activities have been happening to make this conference come to life, and today we released the program for cf.Objective(ANZ). Find out more about cf.bjective(ANZ) here and make sure you follow cf.Objective(ANZ) on Twitter for the latest updates.

Thanks to every one on the committee for making this happen, and thanks to cf.Objective() for bringing the conference to Australia.

So, get out your magic marker and draw a big circle around 12th and 13th of November 2009, and start looking for cheap flights to Melbourne. I have got a flight home already - now to organise getting there.

 

Read CF.Objective() Conference in Melbourne, Australia in full

Time to get serious with frameworks

August 08, 2009
Time to get serious with frameworks

I have been taking a look at Framework One and it has motivated me again to learn OO development for ColdFusion. A part of this learning is to investigate Transfer ORM as well.

But like all good projects, it starts off with a bit of procrastination. So I have updated Railo to 3.1.0.26 and MangoBlog to 3.1. Now that is out of the way, time to get stuck in.

Hmmm, maybe some lunch first ...

13:37 Transfer tBlog seems to be running fine

Read Time to get serious with frameworks in full

A CFML framework for the rest of us

July 30, 2009
A CFML framework for the rest of us

I have been looking at a number of frameworks for awhile but have found them to be either:

  • too complex / hard to get my head around
  • seem like overkill for the applications I build
  • have too much plumbing for my liking

and on some occasions all of the above.

Sean Corfield (Mr Frameworks) is currently working on something that I think is going to suit me nicely - FW/1. Introducing Framework One will tell you all about it.

It is a conventions based framework, like cfWheels, that does not need a lot of configuration to get started. Something that I really like is you can start your site off with just views (and layouts), and then add controllers and services in later. This means you can have a site up and running very quickly; no messing around with plumbing / listeners / general OO headaches.

Conventions and auto-wiring feels a little like black magic at first, but once you understand the rules (FW/1 documentation is really good and there are plenty of example apps), it is a joy to work with.

And for a single file framework (one CFC of about 400 lines), it is no light-weight in terms of functionality; full MVC and hooks to popular bean factories like ColdSpring. It currently runs on ColdFusion, Railo and soon Open BlueDragon.

Read A CFML framework for the rest of us in full

Setting up Google Mail in Railo

May 27, 2009
Setting up Google Mail in Railo

Another one for my notes that may help others. Here are the settings to uses Google mail Server for send emails from Railo.

SMTP: smtp.gmail.com
Username: email@gmail.com
Password: *********
Port: 587
TLS: checked
SSL: not checked

Read Setting up Google Mail in Railo in full

Railo Express with Virtual Hosts

May 27, 2009
Railo Express with Virtual Hosts

I wanted to play around with Railo's Extentions without too much messing around. So I thought I would use Railo Express, but I wanted a web site per application, so they could run from the web root. After a bit of Googling (with google cache to the rescure for www.railo-technologies.com/en/index.cfm?treeID=211) I found out how to get this working. This blog is mostly for my personal records, but if it helps others that is great too.

In /contexts directory you will see railo.xml. Make a copy of this file, eg railo-mangoblog.xml, and then edit it.
Find the following
    <Set name="resourceBase">
        <SystemProperty name="jetty.home" default="."/>/webroot/
    </Set>
and change webroot to a new name, eg webroot-mangoblog

In the same file, uncomment the virtual hosts section and add you domain. eg
  <Set name="virtualHosts">
    <Array type="String">
      <Item>mangoblog.railo.org</Item>
    </Array>
  </Set>

Save this file.

Next create the directory you just defined in the same directory as webroot.

(Re)Start Railo using the BAT file(s). You should see a WEB-INF directory being created for you. You can now administor you site for that domain, eg http://mangoblog.railo.org/railo-context/admin/index.cfm

Read Railo Express with Virtual Hosts in full

Population PDF Forms with ColdFusion 8

May 14, 2009
Population PDF Forms with ColdFusion 8

Now that Adobe owns ColdFusion, a lot of PDF functionality has been added to CF8. Amongst that is the ability to populate PDF Forms. This means you can pre-populate forms for clients / members - how many times have you had to fill out a form and think to yourself, 'they already know this stuff!!'

The client / member can then update any info if required. With the proper licencing, you can save the data in the PDF, or have the PDF submit the data back to the web server.

Recently I was given the job of reproducing Contract Notes for clients. The origion is produced by printing the data onto stationary; but as the client wont have the sationary, this is not going to work. No drama for me, I am a CF developer :-)

The first think I did was to open up the PDF in Adobe Acrobat and add fields to the document to create the PDF form. This document is not to be alter by the client so licencing was not an issue. In fact, I get ColdFusion to flatten the file after it is populated so the client can not modify that data and then print it.

In previous of CF, you would hvae to use CFPDF to read the document, then other CF tags to get the fields and poplaute and bluh bluh bluh - doesn't matter any more cos CF8 simplifies all that with a new tag - CFPDFFORM and it's buddy CFPDFFORMPARAM

<cfpdfform source="#pdfPath##pdfDoc#"
                 destination="#pdfPath##pdfTemp#"
                 action="populate"
                 overwrite="yes" >
    <cfpdfformparam name="Branch" value="#qryCnote.BranchName#" />
    <cfpdfformparam name="Advisor" value="#qryCnote.AdvisorName#" />
</cfpdfform>

Just add a CFPDFFORMPARAM for each form field and give it a value <hand in the air and shout> 'Clear!'

And to get rid of the form fields, just use the flatten attributes.

<cfpdf action="write"
           source="#pdfPath##pdfTemp#"
           destination="#pdfPath##pdfTemp#"
           flatten="yes"
           overwrite="yes" />

And finally, push it back to the browser

<cfheader NAME='Content-Disposition'
               VALUE='attachment;filename=#saveAsName#' />
<cfheader name="cache-control" value="" />
<cfheader name="pragma" value="" />

<cftry>
    <cfcontent type="application/pdf"
                    file="#pdfPath##pdfTemp#"
                    deletefile="yes"

                    reset="yes" />
    <cfcatch>
    <!--- prevent unnecessary log entries when user
           cancels download whilst it is in progress
    --->
    </cfcatch>
</cftry>

Read Population PDF Forms with ColdFusion 8 in full

Railo 3.1 Open Source is here

March 31, 2009
Railo 3.1 Open Source is here

The beta of Railo 3.1, the Open Source version, was released to day. I will update this blog entry once I have had a little play with this much anticipated release. One of the first things I will be checking out is the Extention Manager - download and install application from the Railo Administrator. Gert has been letting a few sneak peeks slip out that makes me think I will not be getting much sleep tonight (2am release in Perth).

Railo 3.1 LogoAlong with the engine, new web sites too.

If you want to know more about Railo, and will be in Sydney in May (21-22), make sure you see Gert Franz at webDU 2009.

I am offcially a Railo Fan - it says so right on their site ;-)

Read Railo 3.1 Open Source is here in full

webDU 2009

March 09, 2009
webDU 2009

I want to go to webDU too

I am all booked in for another trip to Sydney, this time the familiy is coming as well. Fly in Wednesday lunch, check in, then on the ferry to Manly. If there is time will try and swing by Bondi too. We are planning on going to the Aqaurium one night.

Then two days for ColdFusion and web goodness for me while the family hits the Sydney town. Looking foward to catching up with CF buddies and finally get to meet Gert Franz.

After that it is off to the Blue Mountains for the weekend. Then one more look around Sydney before flying home Monday afternoon.

Read webDU 2009 in full

webonix.net is dynamic again

October 25, 2008
webonix.net is dynamic again

Well after a couple of months of being off-line, webonix is back - better, stonger, faster. New hardware, new Ubuntu and new Railo

Read webonix.net is dynamic again in full

New ColdFusion Podcast

June 16, 2008
New ColdFusion Podcast

Sadly, ColdFusion Weekly has come to an end :-(
Well done to Matt and Peter for 80 podcasts over 2 years.

But the good news is Brian Meloche has got some buddies to gether to pick off were the weekly left off. Check out the new ColdFusion podcast here.

In the first session, after all the intros, they do a wrap-up of all the ColdFusion conferences that have being going on. Event though no one at the round table were at webDU 2008, some one (I think Jeff Coughlin), gave webDU big kudos.

Next the podcast moved into the two newly announced Open Source projects, openBD and Railo 3.1. The round table said a lot of favourable comments about Rail. They also discussed comments made by Vince (for which he got refered to a part of the male annatonomy that will loose them a PG rating, and the communities reaction to it.

 

Best wishes Brain and Co.

Read New ColdFusion Podcast in full