How To Guide - Scripting

BlueZone Web-to-Host

How To Use Object Tag Parameters to Insert Variables Into a Script

Script Variables: Click here to learn more about this feature

BlueZone Scripts can accept variables which can be passed to BlueZone through Object Tag Parameters.  Up to 9 variables per BlueZone session may be specified starting with Var1 and ending with Var9. These variables can be inserted into the Object Tag dynamically based on the End User’s login information. Technologies such as Active Server Pages (ASP) and Java Server Pages (JSP) can be used to create HTML pages with dynamic content.

Configuration Method: Manual Configuration

Feature Scope: Site Level Feature


Click here to learn about BlueZone and ASP Integration

Scope

The following exercise will show you how to record a BlueZone script that can be used to automatically log an End User into a host by using two variables, one for Username and one for Password.

In the following exercise, file references will be for BlueZone Mainframe. If you are using BlueZone iSeries or BlueZone VT, substitute the appropriate file names and locations.

The steps involved are:

It is the responsibility of the reader to provide an Active Server Page script or some other method that will provide the dynamic interface to the web page that contains the BlueZone Object Tag.

Requirements

Procedure

Record the BlueZone Login Script
  1. Launch a BlueZone Mainframe or iSeries Display session.

  2. To record a BlueZone Script, select Script:Record from the BlueZone MenuBar. A dialog box will appear prompting you to enter a name for the script.  BlueZone scripts have a .bzs extension. Name the script login.

  3. Click the Save button. This will start the recording process. Record the login script by “logging in” to your host. Use any valid Username and Password which will allow you to to complete the login process.  (Don't worry... the Username and Password used to create the login script will be deleted from the script later).

  4. When the host login process is complete, end the recording of the script by selecting Script:Stop from the BlueZone MenuBar.

Configure BlueZone to Automatically Play the Script
  1. Set the script to “Auto-Play on Connect” using the settings in the Script:Properties dialog. This setting will cause the script to automatically execute after the connection to the host system is established. The BlueZone Web-to-Host Control Module, will know where to find the script on the End User’s workstation, so no path information should be included, just the name of the script login.bzs.

  2. After the above changes have been made to the BlueZone configuration, save the configuration to a file by selecting File:Save As from the BlueZone MenuBar.  Copy this file into the appropriate BlueZone directory (like bz3270 for example) on your web server so it will be included in the download when users connect.

  3. Run eZClear and launch a BlueZone session to verify the proper operation of your login script.  A Script Status dialog will appear to show which script command is being executed.  If you wish, the Script Status dialog may be disabled by unchecking the “Display Script Status Window” checkbox in the Script:Properties dialog.

Use BlueZone Script Editor to Insert Variables Into Your Script

Once you have tested the script and it is working properly, use the BlueZone Script Editor to modify the script by substituting the appropriate variables for the User ID and Password that were recorded in the login script.

  1. Launch BlueZone Script Editor by selecting Script:Edit from the BlueZone MenuBar.  Choose login.bzs from the file selection dialog and click the Open button.  The BlueZone Script Editor will launch, and your script will be displayed in the left hand panel of the editor.

  2. Note that all the recorded events are shown in the script as well as the Wait_Ready # values used to determine when to send the next AID key.

  3. Edit your Username by double clicking on Type “TestUser” (or whatever value you used), and replacing the value with Var1.

  4. Click the OK button.

  5. Using the same technique as above, edit your Password by double clicking on Type “************”, and replacing the value with Var2, and click the OK button.

  6. Save the script by selecting File:Save from the Script Editor MenuBar. Your edited script will look something like this:

Add Variables to the BlueZone Object Tag
  1. Edit your Object Tag by adding the two lines shown in red below.  In the following example, the Username for Var1 is “TestUser” and the Password for Var2 is “TestPassword”.  You must substitute the Username and Password values shown below with actual working values or else the script will not be able to successfully log on to your host.

The following example is a standard Object Tag with the addition of the Var1 an Var2 parameters shown in red.

<OBJECT ID="Seagull Web-to-Host Control Module v3"CLASSID="clsid:037790A6-1576-11D6-903D-00105AABADD3"
CODEBASE="../sglw2hcm.ocx#Version=-1,-1,-1,-1" HEIGHT=0 WIDTH=0>
<PARAM NAME="IniFile"VALUE="default.ini">
<PARAM NAME="Sessions" VALUE="MD_S1">
<PARAM NAME="MD_DistFile"VALUE="display.e3d">
<PARAM NAME="MD_S1" VALUE="mfdisp1.zmd">
<PARAM NAME="MD_S1_Save" VALUE="Yes">
<PARAM NAME="MD_S1_Var1" VALUE="TestUser">
<PARAM NAME="MD_S1_Var2" VALUE="TestPassword">

 

CAUTION! All of the Object Tag values are in clear text, therefore it is advisable to use HTTPS sessions when passing variables like usernames and passwords.

Make the Script Available to Your End Users
  1. The script file must now be made available to all End Users. Copy or upload the login.bzs file that you created and saved on your local workstation, to the BlueZone Product Folder on your web server.

  2. Update the BlueZone Distribution File. The Web-to-Host Control Module must be made aware that a new or updated file is to be made available to the End Users. This is accomplished by using the BlueZone Version Control Feature.  You must modify the Distribution File specified in the Object Tag.

  3. On the Web Server go to the bz3270 folder and find display.e3d file, and open it with Notepad. This example shows a new configuration file being updated, mfdisp1.zmd, and the login script (login.bzs) being added.

  4. Update the version value of mfdisp1.zmd by changing the ,1 to a ,2 (or the next higher number).

  5. Add login.bzs,1. Later, if the login.bzs script is updated, the version number should be incremented accordingly.

Default Distribution File - display.e3d

bzmd.cab,1
mfdisp1.zmd,1
seaglapl.ttf,1
../seagull.saf,1

 

Modified Distribution File - display.e3d showing changes in red

bzmd.cab,1
mfdisp1.zmd,2
seaglapl.ttf,1
../seagull.saf,1
login.bzs,1

 

  1. Test Access the web page containing the Object Tag that includes the variables.  BlueZone should launch, connect, run the script, and log the user in with values contained in the Object Tag.

Congratulations! You have successfully created a BlueZone Script with variables and used it to automatically log an End User into a host.


Related Tasks:

BlueZone and ASP Integration