grails

attaching multiple files to a domain class

I've seen various Grails plugins which allow easier handling of file uploads, however these tend only to support a single file per form-submit. I'd like a multi-attach form where as soon as you pick one file, an extra field and button is added using JS (various sites do it like this). Do you know of any good plugins which provide elega...

External user domain in grails

We're currently using Acegi 0.5.2 plugin for Grails 1.2.1. However, we're going to move our user management to external CRM. What would be the best way to link existing Person domain with external CRM entity? ...

Passing data from GSP to a controller in Grails

I create a GSP page with controls depending on the rows in a database. This depends on the value returned by the <g:each in="${Vehicles}" var="vehicle"> So, if there are 3 vehicles, 3 rows with text boxes will be generated. (The maximum can be 200) <g:form action="update" > <label for="SearchTerm">${term}</label> <g:eac...

Custom Grails plugin dependency

I have a custom grails plugin I m trying to develop and set this def dependsOn = [dataSource: "1.0"] in the Plugin script. Now, my custom plugin loads just fine but I dont see tomcat installed in my application. How does one install a dependency plugin (prompt the user to say yes/no)? Is this even possible? ...

Grails generate-registration without requestmap

I'm making a site thats using a static requestmap. I'm trying to add registration with generate-registration and i keep getting an error Warning, target causing name overwriting of name default Error executing script GenerateRegistration: groovy.lang.MissingMethodException: No signature of method: groovy.util.ConfigObject.lastIndexOf() ...

Grails: Problem with nested associations in criteria builder

I have a frustrating problem with the criteria builder. I have an application in which one user has one calendar, and a calendar has many entries. Seems straightforward enough, but when I try to get the calendar entries for a given user, I can't access the user property (MissingMethodException). Here's the code: def getEntries(User user...

Grails domain class properties from properties file

In my grails application I want to read some values from properties file and set it to Grails Domain class static property at startup. Example Class A{ static myValues="1,2"; } class B{ static myValues="2,3"; } In the above example I have directly given the inputs..Instead of that I want to read it from one config.propert...

Grails (On App Engine) - Basic Search Functionality

Hey Guys! What I need is Search Scaffolding but in its absence I was wondering if you could point me in the direction of any really simple examples for adding search to a domain. I can't use the searchable plugin as it conflicts with the AppEngine plugin (Unless someone has got this to work?). I just need to be able to filter the scaff...

Using grails service in domain class

In my grails application I want use service.However it is always coming as null.I am using grails 1.1 version.How to solve this problem. Sample code: class A{ String name; def testService; static transients=['testService'] } Can we use service inside domain class? ...

Getting details of the error inside a custom error page

I implemented a controller that handles HTTP error codes: class ErrorController { // 500 def internalserver = { } // 504 def timeout = { } // 404 def notfound = { // just testing the values log.debug "params: ${params}" log.debug "response: ${response}" log.debug "url:...

How to search an inner class?

I have these classes. class Author{ Person person } class Person{ String lastName String firstName String middleName } I'd like to query Person and Author. def persons = Person.findAllByLastNameiLike("${a}") but it seems I can't do def authors = Author.findAllByPerson(persons) Any ideas how I'd do this? ...

One's more about grails searchable plugin

Hi. I have two simple domains: public class Hotel { static searchable = true Source source City city HotelType type long sourceid float lat float lon static hasMany = [hotelTexts:HotelText] static mapping = { hotelTexts batchSize:10 } } public class HotelText { static searchable = true static belongsTo = [hotel:Hot...

How to invalidate / refresh a domain instance association?

There is a bug in Grails preventing me from using removeFrom* when the node I'm trying to remove is extending the collection type. Removing the node directly from the association won't update the second level cache. A hasMany B Is there any way to manually invalidate or force a reload on an association cache? Invoking refresh() on...

Which web application framework?

From the following list of frameworks, which one would you use to develop a rich web application and why would you choose it over the others? Sproutcore GWT ExtJS GXT SmartGWT Dojo / Dijit Flex Capuccino Grails ...

How To Implement Adding An Extra Parameter in Grails Pagination?

I have a page/gsp that displays 3 different classes. This means that I need to add extra parameters to the pagination links. currently the link auto generated by default pagination tag in grails produces links like this: http://localhost:8080/Teams/Leader/assignFollower?offset=400&amp;max=100 I'd like it to be something similar t...

How do you update a TextField from a grails remoteLink?

Existing markup: <g:textField name="identifier"/> <g:remoteLink action="newId" update="identifier">generate new id</g:remoteLink> Corresponding HTML markup: <input type="text" id="identifier" name="identifier"> <a onclick="new Ajax.Updater('guid','/webapp/domain/newId',{asynchronous:true,evalScripts:true});return false;" href="/webap...

Intellij Grails and Git

I want to backup my code using smart Git. As a start I am a bit confused, IntelliJ has created two folders for my GRails project: these reside in 1) C:\Documents and Settings\me\.grails\1.2.1\projects and 2) C:\Documents and Settings\me\IdeaProjects\ The 1) contains a plugins folder which contains directories and files of plugins I a...

Grails domain class event listner in service level

Hi , I want to interrupt some specific grails domain class events(read,write,delete,update).Is there any hibernate eventlistner available for grails domain classes.So that all the calls will go through that eventslistner.I tried following def beforeLoad={}, def beforeInsert={} ,etc ..Other than that is there any other way something can ...

Grails validation problems with sets of data: only getting one error message for all errors in a set

Hi, I'm trying to validate a domain class that has a number of subsets. class IebeUser { ... static hasMany = [openUserAnswers:OpenUserAnswer, closedUserAnswers:ClosedUserAnswer] } class OpenUserAnswer { OpenQuestion openQuestion String text static belongsTo = [user:IebeUser] s...

How do you nest g:each tags in gsp?

Assume I have the following classes class Genre { static hasMany=[author:Author] } class Author{ static hasMany=[books:Books] } class Books{ Author author } How do I go about printing this in the gsp using g:each tag? ...