<?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>Armbruster IT Blog</title>
	<atom:link href="http://blog.armbruster-it.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.armbruster-it.de</link>
	<description>Real world fun with Java, Grails, Groovy, Zope, Plone, Linux and much others.</description>
	<lastBuildDate>Fri, 30 Jul 2010 17:09:46 +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>Grails Neo4j plugin 0.3 released</title>
		<link>http://blog.armbruster-it.de/2010/07/grails-neo4j-plugin-0-3-released/</link>
		<comments>http://blog.armbruster-it.de/2010/07/grails-neo4j-plugin-0-3-released/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 17:09:46 +0000</pubDate>
		<dc:creator>Stefan Armbruster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[neo4j]]></category>

		<guid isPermaLink="false">http://blog.armbruster-it.de/?p=159</guid>
		<description><![CDATA[Today I released an update of the Grails Neo4j plugin (http://www.grails.org/plugin/neo4j). The main changes are:

compatibility with Grails 1.3.x. Be aware, Grails 1.3 &#8211; 1.3.3 are suffering from http://jira.codehaus.org/browse/GRAILS-6427, so either use Grails 1.2.x, or be brave and use a recent git build of Grails 1.3.4.SNAPSHOT.
usage of Neo4j 1.1 (released today just a few hours ago, [...]]]></description>
			<content:encoded><![CDATA[<p>Today I released an update of the Grails Neo4j plugin (<a href="http://www.grails.org/plugin/neo4j">http://www.grails.org/plugin/neo4j</a>). The main changes are:</p>
<ul>
<li>compatibility with Grails 1.3.x. Be aware, Grails 1.3 &#8211; 1.3.3 are suffering from <a href="http://jira.codehaus.org/browse/GRAILS-6427">http://jira.codehaus.org/browse/GRAILS-6427</a>, so either use Grails 1.2.x, or be brave and use a recent git build of Grails 1.3.4.SNAPSHOT.</li>
<li>usage of Neo4j 1.1 (released today just a few hours ago, so get it while it&#8217;s hot).</li>
</ul>
<p>All changes:</p>
<ul>
<li>[GRAILSPLUGINS-2302] &#8211; &#8220;home&#8221; link broken in the org.codehaus.groovy.grails.plugins.neo4j.Neo4jController views</li>
<li>[GRAILSPLUGINS-2303] &#8211; Problems with annotation Neo4jEntity</li>
<li>[GRAILSPLUGINS-2345] &#8211; upgrade to Neo4j 1.1</li>
<li>[GRAILSPLUGINS-2346] &#8211; &lt;domainclass&gt;.get() throws exception if id is not invalid</li>
<li>[GRAILSPLUGINS-2347] &#8211; &lt;domainClass&gt;.findAllBy&lt;Field&gt;(value) fails</li>
<li>[GRAILSPLUGINS-2349] &#8211; provide compatibility for Grails 1.3.x</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.armbruster-it.de/2010/07/grails-neo4j-plugin-0-3-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>getting a list of all i18n properties used in a Grails application</title>
		<link>http://blog.armbruster-it.de/2010/07/getting-a-list-of-all-i18n-properties-used-in-a-grails-application/</link>
		<comments>http://blog.armbruster-it.de/2010/07/getting-a-list-of-all-i18n-properties-used-in-a-grails-application/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 19:43:45 +0000</pubDate>
		<dc:creator>Stefan Armbruster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[i18n]]></category>

		<guid isPermaLink="false">http://blog.armbruster-it.de/?p=152</guid>
		<description><![CDATA[You might know this situation: in a project you start by hacking code that uses i18n properties instead of fixed strings in order to support multiple languages. The normal process in Grails is to use the g:message tag in controllers or gsp templates. Side by side you append the new introduced i18n property with some [...]]]></description>
			<content:encoded><![CDATA[<p>You might know this situation: in a project you start by hacking code that uses i18n properties instead of fixed strings in order to support multiple languages. The normal process in Grails is to use the <a href="http://grails.org/doc/latest/ref/Tags/message.html">g:message</a> tag in controllers or gsp templates. Side by side you append the new introduced i18n property with some value in your messsages.properties file.</p>
<p>When support for a new language is requested, all you have to do is translating messages.properties. So far so good &#8211; this make i18n really easy.</p>
<p>But: when the project evolves, there&#8217;s a good chance that some of your i18n properties in messages.properties gets orphaned. Assume you remove a block of code from a gsp. It happens often that the i18n properties used in this block are not removed from messages*.properties because at some point you are not sure if it is referenced elsewhere. So what would be really useful here would be a list of all referenced i18n properties from your *.groovy/*.gsp files.</p>
<p>Doing so is pretty easy, just add a new <a href="http://grails.org/doc/latest/guide/4.%20The%20Command%20Line.html">gant script</a> to your Grails application&#8217;s script folder, let&#8217;s name it i18nList.groovy. This script basically contains:</p>

<div class="wp_syntax"><div class="code"><pre class="groovy" style="font-family:monospace;">includeTargets <span style="color: #66cc66;">&lt;&lt;</span> grailsScript<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Init&quot;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
target<span style="color: #66cc66;">&#40;</span>main: <span style="color: #ff0000;">&quot;create a list of all i18n properties used in groovy code and gsp templates&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">def</span> properties <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #aaaadd; font-weight: bold;">File</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #FFCC33;">eachFileRecurse</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>it.<span style="color: #006600;">file</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span>it<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #b1b100;">case</span> ~/.<span style="color: #66cc66;">*</span>\.<span style="color: #006600;">groovy</span>/:
                    <span style="color: #000000; font-weight: bold;">def</span> matcher <span style="color: #66cc66;">=</span> it.<span style="color: #006600;">text</span> <span style="color: #66cc66;">=</span>~ /code:\s<span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;'](.*?)[&quot;</span><span style="color: #ff0000;">']/
                    matcher.each { properties &lt;&lt; it[1] }
                    break
                case ~/.*<span style="color: #000099; font-weight: bold;">\.</span>gsp/:
                    def matcher = it.text =~ /code=[&quot;'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span>.<span style="color: #66cc66;">*?</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;']/
                    matcher.each { properties &lt;&lt; it[1] }
                    break
            }
        }
    }
    println properties.sort().unique().join(&quot;</span>\n<span style="color: #ff0000;">&quot;)
&nbsp;
}
&nbsp;
setDefaultTarget(main)</span></pre></div></div>

<p>(sorry the color coding seems to fail for some Groovy regexes) The script recursivly iterates over all *.groovy and *.gsp files in your project and extract the part after the &#8216;code&#8217; attribute of the message tag using a regex. The regex result are collected into an array. This array is sorted, unique&#8217;d and printed to the console. That&#8217;s it.</p>
<p>One word of caution: this gant script &#8216;works for me&#8217;. So depending on your code, you might notice that the used regex are not sufficient or even fail. Feel free to modify them for your needs, even better send back your modifications.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.armbruster-it.de/2010/07/getting-a-list-of-all-i18n-properties-used-in-a-grails-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grails Webdav Plugin 0.3 released</title>
		<link>http://blog.armbruster-it.de/2010/05/grails-webdav-plugin-0-3-released/</link>
		<comments>http://blog.armbruster-it.de/2010/05/grails-webdav-plugin-0-3-released/#comments</comments>
		<pubDate>Sun, 30 May 2010 21:30:05 +0000</pubDate>
		<dc:creator>Stefan Armbruster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[webdav]]></category>

		<guid isPermaLink="false">http://blog.armbruster-it.de/?p=148</guid>
		<description><![CDATA[Today I&#8217;ve released a minor update to the Grails Webdav plugin. Compared with the previous version a few bugs have been fixed.
]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve released a minor update to the <a href="http://www.grails.org/plugin/webdav">Grails Webdav plugin</a>. Compared with the previous version <a href="http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=11450&amp;version=15610">a few bugs have been fixed</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.armbruster-it.de/2010/05/grails-webdav-plugin-0-3-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>new Grails plugin released: modproxybalancer</title>
		<link>http://blog.armbruster-it.de/2010/05/new-grails-plugin-released-modproxybalancer/</link>
		<comments>http://blog.armbruster-it.de/2010/05/new-grails-plugin-released-modproxybalancer/#comments</comments>
		<pubDate>Tue, 25 May 2010 12:18:31 +0000</pubDate>
		<dc:creator>Stefan Armbruster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[loadbalancing]]></category>

		<guid isPermaLink="false">http://blog.armbruster-it.de/?p=143</guid>
		<description><![CDATA[Last week I attended the gr8conf, a really great conference. One of my favorite event was the Hackergarden. In the evening after the regular talks ~30+ people came together (should I call them nerds?), split up into small groups and did some hacking on Groovy &#38; Grails related topics. I found myself together with Davide [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I attended the <a href="http://eu.gr8conf.org">gr8conf</a>, a really great conference. One of my favorite event was the Hackergarden. In the evening after the regular talks ~30+ people came together (should I call them nerds?), split up into small groups and did some hacking on Groovy &amp; Grails related topics. I found myself together with Davide Rossi to do some coding on deploying a Grails application to multiple tomcat nodes and manage a loadbalancer in front of them. The original goal was to finish the task at end of evening. Unfortunately we set our goal too high, and did not manage to release some code at that evening. During the last weekend I took some time to finish this and did a <a href="http://grails.org/plugin/modproxybalancer">release today</a>.</p>
<p><a href="http://grails.org/plugin/modproxybalancer">This plugin</a>&#8217;s goal is to simplify the deployment of a grails application  to a cluster consisting of multiple tomcat instances and an Apache httpd mod_proxy_balancer.</p>
<p>It assumes  you have an <a href="http://httpd.apache.org/docs/2.1/mod/mod_proxy_balancer.html" target="blank">Apache mod_proxy_balancer</a> running in front of  multiple tomcat instances in order to provide a) high-availability and b) load-balancing to your Grails  application. In such a scenario, upgrading the running application to a newer release is painful and error-prone when done manually. This plugin&#8217;s goal is to  simplify that procedure by performing a &#8220;rolling upgrade&#8221;. Calling &#8216;grails tomcat redeploy&#8217; performs these  actions:</p>
<ol>
<li>take first node offline in loadbalancer</li>
<li>undeploy app on first tomcat node</li>
<li>deploy app on first tomcat node</li>
<li>check if app responds on first tomcat node</li>
<li>take first node online in loadbalancer</li>
<li>proceed the same procedure with next node</li>
</ol>
<p>To solve this, we&#8217;ve forked the 1.3.1 release of the tomcat plugin an added the following capabilities:</p>
<ol>
<li>deploying to multiple hosts and</li>
<li>emitting lifecycle events: PreDeploy, PostDeploy, PreUndeploy,  PostUndeploy</li>
<li>provide support for &#8216;grails tomcat redeploy&#8217;</li>
</ol>
<p>These changes have been included in a pull request to the upstream plugin, so I&#8217;m hoping they will find their way into Grails 1.3.2.</p>
<p>The rest of the work has been put into the modproxybalancer plugin, taking care of remote controlling the loadbalancer  by catching up these events. mod_proxy_balancer comes  with a simple management frontend called balancer-manager. This consists of  some simple HTML forms that can be easily triggered using htmlunit. When the forked tomcat plugin emits a &#8220;PreUndeploy&#8221; event, the loadbalancer disables the respective tomcat node, then a normal undeploy und deploy happens. After this, the freshly deployed tomcat is checked for availablity and taken back online in the loadbalancer.</p>
<p>The  plugin is licensend under the <a href="http://sam.zoy.org/wtfpl/" target="blank">WTFPL.</a></p>
<p>Side note: this is my first Grails plugin with it&#8217;s <a href="http://github.com/sarmbruster/grails-modproxybalancer-plugin">sources</a> residing on github.com. Thanks to <a href="http://www.cacoethes.co.uk/blog/groovyandgrails/github-pages-publish-your-grails-plugin-docs">Peter Ledbrook&#8217;s excellent blog post</a>, I was able to use GitHub pages for the documentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.armbruster-it.de/2010/05/new-grails-plugin-released-modproxybalancer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>restrict a Grails controller to localhost access only</title>
		<link>http://blog.armbruster-it.de/2010/04/restrict-a-grails-controller-to-localhost-access-only/</link>
		<comments>http://blog.armbruster-it.de/2010/04/restrict-a-grails-controller-to-localhost-access-only/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 13:47:38 +0000</pubDate>
		<dc:creator>Stefan Armbruster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://blog.armbruster-it.de/?p=137</guid>
		<description><![CDATA[A common requirement for many web applications is that some parts (aka controllers) should only be accessible from specifc ip addresses. Typically controllers doing some administrative or maintenance work must be protected from non-authroized access. The most complete solution for this is using a full blown security framework like the Grails Acegi plugin. But there&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>A common requirement for many web applications is that some parts (aka controllers) should only be accessible from specifc ip addresses. Typically controllers doing some administrative or maintenance work must be protected from non-authroized access. The most complete solution for this is using a full blown security framework like the <a href="http://www.grails.org/plugin/acegi">Grails Acegi plugin</a>. But there&#8217;s also a lean and quick solution for this in Grails: use a <a href="http://www.grails.org/doc/latest/guide/6.%20The%20Web%20Layer.html#6.1.5%20Controller%20Interceptors">controller interceptor</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">def</span> beforeInterceptor <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#123;</span>
   <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;127.0.0.1&quot;</span>, <span style="color: #ff0000;">&quot;0:0:0:0:0:0:0:1&quot;</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #CC0099;">contains</span><span style="color: #66cc66;">&#40;</span>request.<span style="color: #006600;">remoteAddr</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      render<span style="color: #66cc66;">&#40;</span>status: <span style="color: #cc66cc;">401</span>, text: <span style="color: #ff0000;">'Access limited to localhost'</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">false</span>
   <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Grails calls the beforeIntereceptor closure prior every action in a controller. Only if it returns true, the action is executed. In the code above if the client has a non-local IP address, a 401 error is returned with an error message. Note that localhost in IPv6 is 0:0:0:0:0:0:0:1, so it work both in IPv4 and IPv6 networks.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.armbruster-it.de/2010/04/restrict-a-grails-controller-to-localhost-access-only/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Grails Neo4j plugin 0.2.1 released</title>
		<link>http://blog.armbruster-it.de/2010/04/grails-neo4j-plugin-0-2-1-released/</link>
		<comments>http://blog.armbruster-it.de/2010/04/grails-neo4j-plugin-0-2-1-released/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 10:08:11 +0000</pubDate>
		<dc:creator>Stefan Armbruster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[neo4j]]></category>

		<guid isPermaLink="false">http://blog.armbruster-it.de/?p=130</guid>
		<description><![CDATA[Today I released a minor update of the Grails Neo4j plugin. The changes are:

performance improvement by no longer calling map constructor in createInstanceForNode
fixed transaction handling by replacing interceptor with a &#8220;real&#8221; servlet filter
support for primitve arrays as properties in domain classes
bugfix: handling of bidirectional many-to-many relationships
bugfix: setProperties does no longer null out properties that have [...]]]></description>
			<content:encoded><![CDATA[<p>Today I released a minor update of the <a href="http://www.grails.org/plugin/neo4j">Grails Neo4j plugin</a>. The changes are:</p>
<ul>
<li>performance improvement by no longer calling map constructor in createInstanceForNode</li>
<li>fixed transaction handling by replacing interceptor with a &#8220;real&#8221; servlet filter</li>
<li>support for primitve arrays as properties in domain classes</li>
<li>bugfix: handling of bidirectional many-to-many relationships</li>
<li>bugfix: setProperties does no longer null out properties that have not been set</li>
<li>support for encodeAsXXXX methods from CodecsGrailsPlugin. In previous versions encoding did not work, since the &#8216;node&#8217;<br />
property of the domain classes could not be encoded (it&#8217;s a neo4j internal class!). Workaround: add getNode()==null method<br />
in AST transformation.</li>
</ul>
<p>Everyone using the 0.2 release is recommended to upgrade.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.armbruster-it.de/2010/04/grails-neo4j-plugin-0-2-1-released/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>remove the passphrase from a pkcs12 certificate</title>
		<link>http://blog.armbruster-it.de/2010/03/remove-the-passphrase-from-a-pkcs12-certificate/</link>
		<comments>http://blog.armbruster-it.de/2010/03/remove-the-passphrase-from-a-pkcs12-certificate/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 10:38:28 +0000</pubDate>
		<dc:creator>Stefan Armbruster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[openvpn]]></category>
		<category><![CDATA[pkcs12]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.armbruster-it.de/?p=126</guid>
		<description><![CDATA[PKCS12 defines a file format that contains a private key an a associated certifcate. These files might be used to establish some encrypted data exchange. In the current use case, OpenVPN is used to connect to a remote network. The pkcs12 is being issued by a CA (certificat authority) tool. For security reasons, the private [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://de.wikipedia.org/wiki/PKCS">PKCS12</a> defines a file format that contains a private key an a associated certifcate. These files might be used to establish some encrypted data exchange. In the current use case, <a href="http://openvpn.net/">OpenVPN</a> is used to connect to a remote network. The pkcs12 is being issued by a CA (certificat authority) tool. For security reasons, the private key contained in the pkcs12 is normally protected by a passphrase. This has the downside, that you need to manually type the passphrase whenever you need to establish the connection. But there&#8217;s a way to get around this. <a href="http://www.openssl.org/">OpenSSL</a> is a swiss-army-knife toolkit for managing simply everything in the field of keys and certificates. Since it&#8217;s a command line tool, you need to understand what you&#8217;re doing. So it took me a little to figure out how to remove a passphrase from a given pkcs12 file. Here&#8217;s what I&#8217;ve done:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl pkcs12 <span style="color: #660033;">-in</span> protected.p12.orig <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-out</span> temp.pem
&nbsp;
openssl pkcs12 <span style="color: #660033;">-export</span> <span style="color: #660033;">-in</span> temp.pem  <span style="color: #660033;">-out</span> unprotected.p12
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> temp.pem</pre></div></div>

<p>The first command decrypts the original pkcs12 into a temporary pem file. pem is a base64 encoded format. The second command picks this up and constructs a new pkcs12 file. During this, the new passphrase is asked. By simply typing &#8216;return&#8217; here, it set to nothing. When using unprotected.p12 in the OpenVPN connection, you&#8217;re no longer asked for a passphrase.</p>
<p><strong>A word of warning:</strong> I do not recommend doing this generally. From my perspective it&#8217;s okay, if your unprotected pkcs12 file is protected by other means, e.g. harddisc encryption.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.armbruster-it.de/2010/03/remove-the-passphrase-from-a-pkcs12-certificate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>running Groovy on the Nokia N900</title>
		<link>http://blog.armbruster-it.de/2010/03/running-groovy-on-the-nokia-n900/</link>
		<comments>http://blog.armbruster-it.de/2010/03/running-groovy-on-the-nokia-n900/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 16:08:48 +0000</pubDate>
		<dc:creator>Stefan Armbruster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[n900]]></category>

		<guid isPermaLink="false">http://blog.armbruster-it.de/?p=115</guid>
		<description><![CDATA[My favorite gadget for the last few months is definitely the Nokia N900. It&#8217;s a geeky device with a real Linux OS aboard. In opposite to it&#8217;s locked down competitors, the N900 runs Maemo, a platform consisting (mostly) of open source software. So I wonder if it&#8217;s possible to use Groovy on that. And yes, [...]]]></description>
			<content:encoded><![CDATA[<p>My favorite gadget for the last few months is definitely the <a href="http://www.nokia.de/produkte/mobiltelefone/nokia-n900">Nokia N900</a>. It&#8217;s a geeky device with a real Linux OS aboard. In opposite to it&#8217;s locked down competitors, the N900 runs <a href="http://www.maemo.org">Maemo</a>, a platform consisting (mostly) of open source software. So I wonder if it&#8217;s possible to use Groovy on that. And yes, it is possible!<span id="more-115"></span>Unfortunately the Maemo platform doesn&#8217;t contain a JVM by itself. Some days ago, I saw a <a href="http://twitter.com/ahynes1/statuses/10722426299">tweet</a> that there a <a href="http://mint.camswl.com/openjdk.htm">OpenJDK port for ARM</a>. All you have to do, is downloading the JDK and JRE from <a href="http://mint.camswl.com/openjdk/release.htm">this page</a>, bunzip it and move the directory to the N900. The next step is downloading <a href="http://groovy.codehaus.org/Download">Groovy</a> and setting the envionment variables</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">JAVA_HOME</span>=<span style="color: #000000; font-weight: bold;">&lt;</span>jdk-dir<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GROOVY_HOME</span>=<span style="color: #000000; font-weight: bold;">&lt;</span>groovy-dir<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #007800;">$GROOVY_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #007800;">$PATH</span></pre></div></div>

<p>With that, it&#8217;s possible to run all the stuff in $GROOVY_HOME/bin, e.g. the groovyConsole on the N900. It terribly slow, the groovyConsole takes abount 60 secs to come up, the keyboard has a very long lag when typing &#8211; but it works!</p>
<p><a href="http://blog.armbruster-it.de/wp-content/uploads/2010/03/Screenshot-20100321-163332.png"><img class="alignnone size-full wp-image-120" title="groovyConsole on Nokia N900" src="http://blog.armbruster-it.de/wp-content/uploads/2010/03/Screenshot-20100321-163332.png" alt="groovyConsole on Nokia N900" width="560" height="336" /></a></p>
<p>Anyone else got a &#8216;groovy&#8217; smartphone?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.armbruster-it.de/2010/03/running-groovy-on-the-nokia-n900/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Grails Neo4j plugin 0.2 released</title>
		<link>http://blog.armbruster-it.de/2010/03/grails-neo4j-plugin-0-2-released/</link>
		<comments>http://blog.armbruster-it.de/2010/03/grails-neo4j-plugin-0-2-released/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 16:15:22 +0000</pubDate>
		<dc:creator>Stefan Armbruster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[neo4j]]></category>

		<guid isPermaLink="false">http://blog.armbruster-it.de/?p=87</guid>
		<description><![CDATA[Today an important update of the Grails Neo4j plugin has been released. Neo4j is a graph database, it&#8217;s main concepts are described in brevity in a previous post.  The plugin provides a convenient way to use Neo4j as a persistence layer for Grails domain classes.
The key features / changes of this release are:

domain classes managed [...]]]></description>
			<content:encoded><![CDATA[<p>Today an important update of the <a href="http://www.grails.org/plugin/neo4j">Grails Neo4j plugin</a> has been released. <a href="http://www.neo4j.org">Neo4j</a> is a graph database, it&#8217;s main concepts are described in brevity in a <a href="http://blog.armbruster-it.de/2009/10/neo4j-grails-plugin/">previous post</a>.  The plugin provides a convenient way to use Neo4j as a persistence layer for Grails domain classes.</p>
<p>The key features / changes of this release are:</p>
<ul>
<li>domain classes managed by Neo4j can now co-existing with traditional domain classes (aka mapped by Hibernate)</li>
<li>Upgrade to Neo4j 1.0</li>
<li>usage of Grails dependency resolution instead of embedding the jars in /lib directory</li>
<li>added a seperate controller to inspect the Neo4j node space</li>
<li>major refactoring using AST transformation, just like in the couchdb plugin</li>
<li>support for the <a href="http://components.neo4j.org/index-util/">Neo4j indexer</a></li>
<li>support for non-declared properties</li>
<li>support for traversers</li>
</ul>
<p><span id="more-87"></span>In more detail:</p>
<h2>Co-existence with other domain implementations</h2>
<p>In the initial 0.1 release there was no possibility to have hibernate-based domain classes and neo4j-bases domain classes within the same application. By massively learning from the implementation of the <a href="http://www.grails.org/plugin/gorm-couchdb">CouchDB plugin</a>, the neo4j plugin shares now the same principles:</p>
<ul>
<li>each domain class annotated with &#8220;@Neo4jEntity&#8221; is managed by Neo4j</li>
<li>the @Neo4jEntity  annotation triggers a <a href="http://groovy.codehaus.org/Local+AST+Transformations">Groovy AST transformation</a> at compile time. This transformation e.g. injects a reference to the Neo4j node instance in each domain class.</li>
<li>the plugin class delegates most of its work to a singleton-style plugin support class</li>
<li>the plugin support class uses Groovy MOP to inject (most of) the GORM methods into the domain classes</li>
</ul>
<h2>Upgrade to Neo4j 1.0</h2>
<p>About two weeks ago, the Neo4j team released their 1.0 version. In order to keep pace, the 0.2 version of the plugin upgrades to this version.</p>
<h2>Using dependency resolution</h2>
<p>In its recent versions Grails provides a powerful <a href="http://grails.org/doc/latest/guide/3.%20Configuration.html#3.7%20Dependency%20Resolution">dependency resolution DSL</a>. Using this feature, the Neo4j plugin does not contain the neo4j jars itself any longer. Instead they are automatically downloaded upon plugin installation from the Neo4j&#8217;s maven repository.</p>
<h2>Controller for visualizing the node space</h2>
<p>The plugin contains a Neo4jController that provides an easy way to inspect and walk through the nodespace. All the properties and relationships are visible and navigable, see the screenshot. <a href="http://blog.armbruster-it.de/wp-content/uploads/2010/03/Bildschirmfoto-explore-node-space-Mozilla-Firefox.png"><img class="alignnone size-full wp-image-90" title="Screenshot Neo4jController" src="http://blog.armbruster-it.de/wp-content/uploads/2010/03/Bildschirmfoto-explore-node-space-Mozilla-Firefox.png" alt="Screenshot Neo4jController" width="718" height="436" /></a></p>
<p>Aside from navigating through the nodespace, the Neo4jController also provides an action for viewing some statistics: counting nodes an relationship by type, and an inspector for viewing the Grails domain class structure. One word of warning: <strong>do not expose this controller to the public!</strong> Instead use e.g. the acegi plugin and protect it from public access.</p>
<h2>Support for Neo4j Indexer</h2>
<p>Since there is no easy way to ask the nodespace questions like &#8220;Give me all cars with more than 250 hp?&#8221;, Neo4j provides an <a href="http://components.neo4j.org/index-util/">addon</a> that indexes property values. The plugin supports this in two ways:</p>
<ul>
<li>Defining index properties in a domain class by annotating the properties to be indexed with @Neo4jIndexed</li>
<li>Using the indexer when the GORM methods &#8216;findBy&lt;prop&gt;&#8217; or &#8216;findAllBy&lt;prop&gt;&#8217; are called on an indexed property</li>
</ul>
<p>The following code example will make that clearer:</p>

<div class="wp_syntax"><div class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">grails.plugins.neo4j.*</span>
@Neo4jEntity
<span style="color: #000000; font-weight: bold;">class</span> Car <span style="color: #66cc66;">&#123;</span>
   <span style="color: #aaaadd; font-weight: bold;">String</span> licenseTag <span style="color: #808080; font-style: italic;">// normal, aka non-indexed property</span>
   @Neo4jIndex
   <span style="color: #aaaadd; font-weight: bold;">String</span> color  <span style="color: #808080; font-style: italic;">// indexed property</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h2>Support for non-declared properties</h2>
<p>Since Neo4j is a schema-less database, there is no limitation on what properties are allowed for a certain node. A Grails domain model is much more strict on this. To fill this gap, the plugin supports non-declared properties:</p>

<div class="wp_syntax"><div class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">def</span> car <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Car<span style="color: #66cc66;">&#40;</span>licenseTag:<span style="color: #ff0000;">'ABC123'</span>, color:<span style="color: #ff0000;">'red'</span><span style="color: #66cc66;">&#41;</span>
car.<span style="color: #006600;">save</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #000000; font-weight: bold;">assert</span> <span style="color: #ff0000;">'red'</span> <span style="color: #66cc66;">==</span> car.<span style="color: #006600;">color</span> <span style="color: #808080; font-style: italic;">// declared property</span>
<span style="color: #000000; font-weight: bold;">assert</span> <span style="color: #000000; font-weight: bold;">null</span> <span style="color: #66cc66;">=</span> car.<span style="color: #006600;">numberOfSeats</span> <span style="color: #808080; font-style: italic;">// N.B: numberOfSeats is _not_ declared</span>
car.<span style="color: #006600;">numberOfSeats</span> <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">5</span>
<span style="color: #000000; font-weight: bold;">assert</span> <span style="color: #ff0000;">'5'</span> <span style="color: #66cc66;">==</span> car.<span style="color: #006600;">numberOfSeats</span></pre></div></div>

<p>Using non-declared properties has one limitation: since there&#8217;s no type information available, they are stored as String. That&#8217;s why the last assert need &#8216;5&#8242; in quotes.</p>
<h2>Support for traversers</h2>
<p>A very powerful method to search and find nodes in the nodespace are <a href="http://wiki.neo4j.org/content/Design_Guide#Searching_using_traversing">traversers</a>. The plugin supports them on two levels:</p>
<ul>
<li>static:  DomainClass.traverse uses the reference node as starting point and</li>
<li>instance: &lt;domainClassInstance&gt;.traverse uses the domainClassInstance as starting point.</li>
</ul>
<p>Both variants come with some overloaded implementations:</p>

<div class="wp_syntax"><div class="code"><pre class="groovy" style="font-family:monospace;">traverse<span style="color: #66cc66;">&#40;</span>StopEvaluator stopEvaluator, ReturnableEvaluator returnableEvaluator, <span style="color: #aaaadd; font-weight: bold;">Object</span>... <span style="color: #006600;">args</span><span style="color: #66cc66;">&#41;</span>
traverse<span style="color: #66cc66;">&#40;</span>Traverser.<span style="color: #006600;">Order</span> order, StopEvaluator stopEvaluator, ReturnableEvaluator returnableEvaluator, <span style="color: #aaaadd; font-weight: bold;">Object</span>... <span style="color: #006600;">args</span><span style="color: #66cc66;">&#41;</span>
traverse<span style="color: #66cc66;">&#40;</span>Closure stopEvaluator, Closure returnableEvaluator, <span style="color: #aaaadd; font-weight: bold;">Object</span>... <span style="color: #006600;">arg</span><span style="color: #66cc66;">&#41;</span>
traverse<span style="color: #66cc66;">&#40;</span>Traverser.<span style="color: #006600;">Order</span> order, Closure stopEvaluator, Closure returnableEvaluator, <span style="color: #aaaadd; font-weight: bold;">Object</span>... <span style="color: #006600;">args</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Note that StopEvaluators and ReturnableEvaluator might be coded in a <a href="http://groovy.codehaus.org/Groovy+way+to+implement+interfaces">&#8216;groovy&#8217; way as closures</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">def</span> traverser <span style="color: #66cc66;">=</span> car.<span style="color: #006600;">traverse</span><span style="color: #66cc66;">&#40;</span>
 <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #66cc66;">&#125;</span>,  <span style="color: #808080; font-style: italic;">// StopEvaluator</span>
 <span style="color: #66cc66;">&#123;</span> it.<span style="color: #006600;">currentNode</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;color&quot;</span>,<span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">==</span><span style="color: #ff0000;">&quot;red&quot;</span><span style="color: #66cc66;">&#125;</span> <span style="color: #808080; font-style: italic;">// ReturnableEvaluator</span>
<span style="color: #66cc66;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.armbruster-it.de/2010/03/grails-neo4j-plugin-0-2-released/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>syncing PIM data between Thunderbird Funambol and a Nokia N900 using Funambol</title>
		<link>http://blog.armbruster-it.de/2010/01/syncing-pim-data-between-thunderbird-funambol-and-a-nokia-n900-using-funambol/</link>
		<comments>http://blog.armbruster-it.de/2010/01/syncing-pim-data-between-thunderbird-funambol-and-a-nokia-n900-using-funambol/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 22:01:12 +0000</pubDate>
		<dc:creator>Stefan Armbruster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[funambol]]></category>
		<category><![CDATA[n900]]></category>
		<category><![CDATA[sync]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://blog.armbruster-it.de/?p=69</guid>
		<description><![CDATA[Since about 1 month I&#8217;m a proud owner of a Nokia N900. This gadget is really impressive, combining powerful hardware with a open source based operating system. Since it&#8217;s the very first Meamo based phone out there, it&#8217;s obvious that not everything is perfect for now.
One thing I have been struggling with is synchronizing my [...]]]></description>
			<content:encoded><![CDATA[<p>Since about 1 month I&#8217;m a proud owner of a Nokia N900. This gadget is really impressive, combining powerful hardware with a open source based operating system. Since it&#8217;s the very first Meamo based phone out there, it&#8217;s obvious that not everything is perfect for now.</p>
<p>One thing I have been struggling with is synchronizing my PIM data. On the notebook or desktop computer I&#8217;m using thunderbird together with the lightning extension (and some other useful addons) holding my contact and calendar data. This stuff should be synced to and from the N900.</p>
<p>The N900&#8217;s default solution for syncing is Nokia&#8217;s PC suite. Since I&#8217;m on Linux, this is no option at all. I tried to use Opensync &#8211; without succeeding. A few days ago the <a href="http://internettabletblog.de/">InternetTabletBlog</a> published a great german <a href="http://internettabletblog.de/2009/12/30/synchronisationsgeschichten-4-dem-n900-syncml-beibringen-mit-hilfe-von-syncevolution/">article</a> on syncing the N900 against <a href="http://scheduleworld.com/sw2/index.html">ScheduleWorld.com</a>. Using this information, it was pretty simple to adopt the procedure to work with <a href="http://www.funambol.org">Funambol</a>.</p>
<h2>Setting up Funambol</h2>
<p>The installation procedure of the Funambol server is very well <a href="http://download.forge.objectweb.org/sync4j/funambol-installation-and-administration-guide.pdf">documented</a>, so I&#8217;ll cover here only the main steps without going into detail.</p>
<ul>
<li>Download the Funambol Server from <a href="https://www.forge.funambol.org/download/">https://www.forge.funambol.org/download/</a></li>
<li>sudo sh ./funambol-8.0.2.bin installs the server software by default to /opt/Funambol</li>
<li>startup the server: /opt/Funambol/bin/funambol start</li>
<li>Using funambol&#8217;s admin tool, set the server&#8217;s URL to a reasonable value</li>
<li>check if http://&lt;servername&gt;:8080/funambol/ds return a page like this:
<pre>Funambol Data Synchronization Server v.8.0.1

Man=Funambol
Mod=DS Server
SwV=8.0.1
HwV=-
FwV=-
OEM=-
DevID=funambol
DevTyp=server
VerDTD=1.2
UTC=true
SupportLargeObjs=true
SupportNumberOfChanges=true
Ext=X-funambol-smartslow</pre>
</li>
</ul>
<h2>Setup thunderbird</h2>
<ul>
<li>Install Funambol Mozilla Sync Client and configure it to use the URL from the previous step.</li>
<li>Provide an arbitrary login and password, Funambol adds an user accout automatically.</li>
<li>Run the sync, your PIM data should now be copied to the Funambol server</li>
<li>Check if data was transferred by logging into http://&lt;yourserver&gt;:8080/funambol/webdemo</li>
</ul>
<h2>Configuring the N900</h2>
<p>This is described in detail <a href="http://internettabletblog.de/2009/12/30/synchronisationsgeschichten-4-dem-n900-syncml-beibringen-mit-hilfe-von-syncevolution/">here</a>, so I&#8217;ll just repeat the main steps:</p>
<ul>
<li>install <a href="http://syncevolution.org/">syncevoltion</a> from <a href="http://people.debian.org/~ovek/maemo/syncevolution_0.9.1-0_armel.deb">http://people.debian.org/~ovek/maemo/syncevolution_0.9.1-0_armel.deb</a></li>
<li>create a syncevoltion profile:
<pre>syncevolution -c Funambol</pre>
</li>
<li>edit the config file of the created profile to match your setup:
<pre>leafpad /home/user/.config/syncevolution/Funambol/config.ini</pre>
</li>
<li>run the sync:
<pre>syncevolution Funambol</pre>
</li>
</ul>
<p>&#8230; and hopefully your done.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.armbruster-it.de/2010/01/syncing-pim-data-between-thunderbird-funambol-and-a-nokia-n900-using-funambol/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
