Internal structure
We have changed a lot in the internal structure of Railo in order to improve the extensibility (extensions) and the performance.Public Interface
The "public interface" (this is the way how you can interact with Railo in java) has been improved a lot. A detailed blog entry for this will follow. You can check out the public Railo interface here http://dev.railo.ch/javadoc/.Ternary operator
Railo now supports the ternary operator which will make using inline conditions much easier. Check out the following example:<cfoutput>it is #isvalid?'fine':'bad'#</cfoutput>
The pattern is:
{condition}?{true-expression}:{false-expression}
Check out http://en.wikipedia.org/wiki/%3F:#CFML_.28Railo_only.29 as wellTimezone defintions
In past you were "only" able to define the timezone of your web context in the Railo Administrator. Now you are able to do this inside your code for only a single request or a single function call as well. A detailed blog entry for this feature will follow.<cfdump var="#getTimeZone()#:#now()#">
<cfset setTimeZone('GMT')>
<cfdump var="#getTimeZone()#:#now()#">
<cfset setTimeZone('PST')>
<cfdump var="#getTimeZone()#:#now()#">
You can compare this with the functions setLocle and getLocale. In this way you are changing the environment timezone for this request and like with locales you can also define the timezone as an argument for different function calls.
<cfdump var="#lsTimeFormat(now(),'full','english (us)','Egypt')#">
The following functions do now support the timezone as an argument:
- createDate
- createDateTime
- createTime
- dateFormat
- day
- dayOfWeek
- dayOfYear
- daysInMonth
- daysInYear
- firstDayOfMonth
- hour
- lsDateFormat
- lsIsDate
- lsTimeFormat
- milliSecond
- minute
- month
- parseDateTime
- quarter
- second
- setTimezone
- timeFormat
- week
- year
Fusion debug
Railo now has an interface to interact with Intergral's FusionDebug as well. A detailed blog entry for this will follow shortly as well.BlazeDS (AMF3) Support
Railo now has support for BlazeDS (AMF3) build in, detailed blog entry for this will follow. Check out Roli's blog on this as well.CFC based customtags
The good old custom tags now come to the cfc age. You are now able to build customtags with the help of components instead of cfml templates. This makes customtags much more comprehensible. A detailed blog entry about this will follow.sizeOf()
Railo now has a new function called "sizeOf". This function returns the size of the given object in bytes. You can use it for almost any type of object.<cfset a.b=array(1,2,3,4,5,6)>
<cfdump var="#sizeOf(a)#">
<cfset a.c=array(1,2,3,4,5,6)>
<cfdump var="#sizeOf(a)#">
Self controlled lib/classes
Railo now has a lib and a class folder for every single web context as well as for the global server context. This folders are managed by Railo, this allows you to add, remove and update jar/class files on the fly. A detailed blog entry for this will follow.cfdump format
You are now able to define how your dump output should look like. Just see the following example:<cfset a.b=array(1,2,3,4,5,6)>
<cfdump var="#a#" format="html">
<cfdump var="#a#" format="classic">
<cfdump var="#a#" format="text">
<cfdump var="#a#" format="simple">
A Railo Administrator page that allows you to define the default debugging format will follow shortly as well.
Optional semicolons
The semicolons you use inside cfscript are no longer required. You can now also write commands per line only.<cfscript>
x=1
y=2
</cfscript>
Extensions
Railo now has a build in Extension Manager that allows you to install/update and uninstall extensions of any kind. Railo extensions as well as CFML applications. See Gert's blog entry for this.More to come...
13 responses so far ↓
1 Adam Reid // Apr 1, 2009 at 1:14 PM
2 Gary Fenton // Apr 1, 2009 at 2:48 PM
The ternary operator looks super useful, just like how it works in javascript.
I'm in two minds about not requiring semicolons. It's very forgiving of Railo but it won't be enforcing best practice.
3 Michael Offner // Apr 1, 2009 at 4:29 PM
in the example above it outputs a string, you can this use with any type you want
some more examples:
<cfset date=DateFormat(now())>
<cfoutput>
#date EQ DateFormat(now())?'today':date#
</cfoutput>
<cfset fine=true>
<cfset sct.a=fine?true:0>
<cfset sct.b=fine?'susi':now()>
<cfset sct.c=fine?array(1,2,3):struct(a:1,b:2,c:3)>
<cfdump var="#sct#">
@Gary
i'm with you, im not a big fan of the optional seicolon, pherhaps we will make a flag to the admin to disable/enable it
4 Oscar Arevalo // Apr 1, 2009 at 4:33 PM
5 Simon WJ // Apr 1, 2009 at 5:14 PM
6 Sean Corfield // Apr 1, 2009 at 8:54 PM
Semicolons are also optional in Ruby and - in both Ruby and Groovy - it is considered "best practice" to omit them unless they are specifically needed to disambiguate some construct!
And, yes, 3.1 is an awesome release - it runs cfSpec now! Another new feature: empty prefix works on <cfimport>!
7 Matthew Williams // Apr 2, 2009 at 4:06 AM
8 Timothy Farrar // Apr 2, 2009 at 3:00 PM
Looks like a great release!
Good work guys!
9 Michael Offner // Apr 3, 2009 at 1:23 PM
no you are right, it was a issue in the deployer, we have fixed that
tnx Michael
10 Ryan LeTulle // Apr 7, 2009 at 2:27 PM
Right now I've got a developer version installed and I can't seem to find a community key.
Is my version now obsolete since Railo went open source? If so, is there a way to update to the latest without affecting the present configuration?
11 Sana // Apr 15, 2009 at 4:03 PM
Would you please provide some info of this new feature "Self controlled lib/classes", I am doing some experiments and so this can be helpful to me to avoid loading classes manually.
12 Gert Franz // Apr 16, 2009 at 9:27 AM
@sana: The CFAdmin tag allows you to load libraries locally for your own web context at runtime. In addition any jar file located in the local conext under for example WEB-INF/railo/lib get's considered, but only for the current web context.
If you want to have a jar available globally for all web contexts, just place it into the server context inside the lib folder there. This directory is normally found here:
{railo-install-dir}/lib/railo-server/context/lib/
Gert
BTW: Sooo funny. Captcha just tells me to enter the letters rtfm :-)
13 Ryan LeTulle // Apr 16, 2009 at 4:46 PM
Leave a Comment