Sunil Prakash Inteti's Blog

A technology perspective

Persisting relationship entities in Neo4j

Posted by Sunil on March 30, 2012

Neo4j is a high-performance, NOSQL graph database with all the features of a mature and robust database. In Neo4j data gets stored in nodes connected to each other by relationship entities that carry its own properties. These relationships are very important in graphs and helps to traverse the graph and make decisions. This blog discusses the two ways to persist a relationship between nodes and also the scenario’s which suits their respective usage. Spring-data-neo4j by springsource gives us the flexibility of using the spring programming model when working with neo4j database. The code examples in this blog will be using spring-data-neo4j.
Read the rest of this entry »

Posted in Java, NoSQL, Spring | Leave a Comment »

Implementing Generic functionality in Grails

Posted by Sunil on September 7, 2010

In web applications we have functionalities like auto suggestions , rating objects, adding to favourites etc which repeat themselves in an application and across applications. So it demands to think about implementing a generic way of rating and adding to user favourites etc and follow DRY principle. Recently in one of my Grails projects we implemented these functionalities in a generic way so that they are reusable and easy to use. Here in this blog, specifically lets look at how we can implement generic auto suggest functionality in Grails. This idea can be extended for other functionalities as well.

Jquery already provides auto suggest functionality. The question here is making functionality generic so that next time we have to use that its a breeze to use. Lets create a tag which can add the necessary jquery code for a text field to have auto suggest capability. Read the rest of this entry »

Posted in Grails, Groovy, Java, Jquery | Leave a Comment »

Cobertura loaded information on 0 classes, classpath issue ?

Posted by Sunil on March 16, 2010

In a grails application, we can use the code coverage plugin to generate the coverage reports. It is simple to use and generate the reports. I faced a perculiar problem while doing a grails test-app. I get an info message that cobertura loaded information on 0 classes

It took some time to figure out the problem. The code coverage plugin(present in the .grails folder) has the cobertura jars in its lib directory. By mistake the cobertura jar with a different version is checked in to the lib directory of the project. So there was a version conflict and hence cobertura was not loading the class informations. Once i removed the unnecessary cobertura jar in the projects lib directory, cobertura was generating reports normally. This could be one of the reasons for cobertura not loading the classes. Hope this helps if you are facing similar problem.

Posted in Uncategorized | Tagged: , | Leave a Comment »

Authenticating Facebook user into Grails App

Posted by Sunil on March 10, 2010

In my previous post I talked about how we can connect to Facebook from our application and get the user deatils. In this post we will discuss how we can authenticate the user based on his facebook user details. We will use acegi plugin of grails to allow uses our of web application to be authenticated by their facebook credentials . We dont need to aunthenticate them into our application like normal way. Let us see how that can be done!

Read the rest of this entry »

Posted in Uncategorized | Leave a Comment »

Connect to Facebook in Grails App

Posted by Sunil on March 5, 2010

Recently we integrated the Facebook connect plugin in our Grails project. In this post we will see how to connect to facebook and authenticate into facebook from our application. So that we can allow facebook users to use our Application.

First step would be to get the facebook connect button on to our home page. The code for this is below.

Getting the facebook connect button on our home page and its functionality

 <fb:login-button onlogin="facebook_onlogin();"></fb:login-button>

Read the rest of this entry »

Posted in Uncategorized | 1 Comment »

Open Flash Chart in a Grails Application

Posted by Sunil on December 10, 2009

In my Grails project we had a requirement that we needed to show graphs. Our client wanted to go for a opensource solution. We decided on the option OpenFlashChart. Grails comes up with its plugin for OpenFlashChart. With Open Flash Chart we can easily show barchart, line chart, piechart, Area charts etc. Let me explain very briefly how Open Flash Chart works. Basically in a web page we need to add this open flash chart which is the swf object. We should provide swf object with a data-file which contains the data it displays. This data could come from backend as well.  When the web page is rendered the swf object tries to get the data and render the graph.  Lets look at how we can use this in a Grails application.

Read the rest of this entry »

Posted in Uncategorized | Tagged: , | 1 Comment »

Practicality of MetaProgramming in Grails Project

Posted by Sunil on November 27, 2009

Grails is a powerful technology to build web applications very rapidly. Groovy provides so many enhancements to Java objects. Metaprogramming capability is one of them. Grails uses this Metaprogramming capability of Groovy heavily to accomplish things faster the way it does.

This blog discusses the the Practicality of this Metaprogramming in the Grails projects based on my experiences.

Read the rest of this entry »

Posted in Uncategorized | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.