RAP on Grails

Last week Benjamin Wolff, a long-known RAP fellow, announced that he has just created an RWT plug-in for Grails.

rap grails1 RAP on Grails

Grails is a ready-to-use web framework with some great featues such as a persistence layer with ORM, dependency injection, unit testing, and advanced web APIs. It comes with a command line that helps you create and run web applications and can also export them as .war files. Grails is based on Groovy, and since Groovy runs on the JVM, it allows to leverage existing Java libraries–such as the RAP Widget Toolkit.

Benjamin says that he was “always missing the nice API and widgets that RAP provides” when working with Grails. So he tried to integrate RWT into a Grails application. With the new decoupled design introduced in RAP 1.5, this was an easy task for someone who knows both RAP and Grails.

After this worked out well, he decided to make his integration available for others as a Grails plug-in. Now you can start writing RWT applications in Grails right away by simply including a plug-in. An RWT application is set up the Grails way, using a configuration:

rwt {
  entrypoints {
 
    // Configuration of an entry point named 'hello', the relative URL path will be '/hello'
    hello {
      bean = 'helloEntryPointService' // The name of the entry point bean (required)
      pageTitle = 'Hello RWT!' // The browser title that will be displayed (optional)
    }
 
  }
}

You can find a simple example RWT application using some Grails features on the GitHub page of the RWT plug-in. As you see, the plug-in not only provides plain RWT, but also JFace, making it easy to bind complex data to your UI. And Grails’ O/R mapping and dependency injection make it even simpler.

This is just the first release of the plug-in. Benjamin is planning some improvements and is interested in any feedback. At the moment, the plug-in incorporates RWT in the latest version 2.0M3. But when RAP 2.0 is released in February 2013, there will be a update of this plug-in available that includes the RAP artifacts directly from Maven.

We are always happy to see RAP being used in new contexts, and in particular it’s great to see that our decoupling in RAP 1.5 proves helpful for others.

3 Responses to “RAP on Grails”

  1. Benjamin Wolff says:

    Hi Ralf,

    thank you very much for the announcement on the blog, a nice and accurate summary ;). I would really love to see it getting some traction in both communities and I’m looking forward to add features and improve the integration of these two great technologies.

    Cheers,
    Ben

  2. Ralf Sternberg says:

    Hi Ben,

    thank *you* for your great work! and let us know if there’s anything we can help with.

    One little inconsistency I’ve noticed in your documentation: page 2 (Getting Started) shows an example configuration with an entrypoints section. On page 3 (Configuration), this section is missing, the entrypoints are direct children of the rwt block. I think it makes perfect sense to group all entrypoints in an extra block as shown in Getting Started, to keep them separate from other global configurations. A theme for example should to be defined once for the application and it can be used by all entrypoints. What do you think?

    Cheers, Ralf

  3. Benjamin Wolff says:

    Hi Ralf,

    that was indeed a mistake in the documentation, I fixed it. Thanks for pointing this out!

    I was planning to add the configuration for themes as a next step. I created an issue here to talk about the implementation: https://github.com/bwolff/grails-rwt/issues/2

    Don’t hesitate to add your comments or to create other issues with ideas for further improvements/enhancements.

    Cheers,
    Ben

3 responses so far

Written by . Published in Categories: EclipseSource News, Planet Eclipse

Author:
Published:
Nov 28th, 2012
Bookmark:
Follow:

Twitter Google+ GitHub