grails-plugin

Is it possible to exclude grails plugin from production environment?

I would like to use certain plugin in development environment, but would like to exclude this plugin from production and from generated war. What is the easiest way to accomplish this? ...

Grails client side validation

Hi ! How do you (if you) manage client side validation with grails ? Do you use a plugin or do you mirror your constraints using a javascript framework ? Cheers ...

Search subset of objects using Compass/Lucene

Hi, I'm using the searchable plugin for Grails (which provides an API for Compass, which is itself an API over Lucene). I have an Order class that I would like to search but, I don't want to search all the instances of Order, just a subset of them. Something like this: // This is a Hibernate/GORM call List<Order> searchableOrders = Cus...

Grails searchable plugin

Hi, In my Grails app, I have the following domain class that is indexed by the Searchable plugin: class Foo implements Serializable { BookletCategory bookletCategory Date lastUpdated static hasMany = [details: BookletRootDetail] static searchable = { bookletCategory component: true id name: 'bookletRoo...

How to setup local dependency in grails plugin (classpath to the main app)?

Hi, I have a Grails app consisting of main app and its local module linked in BuildConfig.groovy: grails.plugin.location.'mymodule' = "modules/mymodule" In mymodule I would like to use Helper classes from the main app, however I cannot find any way of how to make mymodule dependent to the main app. I was thinking of adding some extra...

Hooking into Grails Domain object save()

I'm writing a grails plugin and I need to hook into the domain save() method to do some logic after the save. I need to do this across multiple domain classes. I'm trying to avoid hibernate events in the cases where a plugin user is not using hibernate with GORM. I've tried many thing but below is what I think should have had the best ...

Grails UI datatable dynamic dropdownOptions

Using the datatable, within the Grails UI plugin, does anyone know how to make the list of dropdownOptions dynamic? You can specify the dropdownOptions like this: [age:'Age', formatter:'number', editor:[type:'dropDown', controller:'demo', action:'tableChange', config:[dropdownOptions: ['Foo', 'Bar'], disableBtns:true]], sortab...

get plugin to load *new* runtime artifacts?

I've written a plugin with a new artifact "Foo" that goes into the grails-app/foos/ directory. When I create a Foo then run the app, the Foo is picked up nicely ... when I 'touch grails-app/foos/MyFoo.groovy' the class reloads and onChange is called ... but, when I do 'create-foo MySecondFoo' I don't get an onChange call at all - I have ...

Grails Datasourcesplugin - Can it default to all domain classes not previously specified?

Has anyone hacked the datasources plugin so that the last datasource in the list will map to all domain classes not yet specified? I have an app with over 100 domain classes. Almost all of them are in the same datasource. It would be nice if I only had to specify the exceptions. ...

Grails - Determine if an artefact class is in a given subdirectory of grails-app

I'm implementing an ArtefactHandler and I want to be able to create artefacts from Scripts (to support a legacy format). I don't want to make all Scripts into artefacts, but just those in a particular subdirectory of grails-app, say grails-app/foo/. I'm stuck at trying to figure out the path of the artefact from my ArtefactHandler's isA...

grails database migration

Hi, There are at least two Grails plugins that emulate the database migration functionality of Rails. Autobase Liquibase Is there a consensus about which of these is best, or is there another plugin that does database migration which is better than either of the above? Thanks, Don ...

What makes nimble better than shiro?

What makes nimble a better choice than shiro? I'm trying to decide between nimble and shiro for a new grails project right now and I'm curious what makes nimble the better choice. ...

Making Grails form development DRYer

Hi, When using Grails, the GSP code to render each form field looks something like this: <tr class="prop"> <td valign="top" class="name"><label for="username">Login Name:</label></td> <td valign="top" class="value ${hasErrors(bean: person, field: 'username', 'errors')}"> <input type="text" id="username" name="username" value="$...

Grails Acegi plugin annotations

Hi, I'm using the annotations provided by the Spring Security (AKA Acegi) plugin. I have controller actions annotated with @Secured(['ROLE_ADMIN', 'ROLE_USER']) To indicate that they should be available to administrators and regular users. But now I need to indicate that an action is available to administrators and unregistered user...

login automatically with Grails & Acegi

Hi, I'm using the Acegi plugin in my Grails app. After a user registers, he is redirected to an action that is protected. Therefore, he is shown the login form. However, I would prefer if the user was automatically logged in as soon as he completes registration. It seems like I could achieve this by redirecting to the action that the l...

Grails: adding dynamic methods within a plugin

Hi, I'm developing a plugin that adds a getFlashHelper method to each controller. This method should return an instance of a FlashHelper class. However, the constructor of the FlashHelper class must be passed the instance of the controller on which the getFlashHelper method was called. Hopefully the following code will explain what I'...

grails plugin reloading

Hi, When developing a Grails plugin, you can configure it to reload using either the watchedResources or observe properties. From my reading of the official docs, it seems that the former will cause the plugin to reload when a file changes, and the latter when a plugin changes, is that correct? Say for example, a plugin needs to reload...

How To Call A Taglib As A Function In A Domain Class

I need to call the Static Resources Plugin (http://www.grails.org/Static+Resources+Plugin) from my domain class. This works perfectly in a controller: def tstLink = resourceLinkTo(dir:"docs/${identifier}",file:originalFileName) but in a domain class I get Exception Message: No signature of method: static org.maflt.ibidem.Item.resou...

How to extend/override controller actions of plugins ?

The plugin (Nimble 0.3) I am using in my grails application, includes some controllers and associated actions. I want to change (slightly) some actions behavior, and I was wondering how I can achieve that. Can I create a child controller that inherits from my plugin controller and override some of the action implementation? Or, can I c...

Grails datePicker

Hi, I'm looking for a calendar component for my Grails app. I'm aware that Grails already has the g:datePicker, but it's a bit primitive and not very visually appealing. I've had a look on the contribute-a-tag page and in the grails plugin portals and there's a wide range of options. Rather than trying them all out, I'd be very gratefu...