![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Telnet Connect User's Guide
CHAPTER 2
While there are many ways to go about creating Telnet Components, the most commonly used steps in creating a simple Telnet Component are as follows:
Enter Record mode and navigate to the program using terminal emulation available via the component editor's Native Environment Pane.
Drag and drop input-document data into the screen as needed.
In this chapter, we'll focus on creating and a configuring a Telnet Connection Resource, which is an essential first step in being able to use Telnet Components.
Before you can create a Telnet Component, you need to create a Connection Resource to access the host program. If you try to create a Telnet Component in the absence of any available Connection Resources, a dialog will appear, asking if you wish to create a Connection Resource. By answering Yes to this dialog, you will be taken to the appropriate wizard.
When you create a Connection Resource for the Telnet Component, you will use a live Telnet Connection to connect to a host environment of your choice. After setting up your Connection Resource, it will be available for use by any number of Telnet Components that might require a connection to the host in question.
You can specify Connection parameter values in one of two ways: as Constants or as Expressions. A constant-based parameter uses the static value you supply in the Connection dialog every time the Connection is used. An expression-based parameter allows you to set the value in question using a programmatic expression (that is, an ECMAScript expression), which can result in a different value each time the connection is used at runtime. This allows the Connection's behavior to be flexible and vary based on runtime conditions.
For instance, one very simple use of an expression-driven parameter in a Telnet Connection would be to define the User ID and Password as PROJECT Variables (e.g.: PROJECT.XPath("USERCONFIG/MyDeployUser"). This way, when you deploy the project, you can update the PROJECT Variables in the Deployment Wizard to values appropriate for the final deployment environment. At the other extreme, you could have a custom script that queries a Java business object in the Application Server to determine what User ID and Password to use.
To switch a parameter from Constant-driven to Expression-driven:
Click the right mouse button in the parameter field you are interested in changing.
Select Expression from the context menu and the editor button will appear or become enabled. See below.
Click on the Expression Editor button. The Expression Editor appears.
Create an expression (optionally using the pick lists in the upper portion of the window) that evaluates to a valid parameter value at runtime. Click OK.
To create a Telnet Connection Resource:
From the Composer File menu, select New>xObject, then open the Resource tab and select Connection.
NOTE: Alternatively, you can highlight Connection in the Composer window category pane, click the right mouse button, then select New.
Select the Telnet Connection type from the pulldown menu. Dialog changes appearance to show just the fields necessary for creating the Telnet connection.
In the Host or IP Address field, enter the physical (IP) address or hostname alias for the machine to which you are connecting.
In the Port field, enter the number of the Telnet port. The default port number is 23.
In the Terminal Type field, enter the type of terminal you wish to specify when handshaking with the host. Select one of the values in the pulldown menu (currently VT100, VT220, or VT320) or manually enter another terminal type. Use lowercase letters "vt" (as in vt132) when entering a value manually.
NOTE: Some hosts may not let you log on as a "VT220" (or whatever). If you know the kind of terminal(s) the host recognizes, you can enter an acceptable value in this space to "spoof" the host into handshaking successfully.
In the Code Page field, specify a code page (See "About Code Page Support on page 19."
Enter a UserID and Password. These are not actually submitted to the host during the establishment of a connection. They are simply defined here. (The Password is encrypted.) Right-mouse-click and choose Expression if you want to make these fields expression-driven. See discussion further above.
NOTE: After you've entered UserID and Password info in this dialog, the ECMAScript global variables USERID and PASSWORD will point to these values. You can then use these globals in Send Buffer expressions (or as described in "Native Environment Pane Context Menu" on page -25).
Click the Default check box if you'd like this particular Telnet connection to become the default connection for subsequent Telnet Components.
Click Finish. The newly created resource connection object appears in the Composer Connection Resource detail pane.
Code Page support in exteNd Composer Connection Resources allow you to specify which Character Encoding scheme to use when translating characters sent between exteNd Composer and other host systems. exteNd Composer data uses Unicode character encoding (the Java and XML standard). Existing legacy and other host systems use a variety of character encoding schemes (i.e., Code Pages) specific for their language or usage. A mechanism is needed to translate the character encoding between these systems if they are to communicate with one another. This is handled in exteNd Composer by specifying the Code Page used by a host system in the Connection Resource.
In addition to a connection resource, a Telnet Component may also require that you have already created XML templates so that you have sample documents for designing your component. (For more information, see Chapter 5, "Creating XML Templates," in the exteNd Composer User's Guide.)
In many cases, your input documents will be designed to contain data that a terminal operator might type into the program interactively. Likewise, the output documents are designed to receive data returned to the screen as a result of the operator's input. For example, in a typical business scenario, a terminal operator may receive a phone request from a customer interested in the price or availability of an item. The operator would typically query the host system via "dumb terminal" in a Telnet session by entering information (such as a part number) into a terminal when prompted. A short time later, the host responds by returning data to the terminal screen, and the operator relays this information to the customer. This session could be carried out by an exteNd Composer Web Service that uses a Telnet Component. The part number (arriving via HTTP) might be represented as a data element in an XML input document. The looked-up data returned from the host would appear in the component's output document. That data might in turn be output to a web page, or sent to another business process as XML, etc.
NOTE: If your component design calls for any other xObject resources, such as custom scripts or Code Table maps, it is best to create these before creating the Telnet Component. For more information, see the exteNd Composer User's Guide.
Copyright © 2003 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved. more ...