Host Publisher

IBM(R) WebSphere(R) Host Publisher; Programmer's Guide and Reference


Host Publisher File formats

Host Publisher produces applications using standard open formats--such as HTML pages, Java files, JSPs, and XML files. This makes it simple to make changes to a Host Publisher application after it has been published to a Host Publisher Server. You don't have to keep returning to the Host Publisher Studio to make small changes to your application.

Warning: If you make changes to applications on the server without updating the files in the Host Publisher Studio, you could lose the changes in the server version when you next publish your application. Be sure to update the version you keep in the Host Publisher Studio before you publish those files. There is no automatic way to synchronize the two versions.

A Host Publisher application is made up of several types of files. Other files are only used in the Host Publisher Studio. The sections below describe each file, explain how it is used, and provide the file format.


Integration Object project (.hpi) file

Host Access and Database Access store project information into .hpi files. These files describe the details you defined while creating an Integration Object.

Note:
The format of the Integration Object project (.hpi) file is shown for information only. If you manually edit this file, you might receive unexpected results.

The following is a sample .hpi project file generated by Host Access.

<?xml version="1.0" standalone="yes"?> 
<!DOCTYPE com.ibm.HostPublisher.IntegrationObject SYSTEM "io.dtd" []> 
<com.ibm.HostPublisher.IntegrationObject name = "callup"   type="hod">	
  <Package name = "IntegrationObject"/>
  <Session>
    <PoolName>callup</PoolName>
  </Session>  	
 
  <EJB PropertiesSuffix = "Properties" HelperSuffix = "Helper" 
              EJB10AccessBeanSuffix = "Access0"/> 
 
  <OutputVariable name="callupResults" type ="simple">
    <ScreenCoordinates x="2" y="14" dx="71" dy="6"/>
      <SubVariable name="column1" type ="array">
        <RelativeCoordinates x="0" y="0" dx="26" dy="5"/>
      </SubVariable>
      <SubVariable name="column2" type ="array">
        <RelativeCoordinates x="26" y="0" dx="4" dy="5"/>
      </SubVariable>
      <SubVariable name="column3" type ="array">
        <RelativeCoordinates x="30" y="0" dx="9" dy="5"/>
      </SubVariable>
      <SubVariable name="column4" type ="array">
        <RelativeCoordinates x="39" y="0" dx="9" dy="5"/>
      </SubVariable>
      <SubVariable name="column5" type ="array">
        <RelativeCoordinates x="48" y="0" dx="9" dy="5"/>
      <SubVariable name="column6" type ="array">
        <RelativeCoordinates x="57" y="0" dx="15" dy="5"/>
      </SubVariable> 
  </OutputVariable>
 
  <HODMacro filename = "callup.macro"/>
  <SessionChain>
    <StartState name = "Start Label"/>
    <EndState name = "The End Label"/>
    <Position>middle</Position>
  </SessionChain>
<com.ibm.HostPublisher.IntegrationObject>

The following is a sample .hpi project file generated by Database Access.

<?xml version="1.0" standalone="yes"?> 
<!DOCTYPE com.ibm.HostPublisher.IntegrationObject SYSTEM "io.dtd" []> 
<com.ibm.HostPublisher.IntegrationObject name = "QuerySample"   type="db">	
  <Package name = "IntegrationObject"/>
  <Session>
    <PoolName>callup</PoolName>
  </Session>  	
 
  <RIO RIOPrefix = "Remote"/>
 
  <SQL>SELECT "SHERRI"."DEPARTMENT"."DEPTNO", "SHERRI"."DEPARTMENT"."DEPTNAME", 
                       "SHERRI"."DEPARTMENT"."MGRNO" FROM "SHERRI"."DEPARTMENT"
                       WHERE ( ( "SHERRI"."DEPARTMENT"."DEPTNO" <> 'CHY' ) 
                       AND ( "SHERRI"."DEPARTMENT"."DEPTNAME" <> @+)deptname@-)''@+) ) )
  </SQL>
 
  <JDBCUrl name="jdbc:db2:Sample"/>
  <JDBCDriver name="COM.ibm.db2.jdbc.app.DB2Driver"/>
<com.ibm.HostPublisher.IntegrationObject>

Tag descriptions:

com.ibm.HostPublisher.IntegrationObject

name
Specifies the name of this Integration Object. This name must match the name of the file.

type
The type of Integration Object described in this file. Valid values are hod or db.

EJB
Specifies the suffixes appended to the name of the Integration Object for naming EJB Access Beans and object files. You specify the values for the attributes using the EJB Integration Object Properties selection of the Options menu in the Host Publisher Studio when creating the Integration Object. The attributes are:

EJB10AccessBeanSuffix
Specifies the suffix appended to the name of the Integration Object for naming the EJB 1.0 Access Bean files. The default value is Access0, unless you modify the value in the Studio.ini file.

HelperSuffix
Specifies the suffix appended to the name of the Integration Object for naming the EJB helper object files. The default value is Helper, unless you modify the value in the Studio.ini file.

PropertiesSuffix
Specifies the suffix appended to the name of the Integration Object for naming the EJB properties object files. The default value is Properties, unless you modify the value in the Studio.ini file.

HODMacro

filename
Identifies the filename containing the Host On-Demand macro recorded by the user for this Host Access Integration Object.

JDBCDriver

name
The JDBC driver name to use for the specified URL for Database Access Integration Objects.

JDBCUrl

name
The JDBC URL to connect to when executing this Database Access Integration Object.

OutputVariable
Output variables define data that will be extracted during the macro execution in Host Access Integration Objects.

name
Specifies the variable name provided by the user during macro recording.

type
Specifies the type of variable described by the tag. Valid values are simple and array. Simple variables are stored and displayed as single blocks of text. Array variables are stored as individual lines that can be displayed individually on a JSP.

ScreenCoordinates
Identifies a rectangular region on the application screen that defines the data to extract.

x
Identifies the starting column number. The first column begins at 1.

y
Identifies the starting row number. The first row begins at 1.

dx
Identifies the total number of columns to include in this variable.

dy
Identifies the total number of rows to include in this variable.

Package

name
Specifies the Java package name used when generating the Java source code for this object.

RIO

RIOPrefix
Specifies the prefix prepended to the name of the Integration Object for naming the Remote Integration Object files. You specify the value for the RIOPrefix attribute using the Remote Integration Object Properties selection of the Options menu in the Host Publisher Studio when creating the Integration Object. The default value is Remote, unless you modify the value in the Studio.ini file.

Session

PoolName
Specifies the connection pool name used by this Integration Object.

SessionChain

StartState name
The connection start state label given by the user for the Host Access Integration Object.

EndState name
The connection end state label given by the user for the Host Access Integration Object.

Position
The position of this Host Access Integration Object in the object chain. Valid values are first, middle, or last.

SQL
Identifies the SQL statement to execute for Database Access Integration Objects.

SubVariable
Subvariables define further detail of the format of data defined by an output variable. Subvariables are generated when the user specifies data to be extracted as a table in Host Access. Each column identified by the user is defined using the SubVariable tag.

name
Specifies the variable name provided by the user during macro recording.

type
Specifies the type of variable described by the tag. Valid values are simple and array. Simple variables are stored and displayed as single blocks of text. Array variables are stored as individual lines that can be displayed individually on a JSP.

RelativeCoordinates
Identifies a rectangular region on the application screen that defines the data to extract.

x
Identifies the starting column number. The first column begins at 1.

y
Identifies the starting row number. The first row begins at 1.

dx
Identifies the total number of columns to include in this variable.

dy
Identifies the total number of rows to include in this variable.

Host Publisher application (.hpa) file

This XML file organizes all of the parts that make up a Host Publisher application, including Java objects and the Web pages that refer to them. Host Publisher applications are published to Host Publisher Servers for access by your customers. When Host Publisher Studio is used to load an existing application, it is this file that you actually open.

Note:
The format of the Host Publisher application (.hpa) file is shown for information only. If you manually edit this file, you might receive unexpected results.

Here is a sample of a typical application file:

<?xml version='1.0' encoding='UTF-8'?> 
<!DOCTYPE application SYSTEM 'WebBridge.dtd'> 
<application>         
<appl_name>testdb</appl_name>        
<integration_object>         
  <obj_name>D:\HostPublisher\Studio\IntegrationObjects\EmployeeQuery.jar
  </obj_name>         
  <input_properties>             
    <input>setLastName</input>         
  </input_properties>         
  <output_properties>             
    <output>getEmployeesEmployeeIDResult</output>             
    <output>getEmployeesFirstNameResult</output>             
    <output>getEmployeesExtensionResult</output>             
    <output>getEmployeesLastNameResult</output>             
    <output>getLastName</output>         
  </output_properties>         
  <execution_method>doHPTransaction</execution_method>     
</integration_object>     
<page>d:\hostpublisher2\Studio\testdb\output.jsp</page>     
<page>d:\hostpublisher2\Studio\testdb\input.jsp</page> 
</application>

Tag descriptions:

appl_name
Names the Host Publisher application. This name must match the name of the file. It is also the name Host Publisher Server uses to track this application.

execution_method
Specifies the Java method for invoking the Java object once the inputs are satisfied with data. After the execution method completes, the Java object's resulting data can be accessed using its output methods, if there are any.

input
Specifies the Java method used to set an input value. For a Java bean, this is typically the setter method for a Java bean property.

input_properties
Specifies the beginning of the list of inputs for this Java object. Inputs generally must be satisfied with data before the Java object can be executed. Each input is specified by a separate input tag under this tag.

integration_object
Specifies beginning of a definition of an Integration Object or other Java object that was imported into Host Publisher Studio.

obj_name
Specifies the full path to the Integration Object or other Java object within the file system. If the object is an Integration Object created using one of the Host Publisher Access applications, this file refers to a .jar file containing the Integration Object Java bean and its related files. If this object is another Java object, this file refers to the file containing that Java object.

output
Specifies the Java method used to get data values from a Java object. For a Java bean, this is typically the getter method for a Java bean property.

output_properties
Specifies the beginning of the list of outputs for this Java object. Outputs are used to render Java object data within a Web page. Each output is specified by a separate output tag under this tag.

page
Specifies a Web page that is used, either directly or indirectly, to access Java objects.

Integration Object source (.java) file

Integration Objects created by Host Publisher Studio are Java beans. The Java bean files are contained within a .jar file and are generally made up of two files, the Java bean class and the Java bean BeanInfo class. These class files are generated based on a template maintained by the Host Publisher Studio and information provided by you through one of the Host Publisher Access applications.

The template for Database Access Integration Obects is not available to you for customization, and since any time the Integration Object is modified using the Database Access application it is regenerated and compiled, do not customize the source files for the Integration Objects in any way. Instead, if you require custom logic to make use of Integration Object data, use JSP tags and additional Java code to include the logic in the Web pages, or develop another Java class that extends your Integration Object to customize Integration Object results.

The template for Host Access Integration Objects can be modified at the Java code level. For more information, see Customizing Host Access Integration Object Java code.


JavaServer Pages (JSP) Web page files

Host Publisher Studio generates JSP 1.0 pages to manipulate Java objects and their output. JSP tags are similar to HTML tags, but their purpose is to instantiate Java objects, execute methods, and access the object's properties (inputs and outputs). JSP tags enable you to interact with Java objects using standard Web pages.

With Host Publisher Version 2, JSPs were created using the JSP 0.91 specification. Host Publisher Version 3.5 creates JSPs using the JSP 1.0 specification. Host Publisher provides a migration utility to convert .91 JSPs to 1.0 JSPs. This utility can be invoked at server installation time, in the Host Publisher Studio, and as a command line utility. See the IBM WebSphere Host Publisher Administrator's and User's Guide for more information about the migration utility.

If you want to customize JSP migration, Host Publisher provides sample JSP migration code. For more information about customizing the sample JSP migration code, see Customizing JavaServer Page (JSP) migration.

The following are sample JSPs, followed by a description of how the tags are being used.

JSP for the EmployeeQuery Integration Object

<HTML>
<%@ page contentType="text/html;charset=ISO-8859-1" %>
<BODY>
<jsp:useBean id="EmployeeQuery" type="IntegrationObject.EmployeeQuery" 
                class="IntegrationObject.EmployeeQuery" scope="request">
</jsp:useBean>
<jsp:setProperty name="EmployeeQuery" property="*" />
<% EmployeeQuery.setHPubStartPoolName("NorthwindLocal"); %>
<% EmployeeQuery.doHPTransaction(request, response); %>
<%
if (EmployeeQuery.getHPubErrorOccurred() != 0) {
    // Error page redirection already done by IO
    return;
}
%>
<P>Table:
<TABLE BORDER>
<TBODY>
<tr>
<th>EmployeesEmployeeID<th>
<th>EmployeesFirstName<th>
<th>EmployeesExtension<th>
</tr>
<%
for (int idx1 = 0;idx1 <= 2147483647; idx1 ++){
try {
%>
<tr>
<td><%= EmployeeQuery.getDB2ADMINEMPLOYEEEMPNO_(idx1) %>
<td><%= EmployeeQuery.getDB2ADMINEMPLOYEEFIRSTNME_(idx1) %>
<td><%= EmployeeQuery.getDB2ADMINEMPLOYEEPHONENO_(idx1) %>
</tr>
<%
}
catch (java.lang.ArrayIndexOutOfBoundsException e){
break;
}
catch (java.lang.NullPointerException e){
break;
}
}
%>
</TBODY>
</TABLE>
</BODY>
</HTML>
 

JSP for the QuerySample Integration Object

<%
// Establish a session object which can be used by chained applications.
 
HttpSession hp_session =  request.getSession(false);
if (hp_session == null) {
    hp_session = request.getSession(true);
}
%>
<HTML>
<%@ page contentType="text/html;charset=ISO-8859-1" %>
<BODY>
<jsp:useBean id="QuerySample" type="IntegrationObject.QuerySample" 
                class="IntegrationObject.QuerySample" scope="request">
</jsp:useBean>
<jsp:setProperty name="QuerySample" property="*" />
<% QuerySample.setHPubStartPoolName("samplePool"); %>
<% QuerySample.doHPTransaction(request, response); %>
<%
if (QuerySample.getHPubErrorOccurred() != 0) {
    // Error page redirection already done by IO
    return;
}
%>
<FORM NAME="QuerySample" METHOD="POST" ACTION="<%= response.encodeUrl("QuerySample.jsp") %>">
<P>Department Number
<SELECT NAME ="DB2ADMINEMPLOYEEWORKDEPT_" MULTIPLE SIZE=3>
<%
for (int idx1 = 0 ; idx1 <= 2147483647; idx1 ++){
 try{
%>
<% String str = "<OPTION VALUE=\"" +QuerySample.getDB2ADMINEMPLOYEEWORKDEPT_(idx1) + 
     "\">\n"; out.println(str); %>
<%= QuerySample.getDB2ADMINEMPLOYEEWORKDEPT_(idx1) %>
<%
}
catch (java.lang.ArrayIndexOutOfBoundsException e){
break;
}
}
%>
</SELECT>
<P>
<INPUT TYPE="submit" VALUE="Submit">
</FORM>
</BODY>
</HTML>
 

The first page references an Integration Object called EmployeeQuery. After invoking the object, it renders the object's output in an HTML table with three columns. The second page references an Integration Object called QuerySample. After invoking the object, it renders the object's output in an HTML form that enables the user to select a department. The following tags are used on these pages:

FORM
The FORM tag encompasses the content of an HTML fill-in form. Use this tag to create fill-in forms with checkboxes, radio buttons, and text input windows. It contains the following parameters:

ACTION
The ACTION parameter specifies the URL to which the FORM tag content is sent. This parameter is required.

METHOD
When the ACTION parameter indicates an HTTP URL, the METHOD parameter identifies the HTTP method for sending information to the server. This parameter is optional. Values for this parameter are:

GET
The form content is appended to the URL.

POST
The form content is sent to the server as a message body, and not as part of the URL.

NAME
The NAME parameter specifies the URL to which the FORM tag content is sent. This parameter is required.

Inline Java tag (<% %>)
Inline Java tags specify the beginning and end of Java code segments that are to be invoked as they are written. These segments may reference variables specified within other inline Java tags before these on the same page. As shown in the examples, these tags can be used to access or execute Java objects explicitly.

INPUT
The INPUT tag specifies a variety of editable fields inside a form. It contains the following parameters:

NAME
The NAME parameter specifies the variable name for the VALUE parameter.

TYPE
The TYPE parameter specifies the type for the INPUT tag. This parameter is required. Values for this parameter are:

checkbox
INPUT tag elements are boolean quantities. The default value is off.

file
The INPUT tag element is a file selection tool, with which the user can select a file to be sent with the FORM tag.

hidden
The INPUT tag element is not displayed to the user.

image
The INPUT tag element is an active inline image.

password
The INPUT tag element is a single-line text field, but the text typed in the field is obscured by asterists or some other method. This is used for password entry.

radio
The INPUT tag element is a radio button. Radio buttons are linked together by the same NAME parameter.

reset
The INPUT tag element is a reset button. When pressed, all the fields in the FORM tag are reset to the values given by their VALUE parameter, erasing all user input.

submit
The INPUT tag element is a Submit button. Pressing the Submit button sends the FORM tag data to the specified URL.

text
The INPUT tag element is a single-line text entry field. The physically displayed size of the input field is set by the SIZE attribute.

VALUE
The VALUE parameter specifies the initial value of the INPUT tag.

jsp:setProperty
The jsp:setProperty tag sets the value of one or more properties in a Java bean component, using the Java bean's set methods. You must use a jsp:useBean tag to declare the Java bean before you use the jsp:setProperty tag. The jsp:setProperty tag contains the following parameters:

name
The name parameter names an instance of a Java bean that has already been created or located with a jsp:useBean tag. The value of the name parameter must match the value of the id parameter on a jsp:useBean tag. The jsp:useBean tag must appear before the jsp:setProperty tag in the same JSP file.

property
The property parameter sets the property values in a Java bean component. You can set property values in several ways:
  • By passing all of the values in the user's request (stored as parameters in the request object) to matching properties in the Java bean
  • By passing a specific value in the request object to a matching property or a property of a different name in the Java bean
  • By explicitly setting a Java bean property to a value specified as a String or the result of an expression.

Each method of setting property values is determined by the values you specify on the property tag. The values are:

property="*"
Stores all of the values in the request object parameters (called request parameters) in matching Java bean properties. The property names in the Java bean must match the request parameters. The parameter names usually come from the elements of an HTML form, and the values come from the data the user enters.

The values of the request parameters are always of type String. The String values are converted to other data types so they can be stored in Java bean properties. The allowed Java bean property types and their conversion methods are shown in the following table:

Table 2. String conversions

Property Type String Is Converted Using
boolean or Boolean java.lang.Boolean.valueOf(String)
byte or Byte java.lang.Byte.valueOf(String)
char or Character java.lang.Character.valueOf(String)
double or Double java.lang.Double.valueOf(String)
integer or Integer java.lang.Integer.valueOf(String)
float or Float java.lang.Float.valueOf(String)
long or Long java.lang.Long.valueOf(String)

You can also use jsp:setProperty tag to set the value of an indexed property in a Java bean. The indexed property must have one of the types shown in Table 2, and the request value assigned to it must be an array of the same type. The array elements are converted using the conversion methods shown in Table 2.

If a request parameter has an empty or null value, the corresponding Java bean property is not set. If the Java bean has a property that does not have a matching request parameter, the property value is not set.

property="propertyName" [ param="parameterName" ]
Sets one Java bean property to the value of one request parameter. The request parameter can have a different name than the Java bean property, and if so, you must specify the param attribute. If the Java bean property and request parameter have the same name, you can omit the param attribute.

If the parameter has an empty or null value, the corresponding Java bean property is not set.

You cannot use both the param and value attributes in a jsp:setProperty tag.

property="propertyName" value="{ string | <%= expression %> }"
Sets one Java bean property to a specific value. The value can be a string or an expression. If you use a string, it is converted to the Java bean property's data type, according to the conversion rules shown in Table 2. If you use an expression, the data type of the value of the expression must match the data type of the Java bean property.

If the parameter has an empty or null value, the corresponding Java bean property is not set.

You cannot use both the param and value attributes in a jsp:setProperty tag.

jsp:useBean
The jsp:useBean tag locates or instantiates a Java bean with a specific name and scope. The body of a jsp:useBean tag often contains a jsp:setProperty tag that defines property values in the object.

The jsp:useBean tag works with JavaBeans(TM) components, but not with enterprise beans. If you want to use enterprise beans, you can write a JSP file that constructs a JavaBean component, and have the JavaBean component call the EJB.

Note:
In Host Publisher, Integration Objects and EJB Access Beans are both Java beans.

The jsp:useBean tag contains the following parameters:

class=package.class
The class parameter instantiates a Java bean from a class, using the new keyword and the class constructor. The class must not be abstract and must have a public, no-argument constructor. The package and class names are case sensitive.

id
The id parameter names a variable that identifies the Java bean in the scope you specify. You can use the variable name in expressions or scriptlets in the same JSP file. The name is case sensitive and must conform to the naming conventions of the page scripting language.

scope
The scope parameter defines a scope in which the Java bean exists and the variable named on the id parameter is available. Values for this parameter are:

application
The Java bean is set as a context in the application by a servlet that invokes the JSP file. If the Java bean is not part of the request context, the Java bean is created and stored in the request context.

page
If the Java bean is present in the current JSP, the Java bean is reused. If the Java bean is not present, it is created and stored until the request in the current page is completed.

request
The life of the Java object lasts as long as the request for this page is being processed. It is discarded when a new page is requested.

session
The instance of this class is maintained past the current request, allowing other JSPs, for example, to access this object again.

The default value for the scope parameter is page.

type=package.class
If the Java bean already exists in the specified scope, the type parameter gives the Java bean the type you specify. If you use the type parameter without the class parameter, no Java bean is instantiated. The package and class names are case sensitive.

OPTION
The OPTION tag sets the different character-string options for a SELECT tag. The OPTION tag can contain characters, character references, or entity references. The VALUE attribute specifies the value assigned to the OPTION tag.

SELECT
The SELECT tag enables the user to select from a set of values presented as a selectable list of text strings, specified by the OPTION tag. The SELECT tag contains the following parameters:

MULTIPLE
The MULTIPLE parameter specifies that the user can select multiple items from a single SELECT tag. If MULTIPLE is not specified, the user can select only a single item from the SELECT tag. This parameter is optional.

NAME
This parameter specifies the variable name associated with the SELECT tag. This parameter is required.

SIZE
This parameter specifies the number of displayed text lines. The default is 1, and the list is often presented as a pull-down menu.

Connection and configuration files

This section describes the format of configuration files used by Host Publisher Server Administration to configure Host Publisher. The files use XML tags to structure their content. Host Publisher generates these files along with Integration Objects and publishes them to the server as part of an application. The configuration files are the following:

Connection specification (.connspec)
This file specifies the parameters necessary for establishing a connection to a data source, such as a 3270 application or a database.

Connection pool specification (.poolspec)
This file defines how to create a pool of connections to a host or database. It specifies parameters for pools of connections to data sources, such as 3270 applications or databases. It also serves as the main coordinating file for a complete connection pool definition (including connection, users, and connect and disconnect macros, if appropriate).

Logon specification (.logonspec)
This file specifies the names of the connect and disconnect macros for Host Access Integration Objects. If connection pooling is enabled, this file also specifies the name of the checkin screen.

User pool specification (.userpool)
This file lists the users and any associated user-specific information necessary for accessing a data source. It is this list of users and the connection definition that define a pool of connections.

Checkin screen description (.screen)
This Host On-Demand screen description identifies the host screen that should be active for a connection to be considered ready to be returned to the connection pool. If a connection is not in that state, it is discarded or recycled in an attempt to return the connection to that state. If connection pooling is not enabled, the checkin screen is ignored.

Application manifest (.application)
This file describes all Web pages, Integration Objects and other Java objects, and configuration files that an application requires.

This file is generated by Host Publisher Studio when transferring an application to Host Publisher Server. When the application is deployed into production by the server, this file ensures that all parts of an application are moved into the production area.

Macro files (.macro)
For Host Access Integration Objects only, these files specify IBM Host On-Demand keyboard and screen recognition macros. They are used for replaying sequences of keystrokes for performing certain tasks for the Integration Object, such as logging on to a system or accessing a data screen on an application. See Macro script syntax for more information on the format of these XML files.

Notes:

  1. Configuration descriptions might refer to other files that can be referenced using relative path names. The forward slash (/) is used as a file name separator, and it is replaced by the platform-specific filename separator character when Host Publisher Server Administration processes file names.

  2. If you edit any of the following files in a non-English environment, you must use a UTF-8 capable editor:

Format of connection pool specification files

XML tag conventions

The following sections describe the XML syntax used to define Host Publisher connection pools, using examples. The following conventions have been used:

XML Tags for connection specifications

Note:
This file uses UTF-8 encoding.

A file defines each instance of the ConnSpec record. A connection specification defines how to connect to a data source. Whether connection pooling is used for this definition is defined by the pool specifications. A connection specification is nested within a single <connconfig> tag. The <hodconnspec> tag is used to describe an HodConnSpec record, and the <dbconnspec> tag is used to describe a DbConnSpec record. These records have different sets of properties, and the nested tags used to set their values are described in separate sections.

Host On-Demand connections

The following XML tags correspond to properties of an HodConnSpec record.

connecttimeout
The time, in seconds, that Host Publisher Server will wait while creating a host connection using Host On-Demand APIs, and priming it by running a connect macro.

The value is an integer, either -1 or 1 or greater. The default is 120.

disconnecttimeout
The time, in seconds, that Host Publisher Server will wait while running a disconnect macro and disconnecting a host connection using Host On-Demand APIs.

The value is an integer, either -1 or 1 or greater. The default is 120.

expresslogon
Contains tags that specify whether the connection uses express logon. The nested tags specify connection information for the Digital Certificate Access Server (DCAS) server. The nested tags are:

sessionprops
Contains Host On-Demand connection properties.

singlelogon
Set this value to true if this connection does not allow a user ID and password to be used for multiple simultaneous sessions. If this value is set to true and a user list is defined for this connection, the user ID/password pairs in that user list are locked when in use to prevent their being used by simultaneous connections. If this value is set to true and a user ID is not available for the user list, the requester for the connection waits the amount of time specified by the connecttimeout property.

Set this value to false if this connection allows a user ID and password to be used for multiple simultaneous connections. If this value is set to false and a user list is defined for this connection, the first user ID/password pair in the user list will be reused for each requested connection.

The value is boolean. The default is false.

JDBC connections

The following XML tags correspond to properties of a DbConnSpec record.

connecttimeout
The time, in seconds, that Host Publisher Server will wait to create a database connection using JDBC APIs.

The value is an integer, either -1 or 1 or greater. The default is 120.

drivername
The name of a JDBC driver (class) that can be used by Host Publisher Server to load the driver.

This string value is mandatory.

urlname
This URL must identify the database to which a connection is created.

This string value is mandatory.

Examples

vm3.connspec

<?xml version="1.0"?>
<!DOCTYPE connconfig SYSTEM "connconfig.dtd">
  <connconfig>
    <hodconnspec name="vm3">
    <singlelogon value="false"/>
    <sessionprops>
             SSL=false
             fontSize=10
             autoReconnect=false
             OIAVisible=true
             port=23
             autoConnect=false
             TNEnhanced=false
             fontSizeBounded=true
             autoFontSize=false
             codePage=037
             host=ralvm3
             screensize=2
             sessionType=1
             SSLServerAuthentication=false
             LUName=
             codePageKey=KEY_US
    </sessionprops>
    <expresslogon>
             <elfenabled value="true"/>
             <dcasservername value="9.37.52.31"/>
             <dcasserverport value="809">
    </expresslogon/>
    <disconnecttimeout value="120"/>
    </hodconnspec>
  </connconfig> 					

empdb.connspec

<?xml version="1.0"?>
<!DOCTYPE connconfig SYSTEM "connconfig.dtd">
  <connconfig>
    <dbconnspec name="empdb">
        <drivername value="com.ibm.db2.jdbcdvr"/>
        <urlname value="jdbc://myserver.ibm.com/employeedb"/>
        <connecttimeout value="60"/>
    </dbconnspec>
  </connconfig>
 

XML tags for pool specifications

Note:
This file uses UTF-8 encoding.

A file defines each instance of a PoolSpec record. A pool specification defines whether a connection pool supports connection pooling and defines properties required to support connection pooling. The pool specification is nested within a single <poolconfig> tag. Pool specification values are only used if connection pooling is enabled. See the description of the <poolingenabled> tag for more information.

The <hodpoolspec> tag is used to describe an HodPoolSpec record, and the <dbpoolspec> tag is used to describe an DbPoolSpec record. Both objects have the same set of properties with values defined using the set of nested tags described below:

connecttimeout
The time, in seconds, for which a requester of a connection waits to acquire a connection from the pool if no connections are available.

The value is an integer, either -1 or 0 or greater. The default is 120.

If connecttimeout is set to -1, the requester will wait forever.

dbconnspec
A reference to a DbConnSpec specification in another file. This tag (with different attributes) is used in .connspec files to define DbConnSpec records.

hodconnspec
A reference to a HodConnSpec specification in another file. This tag (with different attributes) is also used in .connspec files to define HodConnSpec records.

hodlogonspec
A reference to a HodLogonSpec specification in another file. This tag (with different attributes) is also used in .logonspec files to define HodLogonSpec records.

localuserpool
A reference to a LocalUserPool specification in another file. This tag (with different attributes) is used in .userpool files to define LocalUserPool records.

maxbusytime
The time in seconds, since a connection was last accessed, after which it is reclaimed. A connection is considered to be accessed when it is acquired or when it is released to the Host Publisher Server to save until the next Integration Object in a chained application acquires it. The connection is reclaimed and terminated if maxbusytime is not set to -1 and either of the following occurs:

The value is an integer, either -1 or 60 or greater. The default is -1.

If maxbusytime is set to -1, a busy connection is never reclaimed.

Note:
The maxbusytime parameter is in effect even when pooling is not enabled. If an Integration Object acquires a connection that is not pooled, the connection is reclaimed if the connection is not active and maxbusytime is not set to -1.

maxconnections
This is the maximum size of the pool. Once this many connections have been created and all connections have been acquired, the next requester will wait unless overflowallowed is set to true. In that case, a new non-pooled connection is created.

The value is an integer. The default is 1.

maxidletime
The time, in seconds, after which a connection that is idle is removed from the pool, if the number of connections in the pool exceeds minconnections.

The value is an integer, either -1 or 60 or greater. The default is -1.

If maxidletime is set to -1, an idle connection is never removed from the pool.

minconnections
The number of active connections in the pool below which idle connections are not disconnected, regardless of the value of maxidletime. This does not imply that Host Publisher Server Administration will create that many connections during initialization. The pool is populated on demand.

The value is an integer. The default is 0.

overflowallowed
If set to true, when a request is received for a connection and none is available (because the maxconnections limit has been reached), a new connection outside the pool is created. When this connection is released, it is ended and discarded.

The value is boolean. The default is false.

poolingenabled
If set to true, connection pooling is enabled and a request to acquire a connection from the pool results in an already-initialized connection being returned to the requester, if one is available. When the requester releases this connection, it is returned to the pool for later use.

If set to false, connection pooling is disabled and a request to acquire a connection from the pool results in a new connection being initialized and returned to the requester. When the requester releases this connection, it is terminated and discarded.

Note:
If connection pooling is disabled, the values of the following properties are ignored:
  • maxidletime
  • connecttimeout
  • minconnections
  • maxconnections
  • overflowallowed

The value is boolean. The default is true.

Examples

callup.poolspec

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE poolconfig SYSTEM "poolconfig.dtd">
<poolconfig>
  <hodpoolspec name="callup">
      <hodconnspec refname="vm6conn"/>
      <hodlogonspec refname="vm6"/>
      <localuserpool refname="vm6users"/>
      <maxidletime value="600"/>
      <minconnections value="10"/>
      <maxconnections value="20"/>
      <connecttimeout value="30"/>
      <overflowallowed value="true"/>
  </hodpoolspec>
</poolconfig> 					

puborder.poolspec

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE poolconfig SYSTEM "poolconfig.dtd">
<poolconfig>
  <hodpoolspec name="puborder">
      <hodconnspec  refname="vm6conn"/>
      <hodlogonspec  refname="vm6"/>
      <localuserpool  refname="vm6users"/>
      <connecttimeout value="30">
      <minconnections value="30"/>
      <maxconnections value="40"/>
  </hodpoolspec>
</poolconfig>

empdb.poolspec

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE poolconfig SYSTEM "poolconfig.dtd">
<poolconfig>
  <dbpoolspec name="empdb">
    <dbconnspec refname="empdb"/>
    <localuserpool refname="empdbusers"/>
    <connecttimeout value="20">
    <minconnections value="5"/>
    <maxconnections value="10"/>
  </dbpoolspec>
</poolconfig>
 

XML Tags for logon and logoff specifications

Note:
This file uses UTF-8 encoding.

A file defines each HodLogonSpec record.The logon specification defines information required by Host On-Demand for logging on and off a connection to a host. This file is only pertinent to Integration Objects created by the Host Access application. The <hodlogonspec> tag is used to describe an HodLogonSpec record, and is nested within a single <logonconfig> tag. The following XML tags correspond to properties of an HodLogonSpec record.

checkinscreendesc
References a file containing a string representation of a com.ibm.eNetwork.ECL.ECLScreenDesc object that is constructed in the Host Publisher Studio. This value is only used when connection pooling is enabled. When a connection is returned to Host Publisher Server, the Server checks the current screen against this screen description. If the current screen and this screen description match, the connection is returned to the pool. If the current screen and this screen description do not match, connection recovery might be initiated.

This string value is mandatory.

logoffmacro
References a file containing the Host On-Demand disconnect macro (in Host On-Demand-defined XML format). A disconnect macro may not be needed if the Integration Object's data macro includes disconnect actions or if certain public domain hosts do not need a disconnect step.

This file reference value is optional.

logonmacro
References a file containing the Host On-Demand connect macro (in Host On-Demand-defined XML format). A connect macro may not be needed if the Host Access Integration Object's data macro includes connect actions or if certain public domain hosts do not need a connect step.

This file reference value is optional.

Example

This is the file vm6.logon. In the example, the file names have been derived from the record name by adding a standard suffix.

<?xml version="1.0"?>
<!DOCTYPE logonconfig SYSTEM "logonconfig.dtd">
<logonconfig>
  <hdlogonspec name="vm6">
    <logonmacro filename="vm6_logon.macro"/>
    <logoffmacro filename="vm6_logoff.macro"/>
    <checkinscreendesc value="vm6_checkin.screen"/>
  </hodlogonspec>
</logonconfig>
 

XML Tags for user pool specifications

Note:
This file uses UTF-8 encoding.

A user pool file contains a list of user ID/password pairs that are used by a connection pool to make a connection. A file is used to define each LocalUserPool record.

For hosts that allow a user ID/password pair to be used by simultaneous multiple connections (for example, AS/400s and JDBC databases), the user list typically has one entry. If more than one entry is specified for such a connection, Host Publisher Server ignores the other entries when selecting user ID/password pairs for logging on to the connection, because it will always use the first connection.

For hosts that do not allow a user ID/password pair to be used by simultaneous multiple connections (for example, 3270 hosts running VM), the Server manages the user list by locking user ID/password pairs that are currently in use. A subsequent request for a connection uses a userID/password pair that is not locked.

The user pool record can be used to store more than just user IDs and passwords. You can associate other properties with user IDs as well as passwords. For instance, you might have a user ID that requires an additional password to log on to another application as part of the session priming process. In this case, the user pool would contain a list of user ID/password pairs with an additional password property associated with each user ID entry. Each property defined in the user list can be encrypted, except the user ID, and each property can use a different level of encryption.

The <schema> tag defines each property that should appear in each entry in the user list, and the encryption level for each property.

The <localuserpool> tag describes a LocalUserPool record, and is nested within a single <userconfig> tag. Multiple <entry> tags are used to define the database entries, one for each user ID, password, and any other properties, using <property> tags.

The <localuserpool> tag has an optional session attribute. If the session attribute is present with a value that is not null, at least one property in the user list is strongly encrypted. The value for the session attribute is set when a user of Host Publisher Studio transfers a user list to the server and selects strong encryption. The Host Publisher Studio prompts the user for a password to be used for strong encryption. When a Web application containing a strongly encrypted user list is deployed on the Server, the password the user specified for strong encryption must be specified when the Server is restarted. Without this password, the Server cannot be restarted. This password is also required by Host Publisher Server Administration when an administrator modifies the strongly encrypted user list. If another user list is created with a property that requires strong encryption, and is to be deployed to the same server, the same password must be specified to encrypt that user list. The Host Publisher Server can only have one startup password, so the same password must be used by all strongly encrypted user lists that are to be deployed to the same server. If weak encryption is used, no password is required.

Examples of User Pool Definitions

vm6users.userpool

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE userconfig SYSTEM "userconfig.dtd">
<userconfig>
  <schema>
      <defineproperty encrypt="0" name="_userid"/>
      <defineproperty encrypt="0" name="app_password"/>
      <defineproperty encrypt="0" name="_password"/>
  </schema>
  <localuserpool name="nm01users">
     <entry  key="vm6Userid01">   
        <property name="userid" value="vm6Userid01"/>
        <property name="_password" value="vm6Password01"/>
        <property name="app_password" value="apppw1"/>
     </entry>
     <entry  key="vm6Userid02">  
        <property name="userid" value="vm6Userid02"/>
        <property name="_password" value="vm6Password02"/>
        <property name="app_password" value="apppw2"/>
     </entry>
  </localuserpool>
</userconfig> 					

empdbusers.userpool

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE userconfig SYSTEM "userconfig.dtd">
<userconfig>
  <schema>
    <defineproperty encrypt="0" name="_userid"/>
    <defineproperty encrypt="2" name="_password"/>
  </schema>
  <localuserpool name="empdbusers" 
    <entry key="UserName5">     
      <property name="_userid" value="UserName5"/>
      <property name="_password" value="o0+n5w1W3mhej7KWpb6SEw=="/>
    </entry> 
    <entry key="UserName4">
      <property name="_userid" value="UserName4"/>
      <property name="_password" value="h57hlX=hMrl13baAuFhk9Q=="/>
    </entry> 
  </localuserpool>
</userconfig> 				

The application manifest file

This file describes, using XML, all the resources that a Host Publisher Studio-generated application depends on. The application manifest lists the pool configuration files, Integration Objects and other Java objects, and JSP and HTML pages used by the application. The manifest is used by Host Publisher Server during deployment to move files from the staging directory to the production directory and is also used to remove applications and provide administrative information.

All document parts that are private to an application, such as Web pages and images, are copied to an application-specific subdirectory that mirrors the structure in the Web pages. The Host Publisher Studio is not able to determine the location of objects added by a developer if they are not stored using relative paths. For example, if the developer adds HTML to include images using a URL that specifies an HTTP:// URL, or the files are stored with absolute paths that do not exist on the development machine, the Host Publisher Studio ignores these files when transferring files to the Host Publisher Server. If the Host Publisher Studio can locate the file, it is listed in the application manifest file as part of the list of files to be transferred to the server.

There is one manifest file per application. Its name is derived from the application name and should match the subdirectory name under the directory where application-specific Web document files are transferred; for example, the c:/HostPublisher/Server/staging/applications subdirectory, where c:/HostPublisher is the directory where Host Publisher is installed. The file has the extension .application, and it is located in the application-specific subdirectory. During deployment the manifest file is moved to the c:/HostPublisher/Server/production/appmanifests subdirectory.

XML Tags for the application manifest

Note:
This file uses UTF-8 encoding.

There are three main categories of tags in this file, which are used to reference the parts of an application:

The following example illustrates the contents of the application manifest for a (host terminal-based) application called callup. This file is called callup.application, and will be in the c:/HostPublisher/Server/staging/applications/callup directory, where c:/HostPublisher is the directory where Host Publisher is installed, after the transfer to the server has been completed.

<?xml version="1.0"?>
<!DOCTYPE applconfig SYSTEM "applconfig.dtd">
<applconfig>
  <hodpoolspec refname="callup">
  <bean filename="com/xyzcorp/callup/callup1.class"/>
  <bean filename="com/xyzcorp/callup/callup2.class"/>
  <bean filename="xyzcorpmisc.jar"/>
  <beandir name="com/xyzcorp/utils"/>
  <!-- .java files too, for debugging on the server ? -->
  <document filename="callup1.jsp/>
  <document filename="callup2.jsp"/>
  <document filename="startpage.html"/>
  <document filename="errors/errorpage.html"/>
  <documentdir name="images"/>
  <!-- Entire directory contents should be published/deployed -->
</applconfig> 			

Directory contents before deployment

The following are the contents of the /var/HostPublisher/Server/staging directory (for AIX) after the callup application is transferred to the server.

Directory contents after deployment

The following are the contents of the /var/HostPublisher/Server/production directory (for AIX) after Host Publisher Server Administration has copied the files from the staging directory during the deployment step.


Macro script files

After a macro script (a .macro file) has been created using the Host Access application, you might want to manually edit it. Manually editing macro scripts should only be performed by advanced users.

Connect and disconnect macros created using Host Access are stored in the Studio_Install_Dir\Studio\SessionDefs directory, where Studio_Install_Dir is the Host Publisher installation directory for the Host Publisher Studio. Data macros are stored in the \Studio\IntegrationObjects directory of the Host Publisher installation directory.

Macro scripts can also be edited directly on the Host Publisher Server. The connect and disconnect macros are stored in the Server_Install_Dir\Server\production\poolspecs directory, where Server_Install_Dir is the Host Publisher Server installation directory, and data macros are stored in the Server_Install_Dir\Server\production\beans directory.

Caution: If the application is redeployed, changes made to the macro scripts on the Host Publisher Server will be lost.

Macro editing tips

When you edit extract coordinates in a data macro, you need to modify the extract coordinates in the Integration Object's .hpi file to match the ones you updated in the macro. After updating the .hpi file, use the Host Access application to re-generate the Integration Object. If the extract coordinates in the data macro do not match those in the .hpi file when the Integration Object runs, the data macro extracts the data based on the macro's updated coordinates, but the Integration Object returns the data to your Web application based on the old coordinates. The data in the resulting Web page might be incorrect.

Macro script syntax

This section is excerpted from the IBM WebSphere Host On-Demand Host Access Beans for Java Reference. The complete book is included in the Host On-Demand Host Access Toolkit.

Information has been added or modified for usage of macro scripts within Host Publisher.

Introduction

IBM Host On-Demand uses XML because a macro is better suited to the state machine model (the main reason for the move: XML is tailor made for a state machine).

The idea of a state machine may be fairly new to you. The idea behind a state machine, especially in the IBM Host On-Demand macro context, is simple. Think of how you use a host system from a terminal or a terminal emulator (like IBM Host On-Demand). The process you follow when you interact with a host system is illustrated in these steps:

  1. The host sends an expected screen down to you at your terminal.
  2. You look at and understand which screen is presented to you.
  3. You take the required actions based on your understanding (type keystrokes, and so forth).
  4. Another screen is presented after these actions.
  5. If you see the screen you expected, you do this all over again.
  6. If you do not see the screen you expected, call the help desk or handle the error.

This is the idea behind a state machine in the Macro context (although the Macro can't call the help desk for you). The states are the screens you expect to see, and you take actions on those screens to change from one state, or screen, to another. That's it, see a screen, perform the action, see the next screen. It is easier to understand (and program) a macro with this approach than having several if-then-else and do-while programming statements. Remember, see a screen, perform the action, see the next screen.

Now that you understand that a macro is a series of screens with their actions associated with them, take a look at how well suited XML is to coding a macro. Here is an example of how to specify a connect macro:

<HAScript name="" description="" timeout="60000" pausetime="200" promptall="false" 
          author="" creationdate="" supressclearevents="false" >
  <screen name="Screen1.1" entryscreen="true" exitscreen="false" transient="false">
     <description uselogic="1 and ((4 and 5) OR (2 or 3))" >
       <oia status="NOTINHIBITED" optional="false" invertmatch="false" />
       <block row="20" col="2" casesense="true" optional="true" invertmatch="false" >
         <string value="USERID   ===>" />
         <string value="PASSWORD ===>" />
       </block>
       <string value="USERID" row="15" col="1" casesense="true" optional="true" 
               invertmatch="false" />
       <numinputfields number="16" optional="false" invertmatch="false" />
       <cursor row="20" col="16" optional="false" invertmatch="false" />
     </description>
     <actions>
         <input value="myID" row="0" col="0" movecursor="true" xlatehostkeys="true" 
                encrypted="false" />
         <input value="myPW" row="0" col="0" movecursor="true" xlatehostkeys="true" 
                encrypted="true" />
         <input value="[enter]" row="0" col="0" movecursor="true" xlatehostkeys="true" 
                encrypted="false" />
     </actions>
     <nextscreens timeout="0" >
          <nextscreen name="Screen2" />
     </nextscreens>
  </screen>
  <screen name="Screen2" entryscreen="false" exitscreen="false" transient="false">
     <description uselogic="1 and 2" >
       <oia status="NOTINHIBITED" optional="false" invertmatch="false" />
       <string value="MORE..." row="20" col="20" casesense="true" optional="false" 
               invertmatch="false" />
     </description>
     <actions>
         <input value="[clear]" row="0" col="0" movecursor="true" xlatehostkeys="true" 
                encrypted="false" />
     </actions>
     <nextscreens timeout="0" >
          <nextscreen name="Screen3.1" />
     </nextscreens>
  </screen>
  <screen name="Screen3.1" entryscreen="false" exitscreen="true" transient="false">
     <comment>
      This screen description defines the connection pool checkin screen.
     </comment>
     <description uselogic="1 and (2 and 3)" >
       <oia status="NOTINHIBITED" optional="false" invertmatch="false" />
       <string value="Ready;" row="1" col="1" casesense="true" optional="false" 
               invertmatch="false" />
       <string value="Ready;" row="2" col="1" casesense="true" optional="false" 
               invertmatch="true" />
     </description>
     <actions>
     </actions>
     <nextscreens timeout="0" >
     </nextscreens>
  </screen>
<HAScript>

These lines of code demonstrate the power of this syntax. All the screens you expect to see for a task (like connecting) are coded within <screen> tags in XML. You describe the screen in a <description> tag, specify the actions for the screen in an <actions> tag, and specify the screen you want to see next in a <nextscreens> tag.

With the above example, keep in mind that the actions happen in sequence. The <screen> tag describes a logon screen with the text USERID and PASSWORD on the screen and the screen's cursor position at row 20, column 10. If the macro logic sees a screen matching this description, it prompts the user for an ID and password, places the prompt results at the specified row and column positions, sends the ENTER key, effectively connecting the user to the host. The <nextscreens> tag specifies the name of another <screen> tag that appears later in the macro. If the next screen does not appear, the macro logic returns an error.

Although there are a large number of valid XML tags, XML is not complicated. A screen is specified with a description, actions, and the next screens. When a macro is played and a screen matching the description appears, the actions are executed for that screen and the macro logic monitors the host for any next screens specified.

Macro Syntax

The following details each valid macro tag:

<HAScript>
  <screen>
    <comment>
    <description>
      <oia>
      <cursor>
      <numfields>
      <numinputfields>
      <string>
      <block>
      <attrib>
      <customreco>
    <actions>
      <prompt>
      <input>
      <extract>
      <message>
      <trace>
      <xfer>
      <pause>
      <mouseclick>
      <boxselect>
      <commwait>
      <custom>
    <nextscreens>
      <nextscreen>
    <recolimit>
 

The following XML tags and their attributes are valid in the IBM Host On-Demand Macro XML namespace. This description of the tags is structured like an actual macro file.

Note:
The tag and attribute values are not case sensitive.

Attention: All characters in a macro must be Unicode characters. Most text editors support this by default, because they use the ASCII character set, which is at the lower end of the Unicode character set.

<HAScript> tag

The <HAScript> tag is the main enclosing tag for the macro. All other tags at this level that are not HAScript are ignored by the parser.

The attributes of the <HAScript> tag are:

name
The name of the macro. This attribute is optional. The name can contain any valid Unicode character.

description
The description of the macro. This attribute is optional. The description can contain any valid Unicode character.

author
The creator of the macro. This attribute is optional. The author can contain any valid Unicode character.

creationdate
The date the macro was created. This attribute is optional. The creationdate can contain any valid Unicode character. The date format is not checked.

promptall
This launches all prompts at the beginning of the macro. This attribute is optional. The default is true. The value must be true or false.

pausetime
The sleep time in milliseconds initiated after a screen is matched. This is used to let the host quiet down. This attribute is optional. The default is no pause. The value must be a number. If a <pause> tag is specified for a specific screen, the value specified on the <pause> tag overrides this value.
Note:
The maximum pause time is limited to the platform on which the macro is running.

timeout
The allowable time in milliseconds between recognition events. If time expires, the macro goes into the error state. You can override this value in the <nextscreens> tag. The default is no timeout. The value must be a number.
Note:
The maximum pause time is limited to the platform on which the macro is running.

suppressclearevents
This is an advanced feature that determines whether the system should ignore screen events when a host application sends a clear screen command immediately followed by an end of record indicator in the data stream. You may want to set this value to true if you have screens in your application flow that have all blanks in them. If there is a valid blank screen in the macro and clear commands are not ignored, it is possible that a screen event with all blanks will be generated by clear commands coming from an ill-behaved host application. This will cause a screen recognition event to be processed and the valid blank screen will match when it shouldn't have matched. This attribute is optional. The default is false. The value must be true or false.

Example
<HAScript name="Logon Macro" description="Logs me on" author="btwebb"
     creationdate="12/29/1998" promptall="true" pausetime="500" timeout="10000" >
 ... 
</HAScript>

<screen> tag

The <screen> tag is the enclosing tag for the screen.

The attributes of the <screen> tag are:

name
The unique identifier for the screen. This attribute is mandatory and must be a unique string among the other screen IDs. The name can contain any valid Unicode character.

entryscreen
If true, the screen should be the first screen seen. Any other screen generates an error. This value must be true or false. This attribute is optional. The default is false.
Note:
There can be only one screen with the entryscreen attribute set to true.

exitscreen
If true, a match on the screen causes the macro to stop playing. You can have multiple screens with the exitscreen attribute set to true. This value must be true or false. This attribute is optional. The default is false.

transient
If true, the screen is handled as transient. Transient screens exist outside the normal macro flow. They are matched after nontransient screens. If you specify next screens in a transient screen, the next screens are ignored. Use this attribute to specify a screen that can appear at any time in the screen flow. This value must be true or false. This attribute is optional. The default is false.

Example
<screen name="screen1" entryscreen="true" exitscreen="false" transient="false"> 
... 
</screen>

<comment> tag

The <comment> tag for the screen. This can contain any valid Unicode character.

There are no attributes for the <comment> tag.

Example
<comment> ... </comment>

<description> tag

The <description> tag is the enclosing tag for the description associated with the screen.

The attributes of the <description> tag are:

uselogic
Determines the boolean logic for screen recognition. The numbers in the value represent the sequential positions of the descriptors in the <description> tag. There must be a descriptor for each number in the value.

In a macro generated by Host Access, the first number in the value always represents the position of the <oia> tag.

Notes:

  1. On the Host Publisher Server machine, if the uselogic attribute is present, the optional and invertmatch attributes of the descriptors are ignored.

  2. On the Host Publisher Studio machine, if you change any of the following:
    • The value of the uselogic attribute of the <description> tag
    • The values of the optional and invertmatch attributes of the descriptors
    • The positions of the descriptors

    and you load the macro into Host Access, the value of the uselogic attribute is overwritten to match the positions and optional and invertmatch attributes of the descriptors.

  3. If you make any of the changes listed above, and the value of the uselogic attribute contains a number for a descriptor that does not exist, the following problems occur:
    • On the Host Publisher Server, the macro fails when Host On-Demand attempts to load it, and an error message is logged.
    • In Host Access, the macro does not load when you open the Integration Object, and an error message is issued. The macro appears blank in the macro tree. Other macros are not affected.

  4. If you have a syntax error in the value of the uselogic attribute, such as unmatched parentheses, the following problems occur:
    • On the Host Publisher Server, the macro fails when Host On-Demand attempts to load it, and an error message is logged.
    • In Host Access, the macro does not load when you open the Integration Object, and an error message is issued. The macro appears blank in the macro tree. Other macros are not affected.

Example
<description uselogic="1 and (2 or !3)"> ... </description>

<oia> tag

The <oia> tag specifies an operator information area (OIA) condition to match. This tag is optional. The default is to wait for inhibit status.

The attributes of the <oia> tag are:

status
If NOTINHIBITED, the OIA must be uninhibited for a match to occur. If DONTCARE, the OIA inhibit status is ignored. This has the same effect as not specifying OIA at all. Valid values are NOTINHIBITED and DONTCARE. This is a required attribute.

optional
If false, this descriptor is considered non-optional during screen recognition. If the descriptors are comprised of more than one non-optional descriptor, and more than one optional descriptor, the non-optional descriptors are checked first. If all of the non-optional descriptors match, the screen matches. If at least one of the non-optional descriptors does not match, the optional descriptors are checked. One of the optional descriptors must match for the screen to match. Otherwise, the screen fails to match. The value must be true or false. This attribute is optional. The default is false.
Note:
If the uselogic attribute is specified on the <description> tag, this attribute is ignored.

invertmatch
If true, recognition matching passes only if the screen does not match this description element (logical NOT not operation). The value must be true or false. This attribute is optional. The default is false.
Note:
If the uselogic attribute is specified on the <description> tag, this attribute is ignored.

Example
<oia status="NOTINHIBITED" optional="false" invertmatch="false" />

<cursor> tag

The <cursor> tag describes the screen based on the position of the cursor.

The attributes of the <cursor> tag are:

row
The row position of the cursor. The value must be a number. This is a required attribute.

col
The column position of the cursor. The value must be a number. This is a required attribute.

optional
If false, this descriptor is considered non-optional during screen recognition. If the descriptors are comprised of more than one non-optional descriptor, and more than one optional descriptor, the non-optional descriptors are checked first. If all of the non-optional descriptors match, the screen matches. If at least one of the non-optional descriptors does not match, the optional descriptors are checked. One of the optional descriptors must match for the screen to match. Otherwise, the screen fails to match. The value must be true or false. This attribute is optional. The default is false.
Note:
If the uselogic attribute is specified on the <description>, this attribute is ignored.

invertmatch
If true, recognition matching passes only if the screen does not match this description element (boolean not operation). The value must be true or false. This attribute is optional. The default is false.
Note:
If the uselogic attribute is specified on the <description> tag, this attribute is ignored.

Example
<cursor row="1" col="1" optional="false" invertmatch="false" />

<numfields> tag

The <numfields> tag defines the total number of fields on the screen. This tag is optional. The number of fields not used if not specified.

The attributes of the <numfields> tag are:

number
The field count. The value must be a number. This is a required attribute.

optional
If false, this descriptor is considered non-optional during screen recognition. If the descriptors are comprised of more than one non-optional descriptor, and more than one optional descriptor, the non-optional descriptors are checked first. If all of the non-optional descriptors match, the screen matches. If at least one of the non-optional descriptors does not match, the optional descriptors are checked. One of the optional descriptors must match for the screen to match. Otherwise, the screen fails to match. The value must be true or false. This attribute is optional. The default is false.
Note:
If the uselogic attribute is specified on the <description>, this attribute is ignored.

invertmatch
If true, recognition matching passes only if the screen does not match this description element (boolean not operation). The value must be true or false. This attribute is optional. The default is false.
Note:
If the uselogic attribute is specified on the <description> tag, this attribute is ignored.

Example
<numfields number="10" optional="false" invertmatch="false" />

<numinputfields> tag

The <numinputfields> tag defines the total number of input fields on the screen. This tag is optional. The number of input fields is not used if not specified.

The attributes of the <numinputfields> tag are:

number
The field count. The value must be a number. This is a required attribute.

optional
If false, this descriptor is considered non-optional during screen recognition. If the descriptors are comprised of more than one non-optional descriptor, and more than one optional descriptor, the non-optional descriptors are checked first. If all of the non-optional descriptors match, the screen matches. If at least one of the non-optional descriptors does not match, the optional descriptors are checked. One of the optional descriptors must match for the screen to match. Otherwise, the screen fails to match. The value must be true or false. This attribute is optional. The default is false.
Note:
If the uselogic attribute is specified on the <description>, this attribute is ignored.

invertmatch
If true, recognition matching passes only if the screen does not match this description element (boolean not operation). The value must be true or false. This attribute is optional. The default is false.
Note:
If the uselogic attribute is specified on the <description> tag, this attribute is ignored.

Example
<numinputfields number="10" optional="false" invertmatch="false" />

<string> tag

The <string> tag describes the screen based on a string.

The attributes of the <string> tag are:

value
The string value. This value can contain any valid Unicode character. This is a required attribute.

row
The starting row position for a string at an absolute position or in a rectangle. The value must be a number. This value is optional. If not specified, Macro logic searches the entire screen for the string. If specified, col position is required. <erow> and <ecol> attributes can also be specified to specify a string in a rectangular area.
Note:
Negative values are valid and are used to indicate relative position for the bottom of the screen (for example, -1 is the last row).

col
The starting column position for the string at an absolute position or in a rectangle. The value must be a number. This attribute is optional.

erow
The ending row position for string in a rectangle. The value must be a number. This attribute is optional. If both erow and ecol are specified, string is in a rectangle.

ecol
The ending column position for string in a rectangle. The value must be a number. This attribute is optional. If both erow and ecol are specified, string is in a rectangle.

casesense
If true, string comparison is case sensitive. The value must be true or false. This attribute is optional. The default is false.

optional
If false, this descriptor is considered non-optional during screen recognition. If the descriptors are comprised of more than one non-optional descriptor, and more than one optional descriptor, the non-optional descriptors are checked first. If all of the non-optional descriptors match, the screen matches. If at least one of the non-optional descriptors does not match, the optional descriptors are checked. One of the optional descriptors must match for the screen to match. Otherwise, the screen fails to match. The value must be true or false. This attribute is optional. The default is false.
Note:
If the uselogic attribute is specified on the <description>, this attribute is ignored.

invertmatch
If true, recognition matching passes only if the screen does not match this description element (boolean not operation). The value must be true or false. This attribute is optional. The default is false.
Note:
If the uselogic attribute is specified on the <description> tag, this attribute is ignored.

Examples
<string value="hello" row="1" col="1" optional="false" invertmatch="false" />
<string value="hello" row="1" col="1" erow="11" ecol="11" casesense="false" 
           optional="false" invertmatch="false" />
<string value="hello" />

<block> tag

The <block> tag describes the screen based on a group of strings. This tag is used instead of multiple <string> tags, when the strings are positioned on the screen relative to the first string. The contents of <block> tag are considered a single descriptor.

The attributes of the <block> tag are the same as the <string> tag, with the exception of the value attribute.

Example
<block row="20" col="2" casesense="true" optional="true" invertmatch="false" >
  <string value="USERID   ===>" />
  <string value="PASSWORD ===>" />
</block>

<attrib> tag

The <attrib> tag describes the screen based on an attribute. This is an advanced feature and should only be used if needed. Usually all the other description elements are enough to describe a screen.

The attributes of the <attrib> tag are:

plane
The plane value string that the attribute resides in. Valid values are COLOR_PLANE, FIELD_PLANE, and EXFIELD_PLANE. This is a required attribute.

value
The hex value string of the attribute. Example, value="0xA0". This is a required attribute.

row
The row position of the attribute. The value must be a number. This is a required attribute.

col
The column position of the attribute. The value must be a number. This is a required attribute.

optional
If false, this descriptor is considered non-optional during screen recognition. If the descriptors are comprised of more than one non-optional descriptor, and more than one optional descriptor, the non-optional descriptors are checked first. If all of the non-optional descriptors match, the screen matches. If at least one of the non-optional descriptors does not match, the optional descriptors are checked. One of the optional descriptors must match for the screen to match. Otherwise, the screen fails to match. The value must be true or false. This attribute is optional. The default is false.
Note:
If the uselogic attribute is specified on the <description> tag, this attribute is ignored.

invertmatch
If true, recognition matching passes only if the screen does not match this description element (boolean not operation). The value must be true or false. This attribute is optional. The default is false.
Note:
If the uselogic attribute is specified on the <description> tag, this attribute is ignored.

Example
<attrib value="0x01" row="1" col="1" plane="COLOR_PLANE" optional="false" 
           invertmatch="false" />

<customreco> tag

The macro logic will call out to any custom recognition listeners for the custom tag to have the listener do its own custom screen recognition logic.

The attributes of the <customreco> tag are:

ID
The unique identifier for the custom description element. Allows for multiple custom elements. This can be any valid Unicode character. This is a required attribute.

Example
<customreco id="id1" />

<actions> tag

The <actions> tag is the enclosing tag for the actions associated with the screen.

The attributes of the <actions> tag are:

promptall
If this value is set to true, the Macro bean will gather all prompts within the current action tag and launch them as one prompt event. The value must be true or false. This attribute is optional. The default is false.

Example
<actions promptall="true"> ... <actions>

<prompt> tag

The <prompt> tag specifies a prompt to be handled for the screen.

The attributes of the <prompt> tag are:

row
The row to place the prompt. The value must be a number. This is a required attribute.

col
The column to place the prompt. The value must be a number. This is a required attribute.

len
The length of the prompt. The value must be a number. This is a required attribute.

name
The name of the prompt. This can be any valid Unicode character. This attribute is optional.

description
The description of the prompt. This can be any valid Unicode character. This attribute is optional.

default
The prompt's default value. This can be any valid Unicode character. This attribute is optional.

clearfield
This clears the host field on placement of prompt text. The value must be true or false. This attribute is optional. The default is false.

encrypted
Use a password echo character. The value must be true or false. This attribute is optional. The default is false.

xlatehostkeys
If true, host key mnemonics (example, [enter]) will be translated. For a list of key mnemonics, see the Host On-Demand online help. The value must be true or false. This attribute is optional. The default is false. If you do not have this value set to true (which is normal because you wouldn't ask users to type key mnemonics), don't forget to code an input tag after the prompt(s) for the current actions to get the prompt data entered onto the host.

Example
<prompt name="ID" row="1" col="1" len="8" description="ID for Logon" 
           default="btwebb" clearfield="true" encrypted="true"/>

<input> tag

The <input> tag specifies keystrokes to be placed on the screen.

The attributes of the <input> tag are:

row
The row position to send the keys. The value must be a number. This attribute is optional. This defaults to current cursor position.

col
The column position to send the keys. The value must be a number. This attribute is optional. This defaults to current cursor position.

movecursor
The place the cursor at the end of the input string. The value must be true or false. This attribute is optional. This defaults to false.

value
The text that is sent to the screen. This can be any valid Unicode character. This is a required attribute.

xlatehostkeys
If true, host key mnemonics (example, [enter]) will be translated. For a list of key mnemonics, see the Host On-Demand online help. The value must be true or false. This attribute is optional. The default is true.

encrypted
If true, keystrokes that are typed are not displayed on the screen. The value must be true or false. This attribute is optional. The default is false.

Example
<input value="[clear]" row="0" col="0" movecursor="true" xlatehostkeys="true" 
       encrypted="false" />
 

<extract> tag

The <extract> tag specifies an extract to be handled for the screen.

The attributes of the <extract> tag are:

name
The name of the extract. This can be any valid Unicode character. This attribute is optional.

srow
Upper left row of the bounding extract rectangle. The value must be a number. This is a required attribute.

scol
The upper left column of the bounding extract rectangle. The value must be a number. This is a required attribute.

erow
The lower right row of the bounding extract rectangle. The value must be a number. This is a required attribute.

ecol
The lower right column of the bounding extract rectangle. The value must be a number. This is a required attribute.

Example
<extract name="Get Data" srow="1" scol="1" erow="11" ecol="11" />

<message> tag

The <message> tag specifies a message to be sent to the user.

The attributes of the <message> tag are:

title
The title to display in the message dialog. This can be any valid Unicode character. This attribute is optional. This defaults to macro name.

value
The message to display in the dialog. This can be any valid Unicode character. This is a required attribute.

Example
<message value="yourvalue" title="YourMessage" />
Note:
To aid in debugging Host Publisher macro execution, you can set distinctive messages in connect, data, and disconnect macros. During macro execution, the macroMessage Integration Object property is set to the last message tag executed. JSPs can query the value of the last message encountered using the Host Publisher getHPubMacroMessage method. For information on the getHPubMacroMessage method and other Integration Object methods that you can use in your WebSphere applications, see Integration Object methods.

<trace> tag

The <trace> tag specifies a string to be sent to one of several trace facilities.

The attributes of the <trace> tag are:

type
The type can either be sent to the IBM Host On-Demand trace facility, a user trace event, or to the command line. Respectively, the types are HODTRACE, USER, SYSOUT. This is a required attribute.
Note:
To aid in debugging and controlling Host Publisher macro execution, set the type attribute to USER.

value
The text that is sent to trace. This can be any valid Unicode character. This is a required attribute.

Example
<trace value="hello" type="HODTRACE" />

<xfer> tag

The <xfer> tag transfers a file to or from a host system.

The attributes of the <xfer> tag are:

direction
The direction for the file transfer. The allowable types are SEND (file from PC to host) and RECEIVE (file from host to PC). This is a required attribute.

pcfile
The PC file name to be used for the file transfer. This should point to a valid file on your system. This is a required attribute.

hostfile
The host file name to be used for the file transfer. This should point to a valid file on your host system. This is a required attribute.

clear
Indicates whether the Macro bean should clear the host screen before performing the file transfer. The value must be true or false. This attribute is optional.

timeout
Sets the time out value (in milliseconds) for the file transfer. If the transfer does not complete in this given time, the macro will end in error. The value must be a number in milliseconds. This attribute is optional and the default is 10000 milliseconds or 10 seconds.

options
Sets the host specific options for the file transfer. Options are different for every type of host system. See the file transfer bean documentation or contact your host system administrator for valid options for your host system. This value must be a Unicode string. This attribute is optional and the default is no options.

pccodepage
Sets the PC code page to use in the file transfer. The value must be a valid PC code page. See the Host On-Demand online help for session configuration for valid code page values. This attribute is optional.

hostorientation
Sets the host character orientation to use in the file transfer. This applies to BIDI (bidirectional) environments only. See the Host On-Demand online help for session configuration for valid values. This attribute is optional and defaults to no value.

pcorientation
Sets the PC character orientation to use in the file transfer. This applies to BIDI (bidirectional) environments only. See the Host On-Demand online help for session configuration for valid values. This attribute is optional and defaults to no value.

pcfiletype
Sets the PC file type to use in the file transfer. This applies to BIDI (bidirectional) environments only. See the Host On-Demand online help for session configuration for valid values. This attribute is optional and defaults to no value.

lamalefexpansion
Sets whether Lam Alef expansion will be used in the file transfer. This applies to BIDI (bidirectional) environments only. See the Host On-Demand online help for session configuration for page values. This attribute is optional and defaults to no value.

lamalefcompression
Sets whether Lam Alef compression will be used in the file transfer. This applies to BIDI (bidirectional) environments only. See the Host On-Demand online help for session configuration for page values. This attribute is optional and defaults to no value.

Example
<xfer direction="send" pcfile="c:\myfile.txt" hostfile="myfile text A0" />

<pause> tag

The <pause> tag causes the macro engine to sleep for the number of milliseconds specified. This action is useful for pausing between several file transfers. The value specified for the <pause> tag overrides the value specified on the pausetime attribute of the <HAScript>tag.

The attributes of the <pause> tag are:

value
The time to pause. The value must be a number (in milliseconds). This attribute is optional. The default is 10000 milliseconds or 10 seconds.

Example
<pause value="2000" />

<mouseclick> tag

The <mouseclick> tag simulates a user mouse click on the Terminal bean. This essentially sets the cursor at a given row and column position.

The attributes of the <mouseclick> tag are:

row
The host screen row position for the mouse click. This must be a number within the host screen coordinate system (example, 24 rows by 80 columns). This is an optional attribute and the default value is 1.

col
The host screen column position for the mouse click. This must be a number within the host screen coordinate system (example, 24 rows by 80 columns). This is an optional attribute and the default value is 1.

Example
<mouseclick row="20" col="16" />

<boxselect> tag

The <boxselect> tag is used for either marking or unmarking the marking rectangle on the Terminal bean.

The attributes of the <boxselect> tag are:

srow
The upper left row of the bounding selection rectangle. The value must be a number within the host screen coordinate system (example, 24 rows by 80 columns). Negative values are allowed and specifiy a virtual position from the last row (for example, if the Screen has 24 rows, a row value of -2 points to the 22nd row). This is a required attribute.

scol
The upper left column of the bounding selection rectangle. The value must be a number within the host screen coordinate system. Negative values are allowed and specifiy a virtual position from the last column. This is a required attribute.

erow
The lower right row of the bounding selection rectangle. The value must be a number within the host screen coordinate system. Negative values are allowed and specifiy a virtual position from the last row. This is a required attribute.

ecol
The lower right column of the bounding selection rectangle. The value must be a number within the host screen coordinate system. Negative values are allowed and specifiy a virtual position from the last column. This is a required attribute.

type
The type of selection action to perform. The value must be either SELECT or DESELECT. This is an optional attribute and the default is SELECT.

Example
<boxselect srow="1" scol="1" erow="11" ecol="11" type="SELECT" />

<commwait> tag

The <commwait> tag is used for performing a communication status wait during a macro's execution.

The attributes of the <commwait> tag are:

value
The type of communication status to wait for. Valid values are CONNECTION_INIT, CONNECTION_PND_INACTIVE, CONNECTION_INACTIVE, CONNECTION_PND_ACTIVE, CONNECTION_ACTIVE, CONNECTION_READY, and CONNECTION_DEVICE_NAME_READY. The meaning of these types is documented in the Java documentation for the ECLConnection object in the Host On-Demand Host Acceess Class Library documentation. The two most used and most meaningful types are CONNECTION_READY and CONNECTION_INACTIVE. This is a required attribute.

timeout
Sets the time out value (in milliseconds) for the communication wait. If the wait does not complete in this given time, the macro will end in error. The value must be a number in milliseconds. This attribute is optional and the default is no time out.

Example
<commwait value="CONNECTION_READY" timeout="10000" />

<custom> tag

The <custom> tag enables the user to have an exit to Java code. See the Host On-Demand Java documentation for the MacroActionCustom class.

The attributes of the <custom> tag are:

id
The ID of the callout code that the Macro bean will use. This can be any valid Unicode character. This is a required attribute.

args
The argument string that can be passed to the callout. This can be any valid Unicode character. This attribute is optional.

Example
<custom id="custom1" args="YourArgument" />

<nextscreens> tag

The <nextscreens> tag contains all the valid next screens to be recognized after the current screen's actions have been executed.

The attributes of the <nextscreens> tag are:

timeout
The allowable time in milliseconds that can elapse between current screen and any next screen before the macro bean will go into the error state. This overrides the timeout attribute for the entire macro. The value must be a number. This attribute is optional. The default is to use the overall macro timeout.

Example
<nextscreens> ... </nextscreens>

<nextscreen> tag

The <nextscreen> tag forces a next screen. Multiple <nextscreen> tags are allowed. If a screen appears that is in the macro but is not a next screen, the macro will go into an error state. If the next screen refers to a screen tag that doesn't exist, the macro will have a parse error.

The attributes of the <nextscreen> tag are:

name
The name of the <screen> element that is the valid next screen. This can be any valid Unicode character. This is a required attribute.

Example
<nextscreen name="screen1" />

<recolimit> tag

The <recolimit> tag is for advanced use only. It is used to enforce a limited amount of time a screen can be recognized in a row before it goes to the screen indicated in the goto attribute. This tag is useful for screen looping where you know exactly how many times you'll see a given screen in a row. It also is a safeguard against infinite screen recognition.

The attributes of the <recolimit> tag are:

value
The allowable number of times to recognize a screen. This value must be a number. This is a required attribute.
Note:
The actions will not be executed the last time the screen is recognized.

goto
The name of the screen to go to when recognition limit has been reached. This can be any valid Unicode character but the screen must exist in the macro. For Host Publisher, this attribute is required. If no goto screen is given, the macro terminates.

Example
<recolimit value="3" goto="endscreen"/>


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]