<?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>Code3</title>
	<atom:link href="http://www.code3.dk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.code3.dk</link>
	<description>Techchat</description>
	<lastBuildDate>Fri, 12 Feb 2010 09:06:30 +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>Creating, consuming and testing SOAP webservices on Grails</title>
		<link>http://www.code3.dk/creating-consuming-and-testing-soap-webservices-on-grails/</link>
		<comments>http://www.code3.dk/creating-consuming-and-testing-soap-webservices-on-grails/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 09:05:14 +0000</pubDate>
		<dc:creator>AN</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[SOAP]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=341</guid>
		<description><![CDATA[We are currently making a backend system, that has its services exposed as webservices. Since making web applications in Grails [...]]]></description>
			<content:encoded><![CDATA[<p>We are currently making a backend system, that has its services exposed as webservices. Since making web applications in Grails is pretty nice, we decided to try it for webservices.</p>
<p>Getting up and running was certainly a breeze.</p>
<p><code><br />
grails create-app ...<br />
grails install-plugin cxf<br />
</code></p>
<p>Grails is a plugin-based framework. And the <a href="http://grails.org/plugin/cxf/">cxf plugin</a> seems to be the best plugin for webservices right now. Exposing the services was then as simple as adding a</p>
<p><code>static expose=['cxf']</code></p>
<p>to the the grails service classes. We wante to allow our service interfaces to operate with complex objects. And to do that best we decided to use the <a href="http://www.grails.org/plugin/dto">DTO plugin</a> and specify our interfaces in terms of DTOs mostly generated from our domain objects. This was only a semi-good idea, I think, as the conversion to/from complex domain objects was not great out of the box (more on that in another post).</p>
<p>To consume webservices, the most straighforward way is to simply dump the <a href="http://groovy.codehaus.org/GroovyWS+installation">minimal jar of the GroovyWS module</a> in the lib folder of the project. Since we already had all the dependencies included by the cxf plugin the minimal jar is all that is needed.</p>
<p>To test the services, most of our test were simply the usual integration tests of the service classes. But for functional tests we used the <a href="http://www.grails.org/plugin/functional-test">functional-tests plugin</a> and the GroovyWS client we already had installed. </p>
<pre class="brush: java">
class MyServiceFunctionalTests extends functionaltestplugin.FunctionalTestCase {

	def myServicePort

	protected void setUp() {
		super.setUp();

		myServicePort = new WSClient(&quot;http://localhost:9091/myservice/services/my?wsdl&quot;, this.class.classLoader)
		myServicePort.initialize()
	}

	public void testAMethod(){
		final List resultVals = myServicePort.aMethod();

		assertEquals(4, resultVals.size());
	}
}
</pre>
<p>It feels a bit wrong to work with old and crufty technology like SOAP with shiny new technology like Groovy on Grails. But with that in mind it works surprisingly well. Points where I found the greatest room for improvement were.</p>
<ul>
<li>Grails has great support for Controllers as entrypoints, with interceptors for logging and authorization. For Services this seems harder if not impossible. I haven&#8217;t succeeded in using either groovys <a href="http://groovy.codehaus.org/Using+invokeMethod+and+getProperty">invokeMethod</a> or the built-in spring support for aspect-oriented-programing.</li>
<li>As mentioned above, the DTO plugin could use a more flexible mapping tool than the one it has.</li>
<li>With code that has no immediate GUI feedback, testing is extremely important. But the Grails test run so slow that it is annoying.</li>
</ul>
<p>Still, would I recommend Grails for a large SOAP project. Yes, I would.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/creating-consuming-and-testing-soap-webservices-on-grails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My first patch to Grails accepted</title>
		<link>http://www.code3.dk/my-first-patch-to-grails-accepted/</link>
		<comments>http://www.code3.dk/my-first-patch-to-grails-accepted/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 10:58:12 +0000</pubDate>
		<dc:creator>mil</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[Grails]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=337</guid>
		<description><![CDATA[I recently wrote a patch for Grails to support dateCreated and lastUpdated when using mockDomain in unit tests.
This patch has [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wrote a patch for Grails to support <code>dateCreated</code> and <code>lastUpdated</code> when using <code>mockDomain</code> in unit tests.</p>
<p>This patch has now been applied to 1.2-SNAPSHOT.</p>
<p><a rel="nofollow" href="http://jira.codehaus.org/browse/GRAILS-4540">http://jira.codehaus.org/browse/GRAILS-4540</a></p>
<p>The <code>mockDomain</code> method makes it possible to test code that uses GORMs dynamic methods, without having to use a real database.</p>
<p>IBM Developerworks has a great article on mock testing in Grails <a rel="nofollow" href="http://www.ibm.com/developerworks/java/library/j-grails10209/index.html">here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/my-first-patch-to-grails-accepted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to debug grails run-app loop</title>
		<link>http://www.code3.dk/how-to-debug-grails-run-app-loop/</link>
		<comments>http://www.code3.dk/how-to-debug-grails-run-app-loop/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 09:21:12 +0000</pubDate>
		<dc:creator>mil</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[Grails]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=331</guid>
		<description><![CDATA[I recently had a problem where grails run-app would start
the server, then immediately recompile 1 class, then restart&#8230; and
repeat.
Google told [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a problem where <code>grails run-app</code> would start<br />
the server, then immediately recompile 1 class, then restart&#8230; and<br />
repeat.</p>
<p>Google told me that the problem probably was an empty Java file in my<br />
project and to look in the<br />
<code>~/.grails/1.2-M4/projects/myproject/classes</code> directory to<br />
see which file kept changing timestamp.</p>
<p>However, no files did that. The solution was to modify<br />
<code>$GRAILS_HOME/scripts/_GrailsCompile.groovy</code> and add<br />
<code>listFiles:true</code> to the compile target:</p>
<pre class="brush: groovy">
ant.groovyc(destdir:classesDirPath,
classpathref:classpathId,
encoding:&quot;UTF-8&quot;,
listFiles:true,
compilerPaths.curry(classpathId, false))
</pre>
<p>And it turned out Google was right, I had a Java file with only the<br />
package specification in it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/how-to-debug-grails-run-app-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Console output from Grails tests</title>
		<link>http://www.code3.dk/console-output-from-grails-tests/</link>
		<comments>http://www.code3.dk/console-output-from-grails-tests/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 07:13:30 +0000</pubDate>
		<dc:creator>AN</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=328</guid>
		<description><![CDATA[For casual testing in Grails, it would be nice to be able to just have the output of the tests [...]]]></description>
			<content:encoded><![CDATA[<p>For casual testing in Grails, it would be nice to be able to just have the output of the tests dumped to the console that the tests were run from. This doesn&#8217;t seem possible in the default setup, but adding these lines </p>
<pre class="brush: java">
		if(argsMap[&#039;no-reports&#039;]){
			println testRunner.out.toString()
			println testRunner.err.toString()
		}
</pre>
<p>should do the trick, if you add them to <strong>$GRAILS_HOME/script/_GrailsTest.groovy</strong> in the &#8220;runTests&#8221; closure, right after &#8221; <code>def result = testRunner.runTests(testSuite)</code>&#8221; </p>
<p>With those lines in place you can run your test like<br />
</br><br />
<code>grails -Dserver.port=9090 test-app -integration -no-reports MyController</code><br />
</br><br />
Specifying the name of the class to test is important since only the output from the last test class will be printed. So we might as well only run one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/console-output-from-grails-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dependent dropdowns in Grails</title>
		<link>http://www.code3.dk/dependent-dropdowns-in-grails/</link>
		<comments>http://www.code3.dk/dependent-dropdowns-in-grails/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 10:46:25 +0000</pubDate>
		<dc:creator>AN</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Grails]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=324</guid>
		<description><![CDATA[It does really seem to be a very common problem with the dependend or chained drop-downs. At least it was [...]]]></description>
			<content:encoded><![CDATA[<p>It does really seem to be a <a href="http://www.code3.dk/dependent-dropdowns-in-seam-and-richfaces/">very common problem</a> with the dependend or chained drop-downs. At least it was one of the first problems I faced in the Grails app I&#8217;m working on now.</p>
<p>The solution is not really more or less elegant than the one for Seam and Richfaces. I followed <a href="http://www.grails.org/AJAX-Driven+SELECTs+in+GSP">the guide on Grails.org</a> but decided to make the solution a bit more general. So I pass the name of the select-element-to-update as a string to the update function. This way I can also put the function in a separate file for inclusion (updateselect.js).</p>
<pre class="brush: javascript">
function updateSelect(e, elemId) {
// The response comes back as a bunch-o-JSON
var values = eval(&quot;(&quot; + e.responseText + &quot;)&quot;) // evaluate JSON

if (values) {
updateSelectFromJSON(values, elemId);
}
}

function updateSelectFromJSON(values, elemId) {
var rselect = document.getElementById(elemId)
// 	Clear all previous options
rselect.options.length = 0

// Rebuild the select
for (var i=0; i &lt; values.length; i++) {
var opt = document.createElement(&#039;option&#039;);
opt.text = values[i].name
opt.value = values[i].id
try {
rselect.add(opt, null) // standards compliant; doesn&#039;t work in IE
} catch(ex) {
rselect.add(opt) // IE only
}
}
}
</pre>
<p>Which is then called like this</p>
<pre class="brush: xml">

...

&lt;form&gt;
optionKey=&quot;id&quot; optionValue=&quot;name&quot; name=&quot;country.name&quot; id=&quot;country.name&quot; from=&quot;${Country.list()}&quot;
onchange=&quot;${remoteFunction(
controller:&#039;country&#039;,
action:&#039;ajaxGetCities&#039;,
params:&#039;&#039;id=&#039; + escape(this.value)&#039;,
onComplete:&#039;&#039;&#039;updateSelect(e, &#039;city&#039;)&#039;&#039;&#039;)}&quot;
&gt;

&lt;/form&gt;</pre>
<p>One thing is missing from this solution, though. Unlike the solution on grails.org, the chained select is not updated based on the default value of the previous select. This can be fixed by inserting the following in the head element of the .gsp page.</p>
<pre class="brush: xml">

function init() {
document.cityform[&#039;country.name&#039;].onchange();
}
window.onload = init;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/dependent-dropdowns-in-grails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grails bash completion</title>
		<link>http://www.code3.dk/grails-bash-completion/</link>
		<comments>http://www.code3.dk/grails-bash-completion/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 10:45:49 +0000</pubDate>
		<dc:creator>AN</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[ant-deb-task]]></category>
		<category><![CDATA[bashcompletion]]></category>
		<category><![CDATA[Grails]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=320</guid>
		<description><![CDATA[I&#8217;ve started doing some Grails development. So far it seems great. Here are a couple of notes to start with.
Grails [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started doing some Grails development. So far it seems great. Here are a couple of notes to start with.</p>
<p>Grails is not packaged officially for Ubuntu yet. And the packages that can be downloaded from grails.org don&#8217;t have bash completion. <a href="http://groups.google.com/group/groovyvan/browse_thread/thread/6a2f95ebbfa4c8ea?pli=1">This guy</a> however packaged grails for Debian/Ubuntu, and it include a bash completion script. <a href="http://code.google.com/p/ant-deb-task/">The package</a> seems to work great, and for one of my machines where I already installed grails from the usual tar.gz download, I pulled out the bash completion from the deb-package. To make it work completely with the tar.gz dowload I just had to modify the location of the grails installation (to use $GRAILS_HOME). Ahhhh.</p>
<p>Somewhat less useful (but fun), I also added the Ubuntu &#8220;notify-send&#8221; notification feature <a href="http://colinharrington.net/blog/2009/05/grails-growl-like-notifications-in-linux-ubuntu-904/">described here</a>. I feel all set for Grails development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/grails-bash-completion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automated documentation and ODFDOM</title>
		<link>http://www.code3.dk/automated-documentation-and-odfdom/</link>
		<comments>http://www.code3.dk/automated-documentation-and-odfdom/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 13:14:55 +0000</pubDate>
		<dc:creator>AN</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[ODFDOM]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=310</guid>
		<description><![CDATA[Everyone hates out-of-date documentation. Unfortunately most people hate keeping documentation updated even more. So Paul Duvall has written a nice [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone hates out-of-date documentation. Unfortunately most people hate keeping documentation updated even more. So Paul Duvall has written a <a href="http://www.ibm.com/developerworks/library/j-ap06108/index.html">nice piece on developerWorks</a> about automatically generated documentation.</p>
<p>The tools used in Pauls piece don&#8217;t exactly fit my project however. I use <a href="http://code.google.com/p/google-guice/">Guice</a>, and since that can be a bit confusing it would be nice to have some overview of how Guice binds the app together. With Guice 2.0  however there is a nice <a href="http://code.google.com/p/google-guice/wiki/Grapher">Guice plugin to generate diagrams</a>. The only problem is that the Seam/Guice integration is not updated to Guice 2.0 yet. So I guess I&#8217;ll postpone this.</p>
<p>An important part of any application is the data model. So I would like to have entity diagrams generated. Since I use hibernate/JPA I thought that there would be an ant task to have entity diagram generated directly. However, lots of searching on google brought me nowhere. <a href="http://www.softwaresecretweapons.com/jspwiki/linguinemaps">Linguine maps</a> would have been a solution back in the days when one used &#8220;.hbm.xml&#8221; files to configure entity classes. But noone does that anymore. So I asked a question on <a href="http://stackoverflow.com/questions/1017997/ant-task-for-generating-er-diagram-from-jpa-hibernate-annotated-classes">Stackoverflow</a> but that didn&#8217;t help. Finally I tried a workaround that involves starting a database deploying the entities and then letting <a href="http://schemaspy.sourceforge.net/">SchemaSpy</a> generate diagrams from the database. This could definitely be more elegant.</p>
<p>I usually don&#8217;t program with deep or advanced class hierachies so I don&#8217;t see the point in doing inheritance graphs. Others do, however, and the tool <a href="http://code.google.com/p/apiviz/">API viz</a> does a nice and easy job of creating them, so I might as well include that. I could presumably also have used <a href="http://umljgraph.sourceforge.net/">UMLJGraph</a> or <a href="http://www.umlgraph.org/">UMLGraph</a> (like in the developerworks article).</p>
<p>The really fun part begins if I were to write a small ant task that could process an ODF document with <a href="http://odftoolkit.org/projects/odfdom/pages/Home">ODFDOM</a> and automatically insert the graphs in the right place. I attended the ODFDOM hands-on-lab at JavaOne, and while the api is a bit rough now, it should actually not be too much work I think (especially if I use <a href="http://groovy.codehaus.org/">Groovy</a>).  I guess the first version would just replace some placeholder string in the document with the appropriate diagram. This way it should not be too difficult to use with the different documentation template documents one encounters. Poor mans LaTeX, yay! I&#8217;ll blog it when I get it running.</p>
<p>+++++++++++++++++++++++++++++++++++++</p>
<p>The AntTask for ApiViz just requires the apiviz jar file which I put in a folder &#8220;buildlib&#8221;:</p>
<pre class="brush: xml">
&lt;target name=&quot;javadoc&quot;&gt;
 &lt;javadoc destdir=&quot;docs/api&quot;
 author=&quot;true&quot;
 version=&quot;true&quot;
 use=&quot;true&quot;
 windowtitle=&quot;TACS API&quot;
 classpathref=&quot;class.build.path&quot;
 doclet=&quot;org.jboss.apiviz.APIviz&quot;
 docletpath=&quot;buildlib/apiviz-1.3.0.GA.jar&quot;
 additionalparam=&quot;-author -version&quot;&gt;
 &lt;fileset dir=&quot;src&quot;/&gt;
 &lt;/javadoc&gt;
 &lt;/target&gt;
</pre>
<p>The not very elegant integration of SchemaSpy involves the buildtarget below which starts two tasks in parallel. The top one just executes a class that programatically start an HSQLDB and then  loads a datasource which points to that database. This then causes Hibernate to create the tables specified by the entity classes. When the database is started and the datasource loaded it sleeps 20 secs to allow the schemaspy task to connect. The bottom parallel task then sleeps 10 secs (to allow the datasource to load) and then runs schemaspy.</p>
<pre class="brush: xml">
&lt;target name=&quot;db-diagram&quot; depends=&quot;db-start&quot;&gt;
&lt;parallel&gt;
 &lt;daemons&gt;
 &lt;java dir=&quot;build/classes/test&quot; classname=&quot;TestEntityManagerProvider&quot; fork=&quot;true&quot;&gt;
 &lt;classpath&gt;
&lt;pathelement location=&quot;build/classes/test&quot;/&gt;
&lt;path refid=&quot;class.test.path&quot;/&gt;
 &lt;/classpath&gt;
 &lt;/java&gt;
 &lt;/daemons&gt;
 &lt;sequential&gt;
 &lt;sleep seconds=&quot;10&quot;/&gt;
 &lt;java jar=&quot;buildlib/schemaSpy_4.1.1.jar&quot;
 output=&quot;docs/output.log&quot;
 error=&quot;docs/error.log&quot;
 fork=&quot;true&quot;&gt;
 &lt;arg line=&quot;-t hsqldb&quot;/&gt;
 &lt;arg line=&quot;-host localhost&quot;/&gt;
 &lt;arg line=&quot;-db tacs&quot;/&gt;
 &lt;arg line=&quot;-u sa&quot;/&gt;
 &lt;arg line=&quot;-s PUBLIC&quot;/&gt;
 &lt;arg line=&quot;-cp buildlib/hsqldb.jar&quot;/&gt;
 &lt;arg line=&quot;-o docs/api&quot;/&gt;
 &lt;/java&gt;
 &lt;/sequential&gt;
 &lt;/parallel&gt;
 &lt;/target&gt;
</pre>
<pre class="brush: java">

public class TestEntityManagerProvider {

 public static void main(String[] args) throws InterruptedException {
 System.out.println(&quot;Starting hsqldb&quot;);

 new Thread(new Runnable(){
 public void run() {
 Server s = new Server();
 s.setDatabaseName(0, &quot;tacs&quot;);
 s.setDatabasePath(0, &quot;mem:test;sql.enforce_strict_size=true&quot;);
 s.start();
 }
 }).start();

 Thread.sleep(2000);

 final Map props = new HashMap();
 props.put(&quot;javax.persistence.jtaDataSource&quot;, &quot;&quot;);
 final EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory(&quot;tacs-diagram&quot;, props);

 final EntityManager entityManager = entityManagerFactory.createEntityManager();

 entityManager.getTransaction().begin();
 entityManager.persist(new Cpe());
 Query q = entityManager.createQuery(&quot;from Cpe&quot;);
 System.out.println(&quot;Results from cpe&quot; + q.getResultList());

 System.out.println(&quot;Sleeping 20 sec&quot;);
 Thread.sleep(200000    );
 System.out.println(&quot;Done sleeping&quot;);
 }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/automated-documentation-and-odfdom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scala and project jigsaw at JavaOne</title>
		<link>http://www.code3.dk/scala-and-project-jigsaw-at-javaone/</link>
		<comments>http://www.code3.dk/scala-and-project-jigsaw-at-javaone/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 09:49:13 +0000</pubDate>
		<dc:creator>AN</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=305</guid>
		<description><![CDATA[A couple of us from Code3 went to JavaOne this year. I saw some great presentations (and some not-so-great). And [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of us from <a href="http://www.code3.dk/">Code3</a> went to JavaOne this year. I saw some great presentations (and some not-so-great). And of course I missed some great presentations. Unfortunately not that many presentations are online. <a href="http://channelsun.sun.com/video/events/javaone/1631259661/chapter+2:+javaone+2009+sun+technical+general+session/25089975001">Here is one</a> I missed, which has a great segment (first 30 mins) on <a href="http://openjdk.java.net/projects/jigsaw/">project jigsaw</a> &#8211; the proposed module system for OpenJDK7. It looks like Java will finally fit well on modern GNU/Linux operating systems like Ubuntu.</p>
<p>My favorite presentation was &#8220;The feel of Scala&#8221; by Bill Venners (I ran out and bought his Scala book after the presentation). This presentation is not online (yet?) but I have found a <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=253855">video of the talk from another conference</a></p>
<p><object width="474" height="443"><param name="movie" value="http://www.parleys.com/download/attachments/5443/parleysshare.swf?pageId=27131945"/><param name="allowFullScreen" value="true"/><param name="pageId" value="27131945"/><embed src="http://www.parleys.com/download/attachments/5443/parleysshare.swf?pageId=27131945" type="application/x-shockwave-flash" allowfullscreen="true" width="474" height="443"/><br />
</object></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/scala-and-project-jigsaw-at-javaone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Groovy web shells – ajaxgroovyshell</title>
		<link>http://www.code3.dk/groovy-web-shells-%e2%80%93-ajaxgroovyshell/</link>
		<comments>http://www.code3.dk/groovy-web-shells-%e2%80%93-ajaxgroovyshell/#comments</comments>
		<pubDate>Tue, 19 May 2009 14:16:39 +0000</pubDate>
		<dc:creator>AN</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[JEE]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=298</guid>
		<description><![CDATA[For the JEE web-app I am currently working on the main audience is power users/admins. So while I can code [...]]]></description>
			<content:encoded><![CDATA[<p>For the JEE web-app I am currently working on the main audience is power users/admins. So while I can code some usecases as nice seam pages that help the user solve a task, other usecase are difficult. The most difficult are the general batch processes that take the form &#8220;select, filter, apply&#8221;.</p>
<p>Unix users (who use shell scripts) know that a small amount of programming is effective at solving these problems. So for my web-app I was contemplating how to get something &#8220;shell-like&#8221; into the project. There are several projects that present a nice AJAX based web interface to the system shell on unix machines. Eg. <a href="http://code.google.com/p/shellinabox">shellinabox</a> and <a href="http://antony.lesuisse.org/software/ajaxterm/">ajaxterm</a>. And there are several programming languages that seem suited for interacting with a Java app. Eg. <a href="http://groovy.codehaus.org/">Groovy</a>, Jython, or Beanshell.</p>
<p>So I decided to try to combine the interactive groovy shell with an ajax frontend. After looking around quite a lot I found shellinabox which has a nice GPL&#8217;ed javascript vt100 front end (I found another <a href="http://fzort.org/bi/o.php">here</a> which is LGPL&#8217;ed).</p>
<p>After a some weekend studies of shellinabox I could make a prototype with the vt100.js of shellabox and the nice little python webserver of ajaxterm. With a little more hacking I was able to hook up the groovyshell as a web-app through a java servlet. The interactive performance sucked, because of some weirdness in standard java.io.PipedInput/OutputStream classes, but fortunately I was not the first with that problem so with some small hacks to the replacement classes from <a href="http://www.live-graph.org">LiveGraph</a> the interactivity became tolerable.</p>
<p>From this working state there is actually still quite a bit of work to have something that I can deploy on a customer production server. But when Guillaume Laforge announced his cool little app <a href="http://groovyconsole.appspot.com/">&#8220;GroovyWebConsole&#8221;</a> to run a groovyshell on the Google AppEngine I figured that I might as well upload what I had and announce it as well. Here is the announcement I sent to groovy-users</p>
<blockquote><p>I have made a similar app to administer a JEE app I&#8217;m doing. It is<br />
similar but is stateful and uses a vt100 interpreter in javascript (from<br />
shellinabox).</p>
<p>You can find it here</p>
<p><a href="http://code.google.com/p/ajaxgroovyshell">http://code.google.com/p/ajaxgroovyshell</a></p>
<p>It is mostly a prototype &#8211; to be really useful for me I need to add</p>
<p>1) Access control<br />
2) A way to paste text from the system (a pop-up textarea?)<br />
3) Proper sessions<br />
4) A robust way to handle threads<br />
5) Syntax highlighting?<br />
6) Better tab completion in GroovyShell (more like ipython)<br />
Unfortunately it won&#8217;t run on the Google AppServer since I need a thread<br />
for the GroovyShell.</p>
<p>Best<br />
Anders
</p></blockquote>
<p>Since then I have noticed several java server projects that have some kind of console facility. But not as an ajax webpage (yet). I have suggested it a couple of places (like <a href="http://weblogs.java.net/blog/kohsuke/archive/2009/05/hudson_cli_and.html">for Hudson</a>, and <a href="http://in.relation.to/11439.lace">for FRESH</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/groovy-web-shells-%e2%80%93-ajaxgroovyshell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Reusable) Dependent dropdowns in Seam and Richfaces</title>
		<link>http://www.code3.dk/reusable-dependent-dropdowns-in-seam-and-richfaces/</link>
		<comments>http://www.code3.dk/reusable-dependent-dropdowns-in-seam-and-richfaces/#comments</comments>
		<pubDate>Thu, 07 May 2009 13:26:06 +0000</pubDate>
		<dc:creator>AN</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[Richfaces]]></category>
		<category><![CDATA[Seam]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=293</guid>
		<description><![CDATA[In the previous post I had some code to illustrate how I do dependent dropdowns with seam and richfaces. I [...]]]></description>
			<content:encoded><![CDATA[<p>In the previous post I had some code to illustrate how I do dependent dropdowns with seam and richfaces. I cleaned it up to focus on the important stuff and I am not sure to which degree it compiles and runs. However, you may have noticed one thing that is certainly odd. Most of the operations are on the object named &#8220;vendormodelselector&#8221; which is described in the post. But the search action is on &#8220;searcher&#8221;. This is because I include the seam file on multiple pages with &#8220;ui:include&#8221; (xmlns:ui=&#8221;http://java.sun.com/jsf/facelets&#8221;). and with &#8220;ui:param&#8221; I can pass a different searcher object depending on the page. Like this</p>
<pre class="brush: xml">
&lt;ui:include src=&quot;vendormodelmenu.xhtml&quot;&gt;
	&lt;ui:param name=&quot;vendormodelheader&quot; value=&quot;Appropriate header&quot;/&gt;
	&lt;ui:param name=&quot;searcher&quot; value=&quot;#{searcher_object_name}&quot;/&gt;
&lt;/ui:include&gt;
</pre>
<p>Neat!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/reusable-dependent-dropdowns-in-seam-and-richfaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
