středa 9. dubna 2014

Kai Tödter's modular application on Eclipse Virgo


Kai Tödter's modular application on Eclipse Virgo

We are looking for suitable technologies for our new project - modular web platform.
Because we like Vaadin and OSGi, we did some research and look ups for technologies based on these frameworks.

We have found two nice things on the internet:




I decided to do some modifications for our project purposes:
  • Maven based project
  • Eclipse Virgo development and deployment ready
  • Get rid of HttpService, use standard WAB (web application bundle)
  • Get rid of Declarative services use Gemini blueprint
I also made some simplifications: I didn't adopt all of original modules and I integrated additional vaadin bundles (org.vaadin.osgi.staticres, org.vaadin.osgi) into main application bundle. Result of my efforts you can download here:

>> Download example com.siemens.ct.osgi.vaadin.pm.zip  <<

Note: This example has some imperfections (some pom.xml refactiong is needed, old vaadin version, some strange behaviors in example....) but for learning purposes is enought, I guess:).

Guide 1 - simple deploy

  1. Download eclipse virgo with jetty 3.6.2 - http://www.eclipse.org/downloads/download.php?file=/virgo/release/VP/3.6.2.RELEASE/virgo-jetty-server-3.6.2.RELEASE.zip
  2. Unzip virgo.
  3. Download com.siemens.ct.osgi.vaadin.pm.zip
  4. unzip
  5. mvn clean install (in <sample_dir>)
  6. Start virgo via <virgo_dir>\bin\startup.bat (wait till virgo is ready)
  7. Copy into <virgo_dir>\pickup those files (KEEP ORDER!!!)
    1. <sample_dir>\vaadin-6.7.6.jar
    2. <sample_dir>\main\target\com.siemens.ct.osgi.vaadin.pm.main-1.0.0-SNAPSHOT.jar
    3. <sample_dir>\printaction\target\com.siemens.ct.osgi.vaadin.pm.printaction-1.0.0.qualifier.jar
    4. <sample_dir>\runoaction\target\com.siemens.ct.osgi.vaadin.pm.runoaction-1.0.0.qualifier.jar
    5. <sample_dir>\bundleview\target\com.siemens.ct.osgi.vaadin.pm.bundleview-1.0.0.qualifier.jar
  8. open url http://localhost:8080/producer/main
  9. Enjoy

Guide 2 - Eclipse tool

  1. Download eclipse virgo with jetty 3.6.2 - http://www.eclipse.org/downloads/download.php?file=/virgo/release/VP/3.6.2.RELEASE/virgo-jetty-server-3.6.2.RELEASE.zip
  2. Unzip virgo.
  3. Download com.siemens.ct.osgi.vaadin.pm.zip
  4. mvn clean install in <sample_dir>
  5. Copy into <virgo_dir>\repository\usr file <sample_dir>\vaadin-6.7.6.jar
  6. Start Eclipse (Kepler), install Virgo Eclipse Tool according to http://wiki.eclipse.org/Virgo/Tooling
  7. Import via  "Existing maven project" projects from directory <sample_dir>. Use project template "groupId"."artefactId"
  8. Add Virgo Nature to imported projects (except project com.siemens.ct.osgi.vaadin.pm)
    1. Select projects in "Package Explorer", right click for context menu -> Virgo -> Add bundle project nature.
  9. Add new server Runtime (Windows -> Preferences -> Server -> Runtime -> Add "EclipseRT\Virgo Runtime". Put <virgo_dir>
  10. Add new server in "Servers" window ->Create New Server -> "EclipseRT\Virgo Runtime", host name "localhost", select your runtime from step 8 as runtime.
  11. Next button
  12. Add application"com.siemens.ct.osgi.vaadin.pm.main" only!.
  13. Start your server in "Servers" window.
  14. open url http://localhost:8080/producer/main
  15. Add other applications (right click on your server in "Servers" window)