Web Services for Remote Portlets (WSRP) is a way to deploy a portlet in one portal, a producer, and use it in another, a consumer. This is done using a special WSRP portlet that relays the user input from a consumer to an actual portlet running in a producer. The Vaadin WSRP add-on gives you the ability to run Vaadin portlets as remote WSRP portlets. The basic WSRP architecture is illustrated in Figure 13.8, “WSRP Architecture”.


In this documentation, we give the instructions for Liferay, but the Vaadin WSRP add-on should work in any other portal or non-portal server that supports WSRP. If you use other portal software, please refer to its documentation for the relevant parts of WSRP configuration.

The add-on is licensed under the same Apache License 2.0 as the Vaadin Framework itself.

The Vaadin WSRP add-on is available as a JAR from the Vaadin Directory as well as from a Maven repository, as described in Chapter 15, Using Vaadin Add-ons. Vaadin 6.6.0 or later is required.

You need to install the Vaadin WSRP JAR at least in the producer portals. A consumer only needs the widget set, but no JARs related to your Vaadin portlet, not even the Vaadin JAR.

You should put the Vaadin WSRP JAR in the WEB-INF/lib folder under the root context in the producer portal server. The location of the root context depends on the server, for example in Tomcat it is in webapps/ROOT.

The Vaadin WSRP add-on contains a widget set, which you must compile into the Vaadin widget set installed in the portal. The widget set is needed in both the producer and consumer portals, but you do not need the WSRP JAR (or any other Vaadin JARs) in the consumer portal. You can avoid compiling the widget set by copying it (and the Vaadin themes) from the producer.

If you use Liferay, the easiest way to compile the widget set is to use the Vaadin Control Panel for Liferay add-on (also available from Vaadin Directory). Its use is described in detail in Section 13.9, “Vaadin Control Panel for Liferay”. You can use the Control Panel to upgrade Vaadin, if you need, then select the Vaadin WSRP add-on, and compile the widget set. Once compiled in the producer, you can copy the ROOT/html/VAADIN folder to the corresponding folder in a consumer, or do the same compilation in the consumer separately.

For other portals than Liferay, a simple manual way to compile the widget set is to create a Vaadin project in Eclipse, add the WSRP JAR and any other required JARs to the WebContent/WEB-INF/lib folder, and click the Compile Vaadin widgets button. You need the Vaadin Plugin for Eclipse to do this.

Once you have configured a portlet as a producer in the producer portal, you can add it as a consumer portlet in a consumer portal. The consumer portlet is not a Vaadin portlet but a special WSRP portlet that relays the user input to the producer portlet in the other portal.

This requires that you have copied or compiled the widget set (and themes) in the consumer, as described earlier.

In Liferay, you first need to configure a WSRP consumer in the Control Panel as follows:

In other portals than Liferay, follow the instructions for the portal software to set up the portlet as a producer.