<?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/"
	>

<channel>
	<title>Gigu's blog &#187; groovy</title>
	<atom:link href="http://blog.gigoo.org/tag/groovy/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gigoo.org</link>
	<description>wEBbLOG</description>
	<lastBuildDate>Thu, 01 Jul 2010 22:59:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mixture of technology at Google App Engine (GAE)</title>
		<link>http://blog.gigoo.org/2010/02/10/mixture-of-technology-at-google-app-engine-gae/</link>
		<comments>http://blog.gigoo.org/2010/02/10/mixture-of-technology-at-google-app-engine-gae/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 01:45:53 +0000</pubDate>
		<dc:creator>Greg Gigon</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[stuff]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[google app engine]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[objectify]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.gigoo.org/?p=4867</guid>
		<description><![CDATA[For some time now I am developing my little hobby project. It is called F1Dashboard and it contains informations related to Formula 1 (my favorite motor-sport).

Since the site is quite stable now I will share with you some technologies and ideas I used.
Platform
F1Dashboard is build and deployed on Google App Engine (GAE). I started this [...]]]></description>
			<content:encoded><![CDATA[<p>For some time now I am developing my little hobby project. It is called <a title="F1 Dashboard" href="http://www.f1dashboard.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.f1dashboard.com');" target="_blank">F1Dashboard</a> and it contains informations related to Formula 1 (my favorite motor-sport).</p>
<p style="text-align: center;">
<div id="attachment_4870" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-4870" title="F1 Dashboard Logo" src="http://blog.gigoo.org/wp-content/uploads/2010/02/f1-dashboard-logo-300x74.jpg" alt="F1 Dashboard" width="300" height="74" /><p class="wp-caption-text">F1 Dashboard</p></div>
<p>Since the site is quite stable now I will share with you some technologies and ideas I used.</p>
<h1>Platform</h1>
<p><a title="F1 Dashboard" href="http://www.f1dashboard.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.f1dashboard.com');" target="_blank">F1Dashboard</a> is build and deployed on <a title="Google App Engine" href="http://appengine.google.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/appengine.google.com');" target="_blank">Google App Engine (GAE)</a>. I started this as an experiment and as a toy project just to learn something new.</p>
<p>GAE is not a new idea, it is another platform for <a title="Cloud computing" href="http://en.wikipedia.org/wiki/Cloud_computing" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');" target="_blank">cloud computing</a>. Main difference from others is the Database model. GAE is using a thing called Data Store (<a title="Big Table" href="http://en.wikipedia.org/wiki/Big_table" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');" target="_blank">Big Table</a>), which is not a normal relational database that anyone used to. There is no schema defined, and querying is impossible without indexing it before. It is something like a massive bag that could store stuff in.</p>
<p>GAE is offered as Python and <a title="Java" href="http://java.sun.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/java.sun.com');" target="_blank">Java</a>. The later was released long time after Python. It has limited version of JVM environment and a whole bunch of Google services to use. Lots of standard JDK types got repackaged by Google just to limit standard Java functionality, like spawning a Threads.</p>
<p>GAE offers standard Java servlets as web technology. This means that you could use some of the well established frameworks out there. I decided to create one myself of course <img src='http://blog.gigoo.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Something simple and not complicated.</p>
<h1>Language</h1>
<p>I choose <a title="Groovy Programming Language" href="http://groovy.codehaus.org" onclick="javascript:pageTracker._trackPageview('/outbound/article/groovy.codehaus.org');" target="_blank">Groovy</a>, just because I wonted to learn another dynamic language and I liked the way Groovy did closures.</p>
<h1>Patterns</h1>
<p>The framework I did follows <a title="MVC pattern" href="http://en.wikipedia.org/wiki/Model–view–controller" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');" target="_blank">MVC</a> pattern. It has single servlet entry. Every requested URL is parsed internally and resolved into Controller and Action. I&#8217;m using <a title="String Template" href="http://www.stringtemplate.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.stringtemplate.org');" target="_blank">String Template</a> as rendering engine for my views.</p>
<p>All database operations are entirely hidden behind Repositories, and I made it simple to switch from <a title="Objectify" href="http://code.google.com/p/objectify-appengine/" onclick="javascript:pageTracker._trackPageview('/outbound/article/code.google.com');" target="_blank">Objectify</a> to <a title="Data Nucleus" href="http://www.datanucleus.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.datanucleus.org');" target="_blank">Data Nucleus</a> to anything else that comes.</p>
<p>I choose Objectify for its simplicity. If you are starting with GAE I would very much recommend it.</p>
<h1>UI</h1>
<p>The design is simple and was done by fried of mine Mike from <a title="Rosslyn Digital" href="http://www.rosslyndigital.co.uk" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.rosslyndigital.co.uk');" target="_blank">Rosslyn Digital</a>.</p>
<p>I plugged in <a title="JQuery " href="http://jquery.org" onclick="javascript:pageTracker._trackPageview('/outbound/article/jquery.org');" target="_blank">jQuery</a> <a title="JQuery tools" href="http://flowplayer.org/tools/index.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/flowplayer.org');" target="_blank">Tools</a> for Overlay effect. It also has a nice plugin for picture gallery.</p>
<p>I also added automatic <a title="F1Dashboard on Twitter" href="http://www.twitter.com/f1dashboard" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.twitter.com');" target="_blank">Twitter</a> updates for every message that is updated on a site.</p>
<h1>Updates</h1>
<p>Site is automatically harvesting for new content from various of Formula 1 related sites. There is also content from Twitter, YouTube and Flickr. It is utilizing <a title="GAE Cron" href="http://code.google.com/appengine/docs/java/config/cron.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/code.google.com');" target="_blank">GAE cron jobs</a> for that.</p>
<p>I&#8217;m trying to gather some ideas for what I can do with the site in near future. If you have an idea, drop me an email. You can also see latest updates on a site at <a title="Blog f1dashboard.com" href="http://blog.f1dashboard.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/blog.f1dashboard.com');" target="_blank">http://blog.f1dashboard.com</a></p>
<p>Cheers, Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gigoo.org/2010/02/10/mixture-of-technology-at-google-app-engine-gae/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Percent encoding in Groovy</title>
		<link>http://blog.gigoo.org/2010/02/01/percent-encoding-in-groovy/</link>
		<comments>http://blog.gigoo.org/2010/02/01/percent-encoding-in-groovy/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 23:35:46 +0000</pubDate>
		<dc:creator>Greg Gigon</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.gigoo.org/?p=4860</guid>
		<description><![CDATA[I was writing some helpers for OAuth Twitter authorization. One of the problem I got was the encoding. OAuth is using UTF-8 and percent encoding (special style of URL ecoding).
I couldn&#8217;t find anything build-in in Java or Groovy so I wrote a very short little method that does it.
 def encodeString(def stringToEncode){
 def reservedCaracters = [...]]]></description>
			<content:encoded><![CDATA[<p>I was writing some helpers for OAuth Twitter authorization. One of the problem I got was the encoding. OAuth is using UTF-8 and <a title="Percent encoding" href="http://en.wikipedia.org/wiki/Percent-encoding" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');" target="_blank">percent encoding</a> (special style of URL ecoding).</p>
<p>I couldn&#8217;t find anything build-in in Java or Groovy so I wrote a very short little method that does it.</p>
<p><span> </span><em><strong>def encodeString(def stringToEncode){</strong></em></p>
<p><span><em><strong> </strong></em></span><em><strong>def reservedCaracters = [32:1, 33:1, 42:1, 34:1, 39:1, 40:1, 41:1, 59:1, 58:1, 64:1, 38:1, 61:1, 43:1, 36:1, 33:1, 47:1, 63:1, 37:1, 91:1, 93:1, 35:1]</strong></em></p>
<p><span><em><strong> </strong></em></span><em><strong>def encoded =  stringToEncode.collect { letter -&gt;<br />
reservedCaracters[(int)letter] ? &#8220;%&#8221; +Integer.toHexString((int)letter).toString().toUpperCase() : letter<br />
}<br />
return encoded.join(&#8220;&#8221;)<br />
}</strong></em></p>
<p>If you ever need something similar, use it <img src='http://blog.gigoo.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gigoo.org/2010/02/01/percent-encoding-in-groovy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>F1 Dashboard released</title>
		<link>http://blog.gigoo.org/2009/08/17/f1-dashboard-released/</link>
		<comments>http://blog.gigoo.org/2009/08/17/f1-dashboard-released/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 22:31:35 +0000</pubDate>
		<dc:creator>Greg Gigon</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[stuff]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[google app engine]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.gigoo.org/?p=4815</guid>
		<description><![CDATA[In last few months I was working on a little personal project. When Google App Engine team announced that preview of Java version is available I decided to give it a try. When I was looking for a subject of my application, one of the ideas started to emerge more that others. I was looking [...]]]></description>
			<content:encoded><![CDATA[<p>In last few months I was working on a little personal project. When Google App Engine team announced that preview of Java version is available I decided to give it a try. When I was looking for a subject of my application, one of the ideas started to emerge more that others. I was looking for a web site that could aggregate all the information about Formula 1 racing. Because there was none available (or my Google search ended on first few results that were not satisfactory) I decided to make one.</p>
<p>Few weeks and cups of coffee latter <a title="F1 Dashboard.com" href="http://www.f1dashboard.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.f1dashboard.com');" target="_blank">F1Dashboard.com</a> is released.</p>
<p style="text-align: center;">
<div id="attachment_4820" class="wp-caption alignnone" style="width: 489px"><img class="size-full wp-image-4820" title="F1 Dashboard screen shot" src="http://blog.gigoo.org/wp-content/uploads/2009/08/f1-dashboard.jpg" alt="F1 Dashboard screen shot" width="479" height="207" /><p class="wp-caption-text">F1 Dashboard screen shot</p></div>
<h3>Generalities</h3>
<p>So, in few words, F1 Dashboard is agregator of news, and media feeds from world of Formula 1. I decided not to collect content, just store information where to find it and short description.</p>
<p>News are harvested from a number of web sites. Twitter updates serves as another source of news.</p>
<p>Images are comming from Flickr, videos from YouTube.</p>
<p>All updates  are happening every few minutes and are 100% automated.</p>
<h3>Technicalities</h3>
<p>GAE supports Groovy as one of JVM programming languages. I decided to give it a try. I love Groovy, it is somewhere in between a friendly and known Java API and Ruby programming language.</p>
<p>It took me a moment to use to BigTable type of DataStore. It restrictes a way I used to work with databases normaly. Google provide entire environment for local development, whitch means I don&#8217;t have to upload to a cloud to see working result.</p>
<p>I created a little homegrown Model Views Presenter/Controller framework and used StringTemplate as rendering engine.</p>
<p>jQuery is the library of choice to handle all JavaScript.</p>
<p>Page styling was done by a friendly and kind designer from <a title="Circa82" href="http://www.circa82.co.uk" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.circa82.co.uk');" target="_blank">Circa82</a> Michael Austin (thanks buddy).</p>
<p>Come on guys, give it a try and tell me what you think <img src='http://blog.gigoo.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Feedback greatlly appriciated. <a title="http://www.f1dashboard.com" href="http://www.f1dashboard.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.f1dashboard.com');" target="_blank">http://www.f1dashboard.com</a></p>
<p>Cheerios, Greg</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gigoo.org/2009/08/17/f1-dashboard-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Groovy with JDO on Google App Engine, enhancing with DataNucleus</title>
		<link>http://blog.gigoo.org/2009/04/27/groovy-with-jdo-on-google-app-engine-enhancing-with-datanucleus/</link>
		<comments>http://blog.gigoo.org/2009/04/27/groovy-with-jdo-on-google-app-engine-enhancing-with-datanucleus/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 01:52:25 +0000</pubDate>
		<dc:creator>Greg Gigon</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[datanucleus]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[google app engine]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jdo]]></category>

		<guid isPermaLink="false">http://blog.gigoo.org/2009/04/27/groovy-with-jdo-on-google-app-engine-enhancing-with-datanucleus/</guid>
		<description><![CDATA[ I have some time this days and I’m trying to fly some clouds with Google App Engine (GAE), Now when they have released Java support I can try to use Groovy. Today I tried to implement some simple storage using JDO. GAE team supports some of its features via&#160; DataNucleus. DataNucleus is using a [...]]]></description>
			<content:encoded><![CDATA[<p><img style="display: inline; margin: 0px 10px 0px 0px" src="http://code.google.com/appengine/images/appengine_lowres.jpg" align="left" /> I have some time this days and I’m trying to fly some clouds with <a href="http://code.google.com/appengine/" onclick="javascript:pageTracker._trackPageview('/outbound/article/code.google.com');" target="_blank">Google App Engine</a> (GAE), Now when they have released Java support I can try to use <a href="http://groovy.codehaus.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/groovy.codehaus.org');" target="_blank">Groovy</a>. Today I tried to implement some simple storage using JDO. GAE team supports some of its features via&#160; <a href="http://www.datanucleus.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.datanucleus.org');" target="_blank">DataNucleus</a>. DataNucleus is using a post compilation hook to enhance any persistable classes. </p>
<p>Having Groovy in a <strong>lib</strong> folder of your <strong>war </strong>(GAE runs your application from this folder) I need to put <strong>asm </strong>library as well. Latest version of Groovy (1.6.1) has a dependency on <strong>asm </strong>library in version <strong>2.2.3. </strong>On the other hand DataNucleus enhancer has dependency on <strong>asm </strong>library in version <strong>3.1</strong>. </p>
<p>GAE Java SDK is shipped with <strong>Ant</strong> task for enhancing persistable classes. It also contains <strong>Ant </strong>macro definition file that makes it simple for usage. Unfortunately this macro includes all libraries from application <strong>lib </strong>folder. This is causing Enhancer to use <strong>asm</strong> library in a version that causes it to fail massively. </p>
<blockquote><p><strong><em>[enhance] SEVERE: An error occured for ClassEnhancer &quot;ASM&quot; when trying to call the method &quot;org.datanucleus.enhancer.as          <br />m.ASMClassEnhancer&quot; on class &quot;getClassNameForFileName&quot; : org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVi           <br />sitor;I)V</em></strong></p>
</blockquote>
<p>Number of this error messages is as big as the number of classes in my application.</p>
<p>Solution is to exclude <strong>asm </strong>library from the macro that Google shipped. Easiest way is to edit, or copy to your local application folder and use it there. The line problematic line of code is in <strong>classpath </strong>element.</p>
<blockquote><p><em>&lt;classpath&gt;        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;pathelement path=&quot;${appengine.tools.classpath}&quot;/&gt;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;pathelement path=&quot;@{war}/WEB-INF/classes&quot;/&gt;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;fileset dir=&quot;@{war}/WEB-INF/lib&quot; includes=&quot;*.jar&quot;&gt;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/fileset&gt;         <br />&lt;/classpath&gt;</em></p>
</blockquote>
<p>The easiest way to fix it is to exclude <strong>asm </strong>library in <strong>fileset </strong>element, just like this:</p>
<blockquote><p><em>&lt;classpath&gt;        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;pathelement path=&quot;${appengine.tools.classpath}&quot;/&gt;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;pathelement path=&quot;@{war}/WEB-INF/classes&quot;/&gt;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;fileset dir=&quot;@{war}/WEB-INF/lib&quot; includes=&quot;*.jar&quot; <strong>excludes=&quot;asm*.jar&quot;&gt;</strong>         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/fileset&gt;         <br />&lt;/classpath&gt;</em></p>
<p>Hope that helps anyone with similar problem.</p>
<p>Cheers, Greg</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.gigoo.org/2009/04/27/groovy-with-jdo-on-google-app-engine-enhancing-with-datanucleus/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
