Archive for December 10th, 2010

This Week in Grails

Friday, December 10th, 2010

Update: Check out the Chinese translation

I tend to see a lot of Grails and Groovy related items in my RSS reader, a couple of Twitter keyword searches, the Grails User mailing list, and miscellaneous other places, so I thought it’d be good to aggregate some of the useful and/or interesting items that I find each week to hopefully give them a little more visibility.

I also wrote a small Groovy script to find the most recent plugin releases and updates since they don’t always get announced.

Miscellaneous Items

  • Upcoming Grails 1.3.6 release

    • The 1.3.6 release should be next week once testing is finished. There are lots of fixes and improvements in this release – check out the partially-finished release notes. The code is very stable at this point so you’d help us out a lot by installing the latest build from our CI server and testing it with your application and letting us know if there are any issues.
  • Ted Naleid’s run-script

    • We had a request to add this cool script to the Grails core scripts and that will be released in 1.3.6. It makes it easy to run a Groovy script that access your domain classes, services, Spring beans, etc.
  • MinuteProject 4 Grails

    • This is an interesting reverse engineering project that supports Grails and several other frameworks. I haven’t looked at it extensively yet but it looks like it does a lot of what my Database reverse engineering plugin does but also generates a scaffolded user interface.
  • Updated Grails logging configuration documentation

    • Peter Ledbrook added a bunch of information to the logging configuration section of the Grails user manual and published a draft here
  • GroovyTestCase uses java.util.logging.Logger

    • Integration tests typically extend GroovyTestCase which has a protected log variable. Unfortunately it turns out that this is is a java.util.logging.Logger but Grails uses Log4j, and this can cause logging statements to seem to disappear and cause confusion when running tests.
  • Testing Closures in Groovy

    • This is an interesting post by Scott Vlaminck using a tracking delegate to help with testing Closures.
  • SAP SDN Blog Reader for iPad, iPhone and Android devices

    • Blog post about using Grails to write a mobile feed reader application
  • Grails 400 Retail Site

    • Developing a Grails e-commerce site using a DB2/400 database on an iSeries/AS400 box
  • QuickHit is hiring

    • QuickHit is hiring a Grails lead developer in Foxboro, MA. They run a popular Grails-based site that hosts realtime football games using Flash.
  • Updated STS Integration docs

  • Mystery Grails site launch

    • Unfortunately I can’t share any details about this one, but a large web site went live this week with their site updated to be entirely Grails-based. It looks great and performance is fantastic. Hopefully more information will be forthcoming once they officially announce the update.
  • Speaking of large sites using Grails …

    • Check out the SpringSource Case Studies page – it turns out that they had a bunch of Groovy and Grails related case studies that I hadn’t seen before.

Plugins

There were four new plugins released:

  • ajaxflow version 0.1.8. Enables ajaxified webflows
  • error-pages-fix version 0.2. Workaround for GRAILS-6992
    until Grails 1.4 is released
  • full-calendar version 0.1.4. Adds support for the FullCalendar jQuery plugin
  • twitter-checker version 0.1. Monitors Twitter for events including new followers and unfollows in your account, new RTs of you made by other users, and new mentions to you made by other users

There were also several updated plugins:

  • activiti version 5.0. Integrates the Activiti BPM Suite and workflow system
  • autobase version 0.10.0. This abandoned plugin has been picked up by new developers
  • cassandra version 0.7.0.20101207. Provides access to Cassandra (not a GORM layer).
  • dojo version 1.4.3.4. Adds the Dojo javascript toolkit.
  • fsm version 0.6.4. Adds Finite State Machine behaviors to domain classes.
  • gorm-mongodb version 0.5.4. Adds a GORM wrapper for MongoDB.
  • jasper version 1.1.6.3. Enables use of JasperReports.
  • localizations version 1.4.1. Stores I18N messages in the database.
  • remoting version 1.2. Exposes Grails services over RMI, Hessian, Burlap, and Spring’s HttpInvoker protocols
  • spreedly version 0.1.2. Provides access to the Spreedly online payment service API
  • ulc version 0.3.1. Provides access to the Canoo UltraLightClient (ULC) RIA kit

In addition, I wanted to draw particular attention to one plugin update, the 1.0 release of the console plugin. This is one of my favorite plugins and I released an updated version yesterday and wrote up some notes here.

Updated Grails Console Plugin

Friday, December 10th, 2010

I’ve released an update to the Grails Console Plugin, version 1.0.1 (there was a bug affecting Grails 1.1 in the 1.0 release). The original authors (Siegfried Puchbauer and Mingfai Ma) aren’t working on it anymore and allowed me to do a release with some changes I had made.

I had been using a modified version of the plugin for a while and finally got around to contributing the changes back. The version I was using was storing the Groovy shell in the user’s HTTP session but this caused problems when clustering since it’s not serializable. This had been fixed in a more recent release however, so the changes I ended up making were mostly cosmetic.

I reworked the GSP, controller and service to be more modular, and split out the Javascript from the GSP into a .js file. In addition I upgraded CodeMirror to the latest version, and switched from Prototype to jQuery (and removed unreleased YUI-based code and other unused files). To customize the console view you can copy the plugin’s GSP (grails-app/views/console/index.gsp) to your application and it’ll be used instead.


Having a console like this available in a running Grails application is very useful. Since it’s running in the same process as your Grails app, it has access to GORM domain classes, services, and everything else in your application. So doing a quick database query, calling a service method or just testing some code is possible without restarting the application or running the standard Swing-based console.

It’s even useful in production, although since this is a very dangerous feature to have in a live web site it’s important to restrict access to it. My preference would be the Spring Security Core plugin since you can restrict it by role (e.g. ROLE_ADMIN) but also by IP address.

I wrote a while back about using a similar console to patch a bug in a running server.

If you have any questions or suggestions send a note to the Grails User mailing list, and report bugs in JIRA under the Grails-Console component.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.