Kai Toedter: Dynamic modular Web Applications with Vaadin and OSGi
Jan 02, 2011
I am a big fan of both OSGi and GWT (Google Web Toolkit). Unfortunately these two technologies don?t fit together very well. When you want to run OSGi on the server, RAP (Rich Ajax Platform) is one proven approach to go. While I like RAP a lot, you have to have quite a lot of Eclipse RCP know how for using it. Another alternative, if your want to run OSGi on the server and provide a modular, dynamic UI is Vaadin. Btw, Vaadin is the Finnish word for female reindeer. Vaadin is a server side RIA framework that uses GWT as rendering engine. In the last couple of days a played a bit around with Vaadin and I have to admit, I like it a lot. So, I wrote a little dynamic OSGi Vaadin demo (Download link and instructions are below). My goals for the demo were: Before I started with Vaadin, I found a few interesting reads and code sample regarding OSGi and Vaadin: But back to the demo, here is a screen shot running the application in Firefox: The idea is to support two kinds of UI contributions: views and actions. The views are inserted in a tab folder, the actions appear in the toolbar and the Action menu. I implemented a little OSGi agent as a view (Bundle View). This view shows a selection of bundles currently available. By checking/unchecking a bundle, it will be activated/stopped on the server side. If you press ?Deselect All?, all bundles go to resolved state and all the UI contributions disappear immediately: Of course you could start and stop bundles from the OSGi console directly, then you would have to refresh the browser to get the changes displayed. To get the demo running on your local machine, follow these steps: In the next weeks I plan to go a little bit more into details of the demo, how OSGi declarative services are used, how to contribute to Vaadin Themes, etc. Stay tuned and have fun! Kai




