COMPOSITE APPLICATIONS - DESIGN AND MANAGEMENT


Filtering the current user interface view
In many composite applications, one component publishes a property that is consumed by another component. The consumer component then wants to show a IBMR LotusR NotesR user interface view but have it filtered by the property that was passed in.

For example, a component could publish a property called 'PersonName'. Other components may then want to display recent mails of that person, future meetings with this person, etc. These target components typically have views that show all documents but usually do not have different views - specifically, a view with all documents for one certain person only. For this to work, the view needs to be sorted by a key.

To be able to do this, a built-in action has been added to composite application component databases. The action filters the current user interface view via the first sorted column and shows only the exact matches using a filter as a key. If the view is categorized, it then expands the found category and only shows the documents in the next level.

This action is named FilterCurrentUIViewViaViewCategory and this action gets a property named KeyFilterType (type string) that is passed in. Any property of type string can function as the key filter. Views (which all have to be filtered with the key) should contain the exact definition of action "FilterCurrentUIViewViaViewCategory" that gets the property 'KeyFilterType' (type string) passed in

The following sample WSDL show how to use this action. This WSDL needs to contain the exact definition of the datatype and action.

<types>

<xsd:schema targetNamespace="com.ibm.compositeapps.samples">

<xsd:simpleType name="KeyFilterType">

<xsd:restriction base="xsd:string"/>

</xsd:simpleType>

</xsd:schema>

</types>

<operation name="UpdateUI_Operation">

<portlet:action name="FilterCurrentUIViewViaViewCategory"

caption="FilterCurrentUIViewViaViewCategory"

description="FilterCurrentUIViewViaViewCategory"/>

<input>

<portlet:param name="KeyFilter" partname="KeyFilterPart"

caption="caption.KeyFilter"

description="description.KeyFilter"/>

</input>

</operation>

A Notes listener component picks up the action and calls the API to filter the view and refresh the window. As a result , the currently displayed Notes user interface view is refreshed in the same Notes window using the new filter.

For example, a source component would publish a property 'KeyFilterType' which could be the person name and the target component action will be invoked and the view will be filtered out.

You would use the Composite Application Editor to wire the source component's property with the built in action of the target component.

Use the following steps to create and wire a view filter:

1. In the Property Broker Editor, edit the WSDL file of the NSF containing the categorized view.

2. Create an action named "FilterCurrentUIViewViaViewCategory" and give it some Input Property of type string.

3. In the Designer client, edit the design of the categorized view and create a view action.

4. In the view action's Infobox, switch to the Advanced tab, and select the Composite Settings Action Name "FilterCurrentUIViewViaViewCategory".

5. Add LotusScript to this action to consume the property. See Using LotusScript classes and APIs in composite applications for more information.

6. Save and close the view.

7. Open the Composite Application in the Composite Application Editor and wire the desired property to the action "FilterCurrentUIViewViaViewCategory"

See Also