Unit IV

Preparing for OCP Exam 4: Build Forms II

Chapter 18

Project Builder

Managing Projects with Project Builder *

Benefits of Using Project Builder *

Exercises *

Creating Projects and Sub-Projects *

Exercises *

Adding Files to a Project *

Exercises *

Implicit and Explicit Dependencies *

Exercises *

Compile Options *

Exercise *

Delivering a Project *

Exercise *

Customizing a Project Builder Environment *

Exercises *

Chapter Summary *

Two-Minute Drill *

In this chapter, you will understand and demonstrate knowledge in the following area:

This chapter covers everything you need to know to begin using Project Builder. Because the chapter contains only one main section, "Managing Projects with Project Builder"—you will find the introduction to the chapter’s contents within that section’s introduction. The contents of this chapter comprise about 8 percent of the OCP Exam 4 test content.

Managing Projects with Project Builder

In this section, you will cover the following points related to managing projects with Project Builder:

Project Builder is the central point from which you can keep track of all the files that make up one or more Developer/2000 application projects. In this section, you will learn the benefits that Project Builder has to offer, and learn the basic layout of the Project Builder display. Next, you will explore how to create projects and subprojects in Project Builder, how to add files to the projects and subprojects, and how to identify files that are dependent on each other. You will then learn how Project Builder makes it easy to compile part or all of your project in a single step, and how to create an installable group of files that comprise a deliverable application. Finally, you will discover the automated actions that Project Builder links to each file type, along with the dynamic variables you can insert into these actions to make them more versatile and flexible.

Benefits of Using Project Builder

Project Builder allows you to create and maintain a hierarchical list of the files that make up your application. From this central list, you can edit files, compile them, run their compiled versions, and combine them into a deliverable product complete with installation scripts for the Oracle Installer.

Project Builder offers a wealth of features to simplify the management of large, complicated, multiple-developer applications. It provides a Global Registry that stores settings identifying how each type of file should be handled. These settings include whether that file type should be delivered in the final application, whether it should be included under a version-control system, what database connection should be used with files of that type, what automated actions are available for that file type, and what variables are available to make those actions modify themselves dynamically. Project Builder also offers a User Registry that can contain user-specific settings that supersede Global Registry settings on a developer-by-developer basis. Project Builder also allows you to keep track of the database connections used in a project. And finally, Project Builder provides a familiar navigator-style Projects node, which can show your project’s files grouped in a tree format in whatever sub-projects you desire, and sorted either by file type or by dependencies between the files. When you add form, report, and graphics files to the Projects tree, Project Builder does not bring the physical files into your Project Builder file; instead, it creates pointers to the form, report, and graphics files, which themselves remain on disk. Project Builder doesn’t stop at simply maintaining these pointers; it allows you to define how each file being pointed to should be edited and packaged into a deliverable Developer/2000 application.

The Project Builder has a basic set of onscreen components that are similar to those you learned about in Form Builder. Figure 18-1 shows these components. At the top of the display are a familiar menu and toolbar; the toolbar includes special buttons to start the Project Wizard and Delivery Wizard (which you will learn more about later), to add and remove files from a project, and to compile source files. On the left side of the display is the Launcher for starting other programs. Most of the screen space is devoted to the tree-oriented Project Navigator, which gives you convenient access to the files in your application.

Exercises

  1. What are the main functions of Project Builder?
  2. How does Project Builder make multiple-developer environments more consistent and efficient?

Creating Projects and Sub-Projects

To see how to add projects and sub-projects in the Project Builder, start the program (if you haven’t already) and double-click on the Projects node to start the Project Wizard. If you see a screen labeled Welcome to the Project Wizard!, deselect its Display this screen next time option and click on the Next button to proceed. The Project Wizard will start by asking you for the title, directory, and filename for your new project. Enter a title of Oracle Press Samples, identify the directory you would like to serve as the project’s default directory, and enter a file name of Oracle_Press_Samples for the project’s file name. Then click on the Next button to continue. The next Project Wizard screen allows you to enter an author name and select a database connection. These parameters will override the default settings established using Project Builder’s Tools | Preferences | Projects menu command. For now, just click on the Next button to continue. In the final Project Wizard screen, select the Just create the project radio button and click on the Finish button. Your screen should now look similar to Figure 18-2.

Figure 2: Project Builder new project

If, at a future time, you would like to create a project without using the Project Wizard, you would start by executing the File | New | Project menu command. Project Builder will immediately present a file-save dialog box; enter the name the project file should be saved under and click on the Save button. You can then change the name the project shows in the Project Navigator by opening the project’s Property Palette.

You can also create subprojects beneath a project to provide further organization of the application’s files. Right-click on your Oracle Press Samples project node and select New Sub-Project from the context menu that appears. Select the subproject’s default directory—it can be the same as the main project’s default directory—and click on the OK button. Change the sub-project’s name to Standard. Next, create a second subproject at the same level and name it AV. You now have a fine hierarchical structure to hold your project files. In the next section, you will learn to add files to it.

Exercises

  1. What is the difference between a project’s title and its filename?
  2. What is the purpose of subprojects?

Adding Files to a Project

Double-click on your Standard subproject node to open the dialog box for adding files to the project. Navigate to the location where your form files from this book are stored and select the .fmb and .fmx files for your sample application. You can select multiple files by employing shift-clicking for contiguous groups and ctrl-clicking for noncontiguous groups. When you are done selecting files, click on the Open button to continue. You should now see two new nodes beneath your Standard subproject: Forms Builder document and Forms Builder executable. Click on the + to the left of each node and you will see pointers to the files you selected. Your screen should now look similar to Figure 18-3 (which shows two .fmb files, while your project will probably only show one). Using the technique you just learned, add the Form Builder files for your AV_DATA forms to your project.

Figure 3: Project Builder project with subproject and file pointers

Tip: The number of files Project Builder can add to a project in one add-file command is limited. The program’s documentation states that in a single command you can add up to 250 files that have Windows long filenames, and as many as 600 files that have names using the older 8.3 notation. In reality, the limit is far lower for files with long filenames. If you select too many files, Project Builder will either add some of them but not others, or will add none at all. If either of these events occurs, add the files in smaller quantities using multiple add-file commands.

Even though the items added to your project are pointers to your files, and not the files themselves, the pointers still have properties. Right-click now on the Project Builder pointer for your image_module.fmb file, and select Property Palette from the context menu that appears. The properties of particular interest include Project Directory, which identifies where the file being pointed to is stored; Version Control File, which—if you have implemented source control using a version-control product such as PVCS or ClearCase—determines whether multiple versions of the file are stored as the file is modified; Deliver File, identifying whether the file should be included in a delivered Developer/2000 application; a group of Actions properties, which determine what programs should be used to open, print, run, and perform other actions on a file; and the Macros group, in which you can specify command-line parameters for the applications defined in the Actions group.

When you are done looking at the project item’s properties, close the Property Palette and return to Project Builder. Double-click on one of the source files represented in the Project Navigator and you will see that the file will be opened for editing in Form Builder. Double-click on one of the compiled files in the Project Navigator and the file will be run by the Forms Runtime program.

Exercises

  1. Which portion of the Project Builder display shows the individual files in your project?
  2. How can you change whether a specific file in a project is destined to be delivered in the distributed application? How can you determine where the physical file is stored? How can you change whether it is version controlled?

Implicit and Explicit Dependencies

In an application, certain files rely on the presence of other files. For instance, compiled forms with .fmx file types cannot exist without there first being a corresponding source form .fmb file. Project Builder offers a Navigator view type that arranges file pointers based on their dependency on other files, rather than by their file types. To see this Dependency View in action, execute the Navigator | Dependency View menu command. Your Project Navigator display will rearrange to show Project Builder’s best understanding of which source files are the basis for other files. Unfortunately, Project Builder isn’t that bright about connecting source and target files; if you add a file_name.fmb and a file_name.fmx file in the same add-files command, Project Builder will not understand that the .fmx file has a dependency on the .fmb file, even though they share the same name. You must state this dependency explicitly by adding the files in separate steps. First, you add the target file—in this case, the .fmx file—and after that file has been added to the Project Navigator, you select it and click on the Add Files to Project button in the Project Builder’s toolbar, shown here:

Illustration 1

In the add-files dialog box that appears, you then select the source file. This creates an explicit dependency that will be reflected when you have set the Project Builder to Dependency View.

While you are using Dependency View, you will notice that source files do not necessarily all display at the same hierarchy level: source files in explicit dependencies with target files display one level deeper than source files without such dependencies. This means that if you add the image_module.fmx file to your project, then add the image_module.fmb file beneath it in an explicit dependency, and next add the sound_module.fmb file to the project, the two .fmb files will not display at the same level. This can be visually confusing. To remedy this, Project Builder offers a display mode that creates "phantom" dependent items for source files that are not part of an explicit dependency. Displaying these phantom files is called showing implicit dependencies. To turn this feature on, execute the Tools | Preferences | Display command and enable the Show implicit items option. If your project includes any source files without explicitly defined target files, Project Builder will create phantom target files so all the source files display at the same level in the Project Navigator. Figure 18-4 shows a project with this option enabled. Notice how the AV subproject’s pointers include two instances of image_module.fmx and sound_module.fmx. The instances in bold lettering are the ones you added manually, while the instances in regular lettering are implicit items and do not really exist. This brings up an important point: enabling the Show implicit items option does not cause Project Builder to automatically seek and add dependent items to your project when you add a source item; it merely causes the Project Navigator to display phantom dependent items so that source items are displayed at the same hierarchical level. It is a purely cosmetic change. It is also important to know that if you have a project displaying with implicit items and then manually add a file with exactly the same name as an implicit item, Project Builder will not replace the implicit item with the real one; it will display both.

Figure 4: Project Navigator with Show implicit items option enabled

Exercises

  1. What is the difference between Project View and Dependency View?
  2. If you have the Show implicit items option enabled and add an .fmb file to your project, will the corollary .fmx file be added automatically? If not, what must you do to ensure that the .fmx file is added?

Compile Options

You can create compiled versions of your source files from within Project Builder. This can be a fast, convenient way to ensure that all the compiled files you are about to package into a deliverable product are up-to-date. To compile all the source files in a project or subproject, right-click on the project name or subproject name in the Project Navigator. Then select Compile All from the context menu that appears. You will see Project Builder start the Forms Compiler program once for each .fmb file in your project. (When you have applications containing other types of source files, Project Builder can start the appropriate compiler for those file types as well.) When the compile process is finished, it will display a dialog box showing the compilation status as Done and offering a Close button. Click on the button to return to Project Builder.

If you wish to compile only the source files that have changed since the last time they were compiled—or that have never been compiled at all—right-click on the appropriate project or subproject name and select Compile Incremental from the context menu that appears. To force a compile on one or more specific source files, select the file pointers in the Project Navigator and execute the Project | Compile Selection menu command.

Exercise


  1. What is the difference between Compile All, Compile Incremental, and Compile Selection?

Delivering a Project

Considering how complex it can be to develop a sophisticated application, preparing it for delivery is remarkably simple. This is largely due to one of Project Builder’s nicest features: the Delivery Wizard. The Delivery Wizard simplifies the process of preparing your finished application for distribution to users. It lets you select the files to include, and for patches, it is smart enough to only include the changed files. The Delivery Wizard copies the selected files to a "staging" area, which is simply a location in which copies of your application’s files are placed, along with other files needed by the Oracle Installer. The staging area can be on a local or networked hard drive, or it can be a remote site accessed via File Transfer Protocol (FTP). Your final step for delivery will be copying files from the staging area to your distribution media, or making the staging area available for users on a network.

To see this in action, select your project’s node in the Project Navigator and execute the Tools | Delivery Wizard menu command. If you are presented with a screen titled Welcome to the Delivery Wizard!, uncheck its Display this screen next time option and click on the Next button to continue to the first page of the Delivery Wizard, which is shown in Figure 18-5. Notice that the name of your project is already presented in the What project would you like to deliver? field. If you open that field, you will see that your subprojects are also available. For the time being, leave the field set to your main project. Enable the Deliver all files radio button, and then click on the Next button to continue. In the next wizard page, click on the Deliver to a local staging area and create Oracle Installer scripts radio button, and enter a name for the directory that you would like the Delivery Wizard to use as the staging area. It is recommended that you have a directory dedicated solely to this function. Also, note that each time you run the Delivery Wizard it replaces the contents of your staging directory, so if you are doing a "patch" release, you will want to place that release’s files in a directory different from the one containing the distribution files you are patching! After you have entered your staging directory name, click on the Next button to continue to the next wizard page. In the first field of this new page, labeled Script Name, enter up to eight alphanumeric characters that will serve as the filename portion of the Oracle Installer files the wizard generates for your application. The user does not need to see this name, so you can be cryptic if necessary. The next field on the page, Program Group Name, is the name the user will see in the Oracle Installer; it is also the name of the Windows Program Group that will be created for your application, and the name that the Installer will add to your Start menu to give the users access to the application’s compiled files. Unlike the prior field, this one allows spaces, mixed-case words, and a friendly amount of space. The value you put in the third field, Version, will also show up in the Oracle Installer, appended to the Program Group Name. Below these fields is a radio group allowing you to specify whether you want the Developer/2000 Runtime environments (Forms Runtime, Reports Runtime, and Graphics Runtime) included in the distributed product. Make your selection and then click on the Next button to proceed.

Figure 5: Project Builder’s Delivery Wizard first page

In the next wizard page you have the opportunity to select which of the compiled files you wish to include in your distributed application. Make any changes you wish, and click on the Next button to continue. The next Delivery Wizard page lets you enter the program labels that will appear in the user’s Start menu after your application is installed. These labels can be mixed case and include spaces. Enter the labels you want your users to see, and then click on the Next button to move forward. The next wizard page allows you to specify environment variables that will be added to the user’s Windows Registry when the application is installed. For the moment, just click on the Next button to proceed to the next page. There, you will see a summary of the actions the Delivery Wizard is about to take. Click on the Finish button and your application’s compiled files will be copied to your staging directory, along with the files necessary to install them using the Oracle Installer.

Exercise


  1. What is the purpose of the staging area?

Customizing a Project Builder Environment

One of the benefits of using the Project Builder is that it knows how to open, edit, print, and perform other operations based on a file’s type. These operations rely on actions defined in the registries and Property Palettes. You can view and modify these actions yourself, and even create new ones of your own if you wish. Actions are hierarchical: the Global Registry defines actions for each file type, and those can be superseded by entries in a User Registry. Individual projects can have their own actions, as can subprojects and even individual files. This gives you a very high degree of control over how your files are handled while maintaining the benefits of having repetitive activities automated. Project Builder provides predefined actions that should be edited only by the project administrator—if at all—as well as user-defined actions that you can easily add yourself by right-clicking on a node and selecting Add Action from the context menu that appears. Don’t do that quite yet, though, because you still need more information about how actions work.

Open your Global Registry node now in the Project Navigator and select the Form Builder document node. Open the Property Palette and, if necessary, open the Actions node. You will see property entries for all the actions currently defined in the Global Registry for this type of file. For instance, the Edit property will contain a value similar to this:

{ORACLE_HOME}\bin\f50des32 {ORACONNECT ? Userid={ORACONNECT}} Module='"'{n}'"' {F50DESOPTS}

This is the command line that Project Builder will execute if you tell it you want to edit one of the Form Builder documents (.fmb files) in your project. The parts of the command line that are surrounded by braces{} are variables called macros. When the command line is executed, the macros are replaced by text; for instance, the {ORACLE_HOME} macro is replaced by the path for your Oracle home directory. The values for macros are defined in the next node of the Property Palette, named Macros.

You may notice that some actions include macros that are not defined in the Macros section of the Property Palette. That is because certain macros cannot be changed; these are called built-in macros. They have one-character names and are shipped with Developer/2000. There are two other categories of macros: predefined macros, which appear in the Macros node of the Property Palette, are also provided with Developer/2000 but can be changed if you wish; and user-defined macros, which you create yourself to add dynamic variables to the command lines executed by actions. A complete treatise on actions and macros is beyond the scope of this book; the important thing to remember for the exams is that actions are file-type-specific commands that perform defined tasks, that you can create your own custom actions, that an action’s command line can include macros to serve as dynamic variables in the action’s command, and that you can create your own macros to add your own variables.

Exercises

  1. What is an action, and why do they exist?
  2. What are the two types of actions, and what is the difference between them?
  3. What can you add to an action to alter the command string it creates dynamically?
  4. What are the three types of macros, and what are the differences between them?

Chapter Summary

In this chapter, you got a thorough introduction to Project Builder. You started by exploring the benefits of using Project Builder, which include easy establishment of company-wide standards for file location, delivery, version control, database connections, and compilation, as well as an intuitive tree structure for displaying project, sub-projects, and individual file names. From this central list, you can edit files, compile them, run their executable versions, and combine them into a deliverable product complete with installation scripts for the Oracle Installer. Project Builder’s Global Registry stores settings identifying how each type of file should be handled. These settings can be superseded by individual developers, if necessary, using settings in the User Registry. Project Builder provides a tree-structured Project Navigator, which can show your application’s files grouped into whatever subprojects you desire, and sorted either by file type or by dependencies between the files. When you add form, report, and graphics files to the Projects tree, Project Builder does not bring the physical files into your Project Builder file; instead, it creates pointers to them. Project Builder allows you to define how each file being pointed to should be edited and packaged into a deliverable Developer/2000 product.

Next, you learned how to create projects and subprojects. This can be done either using the Project Wizard or manually, using the File | New | Project menu command. You can then add files to a project either by double-clicking on the project’s node, or by clicking on it once and then clicking on the Add Files to Project button. The pointers Project Builder creates to your files have properties allowing you to specify parameters on an individual-file basis. These parameters include file location, database connection, automated actions, macro variables, inclusion in the delivered application, and monitoring by a version-control system. When adding files, you can explicitly identify file dependencies by adding a dependent file first, selecting that file’s pointer in the Project Navigator, and then adding the other files on which the first file depends. These dependencies can be displayed by executing the Navigator | Dependency View menu command. If your project contains source files without any corresponding executable files, you can cause the Project Navigator to display the source files at the same hierarchical level by executing the Tools | Preferences | Display command and enabling the Show implicit items option.

Project Builder also provides you with a fast, convenient way to compile your application’s source files. In addition to being able to compile every source file in your application with a single command, it offers commands allowing you to compile only those that have changed since their last compilation, or only those you select manually. For packaging the compiled files into a deliverable application, Project Builder offers the Delivery Wizard. The Delivery Wizard lets you select the files to include, and for patches, it can automatically include only changed files. It copies the selected executable files to a staging area, along with other files necessary for the Oracle Installer to install the application. The staging area can be on a local or networked hard drive, or it can be a remote site accessed via File Transfer Protocol (FTP). Product-packaging operations such as these, as well as more common activities like opening and compiling files, are controlled by Project Builder properties called actions. Actions are file-type-specific commands that execute defined tasks. You can edit the actions to modify how they handle your files, and you can create actions of your own to add new functionality to Project Builder. Within an action’s command string, you can incorporate dynamic variables called macros to insert values into the action command string at run time. There are three categories of macros: built-in macros, which are shipped with Developer/2000, have one-character names, and cannot be changed; predefined macros, which are also provided with Developer/2000, can be changed if you wish, and appear in the Macros node of the Property Palette; and user-defined macros, which you create yourself.

The contents of this chapter comprise about 8 percent of material tested on OCP Exam 4.

Two-Minute Drill

Hosted by uCoz