CFGroovy 2 is a Groovy-centric, pluggable scriptlet engine for CFML runtimes. It allows you to embed any JSR-223 compliant scripting language into your CFML code with transparent passthrough to your normal CFML data structures (url, form, request, session, etc.). Unlike CFGroovy there will be no growth into a Hibernate front end for CFML.
The implementation itself is a single standalone custom tag. It comes bundled with the Groovy JAR and Mark Mandel's JavaLoader so that it can be used without changing your classpath or restarting your server. However, if Groovy is already on the classpath, that will be used as-is and the bundled JAR will be ignored.
Installing your own Groovy JAR is the preferred way to use CFGroovy, I only bundle JavaLoader and the Groovy JAR to make it easier for people to give it a test spin. The classloading voodoo that JavaLoader does can occasionally have strange side effects (not because of JavLoader, mind you, just because classloading is really picky about stuff), and it's generally better to have all your external dependencies in a single location (/WEB-INF/lib) rather than spread around.
Other languages can be pulled in via the 'lang' attribute to the <g:script> tag. The JARs implementing those languages MUST be on the classpath – only Groovy can be loaded implicitly.
Within the body of your script, you have access to variables, url, form, request, cgi, session, application, server, and cluster scopes, assuming they exist. You also have a pageContext variable holding the results of getPageContext(). Here is a simple example using the variables scope:
<!--- set variables.people to an array of structs --->
<cfset people = [ {name: ...}, ... ]
<g:script>
variables.people.sort { p1, p2 ->
p1.name.compareTo(p2.name)
} as Comparator
</g:script>
<cfdump var="#people#" label="sorted people!" />
There is also a manager.cfm custom tag that can be used to flush the script cache, or obtain information about the cache. The default script.cfm uses a simple HashMap-based cache, but if you have Ehcache on your classpath, that will be used instead. It can be invoked like this:
<g:manager action="getCacheInfo" result="info" /> <g:manager action="clearCache" />
CFGroovy2 is targeted at Adobe ColdFusion 8+, Railo 3.1+, and Open BlueDragon 1.0+. There is no intended support for other engines or versions, though as long as they're JVM based and support custom tags and createObject("java", …) there's a good chance it'll work.
The engine (including JavaLoader) is available from Subversion here:
https://ssl.barneyb.com/svn/barneyb/cfgroovy2/trunk/engine/
The demo "app" is available for viewing here (though I don't have Jython or Quercus installed for the Python and PHP scriptlets):
http://www.barneyb.com/cfgroovy2/
and from Subversion here (the demo includes the engine):

