Progress
ADM 2 Guide


Creating the New Class Files

You create the new class files with the New ADM Class tool, located on the AppBuilder menu bar. To start the New ADM Class tool, choose Tools New ADM Class... from the menu bar, shown in Figure 8–2:

Figure 8–2: New ADM Class Menu Option

Invoking this command opens the New ADM Class dialog box, shown in Figure 8–3:

Figure 8–3: New ADM Class (Initial)

Note that this dialog box contains two tabs: a Basic tab, in which you name the class and supply various file and directory names and locations, and a Custom Files tab that provides information about the new custom files for this class. The following sections describe how to use these tabs.

The Basic Tab

The Basic tab initially contains only a single fill-in field: the Name field, in which you enter the name of your new class. After you specify a class name, fill-in fields open for the other labels on this tab. These fields contain automatically generated default names based on the class name that you supply. For example, specifying the class name as mybrowser and the class from which to derive as ...browser.cld produces the result shown in Figure 8–4:

Figure 8–4: Basic Tab with Fill-in Fields

Note that the default names follow the standard Progress naming convention. Progress Software Corporation recommends that you use these names, but does not require that you do so. Recall that once you save your new class, you cannot change the file and directory names for your new class.

Table 8–1 lists and describes the fill-in fields in this tab.

Table 8–1: Basic Tab Fill-in Fields
Field Name
Description
Mandatory?
Name
The name of the class. This name serves as a base name for the names of all of the files for the class.
Yes
Class Definition File
A file that references the components of a class. The extension must be .cld.
Yes
Source Directory
The pathname of the directory where the source files will be generated. You can browse for this directory.
Yes
Rcode Directory
The pathname of the directory for the r-code for the super procedure. You can browse for this directory.
Yes
Template Directory
The pathname of the directory for the template file. You can browse for this directory.
Mandatory if there is a value in the Template field
Derive From Class
The class definition file (.cld) to subclass.
No
Method Library
A file that defines the class name, references a property file, and starts the super procedure. The extension must be .i.
This file is also called the primary include file.
Yes
Property File
A file that defines properties for the class. The extension must be .i.
Yes
Super Procedure
Defines the get and set functions for readable/writable properties and new behavior for the class. The extension must be .p.
Yes
Prototype File
A file that references the functions and internal procedures of a super procedure. The extension must be .i.

NOTE: You can create the contents of this file by using the ProtoGen tool from the AppBuilder’s Pro*Tools palette.

Yes
Template
The name of the template file. It references the primary include file of the class.
No
Copy From Template
A template file to copy from. You can select the file on disk by clicking the file button.
No

Check the Replace existing files if exist option at the bottom of the Basic tab if you want to open these files in the AppBuilder once they have been created.

The Custom Files Tab

The Custom Files tab displays all of the custom files (hooks) that will be generated when the new class is created. Like the file and directory names in the Basic tab’s fill-in fields, these filenames are automatically generated based on the class name that you supply, and thus are not filled until after you specify a class name. For example, specifying the class name mybrowser in the Basic tab produces the result in the Custom Files tab shown in Figure 8–5:

Figure 8–5: Custom Files Tab

The custom files allow you to modify and/or extend a class after it has been deployed, without altering the basic class itself. They are described in more detail in the "Custom Class Files" section.

Creating the Class Files

Once you supply all of the information required in the Basic tab, including specifying whether to open the files in the AppBuilder, you are almost ready to create the files.

Before you create them, however, you must decide whether the AppBuilder should replace files that already exist when it creates the class files. To specify this, either check or uncheck the Replace existing files if exist option at the bottom of the New ADM Class dialog box, as appropriate. You can now create the class by clicking OK. (To cancel the operation, click Cancel.)

When the AppBuilder creates a new class, it generates these files:

You should already be familiar with the standard class files. For descriptions of the custom class files, see the "Adding Application Logic to Your New or Customized ADM Class" section.

Warnings and Error Messages

When the AppBuilder attempts to create a new class, it uses validation controls to check whether pathnames and filenames are correct and whether files already exist. If it is successful in creating the class, the AppBuilder advises you of this as follows:

If the validation process fails, the AppBuilder displays a warning message and does not generate code. The rest of this section describes warnings and error messages that the AppBuilder might display.

Saving the Class Without a Class Name. If you attempt to save the class without providing a class name, the AppBuilder displays the following error message:

Generating Your Files Directly in the %DLC% Directory. Progress Software Corporation recommends that you do not install user-defined code in the %DLC% directory. If you try to do this, the AppBuilder displays the following warning message:

Note that the warning gives you the option of creating a similar directory structure in your working directory (that is, \src\adm2).

If you choose to do this, and any of the directories specified do not yet exist, you will be prompted to create them:

If you choose not to create the directory, the AppBuilder stops processing and does not generate files. You must provide a valid directory name and then try again.

File Generation Error. If an error occurs while the AppBuilder is generating class files, it displays a message and stops processing. For example:

Note that if the AppBuilder stops processing during file generation, it does not delete files that it has finished generating.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095