building oracle forms applications using designer 6i .2 introduction oracle designer provides...

Download Building Oracle Forms Applications Using Designer 6i .2 INTRODUCTION Oracle Designer provides graphical

Post on 25-Mar-2019

219 views

Category:

Documents

1 download

Embed Size (px)

TRANSCRIPT

Building Oracle Forms Applications UsingDesigner 6iAn Oracle Technical White PaperOctober 2000

Building Oracle Forms Applications Using Designer 6iOctober 2000

2

INTRODUCTION

Oracle Designer provides graphical design, generation, and reverse engineering facilities to visuallymodel business processes and automatically generate Web-based applications. This paper shows youhow to use Oracle Designer to model, generate and manage a Web-based Oracle Forms 6iapplication that accesses an Oracle8i database. It illustrates how to create and customize OracleDesigner modules and components and shows you how to link them to various Oracle datasourceswithin a multi-tier architecture.

The paper looks at completing the application by implementing complex user-driven functionalityand detailed layout specifications using Oracle Forms 6i controls. It shows you how to implement anenterprise style guide using Oracle Designer, with Oracle Developer object libraries.

MODULES AND MODULE COMPONENTSModules are made up of module components. Each of these module components consists of tableusages, base table and lookup table usages, that you can link using foreign key links or lookup links.A form module should contain at least one module component and can have many. You could use aform module that has no module components as a launch window for calling other forms.

Figure 1. A Typical Oracle Designer 6i Module Diagram

Building Oracle Forms Applications Using Designer 6iOctober 2000

3

Including Items

A bound item records the use of a database column by a generated application. Create each bounditem in the context of a module component table usage and specify how the column is used by agenerated application.

A bound item is always directly mapped to a single database column. They are displayed on the Dataview of a diagram as shown in Figure 1. They are shown on Display view only if they are to bedisplayed on generated applications.

An unbound item definition records the use of an item by a generated application. The item isreferred to as unbound because its value cannot be derived from a single column on a table. Forexample, totals and summary fields can be implemented using unbound items. Each unbound item isrecorded in the context of a module component definition.

Adding Lists of Values

In Oracle Designer 6i an LOV component simplifies the process of LOV generation by separatingLOV and lookup table usage functionality as it existed in earlier versions of the product. The LOVcomponent controls the definition and generation of the LOV and record group in the form and thelookup table usage is now used simply to define items included or displayed in the form block.

This enables you to:

Define multiple LOVs for the same block and also define different LOVs for query and data entrylinked to the same FK item.

Generate LOVs that are not associated to any item in the form. You can use application logic tolink an LOV to an item at runtime. This means you can define multiple LOVs for an item and thenswitch the LOV according to some context.

Reuse the same LOV definition in multiple blocks and multiple forms.

Figure 2. Adding Lists of Values to Module Diagrams

Building Oracle Forms Applications Using Designer 6iOctober 2000

4

USING ALTERNATIVE DATASOURCESBy default each module component you create has a table as a datasource and data target. If amodule component has a single base table and many lookup table usages, the generated blockrequires a further roundtrip to the server for each record retrieved, in order to populate any lookupitems. A more efficient alternative is to base a block containing lookup items on a view or on a sub-query, that comprises columns from both the base table and the lookup table. A further alternative isto base a block on a procedure stored on the server and to pass a PL/SQL table of records betweenthe block and the procedure. It is the procedure that queries and performs DML on the base table.When you specify a data source or data target that is not a table, you replace the default Form Builderfunctionality. Network traffic is reduced because the processing normally done by Form Builderusing post-query and commit-time triggers is bundled into the API logic.

An Oracle Designer utility enables you to create suitable server-side procedures on which to baseblocks by generating the Server API. The Server API consists of the Table API (TAPI) and theModule Component API (MAPI)

The TAPI provides the table with PL/SQL packages to:

Perform the DML processing on the table.

Provide data checking on the table.

Allow for additional customized application logic to be added through event code segments.

The MAPI is a set of packages made up of procedures for the insert, update, delete, lock, and queryoperations used by views and procedures that:

Are called from generated forms so that the data in queries can be sent using an array of records,and in DML can be received using a PL/SQL table of records.

Allow for additional customized application logic to be added through event code segments.Once a TAPI has been generated for a table, all future DML on the table will occur through thisTAPI. Using a TAPI helps to protect the integrity of the data.

CONTROLLING LAYOUTIn the Design Editor, you can view a module using the display view, providing a means to define andmanipulate the items that provide the user interface elements of the application.

The display view allows the manipulation of user interface information such as prompts and also themanipulation of windows, canvases, action items for navigation between windows, canvases andmodules and item groups for logical grouping of display items in bound areas of the display.

In Figure 3 the display view is shown, displaying two windows, each containing a canvas. In thesecond window, the canvas shows two tabbed canvases.

Tabbed Canvases

Using a tab canvas you can group and display a large amount of related information on a single,dynamic canvas object. Like stacked canvases, tab canvases are displayed on top of a content canvas,partly obscuring it. A tab canvas is made up of one or more tab pages. Tab pages each display asubset of the information displayed on the entire tab canvas.

Building Oracle Forms Applications Using Designer 6iOctober 2000

5

A tab canvas can have many tab pages, and must have at least one. Think of tab pages as the foldersin a filing system. Each individual tab page (folder) has a labeled tab that developers and end usersclick to access the page. You click the labeled tab to display the page at the front of the tab canvas,thereby obscuring any other page(s). Each tab page occupies an equal amount of space on the tabcanvas, roughly equal to the size of the canvas itself. This layering of related canvas sections enablesyou to display more information on a single canvas.

Figure 3. Windows, Canvases and Tabbed Canvases on a Module Diagram

Side by Side Blocks

In earlier versions of Oracle Designer there was no declarative way of defining a layout with blockslaid out side by side. By default, Form Generator places the second and subsequent blocks on thesame canvas below the previous blocks on that canvas. In order to achieve side by side layout youneeded to generate each of the blocks on a separate stacked canvas and then write application logicto display the canvases in the correct place. In Oracle Designer 6i you can position a ModuleComponent next to another. To do this there is a value for the module component placementproperty Right of and a property Right of Component which specifies the name of the modulecomponent which this one is to the right of.

Building Oracle Forms Applications Using Designer 6iOctober 2000

6

With this feature you can layout any number of blocks horizontally across any canvas. In Figure 4 theexample shows a layout where the Employee and Accounts block are both to the right of theDepartments block.

ModuleComponent

PlacementProperty

Right ofComponent

Dept New ContentEmp Right of DeptAcc Right of Dept

Window 1

Employee Detailsxxxxxxx xx xx

xxx

xxxxx

xxx xxxxxxx

Accountsxxxxxx xx

xxx

xxxxxxx

List of Departmentsxxxx xxxxx xxxxx xxx

Figure 4. Side by Side Blocks in Oracle Forms

Multi-Region Blocks

It has been a long-standing restriction that the Oracle Form generator can only generate a block in asingle window. In a more recent version of Oracle Designer we introduced the ability to split a blockover more than one canvas using stacked item groups. Until Oracle Designer 6i there has been a rulethat each Module Component in a module results in a separate block in the generated form. We havechanged this to allow two or more module components, based on the same table usage, to be linkedto indicate that they should result in a single block in the form. This allows each module componentto have different layout options. You can place each module component in different windows orcanvases, and have different preference settings etc. One example of how you might use this is tohave a block where some items in the block display multiple rows as a select mechanism, and thenhave a second window that contains a single row detail for the highlighted row in the first window.

By using multiple module components to define one generated block you can specify for eachmodule component, where its items are to be laid out, i.e.:

Different places on the same canvas

Different canvases in the same window

Different canvases in different windowsYou generat

Recommended

View more >