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:
- 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
- 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
- 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.
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:
- 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.
There are still some outstanding important bugs that I will endeavour to fix soon, as well as improving the error reporting on all fronts.
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, primaryAuthor.name, isbn"/>
Version 0.6 fixes a bunch of bugs related to rendering fields for nested property paths e.g. propertyName=”book.author.firstName” and introduces support for list / array properties eg “book.authors.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.