<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	
	<channel>
		<title>mftech blog</title>
		<link>http://www.mftech.org/blog/index.php</link>
		<description>the mftech blog</description>
		<language>en</language>
		<managingEditor>martin.fluegge@mftech.org</managingEditor>
                <copyright>Copyright 2012</copyright>
		<generator>Pivot Pivot - 1.40.6: 'Dreadwind'</generator>
		<pubDate>Thu, 27 Sep 2012 19:09:02 +0200</pubDate>
		<ttl>60</ttl>
		
		
		
		
		<item>
			<title>Slides for the Dawn talk (EclipseConEurope 2011) available</title>
			<link>http://www.mftech.org/blog/pivot/entry.php?id=28</link>
			<comments>http://www.mftech.org/blog/pivot/entry.php?id=28#comm</comments>
                        <description><![CDATA[ Just a very quick note:<br />
<br />
The slides for the Dawn talk from this year's Eclipse Con are available on the <a rel="external" href="http://www.eclipse.org/cdo/documentation/presentations/" title="">CDO Homepage</a>. ]]></description>
			<guid isPermaLink="false">28@http://mftech.org/blog/pivot/</guid>
			<category>default</category>
			<pubDate>Sun, 06 Nov 2011 13:04:00 +0200</pubDate>
		</item>
		
		
		
		<item>
			<title>Distributed Ecore development, really? Yeah!</title>
			<link>http://www.mftech.org/blog/pivot/entry.php?id=27</link>
			<comments>http://www.mftech.org/blog/pivot/entry.php?id=27#comm</comments>
                        <description><![CDATA[ It is end of June and as every year a new version of Eclipse has been released. And together with this release comes the new version of Dawn - Dawn 1.0. Dawn 1.0 contains several bug fixes but more important are the new features. First of all to mention is the support for the good all tree-based EMF editors which can be generated straight from your EMF generator models. Dawn now supports generating a fragment-based extension as for GMF editors. This makes it possible to collaborate your editors with just some clicks and without the need of programming anything be yourself. <br />
<br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/dsc00152.jpg' class="thickbox" title="" rel="entry-27 external" ><img src="http://www.mftech.org/blog/images/dsc00152.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
<br />
With this new version Dawn introduces a split up generator model. The old DawnGenmodel was only one file which contained generator descriptors for the target extension (GMF, EMF, etc). Now it is separated into at least two files - the main DawnGenerator model and a target specific one. The specific generator model contains information about the target itself. In the context of EMF and GMF this means that it references the related generator model to get access to generation relevant data. It also allows customizing the generated extension (e.g the naming of classes). With the introduction of collaboration EMF editors, Dawn knows two different types of specific generator models - Dawn EMF GenModel (*dawngenmoldel_emf) and Dawn GMF GenModel (*dawngenmoldel_gmf).<br />
<br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/dsc00060.jpg' class="thickbox" title="" rel="entry-27 external" ><img src="http://www.mftech.org/blog/images/dsc00060.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
<br />
The main model (*.dawngenmodel) on the other site contains general settings which will influence all editors, e.g. coloring. This file is only generated once and is referenced by all specific Dawn gen models. <br />
The reason for this split was to separate Dawn from the underlying frameworks and let it only depend on what is really needed. Thus it is possible to run the generator for the collaborative EMF extension without having GMF installed. <br />
For not bothering the user with different editors, Dawn provides a new generation editor which allows having all generation information at one place. For this it can open every specific gen model which is found in the same folder as the main model and displays it on a separated page. How to create your own extensions is described in this <a rel="external" href="http://wiki.eclipse.org/Dawn_Codegen" title="">tutorial</a>. <br />
<br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/ecoreeditor.jpg' class="thickbox" title="" rel="entry-27 external" ><img src="http://www.mftech.org/blog/images/ecoreeditor.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
<br />
With this set of generators ready, Dawn started to provide extensions for exiting frameworks. And what would be more obvious than providing collaborative tooling for the one and only, the number one model, the mother of all our models itself? Well, nothing I guess and that's why I wrote an extension for the Ecore Model Editor. This was actually an easy task, since the Ecore Editor's implementation is quite close to all other generated EMF-model editors and so I just used the brand new generator to create the Dawn extension fragment. But that's not all. Using the existing tooling I created the extension for the graphical Ecore Tools editor likewise. With these both extensions Dawn now supports the most common editors for Ecore modeling. But we won't stop here. While ready for the Juno development we are going to integrate other frameworks like Graphiti to provide similar collaborative extension. They tuned. Till then, enjoy Indigo ;) ]]></description>
			<guid isPermaLink="false">27@http://mftech.org/blog/pivot/</guid>
			<category>default</category>
			<pubDate>Tue, 28 Jun 2011 19:54:00 +0200</pubDate>
		</item>
		
		
		
		<item>
			<title>It's demo time</title>
			<link>http://www.mftech.org/blog/pivot/entry.php?id=26</link>
			<comments>http://www.mftech.org/blog/pivot/entry.php?id=26#comm</comments>
                        <description><![CDATA[ It is June again and as usual there have been a lot of demo camps around the world organized to welcome the new eclipse release - Indigo. And certainly there will be at least one demo camp where I will show the latest Dawn features. I am amazed when I look back to November 2008 when I showed the first prototype of Dawn on the demo camp in Leipzig. That time (in the good old days of Dawn 0.1) Dawn was nothing but the coming goal of me diploma thesis. After porting Dawn to CDO and bringing it back to life inside the eclipse ecosystem I have learned so many things, met do many wonderful people, traveled to cool places that I just can't believe that it all started with a simple idea at the beginning of my thesis. <br />
<br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/soldat.jpg' class="thickbox" title="" rel="entry-26 external" ><img src="http://www.mftech.org/blog/images/soldat.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
<br />
This time I traveled far to the West of Germany to wake the peoples' interest for collaborative modeling. To be exact - to Bonn. If it happens that you are in this area tomorrow event just join us and watch a lot of interesting talks about the latest eclipse technologies. The <a rel="external" href="http://wiki.eclipse.org/Eclipse_DemoCamps_Indigo_2011/Bonn" title="">demo camp</a> will start at 18:15 pm at the Collegium Leoninum Bonn.<br />
<br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/bon_jovi.jpg' class="thickbox" title="" rel="entry-26 external" ><img src="http://www.mftech.org/blog/images/bon_jovi.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
<br />
You should also join the demo camp in <a rel="external" href="http://wiki.eclipse.org/Eclipse_DemoCamps_Indigo_2011/Berlin" title="">Berlin</a> which is organized by <a rel="external" href="http://www.esc-net.de/" title="">ES Computersysteme</a> and <a rel="external" href="http://www.mftech.org" title="">MFTechnologies</a>, or in other words - by Eike and me. This year we have a wide range of interesting topics covering modeling, testing or mobile applications. Or demo camp will start at 17:30 p.m. at the Charite. So come and join us and enjoy a wonderful and interesting evening with us. ]]></description>
			<guid isPermaLink="false">26@http://mftech.org/blog/pivot/</guid>
			<category>default</category>
			<pubDate>Mon, 13 Jun 2011 21:01:00 +0200</pubDate>
		</item>
		
		
		
		<item>
			<title>Slides for the Dawn talk (EclipseCon2011) available</title>
			<link>http://www.mftech.org/blog/pivot/entry.php?id=25</link>
			<comments>http://www.mftech.org/blog/pivot/entry.php?id=25#comm</comments>
                        <description><![CDATA[ The slides for the Dawn talk are now online. Everybody who likes to have a second look to the slides will find them <a rel="external" href="http://www.eclipse.org/cdo/documentation/presentations/" title="">here</a>.<br />
<br />
Thanks for a wonderful EclipseCon. Hope to see you all next year. ]]></description>
			<guid isPermaLink="false">25@http://mftech.org/blog/pivot/</guid>
			<category>default</category>
			<pubDate>Tue, 05 Apr 2011 19:07:00 +0200</pubDate>
		</item>
		
		
		
		<item>
			<title>It always rains in northern California</title>
			<link>http://www.mftech.org/blog/pivot/entry.php?id=24</link>
			<comments>http://www.mftech.org/blog/pivot/entry.php?id=24#comm</comments>
                        <description><![CDATA[ Isn't this the title of a famous <a rel="external" href="http://en.wikipedia.org/wiki/It_Never_Rains_in_Southern_California" title="">song</a>? For me, who is the first time in California, it seems to hold some truth. Unfortunately, since we arrived the weather stayed rainy and windy. But I was told that this is quite unusual for this time, so I hope to be able to use my sun classes next year ;) <br />
<br />
But anyway, actually I would like to call your attention again to my <a rel="external" href="http://www.eclipsecon.org/2011/sessions/?page=sessions&id=2145" title="">talk</a> today. If you are interested in collaborative modeling user interface and want to see how GMF and other EMF based editors are operating distributed on a shared model, come and see the latest state in <a rel="external" href="http://wiki.eclipse.org/Dawn" title="">Dawn</a> development.<br />
<p align='center'><b>Thursday, 24 March 2011<br />
14:30, Stevens Creek</b></p> ]]></description>
			<guid isPermaLink="false">24@http://mftech.org/blog/pivot/</guid>
			<category>default</category>
			<pubDate>Thu, 24 Mar 2011 17:47:00 +0200</pubDate>
		</item>
		
		
		
		<item>
			<title>ThreeDeeWorld</title>
			<link>http://www.mftech.org/blog/pivot/entry.php?id=23</link>
			<comments>http://www.mftech.org/blog/pivot/entry.php?id=23#comm</comments>
                        <description><![CDATA[ Today is the day that Eike and I are going to present CDO quite <a rel="external" href="http://www.eclipsecon.org/2011/sessions/?page=sessions&id=2161" title="">differently</a>. Since the best way to learn about something is to open it up and look inside, we decided it is time for another style of presentation. Instead of providing a set of power point slides we will visualize the main concepts of CDO in a more illustrative <a rel="external" href="http://thegordian.blogspot.com/2011/03/cdo-enters-3rd-dimension.html" title="">way</a>.<br />
<br />
Note that the room changed from Ballroom D to Ballroom BC (14:30).<br />
<br />
If you are not satisfied with learning about all the cool and fancy features from the world of CDO, do not miss my talk on <a rel="external" href="http://www.eclipsecon.org/2011/sessions/?page=sessions&id=2145" title="">Thursday</a> (14:30, Stevens Creek), when I will talk about Dawn and it's latest features and the upcoming plans for Indigo.<br />
<br />
Hope to see you in both talks. <br />
<br />
Enjoy the EclipseCon :) ]]></description>
			<guid isPermaLink="false">23@http://mftech.org/blog/pivot/</guid>
			<category>default</category>
			<pubDate>Mon, 21 Mar 2011 14:42:00 +0200</pubDate>
		</item>
		
		
		
		<item>
			<title>Equinox, Jetty and Jax-WS</title>
			<link>http://www.mftech.org/blog/pivot/entry.php?id=22</link>
			<comments>http://www.mftech.org/blog/pivot/entry.php?id=22#comm</comments>
                        <description><![CDATA[ Developing web apps with J2EE is quite easy. But handling all those dependencies in the WEB-INF folder can be a real pain. Especially if you are used to OSGi and quite modular applications. Well, luckily someone came to the nice idea to bring both things together which finally resulted in OSGI RFC 66. This implementation on Equinox together with Jetty brings up a nice modular development environment for web application. But thinks could become more complicated if SOAP-based web services are involved. Recently I tried to bring up some services on a Jetty/Equinox based application which turned out to be more complicated than expected. <br />
<br />
When I finally had all pieces together it did not look that complicated, but the road was a quite rocky one. Since I did not find a tutorial which described how to bring up Jax-WS services on a Jetty/Equinox platform I decided to write my own...and here it is ;)<br />
<br />
First, download a fresh Eclipse from <href="http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.6.1-201009090800/eclipse-SDK-3.6.1-win32.zip" title="">here</a>. We will use a fresh IDE to show which additional dependencies are needed if you start from the scratch.<br />
<br />
After downloading, unzipping and starting the IDE we will add those dependencies to your development environment. <br />
First you need to install the correct runtime dependencies for Jetty. We are using Jetty 7.1.3 which can be retrieved from the Jetty update page <a rel="external" href="http://download.eclipse.org/jetty/7.1.3.v20100526/repository" title="">http://download.eclipse.org/jetty/7.1.3.v20100526/repository</a>).<br />
From the update site select "Jetty Target Components" and install this feature.<br />
<br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/1_install.jpg' class="thickbox" title="" rel="entry-22 external" ><img src="http://www.mftech.org/blog/images/1_install.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
 <br />
<br />
Now we will focus on the business logic. We will take a small, well, very small example for our webservice. Just imagine that you would have a toll which allows collecting and manipulating data about people. First we will create a small bundle which will act as a container for our business data. Select File-&gt;New-&gt;Other and create a Plug-ing Project names "org.mftech.examples.web.persons"<br />
 <br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/2_new.jpg' class="thickbox" title="" rel="entry-22 external" ><img src="http://www.mftech.org/blog/images/2_new.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
<br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/3_new_2.jpg' class="thickbox" title="" rel="entry-22 external" ><img src="http://www.mftech.org/blog/images/3_new_2.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
 <br />
<br />
We won't make any UI contribution and will not create an RCP.<br />
 <br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/4_new_3.jpg' class="thickbox" title="" rel="entry-22 external" ><img src="http://www.mftech.org/blog/images/4_new_3.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
<br />
Next we need a class to hold the information for a person. Let's be a bit creative and call it...Person. A Person should be named and we want to know how old a person is. In addition we want to collect the same information for the person's children. And it might be interesting which sex a person has. We will also provide a unique identifier to make it easier to find a person in our system. Putting all this together results in the following class.<br />
<br />
<br />
<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
	package org.mftech.examples.web.persons;<br />
<br />
import java.util.ArrayList;<br />
import java.util.List;<br />
<br />
<span style="color:Purple;"><b>public</b></span> class Person<br />
{<br />
	<span style="color:Purple;"><b>public</b></span> enum Sex<br />
	{<br />
		male, female, extraterrestrial_hybrid<br />
	}<br />
<br />
	private int id;<br />
<br />
	private Sex sex;<br />
<br />
	private String name;<br />
<br />
	private int age;<br />
<br />
	private List&lt;Person&gt; children;<br />
<br />
	<span style="color:Purple;"><b>public</b></span> void setSex(Sex sex)<br />
	{<br />
		this.sex = sex;<br />
	}<br />
<br />
	<span style="color:Purple;"><b>public</b></span> Sex getSex()<br />
	{<br />
		return sex;<br />
	}<br />
<br />
	<span style="color:Purple;"><b>public</b></span> void setName(String name)<br />
	{<br />
		this.name = name;<br />
	}<br />
<br />
	<span style="color:Purple;"><b>public</b></span> String getName()<br />
	{<br />
		return name;<br />
	}<br />
<br />
	<span style="color:Purple;"><b>public</b></span> void setAge(int age)<br />
	{<br />
		this.age = age;<br />
	}<br />
<br />
	<span style="color:Purple;"><b>public</b></span> int getAge()<br />
	{<br />
		return age;<br />
	}<br />
<br />
	<span style="color:Purple;"><b>public</b></span> void setChildren(List&lt;Person&gt; children)<br />
	{<br />
		this.children = children;<br />
	}<br />
<br />
	<span style="color:Purple;"><b>public</b></span> List&lt;Person&gt; getChildren()<br />
	{<br />
		if (children == null)<br />
		{<br />
			children = new ArrayList&lt;Person&gt;();<br />
		}<br />
<br />
		return children;<br />
	}<br />
<br />
	<span style="color:Purple;"><b>public</b></span> void setId(int id)<br />
	{<br />
		this.id = id;<br />
	}<br />
<br />
	<span style="color:Purple;"><b>public</b></span> int getId()<br />
	{<br />
		return id;<br />
	}<br />
}<br />
<br />
</td></tr><br />
</table><br />
 <br />
I promised to keep it simple so that's enough for our business model. Now let us focus on the web site of the story. To handle out web container will again will create a bundle. This time named "org.mftech.exampples.web.soap". We will create a pure OSGi bundle. <br />
<br />
 <p style="text-align:center;"><a href='http://www.mftech.org/blog/images/5_another_new_.jpg' class="thickbox" title="" rel="entry-22 external" ><img src="http://www.mftech.org/blog/images/5_another_new_.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
<br />
Since we want to use the cool RFC 66 features the first thing we need to do is to tweak the Manifest.MF a bit. Add the Web-ContextPath to the file and make it look like the one below.<br />
<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
Manifest-Version: 1.0<br />
Bundle-ManifestVersion: 2<br />
Bundle-Name: Soap<br />
Bundle-SymbolicName: org.mftech.exampples.web.soap<br />
Bundle-Version: 1.0.0.qualifier<br />
Bundle-Activator: org.mftech.exampples.web.soap.Activator<br />
Bundle-ActivationPolicy: lazy<br />
Bundle-RequiredExecutionEnvironment: JavaSE-1.6<br />
Import-Package: org.osgi.framework;version="1.3.0"<br />
Web-ContextPath: /persons<br />
<br />
</td></tr><br />
</table><br />
 <br />
Because the RFC66 implementation will search the bundle for a WEB-INF folder containing a web.xml we need to provided both. Create the folder and place in the web.xml.<br />
<br />
<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;<br />
&lt;web-app xmlns="http://java.sun.com/xml/ns/javaee" <br />
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee <br />
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"<br />
	version="2.5"&gt;<br />
<br />
	&lt;display-name&gt;Hello Webapp&lt;/display-name&gt;<br />
	<br />
&lt;welcome-file-list&gt;<br />
		&lt;welcome-file&gt;index.html&lt;/welcome-file&gt;<br />
		&lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;<br />
		&lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;<br />
		&lt;welcome-file&gt;default.html&lt;/welcome-file&gt;<br />
		&lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;<br />
		&lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;<br />
	&lt;/welcome-file-list&gt;<br />
&lt;/web-app&gt;<br />
<br />
</td></tr><br />
</table><br />
<br />
This currently does nothing but to define the welcome files. But I know that you're are keen on seeing the server running, so let's create a simple index.html. <br />
<br />
<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
&lt;html&gt;<br />
&lt;head&gt;&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;b&gt;Server is up and running.&lt;b&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
<br />
</td></tr><br />
</table><br />
<br />
Now go to the runtime configuration, create a new "OSGi Framework" configuration and and select all Jetty 7.1.3 bundles. Do not forget to hit the "Add Required Bundles" button. <br />
<br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/6_runconfig.jpg' class="thickbox" title="" rel="entry-22 external" ><img src="http://www.mftech.org/blog/images/6_runconfig.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
<br />
After starting the configuration change to the following URL &lt;a href="http://localhost:8080/persons/" title=""&gt;http://localhost:8080/persons/&lt;/a&gt;<br />
This will show the content of our small index.html<br />
 <br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/7_server_running.jpg' class="thickbox" title="" rel="entry-22 external" ><img src="http://www.mftech.org/blog/images/7_server_running.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
<br />
So you see, it's quite easy to bring up a moduolar web application. But this is just the beginning. Now let'S focus on the web service. Our service should allow to create, manipulate and delete people from a list. To have a clean design we will form a nice interface with these requirements. <br />
<br />
<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
package org.mftech.exampples.web.soap.registry;<br />
import java.util.List;<br />
import org.mftech.examples.web.persons.Person;<br />
<span style="color:Purple;"><b>public</b></span> interface IPersonRegistry<br />
{<br />
	<span style="color:Purple;"><b>public</b></span> int addPerson(Person person);<br />
	<span style="color:Purple;"><b>public</b></span> void deletePerson(Person person);<br />
	<span style="color:Purple;"><b>public</b></span> List&lt;Person&gt; getAllPersons();<br />
	<span style="color:Purple;"><b>public</b></span> void changeValues(int id, Person person);<br />
}<br />
<br />
</td></tr><br />
</table><br />
<br />
This small interface make more or less sense. We have a method to add a Person which returns the new id assigned to the person. We can also delete a Person, which will be identified by it's id. In addition we can retrieve a list of all registered Persons and finally we can overwrite the values of a person with another Person object. You'll notice that the Person class could not be resolved. To make it available in our soap bundle we must export it form it's own bundle and add the specific dependencies to the bundle that contains out interface.<br />
<br />
 <p style="text-align:center;"><a href='http://www.mftech.org/blog/images/8_packages.jpg' class="thickbox" title="" rel="entry-22 external" ><img src="http://www.mftech.org/blog/images/8_packages.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/9_deps.jpg' class="thickbox" title="" rel="entry-22 external" ><img src="http://www.mftech.org/blog/images/9_deps.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
 <br />
Now it is time to care for the implementation.  I'll make it quick and simply provide the implementation to you. Actually the data is stored in a hash map and we do not care for validation to keep it simple.<br />
 <br />
<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
package org.mftech.exampples.web.soap.registry.impl;<br />
import java.util.ArrayList;<br />
import java.util.HashMap;<br />
import java.util.List;<br />
import java.util.Map;<br />
<br />
import javax.jws.WebService;<br />
<br />
import org.mftech.examples.web.persons.Person;<br />
import org.mftech.exampples.web.soap.registry.IPersonRegistry;<br />
<br />
@WebService<br />
<span style="color:Purple;"><b>public</b></span> class PersonRegistry implements IPersonRegistry<br />
{<br />
	<span style="color:Purple;"><b>public</b></span> static IPersonRegistry instance= new PersonRegistry(); <br />
	<br />
	<span style="color:Purple;"><b>public</b></span> static  Map&lt;Integer, Person&gt; persons=new HashMap&lt;Integer, Person&gt;();<br />
	<br />
	@Override<br />
	<span style="color:Purple;"><b>public</b></span> int addPerson(Person person)<br />
	{<br />
		int index=persons.size();<br />
		person.setId(index);<br />
		persons.put(index,person);<br />
		return index;<br />
	}<br />
<br />
	@Override<br />
	<span style="color:Purple;"><b>public</b></span> void deletePerson(Person person)<br />
	{<br />
		persons.remove(person.getId());<br />
	}<br />
<br />
	@Override<br />
	<span style="color:Purple;"><b>public</b></span> List&lt;Person&gt; getAllPersons()<br />
	{<br />
		return new ArrayList&lt;Person&gt;(persons.values());<br />
	}<br />
<br />
	@Override<br />
	<span style="color:Purple;"><b>public</b></span> void changeValues(int id, Person person)<br />
	{<br />
		person.setId(id);<br />
		persons.put(id, person);<br />
	}<br />
}<br />
<br />
</td></tr><br />
</table><br />
 <br />
The only important thing is that the class is annotated with the @Webservice annotation. This makes the class as a web service for the JAX-WS implementation shipped with your JRE. At this point we could start the web service using the Endpoint API. But this is the least elegant way so we will do it slightly different. We will deploy our service declarative. To do this we must a file called "sun-jaxws.xml" to out WEB-INF folder. This file describes the parameters of our service and allows us to deploy it together with all other resources. <br />
<br />
<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
<br />
&lt;endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0"&gt;<br />
	&lt;endpoint name="PersonRegistry"<br />
		implementation="org.mftech.exampples.web.soap.registry.impl.PersonRegistry"<br />
		url-pattern="/PersonRegistry/service" /&gt;<br />
&lt;/endpoints&gt;<br />
<br />
</td></tr><br />
</table><br />
<br />
Additionally we need to update our web.xml to provide a listener for webservice calls.<br />
<br />
<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
...<br />
	&lt;listener&gt;<br />
		&lt;listener-class&gt;<br />
			com.sun.xml.ws.transport.http.servlet.WSServletContextListener&lt;/listener-class&gt;<br />
	&lt;/listener&gt;<br />
<br />
	&lt;servlet&gt;<br />
		&lt;servlet-name&gt;WSServlet&lt;/servlet-name&gt;<br />
		&lt;servlet-class&gt;com.sun.xml.ws.transport.http.servlet.WSServlet&lt;/servlet-class&gt;<br />
		&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br />
	&lt;/servlet&gt;<br />
<br />
<br />
	&lt;servlet-mapping&gt;<br />
		&lt;servlet-name&gt;WSServlet&lt;/servlet-name&gt;<br />
		&lt;url-pattern&gt;/PersonRegistry/service&lt;/url-pattern&gt;<br />
	&lt;/servlet-mapping&gt;<br />
...<br />
<br />
</td></tr><br />
</table><br />
 <br />
The contextListener is not yet know to our application so we need to download the JAX-WS dependencies (<a rel="external" href="http://jax-ws.java.net/" title="">http://jax-ws.java.net/</a>). Since I had some trouble with version 2.2.1 and die WS action stuff I recommend to use version 2.1 which can be downloaded from <a rel="external" href="http://www.mftech.org/tutorials/osgi_webservice/webservice_lib.zip">here</a>. Just unpack the stuff and copy the lib folder under your WEB-INF folder.<br />
<br />
Unfortunately, there is one last thing to do. We need to generate wrapper classes for JAX-WS. This can be done with the wsgen tool from your JRE. Because I do not want to bother you with the details of this tool, I wrote a small ant file which compiles the classes for you. Just copy the build_server.xml to the root of your "org.mftech.exampples.web.soap" bundle and execute it as ant script. You might need to change to path to your JRE.<br />
<br />
<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
&lt;?xml version="1.0"?&gt;<br />
&lt;project name="My Project" default="start"&gt;<br />
	&lt;property name="jdk.home" value="C:/Program Files/Java/jdk1.6.0_18" /&gt;<br />
	&lt;property name="gen.serviceclass.name" value="PersonRegistry" /&gt;<br />
	&lt;property name="gen.serviceclass" <br />
	value="org.mftech.exampples.web.soap.registry.impl.${gen.serviceclass.name}" /&gt;<br />
	&lt;property name="gen.server" value="wsgen.exe" /&gt;<br />
	&lt;property name="gen.project.root" value='${basedir}' /&gt;<br />
	&lt;property name="gen.server.cp" <br />
	value='.;${gen.project.root}/bin;../org.mftech.examples.web.persons/bin;' /&gt;<br />
<br />
	&lt;target name="start"&gt;<br />
		&lt;echo&gt;${dir}&lt;/echo&gt;<br />
		&lt;echo&gt; ${java.home}&lt;/echo&gt;<br />
		&lt;echo&gt; ${jdk.home}&lt;/echo&gt;<br />
		&lt;antcall target="server" /&gt;<br />
<br />
	&lt;/target&gt;<br />
<br />
	&lt;target name="server"&gt;<br />
<br />
		&lt;property name="gen.server.command" value='"${jdk.home}/bin/${gen.server}" -cp "${gen.server.cp}"<br />
		  ${gen.serviceclass} -s "${gen.project.root}/src-gen"' /&gt;<br />
<br />
		&lt;echo&gt;${gen.server.command}&lt;/echo&gt;<br />
		&lt;exec executable="${gen.server.command}"&gt;<br />
		&lt;/exec&gt;<br />
<br />
	&lt;/target&gt;<br />
&lt;/project&gt;<br />
<br />
</td></tr><br />
</table><br />
 <br />
<br />
Now it is time to restart out web bundle and see the fruits of our work. Just open the following URL in your browser <a rel="external" href="http://localhost:8080/persons/PersonRegistry/service" title="">http://localhost:8080/persons/PersonRegistry/service</a> . You'll see a page which lists all registered services. <br />
<br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/10_services.jpg' class="thickbox" title="" rel="entry-22 external" ><img src="http://www.mftech.org/blog/images/10_services.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p> <br />
<br />
Before we start writing our client we will create a small Servlet that helps us to keep track of the changes in our person registry. Therefore we must add "javax.servlet" and "javax.servlet.http" to our imported packages. <br />
 <br />
&lt;!--<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
package org.mftech.exampples.web.soap.view;<br />
<br />
import java.io.IOException;<br />
import java.io.Writer;<br />
import java.util.List;<br />
<br />
import javax.servlet.ServletException;<br />
import javax.servlet.http.HttpServlet;<br />
import javax.servlet.http.HttpServletRequest;<br />
import javax.servlet.http.HttpServletResponse;<br />
<br />
import org.mftech.examples.web.persons.Person;<br />
import org.mftech.exampples.web.soap.registry.impl.PersonRegistry;<br />
<br />
<span style="color:Purple;"><b>public</b></span> class ShowPersonsServlet extends HttpServlet<br />
{<br />
	@Override<br />
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException<br />
	{<br />
		Writer writer = resp.getWriter();<br />
<br />
		writer.write("&lt;head&gt;&lt;meta http-equiv='refresh' content='5; URL=/persons/showPersons'&gt;&lt;/head&gt;");<br />
		writer.write("&lt;h2&gt;PersonRegistry&lt;/h2&gt;");<br />
<br />
		List&lt;Person&gt; allPersons = PersonRegistry.instance.getAllPersons();<br />
		writer.write("&lt;p&gt;" + allPersons.size() + " persons are registred.&lt;/p&gt;");<br />
<br />
		writer.write("<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border='1'&gt;");<br />
		<br />
		writer.write("&lt;tr&gt;");<br />
		writer.write("&lt;td&gt;Id&lt;/td&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;Age&lt;/td&gt;&lt;td&gt;No. children&lt;/td&gt;");<br />
		for (Person person : allPersons)<br />
		{<br />
			writer.write("&lt;tr&gt;");<br />
			writer.write("&lt;td&gt;" + person.getId() + "&lt;/td&gt;");<br />
			writer.write("&lt;td&gt;" + person.getName() +"&lt;/td&gt;");<br />
			writer.write("&lt;td&gt;" + person.getAge() + "&lt;/td&gt;");<br />
			writer.write("&lt;td&gt;" + person.getChildren().size() + "&lt;/td&gt;");<br />
<br />
			writer.write("&lt;/tr&gt;");<br />
		}<br />
		writer.write("</table>");<br />
	}<br />
<br />
	@Override<br />
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException<br />
	{<br />
		super.doGet(req, resp);<br />
	}<br />
}<br />
<br />
</td></tr><br />
</table>--&gt;<br />
<br />
O.k. I admit that this is not the most sophisticated high end design, but this is just an examples. Now let us register it in the web.xml<br />
 <br />
<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
...<br />
	&lt;servlet&gt;<br />
		&lt;servlet-name&gt;registry&lt;/servlet-name&gt;<br />
		&lt;servlet-class&gt;org.mftech.exampples.web.soap.view.ShowPersonsServlet&lt;/servlet-class&gt;<br />
		&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br />
	&lt;/servlet&gt;<br />
<br />
	&lt;servlet-mapping&gt;<br />
		&lt;servlet-name&gt;registry&lt;/servlet-name&gt;<br />
		&lt;url-pattern&gt;/showPersons&lt;/url-pattern&gt;<br />
	&lt;/servlet-mapping&gt;<br />
...<br />
<br />
</td></tr><br />
</table><br />
<br />
If we then restart our server and check this URL <a rel="external" href="http://localhost:8080/persons/showPersons" title="">http://localhost:8080/persons/showPersons</a> we will see that no person is currently registered.<br />
 <br />
<p style="text-align:center;"><a href='http://www.mftech.org/blog/images/11_ready.jpg' class="thickbox" title="" rel="entry-22 external" ><img src="http://www.mftech.org/blog/images/11_ready.thumb.jpg" style="border: 1px solid;" alt="" title=""  class='pivot-popupimage'/></a></p><br />
<br />
Now, finally we will write the client. Create another plugin called "org.mftech.exampples.web.soap.client". To generate the client you could use the WTP tool to generate an Axis or Apache CXF client, but we will stay with the default JAX-WS implementation and use the tool wsimport. Again I made the generation a bit easier for you by providing a small a script which must be executed from the root of your client plugin. <br />
<br />
<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
&lt;?xml version="1.0"?&gt;<br />
&lt;project name="My Project" default="start"&gt;<br />
	&lt;property name="jdk.home" value="C:/Program Files/Java/jdk1.6.0_18" /&gt;<br />
	&lt;property name="gen.client.project.root" value='${basedir}\..\org.mftech.exampples.web.soap.client' /&gt;<br />
	&lt;property name="gen.endpoint" value="http://localhost:8080/persons/PersonRegistry/service" /&gt;<br />
<br />
	&lt;path id="jaxws.classpath"&gt;<br />
		&lt;fileset dir="${basedir}\..\org.mftech.exampples.web.soap\WEB-INF\lib"&gt;<br />
			&lt;include name="**/*.jar" /&gt;<br />
		&lt;/fileset&gt;<br />
	&lt;/path&gt;<br />
	&lt;taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport"&gt;<br />
		&lt;classpath refid="jaxws.classpath" /&gt;<br />
	&lt;/taskdef&gt;<br />
<br />
	&lt;target name="start"&gt;<br />
		&lt;echo&gt;${dir}&lt;/echo&gt;<br />
		&lt;echo&gt; ${java.home}&lt;/echo&gt;<br />
		&lt;echo&gt; ${jdk.home}&lt;/echo&gt;<br />
		&lt;antcall target="client" /&gt;<br />
	&lt;/target&gt;<br />
<br />
	&lt;target name="client"&gt;<br />
		&lt;wsimport wsdl="${gen.endpoint}?WSDL" sourcedestdir="${gen.client.project.root}\src-gen"<br />
		 package="org.mftech.exampples.web.soap.client" <br />
		verbose="true" debug="true" xendorsed="true" /&gt;<br />
	&lt;/target&gt;<br />
<br />
&lt;/project&gt;<br />
<br />
</td></tr><br />
</table><br />
<br />
After this is done the only thing left is to write a small test client which manipulates the data. <br />
<br />
<table style="table-layout:fixed; width:420; word-wrap:break-word;" width='100%' border="0"   bgcolor="#DCDCDC"><br />
<tr><td><br />
package org.mftech.exampples.web.soap.client;<br />
<br />
import java.util.List;<br />
import java.util.Random;<br />
<br />
<span style="color:Purple;"><b>public</b></span> class WebServiceTester<br />
{<br />
	<span style="color:Purple;"><b>public</b></span> static void main(String[] args) throws InterruptedException<br />
	{<br />
		int c = 65;<br />
		int loopCount = 0;<br />
		while (true)<br />
		{<br />
			PersonRegistry registry = new PersonRegistryService().getPersonRegistryPort();<br />
			List&lt;Person&gt; allPersons = registry.getAllPersons();<br />
			<br />
			if (loopCount % 4 != 0)<br />
			{<br />
				Person person = new Person();<br />
				person.setName("Person " + (char) (c++));<br />
				person.setAge(new Random().nextInt(80)+20);<br />
<br />
				int id = registry.addPerson(person);<br />
<br />
				System.out.println("Added Person with id: " + id);<br />
			}<br />
			else<br />
			{<br />
				if (allPersons.size() &gt; 0)<br />
				{<br />
					registry.deletePerson(allPersons.get(0));<br />
				}<br />
			}<br />
<br />
			loopCount++;<br />
			Thread.sleep(5000);<br />
		}<br />
<br />
	}<br />
}<br />
<br />
</td></tr><br />
</table><br />
 <br />
Now start the server and then the client and enjoy the show. ;) ]]></description>
			<guid isPermaLink="false">22@http://mftech.org/blog/pivot/</guid>
			<category>default</category>
			<pubDate>Thu, 30 Dec 2010 15:40:00 +0200</pubDate>
		</item>
		
		
		
		<item>
			<title>Finally we arrived</title>
			<link>http://www.mftech.org/blog/pivot/entry.php?id=21</link>
			<comments>http://www.mftech.org/blog/pivot/entry.php?id=21#comm</comments>
                        <description><![CDATA[ Finally we arrived. Well, the travel was not as relaxing as excepted. First, the train to the airport was delayed because some signals were damaged. Certainly, if the train in Berlin is delayed it is not easy to find a seat. Actually I was quite lucky that I managed to get into the train with my entire luggage.<br />
Next, when we arrived at the airport we saw millions of people waiting for the check in. It took some time to figure out that the conveyor belts were damaged which led to a long delay at the check in. God bless the online check in which allowed us  only to drop off our baggage which saved some times and nerves.<br />
<br />
<p style="text-align:center;"><img src="http://www.mftech.org/blog/images/img_7376_small.jpg" style="border:0px solid" title="" alt="" class="pivot-image" /></p><br />
<br />
But enough with the whining. We finally arrived and that is all what matters ;) And I am quite sure that all the cool sessions will be a good compensation for the exhausting journey.<br />
<br />
So if you also managed to get to the summit I recommend that you consider watching our <a rel="external" href="http://www.eclipsecon.org/summiteurope2010/sessions/sessions?id=1884" title="">talk on Wednesday</a>. Hope to see you there. And enjoy the summit. :) ]]></description>
			<guid isPermaLink="false">21@http://mftech.org/blog/pivot/</guid>
			<category>default</category>
			<pubDate>Tue, 02 Nov 2010 10:09:00 +0200</pubDate>
		</item>
		
		
		
		<item>
			<title>&quot;Come together&quot;...</title>
			<link>http://www.mftech.org/blog/pivot/entry.php?id=20</link>
			<comments>http://www.mftech.org/blog/pivot/entry.php?id=20#comm</comments>
                        <description><![CDATA[ ...is the title of a famous song written by a famous <a rel="external" href="http://en.wikipedia.org/wiki/John_Lennon" title="">musician</a> who would (if he hadn't been shot) celebrate his 70th birthday today. But it could also be the slogan for an event which starts in less than a month - right, the Eclipse Summit Europe. Last year I promised that I'll be there next time. And so it is. There are a lot of reasons to go to the summit. Here is my top three for this year:<br />
<br />
<p style="text-align:center;"><img src="http://www.mftech.org/blog/images/img_6718_small.jpg" style="border:1px solid" title="" alt="" class="pivot-image" /></p><br />
<br />
1.)	The amazing <a rel="external" href="http://www.eclipsecon.org/summiteurope2010/sessions/?page=sessions" title="">program</a>. I still haven't figured out which talks I will visit. But I remember from last year that it was hard to make a decision. <br />
<br />
2.)	<a rel="external" href="http://thegordian.blogspot.com/" title="">Eike</a> and I are giving a long <a rel="external" href="http://www.eclipsecon.org/summiteurope2010/sessions/sessions?id=1884" title="">talk</a> about <a rel="external" href="http://www.eclipse.org/cdo/" title="">CDO</a> and <a rel="external" href="http://wiki.eclipse.org/Dawn" title="">Dawn</a>. If you are interest in a flexible, scalable model repository for EMF objects, its latest features and the project plans for the coming releases you should mark this talk in your calendar.<br />
<br />
3.)	Last year Ralph Mueller promised to keep the <a rel="external" href="http://www.mftech.org/blog/pivot/entry.php?id=15#comm" title="">drinks free</a>. So I check whether he keeps word ;)<br />
<br />
So, let's come together on the summit. Hope to see you there... ]]></description>
			<guid isPermaLink="false">20@http://mftech.org/blog/pivot/</guid>
			<category>default</category>
			<pubDate>Fri, 08 Oct 2010 13:02:00 +0200</pubDate>
		</item>
		
		
		
		<item>
			<title>It's dawning</title>
			<link>http://www.mftech.org/blog/pivot/entry.php?id=19</link>
			<comments>http://www.mftech.org/blog/pivot/entry.php?id=19#comm</comments>
                        <description><![CDATA[ It has been a year since I announce that 0.1 is released. At this time Dawn based on an own small model repository and provided real-time shared editing for GMF diagrams - on a basic level.<br />
 <br />
Dawn 0.1 came with a flexible communication mechanism which allowed switching the underlying transport protocol (at this time SOAP and RMI were implemented) at runtime. With an HTTP-based protocol in the background Dawn was (nearly) immune to firewall restriction. Dawn was also able to detect and visualize conflicts and to clear those on selected diagram elements. To avoid conflicts the user was able to <a rel="external" href="http://www.mftech.org/dawn/screencasts/9_locking/locking.htm" title="">lock</a> certain parts of the diagram exclusively. As you might guess, this feature certainly needs some sort of a user management in the back end. This user management allowed to set access rights for every user and to control the rights for every diagram (read, write, modify). System administrators could grant/revoke these rights using a web-ba<a rel="external" href="http://www.mftech.org/dawn/screencasts/7_dawn_Webfrontend/dawn_webfrontend.htm" title="">interface</a>sed interface. This interface came along with a <a rel="external" href="http://www.mftech.org/dawn/screencasts/8_more_sophisticated_Diagrams/8_more_sophisticated_Diagrams.htm" title="">simple portal</a> to view the GMF diagrams and their changes in real-time in a browser. Dawn 0.1 even provided some basic editing functionality from within the web-browser.<br />
<br />
<p style="text-align:center;"><img src="http://www.mftech.org/blog/images/07.jpg" style="border:0px solid" title="" alt="" class="pivot-image" /></p><br />
<br />
But Dawn 0.1 also had some drawbacks. The performance on bigger models was rather poor. Also the design was far from being perfect. It was also clear that maintaining an own model repository in competition to CDO would be a hard job as single committer. Not that I do not like challenges, but this one was a bit out of my scope ;) This led to the idea to re-implement Dawn on CDO. So, I became a CDO committer ... and got sidetracked a bit learning all the new stuff. <br />
<br />
<p style="text-align:center;"><img src="http://www.mftech.org/blog/images/06_copy1.jpg" style="border:0px solid" title="" alt="" class="pivot-image" /></p><br />
<br />
It took a while since a found time to look at Dawn again, but here we are one year later and I am proud to announce that <b>Dawn 0.2</b> is out now. Now, Dawn is based on CDO and is treated as one of its sub components. So you can receive it from the Helios update site or the <a rel="external" href="https://build.eclipse.org/hudson/job/emf-cdo-integration/lastSuccessfulBuild/artifact/result/site.p2/" title="">latest CDO builds</a>. <br />
<br />
As a gift for its 0.2nd birthday, Dawn got its own brand new logo. Here it is:<br />
<br />
<p style="text-align:center;"><img src="http://www.mftech.org/blog/images/dawn_logo_300x300.png" style="border:0px solid" title="" alt="" class="pivot-image" /></p><br />
I addition a new <a rel="external" href="http://wiki.eclipse.org/Dawn" title="">wiki page</a> will serve as entry point for every information around Dawn. If you are interested in Dawn have a look at the <a rel="external" href="http://wiki.eclipse.org/Getting_Started_with_Dawn" title="">getting started</a>  section. Or, if you want to generate generate your own client fragment for your GMF editor, visit this <a rel="external" href="http://wiki.eclipse.org/Dawn_Codegen" title="">tutorial</a> .<br />
<br />
There are some features which are not yet re-implemented (e.g the web viewer, locking or authentification). If are you are interested in these features track the <a rel="external" href="http://wiki.eclipse.org/Dawn_Feature_Overview" title="">features page</a> or the related bugzillas.  <br />
<br />
Dawn will not be limited to GMF. In fact it is going to provide collaborative access to every UI which has an underlying EMF model und thus can be stored in a CDO repository.  I leave it up to you to image what this could include ;) ]]></description>
			<guid isPermaLink="false">19@http://mftech.org/blog/pivot/</guid>
			<category>default</category>
			<pubDate>Sun, 11 Jul 2010 12:25:00 +0200</pubDate>
		</item>
		
		
		
	</channel>
</rss>
