ADempiere/Equinox Integration 2
From ADempiere
This Wiki is read-only for reference purposes to avoid broken links.
Approach 2: Embedding ADempiere in Equinox BEWARE: Install howtos currently are very short!
Contents
Status: Alpha Code - Review required
- Swing client can be fired up inside equinox.
- very few tests applied
- Webstart has been fired up with equinox.
- zkwebui runs inside OSGi through equinox servlet bridge
- Currently, deployment is in no way integrated in the standard adempiere setup!
Idea
The idea is simple:
- Turn adempiere projects into bundles.
- org.adempiere.base: Core functionality
- org.adempiere.tools: Supporting libs
- org adempiere.client: Swing client
- Throw these bundles into equinox
- Watch it running
- Start further decomposing it
- Define some kind of core interface
Tutorials
Quickstart
- Code is in https://adempiere.svn.sourceforge.net/svnroot/adempiere/branches/osgi/approach2 - this is a "real" svn branch - check it out!
- Use multiple project setup
- Simple trick on slow sf.net to get into multiple project setup: Do one checkout, rename top-level .project file, import projects into workspace
- copy the folder equinox-target somewhere else - this is the container and it will be modified.
- Open base/META-INF/MANIFEST.MF, press the "export deployable plugins and fragments" icon in the top-right corner
- select all plugins
- choose the copy of equinox-target as the output directory
- On tab Options: Use class files compiled in the workspace (for the moment)
- Finish
- on commandline, cd to copy of equinox-target
- java -jar org.eclipse.osgi_3.5.0.v20090520.jar -console -clean
- Enter ss, verify your three plugins are RESOLVED
- Enter start 4 (id of org.adempiere.client) and watch adempiere starting
WebStart
- Equinox documentation: http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/java_web_start.htm
- A new top-level project webstart has been created
- This is a feature (equinox language).
- It wraps all plugins.
- open webstart/feature.xml (should open in the eclipse feature editor)
- Press the "export deployable feature" icon in the top-right corner
- Choose a directory, eg. the copy of equinox-target again
- Under JAR signed, provide your key store (or create one at first using keytool)
- Under Java Web Start, provide the location the JNLP will be downloaded from and the JVM spec
- Click Finish
- in equinox-target/adempiere-equinox.jnlp, enter the correct download location either.
- in the jnlp file under equinox-target/features, you have to correct the tags under "information", copy those from equinox-target/adempiere-equinox.jnlp
- on the console, cd to equinox-target
- javaws adempiere-equinox.jnlp
ZK Web UI
- New top-level project equinox bridge provides bridging web-app.
- export all adempiere plugins to equinox-bridge/WebContext/WEB-INF/eclipse
- install a tomcat-5.5.28
- ln -s equinox-bridge/WebContent tomcat-5.5.28/webapps/equinox-bridge
- rm -rf tomcat-5.5.28/work/* (ensure using current build)
- fire up tomcat: catalina.sh jpda run (jpda for remote debugging)
- http://localhost:8080/equinox-bridge/index.zul
- Enjoy
Learning Points Encountered
- client code in base: this code has no access eg. on resources in client.
- First core interface defined: IResourceFinder
- Adempiere.class.getResource() converted to Adempiere.getResource() - which in turn uses IResourceHandler
- Postgres Driver in tools is java 1.6? - Have to use a 1.6 VM!
- ZK Servlets do not save ServletConfig - Workaround checked in
- Standard Equinox bridging webapp incompatible with up-to-date equinox - updated version provided.