27.4 Running the cooperative portlets
Execute the following steps to run the cooperative portlets scenario:
1.
| Add the portlet projects to the WebSphere Portal V5.1 Test Environment server:
|
a.
Right-click the server and select Add and remove projects.
|
b.
From the list of available projects, select EchoSource and click the Add > button to add this project to the list of configured projects on the right side. Repeat the same steps to add the EchoTarget project.
|
2.
| In the Servers section, double-click the WebSphere Portal V5.1 Test Environment.
|
Figure 27-6 WebSphere Portal V5.1 Test Environment
3.
| In Portal Options, do the following:
|
-
Select the option Enable base portlets for portal administration and customization. This option is necessary to create wires.
|
-
Uncheck the option Enable multiple pages when deploying portlet projects. This allows you to deploy both the EchoSource and the EchoTarget portlets on the same page.
|
Figure 27-7 Portal options in WebSphere Portal V5.1 Test Environment
5.
| From the Project Explorer view, right-click EchoSource project. Then click Run | Run on server, select WebSphere Portal V5.1 Test Environment server and click Finish. This will load your project into the test environment so that you can view it in Rational Application Developer Web browser. It may take few minutes for this process to complete.
|
6.
| Now you will see the two portlets in the browser. Click Edit Page and select the Wires tab to make the cooperation happen at runtime. You will see different combos to select a source portlet, a property to send, a target portlet and a property or action to receive. If you select Global wire that means that their effects are manifested to all users that can view the page and portlets.
|
7.
| Select the following values:
|
-
Source Portlet: Echo Source portlet
|
-
Target Portlet: Echo Target portlet
|
-
Receiving: Show message, Input message.
|
Figure 27-8 Portlet Wiring Tool
Figure 27-9 New wire
10.
| Enter a message in the Echo Source portlet, for example: Testing cooperative portlets.
|
12.
| The message will be echo back in the source portlet and sent to the Echo Target portlet.
|
Figure 27-10 Sending a message
|