Hi Keke, Thanks again for your contribution!
This is a nice illustration of the interest of Groovy for DSLs and an opportunity for Groovy users to leverage the Restlet project for their RESTful Web applications (http://www.restlet.org). Best regards, Jerome PS: I have also relayed the news on my blog: http://blog.noelios.com/2008/02/29/groovy-dsl-available-for-restlet/ > -----Message d'origine----- > De : keke [mailto:[EMAIL PROTECTED] > Envoyé : vendredi 29 février 2008 09:03 > À : discuss@restlet.tigris.org; [EMAIL PROTECTED] > Objet : [GroovyRestlet] GroovyRestlet is hosted as a Groovy Module > > GroovyRestlet is a simple and ease of use Groovy DSL for constructing > Restlet application. > > Main features of GroovyRestlet: > * Simple Groovy DSL syntax and shortcuts for easily constructing > Restlet application > * Better integration with Spring framework > > A simple example of GroovyRestlet DSL: > > builder.component{ > current.servers.add(protocol.HTTP, 8182) > application(uri:""){ > router{ > def guard = guard(uri:"/docs", > scheme:challengeScheme.HTTP_BASIC, > realm:"Restlet Tutorials") > guard.secrets.put("scott", "tiger".toCharArray()) > guard.next = directory(root:"", autoAttach:false) > restlet(uri:"/users/{user}", handle:{req,resp-> > resp.setEntity("Account of user > \"${req.attributes.get('user')}\"", > mediaType.TEXT_PLAIN) > }) > restlet(uri:"/users/{user}/orders", > handle:{req, resp-> > resp.setEntity("Orders or user > \"${req.attributes.get('user')}\"", > mediaType.TEXT_PLAIN) > }) > restlet(uri:"/users/{user}/orders/{order}", > handle:{req, resp-> > def attrs = req.attributes > def message = "Order \"${attrs.get('order')}\" for > User \"${attrs.get('user')}\"" > resp.setEntity(message, mediaType.TEXT_PLAIN) > }) > } > } > }.start() > > > The detail introduction and examples of GroovyRestlet can be found > here: http://docs.codehaus.org/display/GROOVY/GroovyRestlet > > GroovyRestlet 0.1-SNAPSHOT can be downloaded here: > http://svn.codehaus.org/groovy-contrib/groovyrestlet/download/ groovy-restlet-0.1-SNAPSHOT.jar > > Thanks for Guillaume Laforge and Jerome Louvel's help and suggestion, > GroovyRestlet is hosted by Groovy as a contribution. > > > Cheers, > Keke > ----------------- > We paranoid love life