<?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>Colin Harrington &#187; Groovy-Grails</title>
	<atom:link href="http://colinharrington.net/blog/category/groovy-grails/feed/" rel="self" type="application/rss+xml" />
	<link>http://colinharrington.net/blog</link>
	<description>Technologist, Consultant, Software Engineer, Entrepreneur and Musician</description>
	<lastBuildDate>Tue, 06 Jul 2010 21:50:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Grails: The View Layer [GUM]</title>
		<link>http://colinharrington.net/blog/2010/02/grails-the-view-layer-gum/</link>
		<comments>http://colinharrington.net/blog/2010/02/grails-the-view-layer-gum/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 06:25:57 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Groovy-Grails]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[GUM]]></category>
		<category><![CDATA[Sitemesh]]></category>

		<guid isPermaLink="false">http://colinharrington.net/blog/?p=155</guid>
		<description><![CDATA[This past month, I did a presentation at the Groovy Users of Minnesota which I called Grails: The View Layer.  We took our time delving into the Groovy Server Pages, how Grails utilizes Sitemesh and some of the more obscure tags related to Sitemesh.  Currently, Grails&#8217; Sitemesh integration is not very well understood by the [...]]]></description>
			<content:encoded><![CDATA[<p>This past month, I did a presentation at the <a title="GUM" href="http://groovy.mn" target="_blank">Groovy Users of Minnesota</a> which I called <span style="text-decoration: underline;">Grails: The View Layer</span>.  We took our time delving into the Groovy Server Pages, how <a href="http://www.grails.org" target="_blank">Grails</a> utilizes <a href="http://www.opensymphony.com/sitemesh/" target="_blank">Sitemesh</a> and some of the more obscure tags related to Sitemesh.  Currently, Grails&#8217; Sitemesh integration is not very well understood by the community at large and I wanted to spend some time on it since Sitemesh is such a powerful part of the Framework.</p>
<p><iframe src="http://docs.google.com/present/embed?id=dg8qcbkq_139dtddh5rm&#038;interval=10&#038;size=m" frameborder="0" width="555" height="451"></iframe></p>
<p>I was hoping to spend some more time polishing this slide deck, but hopefully this presentation skeleton is helpful to the community as it is.  I am hoping to give this talk again at <a href="http://www.gr8conf.org/" target="_blank">Gr8Conf</a> in the USA this upcoming April and spend some more time creating more concrete and digestible examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://colinharrington.net/blog/2010/02/grails-the-view-layer-gum/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Grails user-specific configurations</title>
		<link>http://colinharrington.net/blog/2009/11/grails-user-specific-configurations/</link>
		<comments>http://colinharrington.net/blog/2009/11/grails-user-specific-configurations/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 16:15:53 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Groovy-Grails]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Grails]]></category>

		<guid isPermaLink="false">http://colinharrington.net/blog/?p=133</guid>
		<description><![CDATA[I asked a question on the GUM (Groovy Users of Minnesota) User list about how to achieve a user/machine specific config.
I didn&#39;t have much time to figure it out but this is what I ended up finding out:
Grails 1.1.1 create-app generates a Config.groovy with this as the first few lines that would have told me [...]]]></description>
			<content:encoded><![CDATA[<p><img align="right" alt="grails" border="0" height="96" hspace="4" src="http://www.colinharrington.net/images/grails-128x128-icon.png" vspace="4" width="96" />I asked a question on the <a href="http://groovy.mn">GUM (Groovy Users of Minnesota)</a> User list about <a href="http://groups.google.com/group/groovymn/browse_thread/thread/f0a4c8647b2e10ca">how to achieve a user/machine specific config</a>.</p>
<p>I didn&#39;t have much time to figure it out but this is what I ended up finding out:</p>
<p>Grails 1.1.1 create-app generates a <code>Config.groovy</code> with this as the first few lines that would have told me what I need to know if I actually took the time to read it:<br />
<code style="font-size:0.9em">// locations to search for config files that get merged into the main config<br />
// config files can either be Java properties files or ConfigSlurper scripts<br />
//<br />
// grails.config.locations = [ &quot;classpath:${appName}-config.properties&quot;,<br />
//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;classpath:${appName}-config.groovy&quot;,<br />
//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;file:${userHome}/.grails/${appName}-config.properties&quot;,<br />
//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;file:${userHome}/.grails/${appName}-config.groovy&quot;]<br />
//<br />
// if(System.properties[&quot;${appName}.config.location&quot;]) {<br />
//&nbsp;&nbsp;&nbsp; grails.config.locations &lt;&lt; &quot;file:&quot; + System.properties[&quot;${appName}.config.location&quot;]<br />
// } </code></p>
<p>So in my case all I had to do was put this in <code>Config.groovy</code>:<br />
<code style="font-size:0.9em">if (new File(&quot;${userHome}/.grails/${appName}-config.groovy&quot;).exists()){<br />
&nbsp;&nbsp;&nbsp; grails.config.locations = [&quot;file:${userHome}/.grails/${appName}-config.groovy&quot;]<br />
}</code></p>
<p>which allowed me to override properties by doing something like this in my <code>~/.grails/${appName}-config.groovy</code> :<br />
<code style="font-size:0.9em">username = &quot;sa&quot;<br />
password = &quot;sekret&quot;<br />
// environment specific settings<br />
environments {<br />
&nbsp;&nbsp;&nbsp; development {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dataSource {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dbCreate = &quot;create-drop&quot; // use your imagination...<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
}</code></p>
<p>I also ran across a little gem that you can do the same type of config merging with your <code>BuildConfig.groovy</code> by implementing a <code>~/.grails/settings.groovy</code> file. (yes its hardcoded rather than a config.locations property in <code>BuildConfig.groovy</code> &ndash; see <code>BuildSettings.groovy</code> for more)</p>
<p>Now I really wish there was a way to set defaults for things like <a href="http://jira.codehaus.org/browse/GRAILS-1861" target="_blank"><span style="font-family: courier new,monospace;">server.port</span> in the configs</a>.</p>
<p>Thanks, <a href="http://naleid.com/blog/">Ted Naleid</a>, <a href="http://www.refactr.com">Scott Vlaminck</a>, and <a href="http://smokejumperit.com/">Robert Fischer</a> for helping me find what I was looking for!</p>
]]></content:encoded>
			<wfw:commentRss>http://colinharrington.net/blog/2009/11/grails-user-specific-configurations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grails BOF recording at SpringOne2GX</title>
		<link>http://colinharrington.net/blog/2009/10/grails-bof-recording-at-springone2gx/</link>
		<comments>http://colinharrington.net/blog/2009/10/grails-bof-recording-at-springone2gx/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 05:27:12 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Groovy-Grails]]></category>
		<category><![CDATA[BOF]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Recording]]></category>
		<category><![CDATA[SpringOne2GX]]></category>

		<guid isPermaLink="false">http://colinharrington.net/blog/?p=126</guid>
		<description><![CDATA[
	SpringOne2gx was a blast this year.&#160; It was great to get to know many members from the community!

	I was able to record the Grails BOF (Birds Of a Feather) session at SpringOne2gx this year: Download it Here (80MB)

	Big thanks to SpringSource and No Fluff Just Stuff for putting together an awesome conference!

	Props to Dropbox for [...]]]></description>
			<content:encoded><![CDATA[<p>
	<img align="right" alt="" border="0" height="128" hspace="4" src="http://www.colinharrington.net/images/grails-128x128-icon.png" vspace="4" width="128" />SpringOne2gx was a blast this year.&nbsp; It was great to get to know many members from the community!</p>
<p>
	I was able to record the Grails BOF (Birds Of a Feather) session at SpringOne2gx this year: <span style="font-size: 16px;"><a href="http://dl.getdropbox.com/u/129843/GrailsBOF-SpringOne2GX.mp3">Download it Here</a></span> (80MB)</p>
<p>
	Big thanks to <a href="http://www.springsource.com/">SpringSource</a> and <a href="http://www.nofluffjuststuff.com/home/main">No Fluff Just Stuff</a> for putting together an awesome conference!</p>
<p>
	Props to <a href="https://www.getdropbox.com/referrals/NTEyOTg0Mzk">Dropbox</a> for allowing me to share <a href="http://dl.getdropbox.com/u/129843/GrailsBOF-SpringOne2GX.mp3">this recording</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://colinharrington.net/blog/2009/10/grails-bof-recording-at-springone2gx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://dl.getdropbox.com/u/129843/GrailsBOF-SpringOne2GX.mp3" length="84059532" type="audio/mpeg" />
		</item>
		<item>
		<title>VMWare acquiring SpringSource which Acquired G2One</title>
		<link>http://colinharrington.net/blog/2009/08/vmware-acquiring-springsource-which-acquired-g2one/</link>
		<comments>http://colinharrington.net/blog/2009/08/vmware-acquiring-springsource-which-acquired-g2one/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 22:53:17 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Groovy-Grails]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[SpringSource]]></category>

		<guid isPermaLink="false">http://colinharrington.net/blog/?p=110</guid>
		<description><![CDATA[Wow, Big news for the Groovy and Grails Community!&#160; VMWare has announced that it is acquiring SpringSource.&#160; Rod Johnson, the founder of SpringSource and Initial author of the Spring Framework also posted his thoughts on SpringSource&#8217;s blog calling it &#8216;SpringSource &#8211; Chapter Two&#8217;.&#160; I&#160;don&#8217;t think that too many of us saw this one coming.&#160; Now [...]]]></description>
			<content:encoded><![CDATA[<p><img vspace="4" hspace="4" align="left" border="0" alt="" src="http://www.colinharrington.net/images/grails-128x128-icon.png" />Wow, Big news for the Groovy and Grails Community!&nbsp; <a href="http://blogs.vmware.com/console/2009/08/vmware-acquires-springsource.html">VMWare has announced</a> that it is acquiring SpringSource.&nbsp; <a href="http://twitter.com/springrod">Rod Johnson</a>, the founder of <a href="http://www.springsource.com">SpringSource</a> and Initial author of the <a href="http://en.wikipedia.org/wiki/Spring_Framework">Spring Framework</a> also posted his thoughts on SpringSource&#8217;s blog calling it <a href="http://blog.springsource.com/2009/08/10/springsource-chapter-two/">&#8216;SpringSource &#8211; Chapter Two&#8217;</a>.&nbsp; I&nbsp;don&#8217;t think that too many of us saw this one coming.&nbsp; Now its time to wait until Oracle acquires VMWare <a href="http://marceloverdijk.blogspot.com/2009/04/prophecy-has-come-true-springsource.html">If Marcel Overdijk&#8217;s prophecy is true</a> <img src='http://colinharrington.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I&#8217;m not that familiar with SpringSource&#8217;s offerings, but It does seem like some of VMWare&#8217;s products are a natural extension to the goals that SpringSource is trying to accomplish with their Build / Run / Manage mantra.&nbsp; The two companies don&#8217;t really compete, but VMWare +&nbsp;Grails seems like a good combo to me <img src='http://colinharrington.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> &nbsp; <span class="fn"><a href="http://twitter.com/blackdood">Jerome Gagner</a> </span><a href="http://futureitexec.wordpress.com/2009/08/10/vmware-acquires-springsource/">blogged about how VMWare</a> should throw in some <a href="http://www.terracotta.org/">terracotta</a> for some extra spice to take on (read &#8216;out&#8217;) <a href="http://www.microsoft.com/azure/">Windows Azure</a>.</p>
<p>I must say that <a href="http://en.wikipedia.org/wiki/Platform_as_a_service">PaaS</a> offerings look really appealing to me as a developer.&nbsp; Even though I&nbsp;*can* manage machines and hardware, I don&#8217;t want to have to take on the risks and responsibilities.&nbsp; I&#8217;m not quite sure what they are going to accomplish together but VMWare +&nbsp;Grails + SpringSource Technologies as a PaaS solution sounds good to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://colinharrington.net/blog/2009/08/vmware-acquiring-springsource-which-acquired-g2one/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Grails Growl-like notifications in Linux (Ubuntu, 9.04)</title>
		<link>http://colinharrington.net/blog/2009/05/grails-growl-like-notifications-in-linux-ubuntu-904/</link>
		<comments>http://colinharrington.net/blog/2009/05/grails-growl-like-notifications-in-linux-ubuntu-904/#comments</comments>
		<pubDate>Sun, 24 May 2009 22:30:12 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Groovy-Grails]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Growl]]></category>
		<category><![CDATA[Jaunty]]></category>

		<guid isPermaLink="false">http://colinharrington.net/blog/?p=86</guid>
		<description><![CDATA[When I was developing on OSX, a fellow developer&#160;Ted Naleid tipped me off to a script that does Growl notifications for Grails events that Marc Palmer had written.&#160;&#160; The Growl notifications were handy, but now that I&#8217;ve been working on Linux, I&#8217;ve definitely missed them.
I first used a tool called Mumbles, which attempted to be [...]]]></description>
			<content:encoded><![CDATA[<p>When I was developing on OSX, a fellow developer&nbsp;<a href="http://naleid.com/blog/">Ted Naleid</a> tipped me off to a script that does <a href="http://www.anyware.co.uk/2005/2007/06/08/some-grails-055-script-enhancements/">Growl notifications for Grails events</a> that Marc Palmer had written.&nbsp;&nbsp; The Growl notifications were handy, but now that I&#8217;ve been working on Linux, I&#8217;ve definitely missed them.</p>
<p>I first used a tool called <a href="http://www.mumbles-project.org/">Mumbles</a>, which attempted to be a clone of <a href="http://growl.info/">Growl</a>, but I later realized that the built in notification system is probably the way to go.&nbsp; After I learned of Ubuntu 9.04 (Jaunty Jackalope) had some major visualization enhancements to the notifications, I thought that it was definitely the way to go.&nbsp;</p>
<p style="text-align: left;">This is what I currently have with Ubuntu 9.04:</p>
<p style="text-align: center;">
<img vspace="4" hspace="4" border="0" src="http://www.colinharrington.net/images/jaunty-grails-plugins.png" alt="Jaunty Grails notification Plugins" /></p>
<p style="text-align: center;"><img vspace="4" hspace="4" border="0" src="http://www.colinharrington.net/images/jaunty-grails-final.png" alt="Jaunty Grails notification final" /></p>
<p style="text-align: left;">Implementing this is very simple, you simply create an <code>_Events.groovy</code> file in your <code>~/.grails/scripts</code>&nbsp; directory (create it if it doesn&#8217;t exist) with the following contents (modified from the Growl Script):</p>
<p style="text-align: left;"><code>eventStatusFinal = { msg -&gt;<br />
&nbsp;&nbsp;&nbsp; libNotify('Final status', msg)<br />
}<br />
eventStatusUpdate = { msg -&gt;<br />
&nbsp;&nbsp;&nbsp; libNotify('Status', msg)<br />
} <br />
eventCreatedFile = { fileName -&gt;<br />
&nbsp;&nbsp;&nbsp; //libNotify('Created file', fileName)<br />
}<br />
eventStatusError = { message -&gt;<br />
&nbsp;&nbsp;&nbsp; libNotify('Error', message)<br />
}<br />
eventExiting = { code -&gt;<br />
&nbsp;&nbsp;&nbsp; libNotify('Exit', &quot;Return code $code&quot;)<br />
}<br />
eventCreatedArtefact = { type, file -&gt;<br />
&nbsp;&nbsp;&nbsp; libNotify('Created artefct', &quot;$type with name $file&quot;)<br />
}<br />
eventCompileStart = { kind -&gt;<br />
&nbsp;&nbsp;&nbsp; //libNotify('Compiling', &quot;Compiling $kind&quot;)<br />
}<br />
eventCompileEnd = { kind -&gt;<br />
&nbsp;&nbsp;&nbsp; //libNotify('Compilation complete', &quot;Compiled $kind&quot;)<br />
}<br />
eventPluginInstalled = { pluginName -&gt;<br />
&nbsp;&nbsp;&nbsp; libNotify('Plugin installed', pluginName)<br />
}<br />
// Do the notification<br />
void libNotify(title, message) {<br />
&nbsp;&nbsp;&nbsp; def cmd = [<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'notify-send',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; title,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; message,<br />
&nbsp;&nbsp;&nbsp; '-i',<br />
&nbsp;&nbsp;&nbsp; 'grails'<br />
&nbsp;&nbsp;&nbsp; ]<br />
&nbsp;&nbsp;&nbsp; cmd.execute()<br />
}</code></p>
<p>It is simply using Groovy to execute &quot;<code>notify-send $title $message -i grails</code>&quot;.&nbsp;&nbsp; if you don&#8217;t have <code>notify-send</code>, it is part of libnotify so <code>sudo apt-get install libnotify-bin</code> will get you what you need.&nbsp; If I get some time I&#8217;d like to find a way to take advantage of a <a href="http://dbus.freedesktop.org/doc/dbus-java/">Java Dbus implementation</a> to talk to the notification system without having to go through libnotify.</p>
<p>If you want mumbles notifications just do something like this:</p>
<p><code>void mumblesNotify(title, message) {<br />
&nbsp;&nbsp;&nbsp; def cmd = [<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;mumbles-send&quot;,<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;-l&quot;,<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; title,<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; message<br />
&nbsp;&nbsp;&nbsp; ]<br />
&nbsp;&nbsp;&nbsp; cmd.execute()<br />
}</code></p>
<p>Occasionally I&#8217;ll get a failure that there are too many files open (using .execute() in Groovy) and that should be cleared up by using a Java implementation of the DBus notifications.</p>
<p>Let me know what you think.&nbsp; Anything that could be done better?</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://colinharrington.net/blog/2009/05/grails-growl-like-notifications-in-linux-ubuntu-904/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Groovy and Grails IDE Shootout</title>
		<link>http://colinharrington.net/blog/2009/02/groovy-and-grails-ide-shootout/</link>
		<comments>http://colinharrington.net/blog/2009/02/groovy-and-grails-ide-shootout/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 23:27:47 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Groovy-Grails]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Intellij]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[TextMate]]></category>

		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2009/02/11/groovy-and-grails-ide-shootout/</guid>
		<description><![CDATA[Last night at the Groovy Users of Minnesota (GUM) meeting we did an IDE shootout where we covered Groovy and Grails support in the more popular IDEs.
Jesse O&#8217;neill-Oine from Refactr started us off with TextMate.&#160;

I (Colin Harrington) presented on Eclipse and Netbeans:

Hamlet D&#8217;arcy teamed up with Matt Abrams &#38; Bob Schultz to close out the [...]]]></description>
			<content:encoded><![CDATA[<p>Last night at the <a href="http://groovy.mn">Groovy Users of Minnesota</a> (GUM) meeting we did an <a href="http://groups.google.com/group/groovymn/browse_thread/thread/21968a616258054d">IDE shootout</a> where we covered <a href="http://groovy.codehaus.org/">Groovy</a> and <a href="http://grails.org">Grails</a> support in the more popular IDEs.</p>
<p><a href="http://www.linkedin.com/in/joneilloine">Jesse O&#8217;neill-Oine</a> from <a href="http://refactr.com">Refactr</a> started us off with TextMate.&nbsp;</p>
<p style="text-align: center;"><iframe width="555" height="451" frameborder="0" src="http://docs.google.com/EmbedSlideshow?docid=d84rmmv_12fxxsnpgt&amp;size=m"></iframe></p>
<p>I (<a href="http://www.linkedin.com/in/colinharrington">Colin Harrington</a>) presented on <a href="http://eclipse.org">Eclipse</a> and <a href="http://netbeans.org">Netbeans</a>:</p>
<p style="text-align: center;"><iframe width="555" height="451" frameborder="0" src="http://docs.google.com/EmbedSlideshow?docid=dg8qcbkq_91fqpg4dfb&amp;size=m"></iframe></p>
<p><a href="http://www.linkedin.com/pub/0/4ba/2b1">Hamlet D&#8217;arcy</a> teamed up with Matt Abrams &amp; Bob Schultz to close out the night with <a href="http://www.jetbrains.com/">Jetbrains</a>&#8216; <a href="http://www.jetbrains.com/idea/">IntelliJ-IDEA</a>.</p>
<p style="text-align: center;"><iframe width="555" height="451" frameborder="0" src="http://docs.google.com/EmbedSlideshow?docid=dg8qcbkq_116fcz697dq&amp;size=m"></iframe></p>
<p>Ironically IntelliJ-IDEA 8.1 was released the very next day.&nbsp; Hamlet has <a href="http://hamletdarcy.blogspot.com/2009/02/groovy-dynamic-method-support-in-idea.html">some</a> <a href="http://hamletdarcy.blogspot.com/2009/02/intellij-idea-8-groovy-intentions-in.html">good</a> <a href="http://hamletdarcy.blogspot.com/2009/02/groovy-idea-debugging-tip-skip-stepping.html">tips</a> on <a href="http://hamletdarcy.blogspot.com/">his blog</a> <a href="http://hamletdarcy.blogspot.com/search/label/IDEA"><b>about Intellij-IDEA</b></a>.</p>
<p>This is an ever improving topic and changes very rapidly, so If we missed anything just drop us a comment <img src='http://colinharrington.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Special thanks to <a href="http://glaforge.free.fr/weblog/?catid=2">Guillaume Laforge</a>, <a href="http://blogs.sun.com/phejl/">Petr Hejl</a>, <a href="http://hansamann.wordpress.com/">Sven Haiges</a> of the <a href="http://www.grailspodcast.com/">Grails Podcast</a> as well as everyone who has contributed to the community via blogposts, documentation updates, etc.</p>
<p>Enjoy.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://colinharrington.net/blog/2009/02/groovy-and-grails-ide-shootout/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>GORM :: override a setter on a Grails Domain</title>
		<link>http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/</link>
		<comments>http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 04:43:17 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Groovy-Grails]]></category>
		<category><![CDATA[GORM]]></category>
		<category><![CDATA[Grails]]></category>

		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2009/01/08/gorm-override-a-setter-on-a-grails-domain/</guid>
		<description><![CDATA[Rather than implement properties in the Java Language, we have a convention called a Java Bean.&#160; This basically means that properties are implemented with getter and setter methods with a PascalCase property name in the method among a few other simple conventions.&#160;
Grails makes it incredibly easy to manage domain classes since it is inherently domain-centric.&#160; [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://grails.org"><img vspace="4" hspace="4" border="0" align="right" alt="Grails" src="http://www.colinharrington.net/images/grails-128x128-icon.png" /></a>Rather than implement properties in the Java Language, we have a convention called a <a href="http://en.wikipedia.org/wiki/JavaBean">Java Bean</a>.&nbsp; This basically means that properties are implemented with getter and setter methods with a PascalCase property name in the method among <a href="http://en.wikipedia.org/wiki/JavaBean#JavaBean_conventions">a few other simple conventions</a>.&nbsp;</p>
<p><a href="http://grails.org">Grails</a> makes it incredibly easy to manage domain classes since it is inherently <a href="http://en.wikipedia.org/wiki/Domain-driven_design">domain-centric</a>.&nbsp; When you need to enhance your Domain classes at the core of your application, you have an option of implementing your own getters and setters.&nbsp;&nbsp; I love that by default you do not have to implement your own setters, but you have the power to do so if you wish;&nbsp; the principle of sensible defaults.&nbsp; Here is an example of a Book Object with two properties, author and isbn.</p>
<p><code>class Book {<br />
&nbsp;&nbsp;&nbsp; String author<br />
&nbsp;&nbsp;&nbsp; String isbn<br />
}</code></p>
<p>Consider the case where a <code>Book</code> is in your Database with the ISBN of <a href="http://www.amazon.com/Grails-Persistence-GORM-Robert-Fischer/dp/1430219262">978-1430219262</a> and a user tries to search for &quot;9781430219262&quot;.&nbsp; Unless you do some searchable magic, the user will not find the book.&nbsp; A simple solution fo the issue would be to never store &#8216;-&#8217; in the databse.&nbsp; to make this happen you could easily remove the dash in the setter.&nbsp; So your domain would look like this:</p>
<p><code>class Book {<br />
&nbsp;&nbsp;&nbsp; String author<br />
&nbsp;&nbsp;&nbsp; String isbn</p>
<p>&nbsp;&nbsp;&nbsp; <b>void setIsbn(String i) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isbn = i.replace('-','')<br />
&nbsp;&nbsp;&nbsp; }</b><br />
}</code></p>
<p>When I first tried this, I failed a few times before I got it right.&nbsp; Maybe I was just spoiled with Groovy&#8217;s groovyness, but I started out writing<br />
<code>def setIsbn(i){ ... }</code>&nbsp; and when that didn&#8217;t work: <code>void setIsbn(i){ ... }</code> which was being called, but never actually set the property.&nbsp; Then I had a forehead smacking moment where I realized that<b> <i>the method signature must precisely match the signature of a JavaBean setter</i></b><u><i> </i></u>like <code>public void setPropertyName(Type propVal) { ... }</code>&nbsp; In my case I had to make sure that the method was public (public by default), has a return type of void (which is not the default behavior of a closure), and the parameter passed in was of the same type as the property (String)</p>
<p>And then I blogged about it &#8212; the fourth day.</p>
]]></content:encoded>
			<wfw:commentRss>http://colinharrington.net/blog/2009/01/gorm-override-a-setter-on-a-grails-domain/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>GSF :: Groovy Server Faces?</title>
		<link>http://colinharrington.net/blog/2008/11/gsf-groovy-server-faces/</link>
		<comments>http://colinharrington.net/blog/2008/11/gsf-groovy-server-faces/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 05:40:53 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Groovy-Grails]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[JSF]]></category>

		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/11/09/gsf-groovy-server-faces/</guid>
		<description><![CDATA[Has anyone tried to make Java Server Faces (JSF) more groovy?&#160;
Not having done anything with JSF directly, I&#8217;m not sure what could be groovified, but I&#8217;d imagine that Groovy + JSF might make JSF more attractive to a certain type of developer.&#160; I&#8217;m familiar with the some of the .NET component paradigms and can imagine [...]]]></description>
			<content:encoded><![CDATA[<p>Has anyone tried to make <a href="http://en.wikipedia.org/wiki/JavaServer_Faces">Java Server Faces (JSF)</a> more <a href="http://groovy.codehaus.org/">groovy</a>?&nbsp;</p>
<p>Not having done anything with JSF directly, I&#8217;m not sure what could be groovified, but I&#8217;d imagine that Groovy + JSF might make JSF more attractive to a certain type of developer.&nbsp; I&#8217;m familiar with the some of the .NET component paradigms and can imagine what it would be like in Java <img src='http://colinharrington.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>From the little that I have heard/read, I understand that some of the pain in JSF is related to XML configuration.&nbsp; Groovy <a href="http://groovy.codehaus.org/Processing+XML">does XML</a> quite beautifully and could provide some much needed value to that space.&nbsp; Any other areas that Groovy + JSF would shine?&nbsp; Am I completely off base?&nbsp; Again, <i>I&#8217;m not an expert in JSF</i>, but it may warrant a question to the <a href="http://groovy.codehaus.org/Mailing+Lists">Groovy User list</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://colinharrington.net/blog/2008/11/gsf-groovy-server-faces/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Groovy Elvis Operator?:</title>
		<link>http://colinharrington.net/blog/2008/10/groovy-elvis-operator/</link>
		<comments>http://colinharrington.net/blog/2008/10/groovy-elvis-operator/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 03:25:44 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Groovy-Grails]]></category>
		<category><![CDATA[Elvis]]></category>
		<category><![CDATA[Groovy]]></category>

		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/10/30/groovy-elvis-operator/</guid>
		<description><![CDATA[What is this Elvis Operator I vaguely recall?&#160; I&#8217;ll get to that just bear with me for a minute.&#160;
In Java I&#8217;ve seen too many null checks like the following:
If (something != null) {
&#160;&#160;&#160; val = something 
} else { 
&#160;&#160;&#160; val = defaultValue 
}
Its handy to have the Groovy Truth so we don&#8217;t have to [...]]]></description>
			<content:encoded><![CDATA[<p><img vspace="4" hspace="4" border="0" align="right" src="http://www.colinharrington.net/images/elvis-small.gif" alt="" />What is this Elvis Operator I vaguely recall?&nbsp; I&#8217;ll get to that just bear with me for a minute.&nbsp;</p>
<p>In Java I&#8217;ve seen too many null checks like the following:</p>
<p><code>If (something != null) {<br />
&nbsp;&nbsp;&nbsp; val = something <br />
} else { <br />
&nbsp;&nbsp;&nbsp; val = defaultValue <br />
}</code></p>
<p>Its handy to have the <a href="http://groovy.codehaus.org/Groovy+Truth">Groovy Truth</a> so we don&#8217;t have to do null checks.&nbsp; Instead of writing <i><code>if (something != null) { ... }</code></i>&nbsp; we write <i><code>if (something) { ... }</code></i></p>
<p>Well this type of branching logic is precisely why we have the <a href="http://en.wikipedia.org/wiki/Ternary_operation">ternary operator</a> in both <a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.25">Java</a> and <a href="http://groovy.codehaus.org/Logical+Branching#LogicalBranching-ternaryoperator">Groovy</a>.&nbsp; I&#8217;m surprised that the ternary operator is neglected by many developers.&nbsp; It turns our 4 lines of if/else logic into a single line like:</p>
<p><code>val = something ? something : defaultValue</code></p>
<p>The syntax and logic for the ternary operator is the same in Groovy as it is in Java;&nbsp; <i>(Condition) ? Value-If-True : Value-If-False</i>&nbsp;&nbsp; I&#8217;m not going to get into a lesson on the ternary operator and you can certainly <a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.25">read more here</a>.</p>
<p>When using the ternary operator I had to repeat the variable something twice to do a simple check;&nbsp; This isn&#8217;t groovy and it definitely doesn&#8217;t lend itself to the principles of <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRY</a>!&nbsp; *Queue the <a href="http://groovy.codehaus.org/Operators#Operators-ElvisOperator(%3F%3A)">Elvis operator</a>*<br />
Instead of writing:&nbsp; <code>val = something ? something : defaultValue</code><br />
We write:&nbsp; <code>val = something ?: defaultValue</code></p>
<p>A more clear example would be as follows:</p>
<p><code>def rockstar<br />
def defaultrockstar = rockstar ?: &quot;Elvis Presley&quot;<br />
assert defaultrockstar == &quot;Elvis Presley&quot;</code></p>
<p>*Thank you <a href="http://satish.name/?p=16">Satish</a> for the example</p>
<p><a href="http://www.infoq.com/articles/groovy-1.5-new">InfoQ also has an excellent example</a> under the section Syntax Additions&nbsp; :: Elvis Operator.</p>
<p>It is nothing too special but It ends up being closer to how we think about code. Apparently the Elvis Operator <a href="http://www.infoq.com/articles/groovy-1.5-new">was added in Groovy 1.5</a> and is called the &#8216;Elvis Operator&#8217; due to its resemblance of Elvis&#8217;<!-- or rick's --> <a href="http://www.youtube.com/watch?v=Yu_moia-oVI#t=0m28s">trademark hair</a>.&nbsp;</p>
<p>I find the Elvis operator useful, but I still find myself frequently repeating myself when dealing with the same variable.</p>
<p><code>def rockstar</code><br />
<code>rockstar = rockstar ?: &quot;Elvis Presley&quot;</code></p>
<p>If we have gone this far with the Elvis Operator, why not go the extra step and introduce something like long-eyed-elvis ?= or call it the Rick Astley Operator</p>
<p><code>def rockstar</code><br />
<code>rockstar ?= &quot;Elvis Presley&quot;</code></p>
<p>This would be effectively the same as:</p>
<p><code>rockstar = rockstar ? rockstar : &quot;Elvis Presley&quot;</code> <br />
&nbsp;&nbsp;&nbsp;&nbsp; or <br />
<code>rockstar = rockstar ?: &quot;Elvis Presley&quot;<br />
</code></p>
<p>One more for Good measure &#8230; <code>rockstar</code>.</p>
<p>More Reading on the Elvis Operator:</p>
<ul>
<li><a href="http://maas-frensch.com/peter/2007/12/19/how-elvis-showed-me-a-neat-way-of-using-operators-in-ruby/">http://maas-frensch.com/peter/2007/12/19/how-elvis-showed-me-a-neat-way-of-using-operators-in-ruby/</a></li>
<li><a href="http://www.codecommit.com/blog/scala/implementing-groovys-elvis-operator-in-scala">http://www.codecommit.com/blog/scala/implementing-groovys-elvis-operator-in-scala</a></li>
<li><a href="http://jfkbits.blogspot.com/2008/02/call-by-name-yo-elvis.html">http://jfkbits.blogspot.com/2008/02/call-by-name-yo-elvis.html</a></li>
<li><a href="http://docs.codehaus.org/display/GROOVY/Operators">http://docs.codehaus.org/display/GROOVY/Operators</a></li>
</ul>
<p>?;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://colinharrington.net/blog/2008/10/groovy-elvis-operator/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Grails (Jetty) and crossdomain.xml</title>
		<link>http://colinharrington.net/blog/2008/07/grails-jetty-and-crossdomainxml/</link>
		<comments>http://colinharrington.net/blog/2008/07/grails-jetty-and-crossdomainxml/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 03:46:46 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Groovy-Grails]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Jetty]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://colinharrington.net/blog/index.php/2008/07/13/grails-jetty-and-crossdomainxml/</guid>
		<description><![CDATA[This last April I did a presentation at the Twin Cities Code Camp on Microsoft Silverlight and SOA with a Grails server.&#160; I ended up writing a simple Grails application that used several web services to communicate to an in-browser Silverlight application.&#160; I specifically wanted to show a Silverlight application interacting with non Microsoft Technologies.&#160; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://grails.org/"><img hspace="5" border="0" align="left" alt="Grails Logo" src="http://www.colinharrington.net/images/grails-128x128-icon.png" /></a>This last April I did a presentation at the<a href="http://www.twincitiescodecamp.com/TCCC/Default.aspx"> Twin Cities Code Camp</a> on <a href="http://colinharrington.net/blog/index.php/2008/04/14/microsoft-silverlight-and-soa/">Microsoft Silverlight and SOA with a Grails server</a>.&nbsp; I ended up writing a simple <a href="http://grails.org/">Grails</a> application that used several web services to communicate to an in-browser Silverlight application.&nbsp; I specifically wanted to show a Silverlight application interacting with non Microsoft Technologies.&nbsp; I developed the Grails application on Linux on a different physical machine than what I used to develop the Silverlight application.</p>
<p>One of the Issues I ran into was that I was unable to make requests to the XML Web Services in the Grails application.&nbsp; It puzzled me for a minute until a quick Google search turned up a simple issue: I needed a crossdomain.xml policy file (or the clientaccesspolicy.xml).&nbsp; Flash/Flex users run into this all the time and thus most of what you will find is Flash centric.&nbsp; What is the crossdomain.xml file?&nbsp; Well its a way of restricting the domains that can access services.&nbsp;  Its basically a white-listing of domains that are allowed to access the services.&nbsp; The browser and in-browser applications are supposed to respect the crossdomain.xml, and sometimes the Services (server-side) may protect themselves.&nbsp; You can think of it as a <a href="http://en.wikipedia.org/wiki/Robots.txt">robots.txt</a> for Web services.</p>
<p>Great, I knew what the problem was, now how do I fix it?&nbsp; I tried a few things, deploying to tomcat, but that didn&#8217;t work for me while I was actively developing the application.&nbsp; Once I understood a little more about Grails and Jetty, I realized that I could just modify the Jetty server that launched when invoking <code>grails run-app</code>.&nbsp; I simply had to add another context to Jetty, and bingo it worked.&nbsp; Here is what I did:</p>
<p>I found Grails&#8217; RunApp.groovy script (the one that gets invoked on <code>grails run-app</code>) which was located at $GRAILS_HOME\scripts\RunApp.groovy. (%GRAILS_HOME%\scripts\RunApp.groovy for you Windows folk <img alt="" src="http://colinharrington.net/blog/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/msn/shades_smile.gif" /> ).&nbsp; I had to simply create another context much like the Grails application context was being created.&nbsp; Here is a stripped down example of what RunApp.groovy looked like. (<b>modifications in Bold</b>)</p>
<p><code>::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::</code><br />
<code> /**<br />
&nbsp;* Gant script that executes Grails using an embedded Jetty server<br />
&nbsp;* <br />
&nbsp;* @author Graeme Rocher<br />
&nbsp;*<br />
&nbsp;* @since 0.4<br />
&nbsp;*/<br />
...<br />
grailsContext = null <br />
<b>rootContext = null</b><br />
...<br />
target( configureHttpServer : &quot;Returns a jetty server configured with an HTTP connector&quot;) {<br />
&nbsp;&nbsp;&nbsp; ...<br />
&nbsp;&nbsp;&nbsp; setupWebContext()<br />
&nbsp;&nbsp;&nbsp;<b> setupRootWebContext()</b><br />
&nbsp;&nbsp;&nbsp; server.setHandler( webContext )<br />
&nbsp;&nbsp;&nbsp; <b>server.addHandler( rootContext )</b><br />
&nbsp;&nbsp;&nbsp; ...<br />
}<br />
<b>target( setupRootWebContext: &quot;Sets up the Secondary Root Context&quot;){<br />
&nbsp;&nbsp;&nbsp; rootContext = new WebAppContext(&quot;${basedir}/web-app-root&quot;,&quot;/&quot;)<br />
}</b><br />
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::<br />
</code></p>
<p>Most of the magic is in the <i><code>rootContext = new WebAppContext(&quot;${basedir}/web-app-root&quot;,&quot;/&quot;</code></i><code><b>)</b></code> line.&nbsp; Notice that I had to create a new folder &#8216;web-app-root&#8217; which resided alongside web-app (I think I used web-app for a while too).&nbsp; So this context responds to everything in the &quot;/&quot; domain which is the root of the site.&nbsp; Once I put my crossdomain.xml file in that folder, I could access http://localhost:8080/crossdomain.xml and the services were then accesible via Silverlight &#8212; Yay!</p>
<p>I&#8217;m sure there are better ways of doing this, but this is what I did to get the job done.&nbsp; Thanks to <a href="http://www.jtict.com/blog/">JT Dev</a> for his <a href="http://www.jtict.com/blog/grails-jetty-multiple-contexts/">most recent post</a>, which reminded me that I was going to blog about this.&nbsp; I basically did Solution #2 in his <a href="http://www.jtict.com/blog/grails-jetty-multiple-contexts/">blog post on creating multiple jetty contexts</a>.&nbsp; Where was this post back in March?&nbsp; Thanks JT for tipping me off to the <a href="http://grails.org/Static+Resources+Plugin">Static Resources Plugin</a>!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://colinharrington.net/blog/2008/07/grails-jetty-and-crossdomainxml/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
