Sample Program - C# ASP.NET Server (AutoHTML)

 

AutoHTML server application demonstrates how to quickly convert IBM S/390 and AS/400 applications into web applications through PASSPORT Host Integration Objects. PASSPORT Host Integration Objects plays the role of a server component, which provides access to host applications using 3270/5250 to HTML conversion. ASP.NET web page is easily embedded into the converted HTML with customization of each host screen. After the AutoHTML web server application is published, a user can interact with the 3270/5250 application through a web browser, such as Internet Explorer, Firefox or Google Chrome. Also, the administrator can manage/monitor the host sessions.

 

hioapp.jpg

 

Step 1: Browser accesses HIO AutoHTML host application

Step 2: HIO AutoHTML Server starts host session

Step 3: Host sends screen to AutoHTML Server

Step 4: AutoHTML Server transmits HTML page to browser

 

Communication file

Communication settings are stored in the Zephyr Communication Configuration (.ZCC) file. For more information, refer to the Configuration File page.

 

You must change the web.config file if you wish to use a different .zcc file:

<appSettings>

<!--

    Define the location of a configuration file.  

-->

<add key="MyProfile" value=".\zcc\Default_3270.zcc"/>

:

:

</appSettings>

 

Hotspot Files

A hotspot is an area of the HTML screen on which you can click the left mouse button to execute a command or function. In AutoHTML, hotspots can be presented in two different ways: buttons or links. There are three default hotspot files provided with AutoHTML installation:

You need to modify the .zcc file and add the hotspot parameter to enable hotspots:

 

Hotspot = Demo_Custom

 

Please note that the file extension should not be included in the above parameter.

 

You can also create your own custom hotspot file. The .zhs file must adhere to the following specifications. It is an ASCII file and each line in this file corresponds to a hotspot definition. The format of each line is as follows:

 

type,*,*,parm1,parm2,parm3

0 = convert to button

1 = convert to link

2 = insert custom HTML

Some examples of how you may customize your hotspot file are below:

Below are the host AID keys being used by AutoHTML:

3270/5250 Keys

Description

zep_ATTN

Sends a signal command to the host computer. The Attention key is used as a break key to interrupt the host execution of the current program.

zep_CLEAR

Erases the display and signals the host system that a clear action occurred.

zep_CRSRSEL

This key is used to indicate that a cursor select action has taken place in the chosen field. The '?' character changes to the '>' character. This key is used in light pen emulation.

zep_ENTER

Enter key for the host computer. Transmits information to the host.

zep_PA1- zep_PA3

Program Attention keys.

zep_PF1- zep_PF24

Program Function keys.

zep_ROLLDOWN **

Asks the host system to roll the information on the display by issuing an aid code hex F4. This performs a page down action.

zep_ROLLUP **

Asks the host system to roll the information on the display by issuing an aid code hex F5. This performs a page up action.

zep_REFRESH

 

zep_SYSREQ

This key switches your program from a LU-LU session to a SSCP-LU session.

zep_TESTREQ **

Used to perform additional tests of the system.

 

JavaScript File

AutoHTML session uses a JavaScript file (default.js) to control all keyboard mappings. Below are the JavaScript functions included in the default.js file:

 

submitHandler

fnTrapKeyDown

fnMoveFocus

fnSetCursorPos

fnUppercase

clickLink

fnCursorSel

fnCompStringWithCRLF

closeIt

 

This file is located in the AutoHTML Server folder. You may use a text editor to view for additional information on these functions.

 

It is referenced within <head> tag in the Default.aspx:

<head id="Head1" runat="server">

<title>Zephyr AutoHTML Session</title>

<link rel="Stylesheet" href="App_Themes/Theme_default/Default.css" type="text/css" media="screen" />

<script type="text/javascript" src="Default.js" language="javascript"></script>

:

:

<head>

 

Keyboard Map

Host Function

PC Key Combination

ATTENTION

Esc

CLEAR

Pause/Break

ENTER

Enter/Keypad Enter

PA1

Shift + Insert

PA2

Shift + Home

PA3

Shift + Page Up

PF1

F1

PF2

F2

PF3

F3

PF4

F4

PF5

F5

PF6

F6

PF7

F7

PF8

F8

PF9

F9

PF10

F10

PF11

F11

PF12

F12

PF13

Shift +F1

PF14

Shift +F2

PF15

Shift +F3

PF16

Shift +F4

PF17

Shift +F5

PF18

Shift +F6

PF19

Shift +F7

PF20

Shift +F8

PF21

Shift +F9

PF22

Shift +F10

PF23

Shift +F11

PF24

Shift +F12

ROLL DOWN **

Page Down

ROLL UP **

Page Up

SYSTEM REQUEST

Shift + Esc

TEST REQUEST **

Alt + Pause

 

Style Sheet File

AutoHTML uses CSS style sheets to control the appearance of its HTML pages. The foreground color, background color, and font attributes for 4 types of fields, protected normal, protected high intensity, unprotected normal and unprotected high intensity can all be changed to alter your application look and feel. You can select the default style sheet (.css) that comes with installing the AutoHTML application such as Default.css, etc. or you can create your own using the format below.

 

Here is a sample .css file that may be edited with Notepad or any text editor:

 

image1.gif

 

#u0 = unprotected normal

#u1 = unprotected high intensity

#p0 = protected normal

#p1 = protected high intensity

 

You may change the color, font style, and font size of these fields and apply the changes to your AutoHTML or custom host application. The .css files are located in <serverlocation>\App_Themes\Theme_Default\ for your AutoHTML sessions.

 

It is referenced within the <head> tag in the Default.aspx:

<head id="Head1" runat="server">

<title>Zephyr AutoHTML Session</title>

<link rel="Stylesheet" href="App_Themes/Theme_default/Default.css" type="text/css" media="screen" />

:

:

<head>

Note: the Admin.css style sheet file is used by the Admin page only.

 

Web.config File

There are several parameters defined in this configuration file, which is located in the C:\Program Files\PASSPORT Host Integration Objects\DotNetServers\AutoHTML folder by default:

<appSettings>

<!--

Define the location of a configuration file.  

-->

<add key="MyProfile" value=".\zcc\Default_3270.zcc"/>

<!--

Wait_timeout: Maxmium time to wait after an AID key

Wait_quiet: The time out for check X condition

-->

<add key="Wait_timeout" value="10000"/>

<add key="Wait_quiet" value="500"/>

<!--

For the first screen, these three parameters were used to wait for data stream completion

CheckScreenText: if it needs to check the screen text false/true

TextPosition: the start position of the text;

TextToWait: the string to wait for

-->

<add key="CheckScreenText" value="false"/>

<add key="TextPosition" value="0"/>

<add key="TextToWait" value=""/>

</appSettings>

 

Requirements

The sample application requires the following in order to run:

How to install IIS and ASP.NET on Windows Server 2008

IIS and ASP.NET are not enabled by default when you install Windows Server 2008. Follow the steps below to enable these:

  1. Click Start->Administrative Tools and open Server Manager.

  2. In the right pane of Server Manager, expand the Roles Summary section and then click Add Roles.

  3. In the Add Roles Wizard, select the Web Server (IIS) check box and then click Next.

  4. In the Role Services step of the Wizard, select the Application Development role service, and then select the ASP.NET check box.

  5. Complete the wizard to install the software.

How to install the Sample Application

  1. Open IIS Manager from the Server Manager or click Start > Administrative Tools > Internet Information Services (IIS) Manager.

  2. On the Connections pane, expand the server node, right-click Default Web Site and then click Add Application.

  3. In the Add Application dialog, set Alias to “AutoHTML”. Navigate to the physical path of the AutoHTML directory (PASSPORT Host Integration Objects\DotNetServers\AutoHTML\ by default). Select an application pool for the application and then click OK.

  4. If you are using the 64-bit version of Windows Server, you will need to enable a 32-bit Application Pool in IIS. On the Connections pane, click "Application Pools". Right-click your application pool and select "Advanced Settings...". Change "Enable 32-bit Application" to True.

How to Run the Sample Application

Open a browser window/tab and navigate to http://<servername>/autohtml/default.aspx to see the AutoHTML host screen. Note that the .zcc configuration file may be edited to connect to a different host. By default this file is located in the C:\Program Files\PASSPORT Host Integration Objects\DotNetServers\AutoHTML\zcc\ folder and is called Default_3270.zcc. Also, this file is specified in the web.config file.

 

Open a browser window/tab and navigate to http://<servername>/autohtml/admin.aspx to monitor/manage the host sessions created by clients.
 

Note: for additional information regarding HIO sample applications, please refer to the following page on the Zephyr website:

 

http://www.zephyrcorp.com/legacy-integration/host-integration-objects-more.htm