Enhancing the sample by adding a portlet componentAdded by IBM on October 5, 2011 | Version 1 (Original)
|This topic explains how to develop a portlet that will run locally and communicate with an SWT based component after both have been projected to the client from a WebSphere® Portal server.
This topic explains how to develop a portlet that will run locally and communicate with an SWT based component after both have been projected to the client from a WebSphere
® Portal server.
You must complete the steps in Creating an SWT view component
before you can perform the steps below.
To create a portlet component, complete the following steps:
Parent topic: Creating a simple composite application in Eclipse
- Using an Eclipse-based development tool that supports portlet development, create a fully functioning portlet, not a dummy portlet.
It must use the IBM® Portal property broker functionality to publish properties to the SWT component.
- Reference the same WSDL file that you created in the previous procedure in the portlet preferences in the portlet.xml deployment descriptor file.
- Using Rational® Application Developer for WebSphere Software or the Java™ EE Web application tools provided by the Eclipse Web Tools Platform (WTP) project, bundle the portlet into a Web Application Archive (WAR) file.
- From the Administration page, navigate to the WebSphere Portal > Portlet Management > Web Modules page, and then click Install to install your WAR file as a Web module.
- Verify the portlet was installed by searching for it on the Portlet Management > Portlets page.
- In the Templates > Application page, create a new application and make the following edits:
- In the Content tab, define the layout for the application and add the portlet to the page.
- In the Rich Client tab, select This portlet runs locally on the rich client (requires client bundle), and then type the directory of the Web module for the portlet into the Portlet context root field to configure your portlet to be exposed in the client through the local JSR-168 container.
- In the Wires tab, create wires between this portlet and the portlet representing the SWT view by specifying the source portlet, the output property, the target page, which defaults to current, the target portlet, the target action, and whether or not the wire is public or private.
If you want to implement cross-page wires, which are wires that open an event in a second page, you must designate them as global actions. To do so, click Manage Actions and then select the Global check box.
- You must add the portlet to the feature for the SWT view plug-in. Use the Lotus® Expeditor command line tool (WAB Tool) to compile the portlet WAR file into an Eclipse-based plug-in.
The WAB tool is provided in the Lotus Expeditor Development kit. Go to the plugins directory, and look in the com.ibm.pvc.tools.web.translator plug-in for the wab.exe file. See WAB Utility for information on using this tool.
- Add the resulting plug-in to the feature plug-in you created for the SWT view.
- From the Portlet Management > Portlets page, find the portlet you just created, and click the Configure icon to open it, and then add the feature ID to the portlet properties to ensure that the feature is installed when the application is installed from the portal catalog.
- Redeploy the update site with the newly added plug-in to the HTTP server.
If you already deployed the feature and are adding this plug-in to an existing feature, be sure to increment the version number so that the client can pick up your changes with its next update.