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() />
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!
Railo Tasks viewer extension - version 1.2.3
Posted by Paul Klinkenberg in Railo on March 17, 2012
Just a quick post this time, about my newest Railo extension!
The Tasks Viewer extension shows all registered Scheduled tasks on the Railo server, ordered by web context. The detail page will show you all matching log entries (from scheduler.log), and shows a graph of Missed/Succesfull/Errored executions.
This graph is created by looking at the available log data. Logs are deleted when they have grown to 1 MB, so there might be times when you have very little info, and times when you have a lot. That is out of my control unfortunately.
Another feature is the Alert Service, which periodically sends you an email if any tasks threw an error, or were not executed at all.
Beginners, or Why the web is so hackable
Posted by Paul Klinkenberg in Other stuff... on March 2, 2012

Nooooo, off course users can't change hidden values ;-)
From: http://stackoverflow.com/questions/1857032/jquery-ajax-post-not-working#link-post-1857032
The Railo team wishes you a great Railo new year!
Posted by Paul Klinkenberg in Railo on January 2, 2012
Last December, one of the busiest months for most developers, almost everyone in the Railo team took the time to create a video message for all Railo users, contributors, friends, and clients. This video is now online, wishing you a Great Railo New Year!

Recent Comments