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.
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:
- Class definition file: class-name.
cld
- Primary include file:
prim-incl-file
.i
- Property file:
prop-file
.i
- Prototype file:
proto-file
.i
- Super procedure:
super-proc
.p
- Template:
template-file
.w
(if specified in the Basic tab of the New ADM Class dialog box)- Custom primary include file:
prim-incl-file
custom.i
- Custom property file:
prop-file
custom.i
- Custom prototype file:
proto-file
custom.i
- Custom super procedure:
super-proc
custom.p
- Custom exclude definition file:
class-name
exclcustom.i
- Custom instance definition file:
class-name
defscustom.i
- The r-code for the super procedures in the r-code directory.
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 |