After following the steps in Creating a basic HATS project, you have a HATS project that looks a lot like the original host application. Now it's time to customize the project. By performing customization, you can:
There are other, advanced customization tasks you can do as well. They are summarized in Performing other customization tasks and described more fully in the HATS User's and Administrator's Guide, the HATS Web Application Programmer's Guide, and the HATS Rich Client Platform Programmer's Guide.
To understand the purpose of the customization techniques described in this chapter, and how they work together, you must first understand how a HATS application processes a host screen to convert it to a GUI. When a user accesses a HATS application, a request is sent to the HATS application, running on a WebSphere® Application Server, a WebSphere Portal, or a rich client platform. The HATS application forwards the request to the host application and receives a host screen. The HATS application transforms the host screen, using the customization you have created in the HATS project, and sends the transformation to the user. Each time the user interacts with the HATS application, the process is repeated.
The HATS application uses a rules-based approach to determine how to convert each host screen. HATS applications can contain a list of screen events (screen customizations and screen combinations), which specify criteria used to match host screens. Each screen event also lists actions to be taken when a match is found. Your HATS application compares each host screen to its ordered set of screen events, and when the first match is found, it performs the specified actions. You do not have to specify how to convert every single screen from your host application. If there is no matching screen event for a host screen, HATS performs the actions defined for the unmatched screen application event, which by default applies the default transformation. See Working with screen events for more information.
Each HATS project contains a set of different types of resources (artifacts). You can see the resource types listed under the project name in the HATS Projects view in the HATS Toolkit. This section defines the key resource types. For definitions of other HATS resources see the Glossary.
As you develop your HATS project, much of your work will involve screens from your host application. You will use the HATS host terminal to connect to and interact with your host application and use it for these tasks:
Each of these tasks is described in the following sections.
To open a host terminal session, select your project in the HATS Projects view, then click the Open HATS Host Terminal icon on the main tool bar to open the host terminal session. You can also open the host terminal from the pop-up menu by right-clicking any resource in your project, selecting Open Host Terminal, and then selecting the connection to use. If you leave your host session active, you can move around in it as you customize your project, creating screen events and transformations from the active screens. If you prefer, you can navigate to a few screens in your host application and click the Create Screen Capture icon on the host terminal tool bar to create screen captures that you can use to create screen events and transformations.
Table 2 shows the icons that appear on the host terminal screen.
To see what the currently displayed host screen looks like when the HATS application runs in a production environment, click the Host Screen Preview tab at the top of the Host Terminal window. The host screen preview first searches the screen event list in the order specified for your project, and applies the matching screen event. If there are no matching screen event defined for the current screen, the project level template and default rendering rules are applied to the screen.
Another way to work with host screens is to navigate to several screens on your host terminal and use the Create Screen Capture icon, shown in the table above, to capture representations of host screens. After you have captured some host screens, you can work with them without being connected to the host computer. You must create screen captures in order to modify default rendering items or create global rules.
When you create screen captures, they are stored in the Screen Captures folder within your project. To work with a screen capture, expand the folder in the HATS Projects view, then double-click the name of the screen capture to start the screen capture editor. The editor shows the host screen; click the Preview tab at the bottom to see how this screen would be transformed by your project.
Click the Host Screen tab at the bottom to return to the host screen. From this tab you can use the icons on the toolbar at the top of the editor to create a screen customization, screen combination, or transformation based on this screen capture. The name of the screen event or transformation defaults to the name of the screen capture.
Typically, the pages displayed by your HATS application consist of two elements:
A template allows you to control the overall appearance of your application. A template is a JSP file in HATS Web projects or a Java™ Standard Widgets Toolkit (SWT) composite class in HATS rich client projects.
Review the examples of transformed screens in A HATS example. In the Web example, the transformed screen includes three main areas: a graphic title banner, a vertical navigation bar which contains application keypad buttons, and the host information area. In the rich client example, the transformed screen includes a horizontal banner, a toolbar which contains application keypad buttons, and the host information area. The template provides a consistent appearance for the pages in an application and enables you to personalize your HATS application. You can use the same template in more than one application.
Although every screen in your application will normally use the same template, you can define a screen event so that it applies a transformation that uses a different template. The new template applies to host screens matching the screen event. (See Working with screen events for more information about screen events.)
You can either modify a template that comes with HATS or create a new template. Launching the Create a Template wizard allows you to create a blank template, a template based off one of the templates shipped with HATS, or a Web page (Web projects only). For your HATS Web projects, you may want to create a template based off your company's Web site.
To change the template for your HATS project, follow these steps:
to expand the resources for the project.You can also change the default project template by expanding the Templates folder. Right-click on the desired template and select Set as Default Template.
For more information about creating and editing templates see the HATS User's and Administrator's Guide
Default rendering is responsible for transforming host screens that have not been individually customized. Default rendering works to change host components on the screen to widgets in the GUI. Certain host components are mapped to specific widgets for conversion in the default transformation. A default list of mapping items is defined for projects. This list is called a rendering set. You can modify the rendering set to suit your needs.
The items in the rendering set are processed in the order in which they are listed. After a rendering item has been applied to a region of the host screen, that region has been consumed and will not be processed again.
To access the default rendering set, follow these steps:
to expand it.As you can see, there are several items defined in a rendering set. A check box precedes each item. When the box is selected, the item is active, and the default transformation uses the item, if HATS finds the component on the screen. If there is an item that you do not want to use in your project, you can clear the check box rather than removing the item entirely. Using the buttons beside the table, you can add, edit, or remove items. The Up and Down buttons allow you to reorder the rendering items.
To define additional default rendering items, follow these steps:
icon
to change the default settings.
icon to change the default settings.For more information about default rendering see the HATS User's and Administrator's Guide.
Global rules are used to transform specific input fields based on certain criteria. They apply to both customized screens and screens rendered using default rendering. In addition to defining global rules at the project-level, they can also be defined at the screen-level which gives you more control over when the rules are applied.
Each global rule item is defined in a transformation fragment, which can be included in other transformations. You can edit the transformation fragments just like you edit transformations, using all of the options available with transformations.
For more information about global rules see the HATS User's and Administrator's Guide.
A HATS event is a resource that performs a set of actions based on a certain state being reached. There are two types of HATS events, application events and screen events. For more information about application events see the HATS User's and Administrator's Guide. A screen event is a HATS event that is triggered when a host screen is recognized by matching specific screen recognition criteria. There are two types of screen events, screen customizations and screen combinations.
A screen customization is a HATS screen event designed to perform a set of actions when a host screen is recognized. Examples of screen customizations include recognizing a screen and transforming it into a GUI for the user or playing a macro to skip the screen. The screen customization definition includes a set of screen recognition criteria and a list of actions to be taken when a host screen matches the screen recognition criteria. Screen-level global rules and text replacement settings are also included. Use the Create a Screen Customization wizard to create a new screen customization.
A screen combination is a HATS screen event designed to gather output data from consecutive, similar host screens, combine it, and display it in a single output page. An example of a screen combination includes recognizing a screen that contains only partial output data and navigating through all subsequent screens to gather all of the remaining data to display for the user. The screen combination definition includes a set of screen recognition criteria for both the beginning and ending screens to be combined, how to navigate from screen to screen, and the component and widget to use to recognize and render the data gathered from each screen. Also, it includes a list actions to be performed one or more times, screen-level global rules and text replacement settings. Use the Create a Screen Combination wizard to create a new screen combination.
Actions that can be performed in a screen event are listed below. For more details see the HATS User's and Administrator's Guide.
To create a new screen customization, follow these steps:
You do not have to define your screen customization completely when you define it. You can edit it later and modify its screen recognition criteria and actions.
To create a new screen combination, follow these steps:
You do not have to define your screen combination completely when you define it. You can edit it later and modify its screen recognition criteria and actions.
Your HATS application checks each incoming host screen against an ordered list of screen events. It is essential to have the screen events for your project listed in the correct order. For example, you might have one screen event that recognizes a few specific screens, and a second one that recognizes a more general set of screens. If the second one is listed before the first, it might be applied to one of the screens to which you wanted to apply the first, more specific screen event.
You can reorder your screen events, or review the order in which they are checked, in the Project Settings editor. After you have created your project's screen events, double-click Project Settings in the HATS Projects view. In the editor, click the Events tab. Review the list of screen events and use the Up and Down buttons if you want to change the order. The screen event that you want checked first should be at the top of the list.
You can use the check boxes next to each screen event in the list to enable or disable the screen event. When the box is selected, the screen event is active. If you clear the check box, the HATS application will not use that screen event. Disabling some screen events can be useful during testing and debugging, and will improve performance if you have a lot of screen events that you do not use.
A transformation defines the way in which a host screen is converted into a GUI page. The transformation specifies how to treat each part of the host screen.
In host applications, data can be presented in many different ways, such as menus, tables, and command prompts. These are known as host components. Your HATS application converts them into graphical elements, or widgets, for displaying data on a GUI.
HATS comes with a default set of host components, representing the most frequently used methods of presenting data, as well as a set of widgets associated with each one. These host components and widgets are listed in Table 3. As you develop your HATS application, you select a region on the host screen, select a host component (which is responsible for finding specific contents in that region, and select a widget (which is responsible for rendering the output of the host component.
For example, if a host application has a menu in which the user is required to select one of the several choices, you can design your HATS application to display the menu on a GUI as a drop-down list. Alternatively, you can have the menu appear as a list of radio buttons, from which the user makes a choice, or as a list of links or buttons. You can even develop a custom component or widget.
| Host component | Widget |
|---|---|
|
Command line |
Combo RCP-only Drop-down (data entry) List Popup Radio button (data entry) Text input |
|
Field |
Field |
|
Function key |
Button Button table Drop-down (selection) Link Radio button (selection) Toolbar RCP-only |
|
HTML DDS keyword |
Label |
|
Input field |
Calendar Web-only Check box Combo RCP-only Drop-down (data entry) List Popup Radio button (data entry) Text input |
|
Input field with hints |
Combo RCP-only Drop-down (data entry) List Popup Radio button (data entry) |
|
Item selection |
Check box Combo RCP-only Drop-down (data entry) Link (item selection) List Popup Radio button (item selection) Text input |
|
Light pen (attention) |
Button Link Radio button (selection) |
|
Light pen (selection) |
Check box |
|
Scrollbar field (ENPTUI) |
Scrollbar (ENPTUI) |
|
Selection field (ENPTUI) |
Button Check box Link Radio button (selection) |
|
Selection list |
Button Button table Drop-down (selection) Link Radio button (selection) Toolbar RCP-only |
|
Subfile |
Subfile (check box) Subfile (drop-down) Subfile (popup) |
|
Table |
Graph (horizontal bar) Graph (line) Graph (vertical bar) Table |
|
Table (field) |
Graph (horizontal bar) Graph (line) Graph (vertical bar) Table |
|
Table (visual) |
Graph (horizontal bar) Graph (line) Graph (vertical bar) Table |
|
Text |
Label |
|
URL |
Link |
A HATS transformation is a powerful tool, containing all the information needed to convert components from host screens into widgets on GUI pages. A transformation can be used when it is associated with a screen event. The screen event, described in Working with screen events, includes a list of actions to be taken when a host screen matches its screen recognition criteria. Applying a transformation to the host screen is one of the actions that can be taken.
The easiest way to associate a transformation with a screen event is to create the transformation at the same time that you create the screen event.
There are many ways to create a new transformation. When you create a screen event and apply a transformation as one of the actions, HATS will by default create a transformation with the same name, based on the same host screen, and associate it with the screen event. Because the transformation is named and associated with a host screen, it is created without the use of a wizard.
You can also create a transformation in other ways:
Either of these methods starts the Create a Transformation wizard. If you create a transformation directly from a screen capture or from a host terminal, you will have to associate it with a screen event later by editing the screen event and adding the transformation as an action. This process is described in HATS User's and Administrator's Guide.
The Create a Transformation wizard asks you to select the target project, supply a name for the transformation, supply a package (for rich client projects), and indicate on which screen the transformation is based. The wizard creates the transformation and opens it in the transformation editor so that you can add host components and widgets.
While editing a transformation in a HATS Web project, you can use the HATS Components drawer in the Palette view of the Page Designer to drag new components onto the page. You can use the Properties view to modify the settings for the current components. For more information about editing transformations in HATS Web projects, see Editing transformations for Web projects in the HATS User's and Administrator's Guide.
For HATS Web projects, in addition to using the Palette view to edit your transformation, you can use icons on the main toolbar and items from the HATS Tools menu on the menu bar. The following table lists the icons available on the main toolbar.
In addition to the icons on the main toolbar, for HATS Web projects you can use functions from the HATS Tools menu on the menu bar to insert items into a transformation while editing the transformation. These functions are listed in the table below.
| Insert Function | Description |
|---|---|
| Insert Tabbed Folder | Inserts a folder with tabs |
| Insert Macro Key | Adds a button, link, or drop-down list to enable the end user to execute a macro |
| Insert Global Variable | Inserts a global variable as text, or as a prompt for a global variable with input fields |
| Insert Operator Information Area | Inserts the Operator Information Area which shows terminal attributes on the screen |
| Insert Host Keypad > Default Keypad | Adds the default host keypad |
| Insert Host Keypad > Custom Keypad | Adds a customized host keypad containing only the keys that you select |
| Insert Host Keypad > Individual Key | Adds individual host keys that you select |
| Insert Application Keypad > Default Keypad | Adds the default application keypad |
| Insert Application Keypad > Custom Keypad | Adds a customized application keypad to the template on your Web page, containing the keys that you select |
| Insert Application Keypad > Individual Key | Adds individual application keys that you select to the template on your Web page |
| Insert All Host Components | Inserts all possible host components found on a selected screen capture |
| Insert Stored Screen | Inserts a screen that you have stored when combining multiple host screens |
| Insert Integration Object Properties > Input | Inserts inputs from a specified Integration Object JSP page |
| Insert Integration Object Properties > Output | Inserts outputs from a specified Integration Object JSP page |
| Insert Forward to HATS Application | Adds a button that forwards JSP control information to the HATS application started by the user. |
For HATS rich client projects, assuming the Java client application editor (VE) feature is installed with Rational® SDP, you can use the Visual Editor to edit your transformations. With the Visual Editor, the following items in the HATS drawer of the Palette view can be used. For more information about editing transformations in HATS rich client projects, see Editing transformations for rich client projects in the HATS User's and Administrator's Guide.
| Item | Description |
|---|---|
| Component | Launches the Insert Host Component wizard to insert rendering for a specific component |
| Default Rendering | Launches the Insert Default Rendering wizard to insert a default rendering composite |
| Macro Key | Launches the Insert Macro Key wizard to insert a button or link that will run a macro when clicked |
| Global Variable | Launches the Insert Global Variable wizard to display or prompt for the value of a global variable |
| Host Key | Launches the Insert Host Key wizard to insert a button or link that will send a host key when clicked |
| Application Key | Launches the Insert Application Key wizard to insert a button or link for an application key function |
The use of these functions in the transformation editor is described in the HATS User's and Administrator's Guide.
You can also do the following kinds of customization on your HATS project.
Many host screens include a list of function keys (PF keys) and their assignments. You can choose to display these keys graphically in your HATS application. For more information about displaying function keys, see the description of host keypad in the HATS User's and Administrator's Guide.
Your HATS application can replace text strings on host screens with different output on GUI pages. These text strings must be protected text strings, that is, strings that are used only on the screen and never passed to the host application as input. For example, you can replace the text string used as a field label or prompt. You can replace text with different text, HTML coding Web-only , or images. Java regular expression support can be use as part of the text replacement algorithm. Text strings can even be replaced with a button or link that sends a host key.
You can define text replacement in various ways within a project:
If you define text replacement for the same text in both the project settings and in a screen event with different replacement output, the screen event definition takes precedence. If you define text replacement for the same text in both the screen event and component tag level, the component tag level text replacement takes precedence.
Text replacement using another text string attempts to maintain the original screen layout. If the replacement text is longer than the text to be replaced, the replacement text is truncated to fit into the original field size. However, if there is available white space between the text replacement field and the next host component, the replacement string uses that white space for the next characters of your replacement string.
Text replacement with either HTML strings Web-only or images does not preserve the original screen layout, because the replacement output might not fit into the original field size. This might cause undesirable formatting results in the GUI.
When replacing text with any chosen replacement, be sure to test your text replacements carefully to be sure that they do not give unexpected results.
For more information about text replacement see the HATS User's and Administrator's Guide.
You can record a macro to create a set of steps to be taken automatically, such as providing information for entry fields or selecting menu options. For example, to access a host application, a user needs to log on to the system with a user ID and password. Logging on to the system is a good candidate for a macro, because your project can traverse the logon screens for the user of your application. Also, using the Visual Macro Editor you can edit the macro to add a conditional path to take if the user ID or password have expired.
To record a simple logon macro, follow these steps:
).
).
).
).You can run the mylogon macro as an action in a screen customization to log a user on to the host system.
For more information about recording and using macros, refer to the HATS User's and Administrator's Guide and the HATS Advanced Macro Guide.
You can import IBM® WebSphere Host Publisher applications, Integration Objects, and macros into your HATS project using options from the File > Import > HATS menu. You can also create Web pages directly from imported Integration Objects. For more information about importing and using Host Publisher artifacts, refer to the HATS User's and Administrator's Guide. For information about programming with or customizing Host Publisher Integration Objects, refer to the HATS Web Application Programmer's Guide.
When you create a project, you define a connection to the host to handle all transformations. You can define background connections to different hosts to run Integration Objects and macros. Secure Sockets Layer (SSL), Web Express Logon (WEL), pooling, and user lists are supported on these connections. For information about defining connections, refer to the HATS User's and Administrator's Guide.
You can define global variables to hold data from, for example, an area of the screen, and make that data available to business logic, templates, transformations, and macro prompts. For information about global variables, refer to the HATS User's and Administrator's Guide.
You can specify a Java method to be called as one of the actions in a screen event, to perform business logic. To add business logic to your HATS project, in the HATS Projects view, right-click on your project and select New HATS > Business Logic. A wizard prompts you for a target project, a class name and a package name and then a stub class is created in the Source directory for the project. For more information about adding business logic to your HATS project, refer to the HATS Web Application Programmer's Guide or the HATS Rich Client Platform Programmer's Guide, as appropriate.
In addition to representing host-application buttons as part of the screen presentation, you can enable your users to interact with your application by using the keyboard. Refer to the HATS User's and Administrator's Guide for more information.
You can create Integration Objects from the macros in HATS Web projects and HATS EJB projects. HATS EJB projects have no folders for Screen Customizations, Screen Combinations, Screen Captures, or Web Content. EJB projects contain only connections, macros, and Integration Objects. Refer to the HATS Web Application Programmer's Guide for more information on Integration Objects and creating EJB projects.
Integration Objects can be used in Web Services and portlets. Refer to the HATS Web Application Programmer's Guide for more information.
You can also create Model 1, Struts, or JSF Web pages to run your Integration Objects. Refer to the HATS User's and Administrator's Guide for more information.
In the connection editor you can specify Workstation ID properties. Workstation ID settings include None, Prompt user, Use a specified value, and Use an HTTP session variable Web-only .
For more information about workstation IDs, refer to the HATS User's and Administrator's Guide.
You can add support to your HATS project for local viewing and printing of files from the host application. Refer to the HATS User's and Administrator's Guide for more information.
For a HATS 5250 print support step-by-step example, go to the HATS Information Center located at http://publib.boulder.ibm.com/infocenter/hatshelp/v75/index.jsp.
HATS can recognize a subfile on the host screen using the subfile component, and render it in the GUI using the subfile (check box), subfile (drop-down) or subfile (popup) widgets. See a sample host screen containing a subfile Figure 10 and the same screen as rendered by the subfile (drop-down) widget in Figure 11.
For more information about subfile support, refer to the HATS User's and Administrator's Guide.


Fields on 5250 host screens can be marked with specific "check" keywords. Check keywords allow the host application to tell the emulator how certain fields need to react to specific key presses (this key is normally "field exit"). For example, when a field is marked as "auto enter", once a user supplies X number of characters into the field (X being the size of the field), the emulator automatically submits the page back to the host application for processing.
The following 5250 check keywords are supported:
A field on a host screen can also be marked to allow only a certain type of input. For example, the user name and password field on a typical IBM i Sign On screen allows only uppercase letters and digits. With this information available, HATS can generate text boxes which, on the client, restrict key presses based on the field type. For example, if a host screen field is marked as "numeric only", only numerals (and other numeric support characters) will be allowed to be entered into the generated text box. This will reduce the chance of the screen becoming locked or being returned to the user with a message they may have never seen before (since most emulators restrict input).
By default, support for all of these field attributes is enabled. To disable client-side numeric value formatting, follow these steps to edit your project settings file:
<setting name="enableCheckAttributes" value="false"/> com.ibm.hats.transform.widgets.FieldWidget com.ibm.hats.transform.widgets.CalendarWidget com.ibm.hats.transform.widgets.InputWidget com.ibm.hats.transform.widgets.PopupWidget com.ibm.hats.transform.widgets.TableWidget
<setting name="enableCheckAttributes" value="false"/> com.ibm.hats.rcp.transform.widgets.SwtComboWidget com.ibm.hats.rcp.transform.widgets.SwtFieldWidget com.ibm.hats.rcp.transform.widgets.SwtInputWidget com.ibm.hats.rcp.transform.widgets.SwtPopupWidget com.ibm.hats.rcp.transform.widgets.SwtTableWidget
By disabling this setting, the user loses support for the following attribute checking:
You can also add these settings manually to any component in your transformations.
For Web applications add the following settings to the component:
<HATS:Component ... widgetSettings="enableCheckAttributes:false| enableInputRestrictions:false"/>
For rich client applications add the following settings to the component:
ComponentRendering rendering1 = new ComponentRendering(this, 0);
...
rendering1.setWidgetSettings(new StringableProperties("enableCheckAttributes:false|
enableInputRestrictions:false"));
For more information about extended field attributes, refer to the HATS User's and Administrator's Guide, the HATS Web Application Programmer's Guide, and the HATS Rich Client Platform Programmer's Guide.
The auto advance function provides the ability to have focus advance automatically to the next input field in the GUI when a user completely fills an input field. With this feature enabled, GUI focus behaves more like how cursor movement behaves in a typical terminal emulator; after a user has completely filled in a field on the host screen, the cursor automatically moves to the beginning of the next field. To enable this feature on every page of your HATS application, in the Project Settings editor, on the Other tab, select Client Settings and select the Enable automatic field advance check box.
For Web applications, you can selectively disable this function for an individual transformation by adding the following lines just after the </HATS:Form> tag in the transformation file. To selectively enable the function specify true instead of false.
<script> autoAdvance = false; </script>
For rich client applications, you can selectively disable this function for an individual transformation by overriding the needsAutoAdvanceSupport method on the individual transformation as shown below. To selectively enable the function return true instead of false.
public boolean needsAutoAdvanceSupport(boolean preferredValue) {
return false;
}
For more information about the auto advance function, see the HATS User's and Administrator's Guide.
ENPTUI enables an enhanced user interface on non-programmable terminals (NPT) and programmable work stations (PWS) over the 5250 full-screen menu-driven interface, taking advantage of 5250 display data stream extensions. These extensions can be also accessed via the DDS programming interface. Graphical DDS keywords specify the GUI controls to be displayed.
HATS recognizes these 5250 display data stream extensions when used, and renders them into appropriate GUI controls. The following subset of graphical DDS keywords are supported:
For more information about ENPTUI support, refer to the HATS User's and Administrator's Guide.
DDS programmers can use the HTML keyword to imbed raw HTML data into the 5250 data stream. HATS will enable data that is sent from a host application in the HTML DDS keyword to be rendered in the browser.
For more information about HTML DDS support, refer to the HATS User's and Administrator's Guide.