grails

Not getting content in Excel sheet after exporting using DynamicJasper in grails

Hi. I am new to grails and jasper reports. Please help me with the issue. I am trying one example on how to save in excel format the data that we display in grails. I am able to save as excel but not able to get anything inside excel sheet after opening it, not even columns. Refer the link http://www.wysmedia.com/2009/05/dance-with-dynam...

Associations and the Grails webflow

Hi, it's my first time using webflows in Grails and I can't seem to solve this. I have 3 domain classes with associations that look something like this: class A { ... static hasMany = [ b : B ] ... } class B { ... static belongsTo = [ a : A ] static hasMany = [ c : C ] ... } class C { ... static belongsTo = [ b : B ...

How to create virtual path to tempdir tomcat ?

I want to put my images to db but i want to have a link on each image. So I have the idea to copy the image to the temp dir of tomcat (or weblogic). But I must map the tempdir to a virtual path. How do it ? ...

Persisting string array in single column

Our main domain object has multiple string[] properties (various configuration options) and we are thinking of an elegant way to persist the data. GORM creates joined table for the each array so we end up with about dozen joined tables. I wonder if it would be possible to serialize each array into single column of the main table (somew...

How to access relationship table when doing executeQuery in Grails?

Is it possible to access the relationship table when doing HQL statement? As an example, I have 3 tables: account, commitment, account_commitment. It was generated using these domains: class Account { static hasMany = [ commits : Commitment ] String name } class Commitment { static hasMany = [ actors : Account ] String ...

Grails, app-engine, jpa - beginner having trouble with grails generate-all

I'm trying to learn about grails with Google App Engine and JPA by following a few tutorials: http://www.morkeleb.com/2009/08/12/grails-and-google-appengine-beginners-guide/ http://inhouse32.appspot.com/index.html http://grails.org/plugin/app-engine I've got grails 1.3.0 RC 2, and App Engine SDK 1.3.3, and I'm using Windows 7. The st...

grails: quering in a composite structure

hey i have the following domain model: class Location { String name static hasMany = [locations:Location, persons:Person] } class Person { String name } so basically each location can hold a bunch of people + "sub-locations". what is the best way to recursively query for all persons under a location (including it's sub l...

Seed data for grails application

Hello, What is the best way to load seed (initial or test) data into grails application. I'm considering 3 options Putting everything in *BootStrap.groovy files. This is tedious if the domain classes and test data are many. Write custom functionality to load it through xml. May not be too difficult with the excellent xml support ...

How to count ocurrences in 1 to many relationship in gorm - grails

Hi, I have 2 domain classes class A { .... static hasMany = [bs:B] } class B { int code .... } How can I list the number of ocurrences of all codes in B in all the A table? Something like b.each { thisb -> int ocurrences = A.bs.findAll{it == thisb}.size() ... } Thanks ...

Effective way to calculate a similarity percentage between data sets

I am currently working with User objects -- each of which have many Goal objects. The Goal objects are not User specific, that is, Users can share the same Goal. I am attempting to fashion a way to calculate a "similarity percentage" between two Users... (i.e., taking into account how many Goals they share as well as how many Goals they ...

Why does this Grails/HQL query with a JOIN return Lists of pairs of domain classes?

I'm having trouble figuring out how to do a "join" in Groovy/Grails and the return values I get person = User.get(user.id) def latestPhotosForUser = PhotoOwner.findAll("FROM PhotoOwner AS a, PhotoStorage AS b WHERE (a.owner=:person AND a.photo = b)", [person:person], [max:3]) latestPhotosForUser isn't a list of PhotoOwners. It's a lis...

List of all domain classes in Grails

Hi there, how can I get a list of alle domain classes I use in my project? Something like GORM.domains.list()... Greetings from Germany Jan ...

Hibernate's version values in Grails app

I'm looking at a database dump file, and I see many records in various tables with their version number set in values other than 0 (even 94 in one case). I understand it has to do with hibernate locking strategy, but my concern is that today is Sunday, and the site has almost no visitors so is: is this normal ? Or is there a known hibern...

Problem with variable inside gsp

Hi, I have a loop inside a gsp page, and I want to do a calculation on the fly, so I set a variable: <g:set var="total" value="0" /> And in the loop: <g:each in="${mob}" var="m"> ... <g:set var="total" value="${total+(m.q*m.sts.uf)}"/> ... </g:each> The "total" value does not correspond to the expected calculation. m.q is an...

How to implement "select sum()" in Grails

I have a relationship like this: class E { string name hasMany = [me:ME] } class M { float price } class ME { E e M m int quantity } And I'd hate to iterate to achieve this: "obtain the sum of the quantity in ME times the price of the corresponding M for a given E". Any hints on how to implement it using GORM/HQL ? Thanks...

install plugins manually???

is it possible to install and uninstall plugins manually in grails?? if yes, how can it be done? ...

Spring Webflow in Grails keeping plenty of hibernate sessions open

Hi, I have an Internet app running on Grails 1.1.2 and it integrates Spring WebFlow mechanism. The problem is that there are some bots ignoring robots.txt and are entering the flow quite often. Because second step of the flow needs some human intelligence, the bot leaves open flow after the first step. This causes a lot of open flows ...

How to access Grails domain classes in Java service layer?

How can I use grails domain classes (which is in groovy) in service layer which is in Java/Spring. When using the grails MVC, everything is fine as I can use controller to access domain objects and call CRUD and other dynamic methods on them. But, what I am wondering is is there a clean way to do it from Java - say the service layer. F...

Sharing session (or cookie) using Grails acegi plugin

Is it possible for two different Grails project, also having different domains, to share a session/cookie? Let's say I have 2 sites: www.mycompany.com, and, www.othercompany.com. Assume that both sites are having same domains, and same database and records too. What I want to know is if this code: authenticateService.userDomain() or ...

println in grails gsp file

I know this is simple thing, but i was not aware. I used println in gsp file and expected to print output in console. But this is showing on page. <% for(int i =0; i < threads.size();i++) { println i } % thanks. ...