Portlet Factory, Version 6.1.2
Cooperative Portlet Source builder
With the Cooperative Portlet Source and the Cooperative Portlet Target builders, you create portlets that can interact with each other to share information. One or more target portlets on a portal page can automatically react to changes from a source portlet when the source portlet triggers an event. The following are the high-level steps required to implement these types of Portlets:
- Create a target model using the Cooperative Portlet Target builder, which will receive the event from the source. Add an Event Handler builder to this model to process the event.
- Create a source model using the Cooperative Portlet Source builder, which will trigger an event that is to be received by the target portlet.
- Deploy or redeploy the project and add the source and target portlet to a portal.
- Place the portlets on a portal page, and use the Portlet Wiring tool to connect the source portlet to the target.
Key inputs
In most common applications of this builder use these inputs to create portlets that can communicate with one another: See the builder input help for a complete description.
- Name - Enter a name for this builder call.
- Type - Select the Cooperative Portlet type. Typically Property Broker Link or Property Broker Action.
- Output Definitions
- Name - Enter the name of the output that will be passed to the target. For example, OrderID. This input is required. For JSR-286 portlets this must match the Input Name specified in the target builder.
- Output Type Name - Enter the XML Schema Datatype name for the output. This must match the Input Type Name specified in the target builder. This is not used for JSR-286 portlets. Example: OrderIDType
- Value - Enter the value to be passed as an input to the target event.
Key objects this builder creates
When used to create portlets that can communicate with one another, the key objects this builder creates are:
- This builder creates a method named pbAction_<builder name> that is used to initiate the event. A Property Broker Link type will automatically call this, but manually invoke this if you are creating you own UI using the Property Broker Action type
Samples
A complete sample shows you how to use IBM® WebSphere Portlet Factory to implement inter-portlet communication including Property Broker, Click-to-Action, Portlet Factory events, and shared variables.
http://www.lotus.com/ldd/pfwiki.nsf/dx/ibm-using-inter-portlet-communication
More about this builder
When portlets communicate with each other, an action or event that occurs in a source portlet can result in messages being sent to other portlets. These messages might update data or cause other display changes.One or more cooperative portlets on a portal page can automatically react to changes from a source portlet triggered by an action or event in the source portlet. Portlets that are targets of the event can react so that users are not required to make repetitive changes or actions in other portlets on the page.
Cooperation between source and target portlets is facilitated by a IBM WebSphere Portal runtime entity called the Property Broker. Portlets on a page can cooperate in this way even if they were developed without the expectation of cooperation.
This Builder supports three kinds of inter-portlet communication formats:
- JSR-286 Events
- The Cooperative Portlet Source and Cooperative Portlet Target builders support the event functionality which is part of the JSR 286 standard. Event declarations are added to the JSR 286 deployment descriptor (portlet.xml), as opposed to the WSDL files used by the JSR-168 Property Broker events. The event declarations are added automatically through the use of the Cooperative Portlet Builders, and the Factory deployment war creation process. The Cooperative Portlet Source builder describes the events that the portlet publishes, and the Cooperative Portlet Target Builder describes the events that the portlet can process. Event names are made up of the output/input "Name" and "Namespac" which makes them uniquely identifiable. The "Name" and "Namespace" form the event'sQName. Events can pass a single object, which must have a valid JAXB binding, or be in the list of Java standard classes of the JAXB 2.0 specification. To send an event from a source portlet to the target the event QName and data type must match. The "Output Type Name" and "Input Type Name" builder inputs are not used for JSR-286 events and are ignored. Event declaration can optionally specify a list of Aliases to provide alternate QNames that are used when matching events against each other. This is useful when communicating between JSR 168 cooperative portlets and JSR 286 event portlets. See the JSR-286 specification for complete details on these events.
- Standard (JSR 168) implementations
- For use in portlets built in accordance with the JSR 168 Portlet API
- Click-to-Acton (C2A) implementations
- For use in legacy portlets built in accordance with the deprecated IBM portlet API
Note: Click-to-Action is a legacy WebSphere Portal feature that provides automatic frontend integration of portlets. Using C2A, users can transfer data from one portlet to another, and have the target portlet react to the data, thus causing information on the page to be refreshed. In the C2A mode, this builder places the <C2A:encodeProperty> or <C2A:encodeProperties> tag on a model page. These tags are used to build a menu that can fire a C2A event to a target portlet on the same page that matches the specified type.
Parent topic: Builder help
- About using the builder call editor
The builder call editor allows you to specify all the input values to a builder call.
- Locating control builder calls on pages
Each page location technique results in the generation of a Page Location string that determines on what pages, and where on those pages, the control builder calls are added.
- Cooperative Portlet Source builder inputs
This topic describes the inputs for the Cooperative Portlet Source builder.
- How do I use cooperative portlets?
Cooperative portlets are available in IBM WebSphere Portal version 6 and later. Cooperative portlets can interact with each other to share information.
- Cooperative Portlet Target builder
Use the Cooperative Portlet Target builder to define a Property Broker or C2A (Click to Action) event.
Library | Support |