Using the Host on Demand (HOD) containersAdded by IBM on February 24, 2012 | Version 1 (Original)
|Describes how to use the Host on Demand (HOD) containers.
Describes how to use the Host on Demand (HOD) containers.
The Host On-Demand container provides access to IBM WebSphere Host On-Demand applications from within a composite application.
Host application screens are identified for the container by landmarks defined in a container configuration. Landmarks specify the actions that should occur for different screen regions in the host application and the events that should trigger the actions. Through the configuration and its landmarks, the Host On-Demand container allows the composite application to exchange information with a host application.
Configuring Host On-Demand containers with the Composite Application Editor
You can use the Composite Application Editor to add the Host On-Demand container to a composite application, define landmarks, and add actions. To add the container, drag it onto the application from the Containers folder in the Component palette.
Once you have added the Hosted On-Demand container to your application and specified the host application you want to access, you can use the Composite Application Editor toolbar to define data exchange actions that should be triggered when specific events occur.
Configuring Host On-Demand containers in plugins
You can also configure a Host On-Demand container plugin by editing its "plugin.xml" file. This process is described generally in "Application configurations" in Developing Applications for Lotus Expeditor in the IBM Lotus Expeditor information center. Keep in mind these specific tasks when updating plugin.xml.
Create properties for each field in the host application that your composite application needs to access.
Add a targetBuilder element to specify the session configuration stored in an external properties file, similar to the one use d by the Hosted On-Demand session bean. You can specify a URL (for example, 'file://D:/session.properties') or a file in a bundle, in which case the targetBuilder expression attribute should be set to a value of the form 'bundle:/<bundle-symbolic-name>/<path>'; for example, 'bundle:/test.plugin/configuration/session.properties'. For a complete list of supported session properties, see the Host On-Demand information center (http://publib.boulder.ibm.com/infocenter/hodhelp/v10r0/index.jsp?topic=/com.ibm.hod.doc/doc/beans/com/ibm/eNetwork/beans/HOD/Session.html).
If you use the Composite Applications Editor, base64-encoded session properties are stored in the 'hod.properties' component preference. The container uses the session properties defined in this preference if the targetBuilder expression attribute is missing or has an empty value. This is the mechanism used by instances of the generic Hosted On-Demand container created in the Composite Application Editor.
- Create a landmark identifier element to define a screen region to be used for comparison against landmark expressions. If no landmark identifier is defined, landmark expressions are compared against the entire contents of the screen.
- Create landmark elements as needed for the required events and actions.
- Add landmark expressions to the expression attributes of the landmark elements. The expressions can be simple values, regular expressions, or more complex screen descriptions stored externally. To specify a regular expression, prefix the landmark expression with 'regex:'. To create an external screen description, use the syntax defined in the "Host On-Demand macro programming guide" (http://publib.boulder.ibm.com/infocenter/hodhelp/v10r0/index.jsp?topic=/com.ibm.hod.doc/doc/macro/macro.html), and use one of the following mechanisms to reference it in the landmark expression.
- External file URL (for example, 'file://D:/screen1.xml')
- File in a bundle/plugin, with the expression of the form 'bundle:/<bundle-symbolic-name>/<path> (for example, ('bundle:/test.plugin/screens/screen2.xml')
- Component preference, storing a base64 encoded screen description. The preference name must be of the form 'hod.screen.<name>' and the landmark expression must be of the form 'screen:<name>'. This is the mechanism used by the landmark editor tab in the Composite Application Editor.
Note: To override the region specified by the landmark identifier, prefix the landmark expression with '\$<region>=', where <region> specifies the new region. The value following the prefix can be a simple value or a regular expression.
- Define the events that trigger the required actions for the Hosted On-Demand component. The Hosted On-Demand container supports the following events:
- contentComplete - This event occurs when a screen is recognized. All actions in this event are executed serially.
- dataChange - This event occurs either when a property change is coming into the container or when a region of the screen has changed.
- viewInit - This event occurs when the specific component (the view part) opens initially.
- viewClose - This event occurs when the specific component (the view part) closes.
- Specify the actions (publish or receive) to perform when each event occurs. In each action, specify the properties to which the action applies and the associated fields (screen regions).
Represent screen positions with one of the following forms:
- Linear position - '<linear position>' (for example, '1')
- Row, column coordinate - '<row>,<column>' (for example, '5,10')
Represent screen regions with one of the following forms:
- Linear region - '<position>:<length>' (for example, '1:20' or '1.1:20')
- Rectangular region - <upper, left position>-<lower, right position> (for example, '1-160' or '1,1-2,80')
Note: When setting a field, the value may be truncated if it exceeds the size of the screen region defined by the field.
Extending the Host On-Demand container
To extend the Host On-Demand container functionality, extend its view class, com.ibm.rcp.composite.container.hod.view.HODAppView. Use the getContainer method to access the HODAppContainer instance. Use the getECLPS method to access the presentation space, and the g etTerminal method to access the terminal bean. For detailed information about Host On-Demand APIs, see the Host On-Demand information center.
For complete details on how to use this container, refer to the documentation for the Composite Application Editor, Lotus Expeditor, and the Host on Demand information center (http://publib.boulder.ibm.com/infocenter/hodhelp/v10r0/index.jsp?topic=/com.ibm.hod.doc/doc/beans/com/ibm/eNetwork/beans/HOD/Session.html).