cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <bdelacre...@apache.org>
Subject GroovyMarkup syntax works!
Date Thu, 15 Apr 2004 15:52:27 GMT
I've just commited a GroovyMarkup [1] generator sample in the BSF 
block, allowing the ScriptGenerator to use syntax like this:

xml.page() {
     content() {
         section() {
             title("GroovyMarkup test")

             p("Look ma, no angle brackets!")

	ul() {
                 for(i in 1..5) {
                     li("This is item " + i)
                 }
             }
        }
     }
}

Thanks to James Strachan who very quickly fixed a problem in Groovy's 
SAXBuilder. I've committed a snapshot of the Groovy jar with the fix, 
this will have to be replaced with the next release when it's 
available.

Next step would be to allow the (way cool) Groovy Sql syntax [2] to be 
used for database queries. It should be easy to implement, by making a 
ConnectionProvider available to the scripts so that a groovy.sql.Sql 
object can be created to use Connections from the Cocoon pool (I'm 
thinking of having the ScriptGenerator release them to keep scripts 
simple).

I won't have time to work on it right now, so if someone wants to jump 
in...

-Bertrand

[1] http://groovy.codehaus.org/markup.html
[2] http://groovy.codehaus.org/sql.html


Mime
View raw message