Directory

← Back

Vaadin IPC for Liferay

Provides inter-portlet communication for portlets deployed to a Liferay server

Author

Rating

Popularity

<100

The standard inter-portlet communication (IPC) mechanism defined in the Portlet 2.0 specifications requires the page to be reloaded when the communication takes page. This is not very nice, especially for Vaadin application.

Liferay provides a JavaScript API that allows portlets to communicate without the need of refreshing the page. This component uses that API to allow Vaadin portlets to communicate with each other without the need of refreshing the page or using a push add-on.

The add-on also allows Vaadin portlets to communicate with non-Vaadin portlets and Liferay gadgets, using the same API.

The data sent using this mechanism is limited to a String and is passed to the target portlet(s) on the client side. If you want to pass data on server side you can store the data somewhere where it is available to the target portlet and only pass a reference which allows the target portlet to lookup the real data.

This add-on replaces the earlier LiferayIPC add-on.

For Vaadin 7:

The demo war requires 7.0.0.beta11 to be in use in the portal. Also add vaadin-ipc-for-liferay-2.0.0.jar to WEB-INF/lib before deploying the demo war. No widgetset compilation is needed.

For Vaadin 6:

The demo war requires WEB-INF/lib/vaadin.jar (Built using Vaadin 6.6.2) and WEB-INF/lib/vaadin-ipc-for-liferay-1.0.0.jar to be found in the portal. Remember to rebuild the Vaadin widget set in Liferay after adding the IPC add-on!

Sample code

LiferayIPC liferayIPC_1 = new LiferayIPC();
myLayout.addComponent(liferayIPC_1); // Must be added to a layout to be active

/* Send the event */
liferayIPC_1.sendEvent("theEventId", "theData");
liferayIPC_1.addListener("theEventId", new LiferayIPCEventListener() {
    public void eventReceived(LiferayIPCEvent event) {
        getWindow().showNotification("Got event "+event.getEventId()+" with data "+event.getData());
    }
});
LiferayIPC liferayIPC = new LiferayIPC();
myLayout.addComponent(liferayIPC); // Must be added to a layout to be active

/* Send the event */
liferayIPC.sendEvent("theEventId", "theData");
LiferayIPC liferayIPC = new LiferayIPC();
liferayIPC.extend(myUI);
liferayIPC.addLiferayIPCEventListener("theEventId",
        new LiferayIPCEventListener() {
            public void eventReceived(LiferayIPCEvent event) {
                Notification.show("Got event " + event.getEventId()
                        + " with data " + event.getData());
            }
        });
LiferayIPC liferayIPC = new LiferayIPC();
liferayIPC.extend(myUI);

/* Send the event */
liferayIPC.sendEvent("theEventId", "theData");

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Support for Vaadin 7.0.0.beta11 and newer No longer requires widgetset compilation Extend the UI instead of adding it to a layout

Released
2012-12-21
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 7.0+
Vaadin 6.7+ in 1.0.0
Vaadin 6.6+ in 0.9.1
Browser
N/A

Vaadin IPC for Liferay - Vaadin Add-on Directory

Provides inter-portlet communication for portlets deployed to a Liferay server Vaadin IPC for Liferay - Vaadin Add-on Directory
The standard inter-portlet communication (IPC) mechanism defined in the Portlet 2.0 specifications requires the page to be reloaded when the communication takes page. This is not very nice, especially for Vaadin application. Liferay provides a JavaScript API that allows portlets to communicate without the need of refreshing the page. This component uses that API to allow Vaadin portlets to communicate with each other without the need of refreshing the page or using a push add-on. The add-on also allows Vaadin portlets to communicate with non-Vaadin portlets and Liferay gadgets, using the same API. The data sent using this mechanism is limited to a String and is passed to the target portlet(s) on the client side. If you want to pass data on server side you can store the data somewhere where it is available to the target portlet and only pass a reference which allows the target portlet to lookup the real data. This add-on replaces the earlier LiferayIPC add-on. For Vaadin 7: The demo war requires 7.0.0.beta11 to be in use in the portal. Also add vaadin-ipc-for-liferay-2.0.0.jar to WEB-INF/lib before deploying the demo war. No widgetset compilation is needed. For Vaadin 6: The demo war requires WEB-INF/lib/vaadin.jar (Built using Vaadin 6.6.2) and WEB-INF/lib/vaadin-ipc-for-liferay-1.0.0.jar to be found in the portal. Remember to rebuild the Vaadin widget set in Liferay after adding the IPC add-on!
Online