Using Lotus® Expeditor property broker to communicate with local portlet

Perform the following steps to use the property broker between RCP and Portlet:

  1. Develop a portlet which sends message out. Define the portlet message using wsdl. See the following example code:
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="GeneratedPropertyBrokerDefinition"
    	targetNamespace="http://com.ibm.propertybroker.standardtypes"
    	xmlns="http://schemas.xmlsoap.org/wsdl/"
    	xmlns:portlet="http://www.ibm.com/wps/c2a"
    	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    	xmlns:tns="http://com.ibm.propertybroker.standardtypes"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    
    	<types>
    		<xsd:schema
    			targetNamespace="http://com.ibm.propertybroker.standardtypes">
    			<xsd:simpleType name="WireStringType">
    				<xsd:restriction base="xsd:string" />
    			</xsd:simpleType>
    		</xsd:schema>
    	</types>
    
    	<message name="wire_message">
    		<part name="outputPart1" type="tns:WireStringType" />
    	</message>
    
    	<portType name="com.ibm.propertybroker.standardtypes_Service">
    		<operation name="PortletMessageGeneratorAction">
    			<output message="tns:wire_message" />
    		</operation>
    	</portType>
    
    	<binding name="com.ibm.propertybroker.standardtypesbinding"
    		type="tns:com.ibm.propertybroker.standardtypes_Service">
    
    		<portlet:binding />
    		<operation name="PortletMessageGeneratorAction">
    			<portlet:action activeOnStartup="true"
    				caption="message generator action"
    				description="message generator action"
    				name="PortletMessageGeneratorAction" selectOnMultipleMatch="false"
    				type="standard" actionNameParameter="ACTION_NAME" />
    			<output>
    				<portlet:param boundTo="request-attribute"
    					caption="message_caption" name="portlet_message" partname="outputPart1" />
    			</output>
    		</operation>
    	</binding>
    </definitions>

    Use both name and namespace to specify a property. Name=”portlet_message”, namespace=”http://com.ibm.propertybroker.standardtypes”.

  2. Turn this portlet project into the plug-in project.
  3. For the services that need to receive messages from this portlet, you need to add property listener to the property broker service. See the following example code:
    final IProperty property = ServiceManager.createProperty("portlet_message",
    				"http://com.ibm.propertybroker.standardtypes");
    		ServiceManager.getPropertyBroker().addPropertyListener(new IPropertyListener() {
    
    			public void handlePropertyChange(IPropertyValue value) {
    				if (property.equals(value.getProperty()))
    					aBTTText.setText(value.getValue().toString());
    			}
    
    		}, property);

The following screen capture shows how to use RCP property broker to communicate with local portlet application:

screen capture showing how to use RCP property broker to communicate with local portlet application