Grails Platform Core 1.0.M1 Plugin – highlights

Posted by: on Mar 30, 2012 | No Comments

A few days ago we released Platform Core Plugin 1.0.M1 for Grails. The platform will provide APIs and utilities to help us take the Grails ecosystem to the next level.

Even though it is a milestone release, it has very functional Configuration and Security APIs that are already in use in some production apps.

To pique your interest, here are a few of my favourite things available in this release of it:

  1. the pluginConfig variable added to all artefacts declared in plugins. This receives the namespaced Config values for the plugin, tying into the cool new doWithConfigOptions hook that lets plugins declare the configuration values that are valid – as well as default values and validators. See the docs
  2. The displayMessage method added to controllers and the g:displayMessage tag that renders the messages set by controllers. Along with their flash scope variants this eliminates more boiler plate from controllers, and provides a uniform mechanism for plugins and apps to use – your app views don’t need to know how a plugin passes a message to the view if the plugin uses these methods. See the docs
  3. The securityIdentity variable added to all Controllers, Services, Domains and TagLibs to provide the identity of the current logged in user, independent of the security plugin your code is using. This opens up app-defined security integration to all plugins – and using something like this would make the recent dependency injection exploits less likely. No need to inject any services into your domains to get the current user. See the docs

There’s a lot more to come, we’re really excited about the M2 release which will expose the public API for Navigation and Events.

Note that if you want to use the security API now in your apps and plugins, you will need to implement the security bridge for your chosen security provider.

Resources 1.1(.1) plugin released

Posted by: on Oct 21, 2011 | 5 Comments

After a frantic 12 hours or so of coding and debugging, I managed to release version 1.1.1 of the Resources plugin for Grails today.

It was meant to be 1.1 but there was a bug that needed fixing immediately after releasing so 1.1.1 is where we’re at. This version is tested with Grails 1.3.7 and Grails 2.0 RC1 which is set to drop this weekend.

What’s new in this release of Resources?

Well aside from some useful bug fixes there’s a few interesting changes:

  1. If you forget to include r:layoutResources tags, you will get an error in the console. The error may or may not display in the browser currently depending on whether you used site mesh layouts or not. We may be able to improve this in future. This means that people who wondered where their JS code was disappearing to after installing Resources into a 2.0 app will now get an error telling them that they need to add r:layoutResources.
  2. There is now support for laying out arbitrary dispositions by passing a “disposition” to the r:layoutResources tag. This means you can position sets of resources wherever you like in the output, using multiple dispositions. Currently this is only relevant for JavaScript but in future we should be able to support images so that you can e.g. have a bunch of “preloaded” images that are hidden in the page somewhere.
  3. The integration with Grails 2.0 has been “finalized” now. The ResourceService has changed to a “grailsResourceProcessor” bean, and all g:javascript invocations result in called to r:require or r:script as necessary. The default layouts in 2.0 now use layoutResources and a default “application” module exists in new projects.

There are still some outstanding important bugs that I will endeavour to fix soon, as well as improving the error reporting on all fronts.


A new Grails plugin: Invitation-Only

Posted by: on Aug 24, 2010 | One Comment

This morning I released a new Grails plugin that lets you manage beta-invites to your app and similar.

More information here.

Bean-Fields plugin 0.6 released

Posted by: on Mar 13, 2010 | 4 Comments

I have released Bean-Fields plugin 0.6. This extremely handy plugin for Grails applications makes your data form GSPs DRY by centralizing the rendering and styling of your fields, handling <label> rendering, rendering appropriate HTML field based on property type, application of HTML max length constraints, rendering “required field” indicators, and rendering per-field errors. Rendering a whole bean’s worth of fields can be as simple as:

<bean:form beanName="book" properties="title,, isbn"/>

Version 0.6 fixes a bunch of bugs related to rendering fields for nested property paths e.g. propertyName=”” and introduces support for list / array properties eg “book.authors[3].firstName” (This was really quite painful to implement!). Radio groups are working properly now, and test coverage much improved – thanks to contribs from Antony Stubbs.

It also adds a user-definable threshold for whether a radio group or select list should be used for a field with an inList constraint.

Full list of resolved issues is here.