This plugin has the ability to add the
message function just as in controllers to services or other
arbitrarily defined grails artefacts. The artefacts may be configured in Config.groovy.
By default, the
message function is injected into services, but may be configured for additional artefacts as well.
message method may be used exactly as the controller or tag lib
message method as described in
def message = message(code:"default.not.found.message", default:"Not found", args:[ "My Object", "1" ])
Modifying Affected Artefacts
In order to modify the artefacts that are affected by the plugin, simple add the following lines to your
file and add/remove entries as needed:
grails.plugins.artefactmessaging.artefacts = [ [name:'service', plugin:'services'], [name:'task', plugin:'quartz'], ]
name property is used to retrieve the classes from the Grails application. For example, the second entry
above would attempt to retrieve all the quartz task artefacts by using
artefact messaging plugin automatically will observe all changes to files watched by the plugin configured
plugin property. This property may also be null if reloading is not desired.
The default configuration is as follows:
grails.plugins.artefactmessaging.artefacts = [ [name:'service', plugin:'services'], ]
This means that all grails services are automatically injected with the
Special thank you to Paul Fernley for his implementation of grabbing a localized message by the current request bound to the thread (see ArtefactMessagingService).
- Fix #1 - default configuration was not working properly
- Initial release