Client application generation is the creation of screens and reports. You perform client application generation during the design and build phases of the life cycle of an Oracle project. In this chapter, you will learn the Module Data Diagrammer tool,
which is used to generate both screens and reports. On the top of the screen are a pull-down menu and a toolbar of icons. All of the functions that these icons perform can also be found on the menu bar under Edit, View, Utilities, and Tools. Whether you
want to use the icons or the menu is just a matter of usage style. For the most part, the descriptions in this chapter use the icons rather than the menu bar.
Start the Module Data Diagrammer by clicking its icon and entering your user ID, password, and CASE application. Across the top of the screen, you will see a set of icons used to design a diagram (see Figure 28.1).
Initially, you can create a new diagram by either choosing New from the File menu or pressing the New Diagram icon (refer to Figure 28.1). When you choose this icon, or any icon from the Designer/2000 toolset, help is always available. You can see the
help message appear in a balloon to the right of the icon when you move your cursor to an icon without pressing the mouse button. You can also get help by pressing the Context Help icon and then selecting anything on your screen (either an icon or an
element). Finally, you can search for help on any topic from the Help menu pick.
You can use the Module Data Diagrammer to generate screens and reports from Designer/2000. The module basis can come from a number of sources:
To create a module data diagram you need to take certain steps. You must create or select the module, add or modify the summary information, select the data usages, and generate the screen or report.
To select a module, select the Create Module icon. At this point, a list of module names appears. Select Report if you are creating a report or Screen if you are creating a screen and then select the module name from the list. If you are creating the
module for the first time, click the Create Module button. Now fill in the module short name, description, language, and module type.
Initially, when you start your diagram you might want to fill in the summary information so that you can easily identify the diagram when it is printed. Under the File menu is a pick called Summary Information (see Figure 28.2). A window will pop up
showing you all the choices you have for information to be included on your chart.
Figure 28.2. The module data diagram summary information.
Select any information you want to display on the diagram. If you want your name or a diagram title, you need to fill in these items.
If you selected an already existing module that contains table usages, they will appear in a data diagrammer format. Parent/child relationships will display with the parent table on the top and the child on the bottom. Lookup relationships will display
with the lookup to the right of the base table.
If you are creating a new module or need to add new table usages to your module you need to select the Table icon (refer to Figure 28.1). Click the icon and select a table from the list of values.
After you have added a table to the diagram you can edit its usage.
To edit table usage for a screen, double-click the item, and you can edit Table Details, Table Layout, and Table Text.
Under the Table Details tab (see Figure 28.3), you can edit the allowable actions that are on-screen: insert, update, delete, query. These usages are the default for the entire table. Next, you can change the alias, block title, and comment. These will
default from what was entered in the table definition.
In the Table Layout tab (see Figure 28.4), you can select the number of rows to be displayed, the overflow style (whether the window should scroll, if only the field will scroll, or if the field will truncate), and the measurements of the canvas and
In the Table Text tab (see Figure 28.5) you can type in any WHERE clause, any notes, and any help text that you want for online help on the screen you are designing. The WHERE clause can trim down the selection from the table based on some rule defined
for the module being generated.
To edit table usage for a report, double-click the item. Under the Table Details tab (see Figure 28.6), you can edit the title and alias to be displayed, add comments, and choose the layout style. You can also choose the maximum number of records that
can appear on a page.
Under the Table Text tab (see Figure 28.7), you can put in any additional notes and any WHERE clause. The WHERE clause can trim down the selection from the table based on some rule for the module being generated.
After you have added more than one table to a diagram you will want to display the relationships between the tables. Usually, when you add the second table in a relationship, the diagrammer will automatically add the relationship. Sometimes it does not.
To add the relationship, select the Relationship icon (refer to Figure 28.1). Next, select one of the tables in the relationship, and then the other table in the relationship. The diagrammer will automatically place the relationship on the diagram.
If you select an already existing module that contains column usages, they will appear in a data diagrammer format. If you are creating a new module or need to add new column usages to your module, you need to select the table to which you are adding
column usages. Then select the Column icon (refer to Figure 28.1). Click the icon and select a column from the list of values.
The columns will appear on your screen or report in the order they display on the table box. To change the order of columns, simply select the one to be moved and drag it up or down to the position in which you want it to be.
After you have added the column usages you can edit them. Double-click the table or any of the columns listed. Double-clicking the table will bring up the edit window at the Table Details tab. Double-clicking the column will bring up the edit window at
the Column Details tab, displaying the selected column.
Different tabs are available for modifying the look and feel of columns on a screen on the Detail Usages For A Screen dialog box: Usage, Column Details, Column Display, and Column Text.
The Usages tab enables you to view and modify the usage of a column while you look at the usages of all the columns on the screen. (See Figure 28.8.)
The Column Detail tab enables you to edit usage, sort order, summary information, and hints. (See Figure 28.9.)
The Usage area is the same as the Usage tab; however, you can see only one column of the screen at a time.
Order By refers to how the information is ordered in the selection from the database. For example, if you place a 1 in this box for the ID column, the data will order by the ID column. In the lower drop-down list you can select in which direction the
information is orderedeither ascending or descending.
In the Summaries box you list what type of summary calculation you want on a column. The Function box is a pop-up list of function typessum or count. Type is a pop-up list of where you would want the break to bethe group. Source is a pop-up
list of the columns available on the table; choose the one to be summarized.
The hint area is where you enter the hint for the user. When the screen is generated, this hint appears when the user enters the field on the screen. You can also enter a default value for the column at this point.
The Column Display tab describes how columns will be displayed on the screen. (See Figure 28.10.)
The display box contains the prompt that will appear on the screen. You can set the justification of the columnright, left, and so onfrom the Justification pop-up list. You select the data type of the columncharacter, numeric, and so
onfrom the Display Datatype pop-up list. In the Display Format box you can enter a format mask. You enter the implementation itemwhether the item is OLE or VBXin the Implementation Item box. The width and height requirements can be
entered for the column.
The Item Group box in the Column Display tab contains the name of the item group. If you want to display blocks of columns together, enter a name in the Item Group box. Then enter the prompt for the item group. The next time you want to add a column to
this group, select the name from the Item Group pop-up list.
The Column Text tab (see Figure 28.11) contains any notes you might want to have on the column, any derivation expressions or formulas for extracting the columns, any PL/SQL needed to derive the column, any user text you might want to supply online, and
any conditions for highlighting (a negative number, a yes answer to a question, any date beyond 90 days from the current date, and so on).
Different tabs are available for modifying the look and feel of columns on a report on the Detail Usages For A Screen dialog box: Column Details, Column Display, and Column Text.
The Column Detail tab enables you to edit order by, argument, and summary information (see Figure 28.12).
Alias refers to a nickname you want to give the column. This action is useful if it is a user-defined, summary, or duplicate selection. If you do not define an alias, the report generator might bomb out because it is trying to create a SQL query with
two references to a table with the same name. Click the Display box if the column contents will be displayed on the report.
Order By refers to how the information is ordered in the selection from the database. For example if you place a 1 in this box, the data will order by this column first. In the lower drop-down list you can select the direction for the sort order:
ascending or descending.
Argument refers to any paring down you might want to do in the selection of the column. The Operator drop-down list is a list of argument types: =, >, like, and so on. You enter the comparison value in the Name box.
In the Summaries box, you would list the type of summary calculation you want on a column. The Function box is a drop-down list of function types, such as sum, standard deviation, and so on. Type is a pop-up list of where you would want the break to be,
such as in the item, the page, or the report. Source is a pop-up list of the columns available on the table; choose the one to be summarized.
If you select the Column Display tab (see Figure 28.13), you can edit the display and grouping characteristics. These will default from whatever was entered in the attribute definition and generated as a column, or whatever was added or edited in the
The Display box contains the prompt that will appear on the header of each breakpoint. In the Justification drop-down list, set the justification of the columnright, left, and so on. Select the data type of the columnscharacter, numeric, and
so onfrom the Display Datatype drop-down list. Select whether the column should be cut off or wrap on a page by selecting the option from the Wrap drop-down list. Finally, in the Width and Height boxes, select the width and height requirements for
The Item Group box contains the name of the item group. If you want to display blocks of columns together, enter a name in the Item Group box. Then, enter the prompt for the item group. The next time you want to add a column to this group, select the
name from the Item Group Name drop-down list.
The Column Text tab (see Figure 28.14) contains any notes you might want to include on the column, any derivation expressions or formulas for extracting the columns, and any conditions for highlighting (a negative number, a yes answer to a question, any
date beyond 90 days from the current date, and so on.)
When you are ready to save the diagram select File | Save from the menu bar. You can also save your work by pressing the Save icon (refer to Figure 28.1). At this point you can name your diagram.
Sometimes you will want some of your data to display on a different window or canvas than other data. For example, you might have employee personal information on one window and their address on the next window. To move an item to a different window,
select the New Window icon (refer to Figure 28.1). Place the cursor on the diagram and a new window will appear. You can add tables to this window or move existing tables from one window to another.
You might also want to place a table, such as a lookup table, on a pop-up list. To add a pop-up list, select the Pop List icon (refer to Figure 28.1). Drag the cursor around the base table and the lookup that will be the pop-up.
Sometimes you will want some of your data to print on a different page than other data. For example, you might want to print summary information first, and then detail information. To move an item to a different page, select the New Page/Report icon
(refer to Figure 28.1). Place the cursor on the diagram and a new page will appear. You can add tables to this page or move existing tables from one page to another.
You can make changes to a table or its relationships in either the Data Diagrammer or RON. The changes will not be reflected on any module data diagrams that use the same tables. There might be a reason for the user to keep the changes offto
reflect an earlier point in time or reflect the business opinions of another department. However, it is possible to take into account the changes from other users and consolidate them into the current diagram. To do so, you must choose Edit | Consolidate
from the menu bar. At this point, you can choose whether to consolidate a specific entity, relationship, or the entire diagram.
If new tables were added to a module definition in RON they will not be on the diagram. To add these tables or relationships to the diagram, select Edit | Include New. Any new tables or relationships will be added to the diagram.
There are several ways in which you can make the diagram easier for the customer to follow, as explained in the following sections.
You can change the colors of tables and relationships, the fonts of words, and the line width of table outlines and relationships. By changing these items you can make the diagram more readable and more intelligent. For example, you can fill in with
blue all lookup tables. The diagrammer has default colors set up for the base table, lookup table, page, and so on. You change the defaults under Edit | Preferences off the menu bar.
You can change the entire diagram or just a specific entity, relationship, or combination. To change the entire diagram choose Edit | Select all off the menu bar. To select one or more entities or relationships, select one and hold down the Ctrl key
until all the items are selected.
To change the line width, select the Line Width icon (refer to Figure 28.1). Choose a line width from the items listed. To change the line color, choose the Line Color icon. Choose a line color from the colors listed. To change the fill color of
entities, choose the Fill Color icon. Choose a color from the items listed. To change the font of any text selected, choose the Text icon. You can change the font, the style of the font, and the size of text.
When you work with large diagrams, keeping track of where you are on the diagram can become difficult, and the diagram can take up many pages when it prints. There are simple ways to deal with these irritations.
To move from table to table on the diagram, use Edit | Navigate on the menu bar and then select a table. The cursor will select the table you request, and the focus of the screen will include the table requested.
Often, when the diagram is filled with many entities, it becomes very large, sprawling horizontally or vertically. As a result, many blank pages can fill the borders of the diagram. You can reposition the diagram to use the least amount of pages by
using the Minimize Number of Pages icon. Pressing this icon will reposition the entire diagram so that the least number of pages are used.
You can zoom in and out of your picture to get a better idea of how an area of the picture looks or how the entire picture looks. The magnifying glass icons enable you to perform this function. Use the Normal Size icon to return to normal size. To
enlarge, use the Enlarge icon. To shrink, use the Shrink icon.
When you are satisfied that your diagram represents what you want your report or screen to do, you can go ahead and generate it. First, make sure you save the diagram. Second, make sure that the tables your module uses are already generated on your
database. To generate tables right from the Module Data Diagrammer, press the Generate DDL icon (refer to Figure 28.1). Refer to Chapter 29, "Server Generation," on how to Generate DDL. To generate the module, press the Generate icon. The
Generate Form screen will appear (see Figure 28.15).
The screen defaults to the current module to be generated, but you can change any of the objects to generate a different module.
You can set many options when you generate a screen. The following tabs are available: Form Option, Menu Option, Compile, Run, Template, and Other.
The Form Option tab (see Figure 28.16) enables the user to select where the generated form will be located and how it will be generated.
The Menu Option tab looks the same as the Form Option tab. It shows the location of the menu that needs to be generated to attach to the form, if the default menu will not be used.
The Compile tab (see Figure 28.17) lets you specify if and where compiled forms will be generated. You can choose not to generate executable code or to put it in a different place than the compiled code.
The Run tab (see Figure 28.18) enables you to select whether the form should be run after it is generated and the commands to run the form.
The Template tab enables you to enter a template form and a menu template for generating the form (see Figure 28.19).
The Other tab enables you to enter any log you want to keep, any library being used, and any default terminal information needed to run the screen (see Figure 28.20).
The Report Options tab in the Generate Report dialog box, in which you generate report modules, lists the options you have for generating a report. (See Figure 28.21.)
You can change and save any of the options in this tab as the default.
When you are ready to generate the report, press the Start key. As the tool generates, the cursor will turn into turning gears.
If the generator has any question on any data you entered, it will prompt you. For example, if you did not fill in the maximum number of lines on a screen or page, the generator will suggest a default, and you will be given the opportunity to overwrite
If anything seems suspicious to the generator, such as a column length that displays longer than the column itself, the generator will list a warning message.
If anything will make generation impossible, the generator will list an error message and the generation will terminate. One example might be if a table that is used in your module definition does not exist.
If you want to stop generating at any time, just press the Stop button.
When the generation is complete, the application will run or prompt you, depending on which run option you chose.
Application generation is the generation of screens and reports using the Module Data Diagrammer and Module Generator. Using the Module Data Diagrammer, you can set up the look and feel of your screen or report. When you are satisfied with your module definition, you can go ahead and generate your screen or report. Your screen or report will be well documented in the module definition and created to the exact specifications defined in the Module Data Diagrammer.