Grails

Modifying Grails Scaffolded templates – I

In one of the sessions in SpringOne2GX, there was a session on Uber-Scaffolding by Jean Barmarsh. The session was quite incredible and opened up a world of possibilities. We all know that the scaffolded code generated by grails is modifiable if we install the base templates. This is done simply by saying: [java]grails...

by Himanshu Seth
Tag: Grails
10-Feb-2011

Grails

Grails Mail Plugin with DB Driven configuration

We have been coming across a certain use case in a couple of projects that the Email credentials/settings used for sending email should be different based on the from address. This is because the applications act as software services that are used by different organizations, which operate in the same business. And each needed their own...

by Vivek Krishna
Tag: Grails
03-Feb-2011

Grails

Grails criteria query : ‘createAlias’ made it easy

Hello friends, In my grails project, I was finding it difficult to write a query using criteria which can be read as 'list all customers whose current account balance is more than minimum account balance of that customer'. The simplified form of the domain is given below : [java] class Customer { String name Account account ...

by Amit Jain
Tag: Grails
17-Jan-2011

Grails, Technology

Why use Grails?

Last week, I was talking to a prospective client, who instead of asking me, why we should go with TO THE NEW, asked me, why should we go with Grails? Considering the fact that I have been working with Grails for over 3 years and we are a Groovy/Grails focussed shop, it should have been an easy question to answer; but there were so many...

by Deepak Mittal
Tag: Grails
16-Jan-2011

Grails

How to use Thread-Pooling using Groovy

Grails Development is challenging and most Groovy and Grails projects require in-depth understanding of thread-pooling. As a Groovy developer, I really like the thread-pooling API (in java.util.concurrent package), especially when you are hitting x number of API dealing with outside network to fetch information for a single request. ...

by Salil
Tag: Grails
16-Jan-2011

Grails

PageChangeListener for debugging in functional testing using Geb

While using Geb for fuctional testing i require some deugging support so i use PageChangeListener and i found it very useful to find flow of pages while testing my application fuctionally.What it does is it will show the page flow from one page to another.For that we need to just register the PageChangeListener with browser in your ...

by Anuj Aneja
Tag: Grails
13-Jan-2011

Grails

Request Mocking to use groovyPagesTemplateEngine in backend threads

We have a setup where a backend thread, fired by the Spring Events, does some processing, generates a PDF and emails the result to the user. The code we were using to generate the HTML from a GSP to be converted to a PDF using iText was as follows : [java] def webRequest = RequestContextHolder.getRequestAttributes() ...

by Vivek Krishna
Tag: Grails
27-Dec-2010

Grails

Using Custom Tag for embedding the Video in Grails

I had to make a video available on my GSP page. So I looked at the grails flash-player plugin.  After going through the documentation I found that it could not be used with videos on YouTube. This code given below will generate the script for the flash player on your GSP for playing youtube videos. [html] <object...

by Anuj Aneja
Tag: Grails
14-Dec-2010

Grails

Creating custom codec in Grails

Grails applications can define their own codecs and Grails will load them along with the standard codecs. A custom codec class must be defined in the grails-app/utils/ directory and the class name must end with 'Codec'. For more information see Dynamic Encoding Methods. [java] import java.security.MessageDigest import...

by Ankur Tripathi
Tag: Grails
13-Nov-2010

Grails

Encode Content to MD5 Using GROOVY or GRAILS – with Webhook example

Recently I was working on webhooks (which are getting quite popular for sending notifications to other applications using HTTP POST methods). MD5 encoded content is heavily used in webhooks for security concern. My purpose of writing this blog is neither to explain MD5 nor webhooks. But just to show you - 1. a quicker way in...

by Salil
Tag: Grails
12-Nov-2010

Grails

Datamatrix for unique identification of Documents on Server Side with libdmtx

I had earlier written a post on how to use QR Code to take care of identification of printed documents and updating the DB based on the QR Code detection. However, we had to abandon the use of QR Codes in the document because the library wasn't performing reliable, even with QR Codes from image files, which were direct screenshots of the...

by Vivek Krishna
Tag: Grails
22-Oct-2010

Grails

SpringOne2GX : Peter Ledbrook’s session on Performance Tuning

Peter Ledbrook took an amazing session on tuning your grails Application here at SpringOne2GX in Chicago. In this session Peter talked about tuning the various aspects about in your application starting from server side optimizations to the caching and zipping of static resources. One of the most important thing that Peter pointed out...

by Himanshu Seth
Tag: Grails
21-Oct-2010