Grails

Handling corrupted references through ignoreNotFound database mapping in Grails

Hi,   Recently i had a use-case where we have the legacy database and it contains the corrupted references of a non existent record in many-to-one relationship, and i have to populate a grid that contain info also from referenced record. As referenced record doesn't exist, So when we refer to the certain record will result in...

by Tarun Pareek
Tag: Grails
17-Apr-2012

Grails

Integrating Grails with Weceem

Today, I'll be talking on how to go about integrating the Weceem CMS into a grails-app. It is extremely simple and with a couple of steps you would have a CMS that can render traditional as well as custom content merged into your grails application. Ok ... First things first ... What is Weceem ? Weceem (as in 'We seem' to like it...

by Manoj Mohan
Tag: Grails
16-Apr-2012

Grails

Duplicate headers received from server issue on chrome

Hi,   Recently, in my project while downloading some files(not on all files) i am getting exception on chrome, that say :   Duplicate headers received from server Error 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION): Multiple Content-Disposition headers received. This is disallowed to protect against HTTP...

by Tarun Pareek
Tag: Grails
11-Apr-2012

Grails

Using aliases in aggregate functions of criteria queries

When using criteria queries, many times we encounter a use case where we need to order our result not on any field of domain class but on our result set, in these cases aliases can be used. In my project, use case was to find most liked products from the domain: [java] ProductStat{ Date dateCreated Product product } [/java] ...

by Puneet Behl
Tag: Grails
13-Feb-2012

Grails

Alphanumeric Sorting using Criteria Query (with MySQL database)

I am working on a Grails application with MySQL database. I had a use case in which I had to implement alphanumeric sorting using Criteria Query on Grails. By alphanumeric sorting I mean if there is a class Employee with field empId then on doing : [plain] Employee e1 = new Employee(empId:'emp10').save() Employee e2 = new...

by Gaurav Sharma
Tag: Grails
02-Feb-2012

Grails

My Top 9 Features from Grails 2.0

The groovy world is abuzz about the latest release from the Grails Stable, Grails 2.0, which packs a lot more punch than its predecessors, which by themselves were productivity enhancers and wonderful to develop our web applications with. The new version brings with itself a lot of changes compared to the previous releases and...

by Vivek Krishna
Tag: Grails
18-Jan-2012

Grails

Writing JSON APIs : Part II – Creating JSON Named Configs to Control What You Render

In the 1st part of the series, we looked at how to secure our application with Spring Security Basic Authentication and modifying the JSON Marshaller. However, it could often be the case that the same set of fields shouldn't be returned on every JSON response. For example, we could very well have a summary JSON for Book, which just...

by Vivek Krishna
Tag: Grails
29-Dec-2011

Grails

Dbconsole in Grails.

So, Grails 2.0 was released a few days back and I upgraded my application to it as soon as I came to know of its final release and it rocks.!! Among the many things which are making a lot of noise on grails 2.0, there seems to be a lack of noise over the GUI Database console which grails has provided. Developers can connect to the...

by Sachin
Tag: Grails
25-Dec-2011

Grails

Grails productivity enhancer. The unsung hero ‘grails interactive mode’

Of late, I have been thinking about the popularity of grails interactive mode amongst developers. I found that though most of us are aware of this mode but we don't use it as often, as it should be. Where should I use grails --interactive mode while developing in grails? The answer may vary from person to person and the level of...

by Mohd Farid
Tag: Grails
30-Nov-2011

Grails

Grails:Domain Design Via Intellij Idea’s Diagrams

Here is an example of how to design Grails domain class with Intellij Idea.For this we need to have blank domain classes. So lets say we created  three Domain Classes Company,Book,Author To see relationship diagram, Selected Domain Class, and selected tab Domain Class Dependencies.It should look like this Lets assume the...

by Hitesh Bhatia
Tag: Grails
23-Nov-2011

Grails

Writing JSON APIs : Part I – Creating a secure JSON API with Grails and Spring Security in 3 easy steps

We had a requirement in a recent project to expose some of the functionality we had via a JSON API. The functionality needed to be secure, as was the initial web interface which exposed the functionality. We were using Spring Security for the security aspect of our application. The spring security plugin, together with a secured...

by Vivek Krishna
Tag: Grails
16-Nov-2011

Grails

Grails Spring Security Plugin: User Switcher

If you are using Grails Spring Security in your application, one killer functionality that we can easily provide is a simple user switcher Add this to your admin layout: [html] <sec:ifAllGranted roles='ROLE_ADMIN'> <form action='/j_spring_security_switch_user' method='POST'> Switch:...

by Himanshu Seth
Tag: Grails
14-Nov-2011