This JavaBean communicates with the host application using XML data formatting. A JavaDoc for this JavaBean is included with the Host Publisher installation and can be accessed starting with the following file:
install_dir\SDK\XLGW\xmlAppDataBean\AllNames.html
where install_dir is the directory in which Host Publisher is installed. The following functionality is provided by the xmlAppData JavaBean: • It provides Java classes and events for sending and receiving host
windows.
• It provides an XML interface for representing and manipulating these host windows.
The sample HTML-to-Host emulator is located in the SDK: <HostPub>\SDKXLGW\Servlet\xmlLegacyGatewayServletSample
The xmlLegacyGatewayServlet uses XSL processing to convert the XML host window data to the HTML output that is then sent to the Web browser. The HTML output that the Web browser is sent contains JavaScript, where the JavaScript resides in a Host Publisher directory that the WebSphere Application Server is configured to access.
Refer to Figure 26 on page 32 to see how the xmlAppData JavaBean relates to the other components of the XML Legacy Gateway. The xmlAppData JavaBean contains properties that describe the Host Publisher, HOD, and TN3270 or TN5250 parameters used to instantiate a host session.
The xmlAppData JavaBean also contains properties that describe the host data as XML records. These records contain the text of the fields displayed on the window and the attributes of the fields. Methods are supplied for reading the fields so they can be manipulated as an XML document. The xmlAppData JavaBean contains methods for sending a new window of data to the host. This new window is described by an XML document, which will often be the previous host data transformed into an XML document, with the user input fields updated, or a user action specified, or both.
The xmlAppData JavaBean sends xmlDataEvents to all xmlDataEvent listeners. The data events are sent when the host window has changed. The xmlAppData JavaBean interacts with the IBM Host On-Demand (HOD) session JavaBean using PSEvents. When a PSEvent is received by the xmlAppData JavaBean, the JavaBean updates its internal objects to reflect the new status of the host window. The xmlAppData JavaBean sends an xmlDataEvent to inform its listeners of the change.
The xmlAppData JavaBean sends xmlErrorEvents to all xmlErrorEvent listeners when a processing error has been detected. The xmlAppData JavaBean sends xmlLegacyTraceEvents to all xmlLegacyTraceEvent listeners for appropriate tracing of the xmlAppData JavaBean activity. The xmlAppData JavaBean listens for HODTraceEvents and sends the HODTraceEvents to all xmlHODTraceEvent listeners.
3.6.2.1 Interfaces
The xmlAppData JavaBean provides for the following interfaces you can use when writing a servlet that invokes this API.
This interface is used for receiving notification of host window changes. It requires you to include the following method:
- xmlDataEvent(xmlDataEvent)
This is an abstract method to receive notification of host window changes.
2. xmlErrorListener
This interface is used for receiving notification of xmlAppData errors. It requires you to include the following method:
- xmlErrorEvent(xmlErrorEvent)
This is an abstract method to receive error notifications. 3. xmlTraceListener
This interface is used for receiving notification of xmlAppData trace events. It uses the following methods:
- xmlHodTraceEvent(TraceEvent)
This is an abstract method of the xmlTraceListener event handler. - xmlLegacyTraceEvent(String)
This is an abstract method of the xmlTraceListener event handler. 3.6.2.2 Classes
The following classes are available with this API: 1. xmlAction
This class extends the Hashtable class and contains the host window action information for XML host data parsing and generation.
2. xmlActionToSelect
This class extends the xmlAction class and contains the host window action information for XML host data parsing and generation
3. xmlAppData
This class extends the Object class and implements the Serializable, PSListener, TraceListener and CommListener interfaces. The xmlAppData Bean can listen for session presentation services events and convert host terminal data windows to XML formatted data. The xmlAppData Bean also converts XML-formatted data to host terminal data windows and send them to the host using an HOD ECLPS object.
This class extends the Object class. It includes utilities for processing data with double-byte characters.
5. xmlDataEvent
This class extends the Object class. It is used to create an event that contains a new window and/or input action from the host.
6. xmlDisplay
This class extends the Hashtable class. The constructor for this class is used to build an object to contain the XML host data host window display information.
7. xmlErrorEvent
This class extends the Object class. It used to receive an event that signals that an error has occurred within the xmlAppData JavaBean. These events may be internal to the xmlAppData bean, or the xmlAppData bean may be relaying an error that was received from another Host Publisher object, or the xmlAppData bean may be relaying an error that was received from a Host On-Demand object.
8. xmlField
This class extends the Hashtable class. The constructor for this class is used to build an object to contain the XML host data host window field information.
9. xmlLegacyGenerator
This class extends the Object class. This class is used to create an XML host data document (from contents specified in the session and screen objects). The document is returned via the getXMLDoc() method. Display information and unmodified fields can be omitted in the creation process. 10.xmlLegacyParser
This class extends the Object class. This class parses an XML host data document into its content objects returned via the getXMLSession and getXMLScreen methods.
11.xmlScreen
This class extends the Object class and implements the Cloneable and Serializable interfaces. It provides access to the xml_host_data which represents a host window.
12.xmlSession
This class extends the Hashtable class. It contains the host connection, or session, information.
For details about how these interfaces and classes are used see the online documentation mentioned in 3.9, “Documentation” on page 50.