Telnet Connect User's Guide

CHAPTER 3

Creating a Telnet Component

 
Top of page

Before Creating a Telnet Component

As with all exteNd Composer components, the first step in creating a Telnet component—assuming a Connection Resource is available—is to prepare any XML templates needed by the component. (For more information, see "Creating a New XML Template" in the Composer User's Guide.)

Once you've specified the XML templates, you can create a component, using the template's sample documents to represent the inputs and outputs processed by your component.

Also, as part of the process of creating a Telnet component, you must specify a Telnet connection for use with the component (or you can create a new one). See the previous chapter for information on creating Telnet Connection Resources.

Procedure To create a new Telnet Component:

  1. Select File>New>xObject. Open the Component tab and select Telnet Terminal.

    NOTE:   Alternatively, under Component in the Composer window category pane you can highlight Telnet Terminal, click the right mouse button, then select New.

  2. The "Create a New Telnet Component" Wizard appears.

    CreateNewComponent1

  3. Enter a Name for the new Telnet Component.

  4. Optionally, type Description text.

  5. Click Next. The XML Input/Output Property Info pane of the New Telnet Component Wizard appears.

    newTelnetcomponent

  6. Specify the Input and Output templates as follows.

  7. Select an XML template for use as an Output DOM using the same steps outlined above.

    NOTE:   You can specify an input or output XML template that contains no structure by selecting {System}{ANY} as the Input or Output template. For more information, see "Creating an Output DOM without Using a Template" in the User's Guide.

  8. Click Next. The Temp and Fault XML Template panel appears.

    NewTelnetCompTF

  9. If desired, specify a template to be used as a scratchpad under the "Temp Message" pane of the dialog window. This can be useful if you need a place to hold values that will only be used temporarily during the execution of your component or are for reference only. Select a Template Category if it is different than the default category. Then select a Template Name from the list of XML templates in the selected Template Category.

  10. Under the "Fault Message" pane, select an XML template to be used to pass back to clients when an error condition occurs.

  11. As above, to add additional input XML templates, click Add and choose a Template Category and Template Name for each. Repeat as many times as desired. To remove an input XML template, select an entry and click Delete.

  12. Click Next. The Connection Info panel of the Create a New Telnet Component Wizard appears.

    newtelnetcomp27

  13. Select a Connection name from the pulldown list. For more information on the Telnet Connection, see "Creating a Connection Resource" in Chapter 2 of this Guide.

  14. Click Finish. The component is created and the Telnet Component Editor appears.

 
Top of page

About the Telnet Component Editor Window

The Telnet Component Editor includes all the functionality of exteNd Composer's XML Map Component Editor. For example, it contains mapping panes for Input and Output XML documents as well as an Action pane.

There is one main difference, however. The Telnet Component Editor also includes a Native Environment Pane featuring a Telnet emulator. This screen appears black until you either click the Connection icon in the main toolbar or begin recording by clicking the Record button in the toolbar. Either action establishes a Telnet emulation session inside the Native Environment Pane with the host that you specified in the connection resource used by this Telnet component.

 
Top of page

About the Telnet Native Environment Pane

The Telnet Native Environment Pane provides Telnet emulation of your host environment. From this pane, you can execute a Telnet session in real time, interacting with the Native Environment Pane exactly as you would with the screen on a "dumb terminal." You can also do the following:

 
Top of page

About Telnet Keyboard Support

The Telnet Native Environment Pane supports the use of numerous special terminal keys. The Terminal Keypad dialog (see below) is comprised of four Tabs: Common Keys, NumPad Keys, Control Keys and Other Keys. Each Tab contains a group of keys with specific functionality.

Note that you can also achieve the use of additional keys (such as F13 through F20) by using the picklists in the Expression Builder dialog, Function/Methods column, under Telnet > Keys.

Procedure How to Use the Floating Keypad:

  1. Select View/Terminal Keypad from the Composer Menu. A floating Keypad appears. The Keypad window contains a series of tabs, including the following: Common Keys, NumPad Keys, Control Keys and Other Keys.

  2. Click on the appropriate Tab to display the keys you wish to view on the Terminal Keypad.

  3. Click on the key you wish to invoke. If you require help, hover the mouse over that key. Help will display the Telnet keyboard equivalent for that key. You will see the result of the key you clicked in the Native Environment Pane.

  4. Click OK to close the keypad. In order for the keypad to redisplay, you must repeat step 1. When you display the keypad, you will return to the last Tab that you were using.

The following pages illustrate the four Tabs and corresponding keys that can be used to interact with Telnet.

Common Keys: Includes directional keys, (Arrow Down, Arrow Left, Arrow Right, Arrow Up, BackSpace, BackTab) as well as Delete, Escape, Linefeed, Return, and Tab. The function keys, F1 through F20, are also displayed.

keyboardcommonkeys

NumPad Keys: Includes the digits 0-9, Minus, Comma, Period and Enter keys.

keyboardnumkeys

Control Keys: Includes 32 keys associated with specific functions. Refer to Appendix B for a complete listing.

keyboardcontrolkeys

Other Keys: Includes keys to perform common functions for example: the Help key.

keyboardotherkeys

NOTE:   The complete list of special (non-printing) keys and their ANSI equivalents is shown in Appendix B.

 
Top of page

About the Screen Object

The Screen Object is a byte-array representation of the emulator screen shown in the Native Environment Pane, with methods for manipulating the screen contents.

 
Top of section

What it is

The Telnet component communicates with the host environment via a character-mode terminal data stream, in a Telnet session. The user sends data to the host in the form of keystrokes (or XML data mapped to cursor prompts). The host, in turn, sends the terminal a stream of data which may contain anything from a single byte to a whole screen's worth of information. The Screen Object represents the current screen's worth of data. For a 24 x 80 ANSI terminal screen, this is 1,920 bytes of data.

 
Top of section

How it works

When character data arrive from the host, appropriate updates to the Native Environment Pane occur in real time. Those updates might be anything from a simple cursor repositioning to a complete repaint of the terminal screen. The screen content is, in this sense, highly dynamic.

When you have signaled exteNd Composer (via a Check Screen action) that you wish to operate on the current screen's contents, the screen buffer is packaged into a Screen Object that is made accessible to your component through ECMAScript.

Many times, it is not necessary for your component to "know" or understand the complete screen contents prior to sending keystrokes back to the host or prior to mapping data into a prompt. But when mapping outbound from the screen to a DOM, it can be useful to have programmatic access to the Screen Object. To make this possible, the Connect for Telnet defines a number of ECMAScript extensions for manipulating screen contents. These extensions are described in further detail in the next chapter. For now, a simple example will suffice. Suppose you are interested in obtaining a string value that occurs on the screen in row 5 at column position 20. If the string is 10 characters long, you could obtain its value by using the following ECMAScript expression as the Source in a Map action (with an output DOM or temp DOM as the Target):


Screen.getTextAt( 5, 20, 10 )


The 10 characters beginning at row 5, column 20 on the screen would be mapped to the Target of the Map action.

For more examples (and complete API documentation for the Screen object), see the section on "Telnet-Specific Expression Builder Extensions" on page -36 in the next chapter.

 
Top of page

About Telnet-Specific Menu Bar Items

 
Top of section

Component Menu

Start/Stop Recording—This menu option manages the automatic creation of actions as you interact with a host program. Start will enable the automatic creation of actions as you interact with the screen and Stop will end action creation.

Connect/Disconnect—This menu option allows you to control the connection to the host. When you are recording or animating, a connection is automatically established (and consequently, the connection icon is shown in the "connected/disabled" state). However, this button is useful if you are not recording and you merely want to establish a connection for the purpose of navigating the Telnet environment.

 
Top of page

About Telnet-Specific Context-Menu Items

The Telnet Connect also includes context-menu items that are specific to this Connect. To view the context menu, place your cursor in the appropriate pane (Native Environment or Action) and click the right mouse button.

 
Top of section

Native Environment Pane Context Menu

When you right-mouse-click in the Native Environment Pane, you will see a contextual menu. The menu items will be greyed out if you are not in record mode. In record mode, the context menu has the following appearance:

NEPContextMenu

The four commands work as follows:

Send Buffer: USERID—Automatically sends User ID information to the host, based on the value you supplied (if any) for User ID in the Telnet Connection Resource for this component. Also creates the corresponding Send Buffer action in the Action Model.

Send Buffer: PASSWORD—Automically transmits Password information to the host, based on the Password you supplied (if any) in the Telnet Connection Resource for this component. Also creates the corresponding Send Buffer action in the Action Model.

Send Buffer—Brings up the Send Buffer dialog, allowing you to create a new Send Buffer Action. (See the next chapter for a detailed discussion of the use of this command.)

Check Screen—Creates a new Check Screen action without bringing up a dialog (same as a click on the Create Check Screen button in the toolbar).

 
Top of section

Action Pane Context Menu

If you click the right mouse button when the mouse is located anywhere in the Action pane, a context menu appears as shown.

TelnetContextMenu

The function of the context menu items are as follows:

Send Buffer—Allows you to create a Send Buffer action. The Send Buffer Action dialog will appear, allowing you to enter text and/or control-key commands that will be sent to the Telnet host application. (This dialog will also let you enter an ECMAScript expression, or an XPath fragment representing the location of string data in your input DOM.) See the next chapter for a detailed discussion of the use of this command.

Check Screen—This command allows you to create a new Check Screen action (to sync the component with the host). A dialog appears, allowing you to specify various go-ahead criteria as well as a Timeout value. See the next chapter for a detailed discussion of the Check Screen action.

 
Top of page

About Telnet-Specific Buttons

The Telnet Connect includes a number of Connect-specific tool icons (and/or icons with Connect-specific functionality) on the component editor's main toolbar. They appear as shown below.

Record Button

recording defaultRecord icon (normal state)


recordingRecord icon (recording in progress)


recording disabledRecord icon (disabled)



The Record button allows you to capture keyboard and screen manipulations as you interact with the Native Environment Pane. Recorded operations are placed in the Action Model as actions, which you can then "play back" during testing.

Connection Button

Connection (disconnected state)TelnetDisconnectOn


connectedConnection (connected state)


TelnetDisconnectOffConnection (connected/disabled state)


The Connection button on Composer's main toolbar toggles the connection state of the component (using settings you provided during the creation of the Connection Resource associated with the component).

NOTE:   When you are recording or animating, a connection is automatically established, in which case the button will be shown in the "connected/disabled" state. When you turn off recording, the connection the button will return to the enabled state.

Create Check Screen Button

checkscreenThe Create Check Screen button on Composer's main toolbar should be clicked before the first user interaction with any given terminal screen. This signals exteNd Composer that you intend to work with the screen data as currently shown in the Native Environment Pane. Clicking this button causes a new Check Screen Action to be inserted into the Action Model. (See the next chapter for a detailed discussion of this action type.)




Copyright © 2003 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...