In continuation to the previous blogs about Automation using PCSAPI and Automation using EHLLAPI API’s, this blog details about the strongest set of ZIEWIN API’s, the HACL (Host Access Class Library) API.

Host Access Class Library (HACL) is a set of objects that allows application programmers to access host applications easily and quickly. HCL ZIEWin supports different HACL Layers:

Figure 1 HACL Layers

Automation Objects (Visual Basic, Word, Excel, etc) :
The Host Access Class Library Automation Objects allow ZIEWin to support Microsoft COM-based automation technology (formerly known as OLE automation). The HACL Automation Objects are a series of automation servers that allow automation controllers, for example, Microsoft Visual Basic, to programmatically access ZIEWin Communications data and features.

Note: Automation Objects provided by HCL ZIEWin are 64-bit in nature. These can be used only with 64-bit Microsoft Office programs.

At present, the following types of automation objects are supported.

  • C++ objects:

This C++ class library presents a complete object-oriented abstraction of a host connection that includes:

  • Reading and writing the host presentation space (screen)
  • Enumerating the fields on the screen
  • Reading the Operator Indicator Area (OIA) for status information
  • Accessing and updating information about the visual emulator window
  • Transferring file
  • Performing asynchronous notification of significant events

 

  • Java Objects:

Java objects provide Java wrappers for all HACL functions.

  • LotusScript Extension:
    The Host Access Class Library LotusScript Extension (LSX) is a language extension module for LotusScript (the scripting and macro language of Lotus Notes and all the Lotus SmartSuite® products). This LSX gives users of Lotus products access to the HACL functions through easy-to-use scripting functions.

ECL Concept – Connections, Handles and Names
In the context of the ECL, a Connection is single and unique to a ZIEWin emulator window.
Connections are distinguished by their connection handle or connection name. Most HACL objects are associated with a specific connection. Typically, the object takes a connection handle or connection name as a parameter on the constructor of the object. For example, to create an ECLPS (Presentation Space) object associated with connection ‘B’, the following code would be used:

C++

                ECLPS *PSObject;

                PSObject = new ECLPS(’B’);

Visual Basic

Dim PSObject as Object Below is a graphical representation of the most commonly used autECL Objects

Set PSObject = CreateObject(“ZIEWIN.autECLPS”)

PSObject.SetConnectionByHandle(“B“)

The HACL Automation Objects

Figure 2 autECL Object representation

Several automation servers are implemented as real-world, intuitive objects with methods and properties that control ZIEWin operability. Each object begins with autECL, for automation Host Access Class Library. These objects are listed below with brief description:

  • autECLConnList: Connection List contains a list of ZIEWin connections for a given system. This is contained by autECLConnMgr, but may be created independently of autECLConnMgr.
  • autECLConnMgr: Connection Manager provides methods and properties to manage ZIEWin connections for a given system. A connection in this context is a ZIEWin window.
  • autECLFieldList: Field List performs operations on fields in an emulator presentation space.
  • autECLOIA: Operator Information Area provides methods and properties to query and manipulate the Operator Information Area. This is contained by autECLSession, but may be created independently of autECLSession.
  • autECLPS: Presentation Space provides methods and properties to query and manipulate the presentation space for the related ZIEWin connection. This contains a list of all the fields in the presentation space. It is contained by autECLSession, but may be created independently of autECLSession.
  • autECLScreenDesc: Screen Description provides methods and properties to describe a screen. This may be used to wait for screens on the autECLPS object or the autECLScreenReco object.
  • autECLScreenReco: Screen Recognition provides the engine of the HACL screen recognition system.
  • autECLScreenReco: Screen Recognition provides the engine of the HACL screen recognition system.
  • autECLSession: Session provides general session-related functionality and information. For Convenience, it contains the autECLPSautECLOIAautECLXfer, autECLWinMetrics,autECLPageSettings, and autECLPrinterSettings objects.
  • autECLWinMetrics: Window Metrics provides methods to query the window metrics of the ZIEWin session associated with this object. For example, use this object to minimize or maximize a ZIEWin window. This is contained by autECLSession, but may be created independently of autECLSession.
  • autECLXfer: File Transfer provides methods and properties to transfer files between the host and the workstation over the ZIEWin connection associated with this file transfer object. This is contained by autECLSession, but may be created independently of autECLsession.
  • autECLPageSettings: Page Settings provides methods and properties to query and manipulate commonly used settings such as CPI, LPI, and Face Name of the session Page Setup dialog. This is contained by autECLSession, but may be created independently of autECLSession.
  • autECLPrinterSettings: Printer Settings provides methods and properties to query and manipulate settings such as the Printer and PDT modes of the session Printer Setup dialog. This is contained by autECLSession, but may be created independently of autECLSession.

Essentially every class provides properties, methods, and (optionally) Events with it. These can be used in conjunction or separately to interact with and control operations in the ZIEWin window.

More information about the mentioned Classes and sample code can be found in ZIEWin online documentation.

The sample code below demonstrates the usage of most common ECL objects and methods.

1.  Object Declaration

Declare the Objects to be used
DIM autECLPSObj as Object
DIM autECLConnList as Object
Dim autECLOIAObj as Object
Dim PSText String

2.  Initialize session object by Handle or by Name

Define the purpose of the object type
Set autECLPSObj = CreateObject("ZIEWIN.autECLPS")
Set autECLConnList = CreateObject("ZIEWIN.autECLConnList")
Set autECLOIAObj = CreateObject("ZIEWIN.autECLOIA")
Refresh must be called to get latest connection info
autECLConnList.Refresh
Initialize the connection with the first in the list
autECLPSObj.SetConnectionByHandle(autECLConnList(1).Handle)
Initialize the connection with Session Name
autECLOIAObj.SetConnectionByName("A")

3.  Sendkey (String,Row,Col)

sends the text on mentioned row and col location
autECLPSObj.SendKeys "ZIEWIN API’s are very Powerful", 3, 1

4.  Sendkey (KeyStroke)

Send keystroke (Enter) on the green screen
autECLPSObj.SendKeys “[Enter]”

5.  GetText (Row, Col, Length)

' Gets the text of 10 bytes from row and col
 PSText = GetText (1,1,10)

6.  SetCursorPos (Row, Col)

' sets the cursor position at row and col location
 autECLPSObj.SetCursorPos 2, 1

7.  StartMacro (MacroName)

 ' Executes the ZIEWIN recorded .mac macro
autECLPSObj.StartMacro "MacroName"

8.  WaitforInputReady (time in millsec)

waits for specified number of milliseconds
autECLOIAObj.WaitForInputReady(10000)

9.  Properties

Number of rows and cols properties in green screen autECLPS class Object
Rows = autECLPSObj.NumRows
Cols = autECLPSObj.NumCols

10.  GetCursorRow and GetCursorCol

fetch rows and cols properties position
CurPosRow = autECLPSObj.CursorPosRow
CurPosCol = autECLPSObj.CursorPosCol

11.  RegisterPSEvent/ RegisterCommEvent, RegisterKeyEvent

Refer the attached example Excel application

Download the sample code:

Download File(Sample File to be linked)

ZIEWin_hacl_sample

Contact us

For further information on Organizing Web Applications in HCL ZIE, automation capabilities and Lab services offerings, please write to:

ZIO@hcl.com

 

 

Comment wrap
Further Reading
article-img
Mainframes | September 17, 2020
HCL ZIE for Windows Hardware and Software Pre-requisites
HCL ZIE for Windows, a native Windows 64-bit application is a proven emulator solution that supports 3270 and 5250 systems adhering to the latest security standards. Read the blog to know more details.
article-img
Mainframes | September 3, 2020
Installing Z and I Emulator for Windows (ZIEWin)
Z and I Emulator for Windows provides 3270, 5250, and VT emulation, connecting to z/OS®, z/VM®, eServer™ i5, iSeries®, System i5®, zSeries, and ASCII systems.
article-img
Mainframes | September 3, 2020
Configuring session on Z and I Emulator for Windows (ZIEWin)
Z and I Emulator for Windows saves emulator configuration information to a workstation profile (.WS). Depending on your Z and I Emulator for Windows configuration, you might have a workstation profile only or both workstation profile and a configuration file.
Close
Filters result by
Sort:
|