Here's how it works:
As a side note, I really like Inkscape for drawing those diagrams. Well, I have no clue how wonderful some "best-of-the-best" vector graphics apps are. But I seem to be able to do practically everything with Inkscape and, after a while, it's not so hard to use. I've also done a nice production pipeline so that I can just save the pictures as SVG and the build scripts for the book do the exporting to PNG automatically. It's not even hard, just one command-line call.
The LiferayIPC is a Vaadin component that you add in the main window (layout). The inter-portlet communication is done between the client-side widgets.
LiferayIPC liferayipc = new LiferayIPC();To receive an event in other portlets, you define a LiferayIPCEventListener as follows:
layout.addComponent(liferayipc);
...
liferayipc.sendEvent("hello", "This is Data");
liferayipc.addListener("hello", new LiferayIPCEventListener() {The add-on package includes this nice demo WAR that you can just deploy in Liferay. It demonstrates how to send and receive inter-portlet events.
public void eventReceived(LiferayIPCEvent event) {
getWindow().showNotification(
"Received hello: " + event.getData());
}
});
You can combine this client-side communication method with server-side inter-portlet communication, for example, by using portlet session attributes. You may need to do that for security reasons or if you need to send large amount of data. In such case, you just send a client-side notification that says: "Hey, there's new server-side data available, read it now."
So, go ahead and read the new section in the Book of Vaadin. It explains everything. If it doesn't...go and ask in the Vaadin forum.
No comments:
Post a Comment