Applications currently written to work with the Host Access Class Library (HACL) can easily be modified to use the Open Host Interface Objects (OHIO) API. Both API's are object oriented abstractions of a host terminal session. In general, the classes and methods in the HACL API are the same as the classes and methods in the OHIO API. Modifying a HACL application to use the OHIO API requires using different class names and method names, but the flow and logic of the application remains unchanged.
The following sections will help a programmer who is familiar with HACL understand how OHIO is similar and how OHIO is different than HACL. Using this information, you can understand how a particular HACL application can be modified to use OHIO.
The classes and methods in the OHIO API are very similar to the classes and methods found in the HACL API. The following table shows HACL classes and their corresponding OHIO class:
HACL Class |
OHIO Class |
Description |
---|---|---|
ECLConnMgr |
Handles creating and destroying sessions. | |
ECLConnList |
A collection of sessions. | |
A host session. | ||
The presentations space/virtual screen portion of the host session. | ||
The operator information area portion of a host session. Contains host status information. | ||
A collection of fields from the virtual screen. | ||
A field from the virtual screen. |
There are a number of features that are available in HACL that are currently not defined in the OHIO API. This includes:
If your application requires these features, you must use the HACL API. It is expected that the OHIO API will add these and other features in the future as the API becomes further defined.
Each OHIO object has the ability to provide you with a non-OHIO object that provides additional vendor-defined features. This non-OHIO object is returned when the getVendorObject() method is called on an OHIO object. For this product, calling getVendorObject() on an OHIO object will return the corresponding HACL object. For example, calling getVendorObject() on the OhioFields object will return an ECLFieldList object. For those cases where you require a function that is currently not available in the OHIO API, use the getVendorObject() method to get a HACL object that will provide you with that function.
The OHIO API differs in the method for sending keystrokes to the host. HACL uses the ECLPS.SendKeys() method to send keystrokes and "aid" keys (Enter, PA1, etc) to the host. OHIO use the iOhioScreen.sendKeys to send text to the host and uses the iOhioScreen.sendAID method to send "aid" keys to the host.
In HACL, both linear positional addressing (with position 1 in the upper left corner, progressing from left to right, top to bottom) and row and column addressing can be used. The positional method presents the virtual screen as a single array of data elements and uses a single number to index into that array, pinpointing a location in the virtual screen. The row and column method uses two values, a row number and column number to pinpoint a location in the virtual screen. In OHIO, a location within the virtual screen is identified by use of an iOhioPosition object. Both positional and row and column addresses need to be converted to iOhioPosition objects in your OHIO application.
HACL provides a static utility class to convert a positional address to an iOhioPosition object:
In addition, HACL provides a static utility class to convert from an iOhioPosition object to a positional address:
Row and column addresses can easily be converted to an iOhioPosition object by using the CreateOhioPosition(row,
col) method that is available on any OHIO object. To get a row and column address from an iOhioPosition object,
use the iOhioPosition getRow() and getColumn() methods.