Enabling cooperative sources with a Faces action

To enable a cooperative source for Faces portlet, you can use a Command - Hyperlink component in place of a Click-to-Action component to trigger portlet communication.

  1. In the Project Explorer view, select a portlet or the Portlet Deployment Descriptor. Portlets are displayed when you expand the Portlet Deployment Descriptor node under the portlet project folder.
  2. Right-click the desired portlet, and select Cooperative > Enable Source from the pop-up menu. The Enable Cooperative Source dialog opens. Alternatively, open a JSP page, ensure that it has focus, and select Page > Cooperative > Enable Source from the menu.
  3. Provide the appropriate values in the Enable Cooperative Source dialog box. (See Enabling cooperative sources for a complete description of the fields included in this dialog box.) Click OK.
    Here is an example of the code created in the WSDL file:
    <portlet:action type="standard" name="showTickets"></portlet:action>
         <output>
              <portlet:param name="customerId" partname="customerId_Output"
                   boundTo="request-attribute" caption="Customer ID"></portlet:param>
         </output>
    The cooperatively-enabled portlet is shown with a source portlet icon ( Cooperative source portlet icon) in the Project Explorer view.
  4. Insert a Command - Hyperlink component in the appropriate JSP file.
  5. In the Properties view, add a parameter to the Command - Hyperlink component that specifies either the action name parameter you specified in the Enable Cooperative Source dialog, orcom.ibm.portal.propertybroker.action if you omitted the action name parameter, along with a value attribute that is the action name specified in the WSDL file.
    Note: The parameter name used for a JSR 168 API portlet is com.ibm.portal.propertybroker.action; use com.ibm.faces.portlet.ACTION for an IBM® portlet API portlet.
    For example:
    <f:param name="com.ibm.portal.propertybroker.action" value="showTickets"></f:param>
    In addition, you may want to add another parameter to pass the value of the output property that is available in the page, and use the parameter in the page code (shown in the next step) to store the location (scope) specified by the boundTo attribute in the WSDL file.
  6. In the Quick Edit view, for the Faces action associated with the Command - Hyperlink component, store the data to send to the target using the parameter name and scope (specified with the boundTo attribute) in the WSDL file. For example:
    getRequestScope().put("customerId", customerId);
Related concepts
Developing cooperative portlets
Related tasks
Enabling existing portlets for cooperation
Enabling cooperative sources
Enabling cooperative targets
Inserting Click-to-Action encodeProperty
Inserting Click-to-Action encodeProperties
Editing Click-to-Action encodeProperty
Editing Click-to-Action encodeProperties
Related reference
Web Services Description Language (WSDL) 1.1
WebSphere Portal Information Center
XML Schema Part 2: Datatypes
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.