Grails

Day One at Groovy & Grails eXchange 2013

The day one at GGX 2013 London was really awesome. The atmosphere, the sessions and the speakers really made the day wonderful. We could feel the buzz and energy of the thriving and closely knitted Groovy/Grails community all day long. The show was very well managed by Skills Matter and nicely driven by Peter Ledbrook. Here are some...

by Abhishek Tejpaul
Tag: Groovy
13-Dec-2013

Technology

Day 3 at SpringOne2GX 2013

Day 3 of SpringOne2GX'13 was full of new experiences and learning. Knowledge is flowing everywhere and its an amazing feeling listening to the people whom we have been reading and following for so long. The energy and enthusiasm among both attendees and presenters are very high and really appreciable. It reminds me of our Code Camp days...

by Mohd Farid
Tag: Groovy
12-Sep-2013

Grails

Day 2 at SpringOne2GX 2013

Multiple parallel sessions on Groovy, Grails & Spring started from early morning sharp at 8:30 am till 6:00pm. So many options/sessions to choose from. Here are the few highlights from sessions that we attended during the day. Real world applications with Spring Data Neo4j by Michael Hunger : Shared many interesting use cases of...

by Amit Jain
Tag: Groovy
11-Sep-2013

Grails

Using Ftp with Grails

In one of my Grails project I need to drop files over ftp server. Using JSch one can easily transfer files over sftp. Just follow the below steps. 1. Add the below dependency to Grails project "grails-app/conf/BuildConfig.groovy" file [sourcecode language="groovy"] dependencies { compile 'com.jcraft:jsch:0.1.49' } ...

by Puneet Behl
Tag: Groovy
04-Apr-2013

Technology

Regular Expression – Slides Uploaded on SlideShare

Hi Guys,   I took a session on Regular Expressions in the company, i have shared my slide on slideshare. You can see it here : http://www.slideshare.net/rajdgreat007/regular-expressions-14971247   I have discussed following topics in that slide : What are regular expressions Need for regular expressions ...

by raj
Tag: Groovy
31-Oct-2012

Technology

@Canonical annotation

@Canonical: It's very useful annotation. It provides the combination of features of @ToString (default implementation of toString() method based upon the fields in the class), @EqualsAndHashCode(default implementation of equals() and hashCode() method of the class based upon the fields in the class) and @TupleConstructor (provides the...

by Mohit Garg
Tag: Groovy
27-Sep-2012

Grails

Cool way to get/set processed HTML Markup in filters

Hi,   There was a case where i had to encrypt the HTML output of the GSP before displaying it to user. There are a lot of ways to do it, but i wanted to make is as simple as possible. Hence here is the pattern i used:   Note: This is just an example, you can use this concept to do thousands of cool things, like: pdf export...

by Kushal Likhi
Tag: Groovy
27-Sep-2012

Grails

Groovy: Overriding “Plus” operator in a class with interesting example

Have you ever wondered how to overload "plus" operator in Groovy ? It is as easy as adding toppings to your favourite pizza. Let me explain. Let us taka a class for Pizza:   [java] @ToString class Pizza { String name List<Topping> toppings double price } [/java] And another for the Topping: [java] ...

by Imran Mir
Tag: Groovy
26-Sep-2012

Grails

FindResults and FindResult Methods of Groovy

In almost all the applications that we work on, we have to transform elements of a collection in one way or the other. We can do it in different ways. Let there be a domain "Employee" with following attributes: [java] class Employee{ String firstName String lastName Double salary } [/java] And we have 5 Employees: [java] ...

by Vivek Sachdeva
Tag: Groovy
26-Sep-2012

Technology

Using Inject method in Groovy 2.0

A very useful enhanced method in Groovy 2.0 is inject method whose key purpose is to pass the outcome of first iteration to next iteration and keep on passing till all the elements of collections are processed. Lets start with an example, consider a class Employee with name and salary as attributes: [java] class Employee{ ...

by Divya Setia
Tag: Groovy
26-Sep-2012

Technology

@Log annotation

@Log : This annotation provides the log object in groovy class. By using it you don't need to create the Logger object, it automatically provides log object. Example: [groovy] import groovy.util.logging.Log @Log class Person { String name String address String city public void logDetails(){ ...

by Mohit Garg
Tag: Groovy
26-Sep-2012

Technology

TupleConstructor annotation in Groovy

@TupleConstructor annotation provides the classical constructor with default properties. It will create the constructor with first parameter as address, second parameter as name etc. Constructor implementation depends upon the order of the variable declaration. One thing you need to ensure that you need to pass the value in same order as...

by Mohit Garg
Tag: Groovy
25-Sep-2012