Himanshu Seth

I am Himanshu Seth, a Groovy, Grails Practitioner and Agile Enthusiast working at TO THE NEW in Technology division. Please go through my blog posts below


Groovy & Grails: Gr8 without Pivotal

Couple of days back, we got to know about Pivotal deciding to end the sponsorship of Groovy and Grails project from 31st March 2015 through Guillaume Laforge's blog post and Graeme Rocher's post  Like many others in the community, news has taken us by quite some surprise. Just to give everyone context, we are a Technology services...



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



Grails: Find number of queries executed for a particular request

When response time of a page is slow, we might be interested in viewing database queries executed on that page. Enabling SQL Logging shows all queries but we are interested in queries for that particular request only. We can get this information by just simply adding the following filter to our application(Filters in Grails) [groovy] ...



Criteria Query with Left Outer Join

In Grails app development, when using criteria queries, we often find cases for Outer joins. Lets take an example. We have two domain classes with us: [java] class Blog { String title String content static hasMany = [comments: Comment] static constraints = { } } [/java] and [java] class Comment { ...



Organizing “.bashrc”

I have been working on Linux for almost 3 years now and have grown to love it a lot. As with every linux user, the .bashrc file becomes cumbersome and difficult to maintain over a period of time, since there are a lot of project specific aliases, paths, etc So after working on a couple of projects, I started maintaining separate...



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



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



MySql : Publish results of a query to a text file

A while back I was trying to debug an error in our application logic. For that I had to analyze the results of a query This analysis was getting pretty tough to do on the command line. So, I tried to find a way to transfer the results of a query to a text file so that they can be analysed easily. With help from google, I got my...



Linux – Managing applications running on system start-up

Rcconf is a tool that we recently discovered. This tool allows you to manage your start-up applications easily. We found this tool when me and my colleague Aman were trying to identify the processes that we never use but they do eat up a lot of our system resources. We found this link very useful: ...



How to Set-up shared folder/repository between two or more users on Linux

We had a case where we wanted two different applications (run by different users) to be able to read and write from the same file system. This is how we solved this problem: Create a group which these users will belong to :[shell]groupadd GROUP_NAME[/shell] Edit user1 and user2 to be a member of this group:[shell] usermod -a -G...



Embedding JBPM 4.3 in a Grails 1.2.2 Application

Hi, In one of our projects, we had a requirement for using some existing Business Process Management tool. JBPM is one such tool that we are evaluating. Our first step was to run a "Hello World" process from inside the grails application. On searching over the internet, I didn't find any helpful article/blog on integrating JBPM...



Groovy: Create class with dynamic properties

I recently came across a way in Groovy to define a class which can have dynamic getters and setters and properties can be added on the fly. The following code creates a class "MyExpandableClass" and defines two methods in the "getProperty and setProperty". If we define these two methods in a groovy class, then calls to any getter or...