grails

Traditional Auth, Facebook Connect & Grails

I am writing an app which needs to have both the traditional form of user auth, and Facebook Connect. I am using groovy/grails for this application. Grails luckily has JSecurity plugin, Acegi Plugin and Facebook Connect. The Acegi plugin claims to have OpenId and Facebook Connect support too. Anyone's got any experience getting it to wo...

Grails Acegi Plugin - how to update cache?

Hi, I'm having a problem with Acegi Plugin. The problem is that Acegi caches user info. If I update roles or password the change doesn't appear immediately. For a while I can even log out and log in with previous password. I found 2 solutions JIRA. Set cacheUsers = false in SecurityConfig.groovy Use special filter to update securityCon...

Grails Mail Plugin MailAuthenticationException

In dev I used gmails outgoing SMTP server for the Grails Mail Plugin and everything worked fine. Now, in test I'm getting MailAuthenticationException as the SMTP is setup with no authentication; ... Caused by: org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFai...

Running a task in background using Quartz plugin

I'm planning to have a view that presents a button so that when it is clicked, it will run a Quartz job and the page will finish loading successfully (no need to wait for the job to finish). Based on this documentation, you can have a custom trigger class. Can you help me implementing it? My job: class ReconciliationJob { static tr...

grails default values

Hi! I have an application written in grails. I want to add a new domain class with default initial values. These values should appear as default or initial values under the create view. I mean, the generated inout field tag should have this value as an attribute. The class (simplified) look as follows: class Whatever{ static constrain...

When do I create packages for tag-libs, mappings, etc?

I'm working through the Grails In Action book and have noticed 2 instances that the authors do not create packages for classes. Specifically, when creating a mapping and a tag-lib. For instance, the command given to create a tag library is grails create-tag-lib date That gives the output of Resolving dependencies... Dependencies ...

Good CMS (preferable java-based) to integrate with grails app

We have grails application that is damn good. Grails application will be run under tomcat/jetty. I'm looking for a good (preferable java-based) CMS which could be deployed to same webserver and integrated with our application. Our app provides some data (xml/json) and we need that CMS display this data on some static pages (I'm thinking ...

Grails/Groovy taglib handling parsing dynamically inserted tags.

Is there a way to have a custom taglib operate on data loaded in a .gsp file such that it picks up any tags embedded in the data stored in the database. For instance, let's say I'm doing: <g:each in="${activities}"> <li>${it.payload}</li> </g:each> And inside the payload, which is coming from the database, is text...

Grails common exception handling in grails 1.1

Hi Some one please tell me how to handle RunTimeExceptions in grails version1.1 .I have followed the following tutorial.I could not get it working. http://blog.bruary.net/2008/03/grails-custom-exception-handling.html I have MyException which extends RunTimeException .If this particular exception comes I want show different error page....

How to know/log whether Hibernate 2nd-level cache was used or not for a query?

Hi, Currently, in order to check if the Hibernate 2nd-level cache was used for a Database query, I check my SQL log (through p6spy or logSql=true in Datasource.groovy) to see if the Grais/Hibernate triggered an SQL query. And I assume that if the query was not logged, it might mean that cache was used. It is pretty complicated for a ...

Grails Createcriteria for subquery

Hi, How to use createCriteria for subQuery . My HQL is like this : def lists = List.executeQuery("FROM List cl WHERE cl.brand_id in (SELECT b.id FROM Brand b WHERE cl.brand_id=b.id AND b.brand_name rLIKE '^[0123456789].*')") Please tell how can we write this using Createcriteria ?? thanks in advance. ...

Grails SEO friendly URLs

The standard way of creating URLs in grails is: <a href="${createLink(controller:'news', action: 'show', params: [id: news.id])}">${news.title}</a> which generates the url: /news/show/102 I want more SEO friendly URLs like: /news/102/this-is-the-hottest-news-today What is the cleanest way to do this in Grails? I could use gra...

Grails: Validation of string containing a delimited list of email addresses

I have a Grails command object that contains an emailAddresses field, e.g. public class MyCommand { // Other fields skipped String emailAddresses static constraints = { // Skipped constraints } } The user is required to enter a semicolon-delimited list of email addresses into the form. Using Grails' valid...

Groovy sql errors on remote Mysql server ?

I'm using groovy gsql to query to Mysql database. Everything goes well on localhost (testing mode), unfortunately when I switching to remote db groovy don't query db. Here is the code : def sqlModule = Sql.newInstance("jdbc:mysql://localhost/module-test", "b", "b", "com.mysql.jdbc.Driver") def sampleQuery(int dataset) { def Sampl...

Trying to use a grails domain class from the shell

I'm new to Grails. I'm trying to experiement with my grails domains from the shell, and I can't get it to work. These domains work fine from the scaffold code when I run the app. Given this domain class class IncomingCall { String caller_id Date call_time int call_length static constraints = { } } I try to cre...

How to set nvarchar to a table column in GORM

How can I set the column's type to nvarchar(160)? I'm having a hard time making the sample code here relate to my target. I already tried this: String text static constraints = { text(size:1..160,blank:false) } static mapping = { text type: "nvarchar" } I'm encountering this error: Caused by: org.hibernate.MappingExcept...

SSL, Tomcat and GRAILS.

I want to implement SSL in grails. I cannot find the file /conf/server.xml in grails folder structure. Has any implemented it? Much appreciated. ...

Grails 1.2.1 with Webflow Plugin (1.2.1) - params not being returned

I am using the webflow plugin for Grails for the first time and am having some difficulties. To summarize, once within the Webflow, no information appears to be returning to the controller from the form. All examples that I have looked at indicate that the params are returned to the controller action normally and then you can put object...

Use JBoss with IntelliJ for creating Grails apps.

Hi, I want to run my grails apps from intelliJ on JBoss-5.1.0.GA installed locally on my machine. If somebody has any experience please share. Thanks, p.s. The aim is to simulate different production enivronments (development,Staging & test) ...

Grails and ACEGI security plugin - How to impede login from within security event listener?

I have the following event listener in SecurityConfig security { active = true useSecurityEventListener = true //... onInteractiveAuthenticationSuccessEvent = { e, appCtx -> // handle InteractiveAuthenticationSuccessEvent //how to cancel user login from here?? } } The question is, how to stop user from logging in f...