870 likes | 1.01k Views
Enhanced Guide to Oracle8i. Chapter 11: Creating an Integrated Database Application. Steps for Creating an Integrated Database Application. Design Create the specifications for the individual applications Module Development Create the individual forms, reports and charts
E N D
Enhanced Guide to Oracle8i Chapter 11: Creating an Integrated Database Application
Steps for Creating an Integrated Database Application • Design • Create the specifications for the individual applications • Module Development • Create the individual forms, reports and charts • Module Integration • Integrate the individual components into a single application
Steps for Creating an Integrated Database Application • Testing • Unit testing • System testing • Deployment • Packaging the integrated modules into an installable format
Reasons for IntegratingMultiple Form Modules • Breaks project down into independent modules that are easier to work with and debug • Keeps size of .fmx files smaller • Makes it easier for application to be worked on by project teams
Steps for Integrating Application Modules • Place all of the application modules (forms, reports, graphics) in a common folder • Create a main form module to integrate all of the applications
Main Form Components • Splash screen • Introduces application • Switchboard • Provides easy access to most-used features • Pull-down menus • Provide access to all application components
Main Form Screen Design Custom pull-down menus Graphic image Switchboard
Form Global Variables • Variables that can be referenced by any open form • Remain in memory even after form in which they are created is closed • Character variables, with maximum length of 255 characters • Syntax for creating and assigning a value: :GLOBAL.variable_name := value;
Global Path Variables • In an integrated database application, the main form calls other application module files • A global path variable references a text string that stores the complete folder path to all application module files • If application location is changed, only the global path variable needs to be changed
Creating a Global Path Variable • Created in PRE-FORM trigger of main application form • Example syntax: :GLOBAL.project_path := ‘c:\oraclesolutions\chapter11 \tutorialsolutions\cwproject_done\’;
Main Form Splash Screen Forms Runtime window Splash screen
Splash Screen Behavior • User starts application, and splash screen appears briefly • Then, main form window displays switchboard and pull-down menus
Creating a Splash Screen • Create the splash art using a graphics art application • In the main form module, create separate data blocks, windows, and canvases for the splash screen and for the main form Blocks Canvases Windows
Configuring the Splash Screen Window • Configure the splash window using the dialog window style • Document windows: • Non-modal: allow user to multitask in multiple windows • Show pull-down menus and the Forms Runtime toolbar • Dialog windows • Modal: user must close window before working in another window • Appear in a separate window frame • Do not display pull-down menus
Creating and Displaying the Splash Screen • Create an image item on the splash canvas • Create a PRE-FORM trigger to load the splash art file into the image item when the form starts using the READ_IMAGE_FILE procedure file image type full path location to splash art file image item on splash canvas
Form Timers • Created programmatically to control time-based form events • When you create a timer, you specify the duration until the timer expires • When the timer expires, the form WHEN-TIMER-EXPIRED trigger fires
Creating a Timer to Control the Splash Screen Display • Create a timer to specify how long the splash image is displayed • Set the timer interval until timer expires (in milliseconds) timer name parameter specifying that timer is not automatically reset
Displaying the Main Form • Create a WHEN-TIMER-EXPIRED trigger that fires when timer expires • Displays main application form window, hiding splash screen window
Configuring the Main Form Blocks • To ensure that the splash window appears first when the form is started, the splash block must be listed first in the Object Navigator window
Template Forms • Generic forms that include objects that will be used on all application forms • Graphic images • Toolbars • Program units • Window configurations • Etc.
Using a Template Form • Create template form and store it in a central location • When developers make a new form, they start with the template form, save it using a different filename, and then add specific items
Visual Attribute Groups • Form object that defines object properties • Colors • Font sizes and styles • Other properties
Creating a Visual Attribute Group • Create a Visual Attribute Group object in the template form
Creating a Visual Attribute Group • Define the Visual Attribute Group properties on its Property Palette
Applying a Visual Attribute Group to a Form Item • To apply a Visual Attribute Group to a form item, open the item Property Palette and select the Visual Attribute Group
Procedures to Open a Form From Another Form • CALL_FORM • Opens a child form and immediately switches the focus to the child form • OPEN_FORM • Opens a child form with the option of not immediately switching focus to the child form • NEW_FORM • Opens a child form and closes the parent form
The CALL_FORM Procedure • Syntax: CALL_FORM(form_specification, display, switch_menu, query_mode, parameter_list_id); • Parameters: • Form_specification: full path and filename to new form’s .fmx file, or form module name as specified in Object Navigator • Display: specifies whether the calling form is hidden by the called form • HIDE: hides calling form • NO_HIDE: calling form is not hidden, and user can multi-task between the two forms
The CALL_FORM Procedure CALL_FORM(form_specification, display, switch_menu, query_mode, parameter_list_id); • Parameters (continued): • Switch_menu: specifies whether the child form inherits the calling form’s pull-down menus • NO_REPLACE - menus are inherited by called form • DO_REPLACE - menus are not inherited by called form; called form displays its own menus • Query_mode: specifies whether form runs in Normal or Query mode • NO_QUERY_MODE: normal mode, user can change data • QUERY_MODE: user can only view data • Parameter_list_id: ID of optional parameter list
Example CALL_FORM Command Full path to child form’s .fmx file Child form will not inherit calling form’s menus Parent form will be hidden
The OPEN_FORM Procedure • Syntax: OPEN_FORM(form_specification, activate_mode, session_mode, parameter_list_id); • Parameters: • Activate_mode: specifies whether the application focus switches to the child form • ACTIVATE: focus switches • NO_ACTIVATE: focus remains on parent form • Session_mode: specifies whether the child form uses the same database session as the parent form • NO_SESSION: child form shares parent form’s session • SESSION: child form opens new session
The NEW_FORM Procedure • Syntax: NEW_FORM(form_specification, rollback_mode, query_mode, parameter_list_id); • Parameters: • Rollback_mode: specifies whether uncommitted transactions in the parent form are committed or rolled back when the parent form is closed • TO_SAVEPOINT: uncommitted transactions are rolled back to the last savepoint • NO_ROLLBACK: uncommitted transactions are not rolled back • FULL_ROLLBACK: all uncommitted transactions are rolled back
Procedures to Navigate Among Open Forms • GO_FORM • Moves focus to the specified form • NEXT_FORM • Moves focus to the next form • PREVIOUS_FORM • Moves focus to the previous form
The GO_FORM Procedure • Syntax: GO_FORM(‘form_identifier’); • Parameter: • Form_identifier: form ID or form specification • Form_ID: unique ID given to form when it is opened; Can be retrieved using FIND_FORM procedure • Form specification: form name, as specified in the Object Navigator
The NEXT_FORM and PREVIOUS_FORM Procedures • When a new form is opened, a sequential form ID value is assigned to it • NEXT_FORM opens next form in sequence • PREVIOUS_FORM opens previous form in sequence
Procedures to Close Forms • CLOSE_FORM • Closes the specified form • EXIT_FORM • Closes the current form, and provides options for committing or rolling back the uncommitted transactions
The CLOSE_FORM Procedure • Syntax: CLOSE_FORM(‘form_identifier’); • Parameter: • Form_identifier: form ID or form specification • Form_ID: unique ID given to form when it is opened; Can be retrieved using FIND_FORM procedure • Form specification: form name, as specified in Object Navigator
The EXIT_FORM Procedure • Syntax: EXIT_FORM(commit_mode, rollback_mode); • Parameters: • Commit_mode • ASK_COMMIT: ask user whether to commit • DO_COMMIT: automatically commits all transactions • NO_COMMIT: discards uncommitted transactions • Rollback_mode: same as for NEW_FORM procedure
WHEN-WINDOW-CLOSED Triggers • Form-level trigger • Fires when user clicks the Close button on a form window title bar • Code syntax: EXIT_FORM;
Project Builder • Developer utility to help project developers organize and manage individual form, report, and graphic files in an integrated database application • Provides a central access point for all project files • Allows developers to selectively recompile project files • Aids in deploying the finished project
Creating a New Project • Use the Project Wizard to specify: • Project registry (.upd) file • Contains project information and references to project form, report, and graphics files • Project definitions, including title and folder where project files are stored • Project default database connection • User information (author name, comments) • References to files that are included in the project
Project Navigator Window Toolbar Nodes display area Launcher
Project Navigator Window Components • Launcher • Secondary toolbar to access other Developer utilities • Nodes display area • Shows Project Builder and project components
Project Builder Components • Global registry • Specifies types of files that can be included in projects • User registry • Stores user-specific configuration information • Connections • Specifies database connection information that can be applied to projects • Projects • Nodes corresponding to individual projects
Project Properties • Specified on project Property Palette
Project Files and Dependencies • Dependencies: conditional relationships that show how certain files depend on the existence of other files • Target (executable) files depend on input (source code) files • Project Builder automatically deduces file dependencies Input file Target file .fmb .fmx .rdf .rep .ogd .ogr
Project Navigator Views • Project view: displays project files sorted by file type
Project Navigator Views • Dependency view: displays project target files with associated input files Target file Input file
Project File Properties • Project files have 2 types of properties: • Properties specific to the file • Examples: file name, file type • Properties inherited from the project • Examples: directory, author, database connection
Project File Property Palette Specific properties Inherited properties
Managing Project ComponentsUsing Project Builder • Project Builder allows you to: • Add and delete project files • Access and modify project files in their underlying Developer utility • Create and assign database connections to projects • Create subprojects • Build (compile) project files