How to upgrade from Railo 3.* to Railo 4

Upgrading your existing Railo 3 installation to Railo 4 is really easy! No need to re-install Railo or anything, just copy-paste some jar files...

No Comments

My view on CFCamp 2012

I did my first conference presentation here at CFcamp 2012. It worked out great, and got some good feedback. I actually can't wait to do another one! Hopefully, you'll be hearing from me at CF.Objective() or Scotch on the Rocks (June 2013!) soon.

So, CFcamp. It is not a German conference. It is a very international one, with speakers from France, Germany, America, Scotland, Switzerland, Belgium, England, etcetera. All presentations were in English, flyers and programs in English, so easily accessible for a Dutchie like me.

The venue was the StadtHalle Germering,

No Comments

Presenting Railo Extension Builder!

At CFcamp 2012, me and Mark Drew did a presentation about Railo extensions, and the Railo Extension Builder. Right there, we released the first public version of Railo Extension Builder.
In case you weren't there, this blog post is a short recap of the presentation. The original slides can be found on slideshare.

4 Comments

Railo tip: multiple assignments in one

While waiting for CF.Objective() to begin, I am doing some relaxed coding with Micha in the lobby of our hotel. It's great to be talking about and working on Railo with the main man :-)

Anyway, a new Railo tip:

<cfscript>
paul = micha = new Person();
paul.name = 'Paul';
micha.name = 'Micha';
dump(variables);
</cfscript>

See the highlighted part? You can do multiple assignments in one statement!

It also works in regular CFML off course:

<cfset paul = micha = new Person() />

 

No Comments

Railo awesomeness: some cool functions and options

I've been working with the Railo source code all day, and noticed some cool functions within the code. I'm taking a minute to share 'em...

querySlice(query, startrow, rowcount)

This function returns a part of the original query, defined by the startrow and rowcount.

Documentation: http://wiki.getrailo.org/wiki/FUNCTION:QUERYSLICE

Example code:

<cfset q = querynew('column1') />
<cfset queryaddrow(q) />
<cfset querysetcell(q, 'column1', "this is row 1") />
<cfset queryaddrow(q) />
<cfset querysetcell(q, 'column1', "this is row 2") />
<!--- this will dump query 'q', but only containing row 2! --->
<cfdump var="#querySlice(q, 2, 1)#" abort />

isZipFile(filepath)

Return yes/no whether the given file path is a zip file.

Documentation: http://wiki.getrailo.org/wiki/FUNCTION:ISZIPFILE

Example code:

<cfzip action="zip" source="/" file="testZip.zip" recurse="no" />
<cfoutput>
isZipFile('testZip.zip'): #isZipFile('testZip.zip')#<br />
isZipFile( getCurrentTemplatePath() ): #isZipFile( getCurrentTemplatePath() )#
</cfoutput>

someObject["set#key#"](value)

This might also be possible (?) in the most recent versions of other CFML engines, but I sure missed it when I worked with Coldfusion 7 and 8.

When you need to update values in a CFC (bean or valueObject) by calling it's setters, but you don't know beforehand which values you need to set, then I always had to use <cfinvoke>:

<cfinvoke component="#someObject#" method="set#key#">
<cfinvokeargument value="#value#" />
</cfinvoke>

Railo allows you to use struct notation:

<cfset someObject["set#key#"](value) />

Now that's a bit shorter and cleaner!

No Comments

abolition-dr