Saturday, October 29, 2011

Preparing for EclipseCon Europe 2011

Today I started preparing my talk for this years EclipseCon Europe. I'll be speaking about parts of the architecture of my project "mango" aka eiswind book publishing software. I'll be showing how I leverage the XMPP protocol together with synchronous services to make my Eclipse e4 based client application responsive and alive. I'll be showing only a handful of slides together with a bunch of code examples on how I manage long running server tasks, how I do some "not so optimistic locking" with the editor lifecycle and some other stuff. The talk will be on friday afternoon and I'm looking forward to meet you there.

Sunday, August 28, 2011

Why I love the DataBinding framework

I'm working on an enterprise client server application. In my domain model I use a generic ValueList/Value construction to map all kinds of simple selectable values. Think of it as a customizable enum thats stored in the database backend. It's been a while since I annotated the JPA model with the name of the ValueList wherever a value gets referenced, the main purpose of this was to be able to pre-populate the value fields with the default value from the corresponding list.

@JoinColumn(name = "origin_id")
@ValueListName(name = ValueListNames.PERSONORIGIN)
@ManyToOne(optional = true)
public Value getOrigin() {
return this.origin;

Yesterday I created a new feature that enables the user to edit the values of the list whenever he clicks on a Combo and then hits F1. The solution is quite straightforward.

In the Command Handler for the key

- I ask the display for the focus control
- I ask the active part for its DataBindingContext
- I search the Context for the proper binding of the focus control
- I ask the binding for its model element
- I ask the model element wether it has an annotated ValueList name
- if so, I open the Edit Dialog for the correct ValueList

That's true DRY I think.

Thursday, June 23, 2011

It's release time. First e4 based version is out.

Actually our latest Buchmanager 1.8.0 release is based on the M7 milestone of the 4.1 Eclipse SDK. Looking at my posts I saw that I had the first launch of our 3.x based code on the 4.1 platform back in November 2010. So let's say it took me half a year to make it work. The e4 team did a great job and really took care of all the bugs I reported, they even invented new gem features for me (for e.g. opening a ViewPart in the shared area) which caused even more bugs to haunt. Half a year is not the whole truth, of course I did implement new features too.

First reaction of our beta testers was: Fresh and polished UI. They really like it.

That's what the users see. To me it was taking my existing application over to the new platform without any changes in the existing code and getting all the bright new stuff from the e4 application platform.

Monday, June 13, 2011

Placing a ViewPart in the EditorArea

Thanks to tedious investigation and great support from Remy I managed to open a 3.x ViewPart in the shared area with the compat layer on e4. Just use ...editorss and relation="stack" for your contribution as you would do with any other location. But beware that this won't be backward compatible anymore.

This gave me the possibility to rethink my whole UI structure without having to change a line of code, just some changes in the contributions.

Btw the compat layer is great, it truly makes sense to me to move to the e4 platform with any RCP product you may have and then incrementally make use of the new features. The e4 people managed to make our investment safe for the future of eclipse.

Friday, May 27, 2011

Up in the cloud - Trying Amazon EC2

Yesterday I deployed our osgi server process to an amazon ec2 micro instance. It was quite easy, but I had to get used to converting the ssh key for putty, using yum to install things, and notice the difference between stop and terminate an instance. terminate will painfully delete the instance ... as you can get a micro instance for free now this is something to play with. I have to calculate if this is an option for our SaaS offerings as the amazon prizing model is somehow complicated. Next time I'll give Azure a try.

Sunday, May 22, 2011

Classpath scanning with Equinox OSGi

Today I moved some code to OSGi that heavily relies on Classpath scanning.
There's a new API in BundleWiring that lets you scan for resources:
BundleWiring wiring = ctx.getBundle().adapt(BundleWiring.class);
Collection<String> resources= wiring.listResources(DOMAIN,"*.class",BundleWiring.LISTRESOURCES_LOCAL);
Unfortunately due to a bug in NestedBundleDir you need CVS HEAD from the osgi bundle to make this work inside the IDE. It will be fixed in 3.7 RC2.

Sunday, March 27, 2011

It's a joy sending bugs to the e4 team

Today I don't want to rant :) I have been porting my RCP app to the e4 compat layer in the last few months. I didn't implement many new features but I started to open some bugs for things that I either didn't understand or that simply didn't work for me on the e4 compat layer. I found some really friendly people responding (special thanks to Remy) and as of today all of my important issues got fixed. I'll be on customer site this week for some new features to come, but I'm really looking forward to have my next release built on the e4 platform.

Thanks to all of you who took care of my problems and those that are to come!

Saturday, January 29, 2011

Building a web-startable cross-platform p2-installer

Have you ever had trouble with your customers downloading the wrong version of your eclipse product to their box? We had always trouble with 64bit windows with 32bit Java installed, no one can expect from customers to know what java version they have installed.

So today I started off with a slighty customized version of the standard eclipse p2 installer. I got the 3.6.1 maintenance branch from the cvs repo, as current head doesn't compile against the 3.6 platform. I removed the shared install options, as they only would confuse users.

The idea was to webstart the installer to give users an as easy as possible download experience. But the built-in mechanisms of eclipse give us some tedious manual work to do to build such a thing.

First I created a feature containing all the plugins necessary to run the p2 installer, and added all the other platform plugins that are needed to support mac and both windows platforms. (We do not support linux by know, but that should be straightforward). One has to set the platform properties of the platform dependend plugins in the feature manifest manually, a task I always forget until I try to run the build.

Then change the p2 installer product configuration to be based on features and add you newly created feature. Create a keystore if you do not already have one and follow the instructions from the eclipse help to create a webstartable application.

Unfortunately the webstart export does not support multiple platform export, however if you have included the platform dependent plugins, you will find them in your feature.jnlp file, but with all version attributes set to 0.0.0

Now do a second export of the feature, uncheck the JNLP creation option and export for multiple platforms. Leave the signing option on as we need signed jar files for webstart. Copy all the exported, platform dependend plugins from the export to you webstartable plugins folder. (You could get them from the delta pack as well, but then they wouldn't be signed with your key). Now the tedious work: replace the jar file path with version 0.0.0 in your feature jnlp wit the correct paths to your added plugins. The platform and architecture selection in the jnlp will already be there.

To make the p2 installer work via webstart we need to do a third export. This time export the product for you main platform only and get the configuration directory from the export, copy it to the root folder of your webstartable export (simpleconfigurator needs a config file from there thats not included in the jnlp export).

Set up your main jnlp file as suggested in eclipse help and add some properties for the p2 installer:
<property name="org.eclipse.equinox.simpleconfigurator.configUrl" value="http://yourwebstarthostpath/configuration/org.eclipse.equinox.simpleconfigurator/"/>
<property name="org.eclipse.equinox.p2.installDescription" value="http://yourwebstarthostpath/"/>

Don't forget to add your customized file. Now upload this to your webserver and voila, we have a platform independent installation experience for our product.

Don't mind to ask if you run into any troubles. Getting the jnlp files work properly is sometimes confusing.

Sunday, January 2, 2011

E4 not ready for production?

I spent some time experimenting with technology, including virgo and e4 as a platform for my project over the last couple of months. Building a new release yesterday I had to step back on Eclipse 3.6 because of some small but annoying issues with the compatibility layer on e4. There where still some problems with the workbench selection and the visibility to toolbar/menu contributions. However I have to say that the e4 team was "mostly always" glad seeing me open some new bugs I found, but all in all I decided not to deliver on the new platform and give it some more time to become mature. But at least I included the e4 styling engine to give me some control over fonts. I use lots of UI Forms and I found it not easy to get a good color styling, but I guess I've read thats out of scope for the styling eninge, bad for me. Still have to open another bug for the splash handlers that don't seem to work on e4, but I guess that will not be the most important one to fix :)

Jupyter Kernel for Java9