grails

grails many_to_many custom mapping table

Is it possible to generate my custom mapping table in the many to many relationships in grails? I need to introduce an extra parameter in the mapping table and that is the need for creating my own custom mapping table :( ...

Grails: How to get dates in g:textField from calendar?

I have four entry fields from a search filter. I was originally using g:datePicker but it was not quite what I wanted, it was too slow to select the date from drop down boxes, so I decided it was better to use a simple grails text field and next to it a calendar image that would trigger the calendar. I was trying to use the YUI Calendar,...

Grails Tomcat Render GSP template

In a controller i have ,, render(template: 'bookingHeader', model: [memberInstance:memberInstance,bookingInstance: bookingInstance, eventInstance: eventInstance]) render(template: 'bookingAccounts', model: [memberAccountInstanceList:memberInstance.memberAccounts]) which correctly renders info to the screen .. In a gsp I have ...

Performance issue with webtest and grails

Hello I have read the documentation for Grails and Webtest in this site: http://www.grails.org/plugin/webtest And it's very unupdated. Most of the scripts listed there doesn't work. I am looking a way to run a working alternative of -nostart listed there. This is because it's very slow to rerun tests. Or maybe a way to run webtests ...

Grails/GSP: break out of <g:each>

Is there a way to break out of a <g:each>? I have a page wherein I'm iterating through a list and I have to make sure that a checkbox is checked if that was the value stored in DB. To make it a little clearer, please consider something like: <g:each in=${list1}> <g:each in=${list2}> <g:if test="${list1.id == list2.id}"> ...

How to implement Spatial(Geo-Location) searching in Grails?

Hi, I am working on Grails 1.3.2 with MySql. I need to store the latitude and longitude of certain locations in the database and then on the basis of the user's current location, I need to return the items that are within a particular radius of that location. So, we basically have the following requirements: Search for places with-in ...

How to adjust constraints / DB mapping for Map within grails domain class

Following grails domain class: class MyClass { Map myMap } Now for myMap, grails automatically creates a new table for the elements in the map. However if I add elements which are too long (e.g. 1024 characters), I get a DB error. Can I somehow tell grails to make the respective column in myMap's table big enough to allow for large...

Not getting the object id consistently in grails/java

Hi Guys, I am trying to send an email to the customer whenever there is a new invoice generated. but to do that i need to get the id of invoice and customer. My problem is that the code which I am using to get the ids for invoice or customer is giving me inconsistent response, i mean it works sometimes and sometimes it does'nt here is ...

How do I make Intellij stop removing Grails inline plugin module dependencies?

I am developing a Grails application along with a Grails plugin used by that application. In Intellij, I have defined two modules: one for the application, and one for the plugin. In my application's BuildConfig.groovy, I have defined the plugin dependency as a maven dependency, because when it is built/deployed to the production server,...

Grails: How to edit GSP (views/show) to show desired info

I have two Domain classes (Drives & Computer) class Computer { static hasMany = [drives:Drive] String computerName static constraints = { computerName(nullable:false) } } class Drive { static belongsTo = Computer Computer computerName static constraints = { computerName(nullable:false) } } ...

Grails encoding problem Gsp. Help!

I'm with trouble on groovy server pages (gsp) where utf-8 chars are showing not propertly, like "?". But this occur inside grails tags like "${}". Example: <p>Não</p> --> output browser: Não - OK <g:link title="Avaliação Relatório"....> output browser: Avaliaç?o Relat?rio ${value? "Sim" : "Não"} output browser: N?o The gsp already...

another grails urlmapping question

ok, so i asked, and got an answer on how to make a single controller instance case-insensitive vis-a-vis urls. I can do "/mycontroller/$action?/$id?"(controller: "myController") so when an app outside tries to reference link in our app, their lowercase urls ( :( sigh ) will work. I need to extend this to include actions as well. So ...

How to include ' in the input form ?

Hi, I just realize that in my forms I couldn't save name like O'Brian (It would saved as O only and 'Brian will be truncated). I'm using grails 1.2.2 with mysql. is there simple ways to allow ' to be inserted into db ? rather than modify each form and put html replacement for that char ? ...

Should I care about Open Session in View when using Grails?

From my experience of using spring MVC in conjunction with hibernate I know about lazy exception problem occured when addressing to lazy-fetched collection when rendering view. It pure spring+hibernate world it fixes by introducing OpenSessionInViewInterceptor or OpenSessionInViewFilter thus enabling one hibernate session per request. S...

Customize controller name translation in grails

By default SomeController.groovy has a controller name of some. Also, pkg.SomeController has a controller name of pkg/some. Is there a way to plug a custom mechanism for this translation. In my particular instance I want to get rid of the pkg (it's a long story why I need this) I can try to use @Controller("name") but given the number ...

How to Access other values from Login Form using Acegi Plugin in Grails

I want to pass in other hidden values to the server on the form for login. Then I want to be able to do some other computations on the server where I have access to the form hidden parameters and also the newly authenticated user object. I was hoping to use the onInteractiveAuthenticationSuccessEvent event. However, I cannot find a po...

Where to put reusable testing methods used in several grails test classes

I often need to set up the same test structures for different test cases. Therefore I created a TestService class that has several public methods for the test classes. I guess that this is not the best place to put them as TestService will also be deployed although not needed on production. Where would you put those commonly test metho...

Hibernate or Grails - Need help understanding cascade

Hi, I am a college student who do not have a lot of experience on Hibernate or Grails. The main question that I have is mainly about where does cascading apply, does it apply only to attributes where there is an database entry for it or other wise? so for example If I have 2 Domains A and B... where B has hastable that is filled with A...

Copying Relational Table Data

I hope I'm not being too long winded in this question, I just want to make sure that what I'm asking is completely clear (I think it's rather confusing :). I've got a database with a bunch of tables with all my foreign key constraints set up. Relations are sometimes several tables deep, and there are also cases where a child is related ...

Grails Problem with custom error messages

Hi, I am currently trying to specify custom error messages in grails for the default constraints but so far all I get back is the default error message. I know that I have to edit the grails-app/i18n/messages.properties file If I change the following default error codes message, it will correctly display the new error message default...