Developer Release: GWT on Rails

Just over two weeks after the release of GWT-REST, the next layer of the Actionatr stack is ready for release.

GWT on Rails

http://code.google.com/p/gwt-on-rails/

GWT on Rails integrates GWT client side compiled JavaScript with Rails RESTful web services by providing client and resource generators, migration support, asynchronous RESTful client support, and Rake automation. A summary follows.

GWT Client Generator

Until now, building a GWT interface for a Rails project required the use of either an IDE or command line tools to build a GWT “module” which then had to be tweaked for use with Rails instead of the default embedded Tomcat server. Using Rails conventions as a starting point, the GWT client generator allows one to generate a GWT interface (or any number of them) with a single command:

script/generate gwt_client dashboard /Users/jdoe/java_libs/gwt-mac-1.4.61

Rake support is included so that cleaning, compiling, and running your hybrid project are also one-liners:

rake dashboard:compile

rake dashboard:hosted

rake dashboard:clean

GWT Resource Generator

Any ActiveRecord model can be exposed on the client side by simply running the GWT resource generator:

script/generate gwt_resource Project dashboard

Migration Support

Once the resource generator has created a client side resource/model, your ActiveRecord migrations will transparently keep everything in sync. Any fields that are added, altered or removed will likewise be updated in JavaScript-land. By generating a base class that is recreated after each migration and a corresponding model that extends this base, custom code can remain intact while the basic model changes.

GWT-REST

The GWT-REST module comes bundled with this plugin, allowing easy CRUD operations with the built in RailsJsonResourceCollection class.

More details are available on the Google Code project site. Enjoy!

Developer Release: GWT-REST

Today, I am pleased to announce the release of GWT-REST.

http://code.google.com/p/gwt-rest/

From the Google Code project site:

GWT-REST is an asynchronous RESTful client implementation for GWT.

GWT-REST can be used alongside GWT-RPC or as a replacement for it. The intent is to provide a drop-in solution for communicating with REST web services that may or may not be implemented in Java.

GWT-REST works out of the box with Rails 2.0 using JSON. I built it for Actionatr and extracted it to share with others who may be looking to do the same thing. Rails isn’t a requirement though. The code is built using interfaces that allow you to customize for other representations like XML and other server side styles like JSR-311/Jersey.