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-4
Server-Side Script Structure
Server-Side Script Structure
The best way to familiarize yourself with ATP script structure and programming
techniques is to study the many example scripts in the ATP examples directory. This
section describes the structure of one example script for each major type of application
with which ATP pages can communicate:
•
NonStop SQL
•
NonStop TS/MP (formerly Pathway)
•
NonStop TUXEDO
•
Sockets (TCP/IP)
Some of these examples also illustrate the use of NonStop TM/MP (formerly TMF).
For a list of examples that demonstrate particular programming tasks, see Table 6-1,
Examples by Programming Task, on page F-2. For a list of example functions that you
can copy and adapt to your own needs, see Table 6-2, Functions Defined in ATP
Examples, on page F-4.
Using NonStop SQL from JavaScript
The directories called sql and sql_tools within the ATP examples directory
contain many examples that illustrate SQL script structure. One such example is the file
/examples/sql/homebank/Webpages/address.atp. The script enables a
user to change the name or address of a homebanking customer.
Selections from the file address.atp are displayed with accompanying text below. Print
that file or display it on screen if you need to see the complete code.
Definitions and Includes
The script (/examples/sql/homebank/Webpages/address.atp) begins
with definitions of functions that validate components of a customer name and address.
They are in client-side JavaScript because there is no reason for input-validation
functions to occur on the server. (See Example 3-2
on page 3-5.)