grails

Porting a Grails application to GAE

Hi, I currently have a Grails application I'm evaluating to port to Google App Engine and I'd like to know experiences regarding: Acegi security: the application relies on this library to enforce the security (update: just learned that it's based on hibernate so can't be ported; any recommended replacements?). Use of JPA or JDO instead...

How to retrieve the ordered list of best articles having a minimum number of votes by using HQL ?

I have a Vote domain class from my grails application containing properties like article_id and note I want to HQL query the Vote domain class in order to retrieve the 5 best rated articles having at least 10 votes. I tried : SELECT v.article_id, avg(v.note), count(*) FROM vote v where count(*) >= 10 group by v.article_id order by av...

grails find first

I know this is simple question but taking more time How to find first record from table in grails . I need to get only the first record with out knowing the id number . Is there any method like find :first in grails ? thanks in advance . ...

Grails Custom Error Page (500) & Tomcat

Hello I'm trying to implement simple custom error page after any Unhandled Exception being thrown by the Grails code. I've mapped the 500 to my controller: "500" ( controller: "error", action: "serverError" ) and handled the exception in the controller: def serverError = { try { // first check,...

Grails: Getting current View name from within a Taglib.

Is there any way too find out the current view (or gsp file) that is being executed? RequestURI doesn't work due to URL Mappings and forwards. I'm trying to retrieve resources dynamically based on the currently executing GSP file. For example, if product/view.gsp is being executed, I want to include product/view.css and product/view.js...

How to express "where value is in dynamic list" in HQL/GORM?

For a grails application, I need to find a list of objects whose "attr" is one in a dynamic list of strings. The actual HQL query is more complex, but the bit I need help with is this: def result = MyObject.executeQuery("select o from MyObject as o where o.attr in :list", [list: aListOfStrings]) This is obviously not the right syn...

Is there an equivalent to the Bootstrap class in a Plugin

Is there an a way to initialise some data in a Plugin. I am modulizing my code and it would be nice to have something like the bootstrap in the Plugin but I cannot find it. Nor can I find references using the Google. ...

Grails Remote Function and Ajax

I am trying to list addresses and onChange event I send the address ID and return a list of users. <g:select name="AddressID" from="${address}" optionKey="id" optionValue="address" onchange="${ remoteFunction( action:'testMe', params:'\'id=\' + this.value' , ...

Hot to implement grails server-side-triggered dialog, or how to break out of update region after AJAX call

In grails, I use the mechanism below in order to implement what I'd call a conditional server-side-triggered dialog: When a form is submitted, data must first be processed by a controller. Based on the outcome, there must either be a) a modal Yes/No confirmation in front of the "old" screen or b) a redirect to a new controller/view repla...

could not initialize proxy - no Session (Grails Runtime Exception)

Hi, I am using Grails 1.2.2 and I got this message sometimes. It usually happen if I got logged in the apps and the I tried to type url of home apps (http://localhost:9090/apps/) the error screen grab : for bigger view : http://img155.imageshack.us/img155/9982/ss20100609025018.png and the main.gsp code was in http://pastebin.c...

would grails work with mongodb or cassandra?

would grails work with mongodb or cassandra? or would you simply be using their mvc engine and not taking advantage of the other benefits of grails? ...

Does grails use spring's MVC front controller or it has its open implementation?

Does grails use spring's MVC front controller or it has its open implementation? ...

Anyone using grailsflow in its Plug-in or Demo version?

Grailsflow seems to be broken (as of Jan 2010) with Grails 1.2 or above, in both 'demo' and the plug-in flavours. Is there anyone out there using it? Have moved code out of the plug-in into my BootStrap.groovy, so the app will start. @see jcatalog forum post But still need to work around or resolve the error in all views. See stac...

running 'run-app' command from hudson

I have a grails application and have configured hudson for continous integration, in the grails plugin of hudson I've put run-app task which starts a tomcat container and deploys the app in tomcat.The problem I'm facing is - hudson itself is running in tomcat and when my run-app tries to start tomcat again it fails. I then tried writing ...

Can a webflow's action state have multiple redirects on success?

Say, I have this type of webflow: def myFlow = { state1 { } on("next").to("stateAct") stateAct { action { ... DB stuff ... } } on("success").to("state2") state2 { } on("prev").to("state1") } Now, the contents of "stateAct" is common between state1 and state2. Meaning, i...

How to direct to submit button to another action

Hi gurus how can I jump to another action in controller? I have form and several submit buttons. Every submmit button has name. <g:form action="save" method="post"> <g:input name="title" value="${letter.title}" /> <g:input name="comments[0].text" value="${letter.comments[0].text}" /> <g:submitButton name="save" value="save" /...

Grails Object --> LinkedHashMap converter

Hello, Like the JSON converter, is there any easy way to convert an object into LinkedHashMap. The JSON string is constructed as def query = new JSON(cmd).toString() anything similar.. thanks.. ...

Getting JSON data on server side with Grails

Once I post JSON data to a url in Grails, how can I get access to that data inside of the controller? ...

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 do I return an Array from grails / jdo to Flex

this seems really simple but I haven't gotten this to work. I am building my app with grails on google app engine. This pretty much requires you to use JDO. I am making an HTTP call from flex to my app. The action that I am calling on the grails end looks like so def returnShowsByDate = { def query = persistenceManager.newQuery( Sh...