<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6101078170613341771</id><updated>2011-07-29T03:40:24.742+02:00</updated><category term='versioning'/><category term='just in time gwt google web toolkit'/><category term='firefox extension greasemonkey google search'/><category term='echo2 maven archetype nextapp'/><category term='axis2 axis rest curl post request'/><category term='firefox extension fingerprint certificate ssl progresslistener'/><category term='axis2 annotation webservice'/><category term='thunderbird extension xul javascript'/><category term='hibernate versioning versionierung'/><category term='firefox extension google cache'/><category term='echo2 nextapp google maps map'/><title type='text'>Hacim Bengalis Blog</title><subtitle type='html'>General topics. About whatever comes to my mind.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-8415943083053545377</id><published>2009-05-19T22:51:00.002+02:00</published><updated>2009-05-19T22:53:56.732+02:00</updated><title type='text'>New project 'svgmate'</title><content type='html'>svgmate is a web application which is able to produce PNG images from SVG documents.&lt;br /&gt;The documents can either be uploaded or defined as a request parameter.&lt;br /&gt;&lt;br /&gt;See the "full" documentation and examples in my &lt;a href="http://www.banapple.de/display/BANAPPLE/svgmate"&gt;wiki&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-8415943083053545377?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/8415943083053545377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=8415943083053545377&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/8415943083053545377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/8415943083053545377'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2009/05/new-project-svgmate.html' title='New project &apos;svgmate&apos;'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-1741700964118259273</id><published>2009-05-15T12:37:00.003+02:00</published><updated>2009-05-15T12:39:45.450+02:00</updated><title type='text'>Started my personal wiki</title><content type='html'>I started my personal wiki using confluence.&lt;br /&gt;The wiki will contain news and information about my projects.&lt;br /&gt;&lt;br /&gt;Have a look at &lt;a href="http://www.banapple.de/display/BANAPPLE/Home"&gt;www.banapple.de&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-1741700964118259273?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.banapple.de/display/BANAPPLE/Home' title='Started my personal wiki'/><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/1741700964118259273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=1741700964118259273&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/1741700964118259273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/1741700964118259273'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2009/05/started-my-personal-wiki.html' title='Started my personal wiki'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-548342798161814167</id><published>2009-02-05T22:09:00.005+01:00</published><updated>2009-02-12T13:10:51.890+01:00</updated><title type='text'>A firefox extension allowing to run operating system commands</title><content type='html'>&lt;a href="https://addons.mozilla.org/de/firefox/addon/10653"&gt;CommandRun&lt;/a&gt; is a firefox extension which allows to run operating system commands from javascript.&lt;br /&gt;At least it is tested with firefox 3.0.5 on Linux.&lt;br /&gt;&lt;br /&gt;It allows javascript code like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;CommandRun.run("/usr/bin/touch",["/tmp/commandruntest"]);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;which will create the file /tmp/commandruntest or update its timestamp.&lt;br /&gt;&lt;br /&gt;Allowed commands must be defined in the preferences. The preference "extensions.commandrun.allowedcommands" expects a JSON array containing the allowed commands, e.g.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;["/usr/bin/touch","/usr/bin/ls"]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Other commands are rejected.&lt;br /&gt;&lt;br /&gt;So why did I develop this extension at all?&lt;br /&gt;For an intranet web application I searched for a possibility to raise the firefox window from within javascript. The web application is a GWT application, that means it is a javascript client running in a browser. The nature of the application is that it may idle for a long time until it gets an event pushed by a server. The user of the application may do other things while she is waiting for an event to arrive, she may even work with other applications, reading mails, etc. The focus of the web application may be lost, firefox may be hidden by other windows. When an event arrives firefox should immediately raise to the front such that the user can react on the event.&lt;br /&gt;I did not find a simple javascript solution to raise firefox to the front. If anybody knows, please tell me.&lt;br /&gt;&lt;a href="http://www.sweb.cz/tripie/utils/wmctrl/"&gt;wmctrl&lt;/a&gt; is a linux tool which allows to raise windows (and do other things to the window manager).&lt;br /&gt;The next step is then to find a possibility to call wmctrl from within javascript. And there comes the CommandRun extension.&lt;br /&gt;(puh, long speech)&lt;br /&gt;&lt;br /&gt;The extension is based on code snippets from two other extensions:&lt;br /&gt;&lt;a href="https://addons.mozilla.org/de/firefox/addon/7458"&gt;callout&lt;/a&gt; contains code which adds an object to a document's window with which new operations can be called. In my extension's case the CommandRun object is added which allows to invoke 'run'.&lt;br /&gt;&lt;a href="https://addons.mozilla.org/de/firefox/addon/9738"&gt;TerminalRun&lt;/a&gt; allows to execute selected text in a terminal. It contains code to create an operating system process.&lt;br /&gt;&lt;br /&gt;The source can be downloaded via anonymous svn from &lt;a href="http://subversion.banapple.de/public/commandrun/"&gt;http://subversion.banapple.de/public/commandrun/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Additionally I dared to publish the extension on &lt;a href="https://addons.mozilla.org/de/firefox/addon/10653"&gt;addons.mozilla.org&lt;/a&gt; where it can be downloaded with better update support. The current version 0.2.0 is only a start. It is enough for my needs but other people might want the output of the command available in javascript.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-548342798161814167?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/548342798161814167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=548342798161814167&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/548342798161814167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/548342798161814167'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2009/02/firefox-extension-allowing-to-run.html' title='A firefox extension allowing to run operating system commands'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-6348015546494753033</id><published>2008-11-05T23:37:00.006+01:00</published><updated>2009-08-05T21:57:06.172+02:00</updated><title type='text'>A maven2 plugin for Apache FOP</title><content type='html'>I googled for a maven2 plugin which uses &lt;a href="http://xmlgraphics.apache.org/fop/index.html"&gt;Apache FOP&lt;/a&gt; for converting xml files into pdf files.&lt;br /&gt;&lt;br /&gt;Since my search was not successful I made my own plugin.&lt;br /&gt;&lt;br /&gt;Quick start:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Download the &lt;a href="http://subversion.banapple.de/public/maven-fop-plugin/"&gt;source&lt;/a&gt;:&lt;br /&gt;&lt;code&gt;$ svn co http://subversion.banapple.de/public/maven-fop-plugin&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Install the plugin:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ cd maven-fop-plugin&lt;br /&gt;$ mvn install&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;li&gt;Get some xml file and an xsl file which transforms your xml to fo. I suppose these files are now somewhere in your maven project.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Configure your project to use the fop plugin:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;plugins&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;  &amp;lt;plugin&amp;gt;&lt;br /&gt;    &amp;lt;groupId&amp;gt;de.banapple.mojo&amp;lt;/groupId&amp;gt;&lt;br /&gt;    &amp;lt;artifactId&amp;gt;maven-fop-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;configuration&amp;gt;&lt;br /&gt;      &amp;lt;inputFiles&amp;gt;&lt;br /&gt;        &amp;lt;basedir&amp;gt;src/main/xml&amp;lt;/basedir&amp;gt;&lt;br /&gt;      &amp;lt;/inputFiles&amp;gt;&lt;br /&gt;      &amp;lt;xslFile&amp;gt;src/main/xsl-fo/foobar-fo.xsl&amp;lt;/xslFile&amp;gt;&lt;br /&gt;    &amp;lt;/configuration&amp;gt;&lt;br /&gt;  &amp;lt;/plugin&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;&amp;lt;/plugins&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Start maven:&lt;br /&gt;&lt;code&gt;$ mvn de.banapple.mojo:maven-fop-plugin:1.0-SNAPSHOT:fop&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;You should now have some pdf files in the &lt;code&gt;target&lt;/code&gt; folder.&lt;br /&gt;&lt;br /&gt;The plugin is simple. I followed the &lt;a href="http://maven.apache.org/guides/plugin/guide-java-plugin-development.html"&gt;plugin development guide&lt;/a&gt;.&lt;br /&gt;Not documented in the development guide is the usage of the DirectoryScanner with which filesets can be defined as parameters.&lt;br /&gt;The rest of the code is mostly taken from &lt;a href="http://xmlgraphics.apache.org/fop/0.95/embedding.html"&gt;the Apache FOP documentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The plugin has minimal functionality and only allows to convert to pdf. Apache FOP allows a lot of other configuration which may be added in future versions of this plugin.&lt;br /&gt;&lt;br /&gt;If you like it a comment here would be nice. If you are missing a feature please comment here, too, and I will fix it if I find the time.&lt;br /&gt;&lt;br /&gt;The official documentation is now at &lt;a href="http://www.banapple.de/display/BANAPPLE/maven-fop-plugin"&gt;www.banapple.de&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-6348015546494753033?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/6348015546494753033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=6348015546494753033&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/6348015546494753033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/6348015546494753033'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2008/11/maven2-plugin-for-apache-fop.html' title='A maven2 plugin for Apache FOP'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-3335490256111301090</id><published>2008-10-08T08:50:00.002+02:00</published><updated>2008-10-08T11:25:52.796+02:00</updated><title type='text'>twitterfeed feeds your twitter with entries from rss</title><content type='html'>This is just a test for &lt;a href="http://twitterfeed.com/"&gt;twitterfeed.com&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If it works this entry should also appear in my &lt;a href="http://twitter.com/hacim_bengali"&gt;twitter&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;...some time later: it works, I got a tweet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-3335490256111301090?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://twitterfeed.com/' title='twitterfeed feeds your twitter with entries from rss'/><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/3335490256111301090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=3335490256111301090&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/3335490256111301090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/3335490256111301090'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2008/10/twitterfeed-feeds-your-twitter-with.html' title='twitterfeed feeds your twitter with entries from rss'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-8776200477440321141</id><published>2008-09-29T21:36:00.005+02:00</published><updated>2008-09-29T21:47:49.770+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox extension greasemonkey google search'/><title type='text'>Greasemonkey improves google search result navigation</title><content type='html'>I like using the keyboard and I therefore like the possibility to navigate through google's search result with the keyboard.&lt;br /&gt;&lt;br /&gt;Google has an experimental feature which can be activated &lt;a href="http://www.google.com/experimental/"&gt;here&lt;/a&gt;. But I was not able to activate this feature when a search was started from my igoogle page.&lt;br /&gt;&lt;br /&gt;Now I found another solution: &lt;a href="http://www.greasespot.net/"&gt;Greasemonkey&lt;/a&gt; together with the &lt;a href="http://userscripts.org/scripts/show/6575"&gt;Google Ctrl-Arrow&lt;/a&gt; user script.&lt;br /&gt;&lt;br /&gt;I &lt;a href="http://diveintogreasemonkey.org/install/what-is-greasemonkey.html"&gt;learned&lt;/a&gt; that "Greasemonkey is a Firefox extension that allows you to write scripts that alter the web pages you visit".&lt;br /&gt;&lt;br /&gt;Greasemonkey does nothing by itself but uses user scripts. There is a big &lt;a href="http://userscripts.org/"&gt;library&lt;/a&gt; of user scripts.&lt;br /&gt;&lt;br /&gt;Greasemonkey seems to be a very useful extension.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-8776200477440321141?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/8776200477440321141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=8776200477440321141&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/8776200477440321141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/8776200477440321141'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2008/09/greasemonkey-improves-google-search.html' title='Greasemonkey improves google search result navigation'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-8036454431305178332</id><published>2008-09-26T23:39:00.003+02:00</published><updated>2008-09-29T21:10:30.080+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox extension google cache'/><title type='text'>My second firefox extension</title><content type='html'>Once I had a development problem and googled for a solution.&lt;br /&gt;I found a page were my problem was exactly described but the solution was hidden. It was only available for registered users. Registration was not free.&lt;br /&gt;&lt;br /&gt;So I asked my boss to get an account for this service.&lt;br /&gt;In the meanwhile a colleague of mine found another solution. He checked whether the page containing the solution was in the google cache and so it was. Probably google has an account which is used by the google crawler.&lt;br /&gt;&lt;br /&gt;Searching for a firefox extension which load the google cache for a given page I found nothing working for firefox 3, so I started an extension myself.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://ted.mielczarek.org/code/mozilla/extensionwiz/"&gt;extension wizard&lt;/a&gt; completed most of the work. It defined an entry in the context menu and the only work left was to implement the functionality behind the context menu entry. After some searching on the &lt;a href="http://developer.mozilla.org/en/Main_Page"&gt;mozilla developer page&lt;/a&gt; I found the necessary snippets. This is the resulting function:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;onMenuItemCommand: function(e) {&lt;br /&gt;    /*&lt;br /&gt;     * get the recently used browser window&lt;br /&gt;     * http://developer.mozilla.org/en/Code_snippets/Tabbed_browser&lt;br /&gt;     */&lt;br /&gt;    var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].&lt;br /&gt;         getService(Components.interfaces.nsIWindowMediator);&lt;br /&gt;    var recentWindow = wm.getMostRecentWindow("navigator:browser");&lt;br /&gt;    if (recentWindow) {&lt;br /&gt;      var googleCacheUrl = "http://google.com/search?q=cache:"&lt;br /&gt;        +recentWindow.content.document.location;&lt;br /&gt;      /* open the url in a new current tab */&lt;br /&gt;      gBrowser.selectedTab = gBrowser.addTab(googleCacheUrl);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That's all.&lt;br /&gt;&lt;br /&gt;The source code is available via anonymous svn with&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;svn co http://subversion.banapple.de/public/getgooglecache/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The extension can be installed from &lt;a href="http://www.banapple.de/firefox/"&gt;www.banapple.de&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Meanwhile I found an &lt;a href="https://addons.mozilla.org/de/firefox/addon/301"&gt;old extension&lt;/a&gt; which seems to do the same. It only works for Firefox 1.5.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-8036454431305178332?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.banapple.de/firefox/' title='My second firefox extension'/><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/8036454431305178332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=8036454431305178332&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/8036454431305178332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/8036454431305178332'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2008/09/my-second-firefox-extension.html' title='My second firefox extension'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-7808546695218312568</id><published>2008-09-26T20:59:00.003+02:00</published><updated>2008-09-26T21:45:33.262+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox extension fingerprint certificate ssl progresslistener'/><title type='text'>My first firefox extension</title><content type='html'>My first firefox extensions checks the fingerprint of a ssl secured site.For online banking my bank advises me to check the fingerprint of the certificate of their site to make sure it is the right one. Every year the certificate is changed and they proclaim the new fingerprint.&lt;br /&gt;&lt;br /&gt;So before login I always had to open the page info by clicking the lock icon, clicked show certificate and then compared the fingerprint displayed there with the one I stored in a file or on a paper. The the popups had to be closed again.&lt;br /&gt;&lt;br /&gt;The ssl-fingerprint-check extension does all the work for me.&lt;br /&gt;&lt;br /&gt;It can be checked out via anonymous svn with&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;svn co http://subversion.banapple.de/public/ssl-fingerprint-check&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;When I access the banks site it automatically compares the fingerprint of the certificate with a predefined value. If it matches a label in the status panel says that the fingerprint is ok or "INVALID FINGERPRINT".&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://subversion.banapple.de/public/ssl-fingerprint-check/chrome/content/ssl-fingerprint-check.xul"&gt;overlay file&lt;/a&gt; defines which xul elements are added to firefox. In this case a statusbarpanel is added to the status bar.&lt;br /&gt;&lt;br /&gt;The rest is the javascript code to initialize the extension and handle load events which is defined in &lt;a href="http://subversion.banapple.de/public/ssl-fingerprint-check/chrome/content/ssl-fingerprint-check.js"&gt;ssl-fingerprint-check.js&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Let's go through the code:&lt;br /&gt;&lt;br /&gt;first listeners are registered such that the extension gets initialized when firefox starts and uninitialized when it stops.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;window.addEventListener("load", function() { sslFingerprintCheck.init(); }, false);&lt;br /&gt;window.addEventListener("unload", function() { sslFingerprintCheck.uninit(); }, false);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The init function gets the firefox browser element and adds a progress listener to it.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;init: function() {&lt;br /&gt;    var content = document.getElementById("content");&lt;br /&gt;    &lt;br /&gt;    if (content) {&lt;br /&gt;      content.addProgressListener(sslFingerprintCheck_urlBarListener,&lt;br /&gt;        Components.interfaces.nsIWebProgress.NOTIFY_STATE_DOCUMENT);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The current fingerprint and the common name of the certificate are hardcoded in the extension. If you want to make use of this extension you will probably have to change that or get an account in Diepholz.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var fingerprint = "ED:75:31:01:CE:09:71:3C:64:AB:EF:BD:28:AE:B5:3F:FF:87:07:B2";&lt;br /&gt;var commonName = "banking.kreissparkasse-diepholz.de";&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The progress listener calls the function checkCertificate on various events.&lt;br /&gt;checkCertificate gets the certificate and then compares the fingerprint if the common name matches. It updates the statusbarpanel accordingly.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;checkCertificate: function()&lt;br /&gt;  {&lt;br /&gt;    var certificate = sslFingerprintCheck.getCert();&lt;br /&gt;    if (certificate != null) {&lt;br /&gt;      //sslFingerprintCheck.debug("fingerprint="+certificate.sha1Fingerprint);&lt;br /&gt;      //sslFingerprintCheck.debug("cert="+certificate.commonName);&lt;br /&gt;&lt;br /&gt;      /* check for one specific commonName at the moment */&lt;br /&gt;      if (certificate.commonName == commonName) {&lt;br /&gt;        if (certificate.sha1Fingerprint==fingerprint) {&lt;br /&gt;          newLabel = "fp ok";&lt;br /&gt;        } else {&lt;br /&gt;          newLabel = "INVALID FINGERPRINT";&lt;br /&gt;        }    &lt;br /&gt;      } else {&lt;br /&gt;        newLabel = "no banking"; &lt;br /&gt;      }&lt;br /&gt;      document.getElementById("ssl-fingerprint-check-panel").label = newLabel;&lt;br /&gt;    } else {&lt;br /&gt;      document.getElementById("ssl-fingerprint-check-panel").label="no ssl";&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The sites which helped to develop this extension are named in the source code.&lt;br /&gt;&lt;br /&gt;To test the extension follow the instructions on&lt;br /&gt;&lt;a href="http://developer.mozilla.org/en/docs/Building_an_Extension#Extending_the_Browser_with_XUL"&gt;developer.mozilla.org&lt;/a&gt; section 'Test'.&lt;br /&gt;&lt;br /&gt;Possible improvements for this extension:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;provide a preferences window where pairs of common names and fingerprints can be managed&lt;/li&gt;&lt;br /&gt;&lt;li&gt;display a fancy icon for the fingerprint check instead of a label&lt;/li&gt;&lt;br /&gt;&lt;li&gt;display the icon in the ssl status bar panel right to the lock icon&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-7808546695218312568?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://subversion.banapple.de/public/ssl-fingerprint-check/' title='My first firefox extension'/><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/7808546695218312568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=7808546695218312568&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/7808546695218312568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/7808546695218312568'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2008/09/my-first-firefox-extension.html' title='My first firefox extension'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-2408966284963115916</id><published>2008-09-20T23:05:00.003+02:00</published><updated>2008-09-20T23:13:58.520+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='thunderbird extension xul javascript'/><title type='text'>My first thunderbird extension</title><content type='html'>I started my first thunderbird extension.&lt;br /&gt;After some success at the start my motivation now rapidly decreases but I still would like to present my results.&lt;br /&gt;Perhaps some information from it is helpful for other beginners.&lt;br /&gt;&lt;br /&gt;The idea was an extension which parses a message to be displayed for text fragments matching some regular expression and then map the matching text to some link.&lt;br /&gt;In my company, for example, we are using &lt;a href="http://www.atlassian.com/software/jira/"&gt;Jira&lt;/a&gt;.&lt;br /&gt;The tickets in Jira can be accessed by URLs like &lt;br /&gt;http://company-server/jira/browse/PROJECT-1&lt;br /&gt;where PROJECT is an example project name in the company Jira.&lt;br /&gt;I want the extension to map the text "PROJECT-1" to the ticket url.&lt;br /&gt;&lt;br /&gt;The great vision was then to have a preferences window where regular expressions and urls can be defined, the mapped links should be displayed inline in the message text.&lt;br /&gt;&lt;br /&gt;The source code for the extension can be downloaded via anonymous svn from http://subversion.banapple.de/public/linkator/ .&lt;br /&gt;&lt;br /&gt;What I got in the end was an extension which was generally able to process a message and do something with it. So if you want to create an extension which manipulates a message or does some action depending on a message when it is displayed you make take my extension. There is a function called processDocument in content/overlay.js where you can implement your own stuff. The function is called when a message is displayed. You can, for example, set the background color of the message with doc.bgColor="#00FF00".&lt;br /&gt;&lt;br /&gt;I am not really convinced if this extension makes sense at all, so my motivation was not good enough to finish it.&lt;br /&gt;The parsing of the message is not finished, links are not really mapped, mapped links are not displayed in the text.&lt;br /&gt;Instead only matching texts are added to a linkator box which is placed above the message.&lt;br /&gt;This box is not finished because it is never cleared from old matches.&lt;br /&gt;But it shows how the xul interface of thunderbird can be extended with overlays.&lt;br /&gt;&lt;br /&gt;The extension is a mess but here is how I got there.&lt;br /&gt;&lt;br /&gt;First I created a dummy extension with the&lt;br /&gt;&lt;a href="http://ted.mielczarek.org/code/mozilla/extensionwiz/"&gt;Extension Wizard&lt;/a&gt;.&lt;br /&gt;To test this (already runnable) extension I inserted a file in my thunderbird profile in the extensions directory as described in http://developer.mozilla.org/en/Building_an_Extension (this page is for firefox extensions but it is all the same for thunderbird).&lt;br /&gt;&lt;br /&gt;Then I adjusted content/thunderbirdOverlay.xul until I got a new xul element above the message.&lt;br /&gt;&lt;br /&gt;The next step was to implement the behaviour of the extension in content/overlay.js. &lt;br /&gt;&lt;br /&gt;I got information about how to do this from the source of other extensions&lt;br /&gt;One was &lt;a href="https://addons.mozilla.org/de/firefox/addon/4846"&gt;Remote Image Cache&lt;/a&gt; which showed how to hook in for message processing.&lt;br /&gt;&lt;br /&gt;Other useful references:&lt;br /&gt;The XUL tutorial at http://developer.mozilla.org/En/XUL_Tutorial&lt;br /&gt;http://www.xulplanet.com/&lt;br /&gt;&lt;br /&gt;Development was hard. To test it thunderbird always had to be restarted. I would like to hear what tools professional extension writers are using.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-2408966284963115916?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://subversion.banapple.de/public/linkator/' title='My first thunderbird extension'/><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/2408966284963115916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=2408966284963115916&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/2408966284963115916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/2408966284963115916'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2008/09/my-first-thunderbird-extension.html' title='My first thunderbird extension'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-6878082453202458291</id><published>2008-09-08T21:04:00.003+02:00</published><updated>2008-10-14T11:54:12.097+02:00</updated><title type='text'>On using the BeanShell for system introspection</title><content type='html'>At work I came across the &lt;a href="http://www.beanshell.org"&gt;BeanShell&lt;/a&gt;&lt;br /&gt;and its remote server mode.&lt;br /&gt;&lt;br /&gt;From a server application you can invoke the command&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;server(1234);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;in a beanshell which starts a tiny HTTP server on port 1234 and a telnet session server on port 1235.&lt;br /&gt;When your server at port 1234 is then accessed via HTTP you get a page containing&lt;br /&gt;an applet containing a JConsole. This applet communicates with the telnet session server.&lt;br /&gt;&lt;br /&gt;We ignored the warning about the unrestricted access to all parts of the application&lt;br /&gt;and used the applet in production.&lt;br /&gt;&lt;br /&gt;And this helped us to analyze problems we would never have been able to solve&lt;br /&gt;without the remote beanshell. Before we only had logs or beans accessible via JMX.&lt;br /&gt;But these information was fixed after we inserted the log statements or defined&lt;br /&gt;the managed beans.&lt;br /&gt;The remote beanshell allowed us to look into any object which was reachable from&lt;br /&gt;one given entry point object which we set into the beanshell interpreter at startup.&lt;br/&gt;&lt;br /&gt;We were even able to call methods on these objects to fix states we did not expect&lt;br /&gt;before to happen.&lt;br /&gt;&lt;br /&gt;One disadvantage was that the remote server was not running under the standard port 8080.&lt;br /&gt;Firewall issues prevented us from accessing the remote beanshell from our workstations.&lt;br /&gt;We therefore had to login to our production (windows!) web servers, start a browser there&lt;br /&gt;and call the remote beanshell.&lt;br /&gt;&lt;br /&gt;I therefore implemented a servlet providing an Interpreter instance hold in the session.&lt;br /&gt;The code can be checked out via anonymous svn from&lt;br /&gt;http://subversion.banapple.de/public/beanshell-extensions/&lt;br /&gt;&lt;br /&gt;The homepage is &lt;a href="http://www.banapple.de/beanshell-extensions/index.html"&gt;http://www.banapple.de/beanshell-extensions/index.html&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-6878082453202458291?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://subversion.banapple.de/public/beanshell-extensions/' title='On using the BeanShell for system introspection'/><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/6878082453202458291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=6878082453202458291&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/6878082453202458291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/6878082453202458291'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2008/09/on-using-beanshell-for-system.html' title='On using the BeanShell for system introspection'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-4180499777159848268</id><published>2007-08-24T21:06:00.000+02:00</published><updated>2007-08-24T21:41:15.328+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='just in time gwt google web toolkit'/><title type='text'>Just in time compilation of GWT code</title><content type='html'>From Echo2 to GWT... I am still searching for the best toolkit.&lt;br /&gt;&lt;br /&gt;What I liked at Echo2 is that the javascript code for the client is created just in time. There is no compilation step to be made before the deployment like in GWT.&lt;br /&gt;GWT allows to develop an application in hosted mode, so probably there is no big need for a just in time compiler, because you will not deploy the application that often as with echo2 (does this make sense?).&lt;br /&gt;&lt;br /&gt;Anyway, perhaps this feature may be useful for somebody.&lt;br /&gt;&lt;br /&gt;The javascript code for the GWT client, which is normally deployed after compilation as static files, is produced in this example dynamically by a servlet. The servlet compiles the client code to javascript and caches it.&lt;br /&gt;&lt;br /&gt;The source can be downloaded from&lt;br /&gt;&lt;a href="http://www.banapple.de/sandbox/JustInTimeCompilerServlet.java"&gt;http://www.banapple.de/sandbox/JustInTimeCompilerServlet.java&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What has to be done?&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;The sources for the client have to be in the classpath of your web application.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The os dependent GWT library containing the GWTCompiler has to be in the classpath.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The servlet is defined to be accessible under the relative url &lt;code&gt;/gwt-jit&lt;/code&gt; (or anything you want).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The HTML page containing the GWT client has to include the GWT module using the servlet url, like in&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;meta name='gwt:module' content='/gwt-jit=de.banapple.MyModule'&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;How does it work?&lt;br /&gt;&lt;br /&gt;The servlet creates to directories under &lt;code&gt;WEB-INF/&lt;/code&gt;. One for holding the &lt;br /&gt;compiled files, one as a temporary directory for the compilation.&lt;br /&gt;&lt;br /&gt;The GWT bootstrap code requests the file &lt;br /&gt;&lt;code&gt;/gwt-jit/de.banapple.MyModule.nocache.html&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;The servlet first looks whether the file &lt;br /&gt;&lt;code&gt;de.banapple.MyModule.nocache.html&lt;/code&gt;&lt;br /&gt;is already in the cache of compiled files.&lt;br /&gt;If not the module is compiled in method &lt;code&gt;handleModule&lt;/code&gt;. This method just uses the class &lt;code&gt;com.google.gwt.dev.GWTCompiler&lt;/code&gt;, which stores the compiled files in the temporary compilation directory.&lt;br /&gt;&lt;br /&gt;Afterwards the temporary files are copied to the cache directory. The GWTCompiler creates a directory with the module name in the temporary compilation directory. When the GWT bootstrap code requests further cache files (those files with names being a hash), the servlet can not determine which module they belong to and can therefore not look into directory named after the module (ok, it could, it would have to search all those module directories). So they are all copied flat into the cache directory, hoping that the filenames of different modules do not clash.&lt;br /&gt;&lt;br /&gt;The servlet is definitely not fail-proof, e.g it will not work if two request come in which initiate the compilation. But as a first shot it worked for me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-4180499777159848268?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/4180499777159848268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=4180499777159848268&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/4180499777159848268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/4180499777159848268'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2007/08/just-in-time-compilation-of-gwt-code.html' title='Just in time compilation of GWT code'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-3167167389511271584</id><published>2007-05-27T16:05:00.000+02:00</published><updated>2007-05-27T21:54:51.373+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='echo2 nextapp google maps map'/><title type='text'>On using the echo2 googlemaps component</title><content type='html'>There is a echo2 component for google maps&lt;br /&gt;&lt;a href="http://zephyrsoftware.sourceforge.net/?q=googlemaps"&gt;here&lt;/a&gt;. And it works really good so far.&lt;br /&gt;&lt;br /&gt;The author of this component says that the echo2 code has to be patched such that the google map api can be loaded at page load time which is needed for google maps (at least with echo2 version 2.1.0beta5).&lt;br /&gt;&lt;br /&gt;I managed to get the component running with echo2 2.1.0rc2 without patching:&lt;br /&gt;&lt;br /&gt;The starting point for an echo2 application is a servlet which extends &lt;code&gt;nextapp.echo2.webrender.WebRenderServlet&lt;/code&gt;. The normal behaviour of this servlet is to register some services. One of these services is the &lt;code&gt;nextapp.echo2.webcontainer.WindowHtmlService&lt;/code&gt; which produces the output in its service method. The trick is now to replace this class with your own implementation.&lt;br /&gt;&lt;br /&gt;I made it this way:&lt;br /&gt;&lt;br /&gt;The constructor of my &lt;code&gt;HelloWorldServlet&lt;/code&gt; which extends &lt;code&gt;nextapp.echo2.webrender.WebRenderServlet&lt;/code&gt; and which is the starting point of my echo2 application is the following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public HelloWorldServlet()&lt;br /&gt; {&lt;br /&gt;  super();&lt;br /&gt;  &lt;br /&gt;  final String METHOD = "HelloWorldServlet: ";&lt;br /&gt;  &lt;br /&gt;  ServiceRegistry serviceRegistry = WebRenderServlet.getServiceRegistry();&lt;br /&gt;  serviceRegistry.remove(WindowHtmlService.INSTANCE);&lt;br /&gt;  serviceRegistry.remove(NewInstanceService.INSTANCE);&lt;br /&gt;  serviceRegistry.add(MyNewInstanceService.INSTANCE);&lt;br /&gt;  serviceRegistry.add(MyWindowHtmlService.INSTANCE);&lt;br /&gt;  &lt;br /&gt;  log.debug(METHOD+"successful");&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This removes the old service implementations and replaces it with my own implementations:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package de.banapple.echo2test;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import org.apache.commons.logging.Log;&lt;br /&gt;import org.apache.commons.logging.LogFactory;&lt;br /&gt;&lt;br /&gt;import nextapp.echo2.webcontainer.ContainerInstance;&lt;br /&gt;import nextapp.echo2.webrender.Connection;&lt;br /&gt;import nextapp.echo2.webrender.Service;&lt;br /&gt;&lt;br /&gt;public class MyNewInstanceService &lt;br /&gt; implements Service&lt;br /&gt;{&lt;br /&gt; private static Log log = LogFactory.getLog(MyNewInstanceService.class);&lt;br /&gt; &lt;br /&gt;    public String getId()&lt;br /&gt;    {&lt;br /&gt;        return "Echo.NewInstance";&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int getVersion()&lt;br /&gt;    {&lt;br /&gt;        return -1;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void service(Connection conn)&lt;br /&gt;        throws IOException&lt;br /&gt;    {&lt;br /&gt;     final String METHOD = "service: ";&lt;br /&gt;     log.debug(METHOD+"conn="+conn);&lt;br /&gt;     &lt;br /&gt;        ContainerInstance.newInstance(conn);&lt;br /&gt;        MyWindowHtmlService.INSTANCE.service(conn);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static final MyNewInstanceService INSTANCE = &lt;br /&gt;     new MyNewInstanceService();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package de.banapple.echo2test;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import nextapp.echo2.webcontainer.ContainerInstance;&lt;br /&gt;import nextapp.echo2.webcontainer.WindowHtmlService;&lt;br /&gt;import nextapp.echo2.webrender.BaseHtmlDocument;&lt;br /&gt;import nextapp.echo2.webrender.Connection;&lt;br /&gt;import nextapp.echo2.webrender.ContentType;&lt;br /&gt;import nextapp.echo2.webrender.output.CssStyle;&lt;br /&gt;import nextapp.echo2.webrender.service.CoreServices;&lt;br /&gt;&lt;br /&gt;import org.apache.commons.logging.Log;&lt;br /&gt;import org.apache.commons.logging.LogFactory;&lt;br /&gt;import org.w3c.dom.Element;&lt;br /&gt;&lt;br /&gt;public class MyWindowHtmlService &lt;br /&gt; extends WindowHtmlService &lt;br /&gt;{&lt;br /&gt; private static Log log = LogFactory.getLog(MyWindowHtmlService.class);&lt;br /&gt; &lt;br /&gt; public void service(Connection conn)&lt;br /&gt;     throws IOException&lt;br /&gt; {&lt;br /&gt;  final String METHOD = "service: ";&lt;br /&gt;  log.debug(METHOD+"conn="+conn);&lt;br /&gt;  &lt;br /&gt;     ContainerInstance ci = (ContainerInstance)conn.getUserInstance();&lt;br /&gt;     conn.setContentType(ContentType.TEXT_HTML);&lt;br /&gt;     boolean debug = !"false".equals(conn.getServlet().getInitParameter("echo2.debug"));&lt;br /&gt;     BaseHtmlDocument baseDoc = new BaseHtmlDocument("c_root");&lt;br /&gt;     baseDoc.setGenarator("NextApp Echo v2.1.0.rc2");&lt;br /&gt;     &lt;br /&gt;     /* add google maps api */&lt;br /&gt;     baseDoc.addJavaScriptInclude(&lt;br /&gt;       "js/googleload.js");&lt;br /&gt;     &lt;br /&gt;     baseDoc.addJavaScriptInclude(ci.getServiceUri(CoreServices.CLIENT_ENGINE));&lt;br /&gt;     baseDoc.getBodyElement().setAttribute("onload", "EchoClientEngine.init('" + ci.getServletUri() + "', " + debug + ");");&lt;br /&gt;     Element bodyElement = baseDoc.getBodyElement();&lt;br /&gt;     CssStyle cssStyle = new CssStyle();&lt;br /&gt;     cssStyle.setAttribute("position", "absolute");&lt;br /&gt;     cssStyle.setAttribute("font-family", "verdana, arial, helvetica, sans-serif");&lt;br /&gt;     cssStyle.setAttribute("font-size", "10pt");&lt;br /&gt;     cssStyle.setAttribute("height", "100%");&lt;br /&gt;     cssStyle.setAttribute("width", "100%");&lt;br /&gt;     cssStyle.setAttribute("padding", "0px");&lt;br /&gt;     cssStyle.setAttribute("margin", "0px");&lt;br /&gt;     cssStyle.setAttribute("overflow", "hidden");&lt;br /&gt;     bodyElement.setAttribute("style", cssStyle.renderInline());&lt;br /&gt;     baseDoc.render(conn.getWriter());&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public static final MyWindowHtmlService INSTANCE = &lt;br /&gt;  new MyWindowHtmlService();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The implementation of the service method of &lt;code&gt;MyWindowHtmlService&lt;/code&gt; is copied from the original implementation and extended with the &lt;br /&gt;&lt;code&gt;baseDoc.addJavaScriptInclude("js/googleload.js");&lt;/code&gt; which loads the google maps api with my key.&lt;br /&gt;&lt;br /&gt;Ok, that is not really far away from patching the class, but still... It might work with forthcoming versions of echo2.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-3167167389511271584?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/3167167389511271584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=3167167389511271584&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/3167167389511271584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/3167167389511271584'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2007/05/on-using-echo2-googlemaps-component.html' title='On using the echo2 googlemaps component'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-3573144753294263048</id><published>2007-05-23T23:47:00.000+02:00</published><updated>2007-05-23T23:55:45.165+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='echo2 maven archetype nextapp'/><title type='text'>Maven archetype for echo2 application</title><content type='html'>While testing &lt;a href="http://www.nextapp.com/platform/echo2/echo/"&gt;echo2&lt;/a&gt; &lt;br /&gt;I searched for a maven archetype which creates an initial echo2 application.., &lt;br /&gt;and did not find one.&lt;br /&gt;&lt;br /&gt;So I made one available at&lt;br /&gt;http://maven-repository.banapple.de/de/banapple/maven/archetype/&lt;br /&gt;&lt;br /&gt;If you are interested download the jar and install it in your local maven repository and then &lt;br /&gt;create your echo2 app with&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# mvn archetype:create \&lt;br /&gt;  -DarchetypeGroupId=de.banapple.maven.archetype \&lt;br /&gt;  -DarchetypeArtifactId=echo2 \&lt;br /&gt;  -DarchetypeVersion=1.0-SNAPSHOT \&lt;br /&gt;  -DgroupId=&amp;lt;your groupId here&amp;gt; \&lt;br /&gt;  -DartifactId=&amp;lt;your artifactId here&amp;gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Change to the newly created directy and test the application with&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# mvn jetty:run&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This starts a jetty server on port 8080 in which the application runs.&lt;br /&gt;&lt;br /&gt;The archetype uses echo2 libraries which are deployed on &lt;br /&gt;&lt;code&gt;maven-repository.banapple.de&lt;/code&gt;, too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-3573144753294263048?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/3573144753294263048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=3573144753294263048&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/3573144753294263048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/3573144753294263048'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2007/05/maven-archetype-for-echo2-application.html' title='Maven archetype for echo2 application'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-6507551835425995800</id><published>2007-05-17T15:51:00.001+02:00</published><updated>2007-05-23T20:36:08.667+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='axis2 axis rest curl post request'/><title type='text'>Creating POST requests with curl for Axis2 REST service</title><content type='html'>Axis2 allows to create REST services as easily as SOAP services. By default each&lt;br /&gt;SOAP service has a REST counterpart automatically available.&lt;br /&gt;&lt;br /&gt;The responses for REST requests served by Axis2 are the same as SOAP responses but &lt;br /&gt;are missing the enclosing SOAP envelope (this is because REST is handled inte&lt;br /&gt;rnally like a SOAP request). Because of this the responses are currently missing&lt;br /&gt;the REST feature to return links to other resources in the response.&lt;br /&gt;&lt;br /&gt;But creating REST requests is somewhat easier than SOAP requests. This article &lt;br /&gt;describes an example where a REST request is sent with curl.&lt;br /&gt;&lt;br /&gt;Axis2 uses document-style services by default. The following excerpt of the &lt;br /&gt;webservice WSDL which was used shows the XML schema for the data to be transmitted:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;    &amp;lt;xs:schema xmlns:ns="http://impl.service.banapple.de/xsd" attributeFormDefault="qualified" elementFormDefault="unqualified" targetNamespace="http://impl.serv ice.banapple.de/xsd"&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="createContact"&amp;gt;&lt;br /&gt;    &amp;lt;xs:complexType&amp;gt;&lt;br /&gt;    &amp;lt;xs:sequence&amp;gt;&lt;br /&gt;    &amp;lt;xs:element maxOccurs="unbounded" name="incomingData" nillable="true" type="ns10:IncomingData" /&amp;gt;&lt;br /&gt;    &amp;lt;xs:element maxOccurs="unbounded" name="foreignKeys" nillable="true" type="ns10:IncomingForeignKey" /&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="incomingCreator" nillable="true" type="ns10:IncomingCreator" /&amp;gt;&lt;br /&gt;    &amp;lt;/xs:sequence&amp;gt;&lt;br /&gt;    &amp;lt;/xs:complexType&amp;gt;&lt;br /&gt;    &amp;lt;/xs:element&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="createContactResponse"&amp;gt;&lt;br /&gt;    &amp;lt;xs:complexType&amp;gt;&lt;br /&gt;    &amp;lt;xs:sequence&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="return" nillable="true" type="xs:int" /&amp;gt;&lt;br /&gt;    &amp;lt;/xs:sequence&amp;gt;&lt;br /&gt;    &amp;lt;/xs:complexType&amp;gt;&lt;br /&gt;    &amp;lt;/xs:element&amp;gt;&lt;br /&gt;    &amp;lt;/xs:schema&amp;gt;&lt;br /&gt;    &amp;lt;xs:schema xmlns:ax242="http://bean.model.banapple.de/xsd" xmlns:ax283="http://lang.java/xsd" xmlns:ax244="http://util.java/xsd" attributeFormDefault="qualified" elementFormDefault="unqualified" targetNamespace="http://bean.model.banapple.de/xsd"&amp;gt;&lt;br /&gt;    &amp;lt;xs:import namespace="http://util.java/xsd" /&amp;gt;&lt;br /&gt;    &amp;lt;xs:import namespace="http://lang.java/xsd" /&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="IncomingData" type="ns10:IncomingData" /&amp;gt;&lt;br /&gt;    &amp;lt;xs:complexType name="IncomingData"&amp;gt;&lt;br /&gt;    &amp;lt;xs:sequence&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="creationDate" type="xs:long" /&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="dataTypeName" nillable="true" type="xs:string" /&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="dataValue" nillable="true" type="xs:string" /&amp;gt;&lt;br /&gt;    &amp;lt;/xs:sequence&amp;gt;&lt;br /&gt;    &amp;lt;/xs:complexType&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="IncomingForeignKey" type="ns10:IncomingForeignKey" /&amp;gt;&lt;br /&gt;    &amp;lt;xs:complexType name="IncomingForeignKey"&amp;gt;&lt;br /&gt;    &amp;lt;xs:sequence&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="foreignKeyTypeName" nillable="true" type="xs:string" /&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="foreignKeyValue" nillable="true" type="xs:string" /&amp;gt;&lt;br /&gt;    &amp;lt;/xs:sequence&amp;gt;&lt;br /&gt;    &amp;lt;/xs:complexType&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="IncomingCreator" type="ns10:IncomingCreator" /&amp;gt;&lt;br /&gt;    &amp;lt;xs:complexType name="IncomingCreator"&amp;gt;&lt;br /&gt;    &amp;lt;xs:sequence&amp;gt;&lt;br /&gt;    &amp;lt;xs:element name="name" nillable="true" type="xs:string" /&amp;gt;&lt;br /&gt;    &amp;lt;/xs:sequence&amp;gt;&lt;br /&gt;    &amp;lt;/xs:complexType&amp;gt;&lt;br /&gt;    &amp;lt;/xs:schema&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Two namespaces are used:&lt;br /&gt;&lt;code&gt;http://impl.service.banapple.de/xsd&lt;/code&gt; for the element describing the&lt;br /&gt;operation,&lt;br /&gt;&lt;code&gt;http://bean.model.banapple.de/xsd&lt;/code&gt; for the parameters of the operation.&lt;br /&gt;&lt;br /&gt;The example payload for the request is the following:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;createContact&lt;br /&gt;xmlns="http://impl.service.banapple.de/xsd"&lt;br /&gt;xmlns:bean="http://bean.model.banapple.de/xsd"&amp;gt;&lt;br /&gt;&amp;lt;bean:incomingData&amp;gt;&lt;br /&gt;  &amp;lt;creationDate&amp;gt;0&amp;lt;/creationDate&amp;gt;&lt;br /&gt;  &amp;lt;dataTypeName&amp;gt;CUSTOMER_ID&amp;lt;/dataTypeName&amp;gt;&lt;br /&gt;  &amp;lt;dataValue&amp;gt;300042045&amp;lt;/dataValue&amp;gt;&lt;br /&gt;&amp;lt;/bean:incomingData&amp;gt;&lt;br /&gt;&amp;lt;foreignKeys&amp;gt;&lt;br /&gt;  &amp;lt;foreignKeyTypeName&amp;gt;UCID&amp;lt;/foreignKeyTypeName&amp;gt;&lt;br /&gt;  &amp;lt;foreignKeyValue&amp;gt;1&amp;lt;/foreignKeyValue&amp;gt;&lt;br /&gt;&amp;lt;/foreignKeys&amp;gt;&lt;br /&gt;&amp;lt;incomingCreator&amp;gt;&lt;br /&gt;  &amp;lt;name&amp;gt;Foobar&amp;lt;/name&amp;gt;&lt;br /&gt;&amp;lt;/incomingCreator&amp;gt;&lt;br /&gt;&amp;lt;/createContact&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The payload was stored in a file createcontact.xml and sent to the&lt;br /&gt;REST service with curl with the command:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;curl -H "Content-Type: text/xml; charset=UTF-8"&lt;br /&gt;--data-binary @createcontact.xml&lt;br /&gt;http://localhost:8080/contactdb/rest/DataReceiverService/createContact&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It is important to sent the Content-Type header otherwise the REST&lt;br /&gt;service will produce an error response with the not very helpful message&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Required element null defined in the schema can not be found in the request&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-6507551835425995800?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/6507551835425995800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=6507551835425995800&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/6507551835425995800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/6507551835425995800'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2007/05/axis2-allows-to-create-rest-services-as.html' title='Creating POST requests with curl for Axis2 REST service'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-6242057326309960545</id><published>2007-05-10T20:50:00.000+02:00</published><updated>2007-05-10T21:11:13.809+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='axis2 annotation webservice'/><title type='text'>Adding Axis2 webservice programmatically at runtime</title><content type='html'>I just tried out Axis2 (in version 1.1.1).&lt;br /&gt;&lt;br /&gt;But I wanted to embed the AxisEngine into my own web application instead of building an aar and deploying it into the axis2 default web application. One possible way would have been to use the same web application directory layout as used in the axis2 default web app and put a service archive into the WEB-INF/services directory or to package my web application war having the exploded service archive in the WEB-INF/services. Both solutions would have complicated the build process.&lt;br /&gt;&lt;br /&gt;So I wanted to add services programmatically at runtime. Perhaps using some annotations on classes which mark them as webservices.&lt;br /&gt;&lt;br /&gt;I found code like that:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;service = AxisService.createService(&lt;br /&gt; MyServiceImpl.class.getName(),&lt;br /&gt; axisConfiguration,&lt;br /&gt; RPCMessageReceiver.class);&lt;br /&gt;service.setName("MyService");&lt;br /&gt;axisConfiguration.addService(service);&lt;br /&gt;axisConfiguration.startService(service.getName());&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;But the problem was to get the AxisConfiguration. The solution was simple to extend the AxisServlet which has a reference to the configuration. So MyAxisServlet overrode the init method in the following way...&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public void init(ServletConfig config) throws ServletException&lt;br /&gt;{&lt;br /&gt;  super.init(config);&lt;br /&gt;  &lt;br /&gt;  AxisService service;&lt;br /&gt;  try {&lt;br /&gt;    service = AxisService.createService(&lt;br /&gt;      MyServiceImpl.class.getName(),&lt;br /&gt;      axisConfiguration,&lt;br /&gt;      RPCMessageReceiver.class);&lt;br /&gt;    service.setName("MyService");&lt;br /&gt;   &lt;br /&gt;    axisConfiguration.addService(service);&lt;br /&gt;    axisConfiguration.startService(service.getName());      &lt;br /&gt;  } catch (AxisFault e) { &lt;br /&gt;    e.printStackTrace();&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;...and substituted the default AxisServlet in the web.xml with MyAxisServlet ...and it worked.&lt;br /&gt;&lt;br /&gt;At the moment I don't know if I made everything right but I had a webservice running.&lt;br /&gt;&lt;br /&gt;The next step was then to change the init method to search all classes having an annotation @Webservice and add them in the same way as above. Name, scope and targetNamespace were set with annotation attributes.&lt;br /&gt;&lt;br /&gt;So I have my classes annotated and added automatically to the AxisEngine. When I add another webservice class to my web app the only thing to do is to add the annotation. And I don't need a special build process to build the archive or package my war file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-6242057326309960545?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/6242057326309960545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=6242057326309960545&amp;isPopup=true' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/6242057326309960545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/6242057326309960545'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2007/05/adding-axis2-webservice.html' title='Adding Axis2 webservice programmatically at runtime'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6101078170613341771.post-4914573235672451338</id><published>2007-05-01T14:13:00.000+02:00</published><updated>2007-05-11T23:20:48.015+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='versioning'/><category scheme='http://www.blogger.com/atom/ns#' term='hibernate versioning versionierung'/><title type='text'>Versioning of database entities with Hibernate</title><content type='html'>At work I had the requirement to introduce a versioning mechanism for database entities in an already productive application which used Hibernate as persistence framework.&lt;br /&gt;&lt;br /&gt;Versioning was meant in the following way: the state of an entity had to be reconstructable at any point of time and for each change the id of the changer and the time had to be stored. In short: who made what when?&lt;br /&gt;&lt;br /&gt;The following ideas and techniques are not new and are not my own ideas. The implementation orients itself on suggestions from the book "Hibernate in Action" written by Gavin King and Christian Bauer, which I can recommend.&lt;br /&gt;&lt;br /&gt;The database in use did not have triggers, therefore an implementation using database triggers was not possible.&lt;br /&gt;Instead of that the mechanism was to be implemented with Hibernate means.&lt;br /&gt;&lt;br /&gt;Since the application was already in production the changes had to be minor.&lt;br /&gt;One possibility to achieve the goal would have been to introduce a superclass for all entities to  be versioned. But this would have been a bigger change. The risk of errors would have been to great.&lt;br /&gt;&lt;br /&gt;The implementation was done in the following way:&lt;br /&gt;1. a new annotation Historicizable marks the entities to be versioned&lt;br /&gt;2. two new database tables were introduced: EntityHistory and EntityHistoryData. The former includes class name and id of the changed entity, date of the change, the initiator of the change and the type of change (INSERT, UPDATE, DELETE). The latter contains information about each changed attribute of the entity. There is a one-to-many relationship between them.&lt;br /&gt;3. an Interceptor was defined which collects data about changes and stores them.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Interceptor.html"&gt;Interceptor&lt;/a&gt;&lt;br /&gt;gets registered at the SessionFactory. It is therefore used in each Hibernate session. Our interceptor implements the methods onSave, onFlushDirty, onDelete, afterTransactionCompletion and postFlush. The first three just collect information about changes and create a list of EntityHistory beans. The interceptor checks whether the entity for which the interceptor was called is annotated with Historicizable. If not no data is collected.&lt;br /&gt;afterTransactionCompletion checks whether the current transaction was rolled back. In this case the list of collected EntityHistory beans is cleared.&lt;br /&gt;Method postFlush makes the list of EntityHistory beans persistent. This method has to use its own Hibernate Session but which can share the same connection.&lt;br /&gt;&lt;br /&gt;The existing API method of the application did not have an argument which defines the initiator of a change. Instead of changing each of these methods the initiator data can be set as a ThreadLocal variable on the interceptor. So the versioning mechanism relies on the client of the application API to set the initiator properly before calling any API method which could possibly include versioning.&lt;br /&gt;&lt;br /&gt;E.g. some API methods were published as webservices. The webservices itself were extended so that initiator data could be send as a SOAP header with the request.&lt;br /&gt;&lt;br /&gt;This versioning mechanism only works for entities having only primitive or simple properties. Versioning of entities with references to other entities is not supported.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6101078170613341771-4914573235672451338?l=hacimbengali.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hacimbengali.blogspot.com/feeds/4914573235672451338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6101078170613341771&amp;postID=4914573235672451338&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/4914573235672451338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6101078170613341771/posts/default/4914573235672451338'/><link rel='alternate' type='text/html' href='http://hacimbengali.blogspot.com/2007/05/versionierung-von-datenbank-entitten.html' title='Versioning of database entities with Hibernate'/><author><name>Die Preetzer Abelings</name><uri>http://www.blogger.com/profile/03867042450275777746</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_3HDUd2eGsjQ/SOxV_Gi2_tI/AAAAAAAAAAM/WZ965eZ1Ayk/S220/avatar_kopf.jpg'/></author><thr:total>2</thr:total></entry></feed>
