You are on page 1of 35

Course Overview

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

Course Objectives
After completing this course, you should be able to do the following: Manage application navigation by using hierarchical lists with images, database-driven navigation, site maps, and dashboards Build custom tabular forms that use collections and validations Define client-side behaviors Create and customize Plug-ins Extend your application to add binary large object (BLOB) data, send email notifications, use RESTful Web services, and integrate with SQL Developer

1-2

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

Course Objectives
Manipulate application content through templates, themes, and style sheets Create reports declaratively and use the print APIs Use advanced charting techniques Secure your application by using Lightweight Directory Access Protocol (LDAP) and prevent SQL injection attacks and cross-site scripting and usage of Session State Protection Monitor and manage your application by using custom reports

1-3

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

Managing Application Navigation

Preview

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

Objectives
After completing this lesson, you should be able to: Differentiate between various navigation objects (tabs, breadcrumbs, lists, navigation bar entries, and trees) Build a hierarchical list with images Build a database-driven navigation report Build a site map Add a dashboard Incorporate security into navigation Link interactive reports Manage feedback

3-2

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

Navigation Choices

1 3

3-3

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

Building a Hierarchical List with Images

3-4

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

Building a Hierarchical List with Images


Steps 1. Update the list with the desired sublist items. 2. Identify and upload the images to include. 3. Change the template of the list region. 4. Change navigation region settings. 5. Associate an image with a list item.

3-5

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

Building a Database-Driven Navigation Report


This report is used to navigate between pages by using links defined against values in the database. 1. Create a report based on a column. 2. Create a link to page and pass ID value.

3-6

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

Building a Site Map


A site map is used to navigate between pages by page title. 1. Create a page group with the pages you want to appear in the site map. 2. From Activity, create SQL from the APEX_APPLICATION_PAGES view. 3. Create a report that shows the page name. 4. Create a link from the item to #PAGE_ID#. 5. Modify the report to use the desired templates.

3-7

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

Adding a Navigation Bar Entry


To access the site map, create a navigation bar entry: 1. From Shared Components, select Navigation Bar Entry. 2. Click Create. 3. Select From Scratch and click Next. 4. Select Navigation to URL and click Next. 5. Enter Site Map for Entry Label click Next. 6. Select the site map page from the Page drop-down list and click Next. 7. Click Create.

3-8

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

Enforcing Authorization on Your Site Map


Showing an entry on the site map based on authorization requires the following: 1. Create a function that checks for authorization. 2. Update the SQL query on the report to check whether the function is true.

Administrator

Developer

3-9

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

Adding a Dashboard Page


A dashboard page provides a dynamic overview of your application.

3 - 10

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

Linking Interactive Report Regions


Provide a declarative filter where value is Passed from one interactive report region to another.

3 - 11

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

Managing Feedback

3 - 12

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

Synchronizing Beta and Development Feedback

Test (beta) System Export/Import Feedback

Development System

Export/Import Feedback Response

ora01

ora02

3 - 13

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

Building Custom Tabular Forms

Objectives
After completing this lesson, you should be able to: Build a custom tabular form Add validations to your tabular form Manage changes to the tabular form by using collections

4-2

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

What Is a Tabular Form?


A tabular form allows users to update multiple rows in a table concurrently from a single page.

Declarative

Manual

4-3

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

Building a Tabular Form Manually


Build a SQL report. Create an Update button. Add a process to perform the update.

4-4

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

SQL Report Query


Uses the APEX_ITEM API to create a query.
SELECT apex_item.hidden(1,employee_id) || apex_item.display_and_save(2,last_name) last_name , apex_item.text(3,email,8) email , apex_item.date_popup(4,null,hire_date,'DD-MON-YYYY',10,null,null, lpad(to_char(rownum),4,'0')) hiredate , apex_item.select_list_from_query(5,job_id,'select distinct job_id, job_id from oehr_employees',10) job , apex_item.text(6,salary,6) salary , apex_item.text(7,commission_pct,6) commission , apex_item.popupkey_from_query(8,manager_id,'select last_name, employee_id from oehr_employees',10) manager , apex_item.select_list_from_query(10,department_id,'select department_name, department_id from oehr_departments',10) dname FROM oehr_employees

4-5

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

PL/SQL Process: Using the APEX_APPLICATION API


Create a PL/SQL process with the following code:
for i in 1..apex_application.g_f01.count loop update oehr_employees set email = apex_application.g_f03(i), hire_date = apex_application.g_f04(i), job_id = apex_application.g_f05(i), salary = apex_application.g_f06(i), commission_pct = apex_application.g_f07(i), manager_id = replace(apex_application.g_f08(i),'%'||'null%',NULL), department_id = replace(apex_application.g_f10(i),'%'||'null%',NULL) where employee_id = apex_application.g_f01(i); end loop;

4-7

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

Not Null PL/SQL Validation


Ensures that valid values are entered before the data is updated in the database

After the error message is displayed, click Back in your browser to return to the tabular form.

4-8

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

Adding a Not Null PL/SQL Validation


Page-level PL/SQL validation with Function Returning Error Text on the Error page
FOR i IN 1..apex_application.g_f01.count LOOP IF apex_application.g_f01(i) IS NOT NULL THEN IF apex_application.g_f03(i) IS NULL THEN RETURN 'Email must have some value.'; END IF; IF apex_application.g_f04(i) IS NULL THEN RETURN 'Hire Date must have some value.'; END IF; IF apex_application.g_f06(i) IS NULL THEN RETURN 'Salary must have some value.'; END IF; END IF; END LOOP;

4-9

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

Creating and Using a Collection on a Tabular Form


1. 2. 3. 4. 5. 6. Create a process to load the collection. Create a query against the collection. Modify the report attributes. Create a button and process to add a row to the collection. Create a process to update the collection. Create a button and process to delete a row from the collection. 7. Update the database from the collection. 8. Change the validation to use the collection.

4 - 10

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

Defining Client-Side Behaviors

Objectives
After completing this lesson, you should be able to: Describe dynamic actions Explain the two types of dynamic actions: standard and advanced Create advanced dynamic actions to define complex clientside behavior such as the following:
Changing the class when an item is null Disabling a button when an item is null Highlighting an item when the value of another item changes Setting the value of an item when another item changes Deleting and re-creating a row in a report
5-2 Copyright 2010, Oracle and/or its affiliates. All rights reserved.

Dynamic Actions
Use dynamic actions to define complex client-side behavior declaratively. Two types of dynamic actions:
Standard Advanced

Example of using a standard dynamic action

Example of using an advanced dynamic action

5-3

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

Creating and Using Advanced Dynamic Actions: Examples


This lesson covers the following examples of creating and using advanced dynamic actions in Application Express. Changing the class when an item is null Disabling a button when an item is null Highlighting an item when the value of another item changes Setting the value of an item when another item changes Deleting and re-creating a row in a report

5-4

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

Changing the Class When an Item Is Null

A red border is applied when a user leaves the Last Name field empty.

5-5

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

Disabling a Button When an Item Is Null

Last Name and Salary are not null and Apply Changes button is enabled.

Last Name is null and Apply Changes button is disabled.

Salary is null and Apply Changes button is disabled.

5-6

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

Highlighting an Item When the Value of Another Item Changes

Austin

Selecting a department id refreshes the manager id select list.

The Manager Id field is highlighted when refreshed.

5-7

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

Setting the Value of an Item When Another Item Changes


Job Id changes the commission percentage.

Salary changes the commission percentage.

5-8

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

Deleting and Re-Creating a Row in a Report

The first row is deleted. To re-create, click Recreate Employees.

5-9

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

Refreshing the Data in a Report Using Custom Filters

Filtering the report based on department

Filtering the report based on department and job

5 - 10

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

You might also like