Handling portlet events in Vaadin 7

Hi.

Last year I developed an application using Vaadin 6.x which made use of PortletEvents, and managed to make it work on WebSphere Portal.

To send the events, I used the following code:


PortletApplicationContext2 ctx = (PortletApplicationContext2) mainWindow.getApp().getContext();
ctx.sendPortletEvent(mainWindow, new QName(nameSpace, eventName), data);

And to receive them, I used a class that implemented PortletListener, and added it like


PortletApplicationContext2 ctx = (PortletApplicationContext2) getContext();
ctx.addPortletListener(this, new XYZListener());

Now, I need the same functionality with Vaadin 7, but so far, PortletApplicationContext2 seems to be unavailable, and while I can access the method sendPortletEvent through VaadinPortletSession, this class has been deprecated.


VaadinPortletSession portletsession = (VaadinPortletSession) VaadinSession.getCurrent();

The class PortletListener seems to be available, but the method to add the listener is also available through VaadinPortletSession, which could be removed in any future version of Vaadin.

What is the Vaadin 7 way to handle events in portlets? I checked VaadinPortlet and VaadinPortletService and can’t find any method similar to sendPortletEvent, which class should be used instead of PortletApplicationContext2 or VaadinPortletSession?

I am voting this JSR 286 support either needs to be fixed, or it needs to go away. Vaadin is great, and I would love to use it for portlet development in uPortal, and I have a portlet working, but I MUST listen for portlet events and deal with standard portlet activities. I personally can’t wait for Vaadin 8, and if I have to go a different direction now, I won’t come back and rewrite in Vaadin later.