Technology

Regex in groovy

Groovy Language enhancements that help with Regex Slashy Strings is the first thing that comes to my mind while talking about regex in Groovy. They are a simpler way to represent regex patterns as String compared to their Java counterparts. If we have to find all numbers in a String we can do something like this in Java [code] ...

by Aseem Bansal
Tag: Groovy
05-Nov-2015

Technology

Content Migration in AEM using SlingPostServlet

A very basic migration flow looks as follows: In this scenario, you have a CMS(that could be Sitecore, Drupal, Wordpress or any other CMS) which has source content that needs to be migrated to AEM. To achieve this, we typically need to do following things: Get content from source CMS in any format(XML, CSV, etc) Process this...

by Vivek Sachdeva
Tag: Groovy
16-Oct-2015

Technology

Let’s listen any changes made in Collection (List, Map or Set)

Have you ever wondered how come your Collection is being updated and ended up spending time on debugging? We are going to see how can we get to know immediately if our Collection is altered. In this blog, we will do this using ObservableList for 'List' and same can be applied for Map and Set as well. Here goes code to implement this : ...

by Aman Mishra
Tag: Groovy
26-Jul-2015

Grails, Technology

Closure Delegate using Groovy “with” Method and decorating code with multiple assignments

Groovy is an expressive language, that is what we are going to talk about making the usage of "with" method for specifying closure delegate and making our code more succinct (brief and clearly expressed). In my recent project, I was writing a code to resolve tenant and setting some properties to object tenant. ...

by Tarun Pareek
Tag: Groovy
23-Jul-2015

Android, Mobility

Creating Android Application with Groovy

Groovy 2.4 was released in January 2015, with native support for Android development. It allows to write Android applications fully using Groovy. Running Groovy on Android Step 1: Create a new Android project in Android Studio Step 2: Open this build.gradle (Module: app) file: Insert the following code before the first line: ...

by Simranjit Kour
Tag: Groovy
23-Jul-2015

Grails, Technology

Groovy collectEntries to get a Map from a Collection

Dealing with collections is a part of a Developer’s daily life. However, sometimes it becomes quite cumbersome when we have to iterate through each collection every time we want a manipulated Collection. Ever thought of a groovier way to manipulate a collection and get a Map in a single line? Well, multiple iterations to convert a...

by Manali Khanna
Tag: Groovy
15-Jul-2015

Grails

Day 2 @GR8Conf EU 2015

Day 2 at GR8Conf EU June 2015 Copenhagen, Denmark continued to beintriguing and fun filled. The Day started with the keynote from Jeff Scott Brown on Grails and its future plan. He shed light on Grails 3.0 features and its releases plans. He also asked for contribution to migrating plugins from Grails 2.x to Grails 3.0.  In his...

by Sachin Verma
Tag: Groovy
05-Jun-2015

Grails

Day 1 @Gr8Conf EU 2015

The day one at GR8Conf EU June 2015 Copenhagen, Denmark was really awesome. It started at the IT-University with a jam packed hall full of eager registrants with a welcome note from Søren with a history of how the Gr8 conf started. Then, Gulliame went through the state of affairs around Groovy & Grails and addressed the...

by Sachin Verma
Tag: Groovy
04-Jun-2015

Grails

Compile GroovyScript at Runtime and allow caching of compiled source to avoid recompilation at Runtime using GroovyClassLoader

In some cases we need mechanism to provide compilation of groovy script at runtime. But at the same time we need to make sure it doesn't consume the JVM to perform compilation every time when we try to access that script. Hence to perform this we need to do the following task : Compile Groovy Script at Runtime. Cache the compiled...

by Tarun Pareek
Tag: Groovy
01-May-2015

Grails

Reusing grails Criteria for multiple domains using Closure.delegate

I recently had a situation where I had the exact same criteria in multiple domains. I found a way to DRY them using Closure.delegate. I wanted to share that in this post. Just including the relevant details the domains that I had were like the following. [code language="groovy"]class Subscription { static belongsTo = [topic:...

by Aseem Bansal
Tag: Groovy
12-Apr-2015

Grails

Track my traffic -Implementing Traffic Analytics

This one is for a particular use case, so lets come straight out to the point. We start with the obvious first: Problem Statement: To track the traffic of a public page from your application. User Story: The current system needs to add a feature that would enable the end user to use your product to track the traffic on his...

by kartikey
Tag: Groovy
24-Feb-2015