IBM WebSphere Host Access Transformation Server (HATS)

Tutorial - Module 3

Customizing HATS Applications

Abstract

This tutorial is designed for anyone who wants to learn how to customize HATS applications.  The tutorial is in the form of a lab exercise to a live publicly available host application. This module will cover some customization steps and how to apply different actions based upon recognized screen events.  This will demonstrate the rules based engine that is part of HATS and how transformations are applied to screens depending upon certain events.

Assumptions / Requirements

It is assumed that the user has already installed WebSphere Studio 4.03 and the HATS Studio software on a supported platform.  The platform requirements were covered in the HATS Tutorial - Module 1. It is also assumed that a network connection can be made to the publicly accessible IBM Demonstration  iSeries host at: Connectivity to this host can be tested by using any TN5250 emulator configured for the settings above. A WebSphere application server that meets the requirements for HATS needs to be available if you want to deploy the HATS application to a production WebSphere server.  It is assumed that you are already familiar with the WebSphere application server console.

Topics covered on this tutorial

Review Basic HATS Application Steps

You can reuse the previously  configured HATS application for Module 2 for this tutorial.  If you have a previously configured HATS application that you want to use from Module 2, then skip to the next section and start from there.  Otherwise follow these steps prior to starting the next section.

1. Launch the HATS Studio

2. From the HATS Welcome page , click on "launch the Create HATS Project Wizard" link.

3. The New Project panel will come up.

4. On the Connection Settings panel  enter the following: 5. The Select Default Template panel 6. When the studio finishes building the project files the HATS Project View will open and you will see the project folders on the left.  Expand the folders and examine the files that the studio build for the project.  You can now go the next section to start customizing the HATS application.
 

Customizing the application

This section will introduce you to the HATS customization wizards. You will customize the Main Menu screen of the OS/400 application so that the selection menu is rendered on the browser page as a button table widget. You will also add an input field to the page and then test by running the application in the test server within WebSphere Studio.

1. With the project highlighted in the HATS Project View, right click and select Open  Terminal from the list. This will open the terminal window. You will now need to enter a user id and password . In the terminal window type in user: user4boats password: password and press the enter key.

2. The next screen should be the OS/400 Main Menu screen or could possibly be a display messages screen.  If the display messages screen appears, press the enter key and the OS/400 Main Menu screen should appear.

3. The OS/400 Main Menu screen is where we will begin the Screen Customizations wizard so we can customize this screen. Notice that this is a menu screen with several choices that can be entered on the command line. You will create a transform JSP that will render the menu as a Selection List - Button Table widget in the next steps and also add an input field for the command line.

4. From the HATS terminal click on the Create HATS Screen Customization wizard.  The Screen Customization Name and Destination panel will open.

5. Specify a name and a description for the new Screen Customization.

6. The Select Screen Recognition Criteria panel will come up with a screen capture of the OS/400 Main Menu screen.  Here is where you will define the screen recognition criteria.

7. Notice that in the Select a screen box is the choices of Use the terminal screen (selected) and a grayed out choice of Use a previously captured screen. HATS Studio has the capability of using previously captured screens to do customizations with.  This is great for working remotely because it allows the application developer to work remotely and do screen customizations without being attached to a network accessing the host application in real time.  You just need to have previously captured the screens with the HATS built in screen capture tool, then customize on an iterative basis later.

8. The Select Actions panel will come up. 9. The project files will be built now.  The OS_400_Main_Menu.jsp file will be built and the Insert Host Component - Screen Region panel should open up now, shown below.  You can sign off the boats application on the iSeriesD host and close the HATS Terminal window now.

10. The Insert Host Component - Screen Region  panel should be open. We want to render the screen menu as a GUI widget on the browser page.

Figure 1. Insert Host Component - Screen Region panel

 

11. The Rendering Option panel will open next, shown below.  From here you select what Rendering Option method to use. As you select different options the Component Preview and Widget Preview panels will change and show you how the component will look on the web page.

Figure 1. Rendering Option panel - Selection list - Button table widget

12. Examine the code added to the JSP, shown below.  Notice that the SelectionListExtract component has been added with the HATS tag on the JSP.

Figure 3. OS_400_Main_Menu.jsp in HTML editor

13. Move the blinking cursor on the OS_400_Main_Menu.jsp so that it is located below the HATS:Component tag on the page.

14. Make this a Input Field - Text Input widget and click on the Full Page Preview button.  Preview the page, then close the Preview page. Click Finish. Then go to File > Save the JSP or CTRL S to save the changes to the JSP. Figure 4. Preview of OS_400_Main_Menu.jsp.

15. Highlight the application in the HATS Project View.

16. After a while the WebSphere Test Server will load in the Server Perspective and then a browser will start to open the URL to the application. When the first page is in the browser go ahead an sign into the application and press the enter key and navigate through the application to see your screen customization changes.

17. The next page should come up with the transformation applied so that the menu is rendered as a button table widget and no keypad showing and the input field is shown at the bottom.

18. You can also test run the HATS application from a browser while the WebSphere Test Server is running the application in the WebSphere Studio.  Simply copy the URL from the browser in the WebSphere Test Server and then open a browser outside WebSphere Studio and then paste the URL into the browser and press the enter key.  The entry servlet for the application should load after a bit and you should see the first screen of the application in the browser and you can work with the application from here.  This way you can view the application like a web user would see the application running on WebSphere.

19. Summary - the above section has stepped you through generating a screen customization and generating a transformation for one screen that had a menu and input field host component, from which you rendered these as a Selection List - Button Table and an Input field for the web page.  These steps have demonstrated to the developer the steps necessary to customize screens.  These steps can be applied in a similar manner and used to build other screen customizations and transformations for host screens that the developer might want to customize.

Screen Customization Events and Actions

1. Now we will look at the screen customization pages for the screen customization we just did in the previous steps.  We will also examine what further customizations might be done for a  specific screen event in the next section.

2. In the HATS Project View, expand the Screen Customizations folder.  You should see the OS_400_Main_Menu screen customization.  Double click on it which will open OS_400_Main_Menu.evnt and present you with the Overview page.

3. The Overview page - This page displays basic summary information for this event. Notice on the left under Actions that only the "Apply transformations" is Yes and all other actions are No.  Notice the Screen Recognition Criteria section

4. At the very bottom notice that you have several tabs besides the Overview page

5. We will take a look at the Screen Recognition Criteria page now. 6. Screen Recognition Criteria  - You should see the screen recognition information for the screen already in the table in the center. You could use the Add button on the left to add new screen recognition criteria if needed from this page. Leave the screen recognition criteria as is and click on the Actions tab.

7. Actions - On this page you can specify which actions to perform when this OS_400_Main_Menu screen "event" occurs. Currently the only action type specified is "Apply a transformation" . This will apply the OS_400_Main_Menu.jsp using a default template that we have chosen for the project. You could add other Actions for this event by clicking on the Add button.  We will examine actions further in the next section.  Click on Source tab.

8. The Source page shows you the actual XML configuration source for the screen customization for OS_400_Main_Menu. Notice that the type of event is type="screenRecognize". Actions are to apply a transformation of "OS_400_Main_Menu.jsp" and the description of the screen is shown.

9. Keep the Screen Customizations pages open and go to the next section.

Actions and Rules Sets for Screen Recognition Events

In the following section you will examine the type of actions that are possible for a specific screen recognition event.  This is key to the use of the HATS rules based engine.  This is where rule sets can be applied based on specific screen recognition events.

1. Go back to the Actions page and click on the Add button.  With the Action drop down list box, select each one of the choices and look at what specific actions  are available to be applied for this screen event.  Look at the actions below for each panel.

2. Action - Apply Transformation

3. Action - Execute Business Logic 4. Action - Extract Global Variable 5. Action - Insert Global Variable 6. Action - Set Global Variable 7. Action - Show URL

Conclusion

In this tutorial you were shown how to use the screen customization wizard to transform a screen to use a widget based upon a menu host component, and also added an input field for the same page.

The next tutorial (Module 4) will be a lab exercise using a macros as an action when a screen recognition event occurs.

Copyright:  Licensed Materials - Property of IBM
             (C) Copyright IBM Corp. 2002  All rights reserved.
             U.S. Government Users Restricted Rights -
             Use, duplication or disclosure restricted by
             GSA ADP Schedule Contract with IBM Corp.