Download pdf - APEX Developing Web Apps

Transcript
Page 1: APEX Developing Web Apps

Oracle Application Express: Developing Web Applications

Volume II • Activity Guide

D56782GC20

Edition 2.0

November 2010

D69856

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 2: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Disclaimer This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle. The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free. Restricted Rights Notice If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract. Trademark Notice Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Authors Marcie Young, Salome Clement

Technical Contributors and Reviewers Anthony Rayner, Bryan Roberts, Chaitanya Koratamaddi, Christina Cho, Christopher Wensley, Drue Baker, Ganesh Pitchaiah, Hailing Huang, Hilary Farrell, Iloon Ellen, Jason Straub, Jean-Paul Fillon, Joel Kallman, Linda Ross, Nancy Greenberg, Madhavi Siddireddy, Maria Billings, Matthew Gregory, Michael Hichwa, Patrick Wolf, Sharon Kennedy, Terri Jennings, Yi Lu, Wayne Abbott

This book was published using: Oracle Tutor

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 3: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Oracle Application Express: Developing Web Applications - Table of Contents i

Table of Contents

Practices for Lesson 1: Course Overview .....................................................................................................1-1 Practices for Lesson 1 ....................................................................................................................................1-3

Practices for Lesson 2: Introduction to Oracle Application Express ..........................................................2-1 Practices for Lesson 2 ....................................................................................................................................2-3 Practice 2-1: Using Oracle Application Express as a Workspace Administrator ............................................2-4 Practice 2-2: Using Oracle Application Express as a Developer ....................................................................2-5 Practice Solution 2-1: Using Oracle Application Express as a Workspace Administrator ..............................2-6 Practice Solution 2-2: Using Oracle Application as a Developer ....................................................................2-9

Practices for Lesson 3: Interacting with the Database by Using SQL Workshop ......................................3-1 Practices for Lesson 3 ....................................................................................................................................3-3 Practice 3-1: Using Object Browser ...............................................................................................................3-4 Practice 3-2: Using SQL Commands, SQL Scripts, and Query Builder ..........................................................3-5 Practice 3-3: Using Utilities ............................................................................................................................3-6 Practice Solution 3-1: Using Object Browser .................................................................................................3-7 Practice Solution 3-2: Using SQL Commands, SQL Scripts, and Query Builder ............................................3-19 Practice Solution 3-3: Using Utilities ..............................................................................................................3-32

Practices for Lesson 4: Building a Database Application ............................................................................4-1 Practices for Lesson 4 ....................................................................................................................................4-3 Practice 4-1: Creating an Application from a Spreadsheet .............................................................................4-4 Practice 4-2: Creating Applications from Scratch ...........................................................................................4-5 Practice Solution 4-1: Creating an Application from a Spreadsheet ...............................................................4-6 Practice Solution 4-2: Creating Applications from Scratch .............................................................................4-16

Practices for Lesson 5: Creating Reports ......................................................................................................5-1 Practices for Lesson 5 ....................................................................................................................................5-3 Practice 5-1: Building and Manipulating an Interactive Report .......................................................................5-4 Practice 5-2: Customizing Your Interactive Report.........................................................................................5-5 Practice 5-3: Creating a SQL Report ..............................................................................................................5-6 Practice 5-4: Creating a Wizard Report ..........................................................................................................5-7 Practice Solution 5-1: Building and Manipulating an Interactive Report .........................................................5-8 Practice Solution 5-2: Customizing an Interactive Report ..............................................................................5-42 Practice Solution 5-3: Creating a SQL Report ................................................................................................5-52 Practice Solution 5-4: Creating a Wizard Report ............................................................................................5-60

Practices for Lesson 6: Creating Forms ........................................................................................................6-1 Practices for Lesson 6 ....................................................................................................................................6-3 Practice 6-1: Creating a Form on a Table ......................................................................................................6-4 Practice 6-2: Creating a Master Detail Form ..................................................................................................6-5 Practice 6-3: Creating a Tabular Form ...........................................................................................................6-6 Practice Solution 6-1: Creating a Form on a Table ........................................................................................6-7 Practice Solution 6-2: Creating a Master Detail Form ....................................................................................6-20 Practice Solution 6-3: Creating a Tabular Form .............................................................................................6-36

Practices for Lesson 7: Working with Pages and Regions ..........................................................................7-1 Practices for Lesson 7 ....................................................................................................................................7-3 Practice 7-1: Working with Pages and Regions .............................................................................................7-4 Practice Solution 7-1: Working with Pages and Regions ...............................................................................7-6

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 4: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Oracle Application Express: Developing Web Applications - Table of Contents ii

Practices for Lesson 8: Understanding Session State and Debugging ......................................................8-1 Practices for Lesson 8 ....................................................................................................................................8-3 Practice 8-1: Understanding Session State ....................................................................................................8-4 Practice 8-2: Debugging Your Application ......................................................................................................8-5 Practice Solution 8-1: Understanding Session State ......................................................................................8-6 Practice Solution 8-2: Debugging Your Application ........................................................................................8-24

Practices for Lesson 9: Adding Items and Buttons ......................................................................................9-1 Practices for Lesson 9 ....................................................................................................................................9-3 Practice 9-1: Adding Items and Buttons .........................................................................................................9-4 Practice 9-2: Manipulating Items ....................................................................................................................9-5 Practice 9-3: Create an Upload and Download Page .....................................................................................9-7 Practice Solution 9-1: Adding Items and Buttons ...........................................................................................9-8 Practice Solution 9-2: Manipulating Items ......................................................................................................9-27 Practice Solution 9-3: Create an Upload and Download Page .......................................................................9-51

Practices for Lesson 10: Including Page Processing ...................................................................................10-1 Practices for Lesson 10 ..................................................................................................................................10-3 Practice 10-1: Creating and Manipulating Computations, Processes, and Validations ..................................10-4 Practice Solution 10-1: Creating and Manipulating Computations, Processes, and Validations ....................10-6

Practices for Lesson 11: Using Application and Page Utilities....................................................................11-1 Practices for Lesson 11 ..................................................................................................................................11-3 Practice 11-1: Use the Advisor .......................................................................................................................11-4 Practice 11-2: Manage Your Attribute Dictionary ...........................................................................................11-5 Practice Solution 11-1: Using the Advisor ......................................................................................................11-6 Practice Solution 11-2: Manage Your Attribute Dictionary .............................................................................11-13

Practices for Lesson 12: Adding Shared Components That Aid Navigation ..............................................12-1 Practices for Lesson 12 ..................................................................................................................................12-3 Practice 12-1: Creating Lists and List Regions ..............................................................................................12-4 Practice 12-2: Creating and Editing Standard Tabs .......................................................................................12-5 Practice 12-3: Managing Help Text in Your Application .................................................................................12-6 Practice 12-4: Adding Navigation Bar Entries ................................................................................................12-7 Practice 12-5: Adding Breadcrumbs and Tabs to an Existing Page ...............................................................12-8 Practice Solution 12-1: Creating Lists and List Regions .................................................................................12-9 Practice Solution 12-2: Creating and Editing Standard Tabs .........................................................................12-16 Practice Solution 12-3: Managing Help Text in Your Application ...................................................................12-22 Practice Solution 12-4: Adding Navigation Bar Entries ..................................................................................12-29 Practice Solution 12-5: Adding Breadcrumbs and Tabs to an Existing Page .................................................12-39

Practices for Lesson 13: Displaying Dynamic Content ................................................................................13-1 Practices for Lesson 13 ..................................................................................................................................13-3 Practice 13-1: Using Dynamic Actions on Your Page ....................................................................................13-4 Practice 13-2: Importing and Using the Star Rating Plug-In ...........................................................................13-6 Practice 13-3: Creating and Modifying Flash Charts ......................................................................................13-7 Practice 13-4: Creating a Calendar ................................................................................................................13-8 Practice 13-5: Creating a Tree Whose Nodes Link to a Different Page .........................................................13-9 Practice Solution 13-1: Using Dynamic Actions on Your Page ......................................................................13-10 Practice Solution 13-2: Importing and Using the Star Rating Plug-In .............................................................13-35 Practice Solution 13-3: Creating and Modifying Flash Charts ........................................................................13-46

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 5: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Oracle Application Express: Developing Web Applications - Table of Contents iii

Practice Solution 13-4: Adding a Calendar ....................................................................................................13-59 Practice Solution 13-5: Creating a Tree Whose Nodes Link to a Different Page ...........................................13-70

Practices for Lesson 14: Working with Themes, Templates, and Files .......................................................14-1 Practices for Lesson 14 ..................................................................................................................................14-3 Practice 14-1: Working with Themes, Templates, and Files ..........................................................................14-4 Practice Solution 14-1: Working with Themes, Templates, and Files.............................................................14-6

Practices for Lesson 15: Administering Oracle Application Express Workspaces ...................................15-1 Practices for Lesson 15 ..................................................................................................................................15-3 Practice 15-1: Administering Oracle Application Express Workspaces ..........................................................15-4 Practice Solution 15-1: Administering Oracle Application Express Workspaces ............................................15-5

Practices for Lesson 16: Implementing Security ..........................................................................................16-1 Practices for Lesson 16 ..................................................................................................................................16-3 Practice 16-1: Creating an Authentication Scheme ........................................................................................16-4 Practice 16-2: Restricting Users by Using Access Control .............................................................................16-5 Practice 16-3: Enabling Session State Protection ..........................................................................................16-6 Practice Solution 16-1: Creating an Authentication Scheme ..........................................................................16-7 Practice Solution 16-2: Restricting Users by Using Access Control ...............................................................16-12 Practice Solution 16-3: Enabling Session State Protection ............................................................................16-29

Practices for Lesson 17: Building a Websheet Application .........................................................................17-1 Practices for Lesson 17 ..................................................................................................................................17-3 Practice 17-1: Creating and Modifying a Websheet Application .....................................................................17-4 Practice 17-2: Adding and Manipulating a Data Grid and Report ...................................................................17-5 Practice 17-3: Adding and Manipulating Sections in a Page ..........................................................................17-6 Practice 17-4: Sharing Websheets Between Users ........................................................................................17-7 Practice Solution 17-1: Creating and Modifying a Websheet Application .......................................................17-8 Practice Solution 17-2: Adding and Manipulating a Data Grid and Report .....................................................17-20 Practice Solution 17-3: Adding and Manipulating Sections in a Page ............................................................17-43 Practice Solution 17-4: Sharing Websheets Between Users ..........................................................................17-56

Practices for Lesson 18: Deploying Your Application ..................................................................................18-1 Practices for Lesson 18 ..................................................................................................................................18-3 Practice 18-1: Deploying Your Application .....................................................................................................18-4 Practice Solution 18-1: Deploying Your Application .......................................................................................18-5

Practices for Lesson 19: Managing and Maintaining the Application Development Process ...................19-1 Practices for Lesson 19 ..................................................................................................................................19-3 Practice 19-1: Adding Features and Milestones to Your Development Project ..............................................19-4 Practice 19-2: Adding and Monitoring Feedback in Your Application .............................................................19-6 Practice Solution 19-1: Adding Milestones and Features to Your Development Project ................................19-7 Practice Solution 19-2: Adding and Monitoring Feedback in Your Application ...............................................19-23

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 6: APEX Developing Web Apps

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 7: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Oracle Application Express: Developing Web Applications - Table of Contents v

Preface

Profile Before you begin this course, you should be familiar with SQL and PL/SQL.

How This Course Is Organized Oracle Application Express: Developing Web Applications is an instructor-led course featuring lectures and hands-on exercises. Online demonstrations and written practice sessions reinforce the concepts and skills introduced.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 8: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Oracle Application Express: Developing Web Applications - Table of Contents vi

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 9: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 1

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 10: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 2

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 11: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 3

Practices for Lesson 12

Practices Overview There are five practices for this lesson. You create a list and list region, create and edit tabs, manage help text, add a navigation bar entry, and add a breadcrumb.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 12: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 4

Practice 12-1: Creating Lists and List Regions

Overview Create a list of links that aid navigation. Using these links, a user will be able to navigate to the Customers, Products, and Orders pages.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB112_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. In the Order Management application, create a list called Home Page List with the

following list entries:

• View Customers (linked to the Customers page)

• View Products (linked to the Products page)

• View Orders (linked to the Orders page)

b. Create a list sub region called Tasks in the Home region.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 13: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 5

Practice 12-2: Creating and Editing Standard Tabs

Overview In this practice, you change the order in which the standard tabs are sequenced in the application. You also create a Help page and a Help tab to add to the existing tab set.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB121_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. Change the order of the tabs so that the Products tab is before (to the left) of the

Customers tab.

b. Create a page called Help, and then add a new tab called Help, to the existing tab set. The new Help tab will link to the new Help page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 14: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 6

Practice 12-3: Managing Help Text in Your Application

Overview In this practice, you create a help text region on the Help page. Add help text to a page, seed the help text for all items (and set default item help text) within your application, and show how the item-level help text works.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB122_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. Create a help text region called Help on the Help page.

b. Change the help text for the Customers page to the following (located in /home/oracle/labs/scripts/lab13-1.txt):

This page provides information about customers.

c. Seed all the item help text currently defined and enter the following default help text if no item help text is available (located in /home/oracle/labs/scripts/lab13-2.txt):

You are currently using the Order Management application. Enter a value for this item

d. Run the page and select some of the labels on the Customer Details page to see the help text.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 15: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 7

Practice 12-4: Adding Navigation Bar Entries

Overview In this practice, you add a navigation bar entry that, when clicked, will show the page-level help. You also modify the name of an existing navigation bar entry and add another navigation bar entry that is displayed on all pages except the page that it navigates to.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB123_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. Create a navigation bar entry called Help that navigates to the Help page. Make sure

that the Request parameter is set to &APP_PAGE_ID. so that when clicked it will display the help text for the page that you are currently on. Run the page and click the Help navigation bar entry.

b. Change the name of the navigation bar entry for Logout to Sign Off.

c. Add a navigation bar entry called Home. Display the navigation bar entry on all pages except the Home page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 16: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 8

Practice 12-5: Adding Breadcrumbs and Tabs to an Existing Page

Overview In this practice, you create a breadcrumb and add a tab set to an existing page.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB124_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. On the Customer Details page, create a breadcrumb called Customer Details whose

parent entry is Customers (page 2).

b. Associate the tab set to the Customer Details page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 17: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 9

Practice Solution 12-1: Creating Lists and List Regions

Overview Create a list of links that aid navigation. Using these links, a user will be able to navigate to the Customers, Products, and Orders pages.

Tasks a. In the Order Management application, create a list called Home Page List with the

following list entries:

• View Customers (linked to the Customers page)

• View Products (linked to the Products page)

• View Orders (linked to the Orders page)

1) Navigate to your Order Management application home page and select Shared Components.

2) Under the Navigation section, click Lists.

3) Click Create.

4) For Name, enter Home Page List and click Create.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 18: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 10

5) Select Home Page List, which you just created.

6) To begin creating the different list entries, click Create List Entry.

7) Enter View Customers in the List Entry Label field and click the icon to the right of the Page field and select Customers from the different pages displayed. Then click Create and Create Another.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 19: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 11

8) Enter View Products in the List Entry Label field and click the icon to the right of the Page field and select Products from the different pages displayed. Then click Create and Create Another.

9) Enter List of Orders and click the icon to the right of the Page field and select List of Orders from the different pages displayed. Then click Create.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 20: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 12

10) Search for page 1 in your Order Management Application.

b. Create a list sub region called Tasks in the Home region.

1) From the Home page definition, right-click the Home region and select Create Sub Region.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 21: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 13

2) Select the List option, and click Next.

3) For Title, enter Tasks and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 22: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 14

4) From the List drop-down list, select Home Page List and click Create List Region.

5) To view the list, run the page. Click Run.

6) The list is displayed. In the next practice, you will modify the tabs. Click the Edit Page link in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 23: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 15

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 24: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 16

Practice Solution 12-2: Creating and Editing Standard Tabs

Overview In this practice, you change the order in which the standard tabs are sequenced in the application. You also create a Help page and a Help tab to add to the existing tab set.

Tasks a. Change the order of the tabs so that the Products tab is before (to the left) of the

Customers tab.

1) Click the Shared Components icon in the upper-right of the window.

2) In the Navigation region, click Tabs.

3) Click the Edit Standard Tabs tab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 25: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 17

4) Switch the sequences of Customers and Products by changing their sequence numbers. Change T_CUSTOMERS to 30 and T_PRODUCTS to 20. Then click Apply Changes.

5) Run the page. Click the Run Page icon.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 26: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 18

6) Note that the order of tabs has changed. Click the Application link in the Developer toolbar.

b. Create a page called Help, and then add a new tab called Help, to the existing tab set. The new Help tab will link to the new Help page.

1) You want to create a new page that will contain the help information. Click Create Page.

2) Select Blank page and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 27: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 19

3) Click Next.

4) For Name, enter Help and click Next.

5) Select the Yes - Use an existing tab set and create a new tab within the existing tab set option and then click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 28: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 20

6) Ensure that the TS1 tab set is selected in the Existing Tab Set drop-down list and click Next.

7) Enter Help in the Tab Label field and click Next.

8) Click Finish.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 29: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 21

9) Run the page to see the new tab. Click Run Page.

10) The tab is displayed. In the next practice, you add a region to the Help Page and add it as a navigation bar entry. Click the Edit Page link in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 30: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 22

Practice Solution 12-3: Managing Help Text in Your Application

Overview In this practice, you create a help text region on the Help page. Add help text to a page, seed the help text for all items (and set the default item help text) within your application, and show how the item-level help text works.

Tasks a. Create a help text region called Help on the Help page.

1) On the Help page, right-click Regions and select Create.

2) Select the Help Text option and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 31: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 23

3) For Title, enter Help and click Next.

4) Click Create Region.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 32: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 24

5) Navigate to the page definition for the Customers page. Enter 2 for Page and click Go.

b. Change the help text for the Customers page to the following (located in /home/oracle/labs/scripts/lab12-1.txt):

This page provides information about customers.

1) Under Page Rendering, right-click Customers and select Edit.

2) Select the Help tab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 33: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 25

3) Replace the Help Text text with This page provides information about customers and click Apply Changes.

c. Seed all the item help text currently defined and enter the following default help text if no item help text is available (located in /home/oracle/labs/scripts/lab12-2.txt):

You are currently using the Order Management application. Enter a value for this item

1) To edit multiple item help topics at the item level, click the Application Utilities icon in the upper-right of the window.

2) Under Page Specific Utilities, select Item Utilities.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 34: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 26

3) Click the Grid Edit of all Item Help Text link.

4) You want the help text listed to be the item help for the item. Click Seed Item Help Text.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 35: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 27

5) If no Help Text is defined for an item, you want to define a default help text. In the Default Help Text field, enter You are currently using the Order Management application. Enter a value for this item and click Apply Changes.

d. Run the page and select some of the labels on the Customer Details page to see the help text.

1) To see the results, click the Run Page icon.

2) Click the Edit icon for one of the customer rows.

3) Click the Country label to show the help text.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 36: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 28

4) The help text is displayed. Click Close. Note: The default help text appears only if the help text is not already specified for a particular item.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 37: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 29

Practice Solution 12-4: Adding Navigation Bar Entries

Overview In this practice, you add a navigation bar entry that, when clicked, will show the page-level help. You also modify the name of an existing navigation bar entry and add another navigation bar entry that is displayed on all pages except the page that it navigates to.

Tasks a. Create a Navigation bar entry called Help that navigates to the help page. Make sure

that the Request parameter is set to &APP_PAGE_ID. so that when clicked it will display the help text for the page that you are currently on. Run the page and click the Help navigation bar entry.

1) You want to create a navigation bar entry to show the page-level help text. Click the Edit Page link in the Developer toolbar.

2) Click the Shared Components icon.

3) Under Navigation, click Navigation Bar Entries.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 38: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 30

4) Click Create.

5) Make sure that From Scratch is selected and click Next.

6) Select Navigation to URL and click Next.

7) For Entry Label, enter Help and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 39: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 31

8) Click the icon to the right of the Page field.

9) From the list that is displayed, select Help.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 40: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 32

10) In Request, enter &APP_PAGE_ID. (including the period) and click Next. Note: By specifying the &APP_PAGE_ID. bind variable as the request, you are instructing the Oracle Application Express engine to display the help text for the current page when the user clicks the navigation bar entry link.

11) Click Create.

12) Click the Run Page icon.

13) Click Cancel to return to the Customers page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 41: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 33

14) To see help for the Customers page, click the Help link on the navigation bar.

15) The page help text is displayed. You want to change the Logout navigation bar entry. Click the Edit Page link in the Developer toolbar.

16) Click the Shared Components icon.

b. Change the name of the navigation bar entry for Logout to Sign Off.

1) In the Navigation region, click the Navigation Bar Entries link.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 42: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 34

2) Click the Logout icon.

3) In the Image Attributes region, change the Entry Label and Icon Image Alt text to Sign Off and click Apply Changes.

4) Click the Run icon. Note that the Logout link is now renamed Sign Off.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 43: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 35

5) Notice that the navigation item name has changed. You now want to create another navigation bar entry labeled Home that is not displayed on the Home page. Click the Edit Page link in the Developer toolbar.

6) Click Shared Components.

c. Add a navigation bar entry called Home. Display the navigation bar entry on all pages except the Home page.

1) In the Navigation region, click the Navigation Bar Entries link.

2) Click Create.

3) Ensure that the From Scratch option is selected. Click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 44: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 36

4) Select Navigation to URL and click Next.

5) Enter 05 for the Sequence, and For Entry Label and Image ALT enter Home. Then click Next.

6) Click the icon next to Page.

7) Select Home.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 45: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 37

8) Click Next

9) From the list of links below the Condition Type drop-down list, click [page not in]. In Expression 1, enter 1 and click Create.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 46: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 38

10) Click the Run Page icon.

11) Note that the Home link is displayed at the top of the page. Click the Home tab.

12) You see that the Home link is no longer displayed in the Navigation bar list. Select the Customers tab.

13) Notice that the Home navigation bar entry is displayed again. Click the Edit icon for one of the rows.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 47: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 39

Practice Solution 12-5: Adding Breadcrumbs and Tabs to an Existing Page

Overview In this practice, you create a breadcrumb and add a tab set to an existing page.

Tasks a. On the Customer Details page, create a breadcrumb called Customer Details whose

parent entry is Customers (page 2).

1) The Customer Details page does not have any breadcrumbs. You want to add one that has a parent entry to the Customers report on page 2. Click the Edit Page link in the Developer toolbar.

2) Right-click Regions and select Create.

3) Select Breadcrumb for type and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 48: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 40

4) Accept the defaults and click Next.

5) Accept the defaults and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 49: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 41

6) Enter Customer Details for Breadcrumb Entry Label, select Customers (2) for Parent Entry, and click Next.

7) Click Finish.

8) Click Run Page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 50: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 42

9) Notice that the breadcrumb is now displayed. Next, you want to add the tabs to this page. Click the Edit Page link in the Developer toolbar.

b. Associate the tab set to the Customer Details page.

1) Right-click the Customer Details page properties and select Edit.

2) Under Display Attributes, select TS1 (Home, Products, Customers) from the Standard Tab Set list and click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 51: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 43

3) Run the page. The tabs are now displayed.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 52: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Adding Shared Components That Aid Navigation

Chapter 12 - Page 44

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 53: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 1

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 54: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 2

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 55: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 3

Practices for Lesson 13

Practices Overview There are five practices for this lesson. In these practices, you examine how dynamic actions, plug-ins, charts, calendars, and trees work.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 56: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 4

Practice 13-1: Using Dynamic Actions on Your Page

Overview In this practice, you create the following dynamic actions:

• Standard dynamic action that shows the Commission Pct item if the value for Job Id is equal to SA_REP.

• Advanced dynamic action that sets the value of Location when the Department changes.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB125_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. Create a new form page with a report page on the OEHR_EMPLOYEES table. Name the

report Employee List. The report contains FIRST_NAME, LAST_NAME, EMAIL, and JOB_ID. Create a new tab called Employees in the current tab set. The form name is Employee Details, and it contains all the columns; allows insert, update, and delete; and uses the default primary key and trigger. Test your pages.

b. On the Employee Details page, change the P<n>_JOB_ID item to a select list based on the following query (located in /home/oracle/labs/scripts/lab13-1.txt):

select distinct JOB_ID display_value, JOB_ID return_value

from OEHR_EMPLOYEES

order by 1

c. Create a standard show/hide dynamic action, called JOB EQUALS SALES REP, on the P<n>_JOB_ID item, where, if the value of the item is SA_REP, the P<n>_COMMISSION_PCT item is displayed. Test the page.

d. Create a new display-only item called P<n>_LOCATION whose value is saved to session state.

e. Change the P<n>_DEPARTMENT_ID item to a select list based on the following query (located in /home/oracle/labs/scripts/lab13-2.txt):

select distinct DEPARTMENT_NAME display_value, DEPARTMENT_ID return_value

from OEHR_DEPARTMENTS

order by 1

f. Create an advanced dynamic action, called P<n>_LOCATION, that will set the value of the new item that you created when the value of P<n>_DEPARTMENT_ID changes. The value of P<n>_LOCATION should be set by using the following SQL statement

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 57: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 5

(located in /home/oracle/labs/scripts/lab13-3.txt) with P<n>_DEPARTMENT_ID being the page item to submit. Test your page.

select l.city from oehr_locations l, oehr_departments d

where l.location_id = d.location_id and

d.department_id=:P<n>_DEPARTMENT_ID

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 58: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 6

Practice 13-2: Importing and Using the Star Rating Plug-In

Overview In this practice, you import the Star Rating plug-in into your application and add it as an item on your page.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB131_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. Add a new column to the OEHR_EMPLOYEES table by using the following SQL

command (located in /home/oracle/labs/scripts/lab13-4.txt):

alter table "OEHR_EMPLOYEES" add

("RATING" NUMBER(2,0))

/

b. Import the Star Rating plug-in by using the item_type_plugin_com_oracle_star_rating.sql file from the /home/oracle/labs/files directory.

c. Create a plug-in Item called P<n>_RATING that uses the Star Rating plug-in. Accept the default settings. Store the value of the item in the RATING column. Test your page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 59: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 7

Practice 13-3: Creating and Modifying Flash Charts

Overview In this practice, you create a new chart page with a Horizontal Bar – 3D Bar Chart. You then modify the chart and change it to a 3D Column Chart and change some of the settings to see how they work.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB132_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. Create a new Flash chart page that includes a Horizontal Bar - 3D Bar Chart. Use

“Employees by Department” for the Title, “Number of Employees” for the X-Axis, and “Departments” for the Y-Axis. Use the following query (located in /home/oracle/labs/scripts/lab13-5.txt). Test your page.

select null link,

department_name chart_label,

count(*) chart_value

from oehr_employees e,

oehr_departments d

where e.department_id = d.department_id

group by department_name

b. Modify your chart and change it to a 3D Column Chart with look 7. Add X-Axis scrollbars, enter 45 for the X-Axis label rotation, reverse the X and Y axes titles, and set the Max Y Axis to 20. Test your page. Create a help text region called Help on the Help page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 60: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 8

Practice 13-4: Creating a Calendar

Overview In this practice, you create a calendar on the List of Orders page that displays the order total per day. You also link to the Master Detail page for the Order selected.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB133_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. On the List of Orders page, create a new Easy Calendar calendar region called Order

Calendar. Change the sequence number to 5 so that it appears at the top of the page. Base the calendar on the OEHR_ORDERS table and set the Date Column to ORDER_DATE and Display Column to ORDER_TOTAL. Test your page.

b. Add a column link that links to the Master Detail page. Test your page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 61: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 9

Practice 13-5: Creating a Tree Whose Nodes Link to a Different Page

Overview In this practice, you create a new page with a tree region and link to the Employee Details page. Add a button on the Employee Details back to the tree page.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB134_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. Create a Tree Page called “Employees by Manager” that uses the default tree

template. Select the appropriate options in the wizard so that the current query (located in /home/oracle/labs/scripts/lab13-6.txt) looks as follows: <n> is the page number for the Employee Details page.

select case when connect_by_isleaf = 1 then 0

when level = 1 then 1

else -1

end as status,

level,

"LAST_NAME" as title,

null as icon,

"EMPLOYEE_ID" as value,

"EMPLOYEE_ID" as tooltip,

'f?p=&APP_ID.:<n>:'||:APP_SESSION||'::::P<n>_EMPLOYEE_ID:'||"EMPLOYEE_ID" as link

from "#OWNER#"."OEHR_EMPLOYEES"

start with "MANAGER_ID" is null

connect by prior "EMPLOYEE_ID" = "MANAGER_ID"

order siblings by "LAST_NAME"

b. Add a button to the Employee Details page called Employee Hierarchy that navigates to the “Employees by Manager” tree page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 62: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 10

Practice Solution 13-1: Using Dynamic Actions on Your Page

Overview In this practice, you create the following dynamic actions:

• Standard dynamic action that shows the Commission Pct item if the value for Job Id is equal to SA_REP.

• Advanced dynamic action that sets the value of Location when the Department changes.

Tasks a. Create a new form page with a report page on the OEHR_EMPLOYEES table. Name the

report Employee List. The report contains FIRST_NAME, LAST_NAME, EMAIL, and JOB_ID. Create a new tab called Employees in the current tab set. The form name is Employee Details, and it contains all the columns; allows insert, update, and delete; and uses the default primary key and trigger. Test your pages.

1) Navigate to your Order Management application home page and click Create Page.

2) Select Form and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 63: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 11

3) Select Form on a Table with Report and click Next.

4) Accept the defaults and click Next.

5) Enter OEHR_EMPLOYEES for Table Name and click Next.

6) Enter Employee List for Page Name and Region Title and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 64: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 12

7) Select Use an existing tab set and create a new tab within the existing tab set for Tab Options. Select TS1 for Tab Set, enter Employees for the New Tab Label, and click Next.

8) Ctrl-click to select FIRST_NAME, LAST_NAME, EMAIL, and JOB_ID from the list and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 65: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 13

9) Accept the default edit link image and click Next.

10) Enter Employee Details for Page Name and Region Title and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 66: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 14

11) Accept the default primary key and click Next.

12) Accept the default source for the primary key column and click Next.

13) Use Ctrl-click to select all the columns and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 67: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 15

14) Accept the defaults and click Next.

15) Click Finish.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 68: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 16

16) Click Run Page.

17) The Employee List report is displayed. Click the Edit icon for one of the rows.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 69: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 17

18) The Employee Details page is displayed. You want to create a dynamic action that will show the Commission Pct item only if the value of Job Id is SA_REP. Click the Edit Page link in the Developer toolbar.

b. On the Employee Details page, change the P<n>_JOB_ID item to a select list based on the following query (located in /home/oracle/labs/scripts/lab13-1.txt):

select distinct JOB_ID display_value, JOB_ID return_value

from OEHR_EMPLOYEES

order by 1

1) You first want to make the Job Id field a select list. Right-click P<n>_JOB_ID and select Edit.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 70: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 18

2) For the Display As field, click the Select List quick pick link and click the List of Values tab.

3) Enter the following SQL (located in /home/oracle/labs/scripts/lab13-1.txt) in the “List of values definition” field and click Apply Changes

select distinct JOB_ID display_value, JOB_ID return_value

from OEHR_EMPLOYEES

order by 1

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 71: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 19

c. Create a standard show/hide dynamic action, called JOB EQUALS SALES REP, on the P<n>_JOB_ID item, where, if the value of the item is SA_REP, the P<n>_COMMISSION_PCT item is displayed. Test the page.

1) Now you can create a dynamic action on the P<n>_JOB_ID item. Right-click P<n>_JOB_ID and select Create Dynamic Action.

2) Select Standard and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 72: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 20

3) Enter JOB EQUALS SALES REP for Name and click Next.

4) Notice that the Item is prepopulated for you. Enter SA_REP for the Value and click Next.

5) Because you want the Commission Pct column to show when Job is equal to SA_REP, select Show for “Specify the True Action,” make sure that the check box for Create Opposite False Action is checked, and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 73: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 21

6) Select Item(s) for Selection Type, select P<n>_COMMISSION_PCT from the list of items, and click the Move icon.

7) Click Create.

8) You can run the page to see the results. Click Run.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 74: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 22

9) Notice that the Commission Pct item is currently not displayed, because the Job Id is not SA_REP.

10) Change the value of Job Id to SA_REP.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 75: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 23

11) Notice that the Commission Pct item is now displayed. You also want to show the location of a particular department by using the Set Value advanced dynamic action. Click the Edit Page link in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 76: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 24

d. Create a new display-only item called P<n>_LOCATION whose value is saved to session state.

1) You must first create an item to display the location on this page. Right-click Items and select Create Page Item.

2) Select the Display Only item type and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 77: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 25

3) Enter P<n>_LOCATION for the item name and click Next.

4) Accept the defaults and click Next.

5) Accept the defaults and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 78: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 26

6) Click Create Item.

e. Change the P<n>_DEPARTMENT_ID item to a select list based on the following query (located in /home/oracle/labs/scripts/lab13-2.txt):

select distinct DEPARTMENT_NAME display_value, DEPARTMENT_ID return_value

from OEHR_DEPARTMENTS

order by 1

1) You can change the Department Id item so that it is a select list. Right-click P<n>_DEPARTMENT_ID and select Edit.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 79: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 27

2) Click the Select List quick pick link and click the List of Values tab.

3) Enter the following query (located in /home/oracle/labs/scripts/lab13-2.txt) in the “List of values definition” field, and click Apply Changes.

select distinct DEPARTMENT_NAME display_value, DEPARTMENT_ID return_value

from OEHR_DEPARTMENTS

order by 1

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 80: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 28

f. Create an advanced dynamic action, called P<n>_LOCATION, that will set the value of the new item that you created when the value of P<n>_DEPARTMENT_ID changes. The value of P<n>_LOCATION should be set by using the following SQL statement (located in /home/oracle/labs/scripts/lab13-3.txt) with P<n>_DEPARTMENT_ID being the page item to submit. Test your page.

select l.city from oehr_locations l, oehr_departments d

where l.location_id = d.location_id and

d.department_id=:P<n>_DEPARTMENT_ID

1) Now you are ready to create the dynamic action. Right-click P<n>_DEPARTMENT_ID and select Create Dynamic Action.

2) Select Advanced and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 81: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 29

3) Enter GET DEPARTMENT LOCATION for Name and click Next.

4) You want the dynamic action to execute when the item is changed. Accept the defaults and click Next.

5) Select Set Value for Action.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 82: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 30

6) You want to run a SQL statement to set the value. Select SQL Statement for Set Type.

7) Enter the following SQL statement (located in /home/oracle/labs/scripts/lab13-3.txt) in the SQL Statement field. Enter P<n>_DEPARTMENT_ID in the “Page Items to Submit” field and click Next.

select l.city from oehr_locations l, oehr_departments d

where l.location_id = d.location_id and

d.department_id=:P<n>_DEPARTMENT_ID

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 83: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 31

8) You must select the item that you want to be set. Select Item(s) for Selection Type.

9) Select P<n>_LOCATION from the list of items, click the Move icon, and then click Create.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 84: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 32

10) Click the Run Page icon.

11) Notice that the location is displayed for the IT department.

12) Select a different department from the list.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 85: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 33

13) Notice that the Location changes. In the next practice, you examine plug-ins. Click the Edit Page link in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 86: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 34

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 87: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 35

Practice Solution 13-2: Importing and Using the Star Rating Plug-In

Overview In this practice, you import the Star Rating plug-in into your application and add it as an item on your page

Tasks a. Add a new column to the OEHR_EMPLOYEES table by using the following SQL

command (located in /home/oracle/labs/scripts/lab13-4.txt):

alter table "OEHR_EMPLOYEES" add

("RATING" NUMBER(2,0))

/

1) Because you want to save the value of the rating in the database, you must create a new column in the OEHR_EMPLOYEES table. Select SQL Workshop > SQL Commands.

2) Enter the following SQL command (located in /home/oracle/labs/scripts/lab13-4.txt) and click Run.

alter table "OEHR_EMPLOYEES" add

("RATING" NUMBER(2,0))

/

3) The table has been altered.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 88: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 36

b. Import the Star Rating plug-in by using the item_type_plugin_com_oracle_star_rating.sql file from the /home/oracle/labs/files directory.

1) You can import the plug-in now. Select Application Builder > Database Applications.

2) Select the Order Management application.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 89: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 37

3) Click Shared Components.

4) Under User Interface, click Plug-ins.

5) Click Import.

6) Click Browse.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 90: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 38

7) Select the item_type_plugin_com_oracle_star_rating.sql file from the /home/oracle/labs/files directory and click Open.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 91: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 39

8) Click Next.

9) The file was imported successfully. You want to install it now. Click Next.

10) Install it into your Order Management application. Click Install Plug-in.

11) The plug-in was installed successfully. You want to add a plug-in item to your page. Select the Edit Page icon in the upper-right corner of your window.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 92: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 40

c. Create a plug-in Item called P<n>_RATING that uses the Star Rating plug-in. Accept the default settings. Store the value of the item in the RATING column. Test your page.

1) Under the Employee Details region, right-click Items and select Create Page Item.

2) Select the Plug-ins item type and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 93: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 41

3) Select the Star Rating plug-in and click Next.

4) Enter P<n>_RATING for Item Name and click Next.

5) Accept the defaults and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 94: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 42

6) Accept the defaults and click Next.

7) You want the value in the database to be used. Select Database Column for Source Type. Notice that the RATING column that you created is automatically detected. Click Create Item.

8) Click the Run Page icon.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 95: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 43

9) Select one of the rating stars.

10) Click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 96: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 44

11) To see that the value was saved, click the Edit icon for the same row that you modified with the rating.

12) The rating is displayed. In the next practice, you examine how charts work. Click the Edit Page link in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 97: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 45

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 98: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 46

Practice Solution 13-3: Creating and Modifying Flash Charts

Overview In this practice, you create a new chart page with a Horizontal Bar – 3D Bar Chart. You then modify the chart and change it to a 3D Column Chart and change some of the settings to see how they work.

Tasks a. Create a new Flash chart page that includes a Horizontal Bar - 3D Bar Chart. Use

“Employees by Department” for the Title, “Number of Employees” for the X-Axis and “Departments” for the Y Axis. Use the following query (located in /home/oracle/labs/scripts/lab13-5.txt). Test your page.

select null link,

department_name chart_label,

count(*) chart_value

from oehr_employees e,

oehr_departments d

where e.department_id = d.department_id

group by department_name

1) On the Order Management application home page, click Create Page.

2) Select Chart and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 99: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 47

3) Select Flash Chart and click Next.

4) Select Horizontal Bar and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 100: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 48

5) Select 3D Bar Chart and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 101: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 49

6) Enter Employees by Department for Page Name and Region Name and click Next.

7) Accept the defaults and click Next.

8) Enter Employees by Department for chart Title, Number of Employees for X Axis Title, and Departments for Y Axis Title. Click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 102: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 50

9) Enter the following SQL query (located in /home/oracle/labs/scripts/lab13-5.txt) and click Next.

select null link,

department_name chart_label,

count(*) chart_value

from oehr_employees e,

oehr_departments d

where e.department_id = d.department_id

group by department_name

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 103: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 51

10) Click Finish.

11) Run the page. Click Run Page.

12) Place your cursor over one of the bars to see the Department and its value.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 104: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 52

13) You want to change the 3D Bar Chart to a 3D Column Chart and alter the way it looks. Click the Edit Page link in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 105: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 53

b. Modify your chart and change it to a 3D Column Chart with look 7. Add X-Axis scrollbars, enter 45 for X-Axis label rotation, reverse the X and Y axes titles, and set the Max Y Axis to 20. Test your page. Create a help text region called Help on the Help page.

1) Right-click the Employees by Department region and select Edit Chart.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 106: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 54

2) Select 3D Column for Chart Type and select Look 7 for Color Scheme, and then click the Display Settings tab.

3) Select X-Axis for Show Scrollbars, enter 45 for X-Axis Label Rotation, and select the Axes Settings tab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 107: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 55

4) Because you changed the chart type, you must reverse the titles for the X and Y axes. Enter Departments for X Axis Title and Number of Employees for Y Axis Title. Click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 108: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 56

5) Run the page. Click the Run Page icon.

6) Notice that the chart is now a 3D Column chart, the look is different, the “Number of Employees” max value is set to 20 and there is a horizontal scrollbar. Place your cursor over one of the bars to see the department and value.

7) Move the horizontal scrollbar to the right.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 109: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 57

8) In the next practice, you create a calendar. Click the Edit Application link in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 110: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 58

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 111: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 59

Practice Solution 13-4: Adding a Calendar

Overview In this practice, you create a calendar on the List of Orders page that displays the order total per day. You also link to the Master Detail page for the Order selected.

Tasks a. On the List of Orders page, create a new Easy Calendar calendar region called Order

Calendar. Change the sequence number to 5 so that it appears at the top of the page. Base the calendar on the OEHR_ORDERS table and set the Date Column to ORDER_DATE and Display Column to ORDER_TOTAL.

1) In order to see data on your calendar, you may need to modify the dates. Select SQL Workshop > Object Browser.

2) Select the OEHR_ORDERS table and then click the Data tab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 112: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 60

3) Run following update statement from SQL Workshop > SQL Commands. This statement modifies the order dates in the OEHR_ORDERS table so they contain more recent dates that will appear in the calendar created in the next set of steps.

UPDATE oehr_orders

SET order_date = order_date + 2290

4) Now you will create your calendar region. Select Application Builder > Database Application.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 113: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 61

5) Select the Order Management application and then select the List of Orders page.

6) Right-click Regions and select Create.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 114: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 62

7) Select Calendar and click Next.

8) Select Easy Calendar and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 115: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 63

9) For Title, enter Order Calendar, enter 5 for Sequence, and click Next.

10) For Table/View name, select OEHR_ORDERS (table) and click Next.

11) For display column, select ORDER_TOTAL and click Create Region.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 116: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 64

12) To view the calendar, run the page. Click Run.

13) Find a month where there is an order total listed for a particular day. Note that there is no link to click. Click Edit Page <n> on the Developer Toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 117: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 65

b. Add a Column Link that links to the Master Detail page. Test your page.

1) Right-click the Order Calendar Region and select Edit Calendar.

2) Select the Column Link subtab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 118: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 66

3) Click the up arrow next to Page and select the Master Detail link. Click the Flashlight icon for the Set these items field.

4) Enter P<n>_ORDER_ID (for the Master Detail page) under Items 1 and #ORDER_ID# for Values 1 and then click Apply.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 119: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 67

5) Click Apply Changes.

6) Run the page. Click the Run Page icon.

7) Note that the order total is now linked to the Master Detail page. Click an Order Total.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 120: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 68

8) The Master Details page is displayed and the values are populated based on the Order ID. In the next practice, you create a new page that contains a tree. Click the Application link in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 121: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 69

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 122: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 70

Practice Solution 13-5: Creating a Tree Whose Nodes Link to a Different Page

Overview In this practice, you create a new page with a tree region and link to the Employee Details page. Add a button on the Employee Details back to the tree page.

Tasks a. Create a Tree Page called “Employees by Manager” that uses the default tree

template. Select the appropriate options in the wizard so that the current query (located in /home/oracle/labs/scripts/lab13-6.txt) looks as follows: <n> is the page number for the Employee Details page.

select case when connect_by_isleaf = 1 then 0

when level = 1 then 1

else -1

end as status,

level,

"LAST_NAME" as title,

null as icon,

"EMPLOYEE_ID" as value,

"EMPLOYEE_ID" as tooltip,

'f?p=&APP_ID.:<n>:'||:APP_SESSION||'::::P<n>_EMPLOYEE_ID:'||"EMPLOYEE_ID" as link

from "#OWNER#"."OEHR_EMPLOYEES"

start with "MANAGER_ID" is null

connect by prior "EMPLOYEE_ID" = "MANAGER_ID"

order siblings by "LAST_NAME"

1) From the Order Management application home page, click Create Page.

2) Select the Tree option, and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 123: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 71

3) Enter Employees by Manager for Page Name and Region Name and click Next.

4) Ensure that the Do not use tabs option is selected. Click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 124: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 72

5) Select the Default tree template and click Next.

6) Accept the default Table Owner and click Next.

7) Enter OEHR_EMPLOYEES for Table and click Next.

8) Change the following values and click Next.

Item Value

ID EMPLOYEE_ID

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 125: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 73

Item Value

Parent ID MANAGER_ID

Node Text LAST_NAME

Start With MANAGER_ID

9) You can see the query that is generated by expanding Current Query. Click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 126: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 74

10) Select the check boxes for Collapse and Expand All. You want to link to a particular item so that you can go to another page when an entry in the tree selected. Select Existing Application Item for Link Option. Select P<n>_EMPLOYEE_ID for the page that you want to go to—the Employees Detail page. You can also show a tooltip. In this case, you want to show the EMPLOYEE_ID of the Employee when you put the cursor over the name. Select Database Column for Tooltip and select EMPLOYEE_ID for Tooltip Column and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 127: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 75

11) Select the Employee Details page for Link Page, select the P<n>_EMPLOYEE_ID item from the “Link Existing item” list, and click Next.

12) Click Finish.

13) Click Run Page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 128: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 76

14) Expand one of the manager nodes. Notice that when you place your cursor over one of the names, you see the EMPLOYEE_ID of the person as a tooltip. Click one of the names.

b. Add a button to the Employee Details page called Employee Hierarchy that navigates to the “Employees by Manager” tree page.

1) The Employee Details page opens with the information about the Employee already displayed. You want to add a button on this page linking to the tree page. Click the Edit Page link in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 129: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 77

2) Right-click the Employee Details region and select Create Region Button.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 130: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 78

3) For Button Name, enter Employee Hierarchy and click Next.

4) For Position, select the [Top] quick pick, and click Next.

5) Select Redirect to Page in this Application for Action, select the Employee by Manager page (where your tree is located), and click Create Button.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 131: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 79

6) Run the page. Click the Run Page icon.

7) Click the Employee Hierarchy button.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 132: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 80

8) The tree is displayed. Click Expand All.

9) Select a different employee from the list.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 133: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 81

10) The Employee Details page is displayed.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 134: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 13: Displaying Dynamic Content

Chapter 13 - Page 82

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 135: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 1

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 136: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 2

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 137: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 3

Practices for Lesson 14

Practices Overview There is one practice for this lesson. In this practice, you examine how to work with various themes, templates, and files.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 138: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 4

Practice 14-1: Working with Themes, Templates, and Files

Overview In this practice, you switch to a different theme for the Order Management application and upload an image and add it as an application logo. You change an existing region to use a different template. You copy an existing region template, make a change to the custom template and associate it with a region on your page. Finally, you upload a cascading style sheet, and change the custom template to use the class from the style sheet and also add the class to what is displayed for help text.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB135_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. Create a new theme (Theme 1) for your application. After creating the theme, switch

the theme of your application to that theme.

b. Upload the oralogo.gif image from your /home/oracle/labs/files directory and add it as a logo for your application.

c. On your Home page (Page 1), change the template for the Tasks to use the Navigation Region template and override the List Template to use the Vertical Sidebar List. Change the region so that it is no longer a sub region and delete the Home region.

d. Copy the “Region without Buttons and Titles” template to the “Region without Buttons and Titles – Custom” template.

e. Add the following line (located in /home/oracle/labs/scripts/lab14-1.txt) right before the last line in the template definition.

<div class=”rc-bottom”>Oracle Confidential – Internal Only</div>

f. Change the template used for the Employee List Region on the Employee List page so that it uses the custom template that you just modified.

g. Upload the apexstyle.css file from the /home/oracle/labs/files directory.

h. Add the cascading style sheet to the Page template on the Employee List page. The line of code is as follows (located in /home/oracle/labs/scripts/lab14-2.txt):

<link rel=”stylesheet” href=”#WORKSPACE_IMAGES#apexstyle.css” type=”text/css” />

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 139: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 5

i. Change the custom region template to use the new style, bigblue, for the text you added at the bottom of the template so that it looks like the following (located in /home/oracle/labs/scripts/lab14-3.txt):

<div class=”rc-bottom bigblue”>Oracle Confidential – Internal Only</div>

j. Create a tab called Employees and add the following help text (located in /home/oracle/labs/scripts/lab14-4.txt) on the Employee List page.

<span class=”bigblue”>This page provides a list of Employees.</span>

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 140: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 6

Practice Solution 14-1: Working with Themes, Templates, and Files

Overview In this practice, you switch to a different theme for the Order Management application and upload an image and add it as an application logo. You change an existing region to use a different template. You copy an existing region template, make a change to the custom template, and associate it with a region on your page. Finally, you upload a cascading style sheet, and change the custom template to use the class from the style sheet, and also add the class to what is displayed for help text.

Tasks a. Create a new theme (Theme 1) for your application. After creating the theme, switch

the theme of your application to that theme.

1) Navigate to the Order Management application home page and click Shared Components.

2) In the User Interface region, click Themes.

3) Click Create.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 141: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 7

4) Ensure that From the Repository is selected and click Next.

5) Select Theme 1 and click Next.

6) Click Create.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 142: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 8

7) To use the theme that you just created in your application, you must switch to that theme. Click Switch Theme.

8) Make sure 1. Simple Red is selected and click Next.

9) Note that the page shows the compatibility between the old and new templates. Click Next.

10) Click Switch Theme.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 143: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 9

11) Run the page. Click the Run Page icon.

12) Notice that the new theme is used. Click the Home navigation entry.

13) You want to add a logo to the application. Click the Application link in the Developer toolbar.

b. Upload the oralogo.gif image from your /home/oracle/labs/files directory and add it as a logo for your application.

1) You must upload the image to the image repository. Click Shared Components.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 144: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 10

2) Under Files, select Images.

3) Click Create.

4) Click Browse.

5) Select the oralogo.gif file in your /home/oracle/labs/files folder.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 145: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 11

6) Click Upload.

7) You can add the logo to your application. Select the Shared Components breadcrumb.

8) Click Edit Definition under the Application section.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 146: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 12

9) In the list of links displayed at the top of the page, click the Logo link.

10) Ensure that the Image option is selected. Enter #WORKSPACE_IMAGES#oralogo.gif in the Logo field, and height=20,width=100 for Logo Attributes. Click Apply Changes.

11) Run the page. Click the Run Page icon.

12) Note that all your pages display the logo. You want to change the templates used on this page. Click the Edit Page link in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 147: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 13

c. On your Home page (Page 1), change the template for the Tasks to use the Navigation Region template and override the List Template to use the Vertical Sidebar List. Change the region so it is no longer a sub region and delete the Home region.

1) Right-click the Home region and select Edit.

2) Click Delete.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 148: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 14

3) Make sure that “Delete corresponding sub regions?” and “Delete associated list and list entries?” are set to No and click Delete Region.

4) You want to modify the templates used in the Tasks Region. Right-click Tasks and select Edit.

5) Under User Interface, select Navigation Region for Template and under Source, select Vertical Sidebar List for List Template Override. Then click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 149: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 15

6) Click the Run Page icon.

7) Notice that the Home region is no longer a parent of the Tasks region. In addition, if you place your cursor over one of the options, notice that the vertical bar next to the option turns red, indicating the active region.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 150: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 16

8) You want to make a change to one of the templates. Click the Edit Page link in the Developer toolbar.

d. Copy the “Region without Buttons and Titles” template to the “Region without Buttons and Titles – Custom” template.

1) Click the Shared Components icon.

2) Under User Interface, click Templates.

3) Select 1. Simple Red for Theme and Region for Type and click Go.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 151: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 17

4) You want to make a copy of the Region without Buttons and Titles template. Click the Copy icon for this template.

5) Enter Region without Buttons and Titles – Custom for New Template Name, and click Copy.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 152: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 18

6) Leave the Theme and Type selection as is and enter custom for Template Name and click Go.

e. Add the following line (located in /home/oracle/labs/scripts/lab14-1.txt) right before the last line in the template definition.

<div class=”rc-bottom”>Oracle Confidential – Internal Only</div>

1) Click the Region without Buttons and Titles – Custom link.

2) Add the following line (located in /home/oracle/labs/scripts/lab14-1.txt) to the template definition right before the last line </div> and click Apply Changes.

<div class=”rc-bottom”>Oracle Confidential – Internal Only</div>

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 153: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 19

f. Change the template used for the Employee List Region on the Employee List page so that it uses the custom template that you just modified.

1) You must change the template used for a region to the template that you just modified. Navigate to the Employee List page and under regions, right-click the Employee List region and select Edit.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 154: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 20

2) Under User Interface, select Region without Buttons and Titles – Custom from the list of templates.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 155: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 21

3) Click Apply Changes.

4) Click the Run Page icon.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 156: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 22

5) Notice that your report contains the Oracle Confidential message at the bottom of the page. You want to change the style of this text to use a class in a custom stylesheet. Select the Edit Page link in the Developer toolbar.

g. Upload the apexstyle.css file from the /home/oracle/labs/files directory.

1) Click the Shared Components icon.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 157: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 23

2) Under Files, select Cascading Style Sheets.

3) Click Create.

4) Click Browse.

5) Select the apexstyle.css file from the /home/oracle/labs/files directory and click Open.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 158: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 24

6) Click Upload.

7) To view the style sheet, select apexstyle.css.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 159: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 25

8) Notice that the name of the style is bigblue.

9) Click the Edit Page icon for the Employee List page.

h. Add the cascading style sheet to the Page template on the Employee List page. The line of code is as follows (located in /home/oracle/labs/scripts/lab14-2.txt):

<link rel=”stylesheet” href=”#WORKSPACE_IMAGES#apexstyle.css” type=”text/css” />

1) You first need to add the style sheet to the Page template. Under Shared Components, expand Templates > Page. Right-click One Level Tabs – Right Sidebar and select Edit.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 160: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 26

2) Click the Definition tab.

3) Enter the following line of code (located in /home/oracle/labs/scripts/lab14-2.txt) right after the current style sheet reference. Then click Apply Changes.

<link rel=”stylesheet” href=”#WORKSPACE_IMAGES#apexstyle.css” type=”text/css” />

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 161: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 27

i. Change the custom region template to use the new style, bigblue, for the text you added at the bottom of the template so that it looks like the following (located in /home/oracle/labs/scripts/lab14-3.txt):

<div class=”rc-bottom bigblue”>Oracle Confidential – Internal Only</div>

1) Under Templates > Region, right-click Region without Buttons and Titles – Custom and select Edit.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 162: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 28

2) Add bigblue to the line that you added previously (located in /home/oracle/labs/scripts/lab14-3.txt) so that it reads as follows (changes in bold). Then click Apply Changes.

<div class=”rc-bottom bigblue”>Oracle Confidential – Internal Only</div>

3) Click the Run Page icon.

4) Notice that the bigblue style was applied. You can also add the style to a section on your page. Select the Edit Page link in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 163: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 29

j. Create a tab called Employees and add the following help text (located in /home/oracle/labs/scripts/lab14-4.txt) on the Employee List page.

<span class=”bigblue”>This page provides a list of Employees.</span>

1) Right-click the Employee List Page Rendering node and select Edit.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 164: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 30

2) Select TS1 (Home, Products, Customers) for Standard Tab Set and select the Help tab.

3) Change the help text to the following (located in /home/oracle/labs/scripts/lab14-4.txt) and click Apply Changes.

<span class=”bigblue”>This page provides a list of Employees.</span>

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 165: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 31

4) You want to also create a tab for this page. Under Shared Components, expand Parent Tabs and right-click Tab Set: TS1 and click Create.

5) Click Add next to the Help tab.

6) Enter Employees for Tab Label and click Next.

7) Select the Employee List page for “Tab Current for Page” and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 166: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 32

8) Accept the defaults and click Next.

9) Accept the defaults and click Next.

10) Click Create Tab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 167: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 33

11) Click the Run Page icon.

12) Click the Help navigation bar entry to show the page-level help.

13) Notice that the bigblue class has been applied to the text.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 168: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 14: Working with Themes, Templates, and Files

Chapter 14 - Page 34

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 169: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 1

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 170: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 2

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 171: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 3

Practices for Lesson 15

Practices Overview There is one practice for this lesson. In this practice, you examine how to administer your workspace.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 172: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 4

Practice 15-1: Administering Oracle Application Express Workspaces

Overview In this practice, you create three users: a developer, a workspace administrator, and an end user. You perform workspace administrative tasks, such as monitoring a user’s activity and purging the activity logs and session state of a developer. Additionally, you also request to add an existing schema for your workspace and show the workspace utilization summary report.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB141_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. Create the following users:

Name User Type

Brad.Knight Developer

Susie.Parker Workspace Administrator

John.Bell End User

b. Monitor the activity of your ora<n> user for the last two weeks in the Order Management application. Which page has been accessed the most?

c. Purge the session state that is older than one week.

d. Request that another existing schema be added to this workspace.

e. Review the schema request and approve it by using the APEX Administration tool. Hint: Log in as admin/Welcome_1. If you must change the password, change it to Oracle_1.

f. Review the Workspace Summary Report.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 173: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 5

Practice Solution 15-1: Administering Oracle Application Express Workspaces

Overview In this practice, you create three users: a developer, a workspace administrator, and an end user. You perform workspace administrative tasks, such as monitoring a user’s activity and purging the activity logs and session state of a developer. Additionally, you also request to add an existing schema for your workspace and show the workspace utilization summary report.

Tasks a. Create the following users:

Name User Type

Brad.Knight Developer

Susie.Parker Workspace Administrator

John.Bell End User

1) Click the arrow next to Administration and select Manage Users and Groups.

2) Notice that you receive an error because the user you are logged in as is not the workspace administrator for this workspace. Click Logout.

3) Click Login.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 174: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 6

4) Enter ora01 for Workspace, ora01_admin for Username, and ora01 for Password, and click Login.

5) Select Administration > Manage Users and Groups again.

6) This time you are able to access the page. Notice the list of users. Click Create User.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 175: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 7

7) Enter the following information and click Create and Create Another.

• User Name: Brad.Knight

• Email address: [email protected]

• Select No for the User is a workspace administrator option.

• Select Yes for the User is a developer option.

• Password: welcome1

• Confirm Password: welcome1

• Select No for Require Change of Password on First Use.

8) Enter the following information and click Create and Create Another.

• User Name: Susie.Parker

• Email address: [email protected]

• Select Yes for the User is a workspace administrator option.

• Password: welcome1

• Confirm Password: welcome1

• Select No for Require Change of Password on First Use.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 176: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 8

9) Enter the following information and click Create User.

• User Name: John.Bell

• Email address: [email protected]

• Select No for the User is a workspace administrator option.

• Select No for the User is a developer option.

• Password: welcome1

• Confirm Password: welcome1

• Select No for Require Change of Password on First Use.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 177: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 9

10) The new users are now in the list. Click the View icons button.

11) Notice that the color of the icons indicates the type of user. Green is for end users, yellow is for developers, and red is for workspace administrators. Click View Dashboard.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 178: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 10

b. Monitor the activity of your ora<n> user for the last two weeks in the Order Management application. Which page has been accessed the most?

1) You see an overview of the user you are logged in as, and various other information, including workspace users and their statuses. Click the Activity tab.

2) Click Monitor Activity.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 179: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 11

3) Click the By User link in the Page Views region.

4) Click the link that represents your username to see the page views by developer by application.

5) Select the Order Management Application from the list of Applications.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 180: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 12

c. Purge the session state that is older than one week.

1) Review the list of pages that have been viewed recently. You want to also look at the session state information. Select Administration > Manage Service.

2) Under Manage Meta Data, click the Session State link.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 181: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 13

3) Click the Purge Sessions by Age link.

4) Ensure that 1 Week is selected in the “Session older than” drop-down list and click Purge Sessions.

5) The “Sessions removed” message is displayed to indicate purging of the session state.

d. Request that another existing schema be added to this workspace.

1) To organize the data in your workspace logically, you must add the ORA02 database schema to this workspace. Select Administration > Service Request.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 182: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 14

2) Click Request Schema and click Next.

3) Select Use an existing schema, enter ora02 in the Schema Name field, and click Next.

4) Click Finish.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 183: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 15

e. Review the schema request and approve it by using the APEX Administration tool. Hint: Log in as admin/Welcome_1. If you must change the password, change it to Oracle_1.

1) In order to approve the request, you must log in to the APEX Administration tool. Enter the following URL or in your browser, and click the Apex Admin link under Links.

http://localhost:8080/apex/apex_admin

2) The login page is displayed. Enter admin for Username and Welcome_1 for Password, and click Login.

3) You might be asked to change your password. If so, change it to Oracle_1.

4) Click Manage Requests.

5) Notice that your request for a new schema is in the list. Click the Edit icon for the entry.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 184: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 16

6) Review the details of the request and click Assign Schema.

7) The “Schema created or assigned” message is displayed. Click Logout.

f. Review the Workspace Summary Report.

1) Click Login.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 185: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 17

2) Log in to your ORA01workspace as the ora01_admin user, with ora01 as the password, and click Login.

3) Select Administration > Workspace Utilization.

4) The Workspace Summary Report is displayed. This report shows all the information about the workspace including the users, request, and schemas. This information can be emailed to any interested parties.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 186: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 15: Administering Oracle Application Express Workspaces

Chapter 15 - Page 18

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 187: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 1

Practices for Lesson 16: Implementing Security

Chapter 16

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 188: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 2

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 189: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 3

Practices for Lesson 16

Practices Overview There are three practices for this lesson. In these practices, you examine how to implement security within your application.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 190: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 4

Practice 16-1: Creating an Authentication Scheme

Overview In this practice, you create an authentication scheme, and then make it the current default.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB141_ORDER_MGMT_SOLN.SQL packaged applications and performed Practice 15-1.

Tasks a. Create an authentication scheme called OpenDoor based on the Open Door

credentials.

b. Make OpenDoor the current authentication scheme.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 191: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 5

Practice 16-2: Restricting Users by Using Access Control

Overview In this practice, you create an access control page, set the application mode to restrict access, create the access control list, and assign application components to an authorization scheme.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB161_ORDER_MGMT_SOLN.SQL packaged applications and performed Practice 15-1.

Tasks a. Switch the current authentication schema to Application Express.

b. Create an access control page for the Order Management application.

c. Set the application mode to restricted access. Only users defined in the access control list are allowed.

d. Add users to the access control list.

• john.bell can only view the information in the application; he cannot make any changes to application data.

• brad.knight should be allowed to edit application data but he cannot change application administration settings (application mode and the access control list).

• susie.parker is the administrator of the application, so she can change anything in addition to changing the user privileges.

e. Define and apply the authorization schemes to each application component. This will restrict access to application pages and components.

• Users with the View privilege can review customer information, but cannot change or create information.

• Users with the Edit privilege can make changes to customer information but cannot make changes to the application mode and the access control list.

• Users with the Administrator privilege can make any changes, including administering the Order Management application.

f. Run the application and log in as each different user. What do you observe?

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 192: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 6

Practice 16-3: Enabling Session State Protection

Overview In this practice, you enable and configure session state protection for the Customers page.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB163_ORDER_MGMT_SOLN.SQL packaged applications and performed Practice 15-1.

Tasks a. Enable Session State Protection.

b. On the Customers page, for display-only items, change the page access protection to Arguments Must Have Checksum.

c. Run the page and make a change to a customer. Click the Back button in your browser, and make a different change. What do you observe?

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 193: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 7

Practice Solution 16-1: Creating an Authentication Scheme

Overview In this practice, you create an authentication scheme, and then make it the current default.

Tasks a. Create an authentication scheme called OpenDoor based on the Open Door

credentials.

1) Navigate to your Order Management application home page and click Run Application.

2) Because you will be changing the authentication scheme for the application, you want to sign off from the application. Click Sign Off.

3) Now you will create your authentication scheme. Click the Application link in the Developer toolbar.

4) From the application home page, click Shared Components.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 194: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 8

5) In the Security region, click the Authentication Schemes link.

6) Click Create.

7) Leave the default value of “Based on a pre-configured scheme from the gallery” and click Next.

8) Select the Show Built-In Login Page and Use Open Door Credentials option. Click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 195: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 9

9) For Name, enter OpenDoor and click Create Scheme.

b. Make OpenDoor the current authentication scheme.

1) To make OpenDoor the current authentication scheme, click the Change Current tab.

2) From the Available Authentication Schemes select list, select OpenDoor.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 196: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 10

3) Click Next.

4) Click Make Current.

5) Click Run Application.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 197: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 11

6) To log in to the system, enter yourname in the Username field and then click Login.

7) The Home page is displayed. Notice that the name that you entered appears in the Welcome area. In the next practice, you will use access control to set up authorization to certain pages and buttons. Click the Application link in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 198: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 12

Practice Solution 16-2: Restricting Users by Using Access Control

Overview In this practice, you create an access control page, set the application mode to restrict access, create the access control list, and assign application components to an authorization scheme.

Tasks a. Switch the current authentication schema to Application Express.

1) Navigate to Shared Components > Authentication Scheme.

2) Select Application Express from the list of Available Authentication Schemes and click Next.

3) Click Make Current.

b. Create an access control page for the Order Management application.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 199: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 13

1) Navigate to your Order Management application home page and click Create Page.

2) Select Access Control and click Next.

3) Accept the default page value and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 200: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 14

4) For Tab Options, select Use an existing tab set and create a new tab within the existing tab set, select TS1 for the Tab Set, and enter Admin for the New Tab Label. Then click Next.

5) Click Finish.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 201: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 15

6) Click Run Page.

c. Set the application mode to Restricted access. Only users defined in the access control list are allowed.

1) The access control page is displayed. Here is where you set the application mode and add users to the access control list. For Application Mode, select Restricted access, Only users defined in the access control list are allowed, and click Set Application Mode.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 202: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 16

d. Add users to the access control list.

• john.bell can only view the information in the application; he cannot make any changes to application data.

• brad.knight should be allowed to edit application data but he cannot change the application administration setting (application mode and the access control list).

• susie.parker is the administrator of the application, so she can change anything in addition to changing the user privileges.

1) The application mode has been set. Now users whose credentials are defined in the access control list can access your Order Management application. To add your privileged users, click Add User.

2) You want John Bell to only be able to view the information in your application. He cannot make any changes to application data. Enter john.bell as the username and select View from the list of privileges. Then click Add User.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 203: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 17

3) You want Brad Knight to be able to edit the information in your application but not be able to change any of the administration options. Enter brad.knight as the username and select Edit from the list of privileges. Click Add User.

4) You want Susie Parker to be able to edit the information in your application as well as update the administration access control list. Enter susie.parker as the username and select Administrator for the privilege. Click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 204: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 18

e. Define and apply the authorization schemes to each application component. This will restrict access to application pages and components.

• Users with the View privilege can review customer information, but cannot change or create information.

• Users with the Edit privilege can make changes to customer information but cannot make changes to the application mode and the access control list.

• Users with the Administrator privilege can make any changes, including administering the Order Management application.

1) You can define which areas of the application are restricted. Click the Application <n> link on the Developer toolbar.

2) You can restrict access for users with the View privilege to customer information. On the Order Management application home page, click the Customers Page.

3) Right-click the Customer Report region and select Edit Report Attributes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 205: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 19

4) Click the Link Column tab. Note: If the report were a classic report, you would modify the CUSTOMER_ID attribute and set the authorization in the column attribute definition instead of at the report level (as in an interactive report).

5) Select access control - edit for Authorization Scheme and click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 206: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 20

6) Because you want the Create Button to appear only if the user has Edit or Administrator privilege, you must set the authorization scheme accordingly. Under Region Buttons for the Customer Report region, right-click CREATE and select Edit.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 207: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 21

7) Click the Security tab.

8) Select the access control - edit authorization scheme and click Apply Changes.

9) You also want to protect against direct access to a page. Even though you restricted a user who did not have the Edit privilege to edit or create users on the Customers page, he or she can still access Customer Details if the correct URL is entered. To prevent this from happening, you must restrict Customer Details to only users with the Edit privilege. Enter the page number of the Customer Details page (in this case 5) and click Go.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 208: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 22

10) Right-click the Customer Details page and select Edit.

11) Select the Security tab.

12) For Authorization Scheme, select access control - edit. Click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 209: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 23

13) Click the Application<n> breadcrumb to return to the Order Management application home page.

14) Because users with the Administrator privilege are only allowed to make changes to the access control list, you must set the authorization scheme for the Access Control Administration page. Click Access Control Administration Page. Note that you may have to advance to the second page of icons to see this page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 210: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 24

15) Right-click Access Control Administration Page and select Edit.

16) Select access control - administrator for the Authorization Scheme and click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 211: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 25

f. Run the application and log in as each different user. What do you observe?

1) Now you are ready to run the application. Enter 1 for Page and click Go.

2) Click the Run Page icon.

3) If you are already logged in, click Sign Off.

4) Enter brad.knight and welcome1 for the username and password, respectively. Then click Login.

5) Click View Customers.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 212: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 26

6) Notice that Brad can edit customer information, and he has the Create button. Click the Admin tab.

7) You receive an error because you need Administration privilege to access this page.

8) Click Sign Off.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 213: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 27

9) Enter john.bell and welcome1 as the username and password, respectively. Then click Login.

10) Click View Customers.

11) John has the View privilege only and, therefore, cannot edit customer information. Also, the Create button is not displayed for him.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 214: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 28

12) Change the page number in your URL to try to access the Customer Details page. Example url …/f?p=104:2:2101953412249296357::NO

Change to …/f?p=104:<customer details page number>:2101953412249296357::NO

13) Press the Enter key. Notice that you receive a message denying access to the page, because access to the Customer Details page is restricted to the Edit privilege users.

14) Click the OK link.

15) Click Application <n> on the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 215: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 29

Practice Solution 16-3: Enabling Session State Protection

Overview In this practice, you enable and configure session state protection for the Customers page.

Tasks a. Enable Session State Protection.

1) From the Order Management application home page, click Shared Components.

2) Under Security, click the Session State Protection link.

3) Note that the Session State Protection is enabled. If you see that it is disabled, perform the following steps to enable Session State Protection:

a) Click the Set Protection> button. The Session State Protection Wizard appears.

b) Under Select Action, select Enable, and then click Next.

c) Click Enable Session State Protection. Session State Protection has now been enabled for the application.

b. On the Customers page, for display-only items, change the page access protection to Arguments Must Have Checksum.

1) Configure Session State Protection for the Customers page. Click the Page icon on the Session State Protection page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 216: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 30

2) Click the Customers page ID. The “Set Page and Item Protection” page appears.

3) For Item type, select Display-Only Items.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 217: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 31

For Page Access Protection, select Arguments Must Have Checksum and click Apply Changes.

4) Return to the Order Management application home page by selecting the Application breadcrumb.

c. Run the page and make a change to a customer. Click the Back button in your browser, and make a different change. What do you observe?

1) Click Run Application.

2) You must be logged in as a developer so that you can edit customer details. Because you are currently logged in as john.bell, click Sign Off.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 218: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 32

3) Log in as brad.knight (the password is welcome1) and click Login.

4) Select View Customers.

5) Click the Edit icon for one of the customers.

6) Change the Account Manager to something different.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 219: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 33

7) Click Apply Changes.

8) The record was modified. Click the Back button in your browser.

9) Change the value of First Name and click Apply Changes.

10) Notice that you receive an error. The second Apply Changes action fails because the checksum on this page does not match the one in the database, because you

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 220: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 16: Implementing Security

Chapter 16 - Page 34

used the Back button in your browser instead of clicking the Edit icon in the Customers report.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 221: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 1

Practices for Lesson 17: Building a Websheet Application

Chapter 17

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 222: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 2

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 223: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 3

Practices for Lesson 17

Practices Overview There are four practices for this lesson. In these practices, you build and manipulate a websheet application.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 224: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 4

Practice 17-1: Creating and Modifying a Websheet Application

Overview In this practice, you create and modify a websheet application.

Assumptions You have performed the previous practices or imported the LAB03_SOLN.SQL packaged application.

Tasks a. Create a websheet and change the SQL property to Yes.

b. Run the websheet.

c. Add the dog.gif file from the /home/oracle/labs/files directory and add it to the Welcome section in your page.

d. Create another page called Customers with a section called Customer List that contains the following query (located in /home/oracle/labs/scripts/lab17-1.txt). Hint: Use markup syntax with the following query.

select cust_first_name||' '||cust_last_name Name, city, state_province, cust_email from oehr_customers where

country_id='US'

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 225: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 5

Practice 17-2: Adding and Manipulating a Data Grid and Report

Overview In this practice, you add a data grid and report and manipulate the results.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB0171_WEBSHEET_SOLN.SQL packaged applications.

Tasks As a developer, you can create and manipulated data grids and reports for your websheet. In this practice, perform the following tasks:

a. Create a data grid called Tasks based on the tasks_2010.txt tab-delimited file (located in the /home/oracle/labs/files directory).

b. Manipulate the Tasks data grid as follows:

• Hide the Assigned To column.

• Change the “closed” status to “Closed”.

• Change all the “On-Hold” statuses to “Pending”.

• Change the STATUS column to display a list based on only the current values.

• Add a Priority column with a range of priorities of 1 to 5, with 3 being the default.

• View the change history.

c. Add the following annotations to your data grid

• A file: hardware.xls

• A note with any text

• A link to http://www.oracle.com

• Any two tags

d. Create a saved report for the changes that you made. Save the saved report as an alternative report named “Tasks with Annotations.”

e. Create a report on the OEHR_DEPARTMENTS table. Change some of the header names and exclude the link column.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 226: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 6

Practice 17-3: Adding and Manipulating Sections in a Page

Overview In this practice, you add and manipulate various sections in your pages.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB0172_WEBSHEET_SOLN.SQL packaged applications.

Tasks In this practice, perform the following tasks:

a. On the Customers page, create a chart section based on the Tasks data grid. Specify the following:

• Chart Label and “Axis Title for Label”: Project

• Chart Value and “Axis Title for Value”: Budget

• Function: Sum

• Sort: Label Ascending

b. On the Customers page, create a data section based on the OEHR_DEPARTMENTS report.

c. On the Customers page, create a section navigation section that appears at the top of the page.

d. On the Home page, create a page navigation section that appears at the top of the page.

e. On the Home page, create a text section, titled Useful Links, to display links for the APEX Product page, your data grid, and your report as follows (located in /home/oracle/labs/scripts/lab17-2.txt). Note: You must look up the report number in the markup syntax area.

Product Home Page: [[URL:http://www.oracle.com/apex]]

Maintain Data: [[data grid: tasks | Tasks]]

View Report: [[ report: <rpt number> | OEHR_DEPARTMENTS ]]

f. Move the section to a new page called Additional Information.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 227: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 7

Practice 17-4: Sharing Websheets Between Users

Overview In this practice, you create an access control list to allow users to share websheets.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB0173_WEBSHEET_SOLN.SQL packaged applications.

Tasks In this practice, perform the following tasks:

a. Determine what type of authentication your websheet uses.

b. Create three developer users in Application Express: ws_admin, ws_contributor, and ws_reader.

c. Add the users with their respective privileges to your websheet access control list.

b. Test the websheet to make sure that the correct users have the correct authorization.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 228: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 8

Practice Solution 17-1: Creating and Modifying a Websheet Application

Overview In this practice, you create and modify a websheet application.

Tasks a. Create a websheet and change the SQL property to Yes.

1) Select Application Builder > Websheet Applications.

2) Click Create.

3) Select Websheet and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 229: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 9

4) Enter a websheet name and click Next.

5) Click Create.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 230: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 10

6) Your websheet was created successfully. Because you want to be able to create a SQL report, you will need to change one of the properties of the websheet. Click Edit Properties.

7) Select the SQL tab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 231: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 11

8) Change Allow SQL Tabs and Reports to Yes and click Apply Changes.

b. Run the websheet.

1) Click Run.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 232: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 12

2) Enter your administrator username and password and click Login.

3) When your websheet was created, a default Welcome page was created. You can add some annotations to this page. Under Annotations, select the Add file link.

c. Add the dog.gif file from the /home/oracle/labs/files directory and add it to the Welcome section in your page.

1) Click Browse.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 233: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 13

2) Select the dog.gif file in the labs/files directory and click Open.

3) Enter Dog Photo for alias and enter something in the description field. Then click Add.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 234: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 14

4) The file was added. Now you can include it in your page. Click the Edit link.

5) You must use markup syntax to add the file you created. To learn what the syntax is, you can use Help. Under Help, click the Markup Syntax link.

6) Select the Application Content tab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 235: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 15

7) Select the Files/Images subtab.

8) The file that you added is listed. To see the syntax, click the > icon next to About.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 236: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 16

9) Notice that if you want to have the file display on the page, you use the [[IMAGE: ]] syntax.

10) Switch to the page area and enter [[IMAGE: dog.gif]]. You can put some other text in the content area as well. Then click Apply Changes.

11) Notice that the image and text that you added are displayed.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 237: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 17

d. Create another page called Customers with a section called Customer List that contains the following query (located in /home/oracle/labs/scripts/lab17-1.txt) Hint: Use markup syntax with the following query.

select cust_first_name||' '||cust_last_name Name, city, state_province, cust_email from oehr_customers where

country_id='US'

1) Create a new page that contains a section based on a SQL query. In the Page area, select New Page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 238: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 18

2) Enter Customers for Name, enter Customer List for First Section Name, and enter the following (located in /home/oracle/labs/scripts/lab17-1.txt) in the section contents area. Then click Create Page.

[[SQL:select cust_first_name||' '||cust_last_name Name, city, state_province, cust_email from oehr_customers where country_id='US']]

3) The page was created and the new section with the list of customers is displayed.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 239: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 19

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 240: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 20

Practice Solution 17-2: Adding and Manipulating a Data Grid and Report

Overview In this practice, you create and manipulate a data grid and report.

Tasks a. Create a data grid called Tasks based on the tasks_2010.txt tab-delimited file

(located in /home/oracle/labs/files directory).

1) Select Data > Create.

2) Select Data Grid and click Next.

3) You will copy the data from a .txt file. Select Copy and Paste and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 241: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 21

4) Open the tasks_2010.txt file located in your /home/oracle/labs/files directory (open a terminal window and enter gedit). Select the entire document and copy it to your clipboard (Edit > Copy).

5) Switch to APEX and paste the contents in the Paste Spreadsheet Data Below area. Enter Tasks for Name and Alias and make sure the First Row Contains Column Headings check box is selected. Then click Upload.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 242: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 22

6) Your data grid was created successfully and is displayed. Click the X to close the success message.

b. Manipulate the Tasks data grid as follows:

• Hide the Assigned To column.

• Change the “closed” status to “Closed”.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 243: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 23

• Change all the “On-Hold” statuses to “Pending”.

• Change the STATUS column to display a list based on only the current values.

• Add a Priority column with a range of priorities of 1 to 5, with 3 being the default.

• View the change history.

1) You can perform a number of different tasks in a data grid. To hide a column, click the ASSIGNED_TO column header and click the Hide Column button.

2) To filter based on a particular value, click the STATUS column header and select closed.

3) To perform an inline edit, click a value in the STATUS column. The value is placed into inline edit mode. Change the value to Closed. To accept the change, click somewhere else in the data grid.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 244: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 24

4) To remove the filter, click the Remove Filter icon.

5) Click the STATUS column header again to see that the “closed” value is no longer listed.

6) You can change a set of values. Click Manage and select Rows > Replace.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 245: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 25

7) You want to change all the On-Hold statuses to Pending statuses. Select STATUS in the Columns list, enter On-Hold for Find What, and enter Pending for Replace With. Then click Apply.

8) Click the STATUS column header again to see that the On-Hold status is no longer listed because all of the values were changed to Pending.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 246: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 26

9) At this point, you no longer want users to change the status by using inline edit. Instead, you want them to select a status from a list. Click Manage and select Columns > Column Properties.

10) Select STATUS for Column Name, select Select List for Display As, and select - New List of Values Based on Current Values – for List of Values. Then click Apply.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 247: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 27

11) Select a STATUS value and notice that it now appears as a drop-down list, rather than as a text field where an inline edit can be performed.

12) You can also add a new column. Click Manage and select Columns > Add.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 248: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 28

13) Enter Priority for Column Name, select Number for Type, select Select List for Display As, select –New List of Values – for List of Values, enter Priorities for List of Values Name, enter 1,2,3,4,5 for List of Values Definition, and enter 3 for Default Text. Then click Apply.

14) The new column is displayed in the data grid. Select one of the values to see that the select list is displayed.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 249: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 29

15) You can view the history of changes that were made. Click Manage and select History.

16) A report of the changes that have been made to the data grid is displayed.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 250: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 30

17) Annotations can be added to each record in your data grid. Select the Tasks breadcrumb to return to the data grid.

c. Add the following annotations to your data grid

• A file: hardware.xls

• A note with any text

• A link to http://www.oracle.com

• Any two tags

1) Click the Edit icon for one of the rows.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 251: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 31

2) You can edit the record from this page. In this case, you want to add some annotations. In the Actions area, click the Add File link.

3) Click Browse.

4) Select the hardware.xls file from the /home/oracle/labs/files directory and click Open.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 252: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 32

5) Click Apply.

6) The file that you just added is listed in the Annotations area. Under Actions, click the Add Note link.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 253: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 33

7) Enter something in the text area and click Apply.

8) Your note was added. Under Actions, click the Add Link link.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 254: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 34

9) Enter Oracle Website for Link Name, enter http://www.oracle.com for the URL Target, and click Apply.

10) Your link was added. Under Actions, click the Add Tags link.

11) Enter any two tags, separated by commas, and click Apply.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 255: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 35

12) All your annotations were added. Click Apply Changes.

13) You can view the annotations in the report by including the columns. Click Actions and select Select Columns.

14) Select Files, Notes, Links, and Tags from the Do Not Display area and click the Move (>) icon.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 256: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 36

15) The columns now appear in the “Display in Report” area. Click Apply.

16) Notice that the columns now appear in the report. You can place your cursor over an annotation to view details.

d. Create a saved report for the changes that you made. Save the saved report as an alternative report named “Tasks with Annotations.”

1) You can save this view of the report. Click Actions and select Save Report.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 257: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 37

2) You want to make this report available to other users. Select As Default Report Settings from the Save drop-down list.

3) Select Alternative for Default Report Type. This means that it is available to other authenticated users but not to the primary user. Enter Tasks with Annotations for Name and click Apply.

4) Notice that the Reports drop-down list shows all the reports that are available for you to select from. Select the Primary Report option.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 258: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 38

5) You will need to reset the Primary Report to return it to its original settings. Click Actions and select Reset.

6) Click Apply.

7) Notice that the annotations are no longer displayed in the Primary Report. Now when you select the alternative report Tasks with Annotations, you see the repost with the changes that you made before you performed the reset action.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 259: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 39

e. Create a report on the OEHR_DEPARTMENTS table. Change some of the header names and exclude the link column.

1) You see that the annotations are now listed in the saved report. Next, you create a report based on an existing table. Select Data > Create.

2) Select Report and click Next.

3) Enter OEHR_DEPARTMENTS for “Table or View Name” (you can select the table from the popup list) and enter OEHR_DEPARTMENTS for Report Name. Click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 260: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 40

4) Click Create.

5) The report is displayed. You can modify the attributes for this report. Click Manage and select Edit Attributes.

6) Change the following headers, and then select the Link Column subtab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 261: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 41

Column Attribute Header

DEPARTMENT_ID Number

DEPARTMENT_NAME Name

MANAGER_ID Manager

LOCATION_ID Location

7) Select Exclude Link Column for Link Column, and click Apply Changes.

8) The report is displayed with the headers modified and the link column eliminated.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 262: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 42

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 263: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 43

Practice Solution 17-3: Adding and Manipulating Sections in a Page

Overview In this practice, you create and manipulate various sections on a page.

Tasks a. On the Customers page, create a chart section based on the Tasks data grid. Specify

the following:

• Chart Label and “Axis Title for Label”: Project

• Chart Value and “Axis Title for Value”: Budget

• Function: Sum

• Sort: Label Ascending

1) To see the list of pages that have been created in your websheet, select Page > Page Directory.

2) Select the Customers page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 264: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 44

3) You want to create a new section on this page. In the Page area, click the New Section link.

4) Select Chart and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 265: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 45

5) Select Horizontal Bar and click Next.

6) Select the Tasks data grid and click Next.

7) Accept the default Primary Report and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 266: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 46

8) Specify the following and click Next.

Field Name Value

Chart Label PROJECT

Axis Title for Label Project

Chart Value BUDGET

Axis Title for Value Budget

Function Sum

Sort Label - Ascending

9) Click Create.

10) Scroll to the bottom of your page to see the chart.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 267: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 47

b. On the Customers page, create a data section based on the OEHR_DEPARTMENTS report.

1) You want to create another section on your Customers page that displays the report that you created in the previous practice. Scroll to the top of the page and Select Page > New Section.

2) Select Data and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 268: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 48

3) Select Report for Data Section Source, select OEHR_DEPARTMENTS for Report, and enter List of Departments for Title. Then click Next.

4) Accept the default saved report and click Next.

5) Click Create.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 269: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 49

6) Scroll to the bottom of the page where the report is displayed.

c. On the Customers page, create a section navigation section that appears at the top of the page.

1) The page is getting quite long, so you want to create a navigation section for the page. Under Page, click the New Section link.

2) Select Navigation and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 270: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 50

3) Select Section Navigation and click Next.

4) Enter 05 for Sequence (because you want this section to appear at the top of the page) and enter List of Sections on this Page for Title. Then click Create.

5) The navigation section is displayed. You may also have many pages in this websheet application. You can create a page navigation section to manage all the pages. Click the Home breadcrumb.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 271: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 51

d. On the Home page, create a page navigation section that appears at the top of the page.

1) On the Home page, under Pages, click the New Section link.

2) Select Navigation and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 272: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 52

3) Select Page Navigation and click Next.

4) Enter 5 for Sequence (so that it appears at the top of the page), enter Page Navigation for Title, and click Create.

5) You want to create another text section on this page to manage useful links that you want to maintain. Under Pages, click the New Section link.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 273: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 53

e. On the Home page, create a text section, titled Useful Links, to display links for the APEX Product page, your data grid, and your report as follows (located in /home/oracle/labs/scripts/lab17-2.txt). Note: You must look up the report number in the markup syntax area.

Product Home Page: [[URL:http://www.oracle.com/apex]]

Maintain Data: [[data grid: tasks | Tasks]]

View Report: [[ report: <rpt number> | OEHR_DEPARTMENTS ]]

1) Select Text and click Next.

2) Enter 07 for Sequence, Useful Links for Title, and enter the following (located in /home/oracle/labs/scripts/lab17-2.txt) in the content area. Then click Create.

Product Home Page: [[URL:http://www.oracle.com/apex]]

Maintain Data: [[data grid: tasks | Tasks]]

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 274: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 54

View Report: [[ report: <rpt number> | OEHR_DEPARTMENTS ]]

Note: You will need to look up the report alias in the markup syntax area.

3) The Useful Links section is displayed. You realize that you would like this section to be included on its own page, so you want to move it. Select the Edit link for this section.

f. Move the section to a new page called Additional Information.

1) Under Tasks, select Move section to new page.

2) Enter Additional Information for both New Page Name and New Page Alias, and click Move Section.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 275: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 55

3) Notice that the section is moved and a link in the Page Navigation section is automatically added to link to the next page. Click Additional Information in the Page Navigation section.

4) The new page with the moved section is displayed.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 276: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 56

Practice Solution 17-4: Sharing Websheets Between Users

Overview In this practice, you create an access control list to allow users to share websheets.

Tasks a. Determine what type of authentication your websheet uses.

1) From your websheet, select Administration.

2) Click Application Properties.

3) Select the Authentication subtab.

4) Notice that the websheet currently uses Application Express Account authentication. As a result, you can create some users in Application Express that will have access to this websheet. Click the Return to Application Express button.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 277: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 57

5) Log in to your workspace as the admin user.

b. Create three developer users in Application Express: ws_admin, ws_contributor, and ws_reader.

1) Select Administration > Manage Users and Groups.

2) Click Create User.

3) Enter ws_admin for Username, Password, and Confirm Password. Enter [email protected] for Email address. Select No for “Require Change of Password on First Use” and click Create and Create Another.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 278: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 58

4) Enter ws_contributor for Username, Password, and Confirm Password. Enter [email protected] for Email address. Select No for “Require Change of Password on First Use.” Then click Create and Create Another.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 279: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 59

5) Enter ws_reader for Username, Password, and Confirm Password. Enter [email protected] for Email address. Select No for “Require Change of Password on First Use.” Then click Create User.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 280: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 60

6) Now that your Application Express users have been created, you can create the access control list for the websheet. Select Application Builder > Websheet Applications.

7) Select your websheet application.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 281: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 61

8) Click Run.

9) Log in as the admin workspace user.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 282: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 62

b. Add the users with their respective privileges to your websheet access control list.

1) Select Administration > Access Control.

2) Click Create Entry.

3) Enter ws_reader for Username, select the Reader privilege, and click Create and Create Another.

4) Enter ws_contributor for Username, select the Contributor privilege, and click Create and Create Another.

5) Enter ws_admin for Username, select the Administrator privilege, and click Create and Create Another.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 283: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 63

6) You must also create a user for the workspace admin user, because you are currently logged in as that user. Enter ora<n>_admin for Username, select the Administrator privilege, and click Create.

7) Now that your access control list has been populated, you can change the application properties to use it for authorization. Select Administration > Application Properties.

8) Select the Authorization subtab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 284: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 64

9) Select Custom for Access Control List Type and click Apply Changes.

c. Test the websheet to make sure the correct users have the correct authorization.

1) You can now test access to your websheet. Click the Logout link.

2) Enter ws_reader for Username and Password, and click Login.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 285: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 65

3) You do not see the Administration menu, and you cannot add a new section or page, because this user has the Reader privilege. Click the Logout link.

4) Enter ws_contributor for Username and Password, and click Login.

5) You do not see the Administration menu, but you are able to add a new section or a page, because this user has the Contributor privilege. Click the Logout link.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 286: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 66

6) Enter ws_admin for Username and Password, and click Login.

7) Notice that, with the Administrator privilege, you now see the Administration menu and you can add a new section or a page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 287: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 67

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 288: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 17: Building a Websheet Application

Chapter 17 - Page 68

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 289: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 1

Practices for Lesson 18: Deploying Your Application

Chapter 18

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 290: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 2

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 291: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 3

Practices for Lesson 18

Practices Overview There is one practice for this lesson. In this practice, you examine how to deploy your application.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 292: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 4

Practice 18-1: Deploying Your Application

Overview In this practice, you identify what supporting database objects you want to export into a single file, export the application, and import the file into another workspace.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB163_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. Change the welcome messages that will appear during the installation process of your

application.

b. Add the APEX_ACCESS_CONTROL (table) database object to the Prerequisite section of your Supporting Objects definition.

c. Add the classobjects.sql installation script from the directory of your Supporting Objects definition in /home/oracle/labs/oehr.

d. Export your application.

e. Import the file you exported into the other schema (ORA02) that you added to your workspace in Practice 15-1.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 293: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 5

Practice Solution 18-1: Deploying Your Application

Overview In this practice, you identify which supporting database objects you want to export into a single file, export the application, and import the file into another workspace.

Tasks a. Change the welcome messages that will appear during the installation process of your

application.

1) Navigate to the Order Management application home page and click Supporting Objects. (Note: You can be logged in as ora<n> or ora<n>_admin.)

2) Review the options on the Supporting Objects page. Click the Messages link under Installation.

3) Change the Welcome Message to include the name of your application (Order Management). Click the Prerequisites tab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 294: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 6

4) The Prerequisites tab is where you define what checks are required before installation, including required free disk space, required system privileges, and schema object restrictions.

a) Enter 4096 (which is approximately 4 MB) for the required free space. This is the approximate size that the application would require in your target workspace schema.

b) Make sure that the CREATE SEQUENCE system privilege is checked, in addition to CREATE TRIGGER, CREATE PROCEDURE, CREATE TABLE, and CREATE VIEW.

c) Click the up arrow to select a table in the Object Names field.

b. Add the APEX_ACCESS_CONTROL (table) database object to the Prerequisite section of your Supporting Objects definition.

1) Click the APEX_ACCESS_CONTROL (table) link.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 295: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 7

2) Click Add.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 296: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 8

3) Because these objects are added to the prerequisites area, the installer makes sure that the database objects do not exist before the installation scripts are executed. Click the Substitutions tab.

4) You do not have any static substitution strings defined for this application. You can define static substitution strings for phrases or labels that occur in many places within an application. Click the Build Options tab.

5) You do not have any build options defined for this application. This allows you to conditionally display specific functionality within an application. Click the Validations tab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 297: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 9

c. Add the classobjects.sql installation script from the directory of your Supporting Objects definition in /home/oracle/labs/oehr.

1) You do not have any validations defined for this packaged application. These validations, which are similar to normal application or page validations, prevent a user from installing database objects if the user-defined conditions are not satisfied. Click the Install tab.

2) In order for the database objects to be created, you must create or upload the scripts to create and load the data for each supporting object that does not exist in the target instance. Click the Create > button.

3) For the purpose of this class, the scripts to create the required database objects have already been created in the /home/oracle/labs/oehr/*.sql folder. Select the Create from file option to upload and associate the installation scripts with the Order Management application. Click Next.

4) Enter class_objects in the script Name field and click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 298: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 10

5) Click Browse.

6) Select the /home/oracle/labs/oehr/classobjects.sql file, and click Open.

7) Click Create Script.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 299: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 11

8) The script has been added to the list of scripts that are to be installed. Click the Deinstall tab.

9) You can specify a script to deinstall the support objects in case you need to reinstall. However, you will not define one during this class. Click the Export tab.

d. Export your application.

1) Select Yes from the Include Supporting Object Definition Export drop-down list. Selecting Yes ensures that the deployment attributes are exported with your application by default. Click Apply Changes.

2) Review the Supporting Objects definition. Notice that the number of installation scripts has changed to 1. Now you are ready to export the application. Under Tasks, click the Export Application link.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 300: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 12

3) Select No for Export Supporting Object Definitions and click Export Application.

4) Select Save File and click OK.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 301: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 13

5) Click Save to save the file on the desktop. Make note of the file name. You will import this file in the next few steps.

e. Import the file you that exported into the other schema (ORA02) that you added to your workspace in Practice 15-1.

1) You want to import this application into the workspace that you assigned in an earlier practice. Select the Application Builder breadcrumb.

2) Click Import.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 302: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 14

3) Click Browse.

4) Browse to the location where you saved your packaged application, select the file, and click Open.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 303: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 15

5) Click Next.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 304: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 18: Deploying Your Application

Chapter 18 - Page 16

6) After the application has been successfully imported, click Next.

7) Select the schema you created in a previous practice. Click Install.

8) Your application was installed successfully.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 305: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 1

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 306: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 2

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 307: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 3

Practices for Lesson 19

Practices Overview There are two practices for this lesson. In these practices, you manage and maintain the application development process by using Team Development.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 308: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 4

Practice 19-1: Adding Features and Milestones to Your Development Project

Overview In this practice, you add features and milestones to your Order Management Release 6.0 project.

Tasks a. Create the following features (both tables are needed to create each feature):

Feature Owner Contributor Focus Area Release

Create FY Management Reports for Orders by Sales Rep

karen tom Reporting 6.0

Allow more than one Sales rep to Get Credit for Order

tom karen Order Processing

6.0

Capture Customer Preferences for Product

tom karen CRM

b. Below is continuation of the previous table:

Status Desirability Priority Milestone Start Date Due Date

Approved – 20%

2. Highly Desirable

2. Prioritized Beta 6.0 <tomorrow’s date>

<one month from today>

Under Consideration – 10%

3. Desirable 3. Normal Priority

Early Adopter 6.0

<week from today>

<one month from start date>

Under Consideration – 10%

3. Desirable 3. Normal Priority

<one month from today>

c. Change the status of the first feature (“Create FY Management Reports for Orders by Sales Rep”) to “Functionally complete – 80%.” Review the dashboard. What do you observe?

d. Create the following milestones:

Milestone Date Owner Release Description

Beta 6.0 <one month from today>

<your name> 6.0 Beta Release for Order Management System 6.0

Early Adopter 6.0

<one month from today + 3 weeks>

<your name> 6.0 Early Adopter Release for Order Management System 6.0

Production 6.0

<one month from today + 6 weeks>

<some other name>

6.0 Production Release for Order Management System 6.0

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 309: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 5

e. View the milestones in the calendar.

f. Specify the Early Adopter 6.0 milestone for the “Allow more than one Sales rep to Get credit for Order” feature.

g. Specify the Beta 6.0 milestone for the “Create FY Management reports for Orders by Sales Rep” feature.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 310: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 6

Practice 19-2: Adding and Monitoring Feedback in Your Application

Overview In this practice, you create a feedback page, submit feedback, and review and categorize feedback as feature, bug, or to do.

Assumptions You have performed the previous practices or imported both LAB03_SOLN.SQL and LAB181_ORDER_MGMT_SOLN.SQL packaged applications.

Tasks a. Create a feedback form for your Order Management application.

b. Create the following feedback from your application:

Feedback Number

Feedback Text Feedback Type

1 Date format needs to be changed on Master detail Page to MM/DD/YYYY

General Comment

2 Error when deleting a line item on an order Bug

3 Add label help text on Orders page General Comment

c. Review your feedback in Team Development.

d. Log feedback 1 (“Date format needs to be changed on Master detail Page to MM/DD/YYYY”) as a feature with a status of “Functionally complete - 80%.”

e. Log feedback 3 (Add label help text on Orders page ) as a To Do, assign it to tom, and change the status to “Assigned - 30%.” Delete the feedback entry after logging it as a To Do.

f. Edit the To Do, changing the status to “Work Progressing - 80%” and specifying Documentation for the category.

g. Log feedback 2 (“Error when deleting a line item on an order”) as a bug. Set the severity to “4. Moderate Impact” and assign it to tom.

h. Edit the bug and change the status to “80. Fixed in development,” set the priority to “1. As soon as possible,” and set the estimated fix date to a week before Beta.

i. Review the Team Development dashboard. Note: You must set the Release to 6.0 to see all the components.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 311: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 7

Practice Solution 19-1: Adding Milestones and Features to Your Development Project

Overview In this practice, you add features and milestones to your Order Management Release 6.0 project.

Tasks a. Create the following features (both tables are needed to create each feature):

Feature Owner Contributor Focus Area Release

Create FY Management Reports for Orders by Sales Rep

karen tom Reporting 6.0

Allow more than one Sales rep to Get Credit for Order

tom karen Order Processing

6.0

Capture Customer Preferences for Product

tom karen CRM

b. Below is continuation of the previous table:

Status Desirability Priority Milestone Start Date Due Date

Approved – 20%

2. Highly Desirable

2. Prioritized Beta 6.0 <tomorrow’s date>

<one month from today>

Under Consideration – 10%

3. Desirable 3. Normal Priority

Early Adopter 6.0

<week from today>

<one month from start date>

Under Consideration – 10%

3. Desirable 3. Normal Priority

<one month from today>

1) On the Application Express home page, click the Team Development icon.

2) Click Features.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 312: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 8

3) Click Create Feature.

4) Enter the following information and click Create Feature.

Name Value

Feature Create FY Management Reports for Orders by Sales Rep

New Owner karen

New Contributor tom

New Focus Area Reporting

New Release 6.0

Feature Status Approved – 20%

Desirability 2. Highly desirable

Priority 2. Prioritized

Start Date Select tomorrow’s date

Due Date Select date one month from now

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 313: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 9

5) Your feature was created. You want to create another feature. Click Create Feature.

6) Enter the following information and click Create Feature.

Name Value

Feature Allow more than one Sales rep to Get Credit for Order

Feature Owner tom

Contributor karen

New Focus Area Order Processing

Release 6.0

Feature Status Under consideration – 10%

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 314: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 10

Name Value

Desirability 3. Desirable

Priority 3. Normal Priority

Start Date Select date a week from today

Due Date Select date one month from start date

7) Your feature was created. You want to create another feature. Click Create Feature.

8) Enter the following information and click Create Feature.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 315: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 11

Name Value

Feature Capture Customer Preferences for Product

Feature Owner tom

Contributor karen

New Focus Area CRM

New Release 7.0

Feature Status Under consideration – 10%

Desirability 3. Desirable

Priority 3. Normal Priority

Milestone

Start Date Select date one month from today

Due Date

9) To view all the features that you created, click the Features tab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 316: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 12

c. Change the status of the first feature (“Create FY Management Reports for Orders by Sales Rep”) to “Functionally complete – 80%.” Review the Dashboard. What do you observe?

1) You can edit one of the features. Click the Edit icon for the first feature that you created.

2) Change Feature Status to Functionally Complete – 80% and click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 317: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 13

3) Click the Dashboard tab.

4) Notice that the Percent Complete indicator has changed. This indicator averages completeness based upon the feature being at least 80% complete. If, for example, you had 10 features and one is 100% complete and the other 9 are 60% complete, the Percent Complete indicator on the Dashboard page would be 10% because 1 of the 10 is 80% or higher. You are ready to create milestones. Click the Team Development breadcrumb.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 318: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 14

d. Create the following milestones:

Milestone Date Owner Release Description

Beta 6.0 <one month from today>

<your name> 6.0 Beta Release for Order Management System 6.0

Early Adopter 6.0

<one month from today + 3 weeks>

<your name> 6.0 Early Adopter Release for Order Management System 6.0

Production 6.0

<one month from today + 6 weeks>

<some other name>

6.0 Production Release for Order Management System 6.0

1) From the Team Development Page, click the Milestones icon.

2) You currently do not have any milestones. Click Create Milestone.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 319: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 15

3) Enter the following information and click Create.

Name Value

Milestone Beta 6.0

Date <one month from today>

Owner <your name>

Release 6.0

Description Beta Release for Order Management System 6.0

4) Your milestone was created. Notice that the Dashboard information is updated based on the information entered. In this case, there are 31 days until you reach your milestone date. You want to create another milestone. Click Create Milestone.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 320: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 16

5) Enter the following information and click Create.

Name Value

Milestone Early Adopter 6.0

Date <one month from today + 3 weeks>

Owner Select your name from the list

Release 6.0

Description Early Adopter Release for Order Management System 6.0

6) Your milestone was created successfully. You want to create one more for production. Click Create Milestone.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 321: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 17

7) Enter the following information and click Create.

Name Value

Milestone Production 6.0

Date <one month from today + 6 weeks>

Owner Enter someone else’s name in New Owner

Release 6.0

Description Production Release for Order Management System 6.0

e. View the milestones in the calendar.

1) Your milestone was created successfully. You can view your milestones in the calendar. Click the Calendar tab.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 322: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 18

2) Because your first milestone is a month ahead, click the right arrow to go to the next month.

3) The milestones are displayed in the calendar. You want to associate these milestones with the features that you created earlier. Click the Team Development breadcrumb.

f. Specify the Early Adopter 6.0 milestone for the “Allow more than one Sales rep to Get credit for Order” feature.

1) Because you only have milestones for Release 6.0, you can narrow the list of features by selecting 6.0 from the Release list.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 323: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 19

2) Click Set.

3) Notice that only two features (for Release 6.0) are now in the list of features. Select the Allow more than one Sales rep to Get Credit for Order link.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 324: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 20

4) Select Early Adopter 6.0 from the list of milestones.

5) Click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 325: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 21

g. Specify the Beta 6.0 milestone for the “Create FY Management reports for Orders by Sales Rep” feature.

1) Click the Create FY Management reports for Orders by Sales Rep link from the list of Features.

2) Select Beta 6.0 from the Milestone list and click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 326: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 22

3) The features have been updated and the percent of features complete, in Dashboard on the right side of the window, has been updated. 50% is displayed, because there are two features, one of which is 80% complete and the other of which is less than 80% complete.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 327: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 23

Practice Solution 19-2: Adding and Monitoring Feedback in Your Application

Overview In this practice, you create a feedback form in your application, submit feedback, and review and categorize the feedback.

Tasks a. Create a feedback form for your Order Management application.

1) Select Database Applications from the Application Builder drop-down list.

2) Select the Order Management application.

3) You want to create a new feedback page. Click Create Page.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 328: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 24

4) Select Feedback Page and click Next.

5) Enter Feedback for Page Name, select No Tabs – Right Sidebar (fixed-width / DIV based) for Popup Page Template, and click Create. Notice that a navigation bar entry will be created and feedback will be enabled.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 329: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 25

6) Click Run Application.

7) If you receive the login window, enter your username and password and click Login. If you do not receive the login window, click Logout and log in as ora<n>.

b. Create the following feedback from your application:

Feedback Number

Feedback Text Feedback Type

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 330: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 26

Feedback Number

Feedback Text Feedback Type

1 Date format needs to be changed on Master detail Page to MM/DD/YYYY

General Comment

2 Error when deleting a line item on an order Bug

3 Add label help text on Orders page General Comment

1) Click Feedback in the navigation bar.

2) Enter Date format needs to be changed on Master detail Page to MM/DD/YYYY in the feedback text area, and click Submit Feedback.

3) You want to create another feedback item. Click Feedback in the navigation bar.

4) Enter Error when deleting a line item on an order in the feedback text area, and select Bug for Feedback Type.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 331: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 27

5) Click Submit Feedback.

6) You want to create another feedback item. Click Feedback in the navigation bar.

7) Enter Add label help text on Orders page in the feedback text area, and click Submit Feedback.

8) You have entered all your feedback. Now you want to go view it in Team Development. Click Home in the Developer toolbar.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 332: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 28

c. Review your feedback in Team Development.

1) Select Feedback from the Team Development drop-down list.

2) The Feedback dashboard is displayed. Notice that feedback items have been filed. Under Top Feedback Filters, click the 3 link to see the feedback.

d. Log feedback 1 (“Date format needs to be changed on Master detail Page to MM/DD/YYYY”) as a feature with a status of “Functionally complete - 80%.”

1) Your feedback is displayed. Click the Log as Feature button for feedback 1.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 333: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 29

2) Specify the following and click Create Feature:

Name Value

Feature Name Date format needs to be changed on Master detail Page to MM/DD/YYYY

Release 6.0

Assigned To karen

Start Date Select tomorrow’s date

Due Date Select date one month from now

Desirability 3. Desirable

Priority 3. Normal Priority

Feature Status Functionally complete - 80%

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 334: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 30

e. Log feedback 3 (“Add label help text on Orders page”) as a To Do, assign it to tom, and change the status to “Assigned - 30%.” Delete the feedback entry after logging as a To Do.

1) You want to make feedback 3 a To Do. Click the Log as Todo button for Feedback 3.

2) Specify the following and click Create To do.

Name Value

Release 6.0

Assigned To tom

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 335: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 31

Name Value

To do status Assigned - 30%

Delete feedback entry <checked>

f. Edit the To Do, changing the status to “Work Progressing - 80%” and specifying Documentation for the category.

1) Click Edit To Do.

2) Change the Status to Work Progressing – 80%, enter Documentation for New Category, and click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 336: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 32

g. Log feedback 2 (“Error when deleting a line item on an order”) as a bug. Set the severity to “4. Moderate Impact,” and assign it to tom.

1) Feedback 2 is a bug. Click the Log as Bug button for feedback 2.

2) Specify the following and click Create Bug.

Name Value

Severity 4. Moderate Impact

Release 6.0

Assign To tom

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 337: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 33

3) Click the Team Development breadcrumb.

4) To view the bug that you just assigned, click Bugs.

5) From the Dashboard, select 6.0 for Release and click Set.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 338: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 34

6) Click the number of bugs in the Percent Closed region.

h. Edit the bug and change the status to “80. Fixed in development”, set the priority to “1. As soon as possible,” and set the estimated fix date to a week before Beta.

1) Click the Edit icon for the bug.

2) Select 80. Fixed in development for Status, As soon as possible for Priority, Beta 6.0 for Target Milestone, and select a date for the Estimated Fix Date to day that is a week before the target milestone. Then click Apply Changes.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 339: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 35

i. Review the Team Development dashboard. Note that you must set the Release to 6.0 to see all the components.

1) Select the Team Development breadcrumb.

2) An overview of all your features, milestones, To Dos, and bugs are displayed, as well as a dashboard on the right that indicates the percent complete for each component.

Oracle In

ternal & O

racle Aca

demy

Use O

nly

Page 340: APEX Developing Web Apps

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 19: Managing and Maintaining the Application Development Process

Chapter 19 - Page 36

Oracle In

ternal & O

racle Aca

demy

Use O

nly