Grails

Making a domain non-persistent

In grails app, there might come scenarios where one need to create a non-persistent domain rather than creating a command obejct or POJO / POGO. GORM comes with a handy static property mapWith which has default value GORM (which associates any domain with gorm persistence layer). To make a domain non persistent set mapWith=”none”. For […]

Grails

Parsing URL Mappings in Grails

There are times when we need to parse the URL mappings in our grails app. In my case we have a REST API. In which we have implemented a generic query method for all controllers but it is available to only a few using custom URL mappings. We wanted to create test cases in such […]

GrailsJava/JVM

Spring Events With Grails

Hi, There arise several situations where you need to implement a certain flow comprising of various tasks. These tasks may be executed independent of each other and it gives us an opportunity to separate out the different parts of a flow into separate threads that can be executed “asynchronously”. I had a very similar use […]

Komal Jain
Komal Jain
Read

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: Topic] […]

AndroidAWSGrails

File Upload on Amazon S3 server via REST API call

We Can upload file on Amazon S3 Server directly without intervention of web server by using REST API call on S3 Server. Use Case : File upload was required on mobile app without integrating SDK because integrating SDK causes app to be heavier in size and also if it goes through our web server than it would […]

GrailsJava/JVM

MultikeyMap : Nested maps solution.

Hi everyone , recently I came accross a usecase where I had to map multiple keys against one value. So Juggling with this I came to know about MultiKeyMap of apache. MultikeyMap is used to map multiple keys against one value . The purpose of this class is to avoid the need to write code […]

Komal Jain
Komal Jain
Read

Grails

Generate PDF for Google Charts through Javascript

In a previous blog, we learned, how to draw a google chart. Let’s say, I have 5 graphs on my page and I want to generate a PDF which contains these graphs using a JavaScript. For that, we will use jsPDF plugin. Step 1. Create a hidden empty DIV, to store graph-images: [java] <div id=’graph-images’ […]

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 […]

kartikey
kartikey
Read
Services