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...
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...
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...
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] ...
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...
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...
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...
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...
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...
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...
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...
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:...