grails

Left Joins in Grails

Hi, How to call joins in grails.Here are my Domain classes : package com.org.domain class CoverageList { Integer id Integer pub_cat_id Integer brand_id Integer brand_set_no String cov_list_desc Date edit_date Date part_edit_date Integer category_id static constraints = { } static mapping ...

Does anyone have any experience using CloudFoundry with Grails?

I am at the point with my Grails app that I want to deploy it up onto Amazon EC2 so I can start showing it to people. I have a little experience using EC2 "manually" to put other projects onto the web, but I was hoping to find something which made the deployment cycle a little more manageable. In steps CloudFoundry. I have read throug...

Grails war command defaults to development environment under netbeans

Hi, when I generate the war in my grails app via right-click / run grails / command / war, it shows "Environment set to development", having it run without parameters. Why is this happening when according to the docs it should default to production (which is what I need)? BTW, is there a way having built the whole grails application wit...

Using Grails Acegi-Plugin and need additonal checks at authentication time

I have seen the other questions and reviewed the documentation, but I have not found a clear example or answer. 1) Do I need a new userDetailsService class 2) Do I need a new userDetailsService class AND subclass the GrailsDaoImpl The documentation for the plugin discusses it but it is just not clear to me? ...

Renaming composite foreign keys in GORM

I have the following classes: class Catalog { static mapping = { id composite:['name', 'manufacturer'] columns { name column:'cat_name' manufacturer column:'manuf_id' } } String name Manufacturer manufacturer } class Order { static mapping = { columns { // How to rename foreign keys as cat_n...

Secure some, but not all pages in a Grails application with the Shiro plugin

Might be just me, but I have a hard time understanding how to secure just some of the pages in a Grails application with the Shiro Plugin. I use this in my security filter: class SecurityFilters { def filters = { all(uri: "/**") { before = { // Ignore direct views (e.g. the default main index page). if (!con...

Grails logging all to one file

I have an issue when i war my grails project to deploy on my production server there is a limitation that i only log to /var/log/tomcat5/catalina.out. This means that i have to make every log including stacktrace write to that one file. I've tried following other examples and it just doesn't seem to work i still get the error "permission...

grails-app/utils dir

Hi, I've just noticed the existence of the grails-app/utils dir. I've never seen it referred to in any documentation (or used in a project). It's created by default when you run create-app, any idea what you're supposed to put in there? "Utility" code is an obvious guess, but it seems like that should go under the src dir. Thanks, Don...

Script level login to Grails app using Acegi security

Scenario: I have a Grails app that uses Acegi security for authentication. I'm implementing a REST service endpoint in the app and want to be able to GET and POST to / from the service endpoint using a shell script. I've been trying to use curl to do this, but can't find the right combination of parameters to make the curl command log ...

GORM Save cascade return collection with no ids

Hi, Using Grails (GORM) I'm populating a collection upon creating an object and I must return the newly populated collection with ids. class A { static hasMany = [bees:B] } class B { static belongsTo = [a:A] } As noticed, a one-to-many relationship when the many side belongs to the one side for full cascading If A is not saved befor...

Groovy: isn't there a stringToMap out of the box?

as a tcl developer starting with groovy, I am a little bit surprised about the list and map support in groovy. Maybe I am missing something here. I am used to convert between strings, lists and arrays/maps in tcl on the fly. In tcl, something like "['a':2,'b':4]".each {key, value -> println key + " " + value} would be possible, where...

Overriding setter on domain class in grails 1.1.2

I have following two domain classes in Grails 1.1.2: class A implements Serializable { MyEnumType myField Date fieldChanged void setMyField(MyEnumType val) { if (myField != null && myField != val) { myField = val fieldChanged = new Date() } } } class B extends A { List children void setMyField(MyEnumType val) { if (m...

Session variables not sticking with GXT

I'm encountering a strange problem with the session using GXT 2.1 and a Grails 1.2 backend. I'm creating two FormPanels, panelA and panelB, which submit to action1 and action2 in Grails respectively. In action1 I set a hardcoded session variable and retrieve it in action2, but it is always returning null! If I manually go to action1 then...

Grails: Invoking one taglib from within another

Hi, I want to define my own taglib that will use the g:datePicker to generate some of it's output. class MyTagLib def myTag = {attrs -> // I need to invoke the `datePicker` tag of the the `FormTagLib` tag library // provided by Grails } } I want to pass along the attributes map when I invoke this tag. When I invok...

How to determine controller/function caller from view in grails

Hi, how can I determine what function from which controller called the view I'm currently displaying ? Thanks. ...

Defining a particular strategy of ID generation in Grails

Hi, how i can define and use a strategy of ID (primary keys) generation for my domain classes ? I want to put a prefix for the primaryKey of some domain classes like customers and manufacturers based in the ID (primary key) of their hometown. I know that Hibenate has a API for this, but who i can integrate such strategy in my Grails app...

grails test-app to output to console

Hi I am new to grails, coming from Django. Using test driven development, I am used to writing tests and then actual functionality. What works well for me it to write the test, run the function with some debug output to see that state of variables until the unit test passes, and then moving the debug output. In grails the 'grails t...

grails datePicker data binding

Hi, I've create a modified version of Grails' datePicker tag. It uses exactly the same parameters as the Grails datePicker, but for some reason the Date property of the object that these parameters are bound to is not being set. This class has a property start of type Date and the parameters that are being sent are start_year start_m...

How do I map my domain URL the root folder of my Grails app?

I have a Grails app called abc, which when I access locally I get at through http://localhost:port/abc I have deployed my app up on Amazon EC2 with an elastic IP address which I can get at directly as http://1.2.3.4/abc I have a domain name of xyz.com and I have pointed that at my elastic IP, so now I can go to http://xyz.com htt...

Removing controllers and domain classes in grails

Hi, as there is a process to create a controller or a domain class via grails create-XXX, are there any considerations be aware of for their removal ? Or is it enough to delete the class and the corresponding test ? Thanks. ...