Tandem Connect User's Guide

CHAPTER 2

Getting Started with the Tandem Component Editor

 
Top of page

Steps Commonly Used to Create a Tandem Component

While there are many ways to go about creating Tandem Components, the most commonly used steps in creating a simple Tandem Component are as follows:

In this chapter, we'll focus on the first two steps: creating XML Templates and creating and a configuring a Tandem Connection Resource, which is an essential first step in being able to use Tandem Components.

 
Top of page

Creating XML Templates for Your Component

Although it is not strictly necessary to do so, your Tandem Component may require you to create 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 Tandem 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 Tandem 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:   Your component design may call for any other xObject resources, such as custom scripts or Code Table maps. If so, it is best to create these before creating the Tandem Component. For more information, see the exteNd Composer User's Guide.

 
Top of page

Creating a Tandem Connection Resource

Once you have the XML templates in place, your next step will be to create a Connection Resource to access the host program. If you try to create a Tandem 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.

 
Top of page

About Connection Resources

When you create a Connection Resource for the Tandem Component, you will have two choices: a straight "Tandem Connection" and a "Tandem Logon Connection." Generally speaking, you will use the straight Tandem Connection to connect to your host environment. The Logon Connection is used for connection pooling, which will be explained in greater detail in Chapter 6 of this Guide.

You will use a live Tandem 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 Tandem Components that might require a connection to the host in question.

Procedure To create a Tandem Connection Resource:

  1. From the Composer File menu, select New>xObject, then open the Resource tab and select Tandem Connection.

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

    The Create a New Connection Resource Wizard appears.

    newconnectionresourcep27

  2. Type a Name for the connection object.

  3. Optionally, type Description text.

  4. Click Next. The second panel of the wizard appears.

    dummyConnectionResource

  5. Select the Tandem Connection type from the pulldown menu. The dialog changes appearance to show just the fields necessary for creating the Tandem connection.

  6. In the Host or IP Address field, enter the physical (IP) address or hostname alias for the machine to which you are connecting.

  7. In the Telnet Port field, enter the number of the TCP/IP port. The default port number is 23.

  8. In the Code Page field, specify a code page (See "Code Page Support" on page -17.

  9. 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 under "Native Environment Pane Context Menu" on page 30).

  10. Check Autowrap Characters if you want the cursor to move to the first position of the next line as soon as the cursor reaches the end of the line.

  11. Check 8-bit Data Characters if the communicated data is in 8-bit character format. For 7-bit characters, uncheck this option and the 8th bit will be truncated.

  12. Check Backspace Send Delete if you want the Backspace key to send a delete. If not checked, it sends a backspace.

  13. Check Terminal New Line if the ENTER key should generate a carriage return/line feed combination.

  14. Check the Default check box if you'd like this particular Tandem connection to become the default connection for subsequent Tandem Components.

  15. Click Finish. The newly created resource connection object appears in the Composer Connection Resource detail pane. 

 
Top of section

Code Page Support

Code Page support in exteNd Composer Connection Resources allows 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.

 
Top of page

About Constant and Expression Driven Connections

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 Tandem 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.

Procedure To switch a parameter from Constant-driven to Expression-driven:

  1. Click the right mouse button in the parameter field you are interested in changing.

  2. Select Expression from the context menu and the editor button will appear or become enabled. See below.

    dummyExprConnectionResource

  3. Click on the Expression Editor button. The Expression Editor appears.

    ExpressionEd

  4. 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.




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