<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Sunil Prakash Inteti&#039;s Blog</title>
	<atom:link href="http://sunilprakashinteti.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sunilprakashinteti.wordpress.com</link>
	<description>A technology perspective</description>
	<lastBuildDate>Fri, 11 Feb 2011 05:38:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sunilprakashinteti.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/96ee2f79f7cb937aa5a79364c3802e0f?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Sunil Prakash Inteti&#039;s Blog</title>
		<link>http://sunilprakashinteti.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sunilprakashinteti.wordpress.com/osd.xml" title="Sunil Prakash Inteti&#039;s Blog" />
	<atom:link rel='hub' href='http://sunilprakashinteti.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Implementing Generic functionality  in Grails</title>
		<link>http://sunilprakashinteti.wordpress.com/2010/09/07/implementing-generic-functionality-in-grails/</link>
		<comments>http://sunilprakashinteti.wordpress.com/2010/09/07/implementing-generic-functionality-in-grails/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 12:38:27 +0000</pubDate>
		<dc:creator>Sunil</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Jquery]]></category>

		<guid isPermaLink="false">http://sunilprakashinteti.wordpress.com/?p=152</guid>
		<description><![CDATA[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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilprakashinteti.wordpress.com&amp;blog=8438360&amp;post=152&amp;subd=sunilprakashinteti&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>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 <strong>DRY</strong> 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.</p>
<p>Jquery already provides <a href="http://docs.jquery.com/Plugins/Autocomplete">auto suggest</a> 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.<span id="more-152"></span></p>
<p><strong>HTML code :</strong></p>
<pre class="brush: xml;"> &lt;g:textField name=&quot;city&quot; id=&quot;city&quot; value=&quot;&quot; /&gt;
&lt;g:autoSuggest autoCompleteForId=&quot;city&quot; searchObject=&quot;com.xebia.Address&quot; searchProperty=&quot;city&quot;/&gt;
</pre>
<p>For searchObject property we must give the fully qualified class name of the domain object. Here we have Address as the domain objects which has a property city in it. The above tag is handled by the following closure in the Taglibrary.</p>
<p><strong>Autocomplete Tag Library:</strong></p>
<pre class="brush: java;">
    def autoSuggest = { attrs , body -&gt;
		def searchObject = attrs.searchObject
		def searchProperty = attrs.searchProperty
		def htmlId = attrs.autoCompleteForId
		def width = attrs.width
		def contextName = grailsApplication.config.grails.serverURL
		def actionName = attrs.action ? attrs.action : 'autoSuggest'
		def controllerName = attrs.controller ? attrs.controller : 'autocomplete' 

		String serviceUrl =  createLink(controller:controllerName, action:actionName , absolute:true)

		importScriptsAndCSS(out, contextName, pageScope);

		out &lt;&lt; &quot;&lt;script&gt;  jQuery(function() {&quot;
		out &lt;&lt; 	&quot;\$(\&quot;#&quot;+ htmlId+ &quot;\&quot;).autocomplete({ &quot;
		out &lt;&lt;			  &quot; serviceUrl: \'&quot;+ serviceUrl +&quot;\',&quot;
		out &lt;&lt; 		'''
					    minChars:1,
					    maxHeight:400,
					    zIndex: 9999,
					    deferRequestBy: 0,
					 '''
		if(width) {
			out &lt;&lt; 	&quot;width:&quot;+width+&quot;,&quot;
		}

		out &lt;&lt;	&quot;params: {searchObject:\'&quot;+searchObject+&quot;\',searchProperty:\'&quot;+searchProperty  + &quot;\'}, &quot; 

		out &lt;&lt; '''
						noCache: false
					});
			});
			 &lt;/script&gt;
		'''

	} 
</pre>
<p>The method importScriptsAndCSS(out, contextName, pageScope) as the name suggests, adds the necessary css and javascript needed only once per page.<br />
The auto suggest tag that we use in tandem with a text field captures the property that we need suggestions for on an domain object and adds necessary jquery code to hit a generic AutoSuggestController which will return the matching options in JSON format to jquery. Now lets look at the generic AutoSuggestController code.</p>
<p><strong>AutoSuggestController</strong></p>
<pre class="brush: java;">
  def autoSuggest = {
		log.debug(&quot;Inside the auto complete controller&quot;)
		def searchObject = params.searchObject
		def searchProperty = params.searchProperty
		def queryValue = params.query

		def searchCriteria = grailsApplication.getClassForName(searchObject).createCriteria()
		log.debug &quot;query value is ${queryValue}&quot;
		def results = searchCriteria.list{
			projections {
				groupProperty(searchProperty)
			}
			ilike(searchProperty, &quot;%${queryValue}%&quot;)
			maxResults(5)
		}
		log.debug(&quot;Auto suggest Results  : &quot;+results)
		render createJSONForResults(results, queryValue , searchProperty)
	}
</pre>
<p>The above code snippet is the action that will be accessed by the jquery which also passes the search Property and Search Object to  the controller. Dynamically we determine the domain object by this line of code   <strong>grailsApplication.getClassForName(searchObject).createCriteria()</strong></p>
<p>We get the domain object from the fully qualified class name and then create a criteria on the grails domain object. In this criteria we attempt to get the list of objects for which the searchProperty(city) matches. Once we get the list of objects we have to convert the list into JSON object format, so that that is passed back to the jquery to render the auto suggestions.</p>
<p><strong>JSON format can be achieved like this</strong></p>
<pre class="brush: java;">
   private String createJSONForResults(def results, String queryValue, String searchProperty) {
		def resultsArray = results.toArray()
		StringBuilder resultsJSONObject = new StringBuilder(&quot;{ query : \'${queryValue}\' , suggestions: [&quot;)
		if(resultsArray.length &gt; 0) {
			for(int i=0;i&lt;resultsArray.length-1;i++) {
				String currentProperty = resultsArray[i]
				currentProperty = &quot;'&quot; + currentProperty + &quot;',&quot;
				resultsJSONObject.append(currentProperty)
			}

			def lastResult = resultsArray[resultsArray.length-1]
			String lastElement = &quot;'&quot; + lastResult + &quot;']}&quot;
			resultsJSONObject.append(lastElement)
			return resultsJSONObject.toString()
		} else {
			resultsJSONObject.append(&quot;]}&quot;)
		}
	}
</pre>
<p>This piece of functionality can be used across the Grails applications and can be resued heavily in a single application as well following the DRY principle.</p>
<p><strong>Conclusion</strong><br />
Following the same way of using a taglibrary and generic controller we can implement the other functionalities like rating objects, using adding favourites and many more using Grails dynamism.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilprakashinteti.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilprakashinteti.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilprakashinteti.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilprakashinteti.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sunilprakashinteti.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sunilprakashinteti.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sunilprakashinteti.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sunilprakashinteti.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilprakashinteti.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilprakashinteti.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilprakashinteti.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilprakashinteti.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilprakashinteti.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilprakashinteti.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilprakashinteti.wordpress.com&amp;blog=8438360&amp;post=152&amp;subd=sunilprakashinteti&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sunilprakashinteti.wordpress.com/2010/09/07/implementing-generic-functionality-in-grails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b47944a912baf92a796517302c2128c4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Sunil</media:title>
		</media:content>
	</item>
		<item>
		<title>Cobertura loaded information on 0 classes, classpath issue ?</title>
		<link>http://sunilprakashinteti.wordpress.com/2010/03/16/cobertura-loaded-information-on-0-classes-classpath-issue/</link>
		<comments>http://sunilprakashinteti.wordpress.com/2010/03/16/cobertura-loaded-information-on-0-classes-classpath-issue/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 08:05:03 +0000</pubDate>
		<dc:creator>Sunil</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cobertura]]></category>
		<category><![CDATA[Grails]]></category>

		<guid isPermaLink="false">http://sunilprakashinteti.wordpress.com/?p=146</guid>
		<description><![CDATA[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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilprakashinteti.wordpress.com&amp;blog=8438360&amp;post=146&amp;subd=sunilprakashinteti&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a grails application, we can use the <a href="http://www.grails.org/plugin/code-coverage" target="_blank">code coverage plugin</a> to generate the coverage reports. It is simple to use and generate the reports. I faced a perculiar problem while doing a <strong>grails test-app. </strong>I get an info message that <strong>cobertura loaded information on 0 classes</strong></p>
<p>It took some time to figure out the problem. The code coverage plugin(present in the <strong>.grails</strong> folder) has the cobertura jars in its <strong>lib</strong> directory. By mistake the cobertura jar with a different version is checked in to the <strong>lib </strong>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 <strong>lib directory, </strong>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.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilprakashinteti.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilprakashinteti.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilprakashinteti.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilprakashinteti.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sunilprakashinteti.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sunilprakashinteti.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sunilprakashinteti.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sunilprakashinteti.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilprakashinteti.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilprakashinteti.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilprakashinteti.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilprakashinteti.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilprakashinteti.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilprakashinteti.wordpress.com/146/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilprakashinteti.wordpress.com&amp;blog=8438360&amp;post=146&amp;subd=sunilprakashinteti&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sunilprakashinteti.wordpress.com/2010/03/16/cobertura-loaded-information-on-0-classes-classpath-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b47944a912baf92a796517302c2128c4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Sunil</media:title>
		</media:content>
	</item>
		<item>
		<title>Authenticating Facebook user into Grails App</title>
		<link>http://sunilprakashinteti.wordpress.com/2010/03/10/authenticating-facebook-user-into-grails-app/</link>
		<comments>http://sunilprakashinteti.wordpress.com/2010/03/10/authenticating-facebook-user-into-grails-app/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 10:08:06 +0000</pubDate>
		<dc:creator>Sunil</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sunilprakashinteti.wordpress.com/?p=114</guid>
		<description><![CDATA[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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilprakashinteti.wordpress.com&amp;blog=8438360&amp;post=114&amp;subd=sunilprakashinteti&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my previous <a href="http://sunilprakashinteti.wordpress.com/2010/03/05/connect-to-facebook-in-grails-app/" target="_blank">post</a> 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!</p>
<p><span id="more-114"></span></p>
<p>The prerequisite for this feature is to have the acegi plugin installed. In my last  <a href="http://sunilprakashinteti.wordpress.com/2010/03/05/connect-to-facebook-in-grails-app/" target="_blank">post</a> , after the getting the facebook user details we redirect to facebook controller passing his details(<strong>facebook user id, sessionKey</strong> etc) as params  :</p>
<pre class="brush: java;">document.location.href=&quot;${params.lang}/facebook/subscription?firstname=&quot;+firstname+&quot;&amp;lastname=&quot;+lastname+&quot;&amp;fbuid=&quot;+uid+&quot;&amp;sessionkey=&quot;+sessionkey+&quot;&amp;pic=&quot;+pic;</pre>
<p>Here we are passing the facebook user id as <strong>fbuid. </strong>Assuming the user class in the application is <strong>UserAccount, </strong>we can have a fbuid property on UserAccount. From the param <strong>fbuid</strong> we can get the existing user.We can also choose to connect <strong>fbuid</strong> to an existing user in our application. For  that we may need to authenticate user normally into our app and then updating his <strong>UserAccount.fbuid </strong>from the param fbuid. We can use a popup mechanism to give the user the option to connect his facebook uid to his existing account or create a new account with his facebook user id.</p>
<p>Lets assume that we already have an Useraccount and we have its correspondint fbuid attached to it. How can we create  his authentication object.  Here is the code which can be part of as service class(utilityService for eg.)</p>
<p>In <strong>FacebookController</strong></p>
<pre class="brush: groovy;">

subscription = {

def account = UserAccount.findByFbuid(params.fbuid)
   if (account) {
     // assuming user has list of authohorities or roles ...
     utilityService.authenticateFacebookUser(params.fbuid, params.sessionkey, account.authorities)
   }
}
</pre>
<p>The idea here is that from <strong>fbuid </strong>we can get his account(Since user has a fbuid property). From that we can get his authority and then authenticate him using the following method in utilityService.</p>
<pre class="brush: java;">
public void authenticateFacebookUser(long uid, String sessionKey, GrantedAuthority[] authorities) {
    def token = new FacebookAuthenticationToken(authorities, uid, sessionKey)
    FacebookAuthenticationToken authentication = facebookAuthProvider.authenticate(token)
    SCH.context.authentication = authentication
}
</pre>
<p>Here <strong>FacebookAuthenticationToken </strong>and <strong>facebookAuthProvider </strong>are the classes provided by acegi grails plugin &amp; SCH is the alias for Security Context Holder. By this way an user can be linked with his facebook id and authenticated.</p>
<p>How ever there are some changes that could be needed. In our existing application we are using acegi plugin and we use the AuthorizeTagLib.grrovy. We have to extend this to include the facebook authenticated users. Other wise when we use this existing logic we will get missing property exception on <strong>aunthentication </strong>object, as the authentication object is different in case of facebook and normal authentication object.</p>
<p>For example the isLoggedIn() method in AuthorizeTagLib.groovy can be extended like this.</p>
<pre class="brush: groovy;">

public boolean isLoggedIn() {
def authenticationObject = SCH?.context?.authentication
return (authenticationObject instanceof FacebookAuthenticationToken || authenticateService.isLoggedIn())

}</pre>
<p>As the case may be other methods of the AuthorizeTagLib may have to be extended as well. This applies for classes facebookAuthenticationProvider and UserDetailsService of  Acegi plugin.By this the user of our application can be authenticated by his facebook credentials and he can use our site normally.</p>
<p><strong>Summary:</strong>In this post we basically talked about the idea of connecting a userAccount to user&#8217;s facebook id, and authenticating   user by his facebook credentials also.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilprakashinteti.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilprakashinteti.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilprakashinteti.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilprakashinteti.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sunilprakashinteti.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sunilprakashinteti.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sunilprakashinteti.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sunilprakashinteti.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilprakashinteti.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilprakashinteti.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilprakashinteti.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilprakashinteti.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilprakashinteti.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilprakashinteti.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilprakashinteti.wordpress.com&amp;blog=8438360&amp;post=114&amp;subd=sunilprakashinteti&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sunilprakashinteti.wordpress.com/2010/03/10/authenticating-facebook-user-into-grails-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b47944a912baf92a796517302c2128c4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Sunil</media:title>
		</media:content>
	</item>
		<item>
		<title>Connect to Facebook in Grails App</title>
		<link>http://sunilprakashinteti.wordpress.com/2010/03/05/connect-to-facebook-in-grails-app/</link>
		<comments>http://sunilprakashinteti.wordpress.com/2010/03/05/connect-to-facebook-in-grails-app/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 12:40:28 +0000</pubDate>
		<dc:creator>Sunil</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sunilprakashinteti.wordpress.com/?p=66</guid>
		<description><![CDATA[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. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilprakashinteti.wordpress.com&amp;blog=8438360&amp;post=66&amp;subd=sunilprakashinteti&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>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.</p>
<p>First step would be to get the facebook connect button on to our home page. The code for this is below.</p>
<p><strong> Getting the facebook connect button on our home page and its functionality<br />
</strong></p>
<pre class="brush: xml;"> &lt;fb:login-button onlogin=&quot;facebook_onlogin();&quot;&gt;&lt;/fb:login-button&gt;
</pre>
<p><span id="more-66"></span></pre>
<p>Ofcourse we need to add the facebook namespace to our gsp/html page.</p>
<pre class="brush: xml;"> xmlns:fb=&quot;http://www.facebook.com/2008/fbml&quot; </pre>
<p>1) fb:login-button is an XFBML tag, we need some Facebook-specific JavaScript to actually render it. This line does the trick.</p>
<pre class="brush: xml;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php&quot;&gt;&lt;/script&gt;</pre>
<p>2) Create a cross domain receiver file, which is necessary for secure <a href="http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication">cross-domain communication</a> with Facebook</p>
<p>create a file with a name xd_receiver.htm and put the following contents into it.</p>
<pre class="brush: xml;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt; &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt; &lt;body&gt; &lt;script src=&quot;http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt;  </pre>
<p>3) Every connect website is a facebook application and an API key is required. Fortunately we can easily generate an API key from<br />
<a href="http://www.facebook.com/developers/" target="_blank">here</a> , fill in details and submit the application.</p>
<p>4) We need to tell facebook about our API key. We need to put this code in the &lt;body&gt; tag.</p>
<pre class="brush: xml;">&lt;script type=&quot;text/javascript&quot;&gt;FB.init(&quot;3f0ba1d70537bbf9381bca2bbb9f9a93&quot;,&quot;xd_receiver.htm&quot;);&lt;/script&gt;</pre>
<p>This tells the facebook about out API key and the location of the out cross domain receiver file.</p>
<p>By this piece of code we can get the fbConnect button on our home page. But when you click it nothing happens as we need to add a the functionality for the function <strong>facebook_onlogin()</strong></p>
<pre class="brush: java;">
function facebook_onlogin() {
var uid = FB.Facebook.apiClient.get_session().uid ;
var sessionkey = FB.Facebook.apiClient.get_session().session_key;FB.Facebook.apiClient.users_getInfo(uid, new  Array('first_name','last_name','email','pic_square_with_logo'), function(result, ex) {
var firstname = result[0]['first_name']
var lastname = result[0]['last_name']
var pic = result[0]['pic_square_with_logo']
document.location.href=&quot;${params.lang}/facebook/subscription?firstname=&quot;+firstname+&quot;&amp;lastname=&quot;+lastname+&quot;&amp;fbuid=&quot;+uid+&quot;&amp;sessionkey=&quot;+sessionkey+&quot;&amp;pic=&quot;+pic;});
}</pre>
<p>The code is self explainatory. To be brief, here we are using the javascript library <strong>FeatureLoader.js.php </strong>to contact the Facebook and get details of a facebook user like his first name, last name, his profile picture etc.</p>
<p>We also get his facebook id using  <strong>var uid = FB.Facebook.apiClient.get_session().uid ;</strong></p>
<p>If the user doesnt have a facebook session already it prompts the popup to log on to facebook. <strong>If you want to know how it is done </strong>look through the sourcecode <a href="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" target="_blank">here</a>. If he is logged in we can get the details of the facebook user like facebook id, first name, last name, email etc.</p>
<p>The trick here is to pass on the details to our custom controller, lets name it FacebookController. More precisely this is the code that is doing that.</p>
<p>document.location.href="${params.lang}/facebook/subscription?firstname="+firstname+"&amp;lastname="+lastname+"&amp;fbuid="+uid+"&amp;sessionkey="+sessionkey+"&amp;pic="+pic;});</p>
<p>The action name in facebook controller is subscription and in here we can choose to authenticate him in to our application by connecting him to an existing user. This is to say, user doesn't need to log in to grails application by his username and password rather use his facebook. I will explain how this can be done in my next blog.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilprakashinteti.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilprakashinteti.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilprakashinteti.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilprakashinteti.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sunilprakashinteti.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sunilprakashinteti.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sunilprakashinteti.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sunilprakashinteti.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilprakashinteti.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilprakashinteti.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilprakashinteti.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilprakashinteti.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilprakashinteti.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilprakashinteti.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilprakashinteti.wordpress.com&amp;blog=8438360&amp;post=66&amp;subd=sunilprakashinteti&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sunilprakashinteti.wordpress.com/2010/03/05/connect-to-facebook-in-grails-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b47944a912baf92a796517302c2128c4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Sunil</media:title>
		</media:content>
	</item>
		<item>
		<title>Open Flash Chart in a Grails Application</title>
		<link>http://sunilprakashinteti.wordpress.com/2009/12/10/open-flash-chart-in-a-grails-application/</link>
		<comments>http://sunilprakashinteti.wordpress.com/2009/12/10/open-flash-chart-in-a-grails-application/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 07:26:57 +0000</pubDate>
		<dc:creator>Sunil</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Open Flash Chart]]></category>

		<guid isPermaLink="false">http://sunilprakashinteti.wordpress.com/?p=15</guid>
		<description><![CDATA[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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilprakashinteti.wordpress.com&amp;blog=8438360&amp;post=15&amp;subd=sunilprakashinteti&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>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 <a href="http://teethgrinder.co.uk/open-flash-chart/" target="_blank">OpenFlashChart</a>. Grails comes up with its <a href="http://www.grails.org/Open+Flash+Chart+Plugin" target="_blank">plugin for OpenFlashChart</a>. 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.</p>
<p><span id="more-15"></span>For example purpose I choose to show a barchart here which shows goals scored by Striker in a Season by name.  We need to add the chart to our view page. Taglibrary of grails is of a great help here especially if we are using the chart at various places in our application.So first let us write a Taglibrary <strong>OFCTaglibrary.groovy</strong> and add a closure chart. Ofcourse this is put under the Taglibrary folder for grails for convention purposes.</p>
<pre class="brush: java;">
public class OFCTaglibrary {
  static namespace = &quot;grailsOfc&quot;
  def chart = { attrs -&gt;
  if (!attrs.name)
     throwTagError(&quot;Tag [chart] is missing required attribute [name]&quot;)
    String name = attrs.remove('name')
    String width = attrs.width ? attrs.remove(&quot;width&quot;) : &quot;350&quot;
    String height = attrs.height ? attrs.remove(&quot;height&quot;) : &quot;200&quot;
    String url = attrs.url? attrs.remove(&quot;url&quot;) : &quot;&quot;
    String flashFileName = &quot;open-flash-chart.swf&quot;
    out &lt;&lt; &quot;&lt;div id='$name' name='$name'&gt;&lt;/div&gt;\n&quot;
    out &lt;&lt; &quot;&quot;&quot;
    &lt;script type=&quot;text/javascript&quot;&gt;
    var params = {};
    params.wmode = &quot;transparent&quot;;
    swfobject.embedSWF(&quot;${request.contextPath}/${flashFileName}&quot;, &quot;$name&quot;, &quot;$width&quot;,&quot;$height&quot;,&quot;9.0.0&quot;, &quot;expressInstall.swf&quot;, {&quot;data-file&quot;:&quot;$url&quot;},params);&lt;/script&gt;
    &quot;&quot;&quot;
  }
}
</pre>
<p>Now we have created a tag library which we can use in view  pages to insert the OFC chart .  I will expain the attributes  in the closure a little later.(rather i feel it is self expainatory <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p>This is the piece of code that we should put in the view to show a OFC chart.</p>
<pre class="brush: xml;">

&lt;grailsOfc:chart name=&quot;barChart&quot; url=&quot;${createLink(controller:'stats',action: 'bar_graph')}&quot; width=&quot;${chartWidth}&quot; height=&quot;174&quot; /&gt;
</pre>
<p>So when this page is rendered grails looks for the Taglibrary with namespace <strong>grailsOfc</strong>. In this Taglibrary it looks for the chart closure, and puts the code for the swf object in the view. The  <strong>open-flash-chart.swf </strong>it looks for the data-file in the url</p>
<pre class="brush: java;">${createLink(controller:'stats',action: 'bar_graph')}</pre>
<p><a href="http://www.grails.org/Tag+-+createLink" target="_blank">createLink</a> is a GrailsTag which we can use to call an action on Grails Controller. The idea here is we can put the logic to get the data from the server.<br />
We shall now look at the StatsController code.</p>
<pre class="brush: java;">
 def bar_graph = {
 def players = Player.findAll() //could be a more complex logic. This is just to get a filtered list of players

 def x_axis_labels = []
 List values = []
 players.each {
   x_axis_labels.add( it.playerName)
   Map bar = [:]
   bar.put(&quot;top&quot;, it.goals())
   bar.put(&quot;colour&quot;, &quot;#0080F7&quot;)
   values.add(bar)
 }

 String backgroundColour = &quot;#FFFFFF&quot;
 List elements = [];

 def barChart = [ type: &quot;bar&quot;, values: values, tip: &quot;#val# Goals&quot;, colour: &quot;#E3E2DD&quot;, alpha:1 ]
 elements.add(barChart);

 //    x Axis
 Map xAxis = ['tick-height': 0, colour: &quot;#74665D&quot;, stroke: 1, 'grid-colour': &quot;#FFFFFF&quot;,
               labels: [labels: x_axis_labels, visible:true]]

 //y Axis
 Map yAxis = [ 'tick-height': 0, colour: &quot;#74665D&quot;, stroke: 1,'grid-colour': &quot;#E0DDD8&quot;, min: 0, max: 50, steps: 15,
                labels:[text: &quot;#val#&quot;]]

 //assemble the chart
 HashMap goalChart = [:]

 if (values.size() == 0) {

 goalChart['title'] = [text:&quot;noDataExists&quot;]
 }

 goalChart = [ x_axis:xAxis, y_axis:yAxis, elements:elements, bg_colour:&quot;#FFFFFF&quot; ]

 render goalChart as JSON; //grails provides converters to convert map in to JSON format.

 }
</pre>
<p>To summarize here we are building the adding x-axis, y-axis and its labels, adding them to the chart<br />
which can be anything (bar or pie) in a map and convert this to JSON format.</p>
<p>The graph would look like this :<br />
<img src="http://sunilprakashinteti.files.wordpress.com/2009/12/graph.jpg" alt="bar graph" /></p>
<p><strong>Problem :</strong><br />
By this way we can show the Bar graph easily. How ever I faced a problem here.I couldn&#8217;t get a scroll on x-axis inside the chart.<br />
The chart width was increasing. I couldn&#8217;t find an option for the scroll for OFC chart. So I did a workaround. I put this OFC<br />
chart inside a &lt;div&gt; and and in the div i gave the style properties as : overflow-x:scroll; overflow-y:hidden; width : 550px;<br />
This put the chart inside the div with a scroll if the chart widht is increased to more than 550px. I dont know if this option<br />
is there in OFC. But i used this workaround and client was OK with that. <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Conclusion :</strong></p>
<p>Finally i feel if your client is not ready to pay for the charts, OFC is a great option. With this we can achieve all sorts of graphs.For more examples you can visit the <a href="http://teethgrinder.co.uk/open-flash-chart-2/" target="_blank">OFC site</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilprakashinteti.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilprakashinteti.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilprakashinteti.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilprakashinteti.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sunilprakashinteti.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sunilprakashinteti.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sunilprakashinteti.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sunilprakashinteti.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilprakashinteti.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilprakashinteti.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilprakashinteti.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilprakashinteti.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilprakashinteti.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilprakashinteti.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilprakashinteti.wordpress.com&amp;blog=8438360&amp;post=15&amp;subd=sunilprakashinteti&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sunilprakashinteti.wordpress.com/2009/12/10/open-flash-chart-in-a-grails-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b47944a912baf92a796517302c2128c4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Sunil</media:title>
		</media:content>

		<media:content url="http://sunilprakashinteti.files.wordpress.com/2009/12/graph.jpg" medium="image">
			<media:title type="html">bar graph</media:title>
		</media:content>
	</item>
		<item>
		<title>Practicality of MetaProgramming in Grails Project</title>
		<link>http://sunilprakashinteti.wordpress.com/2009/11/27/practicality-of-metaprogramming-in-grails-project/</link>
		<comments>http://sunilprakashinteti.wordpress.com/2009/11/27/practicality-of-metaprogramming-in-grails-project/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 06:59:26 +0000</pubDate>
		<dc:creator>Sunil</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sunilprakashinteti.wordpress.com/?p=3</guid>
		<description><![CDATA[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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilprakashinteti.wordpress.com&amp;blog=8438360&amp;post=3&amp;subd=sunilprakashinteti&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Grails is a powerful technology to build web applications very rapidly. Groovy provides so many enhancements to Java objects. <a title="Metaprogramming" href="http://en.wikipedia.org/wiki/Metaprogramming" target="_blank">Metaprogramming</a> capability is one of them. Grails uses this <a title="Metaprogramming capability of Groovy" href="http://groovy.codehaus.org/ExpandoMetaClass" target="_blank">Metaprogramming capability of Groovy</a> heavily to accomplish things faster the way it does.</p>
<p>This blog discusses the the <em>Practicality of this Metaprogramming in the Grails projects</em> based on my experiences.</p>
<p><span id="more-3"></span></p>
<p>Let me explain briefly how we can achieve Metaprogramming in Groovy in a brief way.</p>
<p>Every method invocation and property access in Groovy is done through <a href="http://groovy.codehaus.org/api/groovy/lang/MetaClass.html" target="_blank"><strong>metaclass</strong></a>. This metaclass contains the properties and methods of the class. Using this metaClass we can add,ovverirde methods to an object and thereby change object behaviour at runtime.<br />
For example :</p>
<p>we can add a method to an object using  its metaClass and a <a href="http://groovy.codehaus.org/Closures" target="_blank">closure</a></p>
<pre class="brush: java;">class Module {
String name
}
Module.metaClass.album = {
//add the logic for this dynamic method album
}</pre>
<p>Some of the scenarios where we can use Metaprogramming in my Grails project(indirectly) are</p>
<p><strong>1) Using Dynamic methods for domain objects provided by GORM</strong></p>
<pre class="brush: java;">Module.findAllByNameLike(&quot;%Groovy%&quot;);
def module = new Module(name:'groovy',url:'someurl').save()</pre>
<p>In controllers and Services we can use these dynamic methods and it makes life very simple.</p>
<p><strong>2) Groovy has added the some methods to final classes like java,lang.Integer, java,lang.String.</strong></p>
<p>Groovy added closure methods to metaClass of these classes.</p>
<pre class="brush: java;">3.times {
//put your business logic here
}</pre>
<p>We can use this helpful methods of Groovy in our application. The readability is increased here and syntax is simple.</p>
<p>Consider a situation if we have to add these dynamic methods to business objects in our application.  Yes we can very well add these methods dynamically and do our business logic but it comes at huge cost.</p>
<p>I strongly feel that using these metaClass mechanism in our business logic has more bad consequesnces than good. It makes code impossible to read and understand (Groovy is already a bit difficult than Java )and difficult to manage later on. I think its better to have appropriate design of domain objects and services rather use this metaClass stuff at all for having dynamic method behavior for object. Practically i don&#8217;t see any advatage to use metaClass to add dynamic methods in our application even if we have a use case because we keep changing our application code frequently unlike the Grovvy library class that we use. I also wonder what kind of applications heavily needs this change of behaviour of objects.</p>
<p>One area where I think we can use this metaClass mechanism is in Unit testing your Grails application. We can ovveride the existing method of dependant object using the metaclass and mock the behaviour of any object. (Only if you are bored with normal mocking mechanism and if you fancy using metaClass)</p>
<p><strong>Conclusion :</strong></p>
<p>Metaprogramming sounds so cool and you would be tempted to use it some how in your project(at least i was). I feel that we have to use this very judiciously so that we don&#8217;t  make our codebase &#8216;hardToUnderstand&#8217; and &#8216;hardToManage&#8217; and &#8216;hardToTest&#8217;. <strong>If you(who used Grails in projects ) disagree with me, please feel free to put the counter argument and  usecase where you used the metaClass to add dynamic methods in your Grails application</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sunilprakashinteti.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sunilprakashinteti.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sunilprakashinteti.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sunilprakashinteti.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sunilprakashinteti.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sunilprakashinteti.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sunilprakashinteti.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sunilprakashinteti.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sunilprakashinteti.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sunilprakashinteti.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sunilprakashinteti.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sunilprakashinteti.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sunilprakashinteti.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sunilprakashinteti.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sunilprakashinteti.wordpress.com&amp;blog=8438360&amp;post=3&amp;subd=sunilprakashinteti&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sunilprakashinteti.wordpress.com/2009/11/27/practicality-of-metaprogramming-in-grails-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b47944a912baf92a796517302c2128c4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Sunil</media:title>
		</media:content>
	</item>
	</channel>
</rss>
