Previous | Contents | Index |
Although ACMS supports several presentation services, ACMS supports
DECforms as its primary presentation service. DECforms provides such
features as FIMS compliance, device-class independence, storage of form
context between exchanges, input verification (values, ranges, and
types), and escape routines.
6.4.1 DECforms Concepts
DECforms architecture provides a full separation of form from function. This separation allows you to write an application program (the function) without being concerned with the intricacies of the user interface (the form) for that program.
Normally, the term form means a document with blanks for the insertion of information. In DECforms, however, the form is a specification that may govern the complete user interface to an application program. The form specification completely describes all terminal screen interactions, the data that is transferred to and from the screen, and any display processing that takes place.
A panel consists of the information and images that are physically displayed on the user's terminal screen. A panel is composed of such items as fixed background information (literals), fields (blanks for insertion of information), attributes, function key control, and customized help messages.
You can partition the display into rectangular areas called viewports by specifying viewport declarations within the form definition. You can adjust the viewport to any size and locate it anywhere on the display (such that viewports overlap one another). For a panel to be visible, it must be associated with a viewport.
Figure 6-3 illustrates the concept of specifying panel declarations and viewport declarations within the DECforms form definition. You specify a viewport name within each panel declaration. By doing this, you map each panel to a specific viewport. At run time, each panel appears on the terminal screen within its viewport.
Figure 6-3 Panels and Viewports
The DECforms Form Manager is the run-time component that provides the interface between the terminal display and an ACMS application. The Form Manager controls panel display, user input, and data transfer between the form and ACMS. A DECforms form is loaded by the Form Manager at execution time under the direction of an ACMS application program.
ACMS begins a session with DECforms when an ACMS application program first references the form. The syntax that references the form is contained in the ACMS task definition.
In normal DECforms programming practice, both panels of this tutorial application are defined in a single form. However, the tutorial application defines a separate form for each panel simply to illustrate how ACMS handles multiple forms. For advanced DECforms design and programming, see DECforms Guide to Commands and Utilities. |
In DECforms, the form record is a structure that controls data transfer between ACMS and the form. The form record identifies which form data items (variables associated with the form) are to be returned to ACMS.
Figure 6-4 shows the interaction between DECforms and ACMS when ACMS requests information from DECforms.
Figure 6-4 DECforms Interaction with ACMS
The following steps are the sequence of events that occur when ACMS requests information from DECforms:
Resource managers (RMs) are the software products that store and manage the data accessed by ACMS applications. A resource manager controls shared access to a set of recoverable resources, such as a database.
All Compaq's resource managers provide access to recoverable data. Step procedures can access the following resource managers either locally or remotely:
Compaq's resource managers are not an integral part of the TP system, but are instead under the control of the operating system (OS). This OS control of resource managers permits database sharing among TP and non-TP applications, decision support systems, and remote nodes requesting data.
ACMS supports Rdb as its primary database management system. For Rdb conceptual information, refer to the Rdb documentation.
For the sake of simplicity, this tutorial application uses an RMS
master file to store and retrieve records. RMS is an OpenVMS-supplied
file management system that supports sequential, relative, or indexed
files. The initialization procedure in this tutorial creates the RMS
file (EMPLOYEE.DAT) when you run the application for the first time.
6.5.2 ACMS Interaction with a Resource Manager
To access a database, ACMS interacts with a procedure server process. The procedure server process, in turn, interacts with the resource manager of the database. As shown in Figure 6-5, processing steps call step procedures (user-written subroutines) to handle interactions with the resource managers of databases or files.
ACMS uses a procedure server process for executing a procedure. When starting a processing step, ACMS allocates a procedure server process to execute the procedure in that step. The procedure server process remains allocated to the task for the duration of one or more processing steps in the task.
In an update task, you need at least one exchange step to prompt the user for a key value, and another to display the requested record for modification. You need one processing step to retrieve the record from the database, and another to write the record back to the database with the user's changes. Figure 6-5 shows the interactions among ACMS, the procedure server, and the resource manager to execute a simple update task.
Figure 6-5 A Resource Manager Interacting with ACMS
The following steps are the sequence of events that executes the update task:
For a full picture of the ACMS execution flow that includes the Form
Manager's role in exchange steps, refer to Figure 6-1.
6.6 Defining Fields and Records in CDD
The CDD dictionary system provides a central storage repository for shareable data definitions. CDD is an active dictionary system that provides the user interface known as CDO (Common Dictionary Operator).
The dictionary contains metadata (descriptions of data) in the form of dictionary definitions. The most commonly used dictionary definitions are fields, records, and databases.
A field definition describes the data that can be stored in a specific field in your application. Field definitions typically include information such as data type and size. The tutorial application defines the following fields: employee number, name, street address, city, state, and zip code.
A record definition typically consists of a grouping of field definitions. The tutorial application defines a record named EMPLOYEE_INFO_RECORD, which contains a group of field definitions corresponding to the preceding fields.
This tutorial application creates your personal CDD dictionary. It also sets up your default CDD directory so that all your definitions are located there automatically. By setting a default CDD directory, the tutorial application can identify EMPLOYEE_INFO_RECORD by its name alone (without having to use its full path name).
This chapter describes in step-by-step detail how to write the Data
Entry Task using ACMS, DECforms, and CDD definitions. Before you begin,
check the prerequisites for this tutorial listed in Section 6.1.
7.1 Defining a CDD Environment
This tutorial application requires you to create a personal CDD directory. You then need to define this directory to be your default CDD directory, so that all your definitions are located there automatically.
Your system manager can help you decide where to locate your CDD directory by choosing one of the following alternatives:
The directory used as your CDD dictionary in this tutorial is represented by the placeholder disk:[cdd_directory]. When this specification appears on subsequent pages, you are required to enter the disk name and directory name where your CDD dictionary is located (for example, USER$1:[JONES.CDD]).
If your system manager determines that you should define a dictionary in your own OpenVMS account, you must first create a subdirectory for this purpose (for example, a subdirectory named CDD in an account such as USER$1:[JONES]). For example:
$ CREATE/DIRECTORY [JONES.CDD] |
This subdirectory must remain dedicated to your CDD dictionary; CDD stores its files there. Do not store your source files or any other OpenVMS files in this directory.
To set up your personal CDD directory, follow these steps:
$ DICTIONARY OPERATOR CDO> |
CDO> DEFINE DICTIONARY disk:[cdd_directory]. CDO> |
CDO> SET DEFAULT disk:[cdd_directory] CDO> |
CDO> SHOW DEFAULT disk:[cdd_directory] CDO> |
CDO> DEFINE DIRECTORY disk:[cdd_directory]d_name. CDO> |
CDO> DIRECTORY |
Directory disk:[cdd_directory] . . . d_name DIRECTORY CDO> |
CDO> EXIT $ |
$ DEFINE CDD$DEFAULT disk:[cdd_directory]d_name $ CDO :== DICTIONARY OPERATOR |
$ @LOGIN.COM $ CDO CDO> SHOW DEFAULT CDD$DEFAULT = disk:[cdd_directory]d_name CDO> |
CDO> EXIT $ |
In this chapter, you create your first source files: CDD files, DECforms files, ACMS files, and COBOL files. The easiest way to manage these files is to create them all in the same OpenVMS directory.
This manual assumes that you are using your default OpenVMS directory (udisk:[uname]) to hold your source files. In this manual, udisk represents your OpenVMS disk name, and uname represents your OpenVMS directory name (for example, USER$1:[JONES]). Make sure that you are located in your default OpenVMS directory when you create a source file.
To define fields and records in your CDD dictionary, follow these steps:
DEFINE FIELD EMPL_NUMBER DATATYPE TEXT SIZE 10. DEFINE FIELD EMPL_NAME DATATYPE TEXT SIZE 30. DEFINE FIELD EMPL_STREET_ADDRESS DATATYPE TEXT SIZE 30. DEFINE FIELD EMPL_CITY DATATYPE TEXT SIZE 20. DEFINE FIELD EMPL_STATE DATATYPE TEXT SIZE 2. DEFINE FIELD EMPL_ZIP_CODE DATATYPE TEXT SIZE 10. |
$ CDO CDO> @EMPLOYEE_FIELDS CDO> |
CDO> SHOW FIELD EMPL_NUMBER Definition of field EMPL_NUMBER | Datatype text size is 10 characters CDO> |
DEFINE RECORD EMPLOYEE_INFO_RECORD. EMPL_NUMBER. EMPL_NAME. EMPL_STREET_ADDRESS. EMPL_CITY. EMPL_STATE. EMPL_ZIP_CODE. END RECORD. |
$ CDO CDO> @EMPLOYEE_INFO_RECORD CDO> |
CDO> SHOW RECORD EMPLOYEE_INFO_RECORD Definition of record EMPLOYEE_INFO_RECORD | Contains field EMPL_NUMBER | Contains field EMPL_NAME | Contains field EMPL_STREET_ADDRESS | Contains field EMPL_CITY | Contains field EMPL_STATE | Contains field EMPL_ZIP_CODE CDO> |
CDO> DIRECTORY Directory disk:[cdd_directory]d_name EMPLOYEE_INFO_RECORD;1 RECORD EMPL_CITY;1 FIELD EMPL_NAME;1 FIELD EMPL_NUMBER;1 FIELD EMPL_STATE;1 FIELD EMPL_STREET_ADDRESS;1 FIELD EMPL_ZIP_CODE;1 FIELD CDO> |
DEFINE RECORD EMPLOYEE_INFO_WKSP. EMPL_NUMBER. EMPL_NAME. EMPL_STREET_ADDRESS. EMPL_CITY. EMPL_STATE. EMPL_ZIP_CODE. END RECORD. |
$ CDO CDO> @EMPLOYEE_INFO_WKSP CDO> |
In this tutorial, the record EMPLOYEE_INFO_RECORD is the same as the workspace (EMPLOYEE_INFO_WKSP) that ACMS passes to DECforms. In many ACMS applications these records are not identical. You often pass a workspace that contains fewer fields than the record definition. Both the record and the workspace definitions are included in this tutorial as examples of the usual practice in ACMS application definitions. |
The easiest way to design DECforms panels in a form is to use the
DECforms Panel Editor in the Form Development Environment (FDE). The
definition of the panel that you create is automatically stored in a
form source file
with the file type of .IFDL (Independent Form Description Language).
7.3.1 Creating a Basic Form
To enter FDE and create a basic form and source file, follow these steps:
$ FDE :== FORMS DEVELOP |
$ @LOGIN.COM |
$ FDE |
_Input_File: EMPLOYEE_INFO_FORM |
Form Development Environment starting... Creating a new form file called: UDISK:[UNAME]EMPLOYEE_INFO_FORM.FORM |
If you copied the online IFDL source files to your default directory before starting this tutorial, DECforms translates the existing IFDL file here and loads the resulting FORM file. It displays the Main Menu instead of Figure 7-1. In this case, use the arrow keys to choose the Exit option and press [Select]. Proceed to Section 7.3.4, step 2. |
Figure 7-1 DECforms LAYOUT Screen
Figure 7-2 FDE Main Menu
IFDL saved in file: UDISK:[UNAME]EMPLOYEE_INFO_FORM.IFDL;1. Form saved in file: UDISK:[UNAME]EMPLOYEE_INFO_FORM.FORM;1. |
$ TYPE EMPLOYEE_INFO_FORM.IFDL |
Form EMPLOYEE_INFO_FORM <FF> Layout VT_LAYOUT Device Terminal Type %VT100 End Device Size 24 Lines by 80 Columns End Layout End Form |
To make your form useful, create a panel that produces a display on the terminal screen. The next section contains instructions for doing this.
Previous | Next | Contents | Index |