iTP Active Transaction Pages (iTP ATP) Programmer's Guide
ATP Web Page and Script Structure
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide—522292-002
3-10
Using NonStop TUXEDO Servers from JavaScript
Displaying the Results
As in the NonStop SQL example, to display the results of the previous transaction, the
script (/examples/pathway/homebank/Webpages/address.atp)
implements a read operation. In this case, the script creates new atp.dictionary
and atp.buffer objects and calls the send_to_server function to send the new
buffer. Upon return from send_to_server, the script checks for a message in the
reply buffer and prints the message if there is one.
To display the form containing the results, the script uses the getData method applied
to the reply buffer object (which is the reply property of the request buffer object).
Using NonStop TUXEDO Servers from JavaScript
The directories called tuxedo and tuxedo_tools within the ATP examples
directory contains many examples that illustrate TUXEDO script structure. The file
/examples/tuxedo/bankapp/transfer.atp shows two external data sources
being used from the same web page:
•
An SQL object accesses a NonStop SQL database to display a form that represents
the first few accounts from the bankapp ACCOUNT table. (bankapp is a
standard NonStop TUXEDO sample application.)
•
NonStop TUXEDO objects transfer money between any two selected accounts.
Selections from the file transfer.atp are displayed with accompanying text below. Print
that file or display it on screen if you need to see the complete code.
For detailed descriptions of objects and methods used for access to NonStop TUXEDO,
see Section 4, ATP Objects, Properties, and Methods
.
Definitions and Includes
The script in Example 3-5 begins with definitions of functions that validate information
about customer accounts. These functions are in client-side JavaScript because there is
no reason for input-validation functions to occur on the server.
The body of the script begins by including several files that define required functions.
The tag <SERVER> (see NonStop TUXEDO Server-Side Functions
on page 3-13)
shows where the server-side JavaScript begins.