<?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>Better Software and beyond...</title>
	<atom:link href="http://www.thorsten-kamann.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thorsten-kamann.de</link>
	<description>About architecture, development, quality and more</description>
	<lastBuildDate>Tue, 25 Oct 2011 20:16:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Writing technical blogs</title>
		<link>http://www.thorsten-kamann.de/2011/10/25/writing-technical-blogs/</link>
		<comments>http://www.thorsten-kamann.de/2011/10/25/writing-technical-blogs/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 20:16:06 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[egit]]></category>
		<category><![CDATA[Gists]]></category>
		<category><![CDATA[GIT]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/?p=633</guid>
		<description><![CDATA[If you are an author writing technical blogs you know the problems: the rich text editors doesn&#8217;t support editing source code very well the most editors doesn&#8217;t support tabs (useful for XML) often your formatted sourcecode will be shot But &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2011/10/25/writing-technical-blogs/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>If you are an author writing technical blogs you know the problems:</p>
<ul>
<li>the rich text editors doesn&#8217;t support editing source code very well</li>
<li>the most editors doesn&#8217;t support tabs (useful for XML)</li>
<li>often your formatted sourcecode will be shot</li>
</ul>
<p>But now we are living in the age of social coding. Since GitHub we are knowing that our code can be forked, commented and reviewed by all users in the internet <img src='http://www.thorsten-kamann.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
But GitHub has another nice feature named GIST. A Gist is a repository containing one or more code snippets. This is versioned like your other sourcecode and every Gist is public and can be used as simple code in your blog posts.</p>
<h4>WordPress and Gists</h4>
<p>If your are using WordPress as blogging software you can easily integrate your gists. If you search for Gist plugins you will find some: http://wordpress.org/extend/plugins/search.php?q=gist<br />
I am using this <a title="Embeded GitHub Gist" href="http://wordpress.org/extend/plugins/embed-github-gist/" target="_blank">one</a> and it works fine. For other blogging software you can embedd your gist with a javascript (see below).</p>
<h4>Eclipse and Gists</h4>
<p>The current release of Egit (the Eclipse integration of GIT) offers a GitHub integration. And additionally Gists are supported, too. You can add your Gists with Mylyn and attach and remove files to/from your gist.</p>
<p>IntelliJ 11 has Gist support, too.</p>
<h4>Working with Gist</h4>
<p>There are some steps to do to use gists in your blog:</p>
<ol>
<li>Login into the Gist area of GitHub (you can use your GitHub account)</li>
<li>Create a new Gist</li>
<li>Add one or more files (code snippets)</li>
<li>Embed this in your blog post:<br />
[gist id=12345]<br />
if you have only one file or<br />
[gist id=12345 file=myfile.txt]<br />
if you want to specify a file directly</li>
<li>Thats all!</li>
</ol>
<h4><span class="Apple-style-span" style="line-height: 18px;">Working with Gist without plugin</span></h4>
<p><span class="Apple-style-span" style="line-height: 18px;">You can use your Gists without any plugin, too. It&#8217;s quite simple. Add this snippet to your page:</span></p>
<pre>&lt;script src="https://gist.github.com/12345.js?file=myfile.txt"&gt;&lt;/script&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2011/10/25/writing-technical-blogs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating RESTful webservices with the Spring Framework</title>
		<link>http://www.thorsten-kamann.de/2011/10/15/creating-restful-webservices-with-the-spring-framework/</link>
		<comments>http://www.thorsten-kamann.de/2011/10/15/creating-restful-webservices-with-the-spring-framework/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 21:53:52 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[JPA]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Webservice]]></category>
		<category><![CDATA[XStream]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/?p=552</guid>
		<description><![CDATA[With the Spring Framework you can easily create RESTful webservices. This is built-in the MVC part of Spring. In this post I show you how to configure this and offer the consumer the response as XML and as JSON. The domain model &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2011/10/15/creating-restful-webservices-with-the-spring-framework/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div id="toc_container" class="toc_wrap_right no_bullets"><p class="toc_title">Contents</p><ul class="toc_list"><li><a href="#The_domain_model-1">1 The domain model</a></li><li><a href="#The_service_model-2">2 The service model</a></li><li><a href="#Wiring_domain_and_service-3">3 Wiring domain and service</a></li><li><a href="#Creating_the_REST_service-4">4 Creating the REST service</a></li><li><a href="#Configuring_the_webxml-5">5 Configuring the web.xml</a></li><li><a href="#Optimize_the_output-6">6 Optimize the output</a></li><li><a href="#Conclusion-7">7 Conclusion</a></li><li><a href="#Resources-8">8 Resources</a></li></ul></div>

<p>With the Spring Framework you can easily create RESTful webservices. This is built-in the MVC part of Spring. In this post I show you how to configure this and offer the consumer the response as XML and as JSON.</p>
<h4><span id="The_domain_model-1">The domain model</span></h4>
<p>First we need a domainmodel. In this sample it is quite simple. It consists of 2 classes: Constellation and ConstellationName.</p>
<p style="text-align: center;"><div class="img size-medium wp-image-553 aligncenter" style="width:300px;">
	<a title="Domain Model" href="http://www.thorsten-kamann.de/wp-content/uploads/2011/10/Domainmodel-of-Tucana.png" rel="lightbox"><img src="http://www.thorsten-kamann.de/wp-content/uploads/2011/10/Domainmodel-of-Tucana-300x141.png" alt="" width="300" height="141" /></a>
	<div>Domainmodel</div>
</div>
<p style="text-align: left;">The Constellation describes an astronomical constellation like Orion, Andromeda and so on. The association to ConstellationName offers names of the constellation in different languages.</p>
<h4><span id="The_service_model-2">The service model</span></h4>
<p>In this sample the interface used by clients (web, webservice) is a classical service class. This class &#8211; named ConstellationService &#8211; needs a repository class to access the underlying database.</p>
<p style="text-align: center;"><div class="img size-medium wp-image-554 aligncenter" style="width:300px;">
	<a title="Service Model" href="http://www.thorsten-kamann.de/wp-content/uploads/2011/10/Servicemodel-of-Tucana.png" rel="lightbox"><img src="http://www.thorsten-kamann.de/wp-content/uploads/2011/10/Servicemodel-of-Tucana-300x138.png" alt="" width="300" height="138" /></a>
	<div>Servicemodel</div>
</div>
<h4 style="text-align: left;"><span id="Wiring_domain_and_service-3">Wiring domain and service</span></h4>
<p>With Spring this is quite easy. You need only a little XML file and some Annotations. In the ConstellationService you add the @Service annotation:</p>
<div id="gist-1289371" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="nd">@Service</span></div><div class='line' id='LC2'><span class="kd">public</span> <span class="kd">class</span> <span class="nc">Service</span><span class="o">{</span></div><div class='line' id='LC3'><span class="o">...</span></div><div class='line' id='LC4'><span class="o">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1289371/f40b2955a76a72aee18bad6466db8bd678a925f8/Service.java" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1289371#file_service.java" style="float:right;margin-right:10px;color:#666">Service.java</a>
            <a href="https://gist.github.com/1289371">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>This annotation is out of the package <em>org.springframework.stereotype.Service</em>. To inject the repository class you can use the @Inject annotation. If you have setup your JPA environment properly you can access the database and get some Constellation instances.</p>
<h4><span id="Creating_the_REST_service-4">Creating the REST service</span></h4>
<p>Now we have a working backend. But we want to have a RESTful webservice so we need another artifact in our sourcecode: the Controller. A controller is the first item of our application. This means if a client requests data the controller gets the request foremost. The controller then is analyzing and validating the request. After this service will be called, the retrieving data prepared and returned.</p>
<p>In Spring you can add some annotations to a controller method to map this method to the specified URL resource:</p>
<div id="gist-1289371" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="nd">@RequestMapping</span><span class="o">(</span><span class="n">value</span> <span class="o">=</span> <span class="s">&quot;/constellations&quot;</span><span class="o">)</span></div><div class='line' id='LC2'><span class="kd">public</span> <span class="n">ModelAndView</span> <span class="nf">getAllConstellations</span><span class="o">()</span> <span class="o">{}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1289371/37442e0e7e14626a0fff7015a6b87e9925c967f1/RequestMapping1.java" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1289371#file_request_mapping1.java" style="float:right;margin-right:10px;color:#666">RequestMapping1.java</a>
            <a href="https://gist.github.com/1289371">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>With this mapping this controller method responses to the request http://some-host/constellations only. You can map more complex URL resources too. For instance if you have an URL with parameter. In our service we want to offer a method the client can request for one constellation identified by its code. This can be done with the annotation @RequestMapping and @PathVariable:</p>
<div id="gist-1289371" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="nd">@RequestMapping</span><span class="o">(</span><span class="s">&quot;/constellation_by_code/{code}&quot;</span><span class="o">)</span></div><div class='line' id='LC2'><span class="kd">public</span> <span class="n">ModelAndView</span> <span class="nf">findConstellationByCode</span><span class="o">(</span><span class="nd">@PathVariable</span> <span class="n">String</span> <span class="n">code</span><span class="o">)</span> <span class="o">{}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1289371/a0058f8b1ad38cf440d4550e2915e6c11e922ab6/RequestMapping2.java" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1289371#file_request_mapping2.java" style="float:right;margin-right:10px;color:#666">RequestMapping2.java</a>
            <a href="https://gist.github.com/1289371">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>With this mapping the part with the {} will be taken as parameter for the method. You can use more placeholder too. For this you can read the <a title="@RequestMapping in the Spring documentation" href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping" target="_blank">Spring documentation</a>.</p>
<p>Now we have all informations to create the controller class.</p>
<div id="gist-1289371" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="nd">@Controller</span></div><div class='line' id='LC2'><span class="kd">public</span> <span class="kd">class</span> <span class="nc">ConstellationServiceController</span> <span class="o">{</span></div><div class='line' id='LC3'>&nbsp;</div><div class='line' id='LC4'><span class="nd">@Inject</span></div><div class='line' id='LC5'><span class="kd">private</span> <span class="n">ConstellationService</span> <span class="n">service</span><span class="o">;</span></div><div class='line' id='LC6'>&nbsp;</div><div class='line' id='LC7'><span class="nd">@RequestMapping</span><span class="o">(</span><span class="n">value</span> <span class="o">=</span> <span class="s">&quot;/constellations&quot;</span><span class="o">)</span></div><div class='line' id='LC8'><span class="kd">public</span> <span class="n">ModelAndView</span> <span class="nf">getAllConstellations</span><span class="o">()</span> <span class="o">{</span></div><div class='line' id='LC9'>&nbsp;&nbsp;<span class="n">List</span><span class="o">&lt;</span><span class="n">Constellation</span><span class="o">&gt;</span> <span class="n">constellations</span> <span class="o">=</span> <span class="n">service</span><span class="o">.</span><span class="na">findAllConstellations</span><span class="o">();</span></div><div class='line' id='LC10'>&nbsp;&nbsp;<span class="n">ModelAndView</span> <span class="n">mav</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ModelAndView</span><span class="o">(</span><span class="s">&quot;xmlView&quot;</span><span class="o">,</span></div><div class='line' id='LC11'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">BindingResult</span><span class="o">.</span><span class="na">MODEL_KEY_PREFIX</span> <span class="o">+</span> <span class="s">&quot;constellations&quot;</span><span class="o">,</span> <span class="n">constellations</span><span class="o">);</span></div><div class='line' id='LC12'>&nbsp;&nbsp;<span class="k">return</span> <span class="n">mav</span><span class="o">;</span></div><div class='line' id='LC13'><span class="o">}</span></div><div class='line' id='LC14'>&nbsp;</div><div class='line' id='LC15'><span class="nd">@RequestMapping</span><span class="o">(</span><span class="s">&quot;/constellation_by_code/{code}&quot;</span><span class="o">)</span></div><div class='line' id='LC16'><span class="kd">public</span> <span class="n">ModelAndView</span> <span class="nf">findConstellationByCode</span><span class="o">(</span><span class="nd">@PathVariable</span> <span class="n">String</span> <span class="n">code</span><span class="o">)</span> <span class="o">{</span></div><div class='line' id='LC17'>&nbsp;&nbsp;<span class="n">Constellation</span> <span class="n">constellation</span> <span class="o">=</span> <span class="n">service</span><span class="o">.</span><span class="na">findConstellationByCode</span><span class="o">(</span><span class="n">code</span><span class="o">);</span></div><div class='line' id='LC18'>&nbsp;&nbsp;<span class="k">return</span> <span class="k">new</span> <span class="nf">ModelAndView</span><span class="o">(</span><span class="s">&quot;xmlView&quot;</span><span class="o">,</span> <span class="n">BindingResult</span><span class="o">.</span><span class="na">MODEL_KEY_PREFIX</span></div><div class='line' id='LC19'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">+</span> <span class="s">&quot;constellations&quot;</span><span class="o">,</span> <span class="n">constellation</span><span class="o">);</span></div><div class='line' id='LC20'><span class="o">}</span></div><div class='line' id='LC21'>&nbsp;</div><div class='line' id='LC22'><span class="nd">@RequestMapping</span><span class="o">(</span><span class="s">&quot;/constellations_by_search/{search}&quot;</span><span class="o">)</span></div><div class='line' id='LC23'><span class="kd">public</span> <span class="n">ModelAndView</span> <span class="n">findConstellationByCodeOrName</span></div><div class='line' id='LC24'>&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nd">@PathVariable</span> <span class="n">String</span> <span class="n">search</span><span class="o">)</span> <span class="o">{</span></div><div class='line' id='LC25'>&nbsp;&nbsp;<span class="k">return</span> <span class="k">new</span> <span class="nf">ModelAndView</span><span class="o">(</span><span class="s">&quot;xmlView&quot;</span><span class="o">,</span> <span class="n">BindingResult</span><span class="o">.</span><span class="na">MODEL_KEY_PREFIX</span></div><div class='line' id='LC26'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">+</span> <span class="s">&quot;constellations&quot;</span><span class="o">,</span> <span class="n">service</span><span class="o">.</span><span class="na">findAllConstellationByCodeOrName</span><span class="o">(</span><span class="n">search</span><span class="o">));</span></div><div class='line' id='LC27'><span class="o">}</span></div><div class='line' id='LC28'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1289371/6fa57ccb22c6e9411ab35b66c6e63bb88d1406bb/ConstellationServiceController.java" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1289371#file_constellation_service_controller.java" style="float:right;margin-right:10px;color:#666">ConstellationServiceController.java</a>
            <a href="https://gist.github.com/1289371">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>The last step we need to do is to configure the Spring container to get it together. For this we need a little bit XML. In this XML we configure 2 views: one for a XML and one for a JSON response. So you need to add the xml or json extension to the url to control the format of the response.</p>
<div id="gist-1289371" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="nt">&lt;bean</span> <span class="na">class=</span><span class="s">&quot;org.springframework.web.servlet.view.BeanNameViewResolver&quot;</span> <span class="nt">/&gt;</span></div><div class='line' id='LC2'>&nbsp;</div><div class='line' id='LC3'><span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;xstreamMarshaller&quot;</span> <span class="na">class=</span><span class="s">&quot;org.springframework.oxm.xstream.XStreamMarshaller&quot;</span></div><div class='line' id='LC4'><span class="na">p:autodetectAnnotations=</span><span class="s">&quot;true&quot;</span> <span class="nt">/&gt;</span></div><div class='line' id='LC5'>&nbsp;</div><div class='line' id='LC6'><span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;xmlView&quot;</span> <span class="na">class=</span><span class="s">&quot;org.springframework.web.servlet.view.xml.MarshallingView&quot;</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="na">p:contentType=</span><span class="s">&quot;application/xml&quot;</span><span class="nt">&gt;</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;constructor-arg</span> <span class="na">ref=</span><span class="s">&quot;xstreamMarshaller&quot;</span> <span class="nt">/&gt;</span></div><div class='line' id='LC9'><span class="nt">&lt;/bean&gt;</span></div><div class='line' id='LC10'>&nbsp;</div><div class='line' id='LC11'><span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;jsonView&quot;</span> <span class="na">class=</span><span class="s">&quot;org.springframework.web.servlet.view.json.MappingJacksonJsonView&quot;</span> <span class="nt">/&gt;</span></div><div class='line' id='LC12'>&nbsp;</div><div class='line' id='LC13'><span class="nt">&lt;bean</span> <span class="na">class=</span><span class="s">&quot;org.springframework.web.servlet.view.ContentNegotiatingViewResolver&quot;</span><span class="nt">&gt;</span></div><div class='line' id='LC14'>&nbsp;&nbsp;<span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;mediaTypes&quot;</span><span class="nt">&gt;</span></div><div class='line' id='LC15'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;map&gt;</span></div><div class='line' id='LC16'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;entry</span> <span class="na">key=</span><span class="s">&quot;json&quot;</span> <span class="na">value=</span><span class="s">&quot;application/json&quot;</span> <span class="nt">/&gt;</span></div><div class='line' id='LC17'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;entry</span> <span class="na">key=</span><span class="s">&quot;xml&quot;</span> <span class="na">value=</span><span class="s">&quot;application/xml&quot;</span> <span class="nt">/&gt;</span></div><div class='line' id='LC18'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;/map&gt;</span></div><div class='line' id='LC19'>&nbsp;&nbsp;<span class="nt">&lt;/property&gt;</span></div><div class='line' id='LC20'>&nbsp;&nbsp;<span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;defaultViews&quot;</span><span class="nt">&gt;</span></div><div class='line' id='LC21'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;list&gt;</span></div><div class='line' id='LC22'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;ref</span> <span class="na">bean=</span><span class="s">&quot;jsonView&quot;</span> <span class="nt">/&gt;</span></div><div class='line' id='LC23'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;ref</span> <span class="na">bean=</span><span class="s">&quot;xmlView&quot;</span> <span class="nt">/&gt;</span></div><div class='line' id='LC24'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;/list&gt;</span></div><div class='line' id='LC25'>&nbsp;&nbsp;<span class="nt">&lt;/property&gt;</span></div><div class='line' id='LC26'>&nbsp;&nbsp;<span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;ignoreAcceptHeader&quot;</span> <span class="na">value=</span><span class="s">&quot;true&quot;</span> <span class="nt">/&gt;</span></div><div class='line' id='LC27'><span class="nt">&lt;/bean&gt;</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1289371/66ec721d1fa99709925728bdeb7ea76f9d97b1da/rpc-context.xml" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1289371#file_rpc_context.xml" style="float:right;margin-right:10px;color:#666">rpc-context.xml</a>
            <a href="https://gist.github.com/1289371">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>First we configure the XMLMarshaller to generate XML out of the Java beans. Then we need 2 Views. One for XML and one for JSON. The most configuration needs the <em>ContentNegotiatingViewResolver</em>. This resolver handles the different response formats. The last property <em>ignoreAcceptHeader</em> you need to get JSON in your browser too. Otherwise always XML will be returned.</p>
<h4><span id="Configuring_the_webxml-5">Configuring the web.xml</span></h4>
<p>You need to activate the Spring servlet and the context listener to get the service running. This is done with a small web.xml.</p>
<div id="gist-1289371" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="nt">&lt;web-app&gt;</span></div><div class='line' id='LC2'>&nbsp;&nbsp;<span class="nt">&lt;context-param&gt;</span></div><div class='line' id='LC3'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;param-name&gt;</span>contextConfigLocation<span class="nt">&lt;/param-name&gt;</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;param-value&gt;</span>/WEB-INF/rpc-servlet.xml<span class="nt">&lt;/param-value&gt;</span></div><div class='line' id='LC5'>&nbsp;&nbsp;<span class="nt">&lt;/context-param&gt;</span></div><div class='line' id='LC6'>&nbsp;</div><div class='line' id='LC7'>&nbsp;&nbsp;<span class="nt">&lt;listener&gt;</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;listener-class&gt;</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;org.springframework.web.context.ContextLoaderListener</div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;/listener-class&gt;</span></div><div class='line' id='LC11'>&nbsp;&nbsp;<span class="nt">&lt;/listener&gt;</span></div><div class='line' id='LC12'>&nbsp;</div><div class='line' id='LC13'>&nbsp;&nbsp;<span class="nt">&lt;servlet&gt;</span></div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;servlet-name&gt;</span>rpc<span class="nt">&lt;/servlet-name&gt;</span></div><div class='line' id='LC15'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;servlet-class&gt;</span>org.springframework.web.servlet.DispatcherServlet<span class="nt">&lt;/servlet-class&gt;</span></div><div class='line' id='LC16'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;load-on-startup&gt;</span>1<span class="nt">&lt;/load-on-startup&gt;</span></div><div class='line' id='LC17'>&nbsp;&nbsp;<span class="nt">&lt;/servlet&gt;</span></div><div class='line' id='LC18'>&nbsp;</div><div class='line' id='LC19'>&nbsp;&nbsp;<span class="nt">&lt;servlet-mapping&gt;</span></div><div class='line' id='LC20'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;servlet-name&gt;</span>rpc<span class="nt">&lt;/servlet-name&gt;</span></div><div class='line' id='LC21'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;url-pattern&gt;</span>/rpc/*<span class="nt">&lt;/url-pattern&gt;</span></div><div class='line' id='LC22'>&nbsp;&nbsp;<span class="nt">&lt;/servlet-mapping&gt;</span></div><div class='line' id='LC23'><span class="nt">&lt;/web-app&gt;</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1289371/9ab96c4e6c65efa26201dbec2b92fefa075dccd4/web.xml" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1289371#file_web.xml" style="float:right;margin-right:10px;color:#666">web.xml</a>
            <a href="https://gist.github.com/1289371">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>Now we have all together and can start the web application. You can access the services with <em>http://localhost:8080/rpc/constellations</em>. As default format XML will be returned. If you want to have JSON change the URL into <em>http://localhost:8080/rpc/constellations.json</em>. Of course you can add .xml to get XML output, too.</p>
<p>If you want to have the data for one constellation you can use the 2nd controller method with <em>http://localhost:8080/rpc/constellation_by_code/and</em>. The last part of the URL is the official code/abbreviation of a constellation. All codes/abbreviations you can get <a title="List of all 88 constellations" href="http://en.wikipedia.org/wiki/List_of_constellations" target="_blank">here</a>. If you want the output as JSON you can add the extension <em>.json</em> too: <em>http://localhost:8080/rpc/constellation_by_code/and.json</em></p>
<h4><span id="Optimize_the_output-6">Optimize the output</span></h4>
<p>We have even 2 little problems:</p>
<ol>
<li>The Constellation class defines a byte array containing imagedata of a starcard. If we want to retrieve all constellations the response will be great.</li>
<li>The association will not be resolved. We want to get all names of a constellation with one request to minimize the response-request cycle.</li>
</ol>
<div><span class="Apple-style-span" style="line-height: 18px;">For the marshalling between XML and JAVA code we use <a title="More about XStream" href="http://xstream.codehaus.org/" target="_blank">XStream</a>. With this library you can (de-)serialize XML from Java and vice versa. With XStream you can add an annotation to a class property to avoid the serialization. This annotation is named <em>XStreamOmmitField</em>.</span></div>
<div id="gist-1289371" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="kd">public</span> <span class="kd">class</span> <span class="nc">Constellation</span><span class="o">{</span></div><div class='line' id='LC2'>&nbsp;&nbsp;<span class="o">...</span></div><div class='line' id='LC3'>&nbsp;&nbsp;<span class="nd">@XStreamOmmitField</span></div><div class='line' id='LC4'>&nbsp;&nbsp;<span class="kd">private</span> <span class="kt">byte</span><span class="o">[]</span> <span class="n">starCardData</span><span class="o">;</span></div><div class='line' id='LC5'><span class="o">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1289371/aed60984f7413c64cc36e146989702a41f703672/Constellation.java" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1289371#file_constellation.java" style="float:right;margin-right:10px;color:#666">Constellation.java</a>
            <a href="https://gist.github.com/1289371">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>
<br />
The 2nd problem can be solved with the @XStreamImplicit annotation. The collection will be resolved and ebedded in the return data. Additionally you can set the name of the parent element of the collection in the XML data.</p>
<p><div id="gist-1289371" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="kd">public</span> <span class="kd">class</span> <span class="nc">Constellation</span><span class="o">{</span></div><div class='line' id='LC2'><span class="o">...</span></div><div class='line' id='LC3'><br/></div><div class='line' id='LC4'><span class="nd">@XStreamImplicit</span><span class="o">(</span><span class="n">itemFiledName</span> <span class="o">=</span> <span class="s">&quot;names&quot;</span><span class="o">)</span></div><div class='line' id='LC5'><span class="kd">private</span> <span class="n">List</span><span class="o">&lt;</span><span class="n">ConstellationName</span><span class="o">&gt;</span> <span class="n">names</span><span class="o">;</span></div><div class='line' id='LC6'><span class="o">}</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1289371/519354ad901c69e597a058ea19ffd3a2f695fd2c/Constellation1.java" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1289371#file_constellation1.java" style="float:right;margin-right:10px;color:#666">Constellation1.java</a>
            <a href="https://gist.github.com/1289371">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>The XML result should look like</p>
<div id="gist-1289371" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="nt">&lt;constallation&gt;</span></div><div class='line' id='LC2'>&nbsp;&nbsp;<span class="nt">&lt;id&gt;</span>4<span class="nt">&lt;/id&gt;</span></div><div class='line' id='LC3'>&nbsp;&nbsp;<span class="nt">&lt;name&gt;</span>Andromeda<span class="nt">&lt;/name&gt;</span></div><div class='line' id='LC4'>&nbsp;&nbsp;<span class="nt">&lt;code&gt;</span>and<span class="nt">&lt;/code&gt;</span></div><div class='line' id='LC5'>&nbsp;&nbsp;...</div><div class='line' id='LC6'>&nbsp;&nbsp;<span class="nt">&lt;names&gt;</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;id&gt;</span>19<span class="nt">&lt;/id&gt;</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;name&gt;</span>Andromeda<span class="nt">&lt;/name&gt;</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;langCode&gt;</span>de<span class="nt">&lt;/langCode&gt;</span></div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;code&gt;</span>and<span class="nt">&lt;/code&gt;</span></div><div class='line' id='LC11'>&nbsp;&nbsp;<span class="nt">&lt;/names&gt;</span></div><div class='line' id='LC12'>&nbsp;&nbsp;<span class="nt">&lt;names&gt;</span></div><div class='line' id='LC13'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;id&gt;</span>20<span class="nt">&lt;/id&gt;</span></div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;name&gt;</span>Andromeda<span class="nt">&lt;/name&gt;</span></div><div class='line' id='LC15'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;langCode&gt;</span>en<span class="nt">&lt;/langCode&gt;</span></div><div class='line' id='LC16'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;code&gt;</span>and<span class="nt">&lt;/code&gt;</span></div><div class='line' id='LC17'>&nbsp;&nbsp;<span class="nt">&lt;/names&gt;</span></div><div class='line' id='LC18'>&nbsp;&nbsp;...</div><div class='line' id='LC19'><span class="nt">&lt;/constellation&gt;</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1289371/be6d663022d3dba800bce32c13dd31e134c1792c/result.xml" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1289371#file_result.xml" style="float:right;margin-right:10px;color:#666">result.xml</a>
            <a href="https://gist.github.com/1289371">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<h4><span id="Conclusion-7">Conclusion</span></h4>
<p>Now you have a Spring-based RESTful service created. As you can see there are not many code you must write. The most is configuration with annotation and some XML. With the @RequestMapping you can create powerful mappings from URL resources to controller methods. Another nice feature is to deliver the response as XML and JSON.</p>
<h4><span id="Resources-8">Resources</span></h4>
<address>You will find all the code snippets at <a title="All the code snippets of this article" href="https://gist.github.com/1289371" target="_blank">https://gist.github.com/1289371</a></address>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2011/10/15/creating-restful-webservices-with-the-spring-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Google&#8217;s webfonts</title>
		<link>http://www.thorsten-kamann.de/2011/09/13/using-googles-webfonts/</link>
		<comments>http://www.thorsten-kamann.de/2011/09/13/using-googles-webfonts/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 10:58:45 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[webfonts]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/?p=536</guid>
		<description><![CDATA[If you are searching for a cool font for your website you have at least 2 problems: Where to find a cool font with a adequate licence (OpenSource, Public Domain and so on) How do I manage that all visitors &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2011/09/13/using-googles-webfonts/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>If you are searching for a cool font for your website you have at least 2 problems:</p>
<ol>
<li>Where to find a cool font with a adequate licence (OpenSource, Public Domain and so on)</li>
<li>How do I manage that all visitors of my website this font have installed?</li>
</ol>
<h4>Embedding fonts in your website</h4>
<p>Every current browser supports loading fonts at runtime and embeds this font into the website (see <a title="Wikipedia: Webfont" href="http://en.wikipedia.org/wiki/Webfont" target="_blank">Webfonts</a>). So the visitor must not manually downloading and installing the font first.</p>
<p>With <a title="Google Webfonts" href="http://www.google.com/webfonts" target="_blank">Google&#8217;s webfonts</a> you can choose a cool font (all are Open Source) and embedding this into your website. This you can do with</p>
<ul>
<li>Adding a stylesheet link statement in your page header</li>
<li>Using the @import statement in your css</li>
<li>Using javascript</li>
</ul>
<p>If you want to embed with a stylesheet link add only</p>
<pre class="brush: css; light: true; title: ; notranslate">&lt;link href='http://fonts.googleapis.com/css?family=Ubuntu:300' rel='stylesheet' type='text/css'&gt;</pre>
<p>to your webpage header. Another approach is to use the @import statement directly in your css:</p>
<pre class="brush: css; light: true; title: ; notranslate">@import url(http://fonts.googleapis.com/css?family=Ubuntu:300);</pre>
<p>With both variants you can reference the font with</p>
<pre class="brush: css; light: true; title: ; notranslate">
font-face: Ubuntu, serif;
</pre>
<p>Ubuntu is only one the fonts Google offers.<br />
If you want to use Javascript to add a webfont to your webpage you can use this snippet:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
WebFontConfig = {
google: { families: [ 'Ubuntu:300:latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})(); &lt;/script&gt;
</pre>
<p>And now you have a nice font for your website.</p>
<h4>But how does this work?</h4>
<p>There is the @font-face definition in CSS3. This the Google Webfont-API use, too. If you load the URL you see in the examples above  a small css snippet will be returned:</p>
<pre class="brush: css; title: ; notranslate">@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: normal;
  src: local('Ubuntu'), url('http://themes.googleusercontent.com/static/fonts/ubuntu/v1/vRvZYZlUaogOuHbBTT1SNevvDin1pK8aKteLpeZ5c0A.woff') format('woff');
}</pre>
<p>So you can see that Google reuse the current web standards.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2011/09/13/using-googles-webfonts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy and paste code into Eclipse</title>
		<link>http://www.thorsten-kamann.de/2011/09/02/copy-and-paste-code-into-eclipse/</link>
		<comments>http://www.thorsten-kamann.de/2011/09/02/copy-and-paste-code-into-eclipse/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 09:20:01 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/?p=521</guid>
		<description><![CDATA[There is a cool feature in Eclipse: You can paste code you copied from antoher website into a source folder of Eclipse and all needed resources will be created: Package structure Class/Interface/Enum Code will be pasted into the newly created &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2011/09/02/copy-and-paste-code-into-eclipse/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>There is a cool feature in Eclipse: You can paste code you copied from antoher website into a source folder of Eclipse and all needed resources will be created:</p>
<ul>
<li>Package structure</li>
<li>Class/Interface/Enum</li>
<li>Code will be pasted into the newly created file</li>
</ul>
<div>For instance you&#8217;ll find this code anywhere in a tutorial:</div>
<pre lang="java">package a.b.c;</pre>
<pre lang="java">class A{
    public A(){}

    public void methodA(){
      System.out.println("This is a very useful class!");
    }
}</pre>
<div>Copy this code and paste it into an Eclipse source folder. After this a new package structure a/b/c and a new class A.java with the content exists.</div>
<div>

<a href='' title='Paste context menu in Eclipse'><img width="150" height="150" src="http://www.thorsten-kamann.de/wp-content/uploads/2011/09/eclipse_cp_1-150x150.png" class="attachment-thumbnail" alt="Paste context menu in Eclipse" title="Paste context menu in Eclipse" /></a>
<a href='' title='The copied source code'><img width="150" height="150" src="http://www.thorsten-kamann.de/wp-content/uploads/2011/09/eclipse_cp_2-150x150.png" class="attachment-thumbnail" alt="The copied source code" title="The copied source code" /></a>

</div>
<div>That&#8217;s all. A very useful feature&#8230;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2011/09/02/copy-and-paste-code-into-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Agile Backoffice Series] Introduction</title>
		<link>http://www.thorsten-kamann.de/2011/06/23/agile-backoffice-series-introduction/</link>
		<comments>http://www.thorsten-kamann.de/2011/06/23/agile-backoffice-series-introduction/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 22:24:24 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Agile BackOffice]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Continuous Deployment]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[JIRA]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/?p=509</guid>
		<description><![CDATA[This article series describes the Agile Backoffice environment. STOP! Agile&#8230; what? Ok. Let us start with some details about the Agile Backoffice. The Agile Backoffice If you start working agile &#8211; mostly you use Scrum as first agile method &#8211; &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2011/06/23/agile-backoffice-series-introduction/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>This article series describes the Agile Backoffice environment. STOP! Agile&#8230; what? Ok. Let us start with some details about the Agile Backoffice.</p>
<h3>The Agile Backoffice</h3>
<p>If you start working agile &#8211; mostly you use Scrum as first agile method &#8211; you and your team are very motivated to do this in a very agile way. The tasks are all pinned on a wall or a whiteboard, a continuous integration will be setup, the project know how will be shared in internal discussions. This works fine for a small team workingalways together in one location.</p>
<p>If you take a look around you see a lot of companies where this optimal conditions not exists. The teams are divided in different locations &#8211; different rooms, different floors, different locations. If your team splitted i such a way a whiteboard with pinned tasks are not a reasonable solution. Additionally to this you have a management interested in the progress of your work. For this requirements you need some tools supporting you. But you should use tools adaptable to your processes and not tools you must adaptable your processes to.</p>
<p>The central tool I choose for the Agile Backoffice is Atlassian Jira. It is the single proint of interest. In this tool you can see all requirements, the stories and the belonging tasks. Additionally you can get informations about changed (re)sources, running builds and &#8211; the most important &#8211; the status of a task, a story or requirement. You have a powerful reporting and a wide support for development tools: Eclipse, IntelliJ, Visual Studio.</p>
<p>Bit only with Jira you can&#8217;t get the result you wish. You need a continuous integration, a source control management, a repository for the deployable artifacts. Additionally you want to review and mesure the quality of your code. For this approaches there are tools but this tools should all be connected together, so there are based on the same data.</p>
<p>This is the goal of the Agile Backoffice and this series of articles. So stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2011/06/23/agile-backoffice-series-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vortragsreihe Dortmund 09.05.2011: Effizente Entwicklung für verteilte Projekte</title>
		<link>http://www.thorsten-kamann.de/2011/04/13/vortragsreihe-dortmund-09-05-2011-effizente-entwicklung-fur-verteilte-projekte/</link>
		<comments>http://www.thorsten-kamann.de/2011/04/13/vortragsreihe-dortmund-09-05-2011-effizente-entwicklung-fur-verteilte-projekte/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 19:44:57 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Events (German)]]></category>
		<category><![CDATA[Gerrit]]></category>
		<category><![CDATA[GIT]]></category>
		<category><![CDATA[Hudson]]></category>
		<category><![CDATA[Sonar]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/?p=504</guid>
		<description><![CDATA[Effizente Entwicklung für verteilte Projekte &#8211; Mit GIT, Gerrit, Hudson und Sonar die Kontrolle behalten. In verteilten Projekten arbeiten viele Entwickler eigenständig an unterschiedlichen Features und wollen diese zu einem Gesamtprojekt beisteuern. Damit die Integration der Beiträge effizient gelingen kann, &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2011/04/13/vortragsreihe-dortmund-09-05-2011-effizente-entwicklung-fur-verteilte-projekte/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<h4>Effizente Entwicklung für verteilte Projekte &#8211; Mit GIT, Gerrit, Hudson  und Sonar die Kontrolle behalten.</h4>
<p><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=id=7058706&amp;doc=gghs-110225102244-phpapp01" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent" /><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=id=7058706&amp;doc=gghs-110225102244-phpapp01" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355" wmode="transparent"></embed></object></p>
<p>In verteilten Projekten arbeiten viele Entwickler eigenständig an  unterschiedlichen Features und wollen<br />
diese zu einem Gesamtprojekt beisteuern. Damit die Integration der  Beiträge effizient gelingen kann,<br />
müssen Toolchain und Prozess drei wichtige Merkmale unterstützen:</p>
<ul>
<li>Schnelle und technisch unkomplizierte Integration von Features.</li>
<li>Review/Kontrolle der Qualität der Beiträge vor ihrer Integration.</li>
<li>kontinuierliche Messung der Codequalität an einem einheitlichen und  gleichbleibenden Standard.</li>
</ul>
<p>Ich zeige in meinem Vortrag, wie sich diese Anforderungen  mit GIT, Gerrit, Hudson und Sonar<br />
erfüllen lassen und der Entwicklungsprozess in verteilten Projekten  effizient gestaltet werden kann.</p>
<p>Git ist als Source-Code-Management-System für OSS-Projekte entwickelt  worden, deren starke Verteilung<br />
besonders charakteristisch für sie ist. Mit Gerrit können GIT-verwaltete  Projekte vor dem eigentlichen Commit<br />
in ein zentrales Sourcecode-Repository bewertet und kommentiert werden.  Dies erleichtert den Maintainern die<br />
Entscheidung, ob sie einen Beitrag akzeptieren wollen.<br />
Hudson gewährleistet die kontinuierliche Integration akzeptierter  Beiträge und integriert Sonar, um die<br />
Entwicklung der Codequalität, gemessen an einem projektweit  einheitlichen Standard, zu bewerten.</p>
<p>Lernen Sie, wie die nahtlose Integration dieser Werkzeuge in einem  gemeinsamen Prozess gelingt und behalten<br />
Sie die Kontrolle über verteilte Projekte.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2011/04/13/vortragsreihe-dortmund-09-05-2011-effizente-entwicklung-fur-verteilte-projekte/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BED 2011: Effizente Entwicklung für verteilte Projekte &#8211; Mit GIT, Gerrit, Hudson und Sonar die Kontrolle behalten.</title>
		<link>http://www.thorsten-kamann.de/2011/03/18/bed-2011-effizente-entwicklung-fur-verteilte-projekte-mit-git-gerrit-hudson-und-sonar-die-kontrolle-behalten/</link>
		<comments>http://www.thorsten-kamann.de/2011/03/18/bed-2011-effizente-entwicklung-fur-verteilte-projekte-mit-git-gerrit-hudson-und-sonar-die-kontrolle-behalten/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 11:34:01 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Events (German)]]></category>
		<category><![CDATA[Gerrit]]></category>
		<category><![CDATA[GIT]]></category>
		<category><![CDATA[Hudson]]></category>
		<category><![CDATA[Software Quality]]></category>
		<category><![CDATA[Sonar]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/?p=499</guid>
		<description><![CDATA[Es gibt einen Talk von mir auf den Berlin Expert Days 2011: Effizente Entwicklung für verteilte Projekte &#8211; Mit GIT, Gerrit, Hudson und Sonar die Kontrolle behalten. In verteilten Projekten arbeiten die Entwickler eigenständig an Features und steuern diese zu &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2011/03/18/bed-2011-effizente-entwicklung-fur-verteilte-projekte-mit-git-gerrit-hudson-und-sonar-die-kontrolle-behalten/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Es gibt einen Talk von mir auf den <a href="https://bed-con.org/index.php" target="_blank">Berlin Expert Days 2011</a>:</p>
<p><strong id="vortrag22">Effizente Entwicklung für verteilte Projekte &#8211; Mit GIT, Gerrit, Hudson und Sonar die Kontrolle behalten.</strong></p>
<p><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=id=7058706&amp;doc=gghs-110225102244-phpapp01" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent" /><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=id=7058706&amp;doc=gghs-110225102244-phpapp01" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355" wmode="transparent"></embed></object></p>
<p>In verteilten Projekten arbeiten die Entwickler eigenständig an Features und steuern diese zu einem Projekt bei. Damit die Integration der Beiträge gelingt, müssen Tools und Prozess einige Merkmale unterstützen:</p>
<ul>
<li>Schnelle und technisch unkomplizierte Integration.</li>
<li>Review der Beiträge vor ihrer Integration.</li>
<li>Messung der Qualität am Projektstandard.</li>
</ul>
<p>Thorsten Kamann zeigt, wie sich die Anforderungen mit GIT, Gerrit, Hudson und Sonar erfüllen lassen und die Entwicklung in verteilten Projekten effizient gestaltet wird.  Git ist als SCM für OSS-Projekte entwickelt worden, deren starke Verteilung besonders charakteristisch ist. Mit Gerrit können GIT-verwaltete Projekte vor dem Commit in ein SCM bewertet und kommentiert werden. Dies erleichtert den Maintainern die Entscheidung über die Akzeptanz. Hudson gewährleistet die kontinuierliche Integration akzeptierter Beiträge und integriert Sonar, zur Bewertung der Codequalität, gemessen am Projektstandard.</p>
<p>Weitere Informationen und Anmeldung: <a href="https://bed-con.org/index.php" target="_blank">https://bed-con.org/index.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2011/03/18/bed-2011-effizente-entwicklung-fur-verteilte-projekte-mit-git-gerrit-hudson-und-sonar-die-kontrolle-behalten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vortragsreihe Bonn 23.02.2011: Effizente Entwicklung für verteilte Projekte</title>
		<link>http://www.thorsten-kamann.de/2011/02/04/vortragsreihe-bonn-23-02-2011-effizente-entwicklung-fur-verteilte-projekte/</link>
		<comments>http://www.thorsten-kamann.de/2011/02/04/vortragsreihe-bonn-23-02-2011-effizente-entwicklung-fur-verteilte-projekte/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 23:21:40 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Events (German)]]></category>
		<category><![CDATA[Gerrit]]></category>
		<category><![CDATA[GIT]]></category>
		<category><![CDATA[Hudson]]></category>
		<category><![CDATA[Sonar]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/?p=488</guid>
		<description><![CDATA[Effizente Entwicklung für verteilte Projekte &#8211; Mit GIT, Gerrit, Hudson und Sonar die Kontrolle behalten. In verteilten Projekten arbeiten viele Entwickler eigenständig an unterschiedlichen Features und wollen diese zu einem Gesamtprojekt beisteuern. Damit die Integration der Beiträge effizient gelingen kann, &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2011/02/04/vortragsreihe-bonn-23-02-2011-effizente-entwicklung-fur-verteilte-projekte/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<h4>Effizente Entwicklung für verteilte Projekte &#8211; Mit GIT, Gerrit, Hudson  und Sonar die Kontrolle behalten.</h4>
<p><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=id=7058706&amp;doc=gghs-110225102244-phpapp01" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent" /><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=id=7058706&amp;doc=gghs-110225102244-phpapp01" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355" wmode="transparent"></embed></object></p>
<p>In verteilten Projekten arbeiten viele Entwickler eigenständig an  unterschiedlichen Features und wollen<br />
diese zu einem Gesamtprojekt beisteuern. Damit die Integration der  Beiträge effizient gelingen kann,<br />
müssen Toolchain und Prozess drei wichtige Merkmale unterstützen:</p>
<ul>
<li>Schnelle und technisch unkomplizierte Integration von Features.</li>
<li>Review/Kontrolle der Qualität der Beiträge vor ihrer Integration.</li>
<li>kontinuierliche Messung der Codequalität an einem einheitlichen und  gleichbleibenden Standard.</li>
</ul>
<p>Ich zeige in meinem Vortrag, wie sich diese Anforderungen  mit GIT, Gerrit, Hudson und Sonar<br />
erfüllen lassen und der Entwicklungsprozess in verteilten Projekten  effizient gestaltet werden kann.</p>
<p>Git ist als Source-Code-Management-System für OSS-Projekte entwickelt  worden, deren starke Verteilung<br />
besonders charakteristisch für sie ist. Mit Gerrit können GIT-verwaltete  Projekte vor dem eigentlichen Commit<br />
in ein zentrales Sourcecode-Repository bewertet und kommentiert werden.  Dies erleichtert den Maintainern die<br />
Entscheidung, ob sie einen Beitrag akzeptieren wollen.<br />
Hudson gewährleistet die kontinuierliche Integration akzeptierter  Beiträge und integriert Sonar, um die<br />
Entwicklung der Codequalität, gemessen an einem projektweit  einheitlichen Standard, zu bewerten.</p>
<p>Lernen Sie, wie die nahtlose Integration dieser Werkzeuge in einem  gemeinsamen Prozess gelingt und behalten<br />
Sie die Kontrolle über verteilte Projekte.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2011/02/04/vortragsreihe-bonn-23-02-2011-effizente-entwicklung-fur-verteilte-projekte/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snow Leopard Update 10.6.5 breaks some Mail plugins</title>
		<link>http://www.thorsten-kamann.de/2010/11/11/snow-leopard-update-10-6-5-breaks-some-mail-plugins/</link>
		<comments>http://www.thorsten-kamann.de/2010/11/11/snow-leopard-update-10-6-5-breaks-some-mail-plugins/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 07:32:52 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://blog.kamann.info/?p=400</guid>
		<description><![CDATA[If you recently updated to Snow Leopard 10.6.5 you can see an alert at starttime of Mail. In this alert Mail says that he disabling some plugins. At my MBP the candidates were Letterbox, Herald and GPG. Bit there is &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2010/11/11/snow-leopard-update-10-6-5-breaks-some-mail-plugins/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>If you recently updated to Snow Leopard 10.6.5 you can see an alert at starttime of Mail. In this alert Mail says that he disabling some plugins. At my MBP the candidates were Letterbox, Herald and GPG. Bit there is a quick workaround for this:</p>
<p>Navigate with finder to <span style="font-family: 'andale mono', times;">/Users/USER_NAME/Library/Mail</span>. There are many directories. Here you search for the disabled mailbundle. Some of the directories are namend <span style="font-family: 'andale mono', times;">Bundle (deactivated*)</span>. In this kind of directory Mail moved the plugins. After you found the mailbundle open it with the command <em>Show Contents</em> and navigate to the <span style="font-family: 'andale mono', times;">Info.plist</span>. Open it with a double click and add to entries to the section SupportedPluginCompatabilityUUID. The both entries must have this values:</p>
<ul>
<li><span style="font-family: 'andale mono', times;">BDD81F4D-6881-4A8D-94A7-E67410089EEB</span></li>
<li><span style="font-family: 'andale mono', times;">857A142A-AB81-4D99-BECC-D1B55A86D94E</span></li>
</ul>
<p>Close the PList-Editor and restart Mail. All plugins should be enabled.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2010/11/11/snow-leopard-update-10-6-5-breaks-some-mail-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add LDAP-Support in XWiki</title>
		<link>http://www.thorsten-kamann.de/2010/09/08/add-ldap-support-in-xwiki/</link>
		<comments>http://www.thorsten-kamann.de/2010/09/08/add-ldap-support-in-xwiki/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 21:46:14 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[XWiki]]></category>

		<guid isPermaLink="false">http://www.bobdveloper.de/?p=97</guid>
		<description><![CDATA[If you use XWiki &#8211; a wiki software written in Java &#8211; you need to enable LDAP-Support manually. Editing the xwiki.cfg This is the main configuration file in XWiki. You&#8217;ll find it in /WEB-INF/xwiki.cfg. The content of this file is &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2010/09/08/add-ldap-support-in-xwiki/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>If you use XWiki &#8211; a wiki software written in Java &#8211; you need to enable LDAP-Support manually.</p>
<h4>Editing the xwiki.cfg</h4>
<p>This is the main configuration file in XWiki. You&#8217;ll find it in /WEB-INF/xwiki.cfg. The content of this file is a little bit confusing. Try to find the section marked with</p>
<pre>
<div id="_mcePaste"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal; font-size: 13px;">
<pre style="font: normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">#-------------------------------------------
# LDAP
#-------------------------------------------</pre>
<p></span></div>
</pre>
<p>In this section you will configuring the LDAP-Support. The following table describing the most important options:</p>
<table style="border-width: 1px; border-style: solid;" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr style="background-color: #eeeeee;">
<td>xwiki.authentication.ldap</td>
<td>Set this to 1 to enable the LDAP-Support</td>
</tr>
<tr style="border: 1px solid black;">
<td>xwiki.authentication.ldap.server<br />
xwiki.authentication.ldap.port</td>
<td>The server and port of your LDAP-Server</td>
</tr>
<tr style="background-color: #eeeeee;">
<td>xwiki.authentication.ldap.bind_DN<br />
xwiki.authentication.ldap.bind_pass</td>
<td>If you need a user and password to access the LDAP-Server you can enter them here.<br />
Leave it empty if you don&#8217;t need any.</td>
</tr>
<tr style="border: 1px solid black;">
<td>xwiki.authentication.ldap.user_group</td>
<td>Limit the access to only the members of this group.</td>
</tr>
<tr style="background-color: #eeeeee;">
<td>xwiki.authentication.ldap.exclude_group</td>
<td>Only users not member of this group can login .</td>
</tr>
<tr style="border: 1px solid black;">
<td>xwiki.authentication.ldap.base_DN</td>
<td>The base DN to use.</td>
</tr>
<tr style="background-color: #eeeeee;">
<td>xwiki.authentication.ldap.UID_attr</td>
<td>The uid attribute to use. Commonly this is <em>cn</em>, but often it can be <em>uid</em>, too.</td>
</tr>
<tr style="border: 1px solid black;">
<td>xwiki.authentication.ldap.password_field</td>
<td>The password field, commonly <em>userPassword</em>.</td>
</tr>
<tr style="background-color: #eeeeee;">
<td>xwiki.authentication.ldap.fields_mapping</td>
<td>XWiki enables you to map the users attribute of XWiki to the users attribute in LDAP (see sample).</td>
</tr>
<tr style="border: 1px solid black;">
<td>xwiki.authentication.ldap.update_user</td>
<td>With setting to 1 you enable the sync of the user data at every login. If not desired set it to 0.</td>
</tr>
<tr style="background-color: #eeeeee;">
<td>xwiki.authentication.ldap.group_mapping</td>
<td>Maps the LDAP groups to XWiki groups.</td>
</tr>
<tr style="border: 1px solid black;">
<td>xwiki.authentication.ldap.mode_group_sync</td>
<td>If you set this option to always the group data will be synced at every logon. Use create to disable this.<br />
In this case the data will be synced once at the first login.</td>
</tr>
<tr style="background-color: #eeeeee;">
<td>xwiki.authentication.ldap.trylocal</td>
<td>If the authentication failed XWiki is trying to authenticate locale.</td>
</tr>
<tr style="border: 1px solid black;">
<td>xwiki.authentication.ldap.ssl</td>
<td>With 1 you enable SSL. With 0 you disable it.</td>
</tr>
<tr style="background-color: #eeeeee;">
<td>xwiki.authentication.ldap.ssl.keystore</td>
<td>The keystore to use.</td>
</tr>
</tbody>
</table>
<h4>Sample configuration</h4>
<pre>#-------------------------------------------
# LDAP
#-------------------------------------------

xwiki.authentication.ldap=1
xwiki.authentication.ldap.server=127.0.0.1
xwiki.authentication.ldap.port=389
xwiki.authentication.ldap.bind_DN=
xwiki.authentication.ldap.bind_pass=
xwiki.authentication.ldap.base_DN=dc=myserver,dc=local
xwiki.authentication.ldap.UID_attr=uid
xwiki.authentication.ldap.password_field=userPassword
xwiki.authentication.ldap.group_classes=groupOfNames
xwiki.authentication.ldap.group_memberfields=member
xwiki.authentication.ldap.fields_mapping=last_name=\
     sn,first_name=givenName,email=mail
xwiki.authentication.ldap.update_user=1
xwiki.authentication.ldap.group_mapping=\
    XWiki.XWikiAdminGroup=cn=admins,ou=groups,dc=myserver,dc=local|\
    XWiki.XWikiEditors=cn=developers,ou=groups,dc=myserver,dc=local|\
    XWiki.XWikiEditors=cn=managers,ou=groups,dc=myserver,dc=local|\
    XWiki.XWikiReaders=cn=users,ou=groups,dc=myserver,dc=local
xwiki.authentication.ldap.trylocal=1</pre>
<p>In this configuration we are mapping 3 XWiki groups (XWikiAdminGroup, XWikiEditors, XWikiReaders) to 4 LDAP groups. The XWIkiEditors should get the members of the developers and managers out of the LDAP server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2010/09/08/add-ldap-support-in-xwiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

