grails

Grails JSON array

I'm converting a list of Foo objects to a JSON string. I need to parse the JSON string back into a list of Foos. However in the following example, parsing gives me a list of JSONObjects instead of Foos. Example List list = [new Foo("first"), new Foo("second")] def jsonString = (list as JSON).toString() List parsedList = JSON.parse(jso...

Grails Duplicate Exception handling

Hi, How to catch duplicate key exceptions in Grails . when trying to save existing integer for a unique column constraint, the error is generating while saving/updating a record . Also used try{ object.save(flush:true) }catch(org.springframework. dao.DataIntegrityViolationException e){ println e.message }catch(org.hibernate.exception.C...

Grails Portlets for Liferay

Hi all, I'm actively developing grails portlets for liferay till today . I was wondering is there a future road map for next plugin releases and updates for portlet support, because i was not finding people developing portlet applications on grails on net. Is there any portlet applications running under production ?? . could any one ...

How do I pass values from grails back to a javascript function?

Hi, I have a feeling that the answer to this is easy but I can't seem to get it yet... I have a Javascript function that calls an action in a Groovy class via a remoteFunction. Now, I need to return the value from the action class back to the Javascript function for further processing. It looks something like this: // sample js functi...

groovy&grails and extjs with netbeans and autocomplete for extjs possible?

Hi everyone! I am using groovy and grails with netbeans. Is there a way to use autocomplete in ExtJS ?(with the .js files in webapp) I read, that netbeans supports autocomplete with ExtJS, however it's not working in my project ... I am using Netbeans 6.8 greets ...

Grails - Need to restrict fetched rows based on condition on join table

Hi guys, I have these two domains Car and Driver which have many-to-many relationship. This association is defined in table tblCarsDrivers which has, not surprisingly, primary keys of both the tables BUT additionally also has another boolean field deleted. Herein lies the problem. When I find/get query on domain Car, I am fetched all re...

Why function callback of Connection is not handled with Yahoo UI ?

I use Yahoo UI with Grails (so grailsui) and I try to upload a file with Ajax and get a JSON response from the server : The response is correctly returned by my controller but a popup is displayed to save the file but it's not a file it's a JSON result. My Yahoo Code is : YAHOO.util.Connect.setForm(document.getElementById('formi...

Grails YUI- Datatable complete refresh

Hi, I have inserted a paginator for my YUI-Datatable. Now I want to refresh my whole page, when the user has changed the view in my Datatable. YUI makes just a refresh (remoteCall) for itself, but I need a refresh for the whole page, because I want to update my Flashanimation too. For any sugest I would be very grateful, Geeronimo 'g...

Dojo or flex with Grails?

Hi, I plan to build a database management system using Grails as the main framework. On the client side, I'm thinking whether to use dojo or flex to make a nice front end. Could some experts here enlighten me on the pros and cons of choosing either, or both? or any other options? thanks! ...

Using (multi lexeme) grails targets in gant scripts

I have a gant script in my grails project. I would like to do something just like this: includeTargets << new File ( "${grailsHome}/scripts/War.groovy" ) war() But for the deploy target in the script provided by the tomcat plugin. Specifically, I would like to invoke this target: grails prod tomcat deploy how would that happen? ...

Grails UrlMapping - cannot set params.id for controller

I'm trying to create a UrlMapping to map some static URL to a controller action, but I can't seem to set params.id. I'm working through Grails in Action, so I'm not sure what's wrong here. Code: class UrlMappings ... static mappings={ "/timeline/chuck_norris"(controller:'post',action:'timeline',id:'chuck_norris') ... } In PostCon...

Cannot set g:checkbox to off for a child on one-to-many relationship

Got a weird issue with g:checkbox not being saved when its switched from on to off for a child in one-to-many relationship. For example: class Parent { Boolean enabled static hasMany = [children: Child] static constraints = { enabled(blank: true, nullable: true) } } class Child { Boolean enabled static belongsTo = [pare...

faster way to change xml to array(grails to flex)

I have a large xml passed from grails to flex. When flex receives the xml, it converts the xml into an associative array object. Given the large xml file, it takes too long to complete the loop, is there any way in flex to make conversion faster? Below is my sample code. <xml> <car> <model>Vios</model> <type>Sedan</type>...

In Grails, How can I create a domain model to link two of another model?

Hey all, I'm currently trying to create a Friendship domain object to link two User objects (with a bit of additional data: createDate, confirmedStatus). My domain model looks as follows class Friendship { User userOne User userTwo Boolean confirmed Date createDate Date lastModifiedDate static belongsTo = [userOne:User , userTwo:User...

Getting the username in Twitter using OAuth 0.1.1 Grails plugin

anyone had tried using http://www.grails.org/plugin/oauth? i'm trying it in twitter.com and i'm having an issue on getting the username or accessing this API: http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-account%C2%A0verify_credentials here's the code in my callback URL: def twitterCallback = { def response = oauthService...

How to create a dir in the context of application deployed on tomcat with Grails ?

I have a Grails application and I use the Config.groovy to add a directory configuration accessible in my controller with grailsApplicatin.config.files.location My directory is "files" to add files in the folder. So I would like that all uploaded files comes into /MyApp/files. I create it on Bootstrap if not exists During the dev it's ...

How can I create a new folder in my web-app (for upload photo album) with Grails on Tomcat ?

i want to create a photo album. But I want to organize on the server the albums so I want to create new folders : /myapp /myapp/albums /myapp/albums/1 /myapp/albums/2 ... How can I do that on tomcat with Grails ? It create all new folder in tomcat/bin not in tomcat/webapps/myapp/ ...

Grails and PermGen issue with g:link and g:render

I've been running grails for sometime without any issues but recently after an upgrade to Grails 1.1.1, I've encountered the dreaded PermGen errors. Prior to the upgrade, no such issue. The error seems to be happening when the <g:link> and <g:render> tags are used in a GSP although I'm not sure it's indicative that this is the issue but...

Grails saving contained object : Example from grails-samples

Hello, I was trying the grails sample programs from http://github.com/grails/grails-samples.git . It is also part of the Definitive Guide To Grails book. The steps (as per grails-samples/dgg/README.txt). Installed mySql --> created user (gtunes), db (gtunes_ch17) etc set GRAILS_HOME, PATH to grails 1.1 ver Grails upgrade grails app-r...

Grails target folder doesn't appear to be on application's classpath

I have a grails project with some additional java source files under src/java folder. When compiling/running the server, the files under that directory get compiled into the project's target folder, together with all other groovy/grails classes. So far so good. However, when I try to load one of the java source files (from src/java) usi...