Oracle® Database

Application Express Advanced Tutorials Release 3.0
B32469-01

March 2007

Oracle Database Application Express Advanced Tutorials, Release 3.0 B32469-01 Copyright © 2003, 2007, Oracle. All rights reserved. Primary Author: Contributor: Terri Winters, Anne Romano

Carl Backstrom, Sharon Kennedy, Amitabh Chhibber, and Jason Straub

The Programs (which include both the software and documentation) contain proprietary information; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. This document is not warranted to be error-free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose. If the Programs are delivered to the United States Government or anyone licensing or using the Programs on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, Commercial Computer Software--Restricted Rights (June 1987). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065. The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup, redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and we disclaim liability for any damages caused by such use of the Programs. Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. The Programs may provide links to Web sites and access to content, products, and services from third parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites. You bear all risks associated with the use of such content. If you choose to purchase any products or services from a third party, the relationship is directly between you and the third party. Oracle is not responsible for: (a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the third party, including delivery of products or services and warranty obligations related to purchased products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from dealing with any third party.

Contents
Preface ................................................................................................................................................................. ix
Audience....................................................................................................................................................... Documentation Accessibility ..................................................................................................................... Related Documents ..................................................................................................................................... Conventions ................................................................................................................................................. ix ix x xi

1

About these Tutorials
What this Book Is Not ............................................................................................................................. Tutorial Topics........................................................................................................................................... About Loading Sample Objects ............................................................................................................ Downloading OEHR Sample Objects ............................................................................................. Importing and Installing OEHR Sample Objects .......................................................................... Checking Your Workspace Storage Space............................................................................... Deleting the OEHR Sample Objects Application ................................................................... Viewing Database Objects ................................................................................................................ About Application Authentication ....................................................................................................... 1-1 1-1 1-2 1-3 1-3 1-4 1-4 1-4 1-5

2

How to Create a Tabular Form
Creating an Application .......................................................................................................................... Creating a Tabular Form Using a Wizard ............................................................................................ Changing an Updatable Column to a Select List ............................................................................... Create a Named List of Values......................................................................................................... Edit the Column to Display as a Select List.................................................................................... 2-1 2-2 2-4 2-5 2-5

3

How to Create a Parameterized Report
Sample Report Utilizing a Form Input ................................................................................................ Creating an Application .......................................................................................................................... Creating Regions ...................................................................................................................................... Create a Search Region ...................................................................................................................... Create a Query Region ...................................................................................................................... Adding Form Items .................................................................................................................................. Create a Search Employee Text Field .............................................................................................. Create a Hidden Text Field............................................................................................................... Create Department and Manager Select Lists................................................................................ Create a Named LOV for Department..................................................................................... 3-1 3-2 3-3 3-3 3-4 3-5 3-5 3-5 3-6 3-6
iii

Create a Named LOV for Manager .......................................................................................... Create an Item Named P1_DEPT ............................................................................................. Create an Item Named P1_MGR .............................................................................................. Adding a Button to Submit the Page.................................................................................................... Adding an Onload Process ..................................................................................................................... Running the Page .....................................................................................................................................

3-6 3-7 3-7 3-8 3-8 3-9

4

How to Create a Drill Down Report
Creating a New Application................................................................................................................... Creating Reports for OEHR_ORDERS and OEHR_ORDER_ITEMS ........................................... Create a Report for OEHR_ORDERS .............................................................................................. Change the Format of Order Date Column............................................................................. Change the Format of Order Total Column............................................................................ Create a Report for OEHR_ORDER_ITEMS .................................................................................. Customizing the ORDER_ITEMS Report ........................................................................................... Add an Item to Hold the Value of ORDER_ID.............................................................................. Add a Where Clause to Restrict the Report ................................................................................... Modify the Region Title..................................................................................................................... Linking the ORDERS Report to the ORDER_ITEMS Report ........................................................ 4-1 4-2 4-3 4-4 4-5 4-5 4-7 4-7 4-7 4-8 4-8

5

How to Control Form Layout
Creating a Table and Data Input Form................................................................................................. 5-1 Create the HT_EMP Table ................................................................................................................ 5-1 Creating a New Application............................................................................................................. 5-3 Create a New Page Containing an Input Form ............................................................................. 5-4 Run the Page ....................................................................................................................................... 5-5 Changing the Appearance of a Page by Altering Region Attributes ............................................. 5-6 Change the Region Title .................................................................................................................... 5-6 Change the Display Point and Template........................................................................................ 5-7 Change the Region Attributes Back to the Original Selections .................................................. 5-8 Understanding How Item Attributes Affect Page Layout................................................................ 5-8 Edit Item Attributes ........................................................................................................................... 5-9 Fix Item Alignment ......................................................................................................................... 5-10 Add a Stop and Start HTML Table Item............................................................................... 5-11 Change a Region to Display-only ................................................................................................. 5-12 Change Items to Display-only................................................................................................ 5-12 Create a New Region............................................................................................................... 5-12 Move Audit Items to the New Region .................................................................................. 5-13 Change the Region Template to Hide/Show Region ......................................................... 5-13 Adding a Region Header and Footer ................................................................................................. 5-14 Making a Region Conditional ............................................................................................................ 5-14 Adding a Region to Contain Hint Text.............................................................................................. 5-15 Changing Item Types ........................................................................................................................... 5-16 Change an Item to a Radio Group ................................................................................................ 5-16 Change an Item to a Select List ..................................................................................................... 5-17 Change an Item to a Check Box .................................................................................................... 5-18 About Label Templates ........................................................................................................................ 5-19

iv

........................................... 5-20 Making Data Bold ............................................................................. 6-11 Add a Button to Submit Check Box Array Values ..... 6-5 Edit the Item to Display as a Check Box............................ 7-9 Create Items for ZIP Code and Radius ............................................................................................................................................................................................................................................................................................................................................................................................................................ Create a New Page................................................................................... Updating the Sample Data ............................................................................................................................................................................................................................................................. Viewing the Chart ..... 7-8 Create a Page to Call the Manual Web Service......... 8-1 8-2 8-3 8-5 8-5 8-6 v ................................................................................................ 6-10 Adding Check Boxes to Each Row in the Report ........CHECKBOX ..................................................................................................................................................................Changing Buttons............................................................................................... 6-12 Add a Process ........................................................................................ 6-4 Create a Process............................. 6-10 Call APEX_ITEM.................................................... 6-2 Editing the Update Form............................................................. 6-4 Add a New Item.................. 7-10 Create a Report on the Web Service Result .................................................................... 6-3 Hide the Warranty Period Field.................................................................................................................................................................................................................................................................................................................................................................................................... 6-7 Create Multi Value Check Boxes to Filter Content ...................................................................................................................................... 7-9 Create a Submit Button .............................................................................................. 6-12 7 How to Implement a Web Service About Creating Web Service References ................................................................................................................................................ 6-3 Add a New Checkbox..................................................................................................... 7-1 Creating a New Application.................................. 7-3 Create a Form and Report.... 7-6 Test the Web Service ............................................................................................ 7-10 8 How to Create a Stacked Bar Chart Creating an Application ............................... 6-1 Run the Application...................................................................................................................................................................................................... 6-8 Edit the Report Region Definition .................................................................................................................................................................... 7-3 Searching a UDDI Registry ................................................................ 5-21 6 How to Work with Check Boxes Creating an Application .................................................................................................................... 6-9 Change the Default Check Box Behavior....................................................................................................................................................... 6-9 Change the Check Boxes to Display in Bold ............................. 7-4 Creating a Web Reference Manually ....... 7-2 Specifying an Application Proxy Server Address............................................................................................................................ Changing the Chart Format ..... Adding Additional Series..... 5-20 Running the Page for Update .............. 7-5 Create a Web Reference Manually............................................................................................................... 6-6 Change the Report Display ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ 6-8 Change the Search Field to a Multi Value Check Box ........................... 7-10 Create a Process to Call the Manually Created Web Reference ................................................................

...................................... 9-8 Show Additional Attributes in the Report Region................................................................................................................................... 9-10 Create a Procedure to Download Documents ............................................................................................................................................................................................... Creating an Application ........................ 9-4 Create a Report on APEX_APPLICATION_FILES ...... 9-5 Storing Additional Attributes About the Document ..................................... Edit an Item to Call the Function ......................................................................................... 9-10 Downloading Documents from the Custom Table ................................................................................................................ 9-11 Edit the Uploaded Files Region ......................................................................................... 9-3 Creating a Report with Download Links .............. Add a Function to the HTML Header Attribute .................................................. Run the Application................................................................................................................................ Changing the Value of Form Elements ............................................ 9-13 10 How to Incorporate JavaScript into an Application Understanding How to Incorporate JavaScript Functions ...... Creating an Access Control Administration Page......................... Incorporating JavaScript in the HTML Header Attribute...................... Edit an Item to Call the Function ............... 9-8 Create a Process to Insert Information ............................................................. Enabling and Disabling Form Elements........................................................................................................................................................... Calling JavaScript from a Button ........................... 9-7 Create a Table to Store Document Attributes ....................................... Add a Function to the HTML Header Attribute ........................................................... 9-9 Storing the Document in a Custom Table ........................ 11-1 11-2 11-2 11-2 11-3 11-4 vi ................................ 9-7 Create an Item to Capture the Document Subject ..................................................................... Create an Application on the OEHR_EMPLOYEES Table....................................................................................................................................................... Including JavaScript in a ......................................................................................................................................... Download Spreadsheet Data ...... About Referencing Items Using JavaScript ................................................................................................................................. Create an Application Based on Spreadsheet Data........................................................................................................................................................................... 10-1 10-2 10-2 10-3 10-3 10-4 10-4 10-5 10-6 10-7 10-7 10-8 10-8 10-9 10-9 10-10 11 How to Build an Access Control Page How Access Control Administration Works.....................................................................................................9 How to Upload and Download Files in an Application Creating an Application ............................................................................................................. 9-2 Create an HTML Region ........................................................................ Test the Validation by Running the Page ............................................................ Create a Call to the disFormItems Function.................................................................................................................................................................js File Referenced by the Page Template ........................................... 9-3 Create a Button ............................................................................................................................................................................................................................................................................. Creating a Client Side JavaScript Validation.......................................................................................................................................................................... 9-4 Add Link to Download Documents ............................................................................ 9-2 Create an Upload Item ........ 9-12 Security Issues to Consider ........................................................... Change the Item to a Select List .................. 9-12 Change the Download Link to Use the New Procedure .............................................................................................................................................................................................................................................................................................. 9-1 Creating an Upload Form .........................................................................................

................................................................... Specify an Authorization Scheme for Page 8 .................................................................................................................................................................................................................................................................................................................................... Loading Demonstration Data............................................................................................................................... Associate Edit Privileges with Page 2 ........................................................... Add Pages to Maintain Projects ........................................................................................................................... Add Users to the Access Control List ............... Specify an Authorization Scheme for the Administration Tab ................................................................................................................................................................................................................................................................. Log In with Edit Privileges ................................................................................................................................................................. 11-4 11-5 11-5 11-6 11-7 11-7 11-7 11-8 11-8 11-9 11-9 11-9 11-9 11-9 11-10 11-10 11-11 12 How to Build and Deploy an Issue Tracking Application Planning and Project Analysis......... Selecting Data Presentation Functions....... About the Issues Table ....................................................... Create the Application................................................................................................. Load Projects Data ............................................ About the Projects Table ...................................................................................................................................................................................................... Load Issues Data ....................................... About Building Database Objects ................................................................................................................................... Applying Authorization Schemes to Components............................................................ Testing the Application .......................................................... Load People Data .................................................................... Log In with View Privileges ......................................................................................................................................................................... Planning and Project Analysis ......................................................................................................................................... Add Pages to Track People........ Updating the Current Authentication Scheme........................................... Create Pages for Maintaining Projects ............................................................................................................................................................................................................................................................ View the Page ........................................... View the Created Database Objects..................................................................................................................................................................................... Gathering the Necessary Data .................................................................. About the People Table .......................... Selecting Data Management Functions ................................... Associate Edit Privileges with the Create Button............................. Associate an Authorization Scheme with the Application ........................ 12-1 12-2 12-2 12-2 12-3 12-3 12-3 12-3 12-4 12-4 12-5 12-6 12-6 12-7 12-7 12-8 12-8 12-9 12-10 12-12 12-12 12-12 12-14 12-14 12-15 12-17 12-18 12-19 vii .. Log In with Administrator Privileges .............................................................................................................................................. Create and Run a Script................................................................................................................................................................................................... Designing the Database Objects ........................................................................Create an Access Control Page..................... Implementing Database Objects....................................................................................................................................... Defining Security Requirements................................................................................ Restrict Access to Page 8 ...................................................................................... Refine the Appearance of the Projects Report Page................................................................... Defining Special Function Requirements ............................................................................................................................................... Creating an Authentication Function......................................................................................... Associate Edit Privileges with the ID Column .......................... Building a Basic User Interface ....................... Refine the Create/Edit Project Page....................................... Update Dates to Make the Projects Current.................................................................................................................................................................... Create Pages for Maintaining People.........................................................................

...................... Add Notification for Overdue Issues........... Navigate to the Breadcrumbs Page ...................................................................................................................................................................................................................................................................................................................................................................................... Add a List........................... 12-20 12-21 12-24 12-25 12-26 12-35 12-44 12-47 12-47 12-52 12-54 12-57 12-58 12-59 12-61 12-62 12-63 12-65 12-66 12-67 12-68 12-69 12-69 12-72 12-72 12-73 12-73 12-74 12-74 12-75 12-78 12-79 12-81 12-85 12-86 12-86 12-86 12-86 12-87 12-88 12-88 12-88 A DDLs and Scripts Creating Application Database Objects DDL .................... Add a New Issues Button ........................................................... Create a Report for HT_ISSUES............................................... Create the Required Objects to Support the Application.............. Add a Breadcrumb Menu ............................................................... Add a Page to Support Assigning Multiple Issues Simultaneously ........................................................................................................... Create a Region to Contain the Breadcrumb ............. Adding Advanced Features .............................................................................................................. Add Support for Email Notification.................................................. Alternate Authentication Mechanisms to Consider... Refine the Create/Edit People Page................................................................ Add Pages to Track Issues ............................................................................................................................ Add an Unassigned Issues Report .... Add a Calendar to Display Issues ................................................................................................................ Add Maintenance Navigation........................................... Create Summary Reports ........................................ Add Content to the Home Page ....................................................... Add a Bar Chart that Displays Average Days to Resolve.................................... How Email Notification Works ....................................................................................... Load the Data ............................................. Add a Recently Opened Issues Report ..................................................................................................................................................................................................................................................................................................................................................................................... Restrict Issue Modification ...................................................... Create Users .......................... Publish the URL......................................................................................................................................................................................... Add An Overdue Issues Report........................... Create a Page 0 ......................................................................... Add Breadcrumb Entries ...................................................... Add Resolved by Month Identified Report .......................................................................... Refine the Issues Report............................................................. Add an Open Issues by Project Pie Chart ........................................................................................... Import the Application Definition into the Production Instance........................................................................ Deploying Your Application ............................................................................................................................................................................................................................................................................................................................................................................ Add Application Security ............................................................................................................................................................................................................................................................................................................. Add Notification of New Assignments .................... A-6 viii ............................................................................................................................................................................................................... Refine the Create/Edit Issues Page ................... Add an Issue Summary by Project Report ......................................................................................................................................................................................Modify the People Report Page ........................................... A-1 Creating Issues Script................. Move the Application Definition .................................................................................. Restrict Project and People Definition ..................................................................................................... Export the Application Definition ..........................

This documentation is available in HTML format. Application Builder is a powerful tool that enables you to quickly assemble an HTML interface (or application) on top of database objects such as tables and procedures. See Also: "About these Tutorials" on page 1-1 Documentation Accessibility Our goal is to make Oracle products. the operating system environment under which you are running the Oracle Application Express. you need to have a general understanding of relational database concepts. and Application Builder. To that end. To use this guide. Prior to completing these tutorials. with good usability. and supporting documentation accessible. For more information. and contains markup to facilitate access by the disabled community. and Oracle is actively engaged with other market-leading technology vendors to address technical obstacles so that our documentation can be accessible to all of our customers. to the disabled community. What is Application Builder? A component of Oracle Application Express. please review Oracle Database 2 Day + Application Express Developer's Guide. Topics in this section include: ■ ■ ■ ■ Audience Documentation Accessibility Related Documents Conventions Audience Oracle Database Application Express Advanced Tutorials is intended for application developers who wish to learn how to build database-centric Web applications using Oracle Application Express. our documentation includes features that make information available to users of assistive technology. services.Preface Oracle Database Application Express Advanced Tutorials contains tutorials with step-by-step instructions that explain how to create a variety of application components and entire applications using the Oracle Application Express development environment. visit the Oracle Accessibility Program Web site at ix . Accessibility standards will continue to evolve over time.

Accessibility of Links to External Web Sites in Documentation This documentation may contain links to Web sites of other companies or organizations that Oracle does not own or control. Oracle neither evaluates nor makes any representations regarding the accessibility of these Web sites. however. call 800. Once you find the specific range.oracle. you can browse the error messages by range. You must register online before using OTN.com/accessibility/ Accessibility of Code Examples in Documentation Screen readers may not always correctly read the code examples in this document. see these Oracle resources: ■ ■ ■ ■ ■ ■ ■ ■ Oracle Database Application Express Release Notes Oracle Database 2 Day + Application Express Developer's Guide Oracle Database Application Express User's Guide Oracle Database Concepts Oracle Database Application Developer's Guide . some screen readers may not always read a line of text that consists solely of a bracket or brace. seven days a week. installation documentation. which is installed by default when you install Oracle. please visit the Oracle Technology Network (OTN). white papers. If you have access to the Oracle Database Documentation Library. registration is free and can be done at http://www. Refer to Oracle Database Sample Schemas for information on how these schemas were created and how you can use them yourself Printed documentation is available for sale in the Oracle Store at http://oraclestore. For TTY support.com/technology/membership/ x . Related Documents For more information. TTY Access to Oracle Support Services Oracle provides dedicated Text Telephone (TTY) access to Oracle Support Services within the United States of America 24 hours a day. you can search for a specific error message using the error message search feature of the Oracle online documentation.http://www. The conventions for writing code require that closing braces should appear on an otherwise empty line. or other collateral. Oracle error message documentation is available only in HTML.Fundamentals Oracle Database Administrator's Guide Oracle Database SQL Reference SQL*Plus User's Guide and Reference For information about Oracle error messages.2398. Many books in the documentation set use the sample schemas of the seed database. see Oracle Database Error Messages.446.oracle.oracle. use your browser's "find in page" feature to locate the specific message. When connected to the Internet.com/ To download free release notes.

or text that you enter. or placeholder variables for which you supply particular values. or terms defined in text or the glossary. text that appears on the screen. then you can go directly to the documentation section of the OTN Web site at http://www. Italic type indicates book titles.oracle. code in examples. xi .com/technology/documentation/ Conventions The following text conventions are used in this document: Convention boldface italic monospace Meaning Boldface type indicates graphical user interface elements associated with an action. emphasis.If you already have a user name and password for OTN. Monospace type indicates commands within a paragraph. URLs.

xii .

It leads your through the process of setting up your development environment and walks you through building an initial application. Illustrates how to create a report based on a SQL query that restricts the query to the value of a form item within the application. Where appropriate.1 About these Tutorials Oracle Database Application Express Advanced Tutorials contains a series of tutorials that explain how to use Oracle Application Express to create applications and application components. The goal of this book is to help you understand how to use Oracle Application Express through hands-on experience. If you are new to Oracle Application Express. For this type of information. please review the Oracle Database 2 Day + Application Express Developer's Guide. this book is not intended to be a complete discussion of Oracle Application Express concepts. This section contains the following topics: ■ ■ ■ ■ What this Book Is Not Tutorial Topics About Loading Sample Objects About Application Authentication What this Book Is Not Oracle Database Application Express Advanced Tutorials contains 11 tutorials with step-by-step instructions. see Oracle Application Express online Help or Oracle Database Application Express User's Guide. The objective of these tutorials is to demonstrate how to build a particular type of application or application component using the Oracle Application Express development environment. Tutorial Topics This document contains the following tutorials: Title How to Create a Tabular Form Description Illustrates how to create a tabular form within a new application and how to change one of the updatable columns from a text field to a select list. However. this book describes concepts relevant to understanding or completing a task. This guide introduces you to application development using Oracle Application Express. How to Create a Parameterized Report About these Tutorials 1-1 .

you need to import the OEHR Sample Objects application. Provides step-by-step instructions on how to create and deploy an application that tracks the assignment. ■ Order Entry (OE) The OE schema tracks product inventories and sales of a company's products. email address. the weight group (for shipping purposes). and country code. and a minimum price. This section contains the following topics: ■ ■ ■ Downloading OEHR Sample Objects Importing and Installing OEHR Sample Objects Viewing Database Objects 1-2 Oracle Database Application Express Advanced Tutorials . Describes some usage scenarios for JavaScript and includes details about how to implement them in your application. To create the objects locally in your workspace. state or province. postal code. you need to create the appropriate sample objects within your workspace. salary. city. and manager. data. job identification code. These sample objects are copies of the objects that are typically installed in two schemas: ■ Human Resources (HR) The HR schema contains information about the employees and the facilities where they work. the product name. and progress of issues related to a project. Illustrates how to create a form and report with links for file upload and download.About Loading Sample Objects Title How to Create a Drill Down Report How to Control Form Layout How to Work with Check Boxes Description Describes how to create a report on a table. the supplier. You then modify the report to contains drill down links to details in another report. users log in to a workspace. including the product identification number. including the street name. the associated associates product category. Illustrates the different ways in which you can create and process check boxes within an application. How to Implement a Web Service Explains how to call a Web service from within an application. About Loading Sample Objects In Oracle Application Express. Explains how to create a data input form and then change the form layout by editing the region and item attributes. the status availability. Each employee has an identification number. Before you can start these exercises. and applications into a virtual private database. Employees are assigned to a department and each department is associated with one location that has a full address. the warranty periods. How to Create a Stacked Bar Chart How to Upload and Download Files in an Application How to Incorporate JavaScript into an Application How to Build an Access Control Page How to Build and Deploy an Issue Tracking Application Explains how to create a stacked bar chart within an application. Explains how to build an Access Control Administration to restrict access to an application. status. Think of each workspace as a shared work area that separates your objects. product descriptions.

Confirm your selections by clicking Install.sql file: ■ ■ Microsoft Windows . Unzip and extract the OEHR_Sample_Objects_installer. Page. or Component Export. Log in to Oracle Application Express. For Supporting Objects.Select Auto Assign New Application ID.Select a schema. c.oracle. specify the following: a. 4. you need to import it into Application Express. Click the Import button. See "Logging In To Oracle Application Express" in Oracle Database Application Express User's Guide. About these Tutorials 1-3 . To import and install the OEHR Sample Objects application: 1. specify the following: a. To install an imported file.Select Application. Build Status . specify that you also want to install both the application and the supporting objects.Double-click the OEHR_SAMPLE_OBJECTS.zip file to your computer. you want to install it.Select Run and Build Application. Download the oehr_sample_objects. b. d. Installing the application creates the objects and sample data needed to complete the exercises in Oracle Database Application Express Advanced Tutorials. c. click Application Builder.zip 2. click Next. Verify that File Character Set is correct. 4. d. Now that you have imported the file. The Install Application wizard appears. select Yes and click Next. 5. In the Install Application wizard. In your Web browser go to: http://www. Locate the OEHR Sample Objects application.About Loading Sample Objects Downloading OEHR Sample Objects To import the OEHR Sample Objects application. Install As Application .zip file UNIX or Linux . Click Next. 8. b. Import file .zip Importing and Installing OEHR Sample Objects After you download the OEHR Sample Objects application. File Type .Enter the following command: $ unzip OEHR_SAMPLE_OBJECTS. On the Workspace home page. you first need to download it from the Oracle Technology Network (OTN): 1. Click Install.Click Browse and navigate to the file. Parse As Schema . For Specify File.com/technology/products/database/application_ express/packaged_apps/oehr_sample_objects. 2. 7. 3. The Application Builder home page appears. 6. 3. During the import process.

Log in to Oracle Application Express. See Also: "Viewing Database Objects" on page 1-4 Checking Your Workspace Storage Space If you experience problems installing the OEHR Sample Objects application. As shown in Figure 1–1 on page 1-5. Request additional storage space. 4. 2. Viewing Database Objects Now. On the Workspace home page. verify the available space in your workspace. Click Deinstall.About Loading Sample Objects 9. Deleting the OEHR Sample Objects Application Deleting the OEHR Sample Objects application and selecting to deinstall the supporting objects completely removes all associated objects and sample data. Object Browser enables you to browse. 2. click Application Builder. 3. Click Object Browser. On the Tasks list. Click the Home breadcrumb link at the top of the page. you can: 1. You many need to request additional storage space. Determine if you need additional storage space. 1-4 Oracle Database Application Express Advanced Tutorials . Object Browser appears. On the Workspace home page. If you are a workspace administrator. To view the objects: 1. See "Viewing the Workspace Overview Report" in Oracle Database Application Express User's Guide. The Application Builder home page appears. create. The Application Builder home page appears. take a look at the objects you just created by going to Object Browser. To remove all associated objects and sample data. click Delete this Application. 2. and edit objects in your database. The Deinstall page appears. select Remove Application Definition and Deinstall Supporting Objects. See "Requesting Additional Storage" in Oracle Database Application Express User's Guide. 5. click SQL Workshop. To delete the OEHR Sample Objects application: 1.

About these Tutorials 1-5 . 4. When you run a page or application. the Application Express engine dynamically renders it into viewable HTML based on data stored in the database. From the Object Selection list. select Tables. See also: "Managing Database Objects with Object Browser" in Oracle Database Application Express User's Guide About Application Authentication As you create new pages. In the Object Selection pane.About Application Authentication Figure 1–1 Object Browser Object Browser is divided into two sections: ■ Object Selection pane displays on the left side of the Object Browser page and lists database objects of a selected type within the current schema. 7. Note that other tabs show additional details about the object you select. 6. The list of objects that appears depends upon the available objects in the current schema. ■ Detail pane displays to the right of the page and displays detailed information about the selected object. The data in the OEHR_EMPLOYEES table appears. leave the Search field blank. click OEHR_EMPLOYEES from the list. 5. To view all objects. The Detail pane shows details about the table. enter a case insensitive term in the Search field. you can view them by running the page individually or by running an entire application. 3. To search for an object name. Note that any object having a red bar adjacent to it is invalid. Click the Data tab in the row at the top of the Details pane.

1-6 Oracle Database Application Express Advanced Tutorials . simply enter your workspace user name and password and then click Login. To continue. See Also: "Establishing User Identity Through Authentication" in Oracle Database Application Express User's Guide. you are prompted to enter a user name and password. Application Express Authentication is a built-in authentication scheme that uses the same internal user accounts you use to log in to a workspace. When you create your own applications.About Application Authentication By default. all the applications you create in these tutorials use Application Express Authentication. you can choose from a number of preconfigured authentication schemes or build your own. The first time you run a page in an application.

Select Create Application and click Next. On the Workspace home page. Click Next. Create Application . You have the option of adding a blank page. you create a tabular form. d. you create an application containing a blank page. 4. you need to create an application using the Create Application Wizard. This tutorial explains how to create a tabular form within a new application and then how to change one of the updatable columns from a text field to a select list. The Application Builder home page appears. a report. This section contains the following topics: ■ ■ ■ Creating an Application Creating a Tabular Form Using a Wizard Changing an Updatable Column to a Select List Creating an Application First. Application . For this exercise.Accept the default. To create an application using the Create Application Wizard: 1.Enter Tabular Form. Schema . 3. c. For Name: a. This built-in process performs optimistic locking behind the scenes to maintain the data integrity. you need to import and install the OEHR Sample Objects application in order to access the necessary sample database objects. Next.Select the schema where you installed the OEHR sample objects. or a report and form. 5.2 How to Create a Tabular Form A tabular form enables users to update multiple rows in a table at once from a single page. See "About Loading Sample Objects" on page 1-2. Add a blank page: How to Create a Tabular Form 2-1 . you need to add a page. Then. Name .Select From scratch. Before you begin. a form. You can use the Tabular Form Wizard to create a tabular form that contains a built-in multiple row update process. click the Application Builder icon. a tabular form. e. 2. b. Click Create.

3. For the page type. A theme is collection of templates that define the layout and style of an application.Creating a Tabular Form Using a Wizard a. To create a tabular form using the Tabular Form Wizard: 1. 6. and Delete. select Blank and click Add Page as shown in Figure 2–1. Language. For Tabs. Update. 9. Review your selections and click Create. For Attributes. the wizard creates a multiple row update process that checks for MD5 checksum values before doing the update to prevent lost updates. The Application home page appears. and User Language Preference Derived From and click Next. b. Select Tabular Form and click Next. In the following exercise you create a tabular form on the OEHR_EMPLOYEES table. and click Next. b. select Form and click Next. Allowed Operations . Click Next. 2. Under Select Page Type. insert.Accept the default.Accept the default. accept the defaults for Authentication Scheme. On the Application home page. For Copy Shared Components from Another Application. accept the default. click Create Page. 10. Insert. 2-2 Oracle Database Application Express Advanced Tutorials . 4. 7. 8. select Theme 2 and click Next. and delete operations on multiple rows in a database table. You can change a theme at any time. For User Interface. accept the default. For Table/View Owner: a. One Level of Tabs. Click Next. See Also: "Managing Themes" in Oracle Database Application Express User's Guide Creating a Tabular Form Using a Wizard The Tabular Form Wizard creates a form to perform update. Figure 2–1 Add Page The new page appears in the list at the top of the page. and click Next. c. Additionally. Table/View Owner . No.

DEPARTMENT_ID Note: This exercise limits the number of columns to optimize the display on-screen.Accept the default.Accept the defaults. For a real form. 9.Accept the default. press Ctrl and select the following columns: FIRST_NAME.Enter Tabular Form. accept the defaults and click Next. For Table/View Name. 14. c. For Button Labels.Accept the default. b. and click Next. 13. and click Next. select OEHR_EMPLOYEES and click Next. Do not use tabs. For Source Type. b. Cancel. For Branching. Figure 2–2 Run Page Icon How to Create a Tabular Form 2-3 . 7. For Page and Region Attributes: a. d. e. For Primary Key. SALARY. you would probably want to include additional columns. For Updatable Columns. b. specify the following: a. Click Next. Page Name . For Displayed Columns: a. f. Region Title . Click Next. Submit button . accept the default. Page . 8. accept the default. For Select Columns. accept the default.Creating a Tabular Form Using a Wizard 5. For Tab. HIRE_DATE. To run the page: 1. 11. 10. Next. c. EMPLOYEE_ID (Number) and click Next. Region Template and Report Template . In this case. Breadcrumb . Click the Run Page icon as shown in Figure 2–2. 6. Delete. 12. select all columns and click Next.Accept the default label text.Enter Apply Changes. Existing trigger. you want the user to remain on the current page. run the page to view your new form. Confirm your selections and click Finish. Branching tells the Web browser what page to display when the current page is submitted for processing. LAST_NAME. Click Next. Tabular Form. and Add Row buttons .

Topics in this section include: ■ ■ Create a Named List of Values Edit the Column to Display as a Select List 2-4 Oracle Database Application Express Advanced Tutorials . updatable columns are displayed. Cancel. the color scheme. Delete.Changing an Updatable Column to a Select List 2. button placement. note that the tabular form contains four buttons. If prompted to enter a user name and password. Note that the overall form layout (that is. and Apply Changes display in the upper right corner and Add Row displays in the bottom right corner. a check box appears to the left of each row to enable the user to select the current row. Users can also select all rows at once by selecting the check box to the left of the column headings. The same check box is also used in conjunction with the Delete button to identify the rows to be deleted. See "About Application Authentication" on page 1-5. region header placement. Additionally. enter your workspace user name and password and click Login. The tabular form appears as shown in Figure 2–3 on page 2-4. Figure 2–3 Tabular Form As shown in Figure 2–3. To accomplish this. and so on) are controlled by templates in the currently selected theme. you create a named list of values (LOV) and then edit the column attributes. In the next exercise. as text fields. See Also: "Managing Themes" in Oracle Database Application Express User's Guide Changing an Updatable Column to a Select List When the Tabular Form Wizard creates a tabular form. you change the default display of the Department Id column to a select list. by default.

Changing an Updatable Column to a Select List See Also: "Creating Lists of Values" in Oracle Database Application Express User's Guide Create a Named List of Values To create a named LOV for the Department Id: 1. select From Scratch and click Next. c.Select Dynamic. click the Create icon. The Page Definition for page 2 appears. department_id b FROM oehr_employees 6. Click Create List of Values. Figure 2–5 Create Icon The Create List of Values Wizard appears. For Name and Type: a.Enter DEPTID. For Source. replace the existing text with this: SELECT DISTINCT department_id a. The Report Attributes page appears as shown in Figure 2–6. Figure 2–4 Developer Toolbar The Page Definition for page 2 appears. Click Next. Click Edit Page 2 on the Developer toolbar as shown in Figure 2–4. Under List of Values. b. 3. 5. How to Create a Tabular Form 2-5 . 2. 4. Note that the LOV does not yet appear on the Page Definitions. Name . Under Regions. Type . Edit the Column to Display as a Select List To edit the column to display as a select list: 1. For Query or Static Values. click the Report link.

4. The Edit icon resembles a small page with a pencil on top of it. 3. change the default display of this column to a select list. Scroll down to Lists of Values. click the Edit icon next to the DEPARTMENT_ID column as shown in Figure 2–6. select DEPTID. The Column Attributes page appears. 6. Next. Scroll down to Tabular Form Element. 5. As shown in Figure 2–7 on page 2-7. Click the Run Page icon in the upper right corner of the page. 2-6 Oracle Database Application Express Advanced Tutorials . Scroll up to the top of the page and click Apply Changes. notice the Department Id column now displays as a select list.Changing an Updatable Column to a Select List Figure 2–6 Column Attributes on the Report Attributes Page 2. From Display As. From Named LOV. select Select List (named LOV). Under Column Attributes.

Note that this should not be altered to: SELECT lower(first_name) FROM oehr_employees How to Create a Tabular Form 2-7 . Consider the following example: SELECT first_name FROM oehr_employees. Doing so can result in a checksum error when altering the data in the form and applying updates.Changing an Updatable Column to a Select List Figure 2–7 Tabular Form with Department Id Column Changed to a Select List Note: Do not modify the select list of a SQL statement of a tabular form after it has been generated.

Changing an Updatable Column to a Select List 2-8 Oracle Database Application Express Advanced Tutorials .

3 How to Create a Parameterized Report In an Oracle Application Express application. otherwise known as a parameterized report. a report is the formatted result of a SQL query. See "About Loading Sample Objects" on page 1-2. You can generate reports in three ways: ■ ■ ■ Running a built-in wizard Defining a report region based on a SQL query Creating a report region based on a PL/SQL function returning a SQL query This tutorial illustrates how to create a report in which the results depend on the form input. or by making a selection from two select lists. you need to import and install the OEHR Sample Objects application in order to access the necessary sample database objects. How to Create a Parameterized Report 3-1 . In this exercise. you create a report region based on a SQL query that references the value of form items within the application. This section contains the following topics: ■ ■ ■ ■ ■ ■ ■ Sample Report Utilizing a Form Input Creating an Application Creating Regions Adding Form Items Adding a Button to Submit the Page Adding an Onload Process Running the Page Sample Report Utilizing a Form Input Figure 3–1 on page 3-2 is an example of a form in which the report results are based on user input. Before you begin. The easiest way to create this type of report in Application Builder is to define a report region based on a SQL query. In this example. the user populates the form by entering an employee ID in the Search Employee field.

On the Workspace home page. Select Create Application and click Next. b.Accept the default. The Application Builder home page appears. accept the default. you need to create an application using the Create Application Wizard. Application . Click Next. Click Add Page. click the Application Builder icon. The new page appears in the list at the top of the page. Select Page Type . b. For Name. Schema . 6.Enter Employees. d.Creating an Application Figure 3–1 Sample Report Creating an Application First. For Tabs. add a blank page. Create Application . c. Click Next. Page Name . and click Next. Next. specify the following: a. 5. 3. d. Name .Select From scratch. Under Add Page. 2. 4. e. To create an application using the Create Application Wizard: 1.Enter Parameterized Report. c.Select Blank. 3-2 Oracle Database Application Express Advanced Tutorials . specify the following: a.Select the schema where you installed the OEHR sample objects. One Level of Tabs. Click Create.

c. Click Next.Accept the default. specify the following: a. The Page Definition for page 1 appears. 9. Identify the type of region to add to this page .Creating Regions 7. Click Create Region.Enter Search. Figure 3–2 Create Icon 3. Topics in this section include: ■ ■ Create a Search Region Create a Query Region Create a Search Region To create a search region: 1. accept the default. b. How to Create a Parameterized Report 3-3 . Select the type of HTML region container you wish to create . and click Next. 2. Under Regions. Accept the remaining default values. For Display Attributes.Employees. You can change a theme at any time. 10. 5. and click Next. See Also: "Managing Themes" in Oracle Database Application Express User's Guide Creating Regions Next. For this exercise you need to create two regions: a Search region to contain search criteria items and a Query region that displays the resulting report. and User Language Preference Derived From and click Next. HTML. click the Create icon as shown in Figure 3–2. For Copy Shared Components from Another Application. accept the defaults for Authentication Scheme. On the Application home page. click 1 . you need to create regions. For Region: a. 8. For User Interface. Language. Review your selections and click Create. The Application home page appears. and click Next. HTML. 4. No.Accept the default. select Theme 18 and click Next. b. For Attributes. A theme is collection of templates that define the layout and style of an application. A region is an area on a page that serves as a container for content. For Title .

"EMPLOYEE_ID" "EMPLOYEE_ID". "OEHR_EMPLOYEES"."HIRE_DATE" "HIRE_DATE". 5. Click Create Region. For Report Implementation. For Region. "OEHR_EMPLOYEES". Enter the following SQL query: SELECT "OEHR_EMPLOYEES". select Report and click Next. "OEHR_EMPLOYEES". 3-4 Oracle Database Application Express Advanced Tutorials . 6.Enter the following."OEHR_EMPLOYEES" "OEHR_EMPLOYEES" WHERE (lower(first_name) like '%' || lower(:P1_NAME) || '%' OR lower(last_name) like '%' || lower(:P1_NAME) || '%') AND department_id = decode(:P1_DEPT."SALARY" "SALARY".manager_id. This makes the resulting search case insensitive for first and last names.:P1_DEPT) AND manager_id = decode(:P1_MGR."COMMISSION_PCT" "COMMISSION_PCT".Creating Regions The Page Definition for page 1 appears. A confirmation message displays at the top of the page. A confirmation message displays at the top of the page: Region created. Create a Query Region Next. b."FIRST_NAME" "FIRST_NAME"."PHONE_NUMBER" "PHONE_NUMBER". Accept the remaining default values and click Next."LAST_NAME" "LAST_NAME".'%null%'. 2."EMAIL" "EMAIL". click the Create icon.department_id. select SQL Report and click Next.'%null%'. Under Regions. "OEHR_EMPLOYEES". 4. "OEHR_EMPLOYEES". "OEHR_EMPLOYEES". 3. You create this item in the next section. See Also: "Understanding Regions" in Oracle Database Application Express User's Guide To create a report region based on a SQL query: 1."DEPARTMENT_ID" "DEPARTMENT_ID" FROM "#OWNER#". Title . For Display Attributes: a. "OEHR_EMPLOYEES".:P1_MGR) The WHERE clause forces both the search criteria and value from the database to be lower case. "OEHR_EMPLOYEES". making sure to include the trailing period: Employees &P1_TEXT."MANAGER_ID" "MANAGER_ID". &P1_TEXT is a substitution string that will determine region title."JOB_ID" "JOB_ID". "OEHR_EMPLOYEES". you need to create a report region based on a SQL query. "OEHR_EMPLOYEES". The Page Definition for page 1 appears.

For Display Position and Name: a. password. Accept the defaults. For Item Attributes: a. Under Items. select Hidden and click Next. you need to create these items. b. The previous SQL query references the following items: P1_NAME. Accept the defaults and click Next. 7. For Item Type.Enter P1_NAME. For Sequence . For Item Name .Accept the default. For Text Control Display Type. d. 3. P1_MGR. 4. select list. and P1_TEXT.Select Search. Create a Hidden Text Field Next. An item can be a text field. 2. For Region . The value of P1_TEXT is used as the basis for the region title that displays. Topics in this section include: ■ ■ ■ Create a Search Employee Text Field Create a Hidden Text Field Create Department and Manager Select Lists See Also: "Understanding Page-Level Items" in Oracle Database Application Express User's Guide.Select Employees &P1_TEXT. Click Next. text area. For Sequence . check box.Accept the default. select Text and click Next. Next. select Text Field and click Next. 5. c. To create the hidden text field P1_TEXT: 1. you will create a hidden text field named P1_TEXT. For Region .Enter Search Employee. 3. b. click the Create icon. 2. 6. Label .Enter P1_TEXT. For Display Position and Name: a. Click Create Item. and so on. For Item Type. P1_DEPT.Adding Form Items Adding Form Items An item is part of an HTML region. c. click the Create icon. Create a Search Employee Text Field To create the text field P1_NAME: 1. Click Next. For Item Name . Under Items. b. How to Create a Parameterized Report 3-5 . c.

A list of values (LOV) is a static or dynamic set of values used to display a page item. For Name and Type: a. Accept the remaining defaults and click Next. Click Create Item.Select Dynamic. click the Create icon. For Query or Static Values. Under Lists of Values. These items will display as select lists and be based on two named (or shared) lists of values. The Page Definition appears. c. Topics in this section include: ■ ■ ■ ■ Create a Named LOV for Department Create a Named LOV for Manager Create an Item Named P1_DEPT Create an Item Named P1_MGR See Also: "Creating Lists of Values" in Oracle Database Application Express User's Guide Create a Named LOV for Department To create a named LOV for department: 1.department_id FROM oehr_departments 5. Name . Click Next. 4. accept the default. Name . Click Create List of Values. and click Next.Adding Form Items d. Create Department and Manager Select Lists Next. From Scratch. replace the existing text with: 3-6 Oracle Database Application Express Advanced Tutorials . Click Next.Enter MANAGER. For Query or Static Values. 3. Type . 5. For Source. you need to create two items named P1_DEPT and P1_MGR. 4. b. 2. Create a Named LOV for Manager To create a named LOV for manager: 1. Click Next. Under Lists of Values. For Name and Type: a. accept the default.Enter DEPARTMENT. replace the existing text with: SELECT department_name. b. and click Next. 4.Select Dynamic. From Scratch. For Source. To create these items. 3. you first define two dynamic LOVs and then create the items P1_DEPT and P1_MGR. c. 2. click the Create icon. Type .

Named LOV . The Page Definition appears.employee_id IN ( SELECT x. and click Next. 4. c. Under Items. Click Next. d. y. For Display Position and Name: a.Accept the default. click the Create icon. Click Next. select Select List and click Next. Named LOV . For Region . select Select List. Create an Item Named P1_DEPT To create the item named P1_DEPT: 1. For Display Position and Name: a. 2.manager_id FROM oehr_employees x) 5. For Item Name . 5. For List of Values: a.Enter P1_DEPT.Accept the default. 3. 2. 4. Accept the remaining defaults and click Next. For Item Type.employee_id r FROM oehr_employees y WHERE y. For Sequence . select Select List and click Next. c. Null Text . Create an Item Named P1_MGR To create the item named P1_MGR: 1. d. b.Select DEPARTMENT. Click Create Item. Click Create List of Values.Enter the following: . 3. b.Enter the following: How to Create a Parameterized Report 3-7 . 6. click the Create icon. 7. For Item Type. Under Items. For Sequence . For Region . For Item Name . For Item Attributes: a. For Select List Control Type. Null Text . For List of Values: a. 5. Accept the remaining defaults and click Next. Label .Enter Department.Enter P1_MGR.first_name || ' ' || y. For Select List Control Type. b.Select Search.Select Search. b.All - c. select Select List and click Next.Adding Form Items SELECT y.Select MANAGER. b.last_name d.

For Process Type. Under Buttons. For Process Attributes: a. click the Create icon.Enter get region title info. 4. 3. 3-8 Oracle Database Application Express Advanced Tutorials . click the Create icon. Accept the remaining defaults and click Create Button. you create a process that sets the value for the hidden item P1_TEXT. 3. For Item Attributes: a. Processes. Under Page Processing. enter P1_GO. b. enter the following SQL query: DECLARE l_dept varchar2(100). 4. By adding this process. BEGIN :P1_TEXT := null. Adding a Button to Submit the Page Why do you need to submit the page? Once the user enters search criteria. 5. l_mgr varchar2(100). To submit the page. Accept the remaining defaults and click Next. select Create a button displayed among this region's items and click Next.Adding a Button to Submit the Page . In Button Name. To add an onload process: 1. select PL/SQL and click Next. For Button Region. 7. you add a button. 2. select Search and click Next. For Button Position.Enter Manager. Click Create Item. Name . Accept the remaining defaults and click Next. To add a button to submit the page: 1. The Page Definition for page 1 appears. 2. the page needs to be submitted so that the query will be rerun against that criteria. the region header simply displays as Employees. For Process. The value of P1_TEXT determines the region title that displays. the region title displays as: Employees in department_name If you choose to not add this process.All c. Label . b. See Also: "Creating Buttons" in Oracle Database Application Express User's Guide Adding an Onload Process Next. 6. Accept the remaining defaults and click Next.

enter your workspace user name and password and click Login. See "About Application Authentication" on page 1-5.Running the Page IF :P1_DEPT != '%null%' THEN SELECT department_name INTO l_dept FROM oehr_departments WHERE department_id = :P1_DEPT. make a selection from the Department or Manager lists and click Go. 5. 3. Figure 3–3 Run Page Icon 2. END IF. END IF. END. :P1_TEXT := :P1_TEXT || ' in Department ' || l_dept. Click Create Process. Running the Page To run the page: 1. :P1_TEXT := :P1_TEXT ||' reporting to ' || l_mgr. Click the Run Page icon in the upper right corner as shown in Figure 3–3. The Page Definition for page 1 appears. Figure 3–4 Form Results Being Populated from Select Lists How to Create a Parameterized Report 3-9 . When the Employees page appears. If prompted to enter a user name and password. IF :P1_MGR != '%null%' THEN SELECT first_name || ' ' || last_name INTO l_mgr FROM oehr_employees WHERE employee_id = :P1_MGR. An Employees report appears as shown in Figure 3–4 on page 3-9.

Running the Page 3-10 Oracle Database Application Express Advanced Tutorials .

How to Create a Drill Down Report 4-1 . This section contains the following topics: ■ ■ ■ ■ Creating a New Application Creating Reports for OEHR_ORDERS and OEHR_ORDER_ITEMS Customizing the ORDER_ITEMS Report Linking the ORDERS Report to the ORDER_ITEMS Report Creating a New Application First. d. The Application Builder home page appears. 2. On the Workspace home page. Name . e.4 How to Create a Drill Down Report A drill down report is a type of report that displays summary data with links to related detail data in other reports. you need to import and install the OEHR Sample Objects application in order to access the necessary sample database objects. c. For Create Application . To create an application: 1. See "About Loading Sample Objects" on page 1-2. a form. 3. you also learn how to change the format of a column by editing column attributes.Accept the default. click the Application Builder icon. or a report and form.Enter Drilldown Reports.Select the schema where you installed the OEHR sample objects. From scratch. For Name. specify the following: a. 4. Additionally. a tabular form. Next. b. you need to add pages. Before you begin. For Schema . a report. you add two blank pages. Application . In this tutorial. For this exercise. You have the option of adding a blank page.Accept the default. Click Next. you create a report on the OEHR_ORDERS table that contains links to drill down to additional data in the OEHR_ORDER_ITEMS table. create a new application. Click Create. Select Create Application and click Next.

For Attributes. Figure 4–1 Add Page b. Review your selections and click Create.Accept the default. accept the defaults for Authentication Scheme.Orders 2 . b. Page Name . Blank. you need to create reports for the OEHR_ORDERS and the OEHR_ORDER_ITEMS tables. 7. Under Add Page: a. 9. Subordinate to Page . First. and click Next. Language. The Application home page appears. Select Page Type . d. Click Next. Note that your application contains three pages: ■ ■ ■ 1 .Login Creating Reports for OEHR_ORDERS and OEHR_ORDER_ITEMS Next. c.Select Blank.Creating Reports for OEHR_ORDERS and OEHR_ORDER_ITEMS 5. 6. One Level of Tabs. accept the default. Page Name . No. Select Page Type . Language Preference Derived From and click Next. For Tabs. 10. 8. Add the second blank page. For User Interface.Order Items 101 . The two new pages appear at the top of the page. 12. Click Add Page. Click Add Page. For Copy Shared Components from Another Application. and click Next. accept the default. c. and User 11.Enter Orders.Accept the default. Under Add Page: a. select Theme 2 and click Next. add the first blank page.Enter Order Items. Topics in this section include: ■ Create a Report for OEHR_ORDERS 4-2 Oracle Database Application Express Advanced Tutorials . as shown in Figure 4–1.

Page Title . For Table/View. select the table. For Table/View Owner. 2. select the default. f.Creating Reports for OEHR_ORDERS and OEHR_ORDER_ITEMS ■ Create a Report for OEHR_ORDER_ITEMS Create a Report for OEHR_ORDERS To create a report on the OEHR_ORDERS table: 1. For Page Attributes: a. b. From the Table/View list. select OEHR_CUSTOMERS. Click Next.Enter Orders. c. The columns in the OEHR_ORDERS table appear.Enter Orders. From the Available Columns list. accept the default. create a join with the OEHR_CUSTOMERS table to display the customer name. click Create Page. From the Available Columns list. 5.Enter 1. For Tables and Columns: a. For page type. f. The columns in the OEHR_CUSTOMERS table appear. e. Page Number . ORDER_DATE Figure 4–2 Selected Columns Next. For Breadcrumb. 3. How to Create a Drill Down Report 4-3 . Region Title . c. ORDER_TOTAL. 4. e. Click Next. select Report and click Next. For Region Template. press Ctrl to select and move the following columns to the Displayed Columns list as shown in Figure 4–2: ORDER_ID. Select Wizard Report and click Next. accept the default. select CUST_LAST_NAME and move it to the Displayed Columns list. d. First. b. On the Application home page. d. select OEHR_ORDERS.

As shown in Figure 4–3. enter your workspace user name and password and click Login. The Column Attributes page appears. Run the page by clicking the Run Page icon. 4. 5. 7. Order Date. Under Regions. 4-4 Oracle Database Application Express Advanced Tutorials . Change the Format of Order Date Column To change the format of the Order Date column: 1. Click Edit Page 1 on the Developer toolbar. select the date format DD-MON-YYYY (for example. Figure 4–4 Report Link The Report Attributes page appears. Locate the section Column Formatting. accept the defaults and click Next. 3. See "About Application Authentication" on page 1-5. The Page Definition for page 1 appears. accept the defaults and click Next. Figure 4–3 Report on OEHR_ORDERS Table Note the report displays four columns: Order Id. The Edit icon resembles a small page with a pencil on top of it. 6. For Join Conditions. Also note that your data might appear in a different order. 2. 8. a report on the ORDERS table appears. Next. Also notice the format of the Order Date and Order Total Columns. and Order Total.Creating Reports for OEHR_ORDERS and OEHR_ORDER_ITEMS 6. you will change the format of these two columns. 12-JAN-2004). click the Report link as shown in Figure 4–4. 9. If prompted for a user name and password. Click the Edit icon next to ORDER_DATE. From Number/Date Format. Cust Last Name. You can ignore this difference and continue with the steps. Click Create Report Page. For Report Options. Click Apply Changes.

change the format of the Order Total Column. Locate the section Column Formatting. Change the Format of Order Total Column To change the format of the Order Total column: 1.10). $5. 5. Create a Report for OEHR_ORDER_ITEMS To create a report on the OEHR_ORDER_ITEMS table: 1. c. Page Number . For Page. On the Application home page. How to Create a Drill Down Report 4-5 . Figure 4–6 Report on OEHR_ORDERS Table with New Column Formats 6.Enter Order Items. select the number format that includes a dollar sign (for example. click Create Page.Enter Order Items. b. 2. For Breadcrumb. select Wizard Report and click Next. Click Apply Changes. the revised report on the OEHR_ORDERS table appears. Region Title . e. 2. 3. 4. For Region Template. Next. The Column Attributes page appears.Enter 2. Page Title . 234. On Create Page. accept the default. From Number/Date Format. Figure 4–5 Run Page Icon As shown in Figure 4–6.Creating Reports for OEHR_ORDERS and OEHR_ORDER_ITEMS The Report Attributes page appears. 4. For Page Attributes: a. select Report and click Next. d. Click the Edit icon next to ORDER_TOTAL. accept the default. 3. Run the page by clicking the Run Page icon in the upper right corner as shown in Figure 4–5. Click Application on the Developer toolbar to return to the Application home page.

UNIT_PRICE. For Report Options. Next. For Join Conditions. d. Click Next. a report on the OEHR_ORDER_ITEMS table appears. accept the defaults and click Next. c. ORDER_ID. The columns in the OEHR_ORDER_ITEMS table appear. Click Run Page. Table/View Owner . select PRODUCT_NAME and move it to the Displayed Columns list. For Tables and Columns: a. Figure 4–7 Report on OEHR_ORDER_ITEMS Table 4-6 Oracle Database Application Express Advanced Tutorials . From the Available Columns list. b. As shown in Figure 4–7. create a join with the OEHR_PRODUCT_INFORMATION table to display the product name. For Show Only Related Tables. QUANTITY Next. Click Next. select OEHR_PRODUCT_INFORMATION. From the Available Columns list. 8. The columns in the OEHR_PRODUCT_INFORMATION table appear.Creating Reports for OEHR_ORDERS and OEHR_ORDER_ITEMS f. e. select No. press Ctrl and move the following columns to the Displayed Columns list: ORDER_ITEM_ID. Click Create Report Page. 7.Accept the default. 6.Select OEHR_ORDER_ITEMS. select the table. Table/View . 9. accept the defaults and click Next. 5. f. g. From the Table/View list.

you add an item to hold the value of the ORDER_ID. Under Regions. Click Create Item. Topics in this section include: ■ ■ ■ Add an Item to Hold the Value of ORDER_ID Add a Where Clause to Restrict the Report Modify the Region Title Add an Item to Hold the Value of ORDER_ID To create an item to hold the value of ORDER_ID: 1. Click Next. Region . For Item Type.Enter P2_ORDER_ID. select Hidden and click Next.Customizing the ORDER_ITEMS Report Customizing the ORDER_ITEMS Report Next. 2. c. b.Select Order Items. Click Edit Page 2 on the Developer toolbar.Accept the default. 5. add a WHERE clause that constrains the report by the value of ORDER_ID item. To add a WHERE to the ORDER_ITEMS report: 1. Sequence . The Page Definition appears. you add a WHERE clause that constrains the report by the value of ORDER_ID item. Under Items. you need to customize the Order Items page. and modify the Region Title to note which order is being viewed. d. Item Name . Add a Where Clause to Restrict the Report Next. For Display Position and Name: a. click the Create icon as shown in Figure 4–8. In this exercise. 4. select Order Items as shown in Figure 4–9. Figure 4–8 Create Icon 3. How to Create a Drill Down Report 4-7 .

To create a link from the ORDER_ID column on the OEHR_ORDERS report to the OEHR_ORDER_ITEMS report: 1. populate the P2_ORDER_ID hidden item on page 2 with the clicked ORDER_ID. 2. The link will populate the P2_ORDER_ID hidden item on page 2 with the clicked ORDER_ID. select P2_ORDER_ID. a. b. From Item 1 Name. select OEHR_ORDER_ITEMS. Note that you may need to click Search to view available columns. In the second Column field. Modify the Region Title To modify the region title of the ORDER_ITEMS report: 1. you must edit the attributes of the ORDER_ID column on the OEHR_ ORDERS report and create a link. Linking the ORDERS Report to the ORDER_ITEMS Report Lastly. replace the existing text with the following: Order Items for Order # &P2_ORDER_ID.ORDER_ID. click Order Items.Linking the ORDERS Report to the ORDER_ITEMS Report Figure 4–9 Order Items 2. 3. Under Regions. In the Page field. Under Regions. 5. 4. To accomplish this. On the Modify Join Conditions page: a. b. 3. Click the Report Attributes tab. On the Page Definition. you link the OEHR_ORDERS report to the OEHR_ORDER_ITEMS report. Click Apply Changes. Scroll down to Column Link. click Orders. For the first Column. 2. Click Modify Join Conditions. replace the existing text with the following condition: :P2_ORDER_ID 5. Click the Query Definition tab. enter 1 in the Page field in the Navigation bar and click Go. Next. 4-8 Oracle Database Application Express Advanced Tutorials . 4. Click Apply Changes. Click the Edit icon next to ORDER_ID. select 2 Order Items. In Title. 3.

Scroll to the top of the page and click Apply Changes. select #ORDER_ID#. Figure 4–10 Column Link Attributes for the ORDER_ID Column 6. select #ORDER_ID#. From Item 1 Value. As shown in Figure 4–11. you can link to page 2 by clicking an Order Id. Click the Run Page icon in the upper right corner of the page. Your Column Link attributes should resemble Figure 4–10 on page 4-9. Figure 4–11 OEHR_ORDERS Report with Link to Page 2 How to Create a Drill Down Report 4-9 . d.Linking the ORDERS Report to the ORDER_ITEMS Report c. For Link Text. 7.

Linking the ORDERS Report to the ORDER_ITEMS Report 4-10 Oracle Database Application Express Advanced Tutorials .

you create the underlying data objects for a data input form by running a script. In this tutorial. In turn. you control the placement and style of form elements (called items) inside of regions using item attributes. How to Control Form Layout 5-1 . you create a table named HT_EMP and then use a wizard to create a new page. Topics in this section include: ■ ■ ■ Create the HT_EMP Table Create a New Page Containing an Input Form Run the Page Create the HT_EMP Table First. This section contains the following topics: ■ ■ ■ ■ ■ ■ ■ ■ ■ Creating a Table and Data Input Form Changing the Appearance of a Page by Altering Region Attributes Understanding How Item Attributes Affect Page Layout Adding a Region Header and Footer Making a Region Conditional Adding a Region to Contain Hint Text Changing Item Types About Label Templates Changing Buttons Creating a Table and Data Input Form The first step in creating a data input form is to create the underlying data objects. you create a new table by running a script in SQL Scripts. Then. On the Workspace home page. There are several attributes that control the placement and positioning of regions on pages. you create a data input form and learn how to change the form layout by altering region and item attributes.5 How to Control Form Layout Data and form elements in an Oracle Application Express application are placed on a page using containers called regions. In this exercise. click SQL Workshop and then SQL Scripts. To create the HT_EMP table and the appropriate associated objects: 1.

emp_last_name. rec_create_date) VALUES (1. :new.'ACCOUNTING'. emp_manager. emp_salary NUMBER. emp_first_name.'F'. emp_hiredate. 100000. date) INSERT INTO ht_emp (emp_id.emp_id FROM DUAL. emp_ telecommute. 3. END. emp_special_info. emp_first_name VARCHAR2(30) not null. The Script Editor appears. emp_part_or_full_time VARCHAR2(1) not null check (emp_part_or_full_time in ('P'.'F')). emp_salary. emp_last_name VARCHAR2(45) not null. VARCHAR2(1) check (emp_telecommute in ('Y')). In the Script Editor. 2.rec_create_date := SYSDATE. / CREATE OR REPLACE TRIGGER bu_ht_emp BEFORE UPDATE ON ht_emp FOR EACH ROW BEGIN 5-2 Oracle Database Application Express Advanced Tutorials . emp_dept VARCHAR2(20) check (emp_dept in ('SALES'.null. Click Create.'cell phone number is xxx.'Tiger'. 4.nextval INTO :new. SYSDATE) / CREATE SEQUENCE ht_emp_seq start with 2 / CREATE OR REPLACE TRIGGER bi_ht_emp BEFORE INSERT ON ht_emp FOR EACH ROW BEGIN SELECT ht_emp_seq. 'MANUFACTURING'. In Script Name.xxx.Creating a Table and Data Input Form The SQL Scripts home page appears.'Y'. emp_hiredate emp_manager emp_special_info emp_telecommute rec_create_date rec_update_date / DATE.'SALES'.yyy. emp_middle_initial. DATE not null. NUMBER references ht_emp.'R'.yyyy'.sysdate.'Scott'. emp_part_or_ full_time. enter HT_EMP. enter the following data definition language (DDL): CREATE TABLE ht_emp ( emp_id NUMBER primary key. VARCHAR2(2000). emp_middle_initial VARCHAR2(1).xxxx home phone is yyy. emp_dept.'HR')).

5. b. Figure 5–1 Details View in the Manage Script Results Page 8. Return to the Workspace home page. Select Create Application and click Next. Click Run. 4.Accept the default. Click Create. c.Accept the default.Enter Form Layout. 3. Next. Click the View Results icon to access the Results page. The Application Builder home page appears. d. 7. From scratch.Select the schema where you installed the OEHR sample objects. create a new application. a report. click the Application Builder icon. The script appears in the SQL Scripts Repository.rec_update_date := SYSDATE. Run the HT_EMP script: a. Red text indicates errors while executing the file. specify the following: a. From the View list. You have the option of adding a blank page. Click Save. Application . Add a blank page: How to Control Form Layout 5-3 . On the Workspace home page. 6. e. END. click Run again. / 5. For Create Application . For Schema . Click the HT_EMP script. For this exercise. See Also: "Using SQL Scripts" in Oracle Database Application Express User's Guide. Click Next. Click the Home breadcrumb link at the top of the page. 2. you add two blank pages. you need to add pages. On the Run Script page. or a report and form. select Details and click Go. Name . Creating a New Application Next. a form. To create an application: 1.Creating a Table and Data Input Form :new. For Name. 6. c. a tabular form. b.

Enter 2. Note that your application contains two pages. and then click Next. 12. e. 7. Create a New Page Containing an Input Form Next. Click Next. Under Select Page Type. c. and click Next. For Table/View Name. select Form on a Table or View and click Next. For Page. Figure 5–2 Add Page b. Page Number . For Copy Shared Components from Another Application. Click Next. accept the default. On the Application home page. For Table/View Owner. Page Name . accept the default. and User 11. 3. 9. create a new form using the Form on a Table or View Wizard. accept the default. click Create Page. On Create Page. 5. Click Add Page. To create a data input form: 1. Region Template . Review your selections and click Create. Breadcrumb .Accept the default. Blank. For User Interface. select Form and click Next. 4. b. f. Language Preference Derived From and then click Next. 10. 2. d. No. as shown in Figure 5–2. 5-4 Oracle Database Application Express Advanced Tutorials . accept the default and click Next. For Page and Region Attributes: a. accept the defaults for Authentication Scheme. For Tabs.Enter HT_EMP. select Theme 12 and then click Next. The blank page appears at the top of the page.Enter Form Layout.Accept the default. Language.Creating a Table and Data Input Form a. select the HT_EMP table and click Next. 6. For Attributes. One Level of Tabs. The Application home page appears. 8. Region Title .

To run the page from the Page Definition: 1. As shown in Figure 5–4 on page 5-6. Validations. 8. For Process Options. You are removing this validation because the value of this column is set using a trigger. Note that the wizard reads the primary key from the database definition. the new form appears. Press SHIFT. The item will have no value in the form for a new record. text areas. For Source Type. select P2_REC_CREATE_DATE not null. Click Finish. and click Next. For Tab. and display only items. 9. The Page Definition for page 2 appears. click Next. select all the columns. Note that the HT Emp form contains basic employee details and includes select lists. accept the default. 12. How to Control Form Layout 5-5 . See "About Application Authentication" on page 1-5. enter your workspace user name and password and click Login. 10. 15. Figure 5–3 Run Page Icon 2. Click the Run Page icon in the upper right corner as shown in Figure 5–3. the next step is to run the page. For Branching. Run the Page Once you create the HT_EMP table and page 2. accept the defaults and click Next. Click Delete. 14. enter 2 (the page you are creating) in both fields and click Next. Click the Edit Page icon. Do not use tabs. Delete the following validation: ■ ■ Under Page Processing. 13. For Select Columns. accept the default Existing Trigger and click Next. you will not be utilizing branching. select the first column 11. If prompted for a user name and password. This validation was automatically created because the underlying database column is not null. Since this page is just for demonstration. Then. For Primary Key.Creating a Table and Data Input Form 7. accept the default and click Next. and then the last one. The application appears.

Notice that the page defaults with one item for each row and labels display to the left of the items. Changing the Appearance of a Page by Altering Region Attributes A region is an area on a page that serves as a container for content. 5-6 Oracle Database Application Express Advanced Tutorials . This item type is a better choice for large text items since it allows for wrapping of input text. You can override this default behavior by configuring user interface defaults for the table. You can alter the appearance of a page by changing the region attributes. Also notice that items based on date columns default to include a date picker. In reality. Under Regions.Changing the Appearance of a Page by Altering Region Attributes Figure 5–4 HT_EMP Form By default. Topics in this section include: ■ ■ ■ Change the Region Title Change the Display Point and Template Change the Region Attributes Back to the Original Selections Change the Region Title To change the region title and other region level attributes: 1. the primary key is included in the page. but appears as a hidden item. the Primary Key column does not display since it is assumed that the primary key is system generated. Click Edit Page 2 on the Developer toolbar. 2. click Form Layout. See Also: "Managing User Interface Defaults" in the Oracle Database Application Express User's Guide. Lastly. notice that the Emp Special Info item was created as a text area because of the size of the base column. The item labels default to the column names with initial capitalization and with the underscores (_) replaced with spaces.

3. The Region Definition appears. 2. 6. temporarily change the region template. 7. You can view specific positions by selecting the flashlight icon to the right of the Display Point list. From the Page Definition. Under Regions. The region display points are determined by the page level template. The form appears as shown in Figure 5–5. Return to the Page Definition. You can control the position of a region within a page template by changing the page template. Oracle Application Express uses the default page level template defined in the current theme.Changing the Appearance of a Page by Altering Region Attributes The Region Definition appears. click the Run Page icon in the upper right corner. 4. 3. Click Apply Changes at the top of the page. 4. From the Page Definition. your selection moves the region to the right side of the page. select Page Template Region Position 3. Next. click Employee Info. Change the Title to Employee Info. Change the Display Point and Template To change other region attributes: 1. Note the new region title. How to Control Form Layout 5-7 . From Template. If you do not select a page level template. From Display Point. click the Run Page icon in the upper right corner. Click Edit Page 2 on the Developer toolbar. In this instance. 5. 5. Scroll down to User Interface. select Borderless Region. Click Apply Changes at the top of the page.

Also. and so on. select list. Item attributes control the display of items on a page. An item can be a text field. 6. Scroll down to User Interface.Understanding How Item Attributes Affect Page Layout Figure 5–5 HT_EMP Form with New Display Point and Template Note the changes in the appearance of the form. note that there is no longer a border around the form. Understanding How Item Attributes Affect Page Layout An item is part of an HTML form. Under Regions. Item attributes determine where a label displays. 3. Click Apply Changes at the top of the page. text area. 2. select Employee Info. Items above region content). From the Display Point List. From the Template list. select Page Template Body (3. check box. The form title displays in a dark color on a white background and has a rule beneath it. how large an item will be as well as whether the item displays next to or below a previous item. Change the Region Attributes Back to the Original Selections To return to the region template and display point to the original selections: 1. Click Edit Page 2 on the Developer toolbar. select Form Region. 4. password. Topics in this section include: ■ ■ ■ Edit Item Attributes Fix Item Alignment Change a Region to Display-only 5-8 Oracle Database Application Express Advanced Tutorials . You can change multiple item labels at once on the Page Items summary page. 5.

Under Items. Common item attribute changes include: ■ ■ Changing item labels by editing the Prompt field. ■ ■ 3. and Width Field Values New Line Yes Yes No No Yes Yes Yes Yes Width 30 15 2 15 2 10 15 10 Table 5–1 Prompt Field Emp ID First Name Middle Initial Last Name Part or Full Time Salary Department Hire Date How to Control Form Layout 5-9 . make the following changes: a. enter a new value in the Sequence field. Edit Item Attributes To edit all item attributes: 1. New Line. Reordering the items. To reorder items. Changing the item width. locate the Items section. Placing more than one item in certain rows to group like items together. Figure 5–6 Edit All Icon The Page Items summary page appears. and Width fields to match those in Table 5–1: New Prompt. Change the values in the Prompt. The initial order of items is based on the order of the columns in the table on which the region is based. New Line. You change how a page appears by editing the item attributes.Understanding How Item Attributes Affect Page Layout See Also: "Understanding Page-Level Items" in Oracle Database Application Express User's Guide. For example. On the Page Definition for page 2. click the Edit All icon. To change the item width. To see the how item attributes affect page layout. you could group all items that make up an employee's name. Many items display better when they have a width that is less than the maximum. enter a new value in the Width field. 2. The Edit All icon resembles a small grid with a pencil on top of it as shown in Figure 5–6.

For example. This change causes five items to display above Special Information (First Name. Oracle Application Express lays out regions as tables. setting the Column Span for the Special Information item to 5 would enable multiple items to display above and below it. but in the same column. Note that this setting can make text items appear squashed. Fix Item Alignment There are several approaches to fixing item alignment: ■ For the items Middle Initial. and Last Name). set New Field to equal No. and Width Field Values Prompt Field Manager Special Information Telecommute Record Create Date Record Update Date b. Click the Run Page icon in the upper right corner of the page. Middle Initial. The Manager item would still be in the same 5-10 Oracle Database Application Express Advanced Tutorials . This places the items directly after the items they follow. that using Column Span to fix the display of the name does not result in a consistent layout. however. Be aware.) Figure 5–7 HT_EMP Form After Editing the Prompt. ■ Change the Column Span field of the Special Information item. Last Name and Manager items. c. (See Figure 5–7. This approach is best used for positioning embedded buttons next to items. New Line No Yes Yes Yes Yes Width 15 60 2 10 10 Click Apply Changes. New Line.) New Prompt. and the width of each column is determined by the largest display width of the items in that column. Width Attributes Note that some items are pushed too far to the right because of the width of the Special Information item.Understanding How Item Attributes Affect Page Layout Table 5–1 (Cont. New Line.

Column Span. edit the column width for Special Information. 4. Click Create Item. The Reorder Region Items icon resembles a light green down or up arrow Figure 5–9.Select Employee Info. Region . Next. Add a Stop and Start HTML Table Item To add a Stop and Start HTML Table item and reset the column width: 1. Note that items are laid out in tables. Figure 5–9 Reorder Region Items Icon The Reorder Region Items page appears in a separate window. and Label Alignment attributes. This forces the close of an HTML table using the </table> tag and starts a new HTML table. Figure 5–8 Create Icon 3. you simply remove the defaulted label. You can change the order in which items display. you could change the Column Span of the Manager item to 3 so it displays above Special Information. Under Items. d. ■ Reset the column width in the middle of the region by adding an item of type Stop and Start HTML Table. Click Edit Page 2 on the Developer toolbar.5. b. To do this. New Field. c. Under Items.Delete _X from the name. click the up and down How to Control Form Layout 5-11 . click the Reorder Region Items icon. To fix this. For Display Position and Name: a. 5.Enter 4. Item Name . 2. Last Name would still be pushed too far to the right. select Stop and start table and click Next. For Item Type. You can edit the position of an item by selecting values for New Line. Sequence . Because the Manager item is larger than Middle Initial. click the Create icon as shown in Figure 5–8. You can prevent the label from displaying at all by setting it to null. The Page Definition appears. Inserting a Stop and Start HTML Table item just after the Last Name item results in an even layout.Understanding How Item Attributes Affect Page Layout column as Middle Initial. Note that a Stop and Start HTML Table item only displays its label.

click the Create icon. Navigate to the Page Definition for page 2. 4. select Text Field (Disabled. 5-12 Oracle Database Application Express Advanced Tutorials . Click Apply Changes. 6. 3. Under Items. b. 4. Select the type of HTML region container you wish to create . Under Regions. saves state). select the item P2_REC_UPDATE_DATE. To make the item P2_REC_UPDATE_DATE display-only: 1. Click Apply Changes. 2. Identify the type of region to add to this page . HTML.Accept the default. For Region: a. Click the Run Page icon in the upper right corner. select Text Field (Disabled. change the Column Span to 3 and click Apply Changes. 7. Record Create Date and Record Update Date. HTML. create a new region and move the display-only items to the new region. Because the values of these columns are set with triggers. Navigate to the Page Definition for page 2. Click Edit Page 2 on the Developer toolbar. Create a New Region To create a new region: 1. 2. 3. For Special Information. Under Items. Change a Region to Display-only There are two columns in the HT_EMP table for auditing. and click Next. 2. Navigate to the Page Definition for page 2.Accept the default. Also notice that a graphical representation of how the items display appears at the bottom of the page. From the Display As list in the Name section. From the Display As list in the Name section. saves state).Understanding How Item Attributes Affect Page Layout arrows in the far right column. This exercise demonstrates how to make items display-only and then how to add them to their own region. and click Next. these columns should not be updatable by users. select the item P2_REC_CREATE_DATE. 3. Topics in this section include: ■ ■ ■ ■ Change Items to Display-only Create a New Region Move Audit Items to the New Region Change the Region Template to Hide/Show Region Change Items to Display-only To make the item P2_REC_CREATE_DATE display-only: 1. Next.

To change the region template to Hide/Show Region: 1. Click the Run Page icon in the upper right corner. add a colon to the end of the label name. By changing the region template to Hide/Show Region. select Audit Information. Figure 5–10 on page 5-13 demonstrates how these items would display in a running page. Move Audit Items to the New Region To move the items to the new region: 1. For Display Attributes. 5. Navigate to the Page Definition for page 2. For P2_REC_CREATE_DATE and P2_REC_UPDATE_DATE: a. c. Click Apply Changes. In the Prompt column. Figure 5–10 Audit Information Region Change the Region Template to Hide/Show Region The Hide/Show Region template enables the user to click a plus (+) sign to expand the contents of the region or click a minus (-) sign to hide the contents. 5. select Hide and Show Region from the Template list. users can decide whether they want to see the Audit Information region. 4. Under User Interface. The Page Items summary page appears. and click Next. enter Audit Information in the Title field.Understanding How Item Attributes Affect Page Layout 4. 4. Under Items. 3. click Audit Information. Navigate to the Page Definition for page 2. Click the Run Page icon in the upper right corner. Click Apply Changes. Under Regions. click the Edit All icon. You can hide the region by clicking the icon to the right of the region title. accept the remaining defaults. 2. The Edit All icon resembles a small grid with a pencil on top of it. How to Control Form Layout 5-13 . 3. In the Region column. b. Figure 5–11 demonstrates how Audit Information displays as a Hide/Show region. 2. Click Create Region.

Since the Employee ID is set by a trigger. the text would take up the entire width of the region (as defined by region template). Click the arrow next to Audit Information to display the two date fields and new footer text as shown in Figure 5–12. 7. P2_EMP_ ID) 5-14 Oracle Database Application Express Advanced Tutorials . Click Edit Page 2 on the Developer toolbar. Navigate to the Page Definition for page 2. You can control the display of the Audit Information region by using a built-in condition that checks for the presence of a value for the item containing the Employee ID (that is. 6. <br/>The Record Update Date is the date that the record was last updated.Adding a Region Header and Footer Figure 5–11 Audit Information as a Hide/Show Region Adding a Region Header and Footer Regions can have headers and footers. you create a display condition for the Audit Information region so that it only displays if the Employee ID is not null. 3. Scroll down to Header and Footer. Under Regions. Figure 5–12 Audit Information Region with Footer As shown in Figure 5–12. Headers and footers typically contain text or HTML that displays at either the top or bottom of the region. Making a Region Conditional To make a region conditional. 2. Click Apply Changes.</i> 5. it only exists for records retrieved from the database. Click the Run Page icon in the upper right corner. select Audit Information. To add a region footer: 1. 4. the text of the footer is wrapped with the italic HTML tag and there is an imbedded break. Without the manual break. Enter the following in Region Footer: <i>The Record Create Date is the date that the record was initially entered in to the system.

5. Navigate to the Page Definition for page 2. 4.Enter Hint. Click Next. Select the type of HTML region container you wish to create . and click Next. 3. Under Regions. Click Apply Changes. From Condition Type. select Audit Information. and click Next. select Value of Item in Expression 1 is NOT NULL.Select Sidebar Region. Under Conditional Display: a. b. Click Create Region. For Display Attributes: a. 6. Click the Run Page icon. HTML. Navigate to the Page Definition for page 2. HTML.Accept the default. Under Regions. 7. 3.Accept the default. For Region: a. This exercise explains how to create another region to display explanatory text (hints) for the user. c. Region Template . 2. The Region Definition appears. d.Select Page Template Region Position 3. b. 2.Select 3. Sequence .Accept the default. Display Point . To create a region to display hint text: 1. Identify the type of region to add to this page . enter the following: Use this page to enter and<br/> maintain employee information. 4. f. click the Create icon. Column .Adding a Region to Contain Hint Text To display the Audit Information region conditionally: 1. Scroll down to Conditional Display. b. Figure 5–13 shows the new Hint region on the page. e. Adding a Region to Contain Hint Text You have the option of displaying regions in columns as well as in rows. Title . enter: P2_EMP_ID 5. How to Control Form Layout 5-15 . In Enter HTML Text Region Source. In Expression 1.

Navigate to the Page Definition for page 2. (It will be redundant. 7. this item is a good candidate for either a check box or a radio group. To change the Part or Full-time item to a radio group: 1. The Edit Page Item page appears.Part-time. 2. you can also create named LOVs and reference them. b. The modified form appears as shown in Figure 5–14. remove the text in the Label field.F. this tutorial has you alter items by editing item attributes.Enter: STATIC:Full-time. Topics in this section include: ■ ■ ■ Change an Item to a Radio Group Change an Item to a Select List Change an Item to a Check Box Tip: For simplicity. Under Label. select Radiogroup.P This definition will display as two radio buttons with the labels Full-time and Part-time. 4.Select Select Named LOV.) Under List of Values. 5-16 Oracle Database Application Express Advanced Tutorials . Under Items. Click the Run Page icon in the upper right corner. navigate to the Item attributes page and select another Display As option. 6. As a best practice. 5. See Also: "Creating Lists of Values" in Oracle Database Application Express User's Guide Change an Item to a Radio Group Because the Part or Full-time item only has two valid choices. List of values definition . create a static list of values. From the Display As list in the Name section. Named LOV . however. At the top of the page. Specify the following: a. Click Edit Page 2 on the Developer toolbar. but the value being inserted into the database will be either F or P. 3.Changing Item Types Figure 5–13 Hint Region Changing Item Types This exercise describes how to change item types to make data entry easier for the user. click Apply Changes. To change an item type. select P2_EMP_PART_OR_FULL_TIME.

select P2_EMP_DEPT. By changing this setting to match the number of valid values (that is. In Number of Columns. or a Popup LOV. a select list. Click the Run Page icon. To display the Full-time and Part-time radio buttons side by side: 1. click Apply Changes. Scroll down to List of Values. Navigate to the Page Definition for page 2. 3. You can have these buttons display side by side. the values display side by side as shown in Figure 5–15. 5. select P2_EMP_PART_OR_FULL_TIME. From the Display As list in the Name section. 4. Figure 5–15 Part or Full-time Item Displayed Side by Side Change an Item to a Select List In the DDL you used to create the HT_EMP table. Department is validated by a check constraint. enter 2. 2. At the top of the page. 2. Full-time and Part-time). Under Items. You can implement Department as a radio group.Changing Item Types Figure 5–14 Part or Full-time item Changed to a Radio Group Notice that Full-time and Part-time displays as a radio group that is stacked in one column. How to Control Form Layout 5-17 . Navigate to the Page Definition for page 2. Click Edit Page 2 on the Developer toolbar Under Items. select Select List. 3. To change Department to a select list: 1. 6.

4. you can also move it up on the page and place it next to the Full-time and Part-time radio group. d. select P2_EMP_TELECOMMUTE. select Checkbox. Under Items. create a static list of values.No Assignment - The last two selections take into account that the EMP_DEPT column can contain nulls.HR c. 5-18 Oracle Database Application Express Advanced Tutorials .Changing Item Types The other Select List choices are for either redirecting the user to another page or URL based on the selection. select Yes. Scroll down to List of Values. you should set Display Null to Yes. 2. 3. click Apply Changes. 6. Click the Run Page icon.Select Select Named LOV List of values definition . When you change the Display Type.MANUFACTURING. The revised form appears as shown in Figure 5–16. Specify the following: a. 7. From the Display As list in the Name section. Figure 5–16 Department Changed to a Select List Change an Item to a Check Box The item Telecommute is ideal for a check box. Under List of Values. 5. Named LOV . b.Enter: STATIC:SALES. Click Edit Page 2 on the Developer toolbar.ACCOUNTING. or submitting the current page which is used when other information needs to be retrieved based upon the selection in the Select List. To change Telcommute to a check box: 1. In Null display value. At the top of the page. As a best practice. Failure to do so results in the item defaulting to the first item in the select list. enter: . whenever you implement a select list and have a column that can be null. From Display Null. Navigate to the Page Definition for page 2.

Note that the check box appears for Telecommute as shown in Figure 5–17. Figure 5–18 Templates and Theme How to Control Form Layout 5-19 .About Label Templates 4.Enter: STATIC:. 7. 2. 5. 8. specify the following: a.Y This List of values definition displays the check box after the label. specify the following: a. Named LOV . You can view the templates associated with the current theme on the Page Definition. Click Edit Page 2 on the Developer toolbar. Figure 5–17 Telecommute Field Changed to Check Box About Label Templates You can control the look of an item label by using a label template. b. Locate the Shared Components area and note the Theme section as shown in Figure 5–18 on page 5-19.Select Select Named LOV. but will not display a value associated with the check box. Sequence . To view templates associated with the current theme: 1. Under Displayed. Begin on New Line . b. List of values definition . click Apply Changes.Enter 55. Click the Run Page icon. Navigate to the Page Definition for page 2. If the check box is checked. the value passed to the database will be Y.Select Yes. 6. To have the label precede the check box. Scroll down to List of Values. At the top of the page.

this would be done with a link from a report page. 5. or in any button position defined in the region template. click the Edit All icon in the Buttons section. These buttons were created as HTML buttons and positioned at the top of the region. Under Items. 5. Buttons can also have templates associated with them to refine how they look. below the region. 2. Running the Page for Update You can run the page and provide it with an Employee ID to retrieve. To change to a different label template: 1. Click Apply Changes. note that the Delete and Apply Changes buttons now display as shown in Figure 5–19. Under Buttons. In the Templates section. 4. above the region.Changing Buttons The current theme is Blue.com/pls/otn/f?p=9659:2:1284393467360777225::::P2_EMP_ID:1 This will pass the value 1 to the item P2_EMP_ID. Scroll down to Label and make a selection from the Template list. Make a new selection from the Position column. Also note that a value now appears in the Record Create Date field. or the page is being used to update an existing record. If you run the page. Click Apply Changes. Navigate to the Page Definition for page 2. The Create button appeared previously because the page was expecting a new record to be created. 2. Run the page. 3. 5-20 Oracle Database Application Express Advanced Tutorials . but for this example. Typically. select an item. Changing Buttons The wizard that created the form in this tutorial also created buttons. You can also position buttons at the bottom of the region. The Edit All icon resembles a small grid with a pencil on top of it. The Required with Help label template prepends a yellow asterisk to the left of the item label. To change a button position: 1. 4. note that this theme includes two Label templates: Optional Label with Help and Required Label with Help. You can change the appearance of an item by selecting another template. run the page and add P2_EMP_ID:1 to the end of the URL as shown in the following example: http://apex.oracle. These buttons display conditionally based upon whether the page is being used to create a new record (that is P2_EMP_ID equals null). to the left or right of the page title. 3. Run the page. Navigate to the Page Definition for page 2.

Making Data Bold One way to make the information in a region easier to read is to make the labels (or the data) more pronounced. In the latter approach. To make data bold manually: 1. 6. Navigate to the Page Definition for page 2. or create a new label template. Under Items. specifying another font. 5. select an item name. To make a label bold. Click Apply Changes. Scroll down to Element.Making Data Bold Figure 5–19 HT_EMP Update Form See Also: "Understanding URL Syntax" in Oracle Database Application Express User's Guide. You can accomplish this by changing the color. you would create a new label template that would wrap the HTML tag for bold around the label and then associate that template with the items in the Audit Information region. 4. 3. 2. In HTML Form Element Attributes. Run the page. enter: class="fielddatabold" This example references a class in the Cascading Style Sheet associated with this application. How to Control Form Layout 5-21 . you could bold the data manually. or using bold.

Making Data Bold 5-22 Oracle Database Application Express Advanced Tutorials .

The Application Builder home page appears. Application . Name . you need to import and install the OEHR Sample Objects application in order to access the necessary sample database objects. e. Check boxes on a form work similarly to a list of values. Click Next. This section contains the following topics: ■ ■ ■ ■ ■ Creating an Application Editing the Update Form Change the Report Display Create Multi Value Check Boxes to Filter Content Adding Check Boxes to Each Row in the Report Creating an Application First. When you define an item to be a check box. Create Application . To create an application using the Create Application Wizard: 1.Select From scratch. How to Work with Check Boxes 6-1 . click the Application Builder icon. Schema . d. On the Workspace home page. b. For Name: a. You define check boxes on a report using the supplied function. Select Create Application and click Next. Click Create. See "About Loading Sample Objects" on page 1-2. you need to provide the check box value in the List of Values section of the Item Attributes page. 4. or you can create check boxes in reports. Next. you need to create an application using the Create Application Wizard. 2.Select the schema where you installed the OEHR sample objects.Enter Check Boxes. For this exercise. you need to add a page. This tutorial illustrates different ways in which you can create check boxes and explains how to reference and process the values of checked boxes. you can create check boxes as items. Before you begin. APEX_ITEM.6 How to Work with Check Boxes In Oracle Application Express. c.CHECKBOX. 3. you add a report and form.Accept the default.

Creating an Application 5. review the application by running it. Click Apply Changes. Click OEHR_PRODUCT_INFORMATION next to page 2 at the top of the page as shown in Figure 6–1. Table Name . For Tabs. Select Page Type -Select Report and Form. Review your selections and click Create. and click Next. One Level of Tabs. edit the page names to make them more meaningful. Language. 6-2 Oracle Database Application Express Advanced Tutorials . Click Add Page.Select OEHR_PRODUCT_INFORMATION. 8. To add a report and form: a. and User Language Preference Derived From and click Next. 7. 6. Click OEHR_PRODUCT_INFORMATION next to page 1 at the top of the page as shown in Figure 6–1. To edit the name of page 2: a. c. No. 13. b. To run the application: 1. c. accept the default. Click Apply Changes. accept the defaults for Authentication Scheme. Click Next. Figure 6–1 Page Name in the Create Application Wizard b. c. Run the Application Next. In Page Name. Next. and click Next. For Attributes. 12. In Page Name. Two new pages appear in the list at the top of the page. select Theme 2 and click Next. b. replace the existing text with Update Form. accept the default. For Copy Shared Components from Another Application. Note that each page has the same page name. To edit the name of page 1: a. 9. For User Interface. The Application home page appears. 11. replace the existing text with Product Report. Click Run Application as shown in Figure 6–2. 10.

Editing the Update Form

Figure 6–2 Run Application Icon

2.

If prompted to enter a user name and password, enter your workspace user name and password and click Login. See "About Application Authentication" on page 1-5. The application appears. Note that the report contains ten columns displaying product information. Users can link to an update form by clicking the Edit icon in the far left column.

3.

Click the Edit icon next to a specific product. As shown in Figure 6–3, an update form appears.

Figure 6–3 Update Form

Editing the Update Form
Page 2 of your application is an update form. In this exercise, you modify this form by hiding the Warranty Period field and creating a new check box. Topics in this section include:
■ ■

Hide the Warranty Period Field Add a New Checkbox

Hide the Warranty Period Field
First, hide the Warranty Period field by changing the Display As attribute. To hide the Warranty Period field:
1.

Click Edit Page 2 on the Developer toolbar. The Page Definition for page 2 appears.

2. 3. 4.

Scroll down to the Items section. Under Items, select P2_WARRANTY_PERIOD. From Display As in the Name section, select Hidden.
How to Work with Check Boxes 6-3

Editing the Update Form

5.

Click Apply Changes.

Add a New Checkbox
In this exercise you create a check box that automatically sets the minimum product price to 75% of the list price. Topics in this section include:
■ ■ ■

Add a New Item Create a Process Edit the Item to Display as a Check Box
Tip: For simplicity, this tutorial has you create a checkbox by editing item attributes. As a best practice, however, you can also create a named LOV and reference it. See Also: "Creating Lists of Values" in Oracle Database Application Express User's Guide

Add a New Item
First, you add a new item. Initially, you create this item to display as a radio group and later change it to a check box. To add an item that displays as a radio group:
1. 2.

On the Page Definition for page 2, scroll down to Items. Under Items, click the Create icon as shown in Figure 6–4.

Figure 6–4 Create Icon

3. 4. 5.

For Item Type, select Radio and click Next. For Radio Group Control Type, select Radio group and click Next. For Display Position and Name:
a. b.

Item Name - Enter P2_SET_MIN_PRICE. Sequence - Enter 9.5. Note that this sequence positions the item below the P2_MIN_PRICE item (the Minimum Price field).

c. d. 6.

Region - Select Update Form. Click Next.

For List of Values:
a. b. c.

Named LOV - Select Select Named LOV. Display Null Option - Select No. List of Values Query - Enter:

6-4 Oracle Database Application Express Advanced Tutorials

Editing the Update Form

STATIC:Yes;Y,No;N d. 7.

Click Next.

For Item Attributes:
a. b. c.

Label - Replace the existing text with Set Minimum Price. Accept the remaining defaults. Click Next.

8.

For Source:
a. b.

Item Source - Select SQL Query. Item Source Value - Enter:
SELECT 'Y' FROM DUAL WHERE :P2_LIST_PRICE*0.75=:P2_MIN_PRICE

c.

Accept the remaining defaults and click Create Item.

Create a Process
Next, you create a page process that sets the minimum price at a 25% discount of the list price. To create a page process:
1. 2. 3. 4.

On the Page Definition for page 2, locate the Page Processing area. Under Processes, click the Create icon. For Process Type, select PL/SQL and click Next. For Process Attributes:
a. b. c. d.

Name - Enter Update Min Price. Sequence - Accept the default. Point - Select OnSubmit - After Computations and Validataions. Click Next.

5.

For Process:
a.

Enter the following:
UPDATE oehr_product_information SET MIN_PRICE=(:P2_LIST_PRICE*0.75) WHERE PRODUCT_ID=:P2_PRODUCT_ID;

b. 6.

Click Next.

For Messages:
a.

Success Message - Enter:
Product successfully updated.

b.

Failure Message - Enter:
Unable to update this product. Contact your system administrator.

c. 7.

Click Next.

For Process Conditions:
a.

Condition Type - Select Value of Item in Expression 1 = Expression 2.
How to Work with Check Boxes 6-5

Editing the Update Form

b.

Expression 1 - Enter:
P2_SET_MIN_PRICE

c. d.

Expression 2 - Enter Y. Click Create Process.

Run the Page To run the page:
1. 2.

Click the Run Page icon in the upper right corner. If prompted to enter a user name and password, enter your workspace user name and password and click Login. See "About Application Authentication" on page 1-5. The revised form appears as shown in Figure 6–5. Note that the Warranty Period field no longer displays and a new Set Minimum Price radio group appears.

Figure 6–5 Update Form with Set Minimum Price Radio Group

Edit the Item to Display as a Check Box
Next, change the Set Minimum Price radio group (P2_SET_MIN_PRICE) to display as a check box. To edit P2_SET_MIN_PRICE:
1.

Click Edit Page 2 on the Developer toolbar. The Page Definition for Page 2 appears.

2. 3. 4. 5. 6.

Under Items, click P2_SET_MIN_PRICE. From Display As, select Checkbox. Scroll down to Label. In Label, delete the existing text, Set Minimum Price. Scroll down to Default. In Default Value, enter N. Under Lists of Values:
a. b.

Number of Columns - Enter 1. List of values definition - Enter:

6-6 Oracle Database Application Express Advanced Tutorials

Run the Page To run the page. you change the number of columns that display on page 1 and then change the format of two columns to include a currency symbol. Under Regions.Product Report. To edit report attributes for page 1: 1. Figure 6–6 Update Form with Set Minimum Price Check Box Change the Report Display You can alter how a report displays by editing report attributes. Click 1 . change the number of columns that display. In the exercise. Click Apply Changes at the top of the page. You can use this page to precisely control the report layout. Click Application on the Developer toolbar. click the Run Page icon in the upper right corner.Y 7.Change the Report Display STATIC: <b> Set Minimum Price</b><br/> (25% Discount on List Price). Note the new Set Minimum Price check box. click the Report link as shown in Figure 6–7 on page 6-7. The revised form appears as shown in Figure 6–6 on page 6-7. The Application home page appears. 2. 3. First. The Page Definition for page 1 appears. Figure 6–7 Report Link The Report Attributes page appears. How to Work with Check Boxes 6-7 .

c. 6-8 Oracle Database Application Express Advanced Tutorials . the value that actually displays field is the Oracle number format. select Checkbox. Click the Next (>) icon at the top of the page. Deselect the Show check box for the following columns: ■ ■ ■ Weight Class Warranty Period Supplier ID Next. From Number / Date Format. select $5. The Page Definition for page 1 appears.10. click P1_REPORT_SEARCH. 6. edit List Price and Min Price columns to include a currency symbol. The revised report appears. and Supplier ID no longer appear and the List Price and Min Price columns include a currency symbol. Scroll down to Label. Warranty Period. b. delete the existing text and replace with Product Status.10. Notice the Weight Class. From Number / Date Format. Under Items. From Display As. b. Edit the List Price column: a. Topics in this section include: ■ ■ ■ ■ Change the Search Field to a Multi Value Check Box Edit the Report Region Definition Change the Default Check Box Behavior Change the Check Boxes to Display in Bold Change the Search Field to a Multi Value Check Box To change the search field to a check box: 1. For Label. Edit the Min Price column: a. 3. you change the Search field (P1_REPORT_SEARCH) on the Product Report page to a multi value check box.234. 5. These check boxes enable users to filter the report by product category (obsolete. 7.Create Multi Value Check Boxes to Filter Content 4. select $5. Min Price. 2. Note that you select a format by selecting an example. Create Multi Value Check Boxes to Filter Content In the next exercise. Click the Edit icon next to List Price. Click the Run Page icon in the upper right corner. 4. Click Edit Page 1 on the Developer toolbar. Clicking the Next icon submits your changes and then displays attributes for the next column.234. However. under development). orderable. planned. Click Apply Changes.

Under Page Processing. Edit the Report Region Definition To edit the report region definition: 1. 3. product_status return_value FROM oehr_product_information ORDER BY 1 Note: Note that to create a multi value check box. Computations. select Item on This Page and click Next. click Product Report. The Region Definition appears. In Source Value or Expression. notice the report returns all products. The Page Definition for page 1 appears. the List of Values query must return more than one row. if you deselect all the check boxes. click the Create icon. enter: obsolete:orderable:planned:under development 6.Create Multi Value Check Boxes to Filter Content 5. it is deselected). 5. Named LOV . in turn. Click Apply Changes at the top of the page. The default value of Y. Specify the following: a. The Page Definition for page 1 appears.product_status)> 0 4. This behavior results from the fact that if a check box has a NULL value (that is.. Scroll down to List of Values. Number of Columns .Enter: SELECT DISTINCT product_status display_value. Under Regions. Scroll down to Source. Change the Default Check Box Behavior Although the Product Status check boxes correctly filter the content on page 1. List of values definition .Enter 4. then it defaults to the default value Y. How to Work with Check Boxes 6-9 . In Source modify the WHERE clause to read as follows: .. WHERE instr(':'||:P1_REPORT_SEARCH||':'. Click Apply Changes at the top of the page. To add a computation that tracks the state of the check box: 1. For Item Location. 7. The Page Definition for page 1 appears. Scroll down to Source. The Create Page Computation Wizard appears.Accept the default. b. enables the check box. You can alter this behavior by adding a computation that remembers the state of the check box. Click Apply Changes at the top of the page. 2. c. 2.

select Value of Item in Expression 1 Is NULL. Computation Type . From Condition Type. 4. e. Change the Check Boxes to Display in Bold Next. Computation Point . Scroll down to Element. enter: P1_REPORT_SEARCH 6. b. The Page Definition for page 1 appears. Under Items. you use APEX_ITEM. To accomplish this.Select Static Assignment. 3. Click Create. Note that the Product Status check boxes display at the top of the page. specify the following: a. For Item. Enter: none(bogus_value) b.Adding Check Boxes to Each Row in the Report 3. 4. 5. Adding Check Boxes to Each Row in the Report In the next exercise. Compute Item . b. 5. In Expression 1. Sequence . The Page Definition for page 1 appears. In this instance. you must edit the report query and make a call to the APEX_ITEM package.Select After Submit. 7. Click Next. click P1_REPORT_SEARCH. Click the Run Page icon in the upper right corner. Click Next.Accept the default. Navigate to the Page Definition for page 1. you add a delete check box to each row in the Product Report. 2. enter: class="fielddatabold" Form Element Option Attributes are used exclusively for check boxes and radio buttons and control the way the Application Express engine renders individual options.CHECKBOX to generate check boxes in the Product 6-10 Oracle Database Application Express Advanced Tutorials . you edit the check box display values (or labels) so that they appear as bold text.Select P1_REPORT_SEARCH. APEX_ITEM is a supplied package for generating certain items dynamically. Click Apply Changes. In Form Element Option Attributes. d. In Computation: a. For Condition: a. To edit check box display values (or labels) to appear in bold: 1. c.

apex_item. Click the Up arrow on the far right until the DEL column is directly below PRODUCT_ID. Scroll to the top of the page and select the Report Attributes tab.G_F01 to APEX_APPLICATION. click Product Report. Navigate to the Page Definition for page 1.CHECKBOX To edit the query to call APEX_ITEM. When the page is submitted. "product_name".G_F50 based on the p_idx parameter value that was passed in.product_id) del. 2. Note that the value passed in for p_idx in the above example is 1. "product_status". "list_price". "catalog_url" FROM "oehr_product_information" WHERE instr(':'||:p1_report_search||':'. "product_description". "min_price". you need to move the DEL column. You can reference these values using the PL/SQL variables APEX_ APPLICATION.G_F01 later on. 3. Oracle Application Express automatically adds new columns to the end of the column list. Under Regions. SELECT "product_id".product_status)> 0 APEX_ITEM is an Oracle Application Express supplied package that you can use to generate certain items dynamically.CHECKBOX Add a Button to Submit Check Box Array Values Add a Process See Also: "APEX_ITEM" in Oracle Database Application Express User's Guide Call APEX_ITEM. Topics in this section include: ■ ■ ■ Call APEX_ITEM. "weight_class". How to Work with Check Boxes 6-11 . "category_id".checkbox(1. 4. Under Column Attributes. locate the Del column. In Region Source. 7.Adding Check Boxes to Each Row in the Report report. 5. add the new line appearing in bold face to the query. "warranty_period". You reference the check box values using the global variable APEX_APPLICATION. 6.CHECKBOX: 1. Scroll down to Source. Next. the values of the check boxes are stored in global package arrays. (See Figure 6–8 on page 6-12). "supplier_id".

2. Accept the remaining defaults and click Next. c. 6. c.Enter DELETE_PRODUCTS. 6-12 Oracle Database Application Express Advanced Tutorials . b.Enter Delete Products. b. Accept the remaining defaults and click Next. select 1 Product Report and click Create Button. Name . select Product Report (1) and click Next. Processes. select Create a button in a region position and click Next. For Process Attributes: a. The Page Definition for page 1 appears. 7. Under Page Processing. For Display Properties: a. 8. 4.Accept the default. 5. 3. For Branching.Select On Submit . For Button Attributes: a. Label . Under Buttons. Button Name . Sequence . For Process Type.Select Top of Region. For Button Region.Enter Delete Products. Add a Process To add a process that executes when the user clicks the Delete Products button: 1. For Point . click the Create icon. Position . accept the default selection and click Next. click the Create icon. For Position. 2. 3.Adding Check Boxes to Each Row in the Report Figure 6–8 Report Column Attributes Page 8. Add a Button to Submit Check Box Array Values To add a button to submit the check box array values: 1. Navigate to the Page Definition for page 1. In Button Template.After Computations and Validations. select PL/SQL and click Next. Click Apply Changes. b.

Enter the following PL/SQL process and then click Next: FOR i in 1. In Failure Message. In this exercise. select the Del check box and then click Delete Products. 4. In Success Message. 6. END LOOP. so you reference the column values using the global variable APEX_APPLICATION. 5. enter: Unable to delete product(s). To remove a product from the report. APEX_ITEM is an Oracle Application Express supplied package that you can use to generate certain items dynamically. the value passed in for product_id is 1. the values of each column are stored in global package arrays.G_F01 to APEX_APPLICATION. When a page is submitted. 7. which you can reference using the PL/SQL variable APEX_APPLICATION. Click Next. Notice that the Delete Products button appears above the report as shown in Figure 6–9. On Messages: a. b.G_F01. Click Create Process.count LOOP DELETE FROM oehr_product_information WHERE product_id = APEX_APPLICATION.G_F01(i). Run the page.G_ F50. enter: Product(s) deleted. Figure 6–9 Product Report with Delete Products Check Box How to Work with Check Boxes 6-13 .APEX_APPLICATION.Adding Check Boxes to Each Row in the Report d..G_F01.

Adding Check Boxes to Each Row in the Report 6-14 Oracle Database Application Express Advanced Tutorials .

This tutorial illustrates two methods for calling a Web service from within an Oracle Application Express application. SOAP is a World Wide Web Consortium (W3C) standard protocol for sending and receiving requests and responses across the Internet.1 specification is a W3C note. and returns a response. You can incorporate calls to external Web services in applications developed in Oracle Application Express. you create a Web service reference using a wizard. The service receives the request.w3. language independent environment.) For information about Simple Object Access Protocol (SOAP) 1.1 see: http://www.7 How to Implement a Web Service Web services enable applications to interact with one another over the Web in a platform-neutral. When you create the Web reference. In a typical Web services scenario. you can follow one of these methods: How to Implement a Web Service 7-1 . Topics in this section include: ■ ■ ■ ■ ■ About Creating Web Service References Creating a New Application Specifying an Application Proxy Server Address Searching a UDDI Registry Creating a Web Reference Manually Note: The SOAP 1. SOAP messages can be sent back and forth between a service provider and a service user in SOAP envelopes.org/TR/SOAP/ See Also: "Implementing Web Services" in Oracle Database Application Express User's Guide About Creating Web Service References To utilize Web services in Oracle Application Express. (The W3C XML Protocol Working Group has been formed to create a standard that will supersede SOAP. processes it. a business application sends a request to a service at a given URL by using the HTTP protocol. Web services in Oracle Application Express are based on SOAP (Simple Object Access Protocol).

Discovery. Add a blank page: a. For Attributes.Creating a New Application ■ You supply the URL to a WSDL document. click the Application Builder icon.) You search for the WSDL by entering either a service or business name. On the Application Builder home page. Under Select Page Type. For Name: a. b. Accept the remaining defaults and click Next. Figure 7–1 Add Page b. The new page appears in the list at the top of the page. and create the Web reference manually. 5. ■ You supply the relevant information on how to interact with the Web reference. enter Web Services and then click Add Page. c. and User Language Preference Derived From and click Next. For Tabs. This tutorial describes both methods. Language. select Create Application. For Shared Components. 8. and click Next. For Name . To create an application: 1. click Create. 2. select Theme 2 and click Next. Blank. In Page Name. Creating a New Application First. (A UDDI registry is a directory where businesses register their Web services. One Level of Tabs. and click Next. accept the default. After that. The wizard then analyzes the WSDL and collects all the necessary information to create a valid SOAP message. The wizard provides a step where you can locate a WSDL using the Description. 6.Enter Web Services. and click Next. For User Interface. On the Workspace home page. 3. you create a Web service reference by searching a UDDI registry. 7. you create a second Web service reference manually. 9. 4. including the SOAP request envelope. accept the default. First. create a new application. For Method. 7-2 Oracle Database Application Express Advanced Tutorials . No. as shown in Figure 7–1. accept the default for Authentication Scheme. and Integration (UDDI) registry. accept the default. Click Next.

4. enter the proxy server in the Proxy Server field. b. To specify a proxy address: 1. 7. click Definition. When prompted whether to search a UDDI registry to find a WSDL. select XMethods UDDI v2 and click Next. Click Apply Changes. 3. 2. Click Create.Searching a UDDI Registry 10. The Web Service References page appears.Select Service Name. Specifying an Application Proxy Server Address If your environment requires a proxy server to access the Internet. Review your selections and click Create. select Web Service References. describing the selected Web service. you create a form and report for displaying movie theaters and locations. Then. For Search. c. Searching a UDDI Registry In this exercise. Review your selections and click Next. The Shared Components page appears. specify the following: a. d. A summary page appears. On the Application home page. Click Next. Note: The following exercise is dependent upon the availability of the specified UDDI registry as well as the Web service ultimately invoked. Under Matching Services. select Ignyte&apos. Under Application. Search Type . you create a Web service reference by searching a UDDI registry for a service name. To create a new Web service by searching for a service name: 1. 2. On the Application home page. click Shared Components. If the UDDI registry or Web service is unavailable. The Application home page appears. click Shared Components. The Application home page appears.s Retrieve Theaters and Movie Showtimes. For UDDI Location. 3. Under Name. 4. you may experience difficulties completing this exercise. select Yes and click Next. Under Logic.Enter ignyte and click Search. 5. Name . you must specify a proxy server address on the Application Attributes page before you can create a Web service reference. How to Implement a Web Service 7-3 . 6.

Searching a UDDI Registry The WSDL Location field displays the URL to the WSDL document. and click Finish. c. On the Create Web Service Reference success page. b. Web Service Reference . Yes. enter the user name and password for your workspace and click Login. 6. b. 4. A form and report resembling Figure 7–2 on page 7-5 appear. Create a Form and Report Next. select all the parameters and click Finish. For Page and Region Attributes: a. Click Next. MovieInformation. change the Item Label default to ZIP Code. To create a form and report after creating a Web Service Reference: 1. in the Create column. Result Tree to Report On . For Web Service Results: a. 7-4 Oracle Database Application Express Advanced Tutorials . is added to the Web Service References Repository.Accept the default. accept the default. Notice that the Theater Information Form at the top of the page contains a data entry field and a submit button. select Create Form and Report on Web Service. b. 3. The Web service reference. For Result Parameters. The Create Web Service Reference page appears. Temporary Result Set Name (Collection) . For Input Items: a. you need to create a page that contains a form and report to use with your Web Service Reference.Change to Theater Information. Accept the defaults. Accept the other defaults and click Next. Click Run Page. you do not need to enter your user name and password. Click Next. Note that since this service does not require authentication. For Choose Service and Operation: a. 8. c. If prompted to log in. For P2_ZIPCODE and P2_RADIUS. c. 5. For P2_ZIPCODE. Operation . Click Next. b. 8. 7.Select MovieInformation. but the Results Report does not contain any data.Select GetTheatersAndMovies.Select Theater (tns:Theater). 2. Form Region Title .

you create a Web reference by supplying information about the Web service and using the manual facility. The report lists the names and addresses of movie theaters matching the entered ZIP code and radius. To test the form. Figure 7–3 Theater Information Report Showing Resulting Data Creating a Web Reference Manually In this exercise. Manual Web references are created by visually inspecting the WSDL document as well as using a tool to determine the SOAP envelope for the Web service request. Then click Submit. enter 43221 in the ZIP Code field and 5 in the Radius field. Topics in this section include: ■ ■ ■ ■ ■ ■ Create a Web Reference Manually Test the Web Service Create a Page to Call the Manual Web Service Create a Submit Button Create Items for ZIP Code and Radius Create a Process to Call the Manually Created Web Reference How to Implement a Web Service 7-5 . The report at the bottom of the page should resemble Figure 7–3.Creating a Web Reference Manually Figure 7–2 Theater Information Form and Report without Data 9.

find the location attribute of the soap:address element. Open the WSDL by going to: http://www. In the Name field. which is a child of the operation element that has a name attribute of GetTheatersAndMovies. click Shared Components. it was this attribute: http://www. You can search for the following term within the code: soap:address location.ignyte.ignyte. See Step 7a. such as Mindreef: http://www.webservice /moviefunctions. 3. click Web Service References. In the URL field on the Create/Edit Web Service page. Locate the SOAP action for the GetTheatersAndMovies operation: a.ignyte.asmx?wsdl b. enter the SOAP action you located (such as http://www. enter Movie Info.com/webservices/ignyte. which is a child of the port element.webserv 7-6 Oracle Database Application Express Advanced Tutorials .com/whatsshowing/GetTheatersAndMovies) 11.ignyte. enter the endpoint of the MovieInformation service you located (such as http://www. 7. If necessary.whatsshowing.whatsshowing. b.do?referer=xmethods&u rl=http://www. 9. Under Logic.mindreef. From the Tasks list on the right.com/webservices/ignyte.net/tide/scopeit/start.com/webservices/ignyte. Click Create. 2.whatsshowing. Locate the endpoint of the MovieInformation service: a. select No and click Next. Locate the SOAP request envelope: a.asmx 8. you will copy code from the WSDL for a service called MovieInformation. In the Action field on the Create/Edit Web Service page.Creating a Web Reference Manually ■ Create a Report on the Web Service Result Create a Web Reference Manually To create a Web reference manually. On the Application home page. Go to a Web services tool. In the WSDL.ignyte. You can search for the following term within the code: soap:operation soapAction. To create a manual Web reference: 1. click the Create Web Reference Manually link. it was this attribute: http://www. 6. For Search UDDI. At the time of this release.com/whatsshowing/GetTheatersAndMovies 10. At the time of this release. find the soapAction attribute of the soap:operation element.webservice/moviefunct ions.whatsshowing. open the WSDL again. 4.ignyte.webserv ice/moviefunctions.com/webservices/ignyte. 5. The Create/Edit Web Service page appears. In the WSDL.asmx).

This is where the response from the Web service will be stored. d.Creating a Web Reference Manually ice/moviefunctions. the following appeared after the HTTP Authentication region on the page: <?xml version="1. In the SOAP Envelope field on the Create/Edit Web Reference page.xmlsoap. Click Preview/Edit on the Invoke page of Mindreef. the values entered for the two items will be sent with the request. Later. This shows the SOAP request envelope with the parameters defined by the values you entered.asmx?wsdl b. At the time of this release.Enter #RADIUS# in the xs:int tns:radius field.ignyte.w3.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas. you will create two items on a page: ZIP Code and Radius.org/soap/envelope/" xmlns:tns="http://www. In the Message Envelope section in Mindreef: .org/2001/XMLSchema"> <soap:Body> <tns:GetTheatersAndMovies> <tns:zipCode>#ZIP#</tns:zipCode> <tns:radius>#RADIUS#</tns:radius> </tns:GetTheatersAndMovies> </soap:Body> </soap:Envelope> 12.Enter #ZIP# in the xs:string tns:zipCode field. How to Implement a Web Service 7-7 . . enter MOVIE_RESULTS.com/whatsshowing" xmlns:xs="http://www. In the Store Response in Collection field. c. The Create/Edit Web Service page should resemble Figure 7–4. enter the xml code that appeared after the HTTP Authentication region on the page (such as the code shown in Step 11d). Click the Invoke tab and then click GetTheatersAndMovies. 13. When this service is called.

4.ignyte. Review the Result field and note the following about the response: ■ The base node in the return envelope is called: GetTheatersAndMoviesResponse ■ The namespace for the message is: http://www. showing Movie Info in the list. 2. Click Create. 3. Click Test. click the Test icon next to the Movie Info Web reference.Creating a Web Reference Manually Figure 7–4 Create/Edit Web Service Page 14.com/whatsshowing ■ The XPath to the interesting parts of the response under the result element is: /GetTheatersAndMoviesResponse/GetTheatersAndMoviesResult/Theater/Movies/Mov ie 7-8 Oracle Database Application Express Advanced Tutorials . Test the Web Service To test the Web service: 1. replace #ZIP# with 43221 and #RADIUS# with 5. In the SOAP Envelope field. The Web Services Testing page appears. On the Web Service References page. The Web Service References page appears.

3. and click Next. For Button Template. 2. 3. For Page. select Movie Information from the list. 8. For Display Properties. For Button Attributes. Click the Application breadcrumb link. To create a page to call the manual Web service: 1. 4. Click Finish. Click Create Region.Creating a Web Reference Manually ■ The interesting elements in the results are called: Name Rating RunningTime ShowTimes Create a Page to Call the Manual Web Service Next. 11. 6. select Blank Page and click Next. Click Create Button. 10. click Edit Page. Button. For Tabs. In Name. and click Next. select HTML and click Next. Create a button in a region position. enter Movie Information and click Next. 9. For Button Position. 5. accept the default. 7. For Button Region. For Region. accept the default. On the Page Definition. On the Success page. locate the Regions section. On the Application home page. On the Page Definition. select Region Template Position #CREATE# from the Position list and click Next. The page number appears in the field. 12. Accept the default for the Page Number and click Next. 6. To create a Submit button: 1. and click Next. No. click Create Page. 2. In the Branch to Page field. and click Next. accept the default. you want to create a page to call the manual Web Service. you want to add a Submit button to the region to initiate a search from the page. 5. Click the Create icon. enter Find Movies and click Next. accept the default. In the Title field. click the Create icon in the Buttons section. Select HTML as the HTML region container and click Next. enter SUBMIT in the Button Name and click Next. 14. How to Implement a Web Service 7-9 . 7. 13. Create a Submit Button Next. Movie Information. 4. 8.

6. In the Name field. 5. Text Field. Click Create Item. 2. In the Failure Message area. For Text Control Display Type. 2. Region . you want to add a report that displays the results of the called Web service. For Item Type. For Display Position and Name. Text Field. click the Create icon in the Processes section. c. accept the default. In the Label field. 4.Enter ZIPCODE. and click Next. 3. Region . enter Radius and click Next. For Display Position and Name. select Web Services and click Next. select Text and click Next. 3.Accept the default. From the When Button Pressed list. you want to create two items where users can enter a search term. Create a Report on the Web Service Result Next. To create the Radius item: 1. select Text and click Next. specify the following: a. Movie Information. 4. 6. In the Label field. 7-10 Oracle Database Application Express Advanced Tutorials . On the Page Definition. On the Page Definition. b. 2. 4. click the Create icon in the Regions section. select Movie Info and click Next. c. 7. and click Next. In the Success Message area. Create a Process to Call the Manually Created Web Reference Next.Accept the default. enter Call Movie Info and click Next. 5. From the Web Service Reference list. enter Error calling Movie Info and click Next. enter Called Movie Info. Click Create Item. b. For Text Control Display Type. Click Next. For Item Type. To create a report on the Web service result: 1. Item Name . For Process Type.Enter RADIUS. On the Page Definition. To create the ZIP Code item: 1. 5. On the Page Definition. replace the existing text with ZIP Code and click Next. 3. you want to create a process that calls the manually created Web reference. specify the following: a. accept the default. select SUBMIT and click Create Process. click the Create icon in the Items section. Movie Information.Creating a Web Reference Manually Create Items for ZIP Code and Radius Next. Item Name . click the Create icon in the Items section. To create a process to call the manually created Web reference: 1. Click Next. 6.

enter your workspace user name and password.ignyte. In the ZIP Code and Radius fields.Select Movie Info from the list. b. 6. 4. enter Search Results and click Next. enter Name. For Region. Click Next. How to Implement a Web Service 7-11 . For Web Reference Type.Enter: /GetTheatersAndMoviesResponse/GetTheatersAndMoviesResult/Theater/Movies/Mov ie e. Click Run Page. In the first four Parameter Names.com/whatsshowing Note that you reviewed both the Result Node Path and Message Namespace when testing the service. Select Report and click Next. Rating. and ShowTimes. The Movie Information form appears. 3. f. d. enter information and click Submit. The results appear in the Search Results area. To test the page: a. 5. 7. as shown in Figure 7–5. 8.Select Document. specify the following: a. Figure 7–5 Movie Information Form with No Data b. Result Node Path .Enter: http://www. c. In the Title field. select Manually Created and click Next. Web Service Reference . select Report on collection containing Web service result and click Next. Message Format . and click Create SQL Report. RunningTime. Message Namespace . For Web Reference Information. Note that these two attributes can be determined by manually inspecting the WSDL document for the service.Creating a Web Reference Manually 2. SOAP Style .Select Literal. If prompted to log in.

Creating a Web Reference Manually 7-12 Oracle Database Application Express Advanced Tutorials .

b. See "About Loading Sample Objects" on page 1-2. 4. click the Application Builder icon. c. The Application Builder home page appears. Application . To create an application using the Create Application Wizard: 1.Accept the default. How to Create a Stacked Bar Chart 8-1 . Select Create Application and click Next. Click Create.Select From scratch. This tutorial describes how to create a stacked bar chart. On the Workspace home page. Create Application .8 How to Create a Stacked Bar Chart A stacked bar chart displays the results of multiple queries stacked on top of one another. Using a stacked bar chart is an effective way to present the absolute values of data points represented by the segments of each bar. you need to create an application using the Create Application Wizard. 2. Name . To create a stacked bar chart. In Application Builder a stacked bar chart is available only as an SVG chart. 3. Before you begin. This section contains the following topics: ■ ■ ■ ■ ■ ■ Creating an Application Create a New Page Adding Additional Series Changing the Chart Format Updating the Sample Data Viewing the Chart See Also: "Creating Charts" in Oracle Database Application Express User's Guide Creating an Application First. either vertically or horizontally.Enter Bar Chart. For Name: a. you need to import and install the OEHR Sample Objects application in order to access the necessary sample database objects. as well as the total value represented by data points from each series stacked in a bar. you can create the chart as a stacked bar chart or you can create a regular (non-HTML) bar chart and then add queries to it.

a form. 9. 3. Do not use Tabs. b. 5. For Region Template. You have the option of adding a blank page. enter Revenue by Category. and click Next. For Copy Shared Components from Another Application. The Application home page appears. e. accept the defaults for Authentication Scheme. 8. a report. No. a tabular form. For Page Attributes: a. The chart will display the sum for sales by product category from within Sample Application. or a report and form. accept the default. 8-2 Oracle Database Application Express Advanced Tutorials . enter Revenue by Category.Create a New Page d. Vertical and then click Next. you can either add a region to an existing page and define it as a stacked bar chart. click Create Page. For Page Number. and video). To create a new page: 1. f. accept the default. 5. The new page appears in the list at the top of the page. select Chart and then click Next. or you can create a new page. select Blank and click Add Page. enter 2. For Attributes. you create four queries (called series) for each of the product categories (phones. Select Stacked Bar. g. e. you need to add a page. One Level of Tabs.Select the schema where you installed the OEHR sample objects. For this exercise. audio. In this exercise. For Tab Options. computers. Select SVG Chart and then click Next. Language. 6. It will contain sales for the twelve months prior to the current month. Click Next. accept the default. Under Select Page Type. Click Next. Create a New Page To create the initial report. For Chart Color Theme. For Page Name. and User Language Preference Derived From and click Next. you create a new page within the Bar Chart application you just created. and then click Next. 4. b. In the following exercise. For Tabs. For Region Name. 7. On the Application home page. For Breadcrumb. Next. accept the default. you add a blank page. Click Next. Add a blank page: a. 6. 10. For page. Review your selections and click Create. 2. accept the default. select Theme 2 and click Next. and click Next. c. Schema . For User Interface. accept the default. d.

For Series Name. In the following exercise. OEHR_ORDERS o. For Query: a. enter: SELECT NULL l.order_id AND oi. Note that you have already created the hardware category. c. label. A more appropriate approach would be to display the data in chronological order. enter: No orders found in the past 12 months. sales_month. you add a series for each of the categories of product in the application (that is.product_id = p.order_date. OEHR_CATEGORIES_TAB ct WHERE o. For example. TO_DATE(to_char(o. On the Success Page. Click Next.'MON')-1) AND o.order_id = oi.'Mon YYYY') sales_month_ order FROM OEHR_PRODUCT_INFORMATION p. Review your selections and click Finish.Adding Additional Series 7. you need to add the series. Displaying dates in alphabetical order does not make sense. Software and Office Equipment). To add a series for the Software category: 1.unit_price) revenue.product_id AND ct. b. revenue FROM ( SELECT TO_CHAR(o. the link is defined as null because there is no appropriate page to link to. In this example.order_date. October would be displayed before September. enter Hardware.order_date. To display the data in chronological order.'Mon YYYY') ORDER BY sales_month_order ) The syntax for the select statement of a chart is: SELECT link.order_date > (trunc(sysdate-365. For When No Data Found Message. d. Note that you cannot include an ORDER BY in the SELECT statement for a series in a stacked chart because the information is displayed in alphabetical order.quantity * oi.'MON')) AND o.order_date <= (trunc(sysdate. Adding Additional Series Once you have created the new page with a region defining the query. click Edit Page. OEHR_ORDER_ITEMS oi. value You must have all three items in your select statement. The Success page appears.'Mon YYYY'). you need to order the data inside a nested SELECT statement. How to Create a Stacked Bar Chart 8-3 . SUM(oi.'Mon YYYY') sales_month. 8.category_name like '%hardware%' GROUP BY TO_CHAR(o. In SQL.

2. Scroll down to Series Query. For Series Name. The only difference is the category in the WHERE clause.order_date > (trunc(sysdate-365.order_id AND oi.order_date <= (trunc(sysdate.quantity * oi. OEHR_CATEGORIES_TAB ct WHERE o. Scroll down to Chart Series and then click Add Series.'Mon YYYY') sales_month_ order FROM OEHR_PRODUCT_INFORMATION p.'MON')-1) AND o. For Series Name. b. 4.order_date. SUM(oi.order_date.'Mon YYYY'). OEHR_ORDERS o.unit_price) revenue.order_date.product_id AND ct. enter: SELECT NULL l. d. revenue FROM ( SELECT TO_CHAR(o.'Mon YYYY'). b. Scroll down to Series Query. enter Office Equipment. c. e. At the top of the page.'MON')) AND o.order_date.'Mon YYYY') sales_month.Adding Additional Series The Page Definition for page 2 appears.order_date. f. OEHR_ORDER_ITEMS oi. 8-4 Oracle Database Application Express Advanced Tutorials . click SVG Chart next to Revenue by Category.'Mon YYYY') sales_month. c.'Mon YYYY') sales_month_ order FROM OEHR_PRODUCT_INFORMATION p. TO_DATE(to_char(o.unit_price) revenue. In SQL. sales_month. Scroll down to Chart Series. enter Software. Under Chart Series. click Add Series. For When No Data Found Message. The SVG Chart page appears with the Chart Attributes tab selected. Under Regions. enter: SELECT NULL l. In SQL. Note that only one series appears.order_id = oi. sales_month. 3. click Apply Changes.'Mon YYYY') ORDER BY sales_month_order ) Note that this SQL matches the previous series. revenue FROM ( SELECT TO_CHAR(o. Add a chart series for Computer: a. d. Add a chart series for office equipment: a.category_name like '%software%' GROUP BY TO_CHAR(o.product_id = p. SUM(oi.quantity * oi. TO_DATE(to_char(o. enter: No orders found in the past 12 months.

Updating the Sample Data The sample data that installed with the OEHR Sample Objects application is not current. Next. 2. OEHR_CATEGORIES_TAB ct WHERE o. enter: No orders found in the past 12 months. 6. 4.'MON')) AND o. In Y Axis Format. On the SVG Chart page. you need to update the dates in the sample data by running an UPDATE statement in SQL Commands. 5.product_id AND ct.order_date <= (trunc(sysdate. enter: Note: This reflects sales for the 12 months prior to the current month. Scroll up and select the Region Definition tab.'MON')-1) AND o. scripts. Return to the Workspace home page. f. Scroll down to Header and Footer.'Mon YYYY') ORDER BY sales_month_order ) e. scroll down to the Axes Settings section. Click the Home breadcrumb link at the top of the page.order_id = oi.category_name like '%office%' GROUP BY TO_CHAR(o. OEHR_ORDERS o. See Also: "Using SQL Commands" in Oracle Database Application Express User's Guide To update the dates in the seed data: 1. and saved queries. You can use SQL Commands to run SQL commands and anonymous PL/SQL. click the SQL Workshop icon and then click SQL Commands. 2.order_date. In Region Footer. Changing the Chart Format Next. enter: FML999G999G999G999G990 This formats the sales_month column as money but without displaying the cents.product_id = p. Scroll up to the top of the page and click Apply Changes. For When No Data Found Message. On the Workspace home page.Updating the Sample Data OEHR_ORDER_ITEMS oi.order_date > (trunc(sysdate-365. you enhance the appearance of the chart with axis titles by adding a region footer. To format the y-axis: 1.order_id AND oi. Click Apply Changes. How to Create a Stacked Bar Chart 8-5 . 3.

Enter the following in the SQL editor pane: UPDATE oehr_orders SET order_date = order_date+2190 4. you can view it. Your bar chart should resemble Figure 8–1. 3. Click the Run Page icon in the upper right corner of the page. 2. See "About Application Authentication" on page 1-5. Click Application Builder and then click your Bar Chart application. Return to page 2. Revenue by Category: a. 3.Revenue by Category. b. Viewing the Chart Now that the chart is complete. Figure 8–1 Revenue by Category Bar Chart 8-6 Oracle Database Application Express Advanced Tutorials . To run the chart: 1. Click 2 .Viewing the Chart The SQL Commands page appears. enter your workspace user name and password and click Login. Click the Home breadcrumb link at the top of the page. If prompted for a user name and password. Click Run (Ctrl+Enter) to execute the command. c.

com/pls/apex/f?p=2046:750: . to http://apex.. For example.. How to Create a Stacked Bar Chart 8-7 .oraclecorp.oraclecorp..Viewing the Chart Tip: One way to navigate to a new page within a running application is to change the second parameter (the page identifier) to 750.com/pls/apex/f?p=2046:1: .. you would change: http://apex.

Viewing the Chart 8-8 Oracle Database Application Express Advanced Tutorials .

Select Create Application and then click Next. click the Application Builder icon. enter Download App. 3. select Blank and click Add Page as shown in Figure 9–1 on page 9-2. 4. and finally how to create the mechanism to download the document in your custom table. This section contains the following topics: ■ ■ ■ ■ ■ ■ ■ Creating an Application Creating an Upload Form Creating a Report with Download Links Storing Additional Attributes About the Document Storing the Document in a Custom Table Downloading Documents from the Custom Table Security Issues to Consider Creating an Application First. 2. The Application Builder home page appears.9 How to Upload and Download Files in an Application Oracle Application Express applications support the ability to upload and download files stored in the database. how to create and populate a table to store additional attributes about the documents. Under Select Page Type. On the Workspace home page. Click Create. b. create a new application using the Create Application Wizard with the assumption you will include an upload form on page 1. How to Upload and Download Files in an Application 9-1 . For Name. Accept the remaining defaults and click Next. 5. Add a blank page: a. To create an application using the Create Application Wizard: 1. For Name. specify the following: a. This tutorial illustrates how to create a form and report with links for file upload and download.

9. accept the default. For Attributes. To create an HTML region: 1. For Tabs. The Page Definition appears. accept the default. Creating an Upload Form Once you create an application. For User Interface. and click Next.Creating an Upload Form Figure 9–1 Add Page The new page appears in the Create Application list at the top of the page. For Copy Shared Components from Another Application. Click the Page 1 icon. you create a form in an HTML region that contains a file upload item and a button. No. you need to create a container to hold the form. The Application home page appears. and click Next. 8. In the following exercise. 9-2 Oracle Database Application Express Advanced Tutorials . 7. click the Create icon as shown in Figure 9–2 on page 9-3. One Level of Tabs. Click Next. b. and User Language Preference Derived From and click Next. select Theme 2 and then click Next. Review your selections and click Create. the next step is to create a form to upload documents. accept the defaults for Authentication Scheme. In Application Builder. Topics in this section include: ■ ■ ■ Create an HTML Region Create an Upload Item Create a Button Create an HTML Region First. this container is called a region. 2. 6. The button submits the page and returns the user to the same page. Under Regions. 10. Language.

b. To create a button: 1.Accept the default. 3. 2. In Application Builder. For Sequence.Creating an Upload Form Figure 9–2 Create Icon 3. Under Buttons. For Region. and so on. d. HTML. select File Browse and then click Next. Create a Button Next. For Region: a. 4. b. Identify the type of region to add to this page . accept the default. In this exercise. Under Items on the Page Definition for page 1. An item can be a text field. Accept the remaining defaults and click Create Region. Select the type of HTML region container you wish to create . 2. select list. For Button Region. Click Next. click the Create icon. click the Create icon. HTML. 5. For Display Position and Name: a. check box. password.Enter P1_FILE_NAME. and click Next. select Submit File. Create an Upload Item Next. files you upload are stored in a table named wwv_flow_file_ objects$. How to Upload and Download Files in an Application 9-3 . To create a file upload item: 1. you need to create a button to submit the file. For Item Type. Accept the remaining defaults and click Next. select Submit File (1) 1 and click Next. 4. The Page Definition appears. c. Accept the remaining defaults and click Next. The Page Definition appears. you will create a File Browse item. b. 5. you need to create a text field or item. text area. Title . and click Next. Item Name . Click Create Item. For Display Attributes: a.Enter Submit File. When you create a File Browse item. an item is part of an HTML form.Accept the default.

For Button Position. 8. If prompted to enter a user name and password. When you run the page. Figure 9–3 Run Page Icon 9. enter your workspace user name and password and click Login. For Button Template. 7. 5. 4. c. the files you upload are stored in a table called wwv_flow_file_ objects$.Enter Submit. accept the default and click Next. select Create a button in a region position and then click Next. the next step is to create a report on the document table that contains links to the uploaded documents. Click Create Button. On Button Attributes: a. Button Name . Click Next. 6. b. Accept the remaining defaults. For Display Properties. Run the page by clicking the Run Page icon as shown in Figure 9–3. Branch to Page . For Branching: a.Select Page 1.Creating a Report with Download Links 3. This selection causes the page to call itself on submit rather than navigate to another page. accept the defaults and click Next. When you use a File Browse item. See "About Application Authentication" on page 1-5. Topics in this section include: ■ ■ Create a Report on APEX_APPLICATION_FILES Add Link to Download Documents Create a Report on APEX_APPLICATION_FILES To create a report on APEX_APPLICATION_FILES: 9-4 Oracle Database Application Express Advanced Tutorials . Figure 9–4 Submit File Form Creating a Report with Download Links Once you create the form to upload documents. Every workspace has access to this table through a view called APEX_ APPLICATION_FILES. it should look similar to Figure 9–4. b.

2. click Report next to Uploaded Files as shown in Figure 9–6. 5. For Display Attributes: a. The Page Definition appears. Your report should resemble Figure 9–5. Figure 9–5 Uploaded Files Report Add Link to Download Documents Next.Enter Uploaded Files. you need to provide a link to download each document. enter the following SQL query: SELECT id. Run the page. select SQL Report and then click Next. Note that your display may differ slightly depending on what files you have uploaded. How to Upload and Download Files in an Application 9-5 . select Report and then click Next. Accept the remaining defaults and click Next. Under Regions.name FROM APEX_APPLICATION_FILES 7. 2. Title . 8.Creating a Report with Download Links 1. Under Regions. For Source. b. For Region. 3. For Report Implementation. Click Edit Page 1 on the Developer toolbar. 6. Click Edit Page 1 on the Developer toolbar at the bottom of the page. To provide a link to download the documents in the report: 1. 4. Click Create Region. click the Create icon.

Creating a Report with Download Links

Figure 9–6 Report Link

The Report Attributes page appears. You can add a link to the ID column by editing Column Attributes.
3. 4. 5.

Under Column Attributes, click the Edit icon in the ID row. Scroll down to Column Link. Under Column Link:
a. b. c.

Link Text - Select #ID#. Target - Select URL. In the URL field, enter the following:
p?n=#ID#

#ID# parses the value contained in the column where ID is the column alias.
6. 7.

At the top of the page, click Apply Changes. Run the page. When you run the page, it should look similar to Figure 9–7.

Figure 9–7 Uploaded Files Report with Download Links

8.

To test the links, click an ID. A File Download dialog box appears.

9-6 Oracle Database Application Express Advanced Tutorials

Storing Additional Attributes About the Document

9.

Click Edit Page 1 on the Developer toolbar to return to the Page Definition.

Storing Additional Attributes About the Document
Next, you create another table to store additional information about the documents that are uploaded. In this exercise, you:
■ ■ ■

Add an item to the upload form to capture the information Add a process to insert this information along with the name of the file Alter the SQL Report of uploaded files to join to the table containing the additional information

Topics in this section include:
■ ■ ■ ■

Create a Table to Store Document Attributes Create an Item to Capture the Document Subject Create a Process to Insert Information Show Additional Attributes in the Report Region

Create a Table to Store Document Attributes
First, you create a table in SQL Commands.
See Also: "Using SQL Commands" in Oracle Database Application Express User's Guide

To create the table to store additional information about uploaded files:
1.

Navigate to SQL Commands:
a.

Click the Home breadcrumb link at the top of the page as shown in Figure 9–8.

Figure 9–8 Breadcrumb Menu

The Workspace home page appears.
b.

On the Workspace home page, click SQL Workshop and then SQL Commands. The SQL Commands page appears.

2.

In the top section, enter:
CREATE TABLE oehr_file_subject (name VARCHAR2(4000) primary key, subject VARCHAR2(4000));

3.

Click Run. The message Table created appears in the Results section.

4.

Click the Home breadcrumb link. The Workspace home page appears.

How to Upload and Download Files in an Application 9-7

Storing Additional Attributes About the Document

Create an Item to Capture the Document Subject
To create an item to capture the subject of the document:
1.

Navigate to the Page Definition for page 1:
a. b. c.

On the Workspace home page, click the Application Builder icon. On the Application Builder home page, click Download App. On the Application home page, click the Page 1 icon.

The Page Definition for Page 1 appears.
2. 3. 4. 5.

Under Items, click the Create icon. For Item Type, select Text and click Next. For Text Control Display Type, select Text Field and click Next. For Display Position and Name:
a. b. c. d.

For Item Name - Enter P1_SUBJECT. Sequence - Accept the default. Region - Select Uploaded Files. Click Next.

6.

For Item Attributes:
a. b. c.

Label field - Enter Subject. Accept the remaining defaults. Click Next.

7.

Click Create Item.

Create a Process to Insert Information
Next, you need to create a process to insert the subject information into the new table. To create a process:
1. 2. 3.

Under Page Processing, Processes, click the Create icon. For Process Type, select PL/SQL and then click Next. For Process Attributes:
a. b. c. d.

Name - Enter Insert file description. Sequence- Accept the default. From Point - Select On Submit - After Computations and Validations. Click Next.

4.

In Enter PL/SQL Page Process, enter the following:
INSERT INTO oehr_file_subject(name, subject) VALUES(:P1_FILE_NAME,:P1_SUBJECT);

5. 6.

Click Next. For Messages:
a.

Success Message - Enter:
Subject inserted

9-8 Oracle Database Application Express Advanced Tutorials

Storing Additional Attributes About the Document

b.

Failure Message - Enter:
Error inserting subject

c. 7.

Click Next.

For Process Conditions:
a. b.

When Button Pressed - Select SUBMIT. Accept the remaining defaults and click Create Process.

Show Additional Attributes in the Report Region
Finally, you need to alter the SQL Report region to join it to the additional attributes table. To accomplish this, you edit the Region Source attribute on the Region Definition page. To edit the Region Source:
1.

Under Regions, click Uploaded Files. The Region Definition appears.

2. 3.

Scroll down to Source. Replace the Region Source with the following:
SELECT w.id,w.name,s.subject FROM APEX_APPLICATION_FILES w,oehr_file_subject s WHERE w.name = s.name

4. 5. 6.

Click Apply Changes. Run the page. Click Browse, locate a file to upload, and click Submit. As shown in Figure 9–9, the Uploaded Files report now contains a Subject column.

Figure 9–9 Uploaded Files Report with Subject Column

7.

Click Edit Page 1 on the Developer toolbar to return to the Page Definition.

How to Upload and Download Files in an Application 9-9

To alter the process to insert documents into the oehr_file_subject table: 1. On the Workspace home page.Storing the Document in a Custom Table Storing the Document in a Custom Table In certain cases. MIME_TYPE) SELECT ID. Navigate to SQL Commands: a. BLOB_CONTENT.mime_type FROM APEX_APPLICATION_FILES WHERE name = :P1_FILE_NAME. b. 2. The message Table Altered appears. Click Download App. 4. Click the Home breadcrumb link at the top of the page. SUBJECT.NAME. Under Processes. The SQL Commands page appears. click SQL Workshop and then SQL Commands. Downloading Documents from the Custom Table Now that documents are being stored in a custom table.:P1_FILE_NAME. END IF. 4. Under Source.:P1_SUBJECT.blob_content. enter the following SQL statement: ALTER TABLE oehr_file_subject ADD(id number. For example. Click Apply Changes. Click Page 1. To accomplish this you need to change: 9-10 Oracle Database Application Express Advanced Tutorials .mime_type varchar2(4000) ). Click Run. 3. Scroll down to Source. 5. DELETE from APEX_APPLICATION_FILES WHERE name = :P1_FILE_NAME. To store documents in your custom table: ■ ■ Add a column of type BLOB to hold the document Alter the process to insert documents into the custom table To add a BLOB column to the oehr_file_subject table: 1. click the Insert file description link. 3. On the Workspace home page. you need to provide a way to download them. You do this by creating a procedure and granting execute on that procedure to the pseudo user APEX_PUBLIC_USER. if you want to create an Oracle Text index on uploaded documents. click Application Builder. Click the Home breadcrumb link at the top of the page. you need to store the documents in a custom table. The Workspace home page appears. 2. In the top section. 7. you may want to store uploaded documents in a table owned by your schema.blob_content BLOB. replace the process with the following: IF ( :P1_FILE_NAME is not null ) THEN INSERT INTO oehr_file_subject(id. 6.

filename="'||replace(replace(substr(v_file_name.application/octect may launch a download window from windows owa_util. FALSE ).null)|| '"'). click SQL Workshop and then SQL Commands. BEGIN SELECT MIME_TYPE. Lob_loc BLOB.lob_loc.if it is a null set it to application/octect -.p('Content-length: ' || v_length). On the Workspace home page.GETLENGTH(blob_content) INTO v_mime. -. / How to Upload and Download Files in an Application 9-11 . Click the Home breadcrumb link at the top of the page. end download_my_file. v_length NUMBER.DBMS_LOB.'/')+1). BLOB_CONTENT.'application/octet').chr(10). v_file_name VARCHAR2(2000). Enter the following SQL statement: CREATE OR REPLACE PROCEDURE download_my_file(p_file in number) AS v_mime VARCHAR2(48). The SQL Commands page appears.p('Content-Disposition: attachment. 2.chr(13). -.instr(v_file_ name. -.use an NVL around the mime type and -.download_file( Lob_loc ). -.v_length FROM oehr_file_subject WHERE id = p_file. --. Navigate to SQL Commands: a.null).set the size so the browser knows how much to download htp.close the headers owa_util.the filename will be used by the browser if the users does a save as htp.v_file_name.set up HTTP header --.mime_header( nvl(v_mime. name.download the BLOB wpg_docload.http_header_close. b. The Workspace home page appears.Downloading Documents from the Custom Table ■ ■ The SQL report region to no longer join to the APEX_APPLICATION_FILES view The URL supplied for the ID column in the SQL report to execute the new procedure instead of executing the previous procedure Topics in this section include: ■ ■ ■ Create a Procedure to Download Documents Edit the Uploaded Files Region Change the Download Link to Use the New Procedure Create a Procedure to Download Documents To create a procedure to download documents from the oehr_file_subject table and grant execute to public: 1.

4. 7. replace the existing URL with the following: #OWNER#. click Page 1. Click Run. On the Workspace home page. click Uploaded Files. download_my_file is the new procedure you just created. click the Edit icon. 4. Replace the Region Source with the following: SELECT s.s. The Page Definition appears. The SQL Commands page appears. The message Statement processed appears. In the top section. 3.download_my_file?p_file=#ID# In this URL: – – #OWNER# is the parsing schema of the current application. Click Run. Under Regions. Click the Home breadcrumb link at the top of the page to return to the Workspace home page.id. On the Application Builder home page. b. Navigate to the Page Definition of page 1: a. Scroll down to the Column Link section. Scroll down to Source. c. click Application Builder. Change the Download Link to Use the New Procedure To change the download link to use the new download procedure: 1. In the URL field. Edit the Uploaded Files Region To change the SQL report region to no longer join with the APEX_APPLICATION_ FILES view: 1. 2. 9-12 Oracle Database Application Express Advanced Tutorials .name. 3. Next. 2. click Download App. replace the existing SQL statement with the following: GRANT EXECUTE ON download_my_file TO PUBLIC / 6. Click Apply Changes. click Report next to Uploaded Files.subject FROM oehr_file_subject s 5.Downloading Documents from the Custom Table 3. Click the SQL Workshop breadcrumb link and then click SQL Commands.s. In the ID row. On the Application home page. you want to run another SQL statement. Under Regions. The message Procedure Created appears. 5. 4.

How to Upload and Download Files in an Application 9-13 . etc. IF NOT wwv_flow_custom_auth_std.'). Be aware that a curious or malicious user could experiment with your download_my_file procedure. set g_flow_id to -that value. ■ One technique you can use to protect an application is to call one of the Oracle Application Express security APIs from within the procedure in order to ensure that the user has already been authenticated. otherwise change the value as required. Note that this approach has security implications that you need to be aware of. --. in a mechanized attack.p('Unauthorized access . passing in any file ID as the p_file argument. a hacker could submit successive IDs until an ID matches a file in your table at which time your procedure would download the file to the hacker. The likelihood of such an attack balanced against the cost and difficulty of providing controls. To invoke your procedure. The Page Definition appears.display this message or a custom message. For example.You can do whatever else you need to here to log the -unauthorized access attempt. a user can click the links you provide. you could include a block of code into the procedure so that it runs first. The measures you take to protect your data from unauthorized access depend upon: ■ Your assessment of the degree of harm that would result if a hacker were able to download a file. -htp. Worse yet. Consider the following example: -. Security Issues to Consider The application you built in this tutorial provides download links that invoke the procedure download_my_file. -RETURN.Assuming your application's numeric ID is 100. A hacker could determine what file IDs exist in your table by legitimate or illicit means. Click Apply Changes. or a user can enter similar URLs in the Web browser's Address (or Location) field.is_session_valid then ---.Security Issues to Consider – 5.file will not be retrieved. -APEX_APPLICATION. You are passing in the value of the column ID to the parameter p_file.G_FLOW_ID := 100. END IF. get the requestor's -IP address. send email.

Security Issues to Consider 9-14 Oracle Database Application Express Advanced Tutorials .

js File Referenced by the Page Template How to Incorporate JavaScript into an Application 10-1 .js file referenced in the page template Topics in this section include: ■ ■ Incorporating JavaScript in the HTML Header Attribute Including JavaScript in a . In general. This tutorial describes some usage scenarios for JavaScript and includes details about how to implement them in your application. you would need to pull down every record to the client. creating a huge HTML document. to verify that a name is contained within a large database table. For example. This section contains the following topics: ■ ■ ■ ■ ■ ■ Understanding How to Incorporate JavaScript Functions About Referencing Items Using JavaScript Calling JavaScript from a Button Changing the Value of Form Elements Creating a Client Side JavaScript Validation Enabling and Disabling Form Elements Understanding How to Incorporate JavaScript Functions There are two primary places to include JavaScript functions: ■ ■ In the HTML Header attribute of a page In a .10 How to Incorporate JavaScript into an Application Adding JavaScript to a Web application is a great way to add features that mimic those found in client/server applications without sacrificing all of the benefits of Web deployment. Oracle Application Express includes multiple built-in interfaces especially designed for adding JavaScript. Remember that JavaScript is not appropriate for data intensive validations. complex operations are much better suited for server-side Application Express validations instead of JavaScript.

3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>#TITLE#</title> #HEAD# <script src="http://myserver. The Page Definition for that page appears.Understanding How to Incorporate JavaScript Functions Incorporating JavaScript in the HTML Header Attribute One way to include JavaScript into your application is to add it to the HTML Header attribute of the page. This approach makes all the JavaScript in that file accessible to the application.'). To add JavaScript code in the HTML Header attribute: 1.js file in the page template. adding the following code would test a function accessible from anywhere on the current page. On the Workspace home page. Scroll down to the HTML Header section. The Edit Page appears. The Application home page appears.js File Referenced by the Page Template In Oracle Application Express you can reference a . click the Edit page attributes icon.myport/my_images/custom. 5. Enter code into HTML Header and then click Apply Changes. } </script> Including JavaScript in a . Click a page. For example. The following code demonstrates how to include a . 2. click the Application Builder icon. You can add JavaScript functions to a page by entering the code in the HTML Header attribute on the Page Attributes page. displaying its set of pages. and is then cached by the browser.js file in the header section of a page template.js file. Note the line script src= that appears in bold. 6. 4.js file loads on the first page view of your application. This is a good approach for functions that are specific to a page as well as a convenient way to test a function before you include it in a . Select an application. This is the most efficient approach because a .alert('This is a test. <script type="text/javascript"> function test(){ window.js" type="text/javascript"></script> </head> <body #ONLOAD#>#FORM_OPEN# See Also: "Customizing Templates" in Oracle Database Application Express User's Guide 10-2 Oracle Database Application Express Advanced Tutorials . In the Page section.

The following example demonstrates how to reference an item by ID and display its value in an alert box. Referencing an item by the item name enables you to use the JavaScript method getElementById() to get and set item attributes and values. if you create an item with the name P1_FIRST_NAME and a label of First Name." Calling JavaScript from a Button Calling a JavaScript from a button is a great way to confirm a request. Note that the function optionally submits the page and sets the value of the internal variable :REQUEST to Delete.getElementById(id). For example.alert('First Name is ' + document. you specify a URL target. you would reference the item using P1_FIRST_NAME. <script type="text/javascript"> function firstName(){ window.value ). Then. if (confDel== true) doSubmit('Delete'). else confDel= confirm(msg). such as the following: confirmDelete('Would you like to perform this delete action?'). How to Incorporate JavaScript into an Application 10-3 . } </script> // Then add the following to the "Form Element Attributes" Attribute of the item: onchange="displayValue('P1_FIRST_NAME'). thus performing the delete using a process that conditionally executes based on the value of request. Note that when you create the button. Oracle Application Express uses this technique for the delete operation of most objects.value ). For example. the best approach is to reference the item name as it is defined within the page. } // or a more generic version would be function displayValue(id){ alert('The Value is ' + document. if(confDel ==null) confDel= confirm("Would you like to perform this delete action?"). The item name displays on the Page Definition and the label displays on a running page. you need to select Action Redirect to URL without submitting page.Calling JavaScript from a Button About Referencing Items Using JavaScript When you reference an item. Consider the following example: <script type="text/javascript"> function deleteConfirm(msg) { var confDel = msg.getElementById('P1_FIRST_NAME'). when you delete a button. a JavaScript message appears asking you to confirm your request. Note that item name is different than the item label. } </script> This example creates a function to confirm a delete action and then calls that function from a button.

value = getVal('P1_ONE') + getVal('P1_TWO') + getVal('P1_THREE')." d. 2. c. In the Page section. To call the function from all three items: 1.value).getElementById('P1_TOTAL'). else return 0. See "About Loading Sample Objects" on page 1-2. b. To calculate this sum.Changing the Value of Form Elements Changing the Value of Form Elements In the following example. Scroll down to Element. there are four text boxes in a region. Click Apply Changes.getElementById(item). click the Edit page attributes icon. Click Apply Changes. 3. In HTML Form Element Attributes. enter the following: <script type="text/javascript"> function sumItems(){ function getVal(item){ if(document. For each item: a. you need to import and install the OEHR Sample Objects application in order to access the necessary sample database objects. In the HTML Header section. Creating a Client Side JavaScript Validation Client side validations give immediate feedback to users using a form. Topics in this section include: ■ ■ ■ Create an Application on the OEHR_EMPLOYEES Table Add a Function to the HTML Header Attribute Edit an Item to Call the Function 10-4 Oracle Database Application Express Advanced Tutorials . The Edit Page appears. 2. One very common JavaScript validation is field not null. you add a JavaScript function to the HTML Header attribute and then call that function from the first three items.getElementById(item). Navigate to the appropriate Page Definition. This type of validation works well in the page header rather than in a . Before you begin. enter: onchange="sumItems().value != "") return parseFloat(document. The fourth text box contains the sum of the other three. } </script> 4. Navigate to the appropriate Page Definition. Select the item name by clicking it. To add a function to the HTML Header attribute: 1. } document.js because it is so specific to a page.

6. For Attributes.Select Report and Form. Click Add Page. One Level of Tabs and then click Next. b. How to Incorporate JavaScript into an Application 10-5 .Creating a Client Side JavaScript Validation ■ Test the Validation by Running the Page Create an Application on the OEHR_EMPLOYEES Table To create a new application on the OEHR_EMPLOYEES table: 1. specify the following: a.Accept the default. For Name. Application . b. 8. On the Workspace home page. To change the name of page 2: a. click the page name OEHR_ EMPLOYEES for page 2 as shown in Figure 10–1 on page 10-5. select Theme 2 and click Next. Schema . enter Update Form.Enter JavaScript Example. d. c. select Create Application and then click Next. Name . The new pages appear in the list at the top of the page. 10. accept the default. Click Apply Changes Click Next. Create Application . and click Next. Click Create. Add a page containing a report by specifying the following in the Add Page section: a. click Application Builder. 2.Select OEHR_EMPLOYEES. Next. 3. In Page Name. d.Select the schema where you installed the OEHR sample objects.Select From scratch. change the name of page 2 to Update Form. For User Interface. No. For Method. accept the defaults for Authentication Scheme. Language. c. Click Next. For Shared Components. Figure 10–1 Newly Created Pages The Page Definition appears. Under Create Application at the top of the page. e. and User Language Preference Derived From and click Next. 9. c. 4. Table Name . b. For Tabs. 5. Select Page Type . accept the default. 7.

To add a function to the HTML Header attribute on page 2: 1. Under Page. Scroll down to HTML Header. To view the update form. A standard report appears. Note that HTML Header already contains a script. Click Create.Creating a Client Side JavaScript Validation 11. Figure 10–3 Edit Page Attributes Icon The Edit Page appears. click 2 . Click Application on the Developer toolbar to return to the Application home page. click either the Create button or Edit icon. Click the Run Application icon as shown in Figure 10–2. On the Application home page. 2. Would you like to perform this delete action? 10-6 Oracle Database Application Express Advanced Tutorials . click the Edit page attributes icon as shown in Figure 10–3. 3.Update Form 101 .Update Form. See "About Application Authentication" on page 1-5. When prompted for a user name and password. Note the new application contains three pages: ■ ■ ■ 1 .Login To view the application: 1. The Application home page appears. 3. Figure 10–2 Run Application Icon 2. The Page Definition for page 2 appears. enter your workspace user name and password and click Login. When the user clicks the Delete button. this script displays the following message.OEHR_EMPLOYEES 2 . you need to add a function to the HTML Header attribute on page 2 that displays a message when the Last Name field does not contain a value. Add a Function to the HTML Header Attribute Next.

The Page Definition appears. 3. Edit an Item to Call the Function Next. After the last </script> tag. The message This field must contain a value appears as shown in Figure 10–4. click Apply Changes. Test the Validation by Running the Page Next.Creating a Client Side JavaScript Validation 4. To edit the P2_LAST_NAME item to call the function: 1. you need to edit the P2_LAST_NAME item to call the function. Click the Run Page icon in the upper right corner. run the page. enter the following script: <script type="text/javascript"> function notNull(object){ if(object.value=="") alert('This field must contain a value. At the top of the page. Scroll down to Element. 5. How to Incorporate JavaScript into an Application 10-7 . The Update Form appears. 3. 4.Update Form appears. click Create. navigate to page 1 and run the page. 2. When the application appears. The Page Definition for page 2 . At the top of the page." 4. Under Items. In HTML Form Element Attributes. Enter 1 in the Page field on the Page Definition and click Go. 2. The Page Definition for page 1 appears. enter the following: onblur="notNull(this). click Apply Changes.'). To test the validation: 1. click P2_LAST_NAME. Next. In HTML Header. } </script> 6. Position your cursor in the Last Name field and then click Create. scroll down and place your cursor after the last </script> tag.

click the Edit page attributes icon. Second. 3. enter the following script: <script language="JavaScript1. Under Page. The following example demonstrates how to use JavaScript to disable a form element based on the value of another form element. Scroll down to HTML Header. 5. First. you write a function and place it in the HTML Header attribute of the page containing your update form.Enabling and Disabling Form Elements Figure 10–4 Update Form Enabling and Disabling Form Elements While Oracle Application Express enables you to conditionally display a page item. if (lEl && lEl != false){ if(a){ 10-8 Oracle Database Application Express Advanced Tutorials . After the last </script> tag.1" type="text/javascript"> function html_disableItem(nd. 4. Topics in this section include: ■ ■ ■ ■ Add a Function to the HTML Header Attribute Edit an Item to Call the Function Change the Item to a Select List Create a Call to the disFormItems Function Add a Function to the HTML Header Attribute To add a function to the HTML Header attribute on page 2: 1. The Edit Page appears. The following example demonstrates how to add a JavaScript function to prevent users from adding commissions to employees who are not in the Sales Department (P2_DEPARTMENT_ID = 80). Navigate to the Page Definition for page 2. 2.getElementById(nd). you call the function from an item on the page. scroll down and place your cursor after the last </script> tag.a){ var lEl = document. it is important to note that a page must be submitted for any changes on the page to be evaluated. In HTML Header.

background = '#ffffff'. 4. In HTML Form Element Attributes. In List of Values definition. enter: SELECT department_name. b. consider creating a named LOV and referencing it. Tip: For simplicity.disabled = true. To edit the P2_DEPARTMENT_ID item to call the function: 1.disabled = false. html_disableItem('P2_COMMISSION_PCT'. Edit an Item to Call the Function The next step is to edit the P2_DEPARTMENT_ID item and add code to the HTML Form Element Attributes attribute to call the function.} } var lTest = lReturn == '80'.background = '#cccccc'.} function disFormItems(){ var lOptions = document. Under Items. Under List of Values.value. Scroll down to List of Values.selected==true){lReturn = lOptions[i]. enter the following: onchange="disFormItems()" 4.style. for(var i=0. 2. Scroll down to Element. Click Apply Changes. however. lEl. From Display Null. this tutorial has you create an item-level list of values.getElementById('P2_DEPARTMENT_ID'). Click Apply Changes.options var lReturn. As a best practice.style.Enabling and Disabling Form Elements lEl.length. Click Apply Changes.i<lOptions.i++){ if(lOptions[i]. specify the following: a. lEl. } </script> 6. }} return true. }else{ lEl. 3. Under Items. select P2_DEPARTMENT_ID. select Select List. select P2_DEPARTMENT_ID. How to Incorporate JavaScript into an Application 10-9 . select No. Change the Item to a Select List To change the P2_DEPARTMENT_ID to display as a select list: 1. 2. department_id FROM oehr_departments 5. From the Display As list in the Name section. 3.lTest).

5. The Edit Page appears. Run the page. Selecting Do not focus cursor prevents conflicts between generated JavaScript and custom JavaScript. Scroll down to the HTML Body Attribute section. first_field(). A good place to make this call would be from the Page HTML Body Attribute." 7. Figure 10–5 Revised Update Form 10-10 Oracle Database Application Express Advanced Tutorials . enter the following: onload="disFormItems(). Navigate to the Page Definition for page 2. 3. you need to create a call to the disFormItems function after the page is rendered to disable P2_COMMISSION_PCT if the selected employee is not a Sales representative. Also notice that the Commission Pct field is unavailable since the Department ID is Administration. Locate the Display Attributes section. Figure 10–5 on page 10-10 demonstrates the completed form. From Cursor Focus. select Do not focus cursor. 4. Click Apply Changes.Enabling and Disabling Form Elements See Also: "Creating Lists of Values" in Oracle Database Application Express User's Guide Create a Call to the disFormItems Function Finally. To create a call to the disFormItems function: 1. Note that Department ID displays as a select list. Under Page. In the Page HTML Body Attribute. click the Edit page attributes icon. 6. 2. 8.

Edit and administrative privileges controlled by access control list. access control list not used.11 How to Build an Access Control Page You can control access to an application. Run the Access Control Administration page. 3. Administrative access only. Once you create the Access Control Administration page. Restricted access. In addition to creating the Access Control Administration page. the Access Control Wizard also creates: ■ two tables within the application’s default schema to manage access control How to Build an Access Control Page 11-1 . Select an application mode: – – – – Full access to all. Add users to the Access Control List. Only users defined in the access control list are allowed. This section contains the following topics: ■ ■ ■ ■ ■ ■ ■ How Access Control Administration Works Creating an Application Creating an Access Control Administration Page Creating an Authentication Function Updating the Current Authentication Scheme Applying Authorization Schemes to Components Testing the Application How Access Control Administration Works You create an access control list by running the Access Control Wizard to create an Access Control Administration page. This page contains a list of application modes and an Access Control List. Public read only. The page contains a list of application modes and an Access Control List. 2. individual pages. or page components by creating an Access Control Administration page. This tutorial explains how to build an Access Control Administration page and then restrict access to an application so that only privileged users can perform specific functions. you: 1.

csv) or tab delimited. Click Create.zip file UNIX or Linux . comma separated (*. Text File . Click Next. Topics in this section include: ■ ■ ■ Download Spreadsheet Data Create an Application Based on Spreadsheet Data Run the Application Download Spreadsheet Data Download the following *. For Load Method: a.Enter the following command: $ unzip acl_employees.zip 2. In your Web browser go to: http://www. 2. 5. Accept the remaining defaults and click Next.Double-click the acl_employees. 3. Select Upload file. Unzip and extract the acl_employees. Select Create from Spreadsheet and click Next.zip Create an Application Based on Spreadsheet Data To create a new application based on spreadsheet data: 1. click the Application Builder icon. 3. b. comma separated (*.csv) or tab delimited and click Next.csv file to you local machine: 1. 6. Select Upload file. Once you create an Access Control.csv file.Click Browse and navigate to the acl_employees. The Application Builder home page appears. 11-2 Oracle Database Application Express Advanced Tutorials . Download the acl_employees. Creating an Application First.Creating an Application ■ ■ the authorization schemes that correspond to the application mode list options the privileges available in the Access Control List You can control access to a specific page or page component by selecting one of these authorization schemes on the page or component attributes pages. tables and values to suit the specific needs of your application.oracle. On the Workspace home page. you need to create an application based on employee data in a spreadsheet. 4. For Data: a.com/technology/products/database/application_ express/packaged_apps/acl_employees.zip file to your computer. you can customize the page.csv file: – – Microsoft Windows . b.

Figure 11–1 Run Application Icon 2. b. enter your workspace user name and password and click Login. The report appears as shown in Figure 11–2 on page 11-4. For User Interface. For Summary Page: a. select Theme 2 and click Next. Summary by Column . Click Create. See "About Application Authentication" on page 1-5. Table Name .Select DEPARTMENT_ID and click Next.Creating an Application 7. 8. 9. For Table Properties: a. A theme is collection of templates that define the layout and style of an application. Aggregate by Column . Accept the remaining defaults and click Next. Schema .Do not make a selection and click Next. Singular Name . For Application Options. accept the defaults and click Next. You can change a theme at any time. How to Build an Access Control Page 11-3 . b. c.Enter Employee. c. Click the Run Application icon as shown in Figure 11–1.Select the appropriate schema. The Application home page appears. 12. If prompted to enter a user name and password. 11. 10. Run the Application To run the application: 1.Enter Employees. For User Interface Defaults: a. Click Next. b. Plural Names .Enter ACL_EMPLOYEES.

enter 8 and click Next.Creating an Access Control Administration Page Figure 11–2 ACL_EMPLOYEES Application The ACL_EMPLOYEES application enables you to view and update employee data. Creating an Access Control Administration Page Next. you need to secure your application so that only privileged users can perform certain operations. To update a specific record. When you implement access control on an Application Express application. select Access Control and click Next. 3. In Administration Page Number. Click Create on the Developer toolbar. The Access Control Wizard appears. For Tabs: 11-4 Oracle Database Application Express Advanced Tutorials . click the Edit icon in the far left column. The first step is to create an access control page by running the Access Control Page Wizard. the best approach is to use an authorization scheme defined at the application level. For Page. 4. Select New page and click Next. 2. Clicking the Analyze tab provides you with access to both a visual and tabular breakdown of the number of employees in each department. Topics in this section include: ■ ■ ■ Create an Access Control Page View the Page Add Users to the Access Control List Create an Access Control Page To create an access control page: 1. 5.

A Success page appears. add three users to the Access Control List: ■ ■ ■ Luis Popp (LPOPP) will have View privileges. 6. Tab Set . To add users to the Access Control List: 1. d. Also note that the default Application Mode is Full Access.Select TS1 (Employees. Enter the first user: How to Build an Access Control Page 11-5 . Adam Fripp (AFRIPP) will have Edit privileges. Analyze). 2. Click Next. Tab Options . Click Run Page. Add Users to the Access Control List Next. Review the confirmation page and click Finish. Click Set Application Mode. A new row appears. 2. 3. c. Under Access Control List.Enter Administration. select Restricted access. John Chen (JCHEN) will have Administrator privileges. Under Application Mode.Select Use an existing tab set and create a new tab within the existing tab set. b. Tab Set Label . A new page appears as shown in Figure 11–3. Only users defined in the access control list are allowed. View the Page To run the page: 1. Figure 11–3 Access Control Administration Page Notice the page is divided into two regions: Application Administration and Access Control List. click Add User.Creating an Access Control Administration Page a.

Enter LPOPP. In the SQL editor pane: a. Creating an Authentication Function Next. Click Apply Changes. click the Home breadcrumb link. d. c. Username . 4. RETURN FALSE. The the Workspace home page appears. you need to make employees in the ACL_EMPLOYEES table the users of the application. END LOOP. The Application home page appears.Enter JCHEN. 11-6 Oracle Database Application Express Advanced Tutorials . END. Enter the following code: CREATE OR REPLACE FUNCTION acl_custom_auth ( p_username IN VARCHAR2. Privilege . b. Click Apply Changes. d.Select Edit. b. 2. To create the authentication function: 1. Click Add User to add a blank row where you can enter the next user. Username . 3. Click Add User to add a blank row where you can enter the first user.Select Administrator. 3. Click SQL Workshop and then SQL Commands. Click Apply Changes. Click Application on the Developer toolbar. On the Application Builder home page.Select View. Enter the next user: a. Click Run. c. b. p_password IN VARCHAR2) RETURN BOOLEAN IS BEGIN FOR c1 IN (SELECT 1 FROM acl_employees WHERE upper(userid) = upper(p_username) AND upper(last_name) = upper(p_password)) LOOP RETURN TRUE. c. 5. Username .Creating an Authentication Function a. / b. Note that the function checks for the userid and its associated last name as a password. Privilege . Enter the next user: a. Privilege .Enter AFRIPP. To accomplish this. you create a simple authentication function in the current authentication scheme.

4. Under Security. 6. Click Application Builder and then click ACL Employees.Applying Authorization Schemes to Components 4. you previously added three users to the Access Control List: ■ ■ ■ LPOPP had View privileges. Click Shared Components. To associate an authorization scheme with your application: How to Build an Access Control Page 11-7 . The Workspace home page appears. Topics in this section include: ■ ■ ■ ■ ■ Associate an Authorization Scheme with the Application Associate Edit Privileges with the ID Column Associate Edit Privileges with the Create Button Associate Edit Privileges with Page 2 Restrict Access to Page 8 Associate an Authorization Scheme with the Application First.view authorization scheme with the application. Click the Home breadcrumb link. In Authentication Function. 5. Scroll back to the top of the page and click Apply Changes. replace -BUILTIN. To update the current authentication scheme. you associate the access control . Edit. Click the Application Express . To accomplish this. The Application home page appears. The Authentication Schemes page appears. click Authentication Schemes. Applying Authorization Schemes to Components Next you need to associate the authorization scheme with the appropriate application components.Current icon. you need to update the current authentication scheme to use the new function. you need to specify that users will only be able to access the application if they have View privileges. As you may recall. you associate the View.with the following: return acl_custom_auth 7. AFRIPP had Edit privileges JCHEN had Administrator privileges In this exercise. 1. and Administrator privileges with specific application components to control which users are allowed to perform what actions. 2. Scroll down to Login Processing. Updating the Current Authentication Scheme Next. 3.

5. Scroll down to Authorization. Navigate to the Page Definition for Page 1. click Definition. Scroll down to Authorization. The Page Definition for page 1 appears. Under Regions. From Authorization Scheme. To accomplish this. associate the access control . 5. Click the Edit icon for ID. The Application home page appears. Click Apply Changes at the top of the page. 2. To associate edit privileges with the Create button: 1. click the Report link. The Column Attributes page appears. select access control . Click 1 . Associate Edit Privileges with the Create Button Next. Associate Edit Privileges with the ID Column For this exercise. but displays it for users with Edit or Administrator privileges. Under Buttons. Click the Application ID breadcrumb link. This hides the Edit icon on page 1 for users with View privileges. This will hide the Edit icon for unprivileged users. select access control . 6. click the Create link (not the icon). 5. The Application home page appears. Scroll down to Authorization. The Page Definition for page 1 appears. Under Application. Click Shared Components. From Authorization Scheme. Click Apply Changes at the top of the page. 3.edit authorization scheme with the ID column. 4. 3. you associate the access control .edit. Click the Page 1 breadcrumb link. The Report Attributes page appears. 11-8 Oracle Database Application Express Advanced Tutorials . From Authorization Scheme. Click Apply Changes at the top of the page. 7. 3. To associate edit privileges with the ID column: 1. Click the Application ID breadcrumb link.edit.edit authorization scheme to the Create button. select access control . only users with at least Edit privileges should be able to edit or delete data. Click the Security tab. 7.Report Page. The Edit icon resembles a small page with a pencil on top of it. 6.view. The Page Definition for Page 1 appears. 4.Applying Authorization Schemes to Components 1. 2. 4. 2.

Click Apply Changes at the top of the page. you specify the access control . associate the access control . The Page Definition for page 2 appears. enter 8 and click Go. test your application by logging in as each of these users. Under Tabs. 2. select access control . Under Page.administrator. Navigate to page 2. 5. How to Build an Access Control Page 11-9 . To specify an authorization scheme for page 2: 1. From Authorization Scheme.Testing the Application Associate Edit Privileges with Page 2 Next. Click Apply Changes at the top of the page. you added three users to the Access Control List: ■ ■ ■ Luis Popp (LPOPP) has View privileges Adam Fripp (AFRIPP) has Edit privileges John Chen (JCHEN) has Administrator privileges Next. Testing the Application At the beginning of this tutorial. The Page Definition for page 8 appears. The Page Definition for page 8 appears. 3. Scroll down to Security. 5. Restrict Access to Page 8 Lastly. From Authorization Scheme. The Page Definition for page 8 appears. 3.edit authorization scheme with page 2. 2. select access control . click the Edit page attributes icon.administrator authorization scheme with all of page 8 and with the Administration tab. Navigate to page 8. In the Page field. Click Apply Changes at the top of the page.administrator. Access Control Administration. 4. 2. Under Page. 4. 3. 4. To accomplish this. From Authorization Scheme. Specify an Authorization Scheme for Page 8 To specify an authorization scheme for page 8: 1. Specify an Authorization Scheme for the Administration Tab To specify an authorization scheme for page 8: 1. Scroll down to Security. select access control .edit. click the Administration link. In the Page field enter 2 and click Go. click the Edit page attributes icon. you need to restrict access to page 8. Scroll down to Authorization.

Password .AFRIPP. When prompted. To log in as Luis Popp: 1. c.Fripp. The Employees Report page appears as shown in Figure 11–5. b. When prompted. Click the Run Page icon in the upper right corner. The Employees Report page appears as shown in Figure 11–4. Click Login.Testing the Application Topics in this section include: ■ ■ ■ Log In with View Privileges Log In with Edit Privileges Log In with Administrator Privileges Log In with View Privileges Luis Popp (LPOPP) has View privileges.LPOPP. c. 2. Click Login. Username . Password . 3. b. Figure 11–4 Employees Report with View Privileges Note that the Edit icon and the Administration tab no longer appear. Username .Popp. To log in as Adam Fripp: 1. specify the following: a. specify the following: a. Log In with Edit Privileges Adam Fripp (AFRIPP) has Edit privileges. 11-10 Oracle Database Application Express Advanced Tutorials . Click Logout in the upper right corner.

Click Logout in the upper right corner. To log in as John Chen: 1.Testing the Application Figure 11–5 Employees Report with Edit Privileges Note that the Edit icon now appears to the left of the Employee Id column. 2. How to Build an Access Control Page 11-11 . Click Administrator tab.JCHEN Password . Username . b. The Employees Report page appears as shown in Figure 11–6. When prompted. Figure 11–6 Employees Report with Administrator Privileges 2. c. specify the following: a.Chen Click Login. Log In with Administrator Privileges John Chen (JCHEN) has Administrator privileges. but the Administration tab still does not appear.

Testing the Application 11-12 Oracle Database Application Express Advanced Tutorials .

Within every project there are always multiple issues that need to be tracked. creating the underlying database objects.12 How to Build and Deploy an Issue Tracking Application This tutorial describes how to create and deploy an application that tracks the assignment. The company’s project leads use various methods to track issues. This tutorial walks you through all the steps necessary to create a robust issue tracking application. This approach offers each project lead access to just the data they need and makes it easier for management to determine if critical issues are being addressed. and progress of issues related to a project. and categorizing issues by using spreadsheets. and building a rich user interface. By creating a hosted application in Oracle Application Express. It is recommended that you read through the entire document first to become familiar with the material before you attempt specific exercises. In this business scenario. How to Build and Deploy an Issue Tracking Application 12-1 . and managed. project leads can easily record and track issues in one central location. MRVL Company has several projects that must be completed on time for the company to be profitable. loading demonstration data. status. including manually recording statuses in notebooks. including planning the project. prioritized. Topics in this section include: ■ ■ ■ ■ ■ ■ ■ Planning and Project Analysis Designing the Database Objects Implementing Database Objects Loading Demonstration Data Building a Basic User Interface Adding Advanced Features Deploying Your Application Planning and Project Analysis Effective project management is the key to completing any project on time and within budget. organizing issues in text documents. Note: This tutorial takes approximately four to five hours to complete. Any missed project deadlines will result in lost revenue.

For this business scenario. and how to present data to users. security requirements. everyone agrees that the application should include the following information: ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Summary of the issue Detailed description of the issue Who identified the issue The date on which the issue was identified Which project the issue is related to Who the issue is assigned to A current status of the issue Priority of the issue Target resolution date Actual resolution date Progress report Resolution summary Defining Security Requirements Because the project leads are concerned about everyone having access to all the information. Topics in this section include: ■ ■ ■ ■ ■ Gathering the Necessary Data Defining Security Requirements Selecting Data Management Functions Selecting Data Presentation Functions Defining Special Function Requirements Gathering the Necessary Data Currently. the project leads establish requirements that define the information that must be tracked. data management functions. only the person assigned or a project lead can change data about the issue 12-2 Oracle Database Application Express Advanced Tutorials . you first need to define application requirements. Then.Planning and Project Analysis Planning and Project Analysis Before beginning development on an Oracle Application Express application. Together. they agree upon the following access rules: ■ ■ ■ ■ ■ ■ Each team member and project lead is only assigned to one project at a time Each team member and project lead must be assigned to a project Managers are never assigned to a specific project Only managers can define and maintain projects and people Everyone can enter new issues Once assigned. each project lead tracks information slightly differently. you use the defined requirements to design a database and an outline that describes how the user interface accepts and presents data.

the project leads determine that the application must support the following special functions: ■ ■ Notify people when an issue is assigned to them Notify the project lead when any issue becomes overdue Designing the Database Objects Once you have defined the database requirements. the project leads determine how information will be entered into the system. users need to view the data. for this project you need to create three tables: ■ Projects tracks all current projects How to Build and Deploy an Issue Tracking Application 12-3 . for managers Resolved issues by month identified Issue resolution dates displayed on a calendar Days to Resolve Issues by person Defining Special Function Requirements Finally. In this step you need to think about how information should be organized in the tables in the underlying database.Designing the Database Objects ■ Management needs views that summarize the data without access to specific issue details Selecting Data Management Functions Next. the next step is to turn these requirements into a database design and an outline that describes how the user interface accepts and presents data. The team decides that users must be able to view the following: ■ ■ ■ ■ ■ ■ ■ ■ ■ All issues by project Open issues by project Overdue issues. For this project. Given the requirements described "Planning and Project Analysis" on page 12-2. by project and for all Recently opened issues Unassigned issues Summary of issues by project. users must be able to: ■ ■ ■ ■ ■ ■ ■ ■ Create issues Assign issues Edit issues Create projects Maintain projects Create people Maintain people information Maintain project assignments Selecting Data Presentation Functions Once the data is entered into the application.

to support the tables. These date columns help determine if any outstanding issues are jeopardizing the project end date. Column Name person_id 12-4 Oracle Database Application Express Advanced Tutorials . To tie the current user to their role within the organization. such as sequences and triggers. The actual end date. target date. Table 12–2 People Table Details Type integer Size n/a Not Null? Yes Constraints Primary key Description A numeric ID that identifies each user. Table 12–1 describes the columns to be included in the Projects table. project start date. The targeted project end date. project_name start_date target_end_date actual_end_date varchar2 date date date 100 n/a n/a n/a Yes Yes Yes No Unique key None None None A unique alphanumeric name for the project. System generated primary keys will be used for all tables so that all the data can be edited without executing a cascade update. Project leads and team members will also have an assigned project. including the project to which it is related and the person assigned to the issue In addition to the tables. The project start date. Table 12–1 Project Table Details Type integer Size n/a Not Null? Yes Constraints Primary key Description A unique numeric identification for each project. you also need to create additional database objects. Populated by a sequence using a trigger. Table 12–2 on page 12-4 describes the columns that will be included in the People table. and actual end date columns. Column Name project_id About the People Table Each person will have a defined name and role. Populated by a sequence using a trigger. Topics in this section include: ■ ■ ■ About the Projects Table About the People Table About the Issues Table About the Projects Table Each project must include project name.Designing the Database Objects ■ ■ People contains information about who can be assigned to handle issues Issues tracks all information about an issue. email addresses will be used for user names.

issue_summary issue_description identified_by identified_date related_project assigned_to status varchar2 varchar2 integer date integer integer varchar2 200 2000 n/a n/a n/a n/a 8 Yes No Yes Yes Yes No Yes None None foreign key to People None foreign key to Projects foreign key to People check constraint A brief summary of the issue. Table 12–3 describes the columns to be included in the Issues table. Populated by a sequence using a trigger. they decided to track separate issues assigned to each person. Issues will be included in columns along with additional columns to provide an audit trail. If the roles that are assigned to a user need to be dynamic. About the Issues Table When the project leads defined their application requirements. Note: For the purposes of this exercise. when it was created. A detailed description of the issue. The issue status. The audit trail will track who created the issue. Automatically set to Open when new and set to Closed when actual resolution date entered. The user who identifies the issue. Table 12–3 Issue Table Details Type integer Size n/a Not Null? Yes Constraints primary key Description A unique numeric ID that identifies an issue. The priority of the issue. The date the issue was identified Projects related to the issue. you would implement roles as a separate table with a foreign key that relates to the people table. as well as who modified the issue last and on what date that modification was made.) People Table Details Column Name person_name person_email person_role Type varchar2 varchar2 varchar2 Size 100 100 7 Not Null? Yes Yes Yes Constraints Unique key None Check constraint Description A unique name that identifies each user. The person who owns this issue. this application has been simplified. Also.Designing the Database Objects Table 12–2 (Cont. The role assigned to each user. User email address. users typically work on more than one project at a time. Column Name issue_id priority varchar2 6 No check constraint How to Build and Deploy an Issue Tracking Application 12-5 . User data is usually much more elaborate and is often pulled from a corporate Human Resource system.

Upload a script to the SQL Script Repository that contains all the necessary create object statements. Populated by a trigger. Execute SQL Commands. sequences. Run SQL Commands by typing or pasting them into the SQL Commands. materialized views. You can: ■ Create an Object in Object Browser. For example. If the valid priorities assigned to issues need to be dynamic. functions. click the SQL Workshop icon on Workspace home page and then click SQL Commands. procedures. See "Managing Database Objects with Object Browser" in Oracle Database Application Express User's Guide. Tracking each change to the data would require an additional table. navigate to SQL Workshop. User who created this issue. and synonyms.Implementing Database Objects Table 12–3 (Cont. Upload a script. types. click SQL Workshop on the Workspace home page. Resolution summary. To upload a script. Actual resolution date of the issue. click SQL Scripts and then click Upload. The progress of the issue. and click Create. views. To create an object in Object Browser. Populated by a trigger. See "Using SQL Commands" in Oracle Database Application Express User's Guide. packages. Topics in this section include: ■ ■ ■ About Building Database Objects About Building Database Objects View the Created Database Objects About Building Database Objects There are several ways to create objects in Oracle Application Express. Implementing Database Objects This first step in building an application is to create the database objects. you would be required to add a separate table with a foreign key that relates to the issues table.) Issue Table Details Column Name target_resolution_date progress actual_resolution_date resolution_summary created_date created_by last_modified_date Type date varchar2 date varchar2 date varchar2 date Size n/a 2000 n/a 2000 n/a 60 n/a Not Null? No No No No Yes Yes No Constraints None None None None None None None Description The target resolution date. then Object Browser. See "Uploading a SQL Script" in Oracle Database Application Express User's Guide. To access SQL Commands. ■ ■ 12-6 Oracle Database Application Express Advanced Tutorials . Note: A real-world application might need more extensive auditing. Use Object Browser to create tables. you might need to track each change to the data rather than just the last change. triggers database links. indexes. linked to the issues table. A wizard walks you through the choices necessary to create the selected database object.

On the Workspace home page. select one of the following tables: ■ ■ ■ HT_ISSUES HT_PEOPLE HT_PROJECTS See Also: "Managing Database Objects with Object Browser" in Oracle Database Application Express User's Guide. 3. For this exercise. You will use this method to create database objects for this exercise. select SQL Scripts and then click Create. Click the Home breadcrumb link. Click Save. Return to the Workspace home page. select Tables. click SQL Workshop and then Object Browser. On the SQL Scripts page. To view database objects in Object Browser: 1. From the Object list on the left side of the page. View the Created Database Objects You can view database objects using Object Browser. you create and run a script. See "Creating a SQL Script in the Script Editor" in Oracle Database Application Express User's Guide.Implementing Database Objects ■ Create script online. On the Workspace home page. click the SQL Workshop icon on the Workspace home page. 2. Log in to Oracle Application Express. To view the details of a specific object. The Manage Script Results page displays a message that the script has been submitted for execution. 5. For Script Name. In the Script Editor: a. b. Create a script online in the Script Repository. To create a script online. A summary page appears. Copy the data definition language (DDL) in "Creating Application Database Objects DDL" on page A-1 and paste it into the script. 4. Click Run. How to Build and Deploy an Issue Tracking Application 12-7 . Click Create. 2. The Script Editor appears. Click Run again. c. 4. Create and Run a Script To build database objects by creating a script: 1. click the DDL for Issue Management Application icon. click SQL Workshop and then SQL Scripts. enter DDL for Issue Management Application. 6. 7. 3.

project_name. however.Loading Demonstration Data Loading Demonstration Data Once you have created all the necessary database objects. sysdate-60. sysdate+30) / INSERT INTO ht_projects (project_id. Look at the DDL you copied from "Creating Application Database Objects DDL" on page A-1. start_date. start_date. 'New Payroll Rollout'.Copy and paste the following: INSERT INTO ht_projects (project_id. project_name. 'Internal Infrastructure'. sysdate+60) / c. project_name. start_date. sysdate+15) / INSERT INTO ht_projects (project_id. sysdate-30. Click Save. sysdate-150. target_end_date) VALUES (1. target_end_date) VALUES (2. 12-8 Oracle Database Application Express Advanced Tutorials . you use SQL Scripts to load demonstration data. sysdate-120. project_name. start_date. You can manually load data using the import functionality available in SQL Scripts. target_end_date) VALUES (5. Notice that the sequences used for the primary keys start at 40 in order to leave room for the demonstration data. In the Script Editor. 'Email Integration'. target_end_date) VALUES (3. specify the following: a. the next step is to load data into the tables. project_name.Enter Load Project Data. sysdate-30) / INSERT INTO ht_projects (project_id. Topics in this section include: ■ ■ ■ Load Projects Data Load People Data Load Issues Data Load Projects Data To import data into the Projects table: 1. start_date. 3. 'Employee Satisfaction Survey'. target_end_date) VALUES (4. The BEFORE INSERT triggers are coded so that the sequence is only accessed if a primary key value is not provided: they will not need to be disabled in order for you to load data. sysdate-60) / INSERT INTO ht_projects (project_id. 2. sysdate-150. b. In the following exercise. 4. Click SQL Scripts. 'Public Website Operational'. Script . Script Name . Click Create. Click the SQL Workshop breadcrumb link.

Loading Demonstration Data

5.

On the SQL Scripts page, click the Load Project Data icon. The Script Editor appears.

6.

Click Run. A summary page appears.

7.

Click Run again. The Manage Script Results page displays a message that the script has been submitted for execution.

Update Dates to Make the Projects Current
Although you have created the projects, the dates need to be updated to make the projects current. To accomplish this, you run another script. To update the project dates and make the projects current:
1. 2. 3.

Click the SQL Scripts breadcrumb link. Click Create. In the Script Editor:
a. b.

Script Name - Enter Update Project Dates. In Script, copy and paste the following:
UPDATE ht_projects SET start_date = sysdate-150, target_end_date = sysdate-30 WHERE project_id = 1 / UPDATE ht_projects SET start_date = sysdate-150, target_end_date = sysdate+15 WHERE project_id = 2 / UPDATE ht_projects SET start_date = sysdate-120, target_end_date = sysdate-60 WHERE project_id = 3 / UPDATE ht_projects SET start_date = sysdate-60, target_end_date = sysdate+30 WHERE project_id = 4 / UPDATE ht_projects SET start_date = sysdate-30, target_end_date = sysdate+60 WHERE project_id = 5 /

c. 4.

Click Save.

On the SQL Scripts page, click the Update Project Dates icon. The Script Editor appears.

5. 6.

Click Run. Click Run again.
How to Build and Deploy an Issue Tracking Application 12-9

Loading Demonstration Data

The Manage Script Results page displays a message that the script has been submitted for execution.

Load People Data
After you have loaded data into the Project table, you can load People data. Because of foreign keys in the Projects table, People data must be loaded after Project data. You load data into the People table by creating and running a script in SQL Workshop. To load data into the People table:
1. 2. 3.

Click the SQL Scripts breadcrumb link. On the SQL Scripts page, click Create. In the Script Editor:
a. b.

Script Name - Enter Load People Data. Script - Copy and paste the following:
INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (1, 'Joe Cerno', 'joe.cerno@mrvl-bademail.com', 'CEO', null) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (2, 'Kim Roberts', 'kim.roberts@mrvl-bademail.com', 'Manager', null) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (3, 'Tom Suess', 'tom.suess@mrvl-bademail.com', 'Manager', null) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (4, 'Al Bines', 'al.bines@mrvl-bademail.com', 'Lead', 1) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (5, 'Carla Downing', 'carla.downing@mrvl-bademail.com', 'Lead', 2) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (6, 'Evan Fanner', 'evan.fanner@mrvl-bademail.com', 'Lead', 3) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) values (7, 'George Hurst', 'george.hurst@mrvl-bademail.com', 'Lead', 4) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (8, 'Irene Jones', 'irene.jones@mrvl-bademail.com', 'Lead', 5) / INSERT INTO ht_people

12-10 Oracle Database Application Express Advanced Tutorials

Loading Demonstration Data

(person_id, person_name, person_email, person_role, assigned_project) VALUES (9, 'Karen London', 'karen.london@mrvl-bademail.com', 'Member', 1) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) values (10, 'Mark Nile', 'mark.nile@mrvl-bademail.com', 'Member', 1) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (11, 'Jane Kerry', 'jane.kerry@mrvl-bademail.com', 'Member', 5) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (12, 'Olive Pope', 'olive.pope@mrvl-bademail.com', 'Member', 2) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (13, 'Russ Sanders', 'russ.sanders@mrvl-bademail.com', 'Member', 3) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (14, 'Tucker Uberton', 'tucker.uberton@mrvl-bademail.com', 'Member', 3) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (15, 'Vicky Williams', 'vicky.willaims@mrvl-bademail.com', 'Member', 4) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (16, 'Scott Tiger', 'scott.tiger@mrvl-bademail.com', 'Member', 4) / INSERT INTO ht_people (person_id, person_name, person_email, person_role, assigned_project) VALUES (17, 'Yvonne Zeiring', 'yvonee.zeiring@mrvl-bademail.com', 'Member', 4) / c. 4.

Click Save.

On the SQL Scripts page, click the Load People Data icon. The Script Editor appears.

5. 6.

Click Run. Click Run again. The Manage Script Results page displays a message that the script has been submitted for execution.

How to Build and Deploy an Issue Tracking Application

12-11

Building a Basic User Interface

Load Issues Data
The last data you need to load is the Issues data. As with People data, you create and run a script to populate the Issues table. To load data into the Issues table:
1. 2. 3.

Click the SQL Scripts breadcrumb link. Click Create. In the Script Editor:
a. b. c.

Script Name - Enter Load Issue Data. Script - Copy and paste the script in "Creating Issues Script" on page A-6. Click Save.

4.

On the SQL Scripts page, click the Load Issue Data icon. The Script Editor appears.

5. 6.

Click Run. Click Run again. The Manage Script Results page displays a message that the script has been submitted for execution.

Building a Basic User Interface
After you create the objects that support your application and load the demonstration data, the next step is to create a user interface. In this exercise, you use the Create Application Wizard in Application Builder to create an application and then the pages that support the data management and data presentation functions described in "Planning and Project Analysis" on page 12-2. Topics in this section include:
■ ■ ■ ■ ■ ■ ■

Create the Application Add Pages to Maintain Projects Add Pages to Track People Add Pages to Track Issues Create Summary Reports Add Content to the Home Page Add a Breadcrumb Menu

Create the Application
You use the Create Application Wizard to create an application containing pages that enable users to view reports on and create data for the selected tables within a schema. Alternatively, you can create an application first and then add pages to it. As the application requirements include customized overview pages, for this exercise you will use the latter approach. To create the application:
1. 2.

Click the Home breadcrumb link. On the Workspace home page, click Application Builder.

12-12 Oracle Database Application Express Advanced Tutorials

No. This authentication is part of the default security of any newly created application. c. Logout enables the user to log out of the application. accept the default. 11. select Theme 10 and click Next. 9. See "About Application Authentication" on page 1-5. Next. 7. Click Next. For Tabs. For Name: a. For Shared Components. Click Create. Under Select Page Type. Click Create. Create Application . Figure 12–1 Issue Tracking Application Home Page Although the page has no content. When prompted. For Attributes. Click Add Page. 8. and User Language Preference Derived From and click Next. Click Next. b. b. enter your workspace user name and password and then click Login. c. 5. Under Add Page: a. and click Next. accept the defaults for Authentication Scheme. 10. the home page appears. To view the application: 1. As shown in Figure 12–1 on page 12-13. How to Build and Deploy an Issue Tracking Application 12-13 . add a blank page. Click the Run Application icon on the Applications home page. 4.Building a Basic User Interface 3. For User Interface. 6. For Method. Language.Select From scratch. 2. select Create Application and then click Next. select No Tabs and then click Next.Enter Issue Tracker. Name . notice that the Create Application Wizard has created the following items: ■ Navigation Links .A navigation bar entry displays in the upper right of the page. select Blank.

This wizard creates a report page and maintenance page for each table. 2. The ID was added to simplify the foreign key and enable cascading updates. 4. select the fourth option (the word Edit) and then click Next. the next step is to create individual pages. For Define Form Page: a. Page Name and Region Title . 9. 10. For Tab Options.Enter 3. For Table/View Name. Once you have created the basic application structure. select HT_PROJECTS and click Next. Accept the remaining defaults and click Next. Page Number: Enter 2. you need to create pages that enable users to view and add data to tables. Click Application on the Developer toolbar to return to the Application home page. For Primary Key. accept the default. select all columns except PROJECT_ID and then click Next. Click Next. To accomplish this. For Tab Options. Do not use tabs. 3. These links only display if you are logged in as a developer. Page Name and Region Title . Select Form on a Table with Report and click Next. select the appropriate schema and then click Next.Enter Projects. 8. Do not use tabs. b.The Developer toolbar appears on the page. For Define Report Page: a. 6. 5. and then click Next. 7. 12-14 Oracle Database Application Express Advanced Tutorials .Building a Basic User Interface ■ Developer Links . For Table/View Owner. accept the default. On the Application home page.Enter Create/Edit Project. PROJECT_ID and click Next. For Select Column(s). click Create Page. Topics in this section include: ■ ■ ■ Create Pages for Maintaining Projects Refine the Appearance of the Projects Report Page Refine the Create/Edit Project Page Create Pages for Maintaining Projects To create pages for maintaining the HT_PROJECTS table: 1. 3. you use the Form on a Table with Report Wizard. and click Next. Page . Add Pages to Maintain Projects First. 12. For Edit Link Image. c. accept the default. b. Note that Project Name is unique and identifies the project. 11. Notice that the Create Application Wizard also created a Login page. c. Select Form and then click Next. Users who only have access to run the application cannot see these links.

and click Next. To add a format mask to the dates on the Create/Edit Project page: 1. For Source Type. click Report next to Projects. On the Application home page. 16. Edit the format for START_DATE: a. and click Next. Figure 12–2 Projects Page Click the Edit link to view an existing row or click the Create button to create a new record. Click the Run Page icon. Projects: a. 14. Under Regions. the newly created report displays the demo data. Click the Edit icon to the left of START_DATE. Update and Delete. b. How to Build and Deploy an Issue Tracking Application 12-15 . select all columns and click Next. 15. Figure 12–3 Create/Edit Project Form Refine the Appearance of the Projects Report Page You can change the appearance of the Projects report page by adding a format mask to the dates. If you click Edit to the left of Employee Satisfaction Survey. The Column Attributes page appears. 3. Navigate to the Page Definition for page 2. a form resembling Figure 12–3 appears. 2. accept the default. Review your selections and click Finish. As shown in Figure 12–2. Under Identify Process Options.Building a Basic User Interface 13. 17. Click Application on the Developer toolbar.Projects. click 2 . For Select Column(s). Existing Trigger. accept the defaults for Insert.

Under Column Formatting. 9. The Report Attributes page appears. 4. enable users to sort on column headings. The Column Attributes page appears. 13. Scroll down to Messages. For PROJECT_ID. enter the following: No Projects found.Building a Basic User Interface b. Under Column Formatting. Click Apply Changes. delete the Heading Edit. for Number/Date Format. for Number/Date Format. This selection specifies PROJECT_NAME as the default column to sort on. 8. Under Column Formatting. Note this functionality can be overridden by any user selections. enter DD-MON-YYYY. 10. To view your changes. enter DD-MON-YYYY. select the light gray arrow. click Apply Changes. b. Figure 12–4 Projects Page with Sort Control 12-16 Oracle Database Application Express Advanced Tutorials . note the addition of a sort control on the Project Name column and the format of the dates in the Start Date and Target End Date columns. b. Next. 7. for Number/Date Format. Click the Next button (>) at the top of the page to navigate to the next Report Item. 5. As shown in Figure 12–4. For PROJECT_NAME. Scroll down to Sorting. select center for Column Alignment and Heading Alignment. For the START_DATE. The Column Attributes page appears. click the Run Page icon in the upper right of the page. For Ascending and Descending Image. At the top of the page. select 1 for Sort Sequence. In When No Data Found Message. To enable column heading sorting. 12. Edit the format for the TARGET_END_DATE: a. 11. enter DD-MON-YYYY. check Sort for all columns except PROJECT_ ID. 6. Click the Next button (>) at the top of the page to navigate to the next Report Item. TARGET_END_DATE and ACTUAL_END_DATE columns. Edit the format for the ACTUAL_END_DATE: a.

Building a Basic User Interface

Refine the Create/Edit Project Page
Next, you need to customize the Create/Edit Project page to make the Project Name field larger and the date fields smaller. You also need to change the date picker type, add a format mask for dates, and add validations that check if the target and actual end dates are after the start date. Edit Fields To make the Project Name field larger and the date fields smaller:
1.

Navigate to the Page Definition for Page 3, Create/Edit Project:
a. b.

From the Developer toolbar, click Application. Click 3 - Create/Edit Project.

2.

Under Items, click the Edit All icon. The Edit All icon resembles a small grid with a pencil on top of it.

3.

Scroll to the right and locate the Width column:
a. b. c. d. e.

For Project Name, enter 60. For Start Date, enter 12. For Target End Date, enter 12. For Actual End Date, enter 12. Click Apply Changes.

4.

Return to the Page Definition. Click the Edit Page icon in the upper right corner. The Edit Page icon resembles a small green piece of paper and pencil.

Change the Date Picker Type To change the date picker type and add a format mask for dates:
1.

Edit the item P3_START_DATE.
a. b. c.

Under Items, click P3_START_DATE. From the Display As list in the Name section, select Date Picker (DD-MON-YYYY). Click Apply Changes.

2.

Edit the item P3_TARGET_END_DATE.
a. b. c.

Under Items, select P3_TARGET_END_DATE. From the Display As list in the Name section, select Date Picker (DD-MON-YYYY). Click Apply Changes.

3.

Edit the item P3_ACTUAL_END_DATE.
a. b. c.

Under Items, select P3_ACTUAL_END_DATE. From the Display As list in the Name section, select Date Picker (DD-MON-YYYY). Click Apply Changes.

Add a Validation Next, add validations to check if the target and actual end dates are after the start date. To add validations:

How to Build and Deploy an Issue Tracking Application

12-17

Building a Basic User Interface

1. 2. 3. 4. 5. 6. 7.

Under Page Processing, Validations, click the Create icon. For Level, accept the default Item level validation and click Next. For Item, select Create/Edit Project: 40. P3_TARGET_END_DATE (Target End Date) and click Next. For Validation Method, select PL/SQL and click Next. Specify the type of validation you want to create. Accept the default PL/SQL Expression and click Next. For Validation Name, enter TARGET_AFTER_START and click Next. For Validation:
a.

Validation - Enter:
to_date(:P3_ACTUAL_END_DATE,'DD-MON-YYYY') >= to_date(:P3_START_ DATE,'DD-MON-YYYY')

b.

Error Message - Enter:
Actual End Date must be same or after Start Date.

c. 8.

Click Next.

For Conditions:
a. b.

Condition Type - Select Value of Item in Expression 1 Is NOT NULL, or click the shortcut link [item not null]. Expression 1 - Enter:
P3_ACTUAL_END_DATE.

This selection ensures that this validation executes only if the user enters an Actual End Date.
c.

Click Create.

To view your changes, click the Run Page icon in the upper right of the page. (See Figure 12–5.)
Figure 12–5 Modified Create/Edit Project

Add Pages to Track People
Once the initial Projects pages are complete, you create pages for maintaining people. Topics in this section include:
■ ■

Create Pages for Maintaining People Modify the People Report Page

12-18 Oracle Database Application Express Advanced Tutorials

Building a Basic User Interface

Refine the Create/Edit People Page

Create Pages for Maintaining People
To create pages for maintaining the HT_PEOPLE table:
1. 2. 3. 4. 5. 6. 7.

Click Application on the Developer toolbar. Click Create Page. Select Form and click Next. Select Form on a Table with Report and click Next. For Table/View Owner, select the appropriate schema and click Next. For Table/View Name, select HT_PEOPLE and click Next. For Define Report Page:
a. b. c.

Page - Enter 4. Page Name and Region Title - Enter People. Click Next.

8. 9.

For Tab Options, accept the default, Do not use tabs, and click Next. For Select Column(s), select all columns except PERSON_ID and click Next.

10. For Edit Link Image, select the fourth option (the word Edit) and click Next. 11. For Define Form Page: a. b. c.

Page Number - Enter 5. Page Name and Region Title - Enter Create/Edit Person Information. Click Next.

12. For Tab Options, accept the default, Do not use tabs, and click Next. 13. For Primary Key, accept the default, PERSON_ID, and click Next. 14. Specify the source for the primary key columns. Accept the default, Existing

Trigger, and click Next.
15. For Select Column(s), select all the columns and click Next. 16. For Insert, Update and Delete, accept the defaults and click Next. 17. Review your selections and then click Finish.

To preview your page, click Run Page. As shown in Figure 12–6, notice the newly created report displays the demo data.

How to Build and Deploy an Issue Tracking Application

12-19

Building a Basic User Interface

Figure 12–6 People Page

To preview the page for adding or editing people, click the Edit button in the far left column.

Modify the People Report Page
Next, you alter the People Report by changing the query to include a join to the Projects table and modify the headings. Change the Query to Include a Join To change the query to include a join to the Projects table:
1.

Navigate to the Page Definition for page 4 - People:
a. b.

If you are viewing a running form, click Application on the Developer toolbar. On the Application home page, click 4 - People.

2. 3. 4.

Under Regions, click People. Scroll down to Source. In Region Source, replace the existing query with the following:
SELECT a."PERSON_ID", a."PERSON_NAME", a."PERSON_EMAIL", a."PERSON_ROLE", b."PROJECT_NAME" FROM "#OWNER#"."HT_PEOPLE" a, "#OWNER#"."HT_PROJECTS" b WHERE a.assigned_project = b.project_id (+)

Note that the outer join is necessary because the project assignment is optional. Modify the Headings To modify the headings:
1. 2.

Click the Report Attributes tab at the top of the page. Under Column Attributes, edit the following column headings:

12-20 Oracle Database Application Express Advanced Tutorials

As shown in Figure 12–7. Scroll down to Sorting. select 1 for Sort Sequence. you customize the Create/Edit People page by adding lists of values to make it easier for users to select a Role or Assigned Project.Remove the Heading Edit. This selection specifies PERSON_NAME as the default column to sort on. Figure 12–7 Revised People Page Refine the Create/Edit People Page Next. e. note the addition of a sort control on the Name column. How to Build and Deploy an Issue Tracking Application 12-21 . PERSON_EMAIL . c. PERSON_NAME . Select Sort for all columns except PERSON_ID. PROJECT_NAME . Under Messages. Next. For PERSON_NAME. 4.Building a Basic User Interface a. Click Apply Changes at the top of the page. For Ascending and Descending Image. 5. Note this functionality can be overridden by user selections. PERSON_ID .Change Heading to Role. PERSON_ROLE .Change Heading to Email. enable column heading sorting. To enable column heading sorting: a. enter the following in When No Data Found Message: No people found. b.Change Heading to Assigned Project and then select left for Heading Alignment. b. 3. d. c. Run the Page To view your changes.Change Heading to Name. click the Run Page icon in the upper right of the page. select the light gray arrow.

replace the existing statements with the following: SELECT project_name d. 4. Create/Edit Person: a.Create/Edit Person Information.Enter ROLES. 3.Select Static Click Next. c. Navigate to the Page Definition for page 5. 3. From Scratch. If you are viewing a form. 5. 6. 2. click 5 . On the Application home page. Click Next. and then click Next. 2. Click Create List of Values. project_id v FROM ht_projects ORDER BY d 6. For Source. b. For Name and Type: a. Click Create List of Values. b. click Application on the Developer toolbar. On the Lists of Values page. 3. Edit Display Attributes To edit display attributes for P5_PERSON_ROLE: 1. Type . Under Shared Components. c. click P5_PERSON_ROLE. accept the default. From Scratch. For Source. From the Display As list in the Name section. Enter the display value and return value pairs shown in Table 12–4: Display Value and Return Value pairs Return Value CEO Manager Lead Member Table 12–4 Display Value CEO Manager Lead Member 5. 12-22 Oracle Database Application Express Advanced Tutorials . Name . 2. Under Items. Add a List of Values for Roles To add a list of values for Roles: 1.Enter PROJECTS. In Query. Type . locate the Lists of Values section and then click the Create icon. click the Edit Page icon in the upper right corner. select Radiogroup. Scroll down to Label.Select Dynamic. and then click Next. b. Name . Under Shared Components. For Name and Type: a. 4. accept the default.Building a Basic User Interface Add a List of Values for Projects To add a list of values for Projects: 1. locate the Lists of Values section and then click the Create icon.

select PROJECTS. For Null display value. You must manually create another validation to ensure that Leads and Members have an assigned project while the CEO and Managers do not. 5. Change Label to Role. To edit display attributes for P5_ASSIGNED_PROJECT: 1. Under Element.None - 5. and click Next. Scroll down to List of Values. for this compound type of validation.Enter Email Address. Click Apply Changes. To alter the display of fields and field labels: 1. accept the default. 2. Scroll down to List of Values. it is generally best to use built-in validation types because they are faster. you will write a PL/SQL validation. b. Email. Prompt . However. How to Build and Deploy an Issue Tracking Application 12-23 . 2. Click the Edit Page icon in the upper right corner to return to the Page Definition for Page 5. click the Edit All icon. As a best practice. 7.Building a Basic User Interface 4. Under Page Processing. From the Display As list in the Name section. From the Named LOV list. Create a Validation The Form on a Table with Report Wizard created not null validations for Name. Next. enter: .Enter Name. click the Create icon. specify that the underlying column is not mandatory. 3. click P5_ASSIGNED_PROJECT. select ROLES. 8. Width . 6. 3. b. b. Click Apply Changes. For Width. For P5_PERSON_NAME: a. 4. 4. Under Items. From the Named LOV list. enter 60. Under List of Values: a. Prompt . Under Items. select Select List. and Role. For Level. Validations. Click Apply Changes. enter the following in Form Element Option Attributes: class="instructiontext" This specifies that the text associated with each radio group option is the same size as other items on the page.Enter 60. Item level validation. For P5_PERSON_EMAIL: a. 2. To add validations to ensure the correct people are assigned projects: 1. 5.

For Validation and Error Message: a. Validation . 5. b. It also replaces %null% with a null when it processes data. b.Enter: Leads and Members must have an Assigned Project.Enter PROJECT_MAND_FOR_LEADER_AND_MEMBER.Enter: (:P5_PERSON_ROLE IN ('CEO'. Click Next. For Validation Method: a. You can create these views as single reports or as separate reports. Figure 12–8 Revised Create/Edit Person Information Form Try entering some records to test the validation. Therefore. Select PL/SQL and click Next. you need to create pages for HT_ISSUES. click the Run Page icon in the upper right of the page. Validation Name .'Manager') AND :P5_ASSIGNED_PROJECT = '%'||'null%') OR (:P5_PERSON_ROLE IN ('Lead'. 7. Accept the remaining defaults and click Next. Enter a CEO with a project and then enter a Lead without a project.'Member') AND :P5_ASSIGNED_PROJECT != '%'||'null%') Oracle Application Express passes nulls as %null%. Accept the default. CEO and Managers cannot have an Assigned Project. P5_ASSIGNED_PROJECT (Assigned Project) and click Next. Run the Page To view your changes. 6. b. Both cases should fail and display the error message you defined. For Sequence and Name: a. PL/SQL Expression and click Next. For 12-24 Oracle Database Application Express Advanced Tutorials . For Item. 4. Error Message . select Create/Edit Person Information: 50. The revised form appears as shown in Figure 12–8. to keep it in the validation. c. you need to break the string apart so that it is not recognized and replaced.Building a Basic User Interface 3. Add Pages to Track Issues Lastly. Click Create. This application needs multiple views on Issues.

select the appropriate schema and click Next. 4. Select Form on a Table with Report and click Next. For Table/View Name. Click Next. you create a complex report that includes an Issues maintenance form. 3. the Issues report will display Issues by the person who identified the issue. and click Next. Do not use tabs. status. For Page Name and Region Title. project. On Define Report Page: a.Enter 6. assigned person. For Select Column(s): a. Topics in this section include: ■ ■ ■ ■ Create a Report for HT_ISSUES Refine the Create/Edit Issues Page Refine the Issues Report Add a Page to Support Assigning Multiple Issues Simultaneously Create a Report for HT_ISSUES To create a report for maintaining HT_ISSUES: 1. For Edit Link Image. Page Number . Ultimately. For Tab Options. For Table/View Owner. 5. Page Number . 10. 6. 11. b. select the fourth option (the word Edit) and click Next. b. On Define Form Page: a. Click Create Page. How to Build and Deploy an Issue Tracking Application 12-25 . 7. Click Next. or priority.Building a Basic User Interface this exercise. 2. Click Next. select HT_ISSUES and click Next. accept the default. Page Name and Region Title . 8.Enter Issues. c. Click Application on the Developer toolbar. 9.Enter 7. enter Create/Edit Issues. c. You then link this maintenance form in multiple places. Press CTRL to select the following columns: – – – – – – – – ISSUE_SUMMARY IDENTIFIED_BY RELATED_PROJECT ASSIGNED_TO STATUS PRIORITY TARGET_RESOLUTION_DATE ACTUAL_RESOLUTION_DATE b. Select Form and click Next.

16. Enter the Display Value and Return Value pairs shown in Table 12–5: Display Value and Return Value Pairs Return Value Open On-Hold Closed Table 12–5 Display Value Open On-Hold Closed 6. Update and Delete. Click Create List of Values.Building a Basic User Interface 12. 2. Navigate to the Page Definition for page 7. On the Page Definition.Enter STATUS. For Insert. For Type. From Scratch. Yes. Do not use tabs. Click Next. Click Edit Page. accept the default. select all the columns and click Next. Priorities. For Create List of Values. ISSUE_ID. accept the default. 15. Review your selections and click Finish. Name . c. 2. b. For Tab Options. click Create. accept the default. and click Next. and click Next. Under Shared Components. accept the default. select Static. and People. enter 7 in the Page field and click Go. For Select Column(s). 4. Create/Edit Issues.Enter PRIORITIES. For Define the source for the primary key columns. and click Next. 12-26 Oracle Database Application Express Advanced Tutorials . accept the default. 18. To add a list of values for Priorities: 1. For Primary Key. Existing Trigger. On Create List of Values: a. 3. 3. On the Lists of Values page. 5. On Create List of Values: a. accept the default value. From Scratch. click the Create icon. and click Next. and click Next. 14. and click Next. Refine the Create/Edit Issues Page You refine the Create/Edit Page for the following reasons: ■ ■ ■ ■ Add lists of values to make it easier for users to select foreign key columns Organize and clean up items Change the display of audit columns Add a button to make data entry faster Add Lists of Values Next. you need to add lists of values for Status. Lists of Values. 13. 17. To add a list of values for Status: 1. Name . For Create List of Values.

Null display value . and click Next. click Create. For Name. Display Value and Return Value Pairs Return Value High Medium Low Table 12–6 Display Value High Medium Low 5. person_id v FROM ht_people ORDER BY 1 5. Navigate to the Page Definition for page 7. Named LOV . select Static. Under Items on the Page Definition for Page 7. 3. In Query. Click Create List of Values. 2. P7_ IDENTIFIED_DATE. 4. you edit individual items. Enter the Display Value and Return Value pairs shown in Table 12–6. The base column is mandatory. On Create List of Values: a.Select Person - 4.Enter: . b. Edit Specific Items Next. 2. To edit P7_IDENTIFIED_DATE: How to Build and Deploy an Issue Tracking Application 12-27 . replace the existing statements with the following: SELECT person_name d. On the Lists of Values page. Click Create List of Values. but you do not want the first name in the list becoming the default value. select Select List. enter PEOPLE. c. click P7_IDENTIFIED_BY. accept the default. Under List of Values: a. c. Display Null . c. From Scratch. To edit P7_IDENTIFIED_BY: 1. Click the Next button (>) at the top of the page to navigate to the next item. 3. From the Display As list in the Name section. select Dynamic. For Create List of Values. Click Next. 4. b. For Type. The Edit Page Item page appears.Select PEOPLE.Select Yes. To add a list of values for People: 1. 6. Click Next.Building a Basic User Interface b. For Type.

Named LOV . Default value . enter Open in Default value. Under Default. Number of Columns .Building a Basic User Interface 1. This selection enables the three valid values to display side by side. select Radiogroup. Scroll down to Default: a. From the Display As list in the Name section. enter the following in the Form Element Option Attributes field: class="instructiontext" 4. 6. From the Display As list in the Name section. select Date Picker (DD-MON-YYYY). Click the Next button (>) at the top of the page to navigate to the next item.Select STATUS. b. Under Label. Click the Next button (>) at the top of the page until you navigate to P7_STATUS. For List of Values: a. P7_ RELATED_PROJECT. Display Null.Enter: to_char(sysdate. Under Element. 12-28 Oracle Database Application Express Advanced Tutorials . b. select Radiogroup. Null display value . 2. Click the Next button (>) at the top of the page to navigate to P7_PRIORITY.Select PROJECTS. 2. enter the following in the Form Element Option Attributes field: class="instructiontext" 4. The Edit Page Item page appears. 5. select Select List. Under Element. Named LOV .'DD-MON-YYYY') b. c.Select Yes. To edit P7_PRIORITY: 1. Scroll down to List of Values. From the Display As list in the Name section.Select PL/SQL Expression. 2. Under List of Values: a. 2. From the Display As list in the Name section. Under Label. enter Open in the Default Value field. 3. To edit P7_RELATED_PROJECT: 1. To edit P7_STATUS: 1.Select Project - 3. Under Default.Enter: .Enter 3. enter the following in the Label field: Status: 3. Default Value Type . enter the following in the Label field: Priority: 3.

Select PRIORITIES.Select Yes. enter:. Click Create Region(s). select Date Picker (DD-MON-YYYY). Select Multiple HTML and then click Next. From the Display As list in the Name section. For Title. click the Create icon. Under Regions. 7. b.Enter the following. Issue Identification 3. select Button Region without Title. None- 6.Building a Basic User Interface 5. Under List of Values: a. Now that the new regions exist.Enter 4. Therefore. 3. For the third row. rename the first region. 6. d. To edit P7_TARGET_RESOLUTION_DATE: 1. Progress. How to Build and Deploy an Issue Tracking Application 12-29 . Named LOV . Click Apply Changes. Resolution. 5. enter 5. click Create/Edit Issues. Displaying items in logical groups makes data entry easier for users. For the fourth row. 2. This selection reflects the fact there are three valid values plus the null value. 4. 2. you next create four new regions named Buttons. For the first row: ■ ■ ■ For Sequence. From the Display As list in the Name section. c. Display Null . Create/Edit Issues: 1. enter Buttons. To edit P7_ACTUAL_RESOLUTION_DATE: 1. Null display value . For the second row. in Title enter Resolution. 2. Click Apply Changes. For Template. in Title enter Progress. 2. Click the Next button (>) at the top of the page until you navigate to P7_ACTUAL_ RESOLUTION_DATE. Under Regions. In Title. Create Regions to Group Items Currently all items are grouped into one large region. select Date Picker (DD-MON-YYYY). To create new regions to group items: 1. and Audit Information. in Title enter Audit Information. Number of Columns . You also rename an existing region. Click the Next button (>) at the top of the page to navigate to P7_TARGET_ RESOLUTION_DATE.

Under Region. To move items to the appropriate regions: 1. c. 2. select Progress for the following items: ■ ■ ■ ■ ■ P7_ASSIGNED_TO P7_STATUS P7_PRIORITY P7_TARGET_RESOLUTION_DATE P7_PROGRESS 3. For P7_ISSUE_SUMMARY. Click the Edit Page icon in the upper right to return to the Page Definition of Page 7. enter 12. 2. The Page Items summary page appears. For P7_TARGET_RESOLUTION_DATE. To move buttons to the Button region: 1. 4. Under Region.Building a Basic User Interface Move Items to the Appropriate Regions Next. Change the Display of Audit Columns Because the Audit columns should be viewable but not editable. select Resolution for the following items: ■ ■ P7_ACTUAL_RESOLUTION_DATE P7_RESOLUTION_SUMMARY 4. Under Items. you create a condition for the Audit Information region. 12-30 Oracle Database Application Express Advanced Tutorials . select Buttons for all buttons. 7. Under Region. click the Edit All icon. click Audit Information. Under Width. Note that you also need to modify some item widths. In the following exercise. enter 12. Under Buttons. move each item to the appropriate region. make the following edits: a. d. click the Edit All icon. As a result. 1. you need to make them display only. For P7_ACTUAL_RESOLUTION_DATE. enter 60. select Audit Information for the following items: ■ ■ ■ ■ P7_CREATED_DATE P7_CREATED_BY P7_LAST_MODIFIED_DATE P7_LAST_MODIFIED_BY 5. the Audit Information region displays when a user edits an existing issue. 6. Under Region. For P7_IDENTIFIED_DATE. but does not appear when a user creates a new issue. To create a condition for the Audit Information region. Under Regions. 3. enter 12. Click Apply Changes. b. Click Apply Changes. Click the Edit Page icon in the upper right to return the Page Definition of Page 7.

Next. To edit P7_LAST_MODIFIED_DATE: 1. Click Apply Changes. select Display as Text (saves state). enter: Created By: b. For HTML Table Cell Attributes. 3. enter: Last Modified Date: b. From Condition Type. To edit P7_CREATED_BY: 1. For Label. From the Display As list in the Name section. 2. Under Items. click P7_CREATED_DATE. Under Label: a. select Display as Text (saves state). change the audit columns to display only. enter: How to Build and Deploy an Issue Tracking Application 12-31 . Under Label: a. enter: class="instructiontext" 4. select Optional Label with Help. For HTML Table Cell Attributes. For Template. Scroll down to Conditional Display. select Display as Text (saves state). For Label. enter the following: P7_ISSUE_ID 5. enter the following in Format Mask: DD-MON-YYYY 5. select Optional Label with Help. 3. P7_ CREATED_BY. From the Display As list in the Name section. enter: class="instructiontext" 3.Building a Basic User Interface 2. P7_ LAST_MODIFIED_DATE. Under Source. To edit P7_CREATED_DATE: 1. c. c. For Label. c. 2. Under Label: a. select Optional Label with Help. Click the Next button (>) at the top of the page to navigate to the next item. 4. Click the Next button (>) at the top of the page to navigate to the next item. In Expression 1. For Template. enter: Created Date: b. select Value of Item in Expression 1 is NOT NULL. From the Display As list in the Name section. For HTML Table Cell Attributes. For Template. 2.

To remove not null validations: 1. Identified By. select Hidden and click Next. Related Project. Under Page Processing. For Select Item Type. Under Items. Item Name . 3. To accomplish this. Click OK to confirm your selection. 2. click P7_CREATED_DATE not null. Click Apply Changes. you need to remove these validations. P7_ LAST_MODIFIED_BY. Delete P7_CREATED_DATE not null: a. From the Display As list in the Name section. Every time the Create/Edit page is called. Under Page Processing. For HTML Table Cell Attributes. Delete P7_CREATED_BY not null: a. Status. 2. Since the Audit columns are set by a trigger. click P7_CREATED_DATE not null. enter: class="instructiontext" 3. Click OK to confirm your selection. Validations. click the Create icon. For Template. To edit P7_LAST_MODIFIED_BY: 1. select Optional Label with Help. enter: Last Modified By: b. b. when users finish with the display. c. b.Enter: P7_PREV_PAGE 12-32 Oracle Database Application Express Advanced Tutorials . c. Click Delete. For Display Position and Name: a. Created Date. they should return to the calling page. enter the following in Format Mask: DD-MON-YYYY 4. you create an item and change the branch on the Create/Edit page. 2.Building a Basic User Interface class="instructiontext" 3. Under Source. Under Label: a. Click Delete. Click the Next button (>) at the top of the page to navigate to the next item. the item must be set with the number of the calling page. and Created By. To create a hidden item: 1. Remove Unnecessary Validations The Form on a Table with Report Wizard created not null validations for Issue Summary. For Label. Validations. Return the User to the Calling Page Because this Create/Edit page will be called from several places. c. select Display as Text (saves state).

Click Copy Button. Under Buttons. and click Next. To edit the branch: 1. Under Branches. How to Build and Deploy an Issue Tracking Application 12-33 . Label . To create a branch that keeps the user on the create page: 1. 2. The sequence of this new branch will be 0. Setting the sequence to 0 makes the branch fire before the default branch but only when the Create and Create Another button is used. 3.Enter Create and Create Another. you first add a new button and then create a new branch. click the Create icon. Functionally. b. enter the following in Page (be sure to include the period): &P7_PREV_PAGE. 3. Next. Add Functionality to Support Adding Multiple Issues Sequentially Next. Click Next. For Button to copy. Branches.Select Issue Identification. click the Copy icon. Click Apply Changes. accept the defaults and click Next. Next.Building a Basic User Interface b. Region . edit the Cancel button. you add functionality that enables users to add more than one issue at a time. click Cancel. edit the branch. accept the default. Click Create Item. 7. Click Apply Changes. The Page Definition for page 7 appears. c. Under Page Processing. 4. Next. select the After Processing branch. 4.Enter CREATE_AGAIN. For Point and Type. enter: &P7_PREV_PAGE. To accomplish this. Under Action. 4. For Target Page. click CREATE. To add a new button: 1. the Copy Button currently works the same as the CREATE button. 2. Button Name . Scroll down to Optional URL Redirect. 2. In Page. To edit the Cancel button: 1. c. Note that this branch also resets P7_PREV_PAGE because the value of that item will be lost when the cache of the page is cleared. 3. Go to Page. create a branch that keeps the user on the Create page. Note the period at the end. For New Button: a. 2. Under Buttons.

next to 7. Click Apply Changes. When Button Pressed . 12-34 Oracle Database Application Express Advanced Tutorials .Enter the following (be sure to include the period): &P7_PREV_PAGE. Set these items . b. b. 8. 6. Click Next. e. Run the Page To see the changes. select the include process success message check box. Go to Page.Building a Basic User Interface 3.Select CREATE_AGAIN. 7. Under Action. Click Create Branch. Sequence . The new form appears as shown in Figure 12–9. 5.Enter 7. 4. With these values . For Branch Conditions: a.Enter the following: P7_PREV_PAGE d.Enter 7.Enter 0. Under Branches. c. click the Run Page icon. For Target: a. Page . select the newly created branch. The Page Definition for page 7 appears. Clear Cache .

Select HTML and click Next. 4. Refine the Issues Report Next. Since the page was not called from another page. For Display Attributes: a. you must: ■ ■ ■ ■ ■ Move the Create button to a new region and edit the label Create new items that enable the user to restrict the query Add a WHERE clause to reference those new items Alter the report column attributes to display each person’s name and the project Modify headings Move Create Button to a New Region To create a new region for the Create button: 1. 3. To accomplish this. the value has not been set. you refine the Issues report page to support dynamic modification of the query. click the Create icon. Title . How to Build and Deploy an Issue Tracking Application 12-35 .Enter Buttons. Select HTML for region container and click Next. Issues. Under Regions.Building a Basic User Interface Figure 12–9 Create/Edit Issues Form The branch you just created is looking for a value in P7_PREV_PAGE. 5. 2. Navigate to the Page Definition for page 6. Region Template .Select Button Region without Title. You need to fix that next. b.

select Display as Text (based on LOV. 4. does not save state). Change the Query and Display Next. 5. Scroll down to Column Link. 3. To move the Create button to the Buttons region: 1. b. Under Regions. enter 6. From Display As. Under Name.Select PROJECTS. Scroll down to Lists of Values. 4. Under Column Link: a. Value. For With These Values. 2. 2. The Column Attributes page for RELATED_PROJECT appears. enter 6. Under List of Values: a. Named LOV . does not save state). select Report next to Issues. change the query to display the actual values for people and projects instead of the ID and then clean up the report display.Select Page Template Body (2. To edit column attributes for IDENTIFIED_BY. Display Point . Name. Scroll down to Lists of Values. 12-36 Oracle Database Application Express Advanced Tutorials .Enter: P7_PREV_PAGE b.Building a Basic User Interface c. Under Optional URL Redirect: a. click the Create link. enter: P7_PREV_PAGE b. 6. Click Apply Changes. select PEOPLE. Scroll down to Tabular Form Element. For Item 2. 3. Click the Edit Icon to the left of IDENTIFIED_BY. 4. Return to the top of the page and click the Next (>) icon. Click Next. Under Displayed. items below region content). Display Null . Under Buttons. 5. For Item 2. From Display As. Click Create Region. Click the Edit Icon to the left of ISSUE_ID. 6. d. Click Apply Changes. From Named LOV. select Buttons in the Display in Region field. RELATED_PROJECT and ASSIGNED_ TO: 1. select Display as Text (based on LOV. To edit column attributes for ISSUE_ID: 1. The Report Attributes page appears. enter the following in the Text Label/Alt field: Add a New Issue 3.Select Yes. Set These Items . Scroll down to Tabular Form Element. 2.

Under Regions. 6. Under List of Values: a. b. For Heading Alignment. Named LOV . Click Apply Changes.Enter a hyphen (-).Select PEOPLE. The Report Attributes page appears. does not save state). check Sort. b. Click Apply Changes. Under Sorting. enter: Target<br>Resolution<br>Date b. Number of Rows . 5. select 1 for Sort Sequence. Null Text . Scroll down to Layout and Pagination. For ISSUE_SUMMARY. 10. accept the default.Enter 5. 8. Return to the top of the page and click the Next (>) icon. 9. 7. To sort on ISSUE_ID: a. you customize how the report displays by changing report attributes. Force the heading to wrap.Building a Basic User Interface c. In Heading. You will store these new items in a new region that will display above the report. To add this functionality. For ISSUE_ID. you first create items that enable the user to set values to query against. c. 4. Specify the following: a. How to Build and Deploy an Issue Tracking Application 12-37 . 7. Scroll down to Tabular Form Element. Display Null . Under Messages. delete the Heading text. it does not support filtering by the end user. 8. The Column Attributes page for ASSIGNED_TO appears. b. 2. Null Text .Enter a hyphen (-). select center.Enter a hyphen (-). From Display As. For Column Alignment. select the light gray arrow for Ascending and Descending Image. select center. Next. Custom. select Display as Text (based on LOV. enter the following in When No Data Found Message: No issues found. Add Support for Filtering Although the report now displays nicely. To create a new region: 1. From Headings Type (the radiogroup row at the top of Column Attributes). click the Create icon. For all columns except ISSUE_ID. For ISSUE_SUMMARY. c. Scroll down to Lists of Values. To alter the report display: 1. For TARGET_RESOLUTION_DATE: a. change the Heading to Summary.Select Yes. 9. Show Null Values as . 3.

d. select PEOPLE. 4. enter 5. For Region. For Item Name . For Source. 6.Enter P6_IDENTIFIED_BY. For Item Attributes. c. For Null Value. Reports Region. b. For Select Item Type. 5. For Null Text. Click Next. accept the defaults and click Next.Building a Basic User Interface 2. enter: -1 8. and click Next. For Region Template. 5. enter: . Under Items. 7. For Item Name. For Sequence. select Issue Report Parameters. select Issue Report Parameters. enter P6_ASSIGNED_TO. c. For Display Position and Name: a. 3. 4. b. 12-38 Oracle Database Application Express Advanced Tutorials . enter: -1 d. 3. For Display Position and Name: a. For Display Attributes: a. For Title. select Select List and click Next. To create the item for Identified By: 1. For Region. click the Create icon. Click Create Item. For Identify List of Values: a. For Select List Control Type. accept the default selection. create the items. select Select List and click Next. Select HTML and then click Next.All - c. click the Create icon. 2. Click Next. accept the default selection. Click Next. accept the default. Select List. b. Select HTML for region container and click Next. To create an item for Assigned To: 1. Click Create Region. Select List. For Select Item Type. 4. Default. enter Issue Report Parameters. Next. Under Items. For Named LOV. and click Next. b. For Select List Control Type. 3. 2.

For Null Text . For Item Attributes. For Select Item Type. 6.Enter: -1 d.Enter: . and then click Next. click the Create icon. Click Next. Click Next. 6. enter: -1 8.Building a Basic User Interface c. For Null Text . accept the default selection.Select STATUS. Click Create Item. For Identify List of Values: a. Click Next. b. accept the defaults and click Next. 4. 7. enter: -1 8. c. 2.All - c. 3. For Named LOV . For Display Position and Name: a. For Source. 7. Default. For Select Item Type. Default.Enter P6_STATUS.Select PEOPLE. b. Click Create Item. Under Items. click the Create icon. Select List. 2. For Region . To create an item for Status: 1. For Null Value .Select Issue Report Parameters. 5. For Source. For Identify List of Values: a.Enter: -1 d. To create an item for Priority: 1. select Select List and click Next.All - c. Named LOV . For Select List Control Type. For Null Value . b.Enter: . Click Next. How to Build and Deploy an Issue Tracking Application 12-39 . Under Items. For Item Attributes. 5. accept the defaults and click Next. Item Name . select Select List and click Next.

For Item Name . 7. For Item Attributes. For Display Position and Name: a. For Identify Item Attributes. For Region . For List of Values: a.Select Issue Report Parameters. b. accept the defaults and click Next. For Null Text . 4. For Item Name . click the Create icon. For Identify Item Name and Display Position: a. Click Next. For Select Item Type. For Null Value . Click Next.Enter P6_RELATED_PROJECT. 4. accept the default selection. select Select List and click Next. b. For Null Text . enter: -1 12-40 Oracle Database Application Express Advanced Tutorials . For Named LOV . For Source.Enter: . For Named LOV . Click Next. 5. Click Create Item. 3. To create an item for Related Project: 1. For Select List Control Type.Enter: .All - c.Select PRIORITIES. 7. for Default. Under Items. 6. c. c.Enter P6_PRIORITY. For Region . 6. b. enter: -1 8. accept the default selection. 5. For Identify List of Values: a. Select List. For Source.Select Issue Report Parameters. for Default.Building a Basic User Interface 3. For Select List Control Type. 2. b.All - c. Select List and click Next. For Null Value . and click Next. accept the defaults and click Next. Click Next.Select PROJECTS.Enter: -1 d.Enter: -1 d.

Click the Edit Page icon in the upper right corner to return to the Page Definition for page 6. select No for New Line. 3. To use space more efficiently. you need to modify the report to react to the parameters. 5.Select Template Based Button. Currently the items display stacked on top of one another. For Button Position. To turn the Issues region into a PL/SQL Function Body Returning a SQL Query: 1. P6_STATUS. Click Next. To accomplish this. Next. Button Name . For Button Region. click the Edit All icon. select Issue Report Parameters and click Next. Under Buttons. and P6_ PRIORITY so they display next to each other. 4. For Button Attributes: a. and P6_PRIORITY. Next.Building a Basic User Interface 8. Template . Click Create Item. Click Apply Changes. P6_ STATUS on the first line and P6_PRIORITY on the second line. P6_STATUS. Buttons can be created in region positions or displayed among items. 2. Under Regions. you need to modify the query's WHERE clause as follows: WHERE (IDENTIFIED_BY = :P6_IDENTIFIED_BY OR :P6_IDENTIFIED_BY = '-1') AND (RELATED_PROJECT = :P6_RELATED_PROJECT OR :P6_RELATED_PROJECT = '-1') AND (ASSIGNED_TO = :P6_ASSIGNED_TO OR :P6_ASSIGNED_TO = '-1') AND (STATUS = :P6_STATUS OR :P6_STATUS = '-1') AND (PRIORITY = :P6_PRIORITY OR :P6_PRIORITIY = '-1') To use the preceding WHERE clause. 3. How to Build and Deploy an Issue Tracking Application 12-41 . The Edit Page icon resembles a small green piece of paper and pencil. For P6_RELATED_PROJECT. This button enables the user to execute the query once they select report parameters. 4.Select Button. create a Go button. c. you must convert the Issues region into a PL/SQL Function Body Returning a SQL Query. select Create a button displayed among this region's items. click the Create icon. To create Go button: 1. Button Style . This selection displays the button to the right of the last report parameter. Under Items. Click Create Button. The Page Definition for page 6 appears. 2. 6. click Issues. Place P6_RELATED_PROJECT. and P6_PRIORITY: 1. To change the position of P6_RELATED_PROJECT. P6_STATUS.Enter P6_GO. b. change the position of P6_RELATED_PROJECT.

For Region Source. replace the existing statements with the following: DECLARE q VARCHAR2(32767). IF :P6_ASSIGNED_TO != '-1' THEN IF we = 'Y' THEN w := w || ' AND ASSIGNED_TO = :P6_ASSIGNED_TO '. IF :P6_STATUS != '-1' THEN IF we = 'Y' THEN w := w || ' AND STATUS = :P6_STATUS '. ELSE w := ' ASSIGNED_TO = :P6_ASSIGNED_TO '.Building a Basic User Interface 2. 12-42 Oracle Database Application Express Advanced Tutorials . 3. '|| ' "ISSUE_SUMMARY".where clause we VARCHAR2(1) := 'N'."HT_ISSUES" '. ELSE w := ' RELATED_PROJECT = :P6_RELATED_PROJECT '. END IF. we := 'Y'. -. IF :P6_RELATED_PROJECT != '-1' THEN IF we = 'Y' THEN w := w || ' AND RELATED_PROJECT = :P6_RELATED_PROJECT '. END IF. we := 'Y'. for Type. Under Name.query w VARCHAR2(4000) . '|| ' "RELATED_PROJECT". END IF. we := 'Y'. select SQL Query (PL/SQL function body returning SQL query). END IF. '|| ' "TARGET_RESOLUTION_DATE". -. IF :P6_IDENTIFIED_BY != '-1' THEN w := ' IDENTIFIED_BY = :P6_IDENTIFIED_BY '. '|| ' "IDENTIFIED_BY". we := 'Y'. '|| ' "STATUS". '|| ' "PRIORITY".identifies if where clause exists BEGIN q := 'SELECT "ISSUE_ID". -. '|| ' "ACTUAL_RESOLUTION_DATE" '|| ' FROM "#OWNER#". ELSE w := ' STATUS = :P6_STATUS '. '|| ' "ASSIGNED_TO". END IF.

IF :P6_PRIORITY != '-1' THEN IF we = 'Y' THEN w := w || ' AND PRIORITY = :P6_PRIORITY '. Figure 12–10 Issues Report To change the report parameters. make new selections under Issue Report Parameters and then click Go. END IF. END IF. ELSE w := ' PRIORITY = :P6_PRIORITY '. If any variables have been set. 4. it appends the WHERE clause to the original SELECT and passes that new SELECT to the database. How to Build and Deploy an Issue Tracking Application 12-43 . Click Apply Changes. RETURN q. END IF. It then builds a WHERE clause (w) composed of just the variables set by the user. Run the Page The report is now complete. END IF. END. The revised report appears and should resemble Figure 12–10 on page 12-43. Click the Run Page icon. IF we = 'Y' THEN q := q || ' WHERE '|| w. we := 'Y'. Note that this function first sets the variable q to the original SELECT statement.Building a Basic User Interface END IF.

you can assign an issue by editing it.Building a Basic User Interface Add a Page to Support Assigning Multiple Issues Simultaneously Currently. 2. 4. select HT_ISSUES and click Next. Next. 6. 10. and Priority. Allowed Operations . For Primary Key Source. Table/View Owner. For Page and Region Attributes: a. and click Next. Click Create Page. and not create or delete issues. 12-44 Oracle Database Application Express Advanced Tutorials . For Displayed Columns: a. ISSUE_ID.Select the appropriate schema. For this exercise. c. 3. 5. Existing trigger. assume that the purpose of this form is to enable users to assign issues. 8. For Table/View Name. 7. Click Next. For Table/View Owner: a. accept the default. Select Tabular Form and click Next. Page . Click Next. 9. Select Form and click Next.Enter 8. Status. Press CTRL and select the following columns: – – – – – – – ISSUE_SUMMARY IDENTIFIED_BY IDENTIFIED_DATE RELATED_PROJECT ASSIGNED_TO STATUS PRIORITY b. you add a new page that enables users to assign multiple issues at once and modify the Related Project. 11. Create a Tabular Form To add a new page to support assigning multiple issues: 1. For Updatable Columns: a. Navigate to the Application home page. Click Next. accept the default. and click Next. or update existing records.Select Update Only. b. Press CTRL and select the following columns: – – – – RELATED_PROJECT ASSIGNED_TO STATUS PRIORITY b. For Primary Key.

c. c. "ISSUE_SUMMARY". To add lists of values: 1.Enter Assign Issues. Click the Edit icon to the left of IDENTIFIED_BY. d. 15. for Region Source. you need to add lists of values to make it easier to select issues. Region Title . Click Next. enter Apply Changes. select Display as Text (based on LOV. Edit the heading for ISSUE_SUMMARY. Assign Issues. click Edit Page. For Button Labels: a. for Display As. To sort by ISSUE_ID: a. Additionally. For all columns except ISSUE_ID. "IDENTIFIED_BY". Under Source. Add Lists of Values Once you have created the initial tabular form."HT_ISSUES" WHERE assigned_to IS NULL To edit report attributes: 1. b. Click Next. accept the defaults and click Next. you need to restrict the query to display only unassigned issues. Select the Report Attributes tab at the top of the page. replace the existing statements with the following: SELECT "ISSUE_ID". does not save state).Enter Assign Issues. 4. Do not use tabs. For Branching. 14. select Sort. 13. b. For Cancel Button Label. 2. appears. Under Regions. For IDENTIFIED_DATE. "STATUS".Building a Basic User Interface b. "IDENTIFIED_DATE". 12. accept the default. Edit the following attributes for IDENTIFIED_BY: a. b. 3. 2. The Page Definition for page 8. "PRIORITY" FROM "#OWNER#". and then click Next. How to Build and Deploy an Issue Tracking Application 12-45 . For Submit Button Label. Page Name . "RELATED_PROJECT". For Tab Options. From the Success page. enter the following in the Heading field: Summary 3. For ISSUE_SUMMARY. Review your selections and then click Finish. accept the default. Under Tabular Form Element. select 1. for Sort Sequence. click Assign Issues. "ASSIGNED_TO".

6. select Select List (named LOV). Click Apply Changes. 5. Under Ascending and Descending Image. Scroll down to Sorting. Click the Next button (>) at the top of the page to navigate to the PRIORITY column. c. for Display As. for Display As. enter the following in When No Data Found Message: No Unassigned Issues. select Select List (named LOV). Edit the following attributes for ASSIGNED_TO: a. Click the Next button (>) at the top of the page to navigate to the RELATED_ PROJECT column. Click Apply Changes. enter a hyphen (-). d. Edit the following attributes for PRIORITY: a. b. Under List of Values: – – – Named LOV . Under Tabular Form Element. select PROJECTS. 11. Under List of Values. for Named LOV. select PRIORITIES. c. For Named LOV. For Display Null. 12-46 Oracle Database Application Express Advanced Tutorials . b. select STATUS. Under List of Values: – – – From Named LOV. c.Select PEOPLE. e. Under Column Formatting.Building a Basic User Interface c. Display Null . b. For Null Text. b. select Yes. Under Messages. select the light gray arrow. Scroll down to Lists of Values. for Number/Date Format. select PEOPLE. for Named LOV. Click the Next button (>) at the top of the page to navigate to the STATUS column. Null Text . Edit the following attributes for RELATED_PROJECT: a. Under Tabular Form Element. Click the Next button (>) at the top of the page to navigate to IDENTIFIED_ DATE. 9. for Display As. Under List of Values. select Select List (named LOV). The Report Attributes page appears. 7. Click the Next button (>) at the top of the page to navigate to the ASSIGNED_ TO column. 12. for Display As. 10. 8. select Select List (named LOV). Under Tabular Form Element. Edit the following attributes for IDENTIFIED_DATE: a. c. Under Tabular Form Element.Select Yes. enter DD-MON-YYYY. b. Edit the following attributes for STATUS: a.Enter a hyphen (-).

you need to add four summary reports.Building a Basic User Interface Delete the Unnecessary Cancel Button The wizard created an unnecessary Cancel button. Click Delete. To view the new form. click CANCEL in the Buttons section. the issue no longer displays. Create Summary Reports Lastly. click the Run Page icon. Topics in this section include: ■ ■ ■ ■ Add an Issue Summary by Project Report Add Resolved by Month Identified Report Add a Calendar to Display Issues Add a Bar Chart that Displays Average Days to Resolve Add an Issue Summary by Project Report The Issue Summary report enable users to select a project and then see a summary of issues related to that project. make a selection from the Assigned To list and then click Apply Changes. Click OK to confirm your selection. Figure 12–11 Assign Issues To assign an issue. Notice that once an issue has been assigned. To delete the Cancel button: 1. Run the Page The tabular form is now complete. On the Page Definition for page 8. This report includes the following summary information: ■ ■ ■ ■ ■ ■ Date first issue identified Date last issue closed Total number of issues Number of issues by status Number of open issues by priority Assignments by status How to Build and Deploy an Issue Tracking Application 12-47 . 3. The Assign Issues form appears as shown in Figure 12–11. 2.

0).decode(priority.null. SUM(DECODE(status. SUM(DECODE(status. c.0).1. 'Open'.1. 'Open'. Navigate to the Application home page. Page Name .1. SUM(DECODE(status. 9. Now that you have the first query. To add an Issue Summary by Project report: 1. COUNT(issue_id) total_issues. b.0)) onhold_issues. 0)) open_medium_prior.Select default: vertical report. and click Next. SUM(DECODE(status. Review your selections and click Finish. 2. 0)) open_high_prior.'Closed'.decode(priority. For Report Attributes: a. 'Open'.1.Enter Issue Summary by Project. 0)) open_low_prior FROM ht_issues WHERE related_project = :P9_PROJECT b. First. 12-48 Oracle Database Application Express Advanced Tutorials .'Low'. For SQL Query: a. Accept the remaining defaults and click Next.Enter 9.0). SUM(DECODE(status. MAX(actual_resolution_date) last_closed. 5. For Region Name .1. Click Create Page. you code the information in two SQL statements. Select Report and click Next. Enter the following SQL SELECT statement: SELECT MIN(identified_date) first_identified.1.'Medium'. c. create a region to display above the report to contain the Project parameter.Enter Issue Summary by Project.0). you need to edit the headings and create the item to control the related project. The first statement gathers information having a singular result and the second statement gathers information having multiple results. 3.0)) closed_issues. For Tab Options. Click Next.0)) open_issues. For Page Attributes: a. Report Template . Click Next. look 1 (include null columns).'Open'.1. Do not use tabs. Page . 7. SUM(DECODE(status. 'Open'.'High'.decode(priority. 6.decode(priority. b. SUM(DECODE(status. 0)) open_no_prior. accept the default. 4.Building a Basic User Interface To create this report. Select SQL Report and click Next.'On-Hold'. 8.

For Button Position. click the Create icon. 2. 2.1 d. 7. enter 5. for Default. 5.Select Issue Summary Report Parameters. Create a Go Button To create a Go button to execute the query: 1. For Button Region. select Create a button displayed among this region's items and click Next. items below region content). Named LOV . 6. For Select Item Type. Click Next. For Item Attributes. From the Success page. Under Items. Under Buttons. Select List.Enter: . 8. For Display Attributes: a. 4. accept the default. Null Text . Null Text .Select Page Template Body (2.Select PROJECTS. Select HTML for region container and click Next. For Sequence. enter -1. click the Create icon. appears. For Button Attributes: How to Build and Deploy an Issue Tracking Application 12-49 . b. Region . 6. accept the defaults and click Next. 3. For Display Position and Name: a. Under Regions. Select HTML and click Next.Enter: .Select - c. c. 4. select Issue Summary Report Parameters and click Next. The Page Definition for page 9. 4. Item Name . Click Create Region. 3. 5. Title . b. c. For Select List Control Type. For List of Values: a. Accept the remaining defaults and click Next. Display Point . 3. Click Create Item. click Edit Page.Enter P9_PROJECT. and click Next. Click Next. click the Create icon. d. For Source. Create the Project Item To create the Project item: 1.Enter Issue Summary Report Parameters. 2. select Select List and click Next. b. Issue Summary by Project.Building a Basic User Interface Create a New Region To create a new region to display above the report: 1.

3. enter a hyphen (-). select . 12-50 Oracle Database Application Express Advanced Tutorials . Change the Heading for OPEN_LOW_PRIOR: Open Issues of Low Priority: 4. select Custom. Under Regions. b.Building a Basic User Interface a.Select Button. You also need to set the report regions to conditionally display when the user has selected a project. Template . Change the Heading for TOTAL_ISSUES to: Total Issues: d. For Show Null Values as. Change the Heading for OPEN_ISSUES to: Open Issues: e. c. Change the Heading for LAST_CLOSED to: Last Issue Closed: c. 2.Enter P9_GO. Button Name . Select the Region Definition tab at the top of the page. 5. 5. Change the Heading for CLOSED_ISSUES to: Closed Issues: g. For Headings Type. Change the Heading for FIRST_IDENTIFIED to: First Issue Identified: b. To edit the headings and report settings: 1.No Pagination Selected -. Specify the following: a. Click Create Button. b. Change the Heading for OPEN_NO_PRIOR to: Open Issues with No Priority: h.Select Template Based Button. click Report next to Issue Summary by Project. Change the Heading for OPEN_MEDIUM_PRIOR to: Open Issues of Medium Priority: j. For Pagination Scheme. Edit Headings and Report Settings Next. you need to edit the headings and report setting for the report region. Scroll down to Layout and Pagination. Change the Heading for ONHOLD_ISSUES to: On-Hold Issues: f. Under Column Attributes: a. Button Style . Change the Heading for OPEN_HIGH_PRIOR: Open Issues of High Priority: i.

status. select Value of Item in Expression 1 Is NOT Contained within Colon Delimited List in Expression 2. For Headings Type. Accept the remaining defaults and click Next. d.Enter the following: SELECT p. 5. For PERSON_NAME. 2.person_id GROUP BY person_name. Rows Per Page .Select 2. Under Regions. COUNT(i. Title . change Heading to Assigned To. c. ht_people p WHERE i. Condition Type .issue_id) issues FROM ht_issues i. SQL Query or PL/SQL function returning a SQL Query .related_project = :P9_PROJECT AND i. Under Regions. For Condition Type. 1.Select Column 1. Select Report and then click Next. Click Create Region. click the Create icon. How to Build and Deploy an Issue Tracking Application 12-51 . 3. i. For Display Attributes: a. Create a Query to Retrieve Assignments To create a query to retrieve assignments by status. select Custom. For Expression 2 enter -1. d.person_name. For Report Implementation.Enter 20. 3. For Source: a. c. For Conditional Display: a. Accept the remaining defaults and click Next. To edit headings and report settings: 1. 6. In Expression 1. For Expression 2. select SQL Report and click Next.Enter Assignments by Status. Column . 2. 7. b. c.assigned_to = p. click Report next to Assignments by Status. b. Break Columns . enter -1. status b. b. In Expression 1 enter: P9_PROJECT c.Select Value of Item in Expression 1 Is NOT Contained within Colon Delimited List in Expression 2. Click Apply Changes. enter P9_PROJECT. 4.Building a Basic User Interface a. 6. Scroll down to Conditional Display.

Note that initially no data displays since no project is selected. 5. Figure 12–12 Issue Summary by Project Report Add Resolved by Month Identified Report The Resolved by Month Identified report is a line chart. Series Name . Page Number . Do not use tabs.Enter Resolved by Month Identified. This report first calculates the number of days it took to resolve each closed issue. 3. select Row Ranges 1-15 16-30 in select list (with pagination).Enter Resolved. 4. and finally displayed by the month. Click Create Page. For Page Attributes: a. b. 2. From Pagination Scheme. For Tab Options. Scroll down to Layout and Pagination. c. Page Name and Region Name . 5. Select Line and click Next. Your report should resemble Figure 12–12. click the Run Page icon. Run the Page To see your newly created report. 12-52 Oracle Database Application Express Advanced Tutorials . For Query: a. Select a project and click Go. Click Apply Changes. accept the default. To add a Resolved by Month Identified report: 1. 7. 8. 6. enter: No issues found. averaged by the month the issue was identified.Building a Basic User Interface 4.Enter 10. Accept the remaining defaults and click Next. 6. Navigate to the Application home page. Select SVG Chart and click Next. Scroll down to Messages. In When No Data Found Message. Select Chart and click Next. and click Next.

Enter 300. Review your selections and click Finish. enter Date Identified. It extracts the month from the identified date so that the data can be grouped by month. Edit the Chart Next. AVG(actual_resolution_date-identified_date) days FROM ht_issues WHERE status = 'Closed' GROUP BY TO_CHAR(identified_date. next to Resolved by Month Identified. For X Axis Title. TO_CHAR(identified_date. 3.Building a Basic User Interface b. the l column). 4. it calculates the average number of days it took for the issues to be closed that were identified in that month. Under Chart Settings: a. Resolved by Month Identified. The Page Definition for page 10. appears. 9. click SVG Chart. Scroll to Axes Setting: a. Your line chart should resemble Figure 12–13. b. To edit the chart: 1. select Edit Page. For Y Axis Title. click the Run Page icon. b. From the Success page. d.'Mon YYYY') month. Click Next. c. How to Build and Deploy an Issue Tracking Application 12-53 . enter Days to Resolve. For When No Data Found Message. Click Apply Changes.Enter the following: SELECT NULL l. Under Regions. Chart Height . 2. 5. Deselect Show Legend. Lastly. enter: No Closed Issues found. add a correct axis label and turn off the Chart Title and legend.'Mon YYYY') Note that this query has no link (that is. SQL . Run the Page To view your newly created line chart.

Click Create Page.TARGET_RESOLUTION_DATE.PERSON_ID (+) AND (I.PERSON_NAME. 7. I.Enter Target Resolution Dates. Click Next. b. 4. For Page Attributes: a. 6. Create a Calendar To create a calendar of target resolution dates: 1.Enter 11. accept the default.STATUS != 'Closed' b.ISSUE_SUMMARY || ' ('||nvl(P. Click Next. Select SQL Calendar and click Next. For Tab Options. c. Navigate to the Application home page. 2. 5. Do not use tabs. enter the following: SELECT I. Select Calendar and click Next. and click Next. I. 12-54 Oracle Database Application Express Advanced Tutorials . 3.ISSUE_ID FROM HT_ISSUES I. HT_PEOPLE P WHERE I.ASSIGNED_TO = P. For Table/View Owner: a.RELATED_PROJECT = :P11_PROJECT OR :P11_PROJECT = '-1') AND I. In Enter SQL Query.Building a Basic User Interface Figure 12–13 Resolved by Month Identified Line Chart Add a Calendar to Display Issues The Target Resolution Dates report is a calendar that displays issues that have not yet closed along with the assigned person on the day that corresponds to the issue target resolution date. Page Number . Page Name and Region Name .'Unassigned') ||') ' disp.

enter: -1 9. Null Text .Enter P11_PROJECT. select Select List and click Next.Select TARGET_RESOLUTION_DATE. Click Next. For Item Attributes. Target Resolution Dates. The target_resolution_date is the date on which the issue displays The issue_summary is concatenated with the person assigned The issue_id does not display. Click Next. For Display Position and Name: a. 9. 2. 8.Select DISP. 3. From the Success page. For Button Position. select Create a button displayed among this region's items and click Next. How to Build and Deploy an Issue Tracking Application 12-55 . Accept the remaining defaults and click Next.Enter: -1 d. appears. b. Under Buttons.Enter: . Create a Go Button To create a Go button to execute the query: 1. you need to add an item. 2. Review your selections and click Finish. For Source. c. select Target Resolution Dates and click Next. Item Name . click the Create icon. Click Create Item. For Select List Control Type. select Select List and click Next. For List of Values: a. but is used to create a link to enable the user to view and edit the issue For Date/Display Columns: a. Named LOV . Date Column . To add an item to support project look up: 1. Under Items. For Null Value . 5. Default. 4. b. For Item Type. select Edit Page. For Button Region. Add an Item to Support Project Look Up To enable the user to look up one project or all projects. The Page Definition for page 11.Building a Basic User Interface Note that: – – – 8. click the Create icon. 6.Select PROJECTS.All Projects - c. For Display Column . 3. 7. accept the defaults and click Next. b.

View/Edit Issues.Building a Basic User Interface 4. For With these values . Template . clear any data from the page and pass in the current issue ID along with the fact that page 11 was the calling page. 5. c. 6. b. click the Run Page icon.Enter: #ISSUE_ID#.P7_PREV_PAGE d. b. Button Name . Click Create Button. 4. Page . you need to call page 7. In Region Footer. To return to the calendar. enter the following: a. Under Regions. Note that you can also click the text displayed for an issue to display the Edit Issue page. Click Apply Changes.Enter P11_GO. c. you need to add a note that displays when the query excludes Closed issues.Enter 7. For Button Attributes: a.Select Button. click Calendar to the right of Target Resolution Dates. Scroll down to Column Link. 5.Select Template Based Button.11 3. click Cancel. Modify Calendar Attributes Lastly. Scroll down to Header and Footer. enter the following: This excludes Closed issues. Your report should resemble Figure 12–14 on page 12-57. 2. Select the Region Definition tab at the top of the page. Clear Cache .Enter 7.Enter: P7_ISSUE_ID. Button Style . 12-56 Oracle Database Application Express Advanced Tutorials . Then. To modify the Calendar Attributes: 1. Set these items . To accomplish this. Run the Page To see your newly created calendar. you need to modify the Calendar Attributes to add link support for viewing and editing the displayed issues. Note that you can click Weekly or Daily to see the corresponding calendar views.

AVG(i.Enter 12. Click Create Page. Select Chart and click Next.'None Assigned') person. 4. Page Name and Region Name . 6. 2.identified_date) days FROM ht_issues i.person_name. 3. Do not use tabs. 7. b. For Page Attributes: a. NVL(p. Accept the remaining defaults and click Next. and click Next. For Chart Definition: a. For Tab Options. Page .actual_resolution_date-i. Chart SQL . 5.Replace the existing statements with the following: SELECT NULL l. accept the default. To add the Average Days to Resolve report: 1. Navigate to the Application home page.Enter Average Days to Resolve.Building a Basic User Interface Figure 12–14 Target Resolution Dates Report Add a Bar Chart that Displays Average Days to Resolve The Average Days to Resolve report is a bar chart that calculates the number of days it takes to resolve each closed issue and then averages that number by assigned person. c. 8. Select Bar (HTML) and click Next. Select HTML Chart and click Next. How to Build and Deploy an Issue Tracking Application 12-57 .

Building a Basic User Interface ht_people p WHERE i. 9. and so NULL was selected. you modify the home page to display the following information: ■ ■ ■ A menu of all available reports Navigation to the maintenance pages A button to Add a New Issue 12-58 Oracle Database Application Express Advanced Tutorials . Your report should resemble Figure 12–15. select only Number of data points. The third item selected is the average number of days it took for that person to resolve all their issues so the issues have a status of closed. Deselect all other options. For Include in summary. or None Assigned if assigned_ to is NULL.status = 'Closed' GROUP BY p.person_name In the above SELECT statement: – – – b. click Run Page. you next need to add content to the home page and tie all the pages together. c.assigned_to = p.person_id (+) AND i. This report does not link to any other page. Run the Page To view your newly created bar chart. In this section. Review your selections and click Finish. Accept the remaining defaults and click Next. The first item selected is the link. The second item is the person’s name. Figure 12–15 Average Days to Resolve Report Add Content to the Home Page Now that you have completed all the detail pages.

select Vertical Sidebar List. Navigate to the Application home page. To add four more list items: 1. 2. 2. On the List Entries page. you add a menu implemented as a list. b. For List Template. Select reset pagination for this page.Building a Basic User Interface ■ ■ ■ ■ Overdue Issues Recently Opened Issues Open Issues by Project as a chart Unassigned Issues Topics in this section include: ■ ■ ■ ■ ■ ■ ■ Add a List Add Maintenance Navigation Add a New Issues Button Add An Overdue Issues Report Add an Unassigned Issues Report Add a Recently Opened Issues Report Add an Open Issues by Project Pie Chart Add a List First. To add a menu: 1. 3. specify the following a. Create List Entries Now that the list has been created. click Create List Entry. You need to add one list item for each report page. you add list items to it. enter Assign Issues. Now you need to create four more list items. click Lists. 6. Click the Create List Entry button on the far right of the page. Under Target. Click the Shared Components icon.Select 8. enter Main Menu. Click Create. The List Entries page appears. 4. 5. For Name. To add a list item for Assign Issues: 1. For List Entry Label. Click Create. Page . 2. 3. Click Create. Under Navigation. one for each of the reports in your application. 7. To define a list item for Issues: How to Build and Deploy an Issue Tracking Application 12-59 . 4.

b. 6. b.Enter 9. For List Entry Label. enter 60. 4. For Sequence. 9. enter 50. Click Create and Create Another. enter Issues.Select 6. This clears any selections for page 6 from the session state. enter Issue Summary by Project. For Sequence. enter 40. c. Select reset pagination for this page. Include the List on the Home Page Now that the list is created. Click Create. c. Clear Cache . enter Target Resolution Dates (calendar). Click Create and Create Another. For Sequence.Enter 6. 11. Under Target. To define a list item for Issue Summary: a. c. To define a list item for Target Resolution Dates: a. To define a list item for Resolved by Month Identified: a. c. For Sequence. 8. Under Target. enter 30.Select 9. For List Entry Label. enter 20. Under Target. Click Create and Create Another. b. specify the following: – – – Page . c. For List Entry Label. b. For Sequence. 7. For List Entry Label. To display the list in the left margin. Click Create and Create Another. Select reset pagination for this page.Select 11. Under Target. you need to change the page template to one that supports the appropriate region position. For List Entry Label. 5.Building a Basic User Interface a. enter Average Days to Resolve (chart). Clear Cache . 10. you need to include it on the home page. select 10 for Page. specify the following: – – Page . enter Resolved by Month Identified (chart). Under Target. To define a list item for Average Days to Resolve: a. select 12 for Page. 3. b. specify the following: – – – Page . To change the page template on the home page: 12-60 Oracle Database Application Express Advanced Tutorials . Select reset pagination for this page.

To define the first list item: a. Title . Click Create List Entry.Enter Menu. appears. enter Maintenance. The Page Definition for page 12. enter: &nbsp. The Page attributes page appears. 1. 4. Under Display Attributes. create a region to contain your menu. Next. Click Apply Changes. 3. The other two enable users to view people and projects. For List Entry Label. Next. Region Template . select 1 for Page. c. 7. you need to add maintenance navigation as a list.Select No Template. b. Select List and click Next. Click the Shared Components icon. click the Create icon. 5. Under Regions. To add list items: 1. select Vertical Sidebar List. click the Edit page attributes icon. Under Target. Average Days to Resolve. 3. 2. Click Create. 2. 6. d. For Name. How to Build and Deploy an Issue Tracking Application 12-61 . 4. Click Create List Region. To create a new region: 1. For Display Attributes: a. select Main Menu. Click Next. Navigate to the Application home page. Click the Edit Page icon in the upper right corner. click Lists. Click Create. select No Tabs with Sidebar. 2. For Source.Building a Basic User Interface 1. Add Maintenance Navigation Next. The first list item acts as a separator between the two navigation regions. Under Page. b. 2]). enter 1 and click Go. create three list items. 3. for Page Template. 2. Display Point . This list will display just below the reports in the left margin.Select Page Template Region Position 2 (or select the quick link [Pos. 5. 4. Under Navigation. In the Page field. 5. For List Template.

6. Create/Edit Issue. Click Next. 4. 2. select 4. For Display Attributes: a. Under Regions. 1. enter 30. Click Create and Create Another. b. Select HTML and click Next. Check reset pagination for this page. enter 20. To create a region to display the new list. Title .Enter Maintenance.Select Page Template Region Position 2 (or select the quick link [Pos. d. For Sequence. b. select Maintenance. Click the Edit Page icon in the upper right corner. For Display Attributes: 12-62 Oracle Database Application Express Advanced Tutorials . Check reset pagination for this page. 5. 6. For List Entry Label. For List Entry Label. c. enter: Projects c. Add a New Issues Button Next. click the Create icon.Select No Template. you create a button to navigate the user to page 7. Click Create List Region. Click Create and Create Another. 4. For Source. 7. 3. To create a region to contain the button: 1. select 2. To define a list item for People: a. click the Create icon. Display Point . 3. b. 2]).Building a Basic User Interface 3. Click Create. 2. enter: People c. 4. Under Target: – – For Page. Under Target: – – For Page. Under Regions. Select List and click Next. 5. To define a list item for Projects: a. For Sequence. Select HTML for the region container and click Next. Region Template .

and specify that the Create and Cancel buttons return the user to the home page. 5. select SQL Report and click Next. Set these items . 5. 4. select Top of Region.Enter 7. b.Enter ADD. Clear Cache . On the Branching page. click the Create icon. For Button Position. Add An Overdue Issues Report Next. The query for this report retrieves all unclosed issues with a past target resolution date. b.Select No Template. d. For Position. Select Report and then click Next.Select 7. you need to call the correct page. To add a button: 1. How to Build and Deploy an Issue Tracking Application 12-63 . 7. d. Button Name .Enter: Add a New Issue c. For Branching. Click Next. and click Next. Under Buttons. Title . click the Create icon. Under Regions. Label . add some content to the home page. Region Template . 2. 3. For Button Region. Create a button in a region position. specify the following: a. Click Create Button. In this exercise.Select Page Template Region Position 1 (or select the quick link [Pos. Add a Report of Overdue Issues To add a report to display overdue issues: 1. 8. For Report Implementation. For Button Attributes: a. select Buttons and click Next. and then click Next. With these values . 1]). For Button Template.Building a Basic User Interface a. clear the cache. c. select Button and click Next. c. 4. accept the default.Enter: P7_PREV_PAGE d. enter Overdue Issues in the Title field and click Next. b. Display Point .Enter Buttons. Click Next. Page . For Display Attributes.Select Redirect to URL without submitting page. Click Create Region. 6. Action . 3.Enter 1. accept the remaining defaults. 2. you add a report to display overdue issues.

enter: Target<br>Resolution<br>Date b. 7. select center. b. Scroll down to Column Link: a. 4.target_resolution_date < sysdate AND i. For TARGET_RESOLUTION_DATE. To sort by issue ID. To edit the column headings: 1.person_id (+) AND i. To edit column attributes for ISSUE_SUMMARY: 1. 6. enter the following in Enter SQL Query: SELECT i. For ISSUE_ID. 10. For Headings Type.priority. For Heading.status != 'Closed' The outer join is necessary because the assignment is optional. 3. Under Regions. 12-64 Oracle Database Application Express Advanced Tutorials . For ASSIGNEE.project_name FROM ht_issues i. ht_people p. select 1 for Sort Sequence. For Page. select center. but not display it. i. For ISSUE_SUMMARY. i. you need to edit the headings and turn the summary into a link to display the issue details. select 2 for Sort Sequence. For ISSUE_ID. i. select Custom.person_name assignee. 2. change the Heading to: Assigned To 6. remove the Heading. c.assigned_to = p. 8. This enables the query to pass in the link. enter the following for Heading: Summary 5. For TARGET_RESOLUTION_DATE: a. Click Create Region. For Heading Alignment. r. select 7. For Link Text. deselect Show.target_resolution_date.project_id AND i. p.related_project = r.issue_id. click the quick link of [Icon 3]. ht_projects r WHERE i. For Column Alignment. 2.issue_summary. Edit the Overdue Issues Report Now that the region has been created.Building a Basic User Interface 5. For Source. For ISSUE_SUMMARY. Click the Edit icon to the left of ISSUE_SUMMARY. click Report next to Overdue Issues. 9. select Sort for all columns except ISSUE_ID.

For Item 2. Under Sorting. i. To select layout and pagination attributes: 1. Under Layout and Pagination: a. enter the Value: 1 3. 3. i. Under the Regions section. d. replace the existing statements with the following: SELECT i. To create a new report by copying an existing report: 1. For Item 2. 2.Building a Basic User Interface c. enter 5. enter Unassigned Issues. Add an Unassigned Issues Report The next report you add displays unassigned. In the Name column. click Overdue Issues.4 (set based pagination). open issues. For Region Name. enter the Name: P7_PREV_PAGE g. Under Messages. select 7. For Region Source. For Item 1. 4.issue_id. p. Click Copy Region.issue_summary. select the light gray arrow for Ascending and Descending Image. r. For Pagination Scheme. i. 3. For To Page. To modify the query and edit the report region: 1. For Item 1. b. accept the default 1.project_name. 4. 5. For Number of Rows.priority. accept the remaining defaults. you can copy the Overdue Issues report and modify it. For Clear Cache. select Search Engine 1. This report is very similar to Overdue Issues. click Unassigned Issues.person_name identifiee FROM ht_issues i. Click Apply Changes. enter the following in When No Data Found Message: No Overdue Issues. click the Copy icon. Under Regions. How to Build and Deploy an Issue Tracking Application 12-65 .2. and click Next. Rather than creating it manually. ht_people p.target_resolution_date. enter the Name: P7_ISSUE_ID e. 2. Click Apply Changes. enter the Value: #ISSUE_ID# f.3. 2.

ht_projects r i.issue_summary.person_name identifiee 12-66 Oracle Database Application Express Advanced Tutorials .project_name. accept the default 1. 4. For Region Source. Add a Recently Opened Issues Report Lastly. select Unassigned Issues.project_id i. Select the Region Definition tab at the top of the page. b. click Report next to Recently Opened Issues. The underlying query displays the five most recently opened issues. p2. To modify the query and edit the report region: 1. priority. issue_summary.identified_by = p. Click Apply Changes.status != 'Closed' i. Set Sequence to -.related_project = r.Building a Basic User Interface WHERE AND AND AND 3.target_resolution_date. project_name. 2. i. Click Copy Region. Under Messages. enter the following in When No Data Found Message: No Unassigned Issues. click the Copy icon. For To Page. 3. i.person_name assignee. p. 4.issue_id. target_resolution_date. Disable sorting by deselecting Sort. 6. accept the remaining defaults. identifiee FROM ( SELECT i. r. For Region Name.person_id Select the Report Attributes tab at the top of the page. 3.priority. Note that previously defined columns have retained their modified attributes. and click Next. i. replace the existing statements with the following: SELECT issue_id. To create a report of recently opened issues by copying an existing report: 1. Under Regions. Under Regions. enter the following Heading: Identified By 5. enter Recently Opened Issues.assigned_to IS NULL i. Under Name. For IDENTIFIEE. 2. you add a report of recently opened issues. For all columns: a. 4. assignee. 5.

7) ORDER BY i.project_name Note that this query does not include a link. ht_people p. r. ht_projects r WHERE i. COUNT(r. How to Build and Deploy an Issue Tracking Application 12-67 . 4.person_id AND i. Click Create Region. the label is the Project Name.Building a Basic User Interface FROM ht_issues i. Select Pie and click Next. add a pie chart displaying Open Issues by Project. For ASSIGNEE. NVL(r. and the value calculated and used for the pie chart is the total number of open issues by project. For Display Attributes. Add an Open Issues by Project Pie Chart Next.created_date > (sysdate .assigned_to = p. 7. click the up arrow to the right of the Sort Sequence column until ASSIGNEE appears after ISSUE_SUMMARY. Under Messages. 3.related_project = r.project_name. click the Create icon. Under Regions. To add a pie chart: 1. For Source.No Pagination Selected -.person_id (+) AND i.'No Project') label. Click Apply Changes. Select SVG Chart and click Next.identified_by = p2. From Pagination Scheme.project_name) value FROM ht_issues i. 5.related_project = r. enter Open Issues by Project in Title and then click Next. 2.project_id GROUP BY NULL. select . Scroll down to the Layout and Pagination section.project_id AND i.project_name ORDER BY r. Select the Report Attributes tab at the top of the page. 9. ht_people p2. enter the following in When No Data Found Message: No Recently Opened Issues. change Heading to: Assigned To 8. 6.created_date desc ) WHERE rownum < 6 5. For ASSIGNEE. ht_projects r WHERE i. 10.status = 'Open' AND i. Select Chart and click Next. 7. 6. enter the following in SQL: SELECT NULL LINK.

Under Regions. you need to provide users with a way to navigate to the home page. 7. You can add breadcrumbs when you create a new page. or manually after you create your pages. You can accomplish this by utilizing breadcrumbs. Under Font Settings. Run the Page To view the revised page.Building a Basic User Interface To edit the chart. you add breadcrumb entries and then include that breadcrumb within a region on page 0. Figure 12–16 Revised Home Page Add a Breadcrumb Menu In the previous exercise. 6. 1. 2. 5. 4. you created menus on the home page to enable users to navigate to various pages within your application. For Chart Title. Next. Adding components to page 0 makes them display on all pages with an application. Click Apply Changes. enter the following in When No Data Found Message: No Open Issues. enter 500. enter 200. click the Run Page icon. In the next exercise. select 14 for the Font Size. 12-68 Oracle Database Application Express Advanced Tutorials . 3. For Chart Height. remove the title. for Legend. Your home page should resemble Figure 12–16. Under Chart Query. click SVG Chart next to Open Issues by Project. For Chart Width.

Click Apply Changes. Under Entry: a. Under Breadcrumb Entries. For Short Name . 3. Under Breadcrumb. enter 2 in Page. Under Breadcrumb. 2. enter 1 in Page. Under Breadcrumb. Navigate to the Application home page. Parent Entry . Click Create Breadcrumb Entry.Enter Create/Edit Projects. Create Breadcrumb Entry for Page 2 To add a breadcrumb entry for page 2: 1. Under Entry. 2. 2. enter 1 in Page. Click Create. 3.Enter Projects. Under Target. Parent Entry . 3. Click Create Breadcrumb Entry. 2. How to Build and Deploy an Issue Tracking Application 12-69 . 4. Edit Breadcrumb Entry for Page 1 To edit the breadcrumb entry for page 1: 1. Under Target. enter 3 in Page. enter 2 in Page. 5.Building a Basic User Interface Topics in this section include: ■ ■ ■ ■ Navigate to the Breadcrumbs Page Add Breadcrumb Entries Create a Page 0 Create a Region to Contain the Breadcrumb Navigate to the Breadcrumbs Page To navigate to the Breadcrumbs page: 1. Click Shared Components. b. click Breadcrumbs. Under Entry: a. 3. Create Breadcrumb Entry for Page 3 To create a breadcrumb entry for page 3: 1.Select Projects. 5. enter 3 in Page. 4. Short Name . The Breadcrumb Entries page appears. b. click Page 1.Select Home. Under Navigation. 4. you edit the existing breadcrumb entry and add breadcrumb entries for other pages. Add Breadcrumb Entries Next. Click the Breadcrumb icon. Under Target. 4. enter Home for Short Name.

2. Under Breadcrumb. enter 6 in Page. Under Breadcrumb. 2. For Parent Entry . For Short Name . Create Breadcrumb Entry for Page 6 To create a breadcrumb entry for page 6: 1.Select Home. Under Entry: a. Under Target. For Short Name . Under Entry: a. Click Create. Click Create Breadcrumb Entry. 5. Click Create Breadcrumb Entry. 5. Create Breadcrumb Entry for Page 7 To create a breadcrumb entry for page 7: 1. b. enter 4 in Page. Click Create Breadcrumb Entry. Under Breadcrumb.Enter Create/Edit Issue.Enter Issues. 4.Select Home. Under Target. Under Breadcrumb.Select People. For Short Name . enter 5 in Page. Create Breadcrumb Entry for Page 4 To create a breadcrumb entry for page 4: 1. Click Create Breadcrumb Entry. For Parent Entry . Under Entry: a. enter 4 in Page. Under Entry: a. 4.Enter Create/Edit Person Information. For Parent Entry . Under Target.Building a Basic User Interface 5. Under Target. 4. Click Create. b. Click Create. Create Breadcrumb Entry for Page 8 To create a breadcrumb entry for page 8: 12-70 Oracle Database Application Express Advanced Tutorials . enter 7 in Page. Click Create. For Short Name . 2. b. enter 6 in Page. 3. b. 5. 2. 3. enter 5 in Page. 3. For Parent Entry . Note that the People breadcrumb entry is a sibling to Projects. 4.Enter People. 5. 3. enter 7 in Page.Select Home. Create Breadcrumb Entry for Page 5 To create a breadcrumb entry for page 5: 1. Click Create.

4.Select Home. Under Target. For Entry: a. For Short Name . 5. Create Breadcrumb Entry for Page 12 To create a breadcrumb entry for page 12: 1. Create Breadcrumb Entry for Page 9 To create a breadcrumb entry for page 9: 1. b. Click Create Breadcrumb Entry.Enter Target Resolution Dates. enter 8 in Page.Select Home. Click Create Breadcrumb Entry. Click Create. 3. 3. 2. For Parent Entry .Enter Issue Summary by Project. 4. b. Under Target. For Parent Entry. Click Create Breadcrumb Entry. For Short Name . For Parent Entry . 2. 5. Under Target. enter 10 in Page. enter 9 in Page. enter 11 in Page. Under Menu Option: a. enter 9 in Page.Enter Resolved by Month Identified. Under Breadcrumb. Under Breadcrumb. enter 8 in Page. Under Entry: a.Enter Assign Issues. Click Create Breadcrumb Entry. 4. Under Breadcrumb.Select Home. b. For Parent Entry . 3. 5. Click Create. For Short Name . Under Breadcrumb. enter 10 in Page. Click Create. 4. Under Entry: a. 2. enter 11 in Page. For Parent Entry . Under Breadcrumb. b. Under Target.Building a Basic User Interface 1. Click Create. 3. Create Breadcrumb Entry for Page 11 To create a breadcrumb entry option for page 11: 1. 5.Select Home. Click Create Breadcrumb Entry. 2.Select Home. Under Entry: a. 3. For Short Name . enter 12 in Page. 2. How to Build and Deploy an Issue Tracking Application 12-71 . Create Breadcrumb Entry for Page 10 To create a breadcrumb entry for page 10: 1.

Click Finish. Click Create. enter Breadcrumbs for Name and click Next. Click Create Page. For Page Attributes. c. 2. No. From the Success page. Your home page should resemble Figure 12–17 on page 12-73. and then click Next.Select No Template. Region Template . For Breadcrumb Entry. 6. Return to the home page by clicking Edit Page. enter 0 for Page Number and click Next. 4. 2. When the Page Definition for page 0 appears. Create a Page 0 Now that the breadcrumb exists. 3. To create a page 0: 1. 5. accept the defaults and click Next. 5. On Tabs. Click Next. b. click the Next Page button (>).Enter Breadcrumbs. enter 12 in Page. 12-72 Oracle Database Application Express Advanced Tutorials . Adding components to page 0 makes them display on all pages with an application. 4. Under Target. 6.Building a Basic User Interface b. Run the Page To see your completed home page. 7. For Identify the type of region to add to this page. For Page Name. The Page Definition for page 0 appears. Navigate to the Application home page. select Breadcrumb and click Next. This selection displays the breadcrumb above all other content on the page. Display Point . For Breadcrumb Container Region: a. click the Create icon. 5. Under Regions. select Edit Page.Select Page Template Region Position 1. accept the default. Region Title . click the Run Page icon. 7. For Short Name .Enter Average Days to Resolve. 3. The Page Definition for page 1 appears. 4. Review your selections and click Finish. For Breadcrumb. accept the defaults and click Next. Select Blank Page and click Next. Create a Region to Contain the Breadcrumb To create a region to contain your breadcrumb: 1. you need to create page 0 and then create a region to contain your Breadcrumb menu. d.

Topics in this section include: ■ ■ Add Support for Email Notification Add Application Security Add Support for Email Notification The planning and project analysis phase produced two email requirements: ■ ■ Notify people when an issue is assigned to them Notify the project lead when any issue becomes overdue Topics in this section include: ■ ■ ■ How Email Notification Works Add Notification of New Assignments Add Notification for Overdue Issues How to Build and Deploy an Issue Tracking Application 12-73 . At this stage your application is fully functional. Those topics are discussed in the next section. Notice how the breadcrumb changes. Click one of the items on the Maintenance menu on the left side of the page.Adding Advanced Features Figure 12–17 Revised Home Page with Breadcrumb Menu Notice the Breadcrumb in the top bar. Adding Advanced Features Once your application is fully functional you can focus on adding advanced features outlined during the planning and project analysis phase. but is missing the security and email notification.

these preferences are set to localhost and 25. d. For Select the type of database object you want to create. See Also: "How to Send Email from an Application" in Oracle Database Application Express User's Guide to learn about configuring Email Environment settings. On the Create/Edit Issue page. For Trigger Body. An assignment can be made or changed from two different pages: Create/Edit Issue and Assign Issues. to send mail in the queue. select AFTER. Email is not sent immediately. SMTP Host Address and SMTP Host Port. select insert. For Options. the best way to implement the notification is with a before insert and update trigger on HT_ISSUES. select HT_ISSUES and click Next. 4. 2. To create a before insert and update trigger on HT_ISSUES: 1. you create a PL/SQL process that calls the supplied APEX_MAIL package. The following is a description of the SEND procedure of the APEX_MAIL package. you add a notification to a person when the person has a new assignment. Click Create. By default. You can create this trigger programmatically using SQL Workshop. click Trigger. enter BIU_HT_ISSUES_NOTIFY_ASSIGNEE. b. you need to change your Email Environment Settings. The DBMS_JOB utilizes two preferences. 5.Adding Advanced Features How Email Notification Works To send mail from within an Oracle Application Express application. If Oracle Application Express is not configured for SMTP services. PROCEDURE SEND Argument Name -----------------------------P_TO P_FROM P_BODY P_BODY_HTML P_SUBJ P_CC P_BCC Type ----------------------VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 In/Out -----IN IN IN IN IN IN IN Default? -------- DEFAULT DEFAULT DEFAULT DEFAULT Add Notification of New Assignments First. For Table Name. you can store the initial values and then check them against any changes to see if an assignment has been made or changed. so there is no way to check the old values against the new values. 3. For Trigger Name. but is stored in a temporary queue until a DBMS_JOB pushes the queue. For Firing Point. The Assign Issues is a tabular form.assigned_to IS NOT NULL) OR (UPDATING AND 12-74 Oracle Database Application Express Advanced Tutorials . For Define: a. On the Workspace home page. For that reason. c. enter the following: IF (INSERTING AND :new. update. click SQL Workshop and then Object Browser.

person_email. Add Notification for Overdue Issues The second email notification notifies the project lead whenever an issue becomes overdue.assigned_to != :old. -p_body => -'You have been assigned a new issue. the package initiates an email to the Project Lead.'-'). -'The details are below. The best way to check for overdue issues is to write a package that queries the HT_ ISSUES table.project_name ||chr(10)|| -' Summary: '||:new.assigned_to) LOOP IF c1. END LOOP. END LOOP. END IF. END IF. The package will be called once a day by a dbms_job.status ||chr(10)|| -'Priority: '||nvl(:new.assigned_to IS NOT NULL) THEN FOR c1 IN (SELECT person_name.priority. There is no human interaction to determine if an issue is overdue.APEX_MAIL.SEND and replace the p_to and p_from with your own valid email address. f. Click Next. To review the code. Click Finish. e.issue_summary ||chr(10)|| -' Status: '||:new. expand the SQL arrow. You can use the Create Object function as follows: ■ Create the package and package body from within the SQL Workshop How to Build and Deploy an Issue Tracking Application 12-75 . This procedure checks for issues by project so that the project lead can receive just one email with all overdue issues rather than an email for each issue. An issue becomes overdue when the target resolution date has passed. If it finds any overdue issues.SEND( -p_to => c1. uncomment the APEX_ MAIL. but the issue is not yet closed. so you cannot check for it on a page or in a trigger.person_email. -p_from => c1.person_email IS NOT NULL THEN FOR c2 IN (SELECT project_name FROM ht_projects WHERE project_id = :new. 6. ' ||chr(10)|| -chr(10)|| -' Project: '|| c2. 7. person_email FROM ht_people WHERE person_id = :new.assigned_to) AND :new.related_project) LOOP -. -p_subj => 'New Issue Assignment').Adding Advanced Features (:old.assigned_to IS NULL OR :new. To make this work within your environment.

issue_summary) LOOP IF l_count = 0 THEN l_msg_body := 'As of today. p. SQL Commands appears. i. i. To create the package body: 1. click SQL Workshop and then SQL Commands. ht_people p WHERE i.project_id = pe.assigned_project AND pe.person_name.status != 'Closed' ORDER BY i. pe.priority FROM ht_issues i.target_resolution_date < SYSDATE AND i.person_email FROM ht_projects pr. the following issues '|| 'are overdue:'||chr(10)|| 12-76 Oracle Database Application Express Advanced Tutorials . END. SQL Commands appears. Enter the following in the field provided: CREATE OR REPLACE package ht_check_overdue_issues AS PROCEDURE email_overdue.assigned_to = p. click SQL Workshop and then SQL Commands.related_project = c1. BEGIN FOR c1 IN (SELECT pr.project_id.target_resolution_date. 2. i.target_resolution_date. Enter the following in the field provided: CREATE OR REPLACE PACKAGE BODY ht_check_overdue_issues AS PROCEDURE email_overdue IS l_msg_body varchar2(32000) := null.person_id (+) AND i. / 3.project_id AND i. l_count number := 0. ht_people pe WHERE pr.issue_summary. pe.status. 2. pr. Click Run.person_name.project_name. On the Workspace home page. i.Adding Advanced Features ■ Use SQL Command Processor to run the create commands To create the package: 1. On the Workspace home page.person_role = 'Lead') LOOP FOR c2 IN (SELECT i.

Click the Edit icon.status ||chr(10)|| ' Priority: '||c2. 2. l_count := 0. END IF. From the Object list on the left side of the page.SEND and replace the p_to and p_from with your own valid email address. Next. END LOOP.priority ||chr(10)|| 'Assigned to: '||c2. 4.person_email.person_email. END LOOP. b.issue_summary ||chr(10)|| ' Status: '||c2. -p_subj => 'Overdue Issues for Project '|| c1.APEX_MAIL.SEND( -p_to => c1. Click Apply Changes. END IF. ELSE l_msg_body := l_msg_body ||chr(10)|| chr(10)|| ' Target: '||c2.Adding Advanced Features chr(10)|| ' Project: '|| c1. uncomment the APEX_MAIL. 3. For each person.project_name ||chr(10)|| chr(10)|| ' Target: '||c2. How to Build and Deploy an Issue Tracking Application 12-77 . select Tables. 3. -p_body => l_msg_body.issue_summary ||chr(10)|| ' Status: '||c2. END ht_check_overdue_issues. -p_from => c1. Select the Data tab.project_name).priority ||chr(10)|| 'Assigned to: '||c2. Select the HT_PEOPLE table. IF l_msg_body IS NOT NULL THEN -.person_name. you want to update the demonstration data to include your employees’ valid email addresses. l_count := l_count + 1. To update demonstration data to include valid email addresses: 1. END email_overdue. Click Run.status ||chr(10)|| ' Priority: '||c2. edit the email address: a. Change Person Email to a valid email address.person_name.target_resolution_date ||chr(10)|| ' Summary: '||c2. 5. / To make this work within your environment. c. On the Workspace home page. click SQL Workshop and then Object Browser.target_resolution_date ||chr(10)|| ' Summary: '||c2.

you can define authorization schemes. you need to set the interval appropriately and execute it using SQL Commands within the SQL Workshop. region. To make this a valid DBMS_JOB.email_overdue. what => 'BEGIN ht_check_overdue_issues. Authorization controls user access to specific controls or components based on user privileges. you would replace desired_ interval with the following: 'TRUNC(SYSDATE)+(25/24)' See Also: Send email from Application Express applications How To on OTN at: http://www. Return to the Workspace home page by clicking the Home breadcrumb link.html Add Application Security The planning and project analysis phase produced two security requirements: ■ ■ Only the CEO and Managers can define and maintain projects and people Once assigned. Repeat step 5 for all people within the HT_PEOPLE table. however. / For this DBMS_JOB. next_date => SYSDATE.'.com/technology/products/database/applic ation_express/howtos/index. DECLARE jobno number. Once defined. To create the DBMS_JOB: The following is an example of a DBMS_JOB that executes your newly created package. 7. BEGIN DBMS_JOB. or item to restrict access.SUBMIT( job => jobno. you want to create a DBMS_JOB that executes your newly created package at a time interval you specify. END. For example. only the person assigned or a project lead can change data about the issue Within Oracle Application Express. Each authorization schema is run only when needed and is defined to validate either once for each page view or once for each session. replace desired_interval with the appropriate interval. COMMIT. Topics in this section include: ■ ■ Restrict Project and People Definition Restrict Issue Modification 12-78 Oracle Database Application Express Advanced Tutorials .Adding Advanced Features 6. interval => desired_interval ). you can associate an authorization scheme with any page. Next. END.oracle. to have this job execute once each day.

Enter: SELECT '1' FROM ht_people WHERE (upper(person_email) = UPPER(:APP_USER) AND person_role IN ('CEO'. b. On the Workspace home page.'Manager')) OR (UPPER(:APP_USER) = 'HOWTO') c.Enter: You are not authorized to access this function. If you do not take this approach. Under Security. This selection is sufficient in this instance as the assigned role typically does not change within a given session. 7. For Validate authorization scheme. Create the Authorization Scheme To create the authorization scheme: 1. Next. Click Shared Components. and click Next. Expression 1 . 6. You may find this user very useful for development and testing. Click Create. Under Authorization Scheme: a. you should always code in a user that can pass all security. Select the Issue Tracker application. accept the default. you may not be able to access the restricted pages unless you define yourself as the CEO or Manager. select Once per session. Scheme Type . enter the following in Name: USER_CEO_OR_MANAGER 8.Select Exists SQL Query. you: ■ ■ Create an authorization scheme to check the current user's role Associate the authorization scheme with the items on the Projects and People report that navigate to the Create/Edit pages Associate the authorization scheme with the Create/Edit pages themselves so that a user cannot bypass the security by manually editing the URL to the target page ■ To reference the current user. Under Authorization Scheme. 9. 4. Identify error message displayed when scheme violated . Scroll down to Evaluation Point. From Scratch. click Application Builder. To address this requirement. How to Build and Deploy an Issue Tracking Application 12-79 . 2. This session variable is compared with the person's email address (which is the same as their workspace or workspace name). 3. 10. Whenever coding this type of security. you need to associate the authorization scheme with the appropriate objects. Click Create. click Authorization Schemes. use the session variable :APP_USER.Adding Advanced Features Restrict Project and People Definition The first requirement states that only the CEO and Managers may define and maintain projects and people. For Create Authorization Scheme. 5.

3. The Page attributes page appears. The Edit Page Buttons page appears. Click the Edit Page icon in the upper right corner. 2. click Report next to People. Navigate to page 3 by clicking the Next Page (>) button. click the Edit page attributes icon. Under Regions. 3. Create/Edit Project. 5. Projects. In Page. Click Apply Changes. 2. Click the Edit icon to the left of PERSON_ID. Associate Objects with the Create/Edit Report To associate the authorization scheme with the Create/Edit Project page: 1. select the Authorization Scheme USER_CEO_OR_ MANAGER. select the Authorization Scheme USER_CEO_OR_MANAGER. 6. 1. appears. The Page Definition for page 3. Under Authorization. 4. Click Cancel. To associate the authorization scheme with the Create button on the People report: 12-80 Oracle Database Application Express Advanced Tutorials . appears. 2. Navigate to page 4 by clicking the Next Page (>) button. 7. Click Apply Changes. appears. The Page Definition for page 4. 5. The Page Definition for page 2. select the Authorization Scheme USER_CEO_OR_ MANAGER. Under Security. Under Regions. Click Apply Changes. 6. 3. Click Cancel.Adding Advanced Features Associate Objects on the Projects Report To associate the authorization scheme with the Projects report: 1. The Edit Page icon resembles a small green piece of paper and pencil. Under Authorization. Click Apply Changes. click Report next to Projects. Click the Edit icon to the left of PROJECT_ID. Associate Objects with the People Report To associate the authorization scheme with the People report. People. 4. click the Create link (not the icon). 4. 3. Under Buttons on the Page Definition for page 2. To associate the authorization scheme with the Create button on the Projects report: 1. Under Authorization. enter 2 and then click Go. 2. select the Authorization Scheme USER_CEO_OR_ MANAGER. Under Page.

See Also: "Create Users" on page 12-88 Restrict Issue Modification The second requirement states that once an issue has been assigned. To let users know why they are not able to make changes. create another user. 3. It also needs to retrieve data from the database because at the time it is How to Build and Deploy an Issue Tracking Application 12-81 . The SQL for this scheme must be specific to the Create/Edit Issues page because it needs to reference P7_ ISSUE_ID. Click Apply Changes. Navigate to page 5 by clicking the Next Page (>) button. 2. you can add an HTML region that displays an explanation when the authorization fails. the best approach is to create an authorization scheme to be evaluated once for each page view. the only issues that are displayed are those that are unassigned. Under Page. The authorization scheme will be associated with both the Apply Changes and Delete buttons on the Create/Edit Issue page. To associate the authorization scheme with the Create/Edit Person Information page: 1. Given this requirement. you can also associate the authorization scheme with the process that performs the insert. The Page Definition for page 5 appears. update and delete on HT_ISSUES. HOWTO2. there are two pages that enable users to modify an issue: the Create/Edit Issue page and the Assign Issues page. they have no way of saving that change. For added security. security is not necessary. you do want to enable users to view all the detailed data about an issue so that they can view the progress and resolution. Currently. Although other users are not allowed to change the data. As the issues are unassigned. Click Apply Changes. You can test this by creating a user with the user name of HOWTO. 2. Under Authorization. This way. The HOWTO user should be able to see the edit link. This user should not be able to see the link. but if they do change something. This protects your application against someone changing the URL to call the Apply Changes process. The Page attributes page appears. This requirement is a little trickier since it changes for every issue. Then. There are many places that a user can navigate to edit an issue: ■ ■ ■ Three regions on the home page display issues or have edit links The Issues report has links to edit each issue The Target Resolution Dates report enables users to select an issue to edit. On the Assign Issues page. The Edit Page Buttons page appears. only the person assigned (or a project lead) can change data about the issue. 4. click the Create link (not the icon). select the Authorization Scheme USER_CEO_OR_ MANAGER. Under Security. 3. select the Authorization Scheme USER_CEO_OR_MANAGER. Under Buttons. unauthorized users can view all the details. click the Edit page attributes icon.Adding Advanced Features 1.

Navigate to the Application home page. 12-82 Oracle Database Application Express Advanced Tutorials . Under Authorization Scheme. Create the Authorization Scheme To create the authorization scheme: 1. 3. END IF. l_person_role := c2. 4. accept the default From Scratch and then click Next. integer. Under Security.assigned_to. Click Create.person_role. The only item that will be available will be P7_ISSUE_ID because it will be passed by the link.person_id.User is HOWTO or new Issue IF :APP_USER = 'HOWTO' or :P7_ISSUE_ID IS NULL THEN RETURN TRUE.related_project. the necessary data will not be available in the session state.Adding Advanced Features evaluated. -. For Expression 1. Click Shared Components. enter the following in Name: P7_ASSIGNED_OR_PROJECT_LEAD 7. integer. FOR c1 IN (SELECT related_project. END LOOP. person_role. enter: DECLARE l_related_project l_assigned_to l_person_id l_person_role l_assigned_project BEGIN integer. 5. click Authorization Schemes. assigned_to FROM ht_issues WHERE issue_id = :P7_ISSUE_ID) LOOP l_related_project := c1. integer. select PL/SQL Function Returning Boolean. assigned_project FROM ht_people WHERE upper(person_email) = upper(:APP_USER)) LOOP l_person_id := c2. 6. 2. FOR c2 IN (SELECT person_id.Issue not yet assigned IF l_assigned_to IS NULL THEN RETURN TRUE. For Creation Method. Under Authorization Scheme: a.assigned_project. l_assigned_project := c2. varchar2(7). END IF. l_assigned_to := c1. -. b. For Scheme Type.

nor are you the Project Lead. b. a. c. a. Under Buttons. select the Authorization Scheme P7_ASSIGNED_OR_ PROJECT_LEAD. This selection is necessary since each issue may have a different result. a. Therefore you are not authorized to modify the data. -. Click Apply Changes. Under Evaluation Point. Now you need to associate the authorization scheme with the appropriate objects on the Create/Edit Issue page. select the Authorization Scheme P7_ASSIGNED_OR_ PROJECT_LEAD. 8. Under Authorization. b. 4. Processes. Under Authorization. 9. b. select the Authorization Scheme P7_ASSIGNED_OR_ PROJECT_LEAD. b.User is assigned to issue ELSIF l_assigned_to = l_person_id THEN RETURN TRUE. 3. Under Buttons.User is lead of related project IF l_person_role = 'Lead' and l_assigned_project = l_related_project THEN RETURN TRUE. Navigate to the Application home page. a. Click Create. Under Authorization. END. select Once per page view. for Validate authorization scheme. Under Authorization. Associate Objects with the Create Edit Issues Report To associate the authorization scheme with buttons and processes: 1. END IF. Under Buttons. 6. click Apply Changes. 5. Under Buttons. ELSE RETURN FALSE. Click Apply Changes. click Create. For Identify error message displayed when scheme violated. enter: This issue is not assigned to you. Select page 7 . select the Authorization Scheme P7_ASSIGNED_OR_ PROJECT_LEAD. click Create and Create Another. 2. How to Build and Deploy an Issue Tracking Application 12-83 . -. select Process Row of HT_ISSUES. Under Page Processing. Click Apply Changes.Create/Edit Issues. 7. click Delete.Adding Advanced Features END LOOP. Click Apply Changes.

create a new region to display an explanation when the authorization fails To create a new region: 1. Select HTML for region container and click Next. items below region content).Adding Advanced Features a. enter Not Authorized. Click Apply Changes. enter the following in Enter HTML Text Region Source and then click Next: You are not authorized to modify the data for this issue because<br>you are not the Project Lead nor is the issue assigned to you. 5. Notice a new region displays at the top of the page and that the only button being displayed is Cancel. b. b. Under Authorization. For Display Point. For Authorization Scheme. Click Next. select {Not P7_ASSIGNED_OR_PROJECT_LEAD}. 2. 7. 4. Click Create Region. c. For Display Attributes: a. select Page Template Body (2. 3. On Region. For Source. For Title. accept the default HTML and click Next. Under Regions. 12-84 Oracle Database Application Express Advanced Tutorials . click the Create icon. Figure 12–18 on page 12-85 displays the Create/Edit Issue page being run by a person for whom the Authorization fails. select the Authorization Scheme P7_ASSIGNED_OR_ PROJECT_LEAD. This selection makes the region only display when the Authorization Scheme fails. Create an HTML Region Lastly. 6.

Although this approach is not required.Deploying Your Application Figure 12–18 New Region Displaying Authorization Failure A more elegant solution to this security requirement would be to create a different page for viewing the details of an issue. You would still want to protect against someone accessing the edit page without using a link so you would also check permission before firing the insert. developers create applications on one server and deploy it on another. update and delete process. Deploying Your Application Now that your application is complete. Topics in this section include: ■ ■ ■ ■ Move the Application Definition Alternate Authentication Mechanisms to Consider Create Users Publish the URL How to Build and Deploy an Issue Tracking Application 12-85 . Typically. You would need to have a procedure that would take in the issue_id and current user and pass back a flag for view only or edit. Then you could dynamically build the link for all the reports to call either the View page or the Edit page based upon a call to that procedure. the next step is to deploy it. you need to install and configure another Oracle Application Express instance. it enables you to resolve bugs without impacting the production instance. Note: To deploy an application on another server.

b. you must export the application definition from your development server and import it into your production server. Log in to the production instance and follow the directions in "About Building Database Objects" on page 12-6. When prompted.Deploying Your Application Move the Application Definition The definition for your application lives within the Oracle database. 2. 6. click Import and then click Next. click the arrow on the Application Builder icon and select the application you just created. Topics in this section include: ■ ■ ■ ■ Export the Application Definition Create the Required Objects to Support the Application Import the Application Definition into the Production Instance Load the Data Export the Application Definition To export the application definition from your development server: 1. Create the Required Objects to Support the Application On your production instance. 4. be aware you cannot test the code until they exist. To move an application to another Oracle Application Express instance. Click Export Application. or Component Export. Page. 2. Import the Application Definition into the Production Instance Log in to the production instance of the Workspace home page: 1. 12-86 Oracle Database Application Express Advanced Tutorials . click to Save the file. 3. For Application.Accept the default and click Next.Click the Browse button and then locate your exported file. click Export/Import. 3. Import file . The application definition includes everything that makes up the application. On the Export/Import page. but it does not include database object definitions or the underlying data. Specify a location on your local hard drive and then click Save. File Character Set . you need to create the objects necessary to support the application. 5. For Export/Import. click Export and then Next. On the Application home page. Note: Although the supporting objects do not need to exist for you to import the application definition. For Import File: a. make sure the application created in this exercise is selected. 7. click the arrow on the Application Builder icon and select the application you just created. On the Workspace home page. File Type . On the Workspace home page. including the templates. c.Select Application. Click the Export/Import icon. 4.

Deploying Your Application Once the success message appears. Auto Assign New Application ID . If you attempt to install an application having the same ID as an existing application in a different workspace. c. If any errors are encountered. If you select this option. the Post-App Install Utility Options page appears. the install is rolled back. From here. Alternatively. Note there are various mechanisms you could use to accomplish this task. you can select one of the following: ■ ■ Select Run Application to see the application running Select Application Attributes to view the application definition within Application Builder Load the Data The next step in deploying your application is to load the data. Click Install Application. If all statements are successful the install commits and becomes permanent. How to Build and Deploy an Issue Tracking Application 12-87 . . Build Status.Only select this option if the application ID is not being used on the production instance. Change Application ID . use either export/import to move data between machines or use SQL to retrieve and transform existing data and load it into the application tables. an error message appears. Parse As Schema . Use the Data Loader to load data copied from a spreadsheet. If the install is successful. Click Install. When you install an application having the same ID as an existing application in the current workspace. you would need to populate the project and people tables. b.Select Run and Build Application. you will be prompted to enter a new application ID. If you have data existing already within an Oracle database. 6.Select the schema on your production server that contains your application objects. This option enables other users to run the application and enables you to log in and change the code if necessary.You can select: – – – Reuse Application ID from Export File . the next step is to install the file. resulting in no permanent changes. Use SQL Scripts and run scripts to create data. the existing application is deleted and then the new application is installed. Be aware that if you select this option you will not be able to access the source code for the application.Select this option to change the existing application ID. d. 5. including: ■ ■ ■ ■ Use the application itself to create data. At a minimum. Install As Application .Select this option to assign a new application ID. On Application Install: a. you can select Run Application Only.

enter the required information. You can determine the URL to your application by positioning the mouse over the Run icon on the Application home page. 4. Publish the URL Now that you have deployed your application.html Create Users In order for your application to be accessible. See Also: "Establishing User Identity Through Authentication" in Oracle Database Application Express User's Guide See Also: Security How To documents on OTN: http://www. and created users. 5. loaded data.com/technology/products/database/applic ation_express/howtos/howtos. From the Administration list on the right side of the page.oracle. Loading. If you are still using Oracle Application Express authentication. the simplest way to create users it to access the Manage Users page. you need to create users. The URL appears in the status bar at the bottom of the page. the Application Express engine calls the credentials verification method specified in the application's current authentication scheme. Navigate to the Workspace home page. click Create End User. Use the built-in Oracle Application Express authentication method. 12-88 Oracle Database Application Express Advanced Tutorials . ■ ■ Your application is currently using the built-in Oracle Application Express authentication method. which checks user name and password against the LDAP directory that you specify. 2. To create a new user: 1. and Unloading Data" in Oracle Database Express Edition 2 Day DBA Alternate Authentication Mechanisms to Consider When the application login page calls the login API with a user name and password. From the Tasks list on the right side of the page. Exporting. Click Create User or Create and Create Another.Deploying Your Application See Also: "Loading Demonstration Data" on page 12-8 and "Importing. Use the built-in LDAP authentication method. which checks the user name and password against the Oracle Application Express workspace repository. You have three choices as to how credentials are verified from within the login API: ■ Implement the method yourself as a PL/SQL function returning Boolean and put it in your application's schema. you can publish your production URL. click Manage Application Express Users. Under User Identification. 3.

com is the URL of the server pls is the indicator to use the mod_plsql cartridge otn is the data access descriptor (DAD) name f?p= is a prefix used by Oracle Application Express 11563 is the application being called 1 is the page within the application to be displayed 3397731373043366363 is the session number To run this example application. P_PASSWORD => :P101_PASSWORD. the URL has no meaning and can be rather long. P_SESSION_ID => :FLOW_SESSION. As you may recall.com/pls/otn/f?p=11563:1:3397731373043366363 Where: ■ ■ ■ ■ ■ ■ ■ apex. Consider the following example: http://apex. The contents of the process are: WWV_FLOW_CUSTOM_AUTH_STD. the page you pass in to the URL is overwritten and does not need to be included. The host name can be changed to make it more symbolic.oracle. you would use the URL: http://apex.com/pls/otn/f?p=11563:1 As you can see from the example used. Note that the Page is hard coded into this process. How to Build and Deploy an Issue Tracking Application 12-89 .oracle. You can also configure Apache to rewrite your URL so that you can publish an abbreviated format and a URL that would be more intuitive to your users. This link is only referenced by this icon and by applications that do not use the Application Express Login API.LOGIN( P_UNAME => :P101_USERNAME.oracle. This wizard creates a process on the Login page (page 101) that controls authentication. You can access the application by using the following URL: http://apex.oracle. See your Apache documentation for details. P_FLOW_PAGE => :APP_ID||':1' ). Because of this. you created the Issue Tracker application using the Create Application wizard.com/pls/otn/f?p=11563:1 When users log in. they receive a unique session number.Deploying Your Application The Run icon gets its value from the Home link attribute on the Edit Security Attributes page.

Deploying Your Application 12-90 Oracle Database Application Express Advanced Tutorials .

Topics in this section include: ■ ■ Creating Application Database Objects DDL Creating Issues Script Creating Application Database Objects DDL The following DDL creates all the required database objects for the issue tracking application in "How to Build and Deploy an Issue Tracking Application" on page 12-1. NULL. as a unique key + implements a sequence to generate project id + assigns the sequence to populate the project id whenever a new record is created + declares table and column comments CREATE TABLE ht_projects ( project_id INTEGER project_name VARCHAR2(100) start_date DATE target_end_date DATE actual_end_date DATE ) / ALTER table ht_projects NOT NOT NOT NOT NULL. including a new column for a system generated primary key + declares the new primary key + implements the real primary key. DDLs and Scripts A-1 . project name.A DDLs and Scripts This appendix contains DDLs (data definition language) and scripts necessary to complete a number of tutorials in Oracle Database Application Express Advanced Tutorials. ----------------This DDL creates all the database objects used by the Issue Management Application featured in HT_PROJECTS The HT_PROJECTS DDL: + creates the projects table with the necessary columns. NULL. NULL.

nextval INTO :new.' ON column ht_projects.start_date IS start date of the project.' ON column ht_projects.actual_end_date IS actual end date of the project.project_name IS unique name of the project.project_id IS system generated unique identifier for the project. / COMMENT 'All / COMMENT 'The / COMMENT 'The / COMMENT 'The / COMMENT 'The / COMMENT 'The / ON table ht_projects IS projects currently underway.target_end_date IS targeted end date of the project. -including a new column for a system generated primary key -+ declares the new primary key -+ implements the real primary key.' ON column ht_projects.project_id FROM DUAL.' --.Creating Application Database Objects DDL ADD CONSTRAINT ht_projects_pk PRIMARY KEY (project_id) / ALTER TABLE ht_projects ADD CONSTRAINT ht_projects_uk UNIQUE (project_name) / CREATE SEQUENCE ht_projects_seq INCREMENT BY 1 START WITH 40 / CREATE OR REPLACE TRIGGER bi_ht_projects BEFORE INSERT ON ht_projects FOR EACH ROW BEGIN IF :new. END. END IF. as a unique key -+ implements a check constraint to validate the roles that people -can be assigned -------+ implements a foreign key to validate that people are assigned to valid projects + implements a check constraint to enforce that all project leads and team members are assigned to projects + implements a sequence to generate person id + assigns the sequence to populate the person id whenever a new record is created A-2 Oracle Database Application Express Advanced Tutorials .HT_PEOPLE --.project_id is null THEN SELECT ht_projects_seq. person name.' ON column ht_projects.' ON column ht_projects.The HT_PEOPLE DDL: -+ creates the people table with the necessary columns.

person_id FROM DUAL. END IF. person_name VARCHAR2(100) NOT NULL.person_name IS unique name of the person.'Member')) / ALTER TABLE ht_people ADD CONSTRAINT ht_people_project_fk FOREIGN KEY (assigned_project) REFERENCES ht_projects / ALTER TABLE ht_people ADD CONSTRAINT ht_people_assignment_cc CHECK ( (person_role in ('Lead'. person_email VARCHAR2(100) NOT NULL. person_role VARCHAR2(7) NOT NULL.person_role IS DDLs and Scripts A-3 .'Member') and assigned_project is not null) or (person_role in ('CEO'. END.'Lead'. / COMMENT 'All / COMMENT 'The / COMMENT 'The / COMMENT ON table ht_people IS people within the company.Creating Application Database Objects DDL --- + declares table and column comments CREATE TABLE ht_people ( person_id INTEGER NOT NULL.person_id IS NULL THEN SELECT ht_people_seq.' ON column ht_people.person_id IS system generated unique identifier for the person.nextval INTO :new.'Manager') and assigned_project is null) ) / CREATE SEQUENCE ht_people_seq INCREMENT BY 1 START WITH 40 / CREATE OR REPLACE TRIGGER bi_ht_people BEFORE INSERT on ht_people FOR EACH ROW BEGIN IF :new.' ON column ht_people. assigned_project INTEGER ) / ALTER TABLE ht_people ADD CONSTRAINT ht_people_pk PRIMARY KEY (person_id) / ALTER TABLE ht_people ADD CONSTRAINT ht_people_uk UNIQUE (person_name) / ALTER TABLE ht_people ADD CONSTRAINT ht_people_role_cc CHECK (person_role in ('CEO'.'Manager'.' ON column ht_people.

target_resolution_date DATE. status VARCHAR2(8) priority VARCHAR2(6). resolution_summary VARCHAR2(2000). identified_date DATE related_project INTEGER assigned_to INTEGER. progress VARCHAR2(2000). records the user creating the -row and also assigns status of 'Open' if no status is provided -+ records the current date and the user whenever an issue is edited and -sets the status to 'Closed' if an ACTUAL_RESOLUTION_DATE is -provided -+ declares table and column comments -create table ht_issues ( issue_id INTEGER issue_summary VARCHAR2(200) issue_description VARCHAR2(2000).assigned_project IS 'The project that the person is currently assigned to.HT_ISSUES --. not null. A-4 Oracle Database Application Express Advanced Tutorials .Creating Application Database Objects DDL 'The role the person plays within the company.' / COMMENT ON column ht_people.' / --. identified_by INTEGER NOT NULL. not null. including a new column -for a system generated primary key -+ declares the new primary key -+ implements a foreign key to validate that the issue is identified by a -valid person -+ implements a foreign key to validate that the issue is assigned to a -valid person -+ implements a foreign key to validate that the issue is associated with -a valid project -+ implements a check constraint to validate the status that is assigned -to the issue -+ implements a check constraint to validate the priority that is assigned -to the issue -+ implements a sequence to generate issue id -+ assigns the sequence to populate the issue id and the creation date -whenever a new record is created. not null.The HT_ISSUES DDL: -+ creates the table with the necessary columns. last_modified_by VARCHAR2(60) ) / ALTER TABLE ht_issues ADD CONSTRAINT ht_issues_pk PRIMARY KEY (issue_id) / ALTER TABLE ht_issues ADD CONSTRAINT ht_issues_identified_by_fk FOREIGN KEY (identified_by) not null. created_date DATE created_by VARCHAR2(60) last_modified_date DATE. not null. not null. not null. actual_resolution_date DATE.

issue_id IS system generated unique identifier for the issue.issue_id FROM DUAL.status IS NULL THEN :new.'Low')) / CREATE SEQUENCE ht_issues_seq INCREMENT BY 1 START WITH 40 / CREATE OR REPLACE TRIGGER bi_ht_issues BEFORE INSERT on ht_issues FOR EACH ROW BEGIN IF :new. END IF.last_modified_by := nvl(wwv_flow.'Medium'.Creating Application Database Objects DDL REFERENCES ht_people / ALTER TABLE ht_issues ADD CONSTRAINT ht_issues_assigned_to_fk FOREIGN KEY (assigned_to) REFERENCES ht_people / ALTER TABLE ht_issues ADD CONSTRAINT ht_issues_project_fk FOREIGN KEY (related_project) REFERENCES ht_projects / ALTER TABLE ht_issues ADD CONSTRAINT ht_issues_status_cc CHECK (status in ('Open'.'On-Hold'. END.actual_resolution_date IS NOT NULL THEN :new. END.last_modified_date := sysdate. END IF.' ON column ht_issues.nextval INTO :new. :new.g_user. / CREATE OR REPLACE TRIGGER bu_ht_issues BEFORE UPDATE ON ht_issues FOR EACH ROW BEGIN IF :new.'Closed')) / ALTER TABLE ht_issues ADD CONSTRAINT ht_issues_priority_cc CHECK (priority in ('High'.g_user.user).status := 'Open'.issue_id IS NULL THEN SELECT ht_issues_seq. / COMMENT 'All / COMMENT 'The ON table ht_issues IS issues related to the projects being undertaken by the company.created_date := sysdate.created_by := nvl(wwv_flow. :new.' DDLs and Scripts A-5 . :new. END IF. :new.user).status := 'Closed'. IF :new.

' / COMMENT ON column ht_issues.issue_summary IS 'A brief summary of the issue.' / COMMENT ON column ht_issues.' / COMMENT ON column ht_issues.' / Creating Issues Script The following script populates Issues table for the issue tracking application in "How to Build and Deploy an Issue Tracking Application" on page 12-1.' / COMMENT ON column ht_issues.' / COMMENT ON column ht_issues.created_date IS 'Audit Column: Date the record was created. --.issue_description IS 'A full description of the issue.priority IS 'The priority of the issue. How important it is to get resolved.assigned_to IS 'The person that the issue is assigned to.resolution_summary IS 'The description of the resolution of the issue.' / COMMENT ON column ht_issues.' / COMMENT ON column ht_issues.last_modified_by IS 'Audit Column: The user who last modified the record.identified_date IS 'The date the issue was identified.progress IS 'Any progress notes on the issue resolution.' / COMMENT ON column ht_issues.Creating Issues Script / COMMENT ON column ht_issues.' / COMMENT ON column ht_issues.identified_by IS 'The person who identified the issue.' / COMMENT ON column ht_issues.target_resolution_date IS 'The date on which the issue is planned to be resolved.created_by IS 'Audit Column: The user who created the record.' / COMMENT ON column ht_issues.actual_resolution_date IS 'The date the issue was actually resolved.' / COMMENT ON column ht_issues.' / COMMENT ON column ht_issues.' / COMMENT ON column ht_issues.' / COMMENT ON column ht_issues.Email Integration Issues -INSERT INTO ht_issues A-6 Oracle Database Application Express Advanced Tutorials .last_modified_date IS 'Audit Column: Date the record was last modified.related_project IS 'The project that the issue is related to.status IS 'The current status of the issue.

'') / INSERT INTO ht_issues (issue_id. sysdate-95.''. issue_summary. 'Medium'.Creating Issues Script (issue_id. 'Client software licenses expire for Bangalore call center before cutover'.''. resolution_summary) VALUES (2. 6. issue_description. priority. actual_resolution_date. sysdate-100. applied patch set. status. sysdate-80. assigned_to.'Worked with HW. sysdate-80.sysdate-66. actual_resolution_date.sysdate-95. 'High'. 'Medium'. 'Closed'. '') / INSERT INTO ht_issues (issue_id. actual_resolution_date. assigned_to. priority. identified_date. identified_date. identified_date. target_resolution_date. 3. 'Timezone ambiguity in some EMEA regions is delaying bulk forwarding to mirror sites'. 14. target_resolution_date. issue_summary. identified_by. progress. 3. actual_resolution_date. status. sysdate-70. per acting steward at branch 745'. resolution_summary) VALUES (5. 'Closed'. 13. actual_resolution_date. target_resolution_date.') / INSERT INTO ht_issues (issue_id. related_project. assigned_to. priority. 6. identified_by. 'Low'. 3.''. related_project. target_resolution_date. issue_description. progress. 1. related_project. sysdate-73. ''. applied patch set.''. 'Midwest call center servers have no failover due to Conn Creek plant fire'. resolution_summary) VALUES (3.'') / INSERT INTO ht_issues (issue_id. sysdate-60. priority. assigned_to. 1. identified_by. identified_date. 6.') / -- DDLs and Scripts A-7 . 'Holiday coverage for DC1 and DC3 not allowed under union contract. 'Worked with HW. related_project. sysdate-90. ''. status. ''. sysdate-110. issue_summary. sysdate-100. issue_summary. 6. 6.''. priority. resolution_summary) VALUES (4. 'Closed'. issue_description. target_resolution_date. assigned_to. 'Closed'. status. 'Making steady progress. related_project. progress. sysdate-73. resolution_summary) VALUES (1. issue_description. 3. 'Open'. 'High'. issue_description.'. sysdate-90. identified_by. 13. ''.''. identified_date. 'Some vendor proposals lack selective archiving and region-keyed retrieval sections'. identified_by. issue_summary. status. 3. progress. progress.

''. actual_resolution_date. target_resolution_date. identified_date. 'Medium'. 5. 'Medium'. actual_resolution_date.''. resolution_summary) VALUES (7.''. 5.sysdate-20. sysdate-10. status. issue_summary.Employee Satisfaction Survey Issues -INSERT INTO ht_issues (issue_id. progress. priority. 'Open'. 8. priority. identified_by. 'Need better definition of terms like work group. actual_resolution_date. issue_description. issue_summary. sysdate-10. resolution_summary) VALUES (10. assigned_to. related_project. 'Open'.'') / INSERT INTO ht_issues (issue_id.sysdate-1. progress. assigned_to. issue_summary. issue_description. null. priority. sysdate+20. issue_description. sysdate-30. 5. related_project. department. issue_summary. assigned_to. identified_by. status. and organization for categories F. progress. ''. 'Provide survey FAQs to online newsletter group'. status. status.''. 1. target_resolution_date. identified_date. identified_date. identified_by. 8. sysdate+15. related_project. sysdate-15.''. ''. ''. resolution_summary) VALUES (6. sysdate-8. issue_summary. actual_resolution_date. sysdate+20. priority. 'Medium'. target_resolution_date. related_project. identified_by. assigned_to. identified_by. 11. 'Review rollout schedule with HR VPs/Directors'. and M-W'. assigned_to. issue_description. H.Creating Issues Script -. resolution_summary) VALUES (9. 1. 1. 5.'') / A-8 Oracle Database Application Express Advanced Tutorials . 11.'') / INSERT INTO ht_issues (issue_id. related_project. 'Distribute translated categories and questions for non-English regions to regional team leads'. actual_resolution_date. 'Low'.''. 8. 'Medium'. 'currently beta testing new look and feel'.''. 'Legal has asked for better definitions on healthcare categories for Canadian provincial regs compliance'. sysdate-2. identified_date. 'Closed'. resolution_summary) VALUES (8. progress. 'Closed'. target_resolution_date.''. status. progress. ''. sysdate+10.'') / INSERT INTO ht_issues (issue_id. issue_description. null. priority. 5. identified_date. 'Open'.'') / INSERT INTO ht_issues (issue_id. target_resolution_date.

status. sysdate-30. assigned_to.Creating Issues Script INSERT INTO ht_issues (issue_id. 11. progress. actual_resolution_date. actual_resolution_date. issue_summary. 5. progress. sysdate-145. 'Survey administration consulting firm requires indemnification release letter from HR SVP'. 'Closed'. 9.variance from Corporate requested'. issue_description. ''. status. progress. Safety health-check reports must be signed off before capital asset justification can be approved'. assigned_to. DDLs and Scripts A-9 . 'Closed'. 1. 'High'. 1.sysdate-110. 'Medium'. actual_resolution_date. identified_by. 'Action plan review dates conflict with effectivity of organizational consolidations for Great Lakes region'. ''.''. resolution_summary) VALUES (12.'') / INSERT INTO ht_issues (issue_id. target_resolution_date. issue_description. resolution_summary) VALUES (13. priority. priority. status.'') / INSERT INTO ht_issues (issue_id. assigned_to. 'Facilities. sysdate+45. resolution_summary) VALUES (11.''. resolution_summary) VALUES (15. progress. actual_resolution_date. identified_date. sysdate-9. target_resolution_date. sysdate-30.''. sysdate-90. issue_description. issue_summary. 1. issue_description. progress. identified_date. issue_summary. 'Closed'. identified_by. priority.''. identified_by. issue_description. 1. 'Local regulations prevent Federal contracts compliance on section 3567. '') / --. sysdate-45. identified_by. 4. target_resolution_date. related_project. related_project. target_resolution_date.'') / INSERT INTO ht_issues (issue_id. 4.Internal Infrastructure Issues -INSERT INTO ht_issues (issue_id. priority. actual_resolution_date. status. 4. 'Low'.sysdate-35. status. identified_by. sysdate-100. ''. priority. issue_summary. 4. related_project. 11. sysdate-15. identified_date. identified_date. ''. 'Cooling and Power requirements exceed 90% headroom limit -. assigned_to. issue_summary. related_project. 'Open'. target_resolution_date. 'Medium'. identified_date.''.106B'. related_project. assigned_to. 5.''. sysdate-17. resolution_summary) VALUES (14.

status. resolution_summary) VALUES (16. sysdate-30. sysdate-100. actual_resolution_date. 'On-Hold'.sysdate-85. 2. ''. issue_summary. issue_summary. assigned_to. related_project. identified_date.''. sysdate-5. 5. 1. 5. actual_resolution_date. 2. status. status. priority. sysdate-35. 10. sysdate+10. identified_by. status. 'Open'. priority. 'Expat exception reports must be hand-reconciled until auto-post phaseout complete'. 'Closed'. identified_by.''. 'Medium'. actual_resolution_date. issue_description. issue_description. identified_by.'') / --. related_project.'') / INSERT INTO ht_issues (issue_id. target_resolution_date. related_project. progress. identified_date. 2. 'pending info from supplier'.''. issue_description. priority. 12. 5.sysdate-1.'') / INSERT INTO ht_issues (issue_id. assigned_to. null. sysdate+4. issue_description. identified_date. 12. 'High'. issue_description. ''. identified_by. resolution_summary) VALUES (19. actual_resolution_date. actual_resolution_date. related_project. 'Closed'.''. assigned_to. 'High'. issue_summary. issue_summary. priority.New Payroll Rollout Issues -INSERT INTO ht_issues (issue_id. sysdate-17. progress. resolution_summary) VALUES A-10 Oracle Database Application Express Advanced Tutorials .''. priority.''. related_project.sysdate-4. 'Semi-monthly ISIS feed exceeds bandwidth of Mississauga backup site'. identified_by. ''. identified_date. 'Emergency Response plan failed county inspector''s review at buildings 2 and 5'. ''. progress. 5. assigned_to. 'Training for call center 1st and 2nd lines must be staggered across shifts'.Creating Issues Script 1.'') / INSERT INTO ht_issues (issue_id. target_resolution_date. 4. sysdate-8. resolution_summary) VALUES (18. target_resolution_date. assigned_to. 'High'. status. 'Medium'.'') / INSERT INTO ht_issues (issue_id. progress. resolution_summary) VALUES (17. issue_summary. target_resolution_date. sysdate-82. target_resolution_date. 'Closed'. identified_date. progress.

issue_summary. actual_resolution_date. sysdate-7. identified_date. priority.''. priority. ''. resolution_summary) VALUES (21. 'Open'. 'Review security architecture plan with consultant'.'') / INSERT INTO ht_issues (issue_id. sysdate-45. issue_description. progress.''. target_resolution_date. ''. related_project. 'Some preferred domain names are unavailable in registry'. 'Open'. identified_by.Public Website Operational Issues -INSERT INTO ht_issues (issue_id.''. priority. DDLs and Scripts A-11 . 'High'. issue_summary. issue_description.''. related_project. assigned_to. 15. 5. 'High'. sysdate+15. sysdate-45. 1. assigned_to. priority. target_resolution_date. 4. identified_date. resolution_summary) VALUES (25. actual_resolution_date. sysdate-55. issue_summary. sysdate-21. assigned_to. progress. target_resolution_date.''. progress. identified_date.'') / INSERT INTO ht_issues (issue_id. identified_date. 'Multi-region batch trial run schedule and staffing plan due to directors by end of phase review'. actual_resolution_date. ''. identified_by. 7. resolution_summary) VALUES (23. ''. 'Evaluate vendor load balancing proposals against capital budget'. 4. issue_description. target_resolution_date. progress. identified_date. issue_summary. identified_by. status.sysdate-40. sysdate-60. target_resolution_date. issue_summary. 'High'. related_project. assigned_to. 7. sysdate-45.'') / --. 2. related_project. resolution_summary) VALUES (24. status.sysdate-50. ''. 5. null. actual_resolution_date. 7. sysdate. 'Auditors'' signoff requires full CSB compliance report'. 4.''.sysdate-43. progress.Creating Issues Script (20. identified_by. status. 'Establish grid management capacity-expansion policies with ASP'.''.'') / INSERT INTO ht_issues (issue_id. 'Closed'. assigned_to. resolution_summary) VALUES (22. identified_by. issue_description. priority.'') / INSERT INTO ht_issues (issue_id. 'Medium'. related_project. status. 'High'. 2. sysdate-50. 5. status. actual_resolution_date. 'Closed'.''. 'Closed'. issue_description. 7.

Creating Issues Script 7.''. identified_by. issue_summary. 7.'') / INSERT INTO ht_issues (issue_id. status. sysdate-10. sysdate. this may drag on. sysdate-20.'') / A-12 Oracle Database Application Express Advanced Tutorials . 'Open'. issue_description. sysdate-5. status. ''. 'High'.''.'') / INSERT INTO ht_issues (issue_id. identified_date. 'Access through proxy servers blocks some usage tracking tools'.''. issue_description.''. 'Closed'. identified_by. target_resolution_date. ''. 17. identified_by. 'Phase I stress testing cannot use production network'. actual_resolution_date. 17. 7.'. 'DoD clients must have secure port and must be blocked from others'. 'Open'. identified_date. priority. related_project.''. progress. resolution_summary) VALUES (26. 'Medium'. 4. sysdate-5. 15. sysdate-11. sysdate. actual_resolution_date. issue_description. actual_resolution_date. 'On-Hold'. related_project. target_resolution_date. 4. assigned_to. 4.sysdate-1. 7. resolution_summary) VALUES (27. 16. issue_summary. 4. target_resolution_date. priority. 'High'. issue_summary. progress. progress. assigned_to. identified_date. 'High'.'') / INSERT INTO ht_issues (issue_id. sysdate-20. priority. status.''. 'Waiting on Security Consultant. resolution_summary) VALUES (28. related_project. ''. assigned_to.

Creating Issues Script DDLs and Scripts A-13 .

Creating Issues Script A-14 Oracle Database Application Express Advanced Tutorials .

Sign up to vote on this title
UsefulNot useful