groovygrails

Using java classes in Grails

I have a Java\Spring\Hibernate application - complete with domain classes which are basically Hibernate POJOs There is a piece of functionality that I think can be written well in Grails. I wish to reuse the domain classes that I have created in the main Java app What is the best way to do so ? Should I write new domain classes exten...

Groovy Grails - how to read body contained within tag?

I'm considering reading the body of a tag to determine what variables the tag should send to the body. e.g, here's the GSP <g:get_domain_info id="${patientInstance?.id}" > <tr class="prop"> <td valign="top" class="name"> ${firstNameLabel}</td> <td valign="top" class="value"> ${firstNameValue}</td> </tr> </g:get_domain_info>...

Poor debugging support for Grails web app in Eclipse

Hi, I'm an everyday C#/ASP.NET MVC/Visual Studio user and i've just started a project in JAVA/GRails/Eclipse but i'm finding it quite difficult to use Eclipse's debugging features and find them somewhat limited compared to Visual Studio's. In particular, i'm finding the following rather disappointing but i don't know if they're limitati...

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? ...

How do I nest ${} in gsp

This is in my gsp and it doesn't work <g:select name="head.id" from="${com.hive.Persons.findAllByFirstname(${variable})}" optionKey="id" value="${organizationInstance?.head?.id}" /> I think that the main reason is that I am nesting ${}. How can I accomplish this. ${variable} is a string passed from the controller. thanks! ...

How to Alphabetically retrieve members of a list?

I have an organization class class Organization { hasMany = [member:Members] } class Members { belongsTo = organization } I'm printing all the members using <ol> <g:each in="${organizationInstance?.members?}" var="m"> <li><g:link controller="members" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li> </g:each> </ol> ...

Grails 1.2.x scripts not working

I am using Grails 1.2.x (Tried both 1.2.0 and 1.2.2- same behavior) I am able to create the application fine by using the command grails create-app But, when I try any command within the project- it "freezes" after printing the Base Directory I have tried grails clean, grails war, grails run-app, grails created-domain-class Grails 1....

Should I be so enthusiastic about Groovy?

I'm currently working on my project which consists of front and back-end written in PHP and desktop app written in Java, and that's what the plan was before I discovered Groovy and later on Grails. Now after rewriting my desktop client and sketching some back-end functionality in Groovy I'm considering to drop PHP altogether in favor of...

Copying a folder from pluginBasedir to the target project

Hi, I want one folder to be copied from my plugin's base directory (pluginBasedir) to the target project when someone installs my plugin. If I keep that folder within web-app, it gets copied. But I want to keep that folder under base directory. Do I have to ovverride _GrailsPluginDev.groovy script? Regards, Paras ...

Persist url parameter throughout grails app

Essentially I am looking to have a url query parameter persist throughout the life of the grails application (POST or GET). ex. http://localhost:8080/demo/controller/action/?myParam=foobar I have tried a couple routes. Dynamic method overriding redirect and customizing application tags for createLink. However, since I also use grails ...

Tree and List on the same page

Hi All! Using Grails and the RichUI plugin to display a tree, and it works fine. When I click one of the Nodes in the tree I show a list(table) from a controller. I should be able to create new, edit and sort. My problem is that pagination doesn't work and also sorting!!! Are there anyone who has done this, or can it be done different...

How to access controller dynamic properties within a base controller's constructor in Grails?

Basically, I want to be able to assign objects created within filters to members in a base controller from which every controller extends. Any possible way to do that? Here's how I tried, but haven't got to make it work. What I'm trying to achieve is to have all my controllers extend a base controller. The base controller's constructor...

Grails Scaffolding Default Date

Hello, I'm using Grails scaffolding and would like to make a change in the default date during a create. Currently dates default to today's date. How would one default it to blank or no date? Thanks, Steve ...

How to take a delimited list, parse it, and add it to list.

Hi, I'm using Groovy and Grails and am trying to take a parameter passed to a controller, parse it, and add each individual element into a list. I thought this would work, but it is adding the whole string into the list, leaving me with only one element. list = [] list.add(params["firstNames"].split()) is returning a list with size ...

Need help about grails domain class design.

I need to create grails domain class like this(see image),but I don't know how to do. Can someone please give me the solution,please? Image : http://www.uppicweb.com/x/i/ib/6demo.jpg ...

one to many relation on appengine with Grails/GORM

Hi, does anyone know how to handle a "one to many" relationship with Grails/GORM on the google appengine? I do understand how relationships get handled with Gorm, and there is also a good series of articles about it: http://blog.springsource.com/2010/06/23/gorm-gotchas-part-1/ http://blog.springsource.com/2010/07/02/gorm-gotchas-part-...

Grails UrlMappingsTests

I am trying to create a UrlMappingsTest and am getting the following error: java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and s...

PaaS : How to build ?

Hi, Experts I wanted to make a web application through which : user(end user) can create his own web application online. which will be integrated with the databases and application/web servers and user can also publish that application withing that application only... Doing some research i come to know it goes under category...

How do I update fields of documents in mongo db using the java driver?

References: http://www.mongodb.org/display/DOCS/Java+Tutorial Still pretty new to mongo db but I'm trying to update part of an existing document inside a collection... unfortunately, the link above doesn't have an update example. Essentially, i just want to be able to: Add new fields to a document Update existing fields of a docu...

Grails error executing create-app

Hi, I am using jdk1.6 and grails 1.3.4. I have set the JAVA_HOME,GRAILS_HOME and PATH variables following the instructions in the grails.org site. When I execute the create-app command I get the following error: C:\grails\grails-1.3.4>grails create-app C:\Users\Documents\Grails\helloworld Welcome to Grails 1.3.4 - http://grails.or...