Oracle HTML DB Tutorial

97
Oracle HTML DB Tutorial: Issue Tracking System (for v 1.6) 14 January 2005

Transcript of Oracle HTML DB Tutorial

Page 1: Oracle HTML DB Tutorial

Oracle HTML DB Tutorial:

Issue Tracking System

(for v 1.6)

14 January 2005

Page 2: Oracle HTML DB Tutorial

Document Releases Date Description11-JAN-2005 Initial Release 14-JAN-2005 Updated Section 8, Creating the Application, to specify to use your

development username and password to login to the application.

Page 2 of 2

Page 3: Oracle HTML DB Tutorial

Contents 1 Preface......................................................................................................................................... 6

Audience ..................................................................................................................................... 6 Software ...................................................................................................................................... 6

2 Introduction................................................................................................................................. 6 3 Scenario....................................................................................................................................... 6 4 Planning and Analysis of Project................................................................................................ 7

Establishing Requirements.......................................................................................................... 7 Necessary Data........................................................................................................................ 7 Requested Security.................................................................................................................. 7 Data Management Functions .................................................................................................. 8 Data Presentation Functions ................................................................................................... 8 Special Functions .................................................................................................................... 8

5 Designing the Database Objects ................................................................................................. 9 Figure 1: Entity Relationship Diagram for Issue Tracker....................................................... 9

Projects........................................................................................................................................ 9 Figure 2: Projects Table Details............................................................................................ 10

People........................................................................................................................................ 10 Figure 3: People Table Details.............................................................................................. 10

Issues......................................................................................................................................... 11 Figure 4: Issues Table Details............................................................................................... 11

6 Implementing the Database Objects ......................................................................................... 12 Requesting a New Workspace .................................................................................................. 12 Building the Objects ................................................................................................................. 12 Viewing Created Objects .......................................................................................................... 13

7 Loading Demonstration Data.................................................................................................... 13 Loading Projects Data........................................................................................................... 13 Loading People Data............................................................................................................. 14 Loading Issues Data.............................................................................................................. 14

8 Building the Basic User Interface ............................................................................................. 15 Creating the Application ........................................................................................................... 15

Image 1 - Defaulted Home Page........................................................................................... 15 Adding Content......................................................................................................................... 16

Projects.................................................................................................................................. 16 Projects Maintenance - Default Pages ....................................................................... 16

Image 2 - Initial Projects Report................................................................................... 18 Image 3 - Initial Create/Edit Project ............................................................................. 18 Projects Maintenance - Refine Report Page............................................................... 18

Image 4 - Revised Projects Report................................................................................ 19 Projects Maintenance - Refine Create/Edit Page....................................................... 20

Image 5 - Revised Create/Edit Project.......................................................................... 21

Page 3 of 3

Page 4: Oracle HTML DB Tutorial

Contents (cont.)

People.................................................................................................................................... 21

People Maintenance - Default Pages ......................................................................... 21 Image 6 - Initial People Report..................................................................................... 22 Image 7 - Initial Create/Edit Person Information ......................................................... 23 People Maintenance - Refine Report Page................................................................. 23

Image 8 - Revised People Report.................................................................................. 24 People Maintenance - Refine Create/Edit Page ......................................................... 24

Image 9 - Revised Create/Edit Person Information ...................................................... 26 Issues..................................................................................................................................... 27

Issue Maintenance - Default Pages ............................................................................ 27 Issue Maintenance - Refine Create/Edit Page............................................................ 27

Image 10 - Revised Create/Edit Issue........................................................................... 34 Refine Issues Report.................................................................................................... 34

Image 11 - Revised Issue Report .................................................................................. 41 Assigning Issues .......................................................................................................... 41

Image 12 - Assign Issues .............................................................................................. 44 Reports .................................................................................................................................. 44

Issue Summary, by Project.......................................................................................... 44 Image 13 - Issue Summary, by Project ......................................................................... 48 Resolved by Month Identified...................................................................................... 48

Image 14 - Resolved by Month Identified .................................................................... 50 Target Resolution Dates ............................................................................................. 50

Image 15 - Target Resolution Dates ............................................................................. 52 Average Days to Resolve ............................................................................................ 53

Image 16 - Average Days to Resolve ........................................................................... 54 Home Page ............................................................................................................................ 54

Reports Menu.............................................................................................................. 54 Maintenance Navigation............................................................................................. 56 Add New Issue Button ................................................................................................. 57 Add Overdue Issues..................................................................................................... 58 Add Unassigned Issues ............................................................................................... 59 Add Recently Opened Issues ....................................................................................... 60 Add Open Issues by Project ........................................................................................ 62 Breadcrumb Menu ...................................................................................................... 62 Revised Home Page .................................................................................................... 66

Image 17 - Revised Home Page.................................................................................... 66

Page 4 of 4

Page 5: Oracle HTML DB Tutorial

Contents (cont.) 9 Adding Advanced Features....................................................................................................... 67

Email Notification..................................................................................................................... 67 New Assignment................................................................................................................... 67

Image 18 - Example Assignment Email ...................................................................... 69 Overdue Issues ...................................................................................................................... 69

Image 19 - Example Overdue Issues Email ................................................................ 72 Application Security ................................................................................................................. 72

Restrict Project and People Definition.................................................................................. 72 Image 20 - Projects page running as HOWTO2......................................................... 75 Image 21 - Create/Edit Projects being accessed by unauthorized user ..................... 75

Restrict Issue Modification ................................................................................................... 76 Image 22 - Create/Edit Issue when user not assigned nor Project Lead.................... 79

10 Deploying the Application....................................................................................................... 80 Moving the Application Definition........................................................................................... 80 Loading Data............................................................................................................................. 81 Alternate Authentication Mechanisms...................................................................................... 82 Creating Users........................................................................................................................... 82 Publishing the URL................................................................................................................... 83

Appendix A: Application DDL..................................................................................................... 84 Appendix B: Demonstration Data................................................................................................. 90

Create Projects Data.................................................................................................................. 90 Update Project Dates Script ...................................................................................................... 90 Create People Script.................................................................................................................. 90 Create Issues Script................................................................................................................... 92

Page 5 of 5

Page 6: Oracle HTML DB Tutorial

1 Preface Oracle HTML DB Tutorial: Issue Tracking System describes how to use the Oracle HTML DB development environment to build and deploy a database-centric Web application. Specifically, the application tracks the assignment, status and progress of issues related to identified projects.

Audience Oracle HTML DB Tutorial: Issue Tracking System is intended for developers with a general understanding of relational database concepts as well as an understanding application development.

Software The directions in this document are specific to the capabilities and presentation of Oracle HTML DB version 1.6.

2 Introduction An application is the combination of information along with a user interface used to collect, manage, and view that information. Generally, applications are used to assist with a specific business function. With Oracle, information is organized into tables that group similar information together, removing redundancies. Using Oracle HTML DB to create a user interface, you create a collection of screens (called pages) that presents the data to the user and enables the user to easily interact with it. This tutorial demonstrates how to design and build an application in Oracle HTML DB using data stored in an Oracle database. The only software necessary to interact with Oracle HTML DB, either as a developer or as an end user, is a recent web browser. This tutorial will take approximately four to five hours to complete from start to finish. It is recommended that you read through the entire document first to become familiar with the material before you attempt the exercise.

3 Scenario Effective project management is the key to completing any project on time and within budget. Within every project there are multiple issues that need to be tracked, prioritized, and dealt with. The MRVL Company has several projects that must be completed on time for the company to be profitable. Missing the planned deadlines for any of these projects will cause the company to lose money. The managers of these projects are tracking issues in several different ways. Some are manually tracking issues in notebooks and others are tracking issues in text documents. There are even some trying to automate a bit and using spreadsheets to record and manage issues.

Page 6 of 6

Page 7: Oracle HTML DB Tutorial

By creating a hosted application in Oracle HTML DB, each project lead can easily record and track issues in one central location. Not only will everyone have access to just the data they need, but having the data stored in one location, will make it easier for management to determine if any critical issues are not being addressed.

4 Planning and Analysis of Project Before any development work can begin, the project leads need to define the requirements for the new application. These requirements will then be turned into a database design and an outline for a user interface to accept and present the data.

Establishing Requirements There are many categories of requirements needed to fully understand an application. Below are the specifics for the necessary data, requested security, data management functions and data presentation functions. Necessary Data Currently, each project manager tracks information slightly differently. Together, they agree the application should include the following information:

• Summary of the issue • Detailed description of the issue • Who identified the issue • The date the issue was identified • Which project the issue is related to

Who the issue is assigned to e issue

• • A current status of th• Priority of the issue • Target resolution date

date • Actual resolution• Progress report • Resolution summary

they agreed upon the following access rules:

at a time ed to a project

n define and maintain projects and people

• Management needs views that summarize the data without access to specific issue details

Requested Security Because the project leads were concerned about everyone having access to all the information,

• Each team member and project lead is only assigned to one project• Each team member and project lead must be assign• Managers are never assigned to a specific project • Only the CEO and Managers ca• Everyone can enter new issues • Once assigned, only the person assigned or a project lead can change data about the issue

Page 7 of 7

Page 8: Oracle HTML DB Tutorial

Data Management Functions The next step is to specify how information will be entered into the system. In this case, users must be able to:

• Create issues • Assign issues • Edit issues • Create projects • Maintain projects

Create people • • Maintain people information • Maintain project assignments

Data Presentation Functions Once the data is entered into the application, users will need to view the data. New reports can be added in the future but the team decides they initially need to be able to view the following:

• All issues by project • Open issues by project

ct and for all • Overdue issues, by proje• Recently opened issues

nagers

a calendar • Days to Resolve Issues by person

nctions that the application must support. The following pecial functions have been identified:

• Notify the project lead when any issue becomes overdue

• Unassigned issues • Summary of issues by project, for ma• Resolved issues by month identified • Issue resolution dates displayed on

Special Functions The last step is to identify any special fus

• Notify people when an issue is assigned to them

Page 8 of 8

Page 9: Oracle HTML DB Tutorial

5 Designing the Database Objects Once the requirements have been finalized, the next step is to organize the information the application needs to track into tables. Based on the requirements, there are three tables necessary:

• Projects. This table will track all current projects. • People. This table will contain information about who can be assigned to handle issues. • Issues. This table will hold all the information about an issue, including the project to

which it is related and the person assigned to rectify the issue.

Below is a simple Entity Relationship Diagram (ERD) displaying how the three tables relate to one another.

Figure 1: Entity Relationship Diagram for Issue Tracker

Additional database objects, such as sequences and triggers, will also be needed to support the tables. System generated primary keys will be used for all tables so that all the data can be edited without needing to implement cascade update.

Projects Each project will have a name and include a project start date as well as the projected end date. These dates will be used to help determine if any outstanding issues are jeopardizing the end date. The following figure includes the details for the columns that will be included in the Projects table.

Page 9 of 9

Page 10: Oracle HTML DB Tutorial

Figure 2: Projects Table Details Column Name Type Size Not Null? Constraints Notes project_id integer Y primary key populated by a sequence via a

trigger project_name varchar2 100 Y unique key start_date date Y target_end_date date Y actual_end_date date N

The Data Definition Language (DDL) for all the objects associated to the Projects table is contained in Appendix A: Application DDL.

PeopleEach person will have a name and a defined role within the company. Project leads and team members will also have an assigned project. The application will track emails for people so that email notification can be integrated into the application. Email address will be used as the application user name. That will tie the current user to their role within the organization. This application has been simplified for the purposes of this exercise. People data is usually much more elaborate and can be pulled from a corporate Human Resource system. Also, people typically work on more than one project at a time. If the roles that are assigned to a person needed to be dynamic, it would have been implemented as a separate table with a foreign key back to the people table. The following figure includes the details for the columns that will be included in the People table. Figure 3: People Table Details Column Name Type Size Not Null? Constraints Notes person_id integer Y primary key populated by a sequence via

a trigger person_name varchar2 100 Y unique key person_email varchar2 100 Y person_role varchar2 7 Y check

constraint

assigned_project integer N foreign key to Projects

The DDL for all the objects associated to the People table is contained in Appendix A: Application DDL.

Page 10 of 10

Page 11: Oracle HTML DB Tutorial

Issues In the requirements section of this document, the project leads identified the information relevant to issues. This was all included as columns along with some additional columns to provide an audit trail. This audit trail will track who created the issue, when it was created, as well as who last modified the issue and on what date that modification was made. A real-world application might need more extensive auditing by tracking each change to the data, rather than just the last change. That would require an additional table, linked to the issues table. If the valid priorities assigned to issues needed to be dynamic, it would have been implemented as a separate table with a foreign key back to the issues table. The following figure includes the details for the columns that will be included in the Issues table. Figure 4: Issues Table Details Column Name Type Size Not Null? Constraints Notes issue_id integer Y primary key populated by a

sequence via a trigger issue_summary varchar2 200 Y issue_description varchar2 2000 N identified_by integer Y foreign key

to People

identified_date date Y related_project integer Y foreign key

to Projects

assigned_to integer N foreign key to People

status varchar2 8 Y check constraint

automatically set to Open when new, set to Closed when actual resolution date entered

priority varchar2 6 N check constraint

target_resolution_date date N progress varchar2 2000 N actual_resolution_date date N resolution_summary varchar2 2000 N created_date date Y populated by a triggercreated_by varchar2 60 Y last_modified_date date N populated by a trigger

The DDL for all the objects associated to the Issues table is contained in Appendix A: Application DDL.

Page 11 of 11

Page 12: Oracle HTML DB Tutorial

6 Implementing the Database Objects The objects that support this application need to be created in the Oracle database within a user account. For this application, a new Oracle HTML DB workspace will be requested. Each workspace is provisioned, or created, with an initial schema and this schema will be used to house the application objects. You may also skip this section and use an existing workspace and schema in your local installation of Oracle HTML DB.

Requesting a New Workspace To request a new Oracle HTML DB workspace:

1. Go to http://htmldb.oracle.com/.

(This is a link to the Oracle supported site for HTML DB development. If you have an Oracle HTML DB instance, use that site instead.)

2. Click Request a Workspace under Tasks. 3. Follow the directions and submit request. 4. You will be notified via email when your request has been approved and your

workspace provisioned.

Building the Objects The information in the Designing the Database Objects section of this document has been turned into Oracle DDL (Data Definition Language). That DDL is contained within Appendix A: Application DDL and will be used in this portion of the application development process. There are several ways that objects can be created using Oracle HTML DB. They are all functions of the SQL Workshop. The first way is to use Create Object from the main SQL Workshop page. This function walks through all the choices necessary to create the selected object type. The second way is the use the SQL Command Processor from the main SQL Workshop page. This runs commands that you type or paste in. The processor can only process one command at a time. The third way is to Upload a script, using Scripts from the main SQL Workshop page. This script would contain the create object statements. Once the script is uploaded, it can then be run. The fourth way, and the method used for this application, is to create a script on-line. This way all the objects will be created with just a few clicks without the need to first save a file to your hard drive. To create the objects necessary for this application:

1. After login, you will be left on the Application selection page. Select SQL Workshop above the Applications list.

2. Under SQL Scripts, select Scripts. 3. Click Create>. 4. For Script Name, enter DDL for Issue Management Application and click Next>. 5. For Script, paste in the DDL from Appendix A: Application DDL. 6. Click Create Script.

Page 12 of 12

Page 13: Oracle HTML DB Tutorial

7. Select Run in the row adjacent to your DDL for Issue Management Application script.

8. Select Parse As to be the schema owner that was created with your workspace or the existing schema owner you wish to use for this exercise.

9. Click Run Script. 10. You will be left on the Summary Statistics page and should see No Error for all the

commands.

Viewing Created Objects Now that the objects have been created, you can see them by using the SQL Workshop Browse feature. To view these objects:

1. Select the SQL Workshop tab. 2. Under Database Browser, click Tables.

3. To view the details of a specific object, click the magnifying glass ( ) to the left of the object name.

7 Loading Demonstration Data To properly view the application that you will be creating, you will need data loaded into the tables. Data can be loaded in manually, via an Oracle import, using the Oracle HTML DB Data Workshop or SQL Workshop. You will use both the Data Workshop and SQL Workshop to load in your demonstration data. If you look at the DDL, you will notice that the sequences used for the primary keys were set to start at 40. That was to leave room for the demonstration data. The before insert triggers were coded in such a way that the sequence is only accessed if a primary key value is not provided. This was done so that they will not need to be disabled in order for you to load in data. Loading Projects Data The Projects data will be loaded using the Data Workshop. You can import text data, xml data or spreadsheet data. You will import text data using the Projects data contained in Appendix B.

1. Select the Data Workshop tab. 2. Under Data Import, select Import Text Data. 3. For Import To, select Existing table. 4. For Import From, keep Copy and paste (up to 30 KB). 5. Click Next>. 6. Select the Table/View Owner for this application (the default will be correct if you

are using a new Workspace) and click Next>. 7. For Table Name, enter HT_PROJECTS and click Next>. 8. For Data, paste in the text from Appendix B: Demonstration Data, Create Projects

Data. 9. Click Next>. 10. Review the Column Mapping and click Import Data. 11. You should be left on the Imports page and should see 5 records Succeeded and 0

records failed.

Page 13 of 13

Page 14: Oracle HTML DB Tutorial

The Projects have been created but the dates need to be updated to make the projects current. To do this, you will create a script and run it, just as you did for creating the database objects.

1. Select the SQL Workshop tab. 2. Under SQL Scripts, select Scripts. 3. Click Create>. 4. For Script Name, enter Update Project Dates and click Next>. 5. For Script, paste in the text from Appendix B: Demonstration Data, Update Project

Dates Script. 6. Click Create Script. 7. Select Run in the row adjacent to Update Project Dates script. 8. Select Parse As to be the appropriate schema owner. 9. Click Run Script. 10. You will be left on Summary Statistics with the Status of No Error for all the

commands. Loading People Data Now that the Project data has been loaded, you can load the People data. People needs to be done second because there are foreign keys to the Projects table. You will load the People data by creating a script and running it.

1. From the Summary Statistics page, click Cancel. This will bring you back to the Script Repository.

2. Click Create>. 3. For Script Name, enter Load People Data and click Next>. 4. For Script, paste in the text from Appendix B: Demonstration Data, Create People

Script. 5. Click Create Script. 6. Select Run in the row adjacent to your Load People Data script. 7. Select Parse As to be the appropriate schema owner. 8. Click Run Script. 9. You should be left on Summary Statistics with the Status of No Error.

Loading Issues Data The last data to load is the Issues data. This will be loaded using the same method you used for the People Data.

1. From the Summary Statistics page, click Cancel. This will bring you back to the Script Repository.

2. Click Create>. 3. For Script Name, enter Load Issues Data and click Next>. 4. For Script, paste in the text from Appendix B: Demonstration Data, Create Issues

Script. 5. Click Create Script. 6. Select Run in the row adjacent to your Load Issues Data script. 7. Select Parse As to be the appropriate schema owner. 8. Click Run Script. 9. You should be left on Summary Statistics with the Status of No Error.

Page 14 of 14

Page 15: Oracle HTML DB Tutorial

8 Building the Basic User Interface Now that the objects that support the application have been created and the demonstration data has been loaded, the user interface can be created. Using the Application Builder, an application will be created and then pages will be created to support the data management and data presentation functions that were identified by the project leads.

Creating the Application You can quickly default pages to both report on and create data for selected tables within a schema by using the Create Application Wizard. Alternatively, you can create just the application definition and then add pages as desired. This application needs customized overview pages to meet the requirements so the latter approach will be used. To create the application:

1. Click on Workspace in the breadcrumb menu, on the left, just below the tabs. This will bring you to the Workspace home page.

2. Click Create Application >. 3. Select From Scratch and click Next>. 4. For Application Name, enter Issue Tracker. Set Pages to 1. Click Next>. 5. For Tabs, select No Tabs and click Next>. 6. For Page Name for Page 1, enter Home and click Next>. 7. For Theme, select Theme 10 and click Next>. 8. Review your selections and click Create Application.

You can get a preview of the application theme by clicking Run. You will be prompted for your username and password again. This is part of the security of your newly defaulted application. Just provide your development username and password, the workspace does not need to be specified because it is known by the login package. Once you login, you will see your new Home page. It will look like the image below. Image 1 - Defaulted Home Page

Although the page has no content, it illustrates the following items that were created:

• Navigation Links - In the upper right of the screen are two Navigation Bar Entries. They allow the user to Print the current page and to Logout.

• Developer Links - At the bottom of the page are developer links. These are displaying because the user who is logged in is also a developer of the application. Regular users, those who have only been granted access to run the application, will not see these links. From left to right, you can; Edit Application - edit the application

Page 15 of 15

Page 16: Oracle HTML DB Tutorial

Edit Page 1 - edit the page that is running New - add a new component to the current page Session - open a new page with the session details Debug - show the page in debug mode Show Edit Links - displays quicklinks next to each object on the page that can be

edited. The link looks like and will appear to the right of the NavBar items, tabs, region titles, buttons, and items. Clicking on the link will popup a window to edit the object.

Also created are:

• Login page - This is the page that you used to login to the application. • Templates - A basic set of templates was created within the new application that fit

the UI Theme selected. • Authentication Schemes - Two authentication schemes were created. Internal

Account Credentials is used by default but a scheme for database authentication was also created.

Adding Content Now that the application structure has been defaulted, content can be added. Projects Projects Maintenance - Default Pages First you will create pages that will allow you to view and add data to the tables. You will use the Form on a Table with Report, 2 Pages Wizard to create a report page and maintenance page for each table starting with HT_PROJECTS.

1. Click Edit Application from the developer links. This will take you to the Application Builder home page with your new application selected.

2. Click Create Page >. 3. Select Page with Component and click Next>. 4. Select Form and click Next>. 5. Select Form on a Table with Report, 2 Pages and click Next>. 6. For Table/View Owner, select the appropriate schema and click Next>. 7. For Table/View Name, enter HT_PROJECTS and click Next>. 8. This next set of attributes are for the Report Page. For Page, enter 2. For Page

Name and Region Title, enter Projects. Click Next>. 9. For Tab Options, keep Do not use tabs and click Next>. 10. For Select Column(s), select every column except PROJECT_ID. Project Name is

unique and identifies the project. The ID was added to simplify the foreign key and allow for cascading updates. Click Next>.

11. For Edit Link Image, select and click Next>. 12. The rest of these attributes are for the Form Page. For Page, enter 3. For Page Name

and Region Title, enter Create/Edit Project. Click Next>. 13. For Tab Options, keep Do not use tabs and click Next>. 14. For Primary Key, keep PROJECT_ID and click Next>. 15. For Primary Key Source Type, keep Existing Trigger and click Next>. 16. For Select Column(s), selected all columns and click Next>.

Page 16 of 16

Page 17: Oracle HTML DB Tutorial

17. For Insert, Update and Delete, keep the defaults and click Next>.

Page 17 of 17

Page 18: Oracle HTML DB Tutorial

18. Review your selections and click Finish. 19. To get a preview, select Run Page.

You will first see the report that was created with the demo data displayed. Image 2 - Initial Projects Report

You can click the edit icon to view an existing row or click the Create button to create a new record. If you click the edit icon to the left of Employee Satisfaction Survey, you will see the following details. Image 3 - Initial Create/Edit Project

This is not the final state of these pages. You will make changes so they will look better and data entry will be easier for the end user. Projects Maintenance - Refine Report Page The Projects Report Page looks fine. To make it look a little better you will add format masks to the dates being displayed.

Page 18 of 18

Page 19: Oracle HTML DB Tutorial

1. Navigate to the Page Definition for page 2, Projects. 3. Under the Regions section, select Q to the left of Projects. This will bring you to the

Report Attributes for that region.

• Click the edit link to the left of START_DATE. For Number/Date Format, enter DD-MON-YYYY.

Click to navigate to the next Report Item. • You will now be on TARGET_END_DATE. For Number/Date Format, enter DD-MON-YYYY.

Click to navigate to the next Report Item. • You will now be on ACTUAL_END_DATE. For Number/Date Format, enter DD-MON-YYYY. Click Apply Changes.

• For PROJECT_ID, remove the Heading (currently set to Edit). • For START_DATE, TARGET_END_DATE and ACTUAL_END_DATE, for

Column Alignment and Heading Alignment, select center. • To enable column heading sorting, for all columns except PROJECT_ID, check

Sort. • For PROJECT_NAME, for Sort Sequence, select 1. This sets Project Name as

the default column to sort on but it will be overridden by any user selections. • Under the Sorting section, for Ascending and Descending Image, select the light

gray arrow ( ) by clicking on it. • Under the Messages section, for When No Data Found Message, enter No

Projects found.. • Click Apply Changes.

4. To view your changes, click the run icon ( ) in the upper right. Image 4 - Revised Projects Report

Page 19 of 19

Page 20: Oracle HTML DB Tutorial

Projects Maintenance - Refine Create/Edit Page You w u ield larger, the date fields sthat the target and actual end dates are after the start date.

1. Navigate to the Page Definition for Page 3, Create/Edit Project. 2. Und Items heading. This will allow you to edit selected

attr• der Width:

nter 60.

• y Changes.

ill c stomize the Create/Edit Project page to make the Project Name fmaller, change the date picker type and add a format mask for dates and add validations

er the Items section, click theibutes of all items. Scroll the window to the right and un For Project Name, e For Start Date, enter . 12 For Target End Date, enter 12. For Actual End Date, enter 12.

Click Appl• Click the edit page icon ( ) in the upper right.

tion, for Display As, select Date Picker (DD-MON-

3. Repeat the previous step for P3_TARGET_END_DATE and

4.

2. Under the Items section, select P3_START_DATE. • Under the Identification sec

YYYY). • Click Apply Changes.

P3_ACTUAL_END_DATE. Under the Validations section, click the create icon ( ). • For Identify the validation level, keep the default of Item level validation and

click Next>. • For t P3_TARGET_END_DATE and click Next>. Item, selec• For Select a validation method, select PL/SQL and click Next>. • ate, keep the default of

• and click Next>.

_START_DATE,'DD-MON-YYYY')

get End Date must be same or after Start Date.

5. create icon

For Pick the type of PL/SQL validation you wish to crePL/SQL Expression and click Next>. For Validation Name, enter TARGET_AFTER_START

• For Validation, enter:

to_date(:P3_TARGET_END_DATE,'DD-MON-YYYY') >= to_date(:P3

• For Error Message, enter: Tar

• Click Next>. • This validation should not be conditional so just click Create. To create the second validation, under the Validations section, click the( ).

For Identify the validation level, keep • the default of Item level validation and

TUAL_END_DATE and click Next>. • For Select a validation method, select PL/SQL and click Next>.

click Next>. • For Item, select P3_AC

Page 20 of 20

Page 21: Oracle HTML DB Tutorial

• ate, keep the default of

END_AFTER_START and click Next>.

START_DATE,'DD-MON-YYYY')

• Under Condition Type, click [item not null]. . This ensures that this

For Pick the type of PL/SQL validation you wish to crePL/SQL Expression and click Next>.

• For Validation Name, enter• or Validation, enter: F

to_date(:P3_ACTUAL_END_DATE,'DD-MON-YYYY') >= to_date(:P3_

• For Error Message, enter:

ate must be same or after Start Date. Actual End D

• Click Next>.

• For Expression 1, enter P3_ACTUAL_END_DATEvalidation will only fire if the user enters an Actual End Date.

• Click Create. 6. To see the changes, click the run icon ( ) in the upper right.

Image 5 - Revised Create/Edit Project

People People

Maintenance - Default Pages plete, you need toNow th work on HT_PEOPLE.

e

at the initial Projects pages are com

1. Click Edit Application from the developer links. This will take you to thted. Application Builder home page with your new application selec

2. Click Create Page >. 3. Select Page with Component and click Next>. 4. Select Form and click Next>. 5. Select Form on a Table with Report, 2 Pages and click Next>. 6. For Table/View Owner, select the appropriate schema and click Next>. 7. For Table/View Name, enter HT_PEOPLE and click Next>.

Page 21 of 21

Page 22: Oracle HTML DB Tutorial

8. This next set of attributes are for the Report Page. For Page, enter 4. For Page Name and Region Title, enter People and click Next>

N_ID and click Next>. 9. For Tab Options, keep Do not use tabs and click Next>. 10. For Select Column(s), select all columns except PERSO11. For Edit Link Image, select and click Next>. 12. The rest of these attributes are for the Form Page. For Page, enter 5.

ation and click

abs and click Next>. 15. For Primary Key, keep PERSON_ID and click Next>.

ce Type, keep Existing Trigger and click Next>.

13. For Page Name and Region Title, enter Create/Edit Person InformNext>.

14. For Tab Options, keep Do not use t

16. For Primary Key Sour17. For Select Column(s), select all the columns and click Next>. 18. For Insert, Update and Delete, keep the defaults and click Next>. 19. Review your selections and click Finish. 20. To get a preview, select Run Page.

Image 6 - Initial People Report

Click the Edit button to the left of a row to preview the page for creating and editing.

Page 22 of 22

Page 23: Oracle HTML DB Tutorial

Image 7 - Initial Create/Edit Person Information

People Maintenance - Refine Report Page Just as with the Projects Report, you will modify the People Report. You will change the query to include a join to the Projects table and modify headings.

1. Navigate to the Page Definition for page 4, People. 2. Under the Regions section, select People.

• For Region Source, enter:

select a."PERSON_ID", a."PERSON_NAME", a."PERSON_EMAIL", a."PERSON_ROLE", b."PROJECT_NAME" from "#OWNER#"."HT_PEOPLE" a, "#OWNER#"."HT_PROJECTS" b where a.assigned_project = b.project_id (+)

The outer join is necessary because the project assignment is optional.

3. Select the Report Attributes tab.

• For PERSON_ID, remove the Heading (currently set to Edit). • For PERSON_NAME, for Heading, enter Name. • For PERSON_EMAIL, for Heading, enter Email. • For PERSON_ROLE, for Heading, enter Role. • oject. For PROJECT_NAME, for Heading, enter Assigned Pr• For PROJECT_NAME, for Heading Align., select left. • To enable column heading sorting, for all columns except PERSON_ID, check

Sort. • For PERSON_NAME, for Sort Sequence, select 1. This sets Person Name as

the default column to sort on but it will be overridden by any user selections. • Under the Sorting section, for Ascending and Descending Image, select the light

gray arrow ( ) by clicking on it. • Under the Messages section, for When No Data Found Message, enter No

People found..

Page 23 of 23

Page 24: Oracle HTML DB Tutorial

• Click Apply Changes. 4. To view your changes, click the run icon ( ) in the upper right.

Image 8 - Revised People Report

People Maintenance - Refine Create/Edit Page Now that the report has been refined, you will work on the Create/Edit Page. You will add lists

f values to make the selection of Role and Assigned Project easier.

2. ponents on the right, under the Lists of Values section, click the

o

1. Navigate to the Page Definition for page 5, Create/Edit Person Information. Under Shared om Ccreate icon ( ). • For Create List of Values: keep From Scratch and click Next>.

ynamic and click Next>. •

d, project_id v jects

• Click Create Named LOV.

• For Name, enter PROJECTS. • For Type:, select D

For Query, enter:

ct_name select proje f m ht_proro order by d

Page 24 of 24

Page 25: Oracle HTML DB Tutorial

3. Under Shared Components on the right, under the Lists of Values section, click the create icon ( ).

4. For Create List of Values: keep From Scratch and click Next>. • For Name, enter ROLES. • For Type:, keep Static and click Next>. • Enter the following Display Value/Return Value pairs:

CEO/CEO nager Manager/Ma

Lead/Lead Member/Member

• Click the edit page icon in the upper right ( ) to return to editing Page 5.

5. Under the Items section, select P5_PERSON_ROLE. • Under the Identification section, for Display As, select Radiogroup. • Under the Label section, for Label, enter Role:. • Under the Element section, for Form Element Option Attribute, enter

class="instructiontext". Without this, the text associated with each of the radiogroup options would be in a larger font than the other items on the page.

• s section, for Named LOV, select ROLES. Under the List of Value• Click Apply Changes.

6. dUn er the Items section, select P5_ASSIGNED_PROJECT. r Display As, select Select List. • Under the Identification section, fo

• Under the List of Values section: For Named LOV, select PROJECTS. For Display Null, select Yes. This is because the underlying column is not

mandatory. ue, enter - None -. For Null display val

• Click Apply Changes. 7. Under the Items section, click the Items heading. This will allow you to edit selected

attributes of all items. • For P5_PERSON_NAME:

me For Prompt, enter Na .

• ail Address.

.

• Click the edit page icon in the upper right (

For Width, enter 60. For P5_PERSON_EMAIL: For Prompt, enter Em For Width, enter 60

• Click Apply Changes. ) to return to editing Page 5.

ect

are faster but for this compound type of validation, you will write a PL/SQL validation.

The Wizard created not null validations for Name, Email and Role. You must manually create the validation that will ensure that all Leads and Members have an assigned projwhile the CEO and Managers do not. Whenever possible, you should use the built-in validation types as they

Page 25 of 25

Page 26: Oracle HTML DB Tutorial

1. Under the Validations section, click the create icon ( ). • For Identify the validation level, keep the default of Item level validation and

click Next>. • For Item, select P5_ASSIGNED_PROJECT and click Next>. • For Select a validation method, select PL/SQL and click Next>. • For Pick the type of PL/SQL validation you wish to create, keep the default of

PL/SQL Expression and click Next>. • For Validation Name, enter

PROJECT_MAND_FOR_LEADER_AND_MEMBER and click Next>. • For Validation, enter:

(:P5_PERSON_ROLE IN ('CEO','Manager') AND :P5_ASSIGNED_PROJECT = '%'||'null%') OR

ND (:P5_PERSON_ROLE IN ('Lead','Member') AP5_ASSIGNED_PROJECT != '%'||'null%') :

Oracle HTML DB passes nulls as %null% so that is what you need to check for in PL/SQL. It also replaces %null% with a null when it processes data so to keep it in the validation, you need to break the string apart so that it is not recognized and replaced.

• For Error Message, enter Leads and Members must have an Assigned

and Managers cannot have an Assigned Project.. Project, CEO• Click Next>. • This validation should not be conditional so just click Create.

2. To view your changes, click the run icon ( ) in the upper right. You can enter some records to test the validation. Try to enter a CEO with a project and then try to enter a Lead without a project. Both cases will fail and produce the error message you

efined. d Image 9 - Revised Create/Edit Person Information

Page 26 of 26

Page 27: Oracle HTML DB Tutorial

Issues Issue Maintenance - Default Pages The last table within the application that needs a maintenance form is HT_ISSUES. The application needs multiple views on Issues. These views could each be created as a separate report or as one, more complex report. The complex report has more value to the end user and that is the one you will be creating. You will begin this report along with an Issues maintenance form. This maintenance form will then be linked in multiple places. The Issues report will ultimately display Issues by identified by, project, assigned person, status, and/or priority.

1. Click Edit Application from the developer links. This will take you to the Application Builder home page with your new application selected.

2. Click Create Page >. 3. Select Page with Component and click Next>. 4. Select Form and click Next>. 5. Select Form on a Table with Report, 2 Pages and click Next>. 6. For Table/View Owner, select the appropriate schema and click Next>. 7. For Table/View Name, enter HT_ISSUES and click Next>. 8. This next set of attributes are for the Report Page. For Page, enter 6. 9. For Page Name and Region Title, enter Issues and click Next>. 10. For Tab Options, keep Do not use tabs and click Next>. 11. For Select Column(s), select only:

• ISSUE_SUMMARY • IDENTIFIED_BY • RELATED_PROJECT • ASSIGNED_TO • STATUS • PRIORITY • TARGET_RESOLUTION_DATE

_RESOLUTION_DATE • ACTUALNext>12. Click .

13. For Edit Link Image, select and click Next>. enter 7. 14. The rest of these attributes are for the Form Page. For Page,

e and Region Title, enter Create/Edit Issue. 15. For Page Nam16. Click Next>.

t>. 17. For Tab Options, keep Do not use tabs and click Nex18. For Primary Key, keep ISSUE_ID and click Next>.

k Next>. 19. For Primary Key Source Type, keep Existing Trigger and clic20. For Select Column(s), select all the columns and click Next>.

efaults and click Next>. 21. For Insert, Update and Delete, keep the d22. Review your selections and click Finish.

Issue Maintenance - Refine Create/Edit Page For Issues, you will first refine the Create/Edit Page. You will add lists of values to make the selection of foreign key columns easier. You will also organize the items and change the display

Page 27 of 27

Page 28: Oracle HTML DB Tutorial

of the audit columns (CREATED_DATE, CREATED_BY, LAST_MODIFIED_DATE, tton to make data entry faster.

First you m

2. and click Go. This will take you to Create/Edit Issue. 3. on, click the

LAST_MODIFIED_BY). Lastly, you will add an additional bu

ust define the list of values that the items will use.

1. From the Success page, select Edit Page. This will leave you on page 6, Issues. For Page:, enter 7Under Shared Components on the right, under the Lists of Values secticreate icon ( ). • For Create List of Values: keep From Scratch and click Next>.

• eep Static and click Next>. • pairs:

4. Next>.

• eep Static and click Next>. • g Display Value/Return Value pairs:

High/High

5. and click Next>.

For Name, enter PEOPLE. • >. •

rson_id v

order by 1

• Click Create Named LOV. Now you will clean up the item

1.

• For Name, enter STATUS. For Type:, kEnter the following Display Value/Return Value

Open/Open On-Hold/On-Hold

sed Closed/Clo

• Click Create Static LOV. Click Create>. • For Create List of Values: keep From Scratch and click• For Name, enter PRIORITIES.

For Type:, kEnter the followin

Medium/Medium Low/Low

• Click Create Static LOV. Click Create>.

Values: keep From Scratch• For Create List of •

For Type:. select Dynamic and click NextFor Query, enter:

select person_name d, pe from ht_people

s.

Click the edit page icon in the upper right ( ) to return to editing Page 7,

2. Und IED_BY. • Under the Identification section, for Display As, select Select List.

Create/Edit Issue. er the Items section, select P7_IDENTIF

Page 28 of 28

Page 29: Oracle HTML DB Tutorial

s mandatory but you do not ing the default value.

son -.

Under the List of Values section: For Named LOV, select PEOPLE.

For Display Null, select Yes. The base column iwant the first name in the list becom

For Null display value, enter - Select Per

• Click to navigate to the next Item. 3. You will now be on P7_IDENTIFIED_DATE.

efault Value section, for Default Value, enter to_char(sysdate,'DD-ct PL/SQL Expression.

• Under the Identification section, for Display As, select Date Picker (DD-MON-YYYY).

• Under t DheMON-YYYY'). For Default Value Type, sele

• Click . 4. ROJECT.

• As, select Select List. ist of Values section:

S.

You will now be on P7_RELATED_PUnder the Identification section, for Display

• Under t Lhe For Named LOV, select PROJECT

• Click . 5. O.

• lay As, select Select List. •

Display Null, select Yes. r - Select Person -.

You will now be on P7_ASSIGNED_TUnder the Identification section, for DispUnder the List of Values section: For Named LOV, select PEOPLE. For For Null display value, ente

• Click . 6.

, enter

• • med LOV, select STATUS.

Columns, enter 3. This allows the three valid values to display side by

You will now be on P7_STATUS. • Under the Identification section, for Display As, select Radiogroup. • For Label, enter Status:.

m Element Option Attribute• Under the Element section, for Forclass="instructiontext". Under the Default Value section, for Default value, enter Open. Under the List of Values section:

For Na For

side.

• Click . 7.

• t Option Attribute, enter

• LOV, select PRIORITIES.

Columns, enter 4. This is because there are three valid values plus the e.

You will now be on P7_PRIORITY. • Under the Identification section, for Display As, select Radiogroup. • For Label, enter Priority:.

Under the Element section, for Form Elemenclass="instructiontext". Under the List of Values section:

For Named For Display Null, select Yes. For

nul lul va

Page 29 of 29

Page 30: Oracle HTML DB Tutorial

For Null display value, enter None.

• Click . 8. RGET_RESOLUTION_DATE.

As, select Date Picker (DD-MON-

9. LUTION_DATE. Display As, select Date Picker (DD-MON-

groups ns to group items into. The items will be grouped into Buttons, Identification, Progress, Resolution and Auditing.

tion, click the create icon (

You will now be on P7_TA• Under the Identification section, for Display

YYYY). • Click Apply Changes. Click P7_ACTUAL_RESO• Under the Identification section, for

YYYY). • Click Apply Changes.

ather than having all the items together in one large region, displaying the items in logical R

will make data entry easier. You will create four new gio re

1. Under the Regions sec ). 2. reate Multiple HTML regions. 3.

select Button Region without Title. 4.

. 5.

tion. 6. For the fourth row:

7. Click Create Region(s). Now that the new regions exist, you need to rename your first region.

1. Under the Regions section, select Create/Edit Issue.

ow that the regions are ready, the items can be moved into the proper region. Some of the item widths uickly when viewing all Page Items.

1. tion, click the Items heading. 2. s, for Region, select Progress:

Under Tasks on right, click CFor the first row: • For Seq., enter 5. • For Title, enter Buttons, • For Template, For the second row: • For Title, enter ProgressFor the third row: • For Title, enter Resolu

• For Title, enter Audit Information.

2. For Title, enter Issue Identification. 3. Click Apply Changes.

N

need to be modified. Both these changes can be done q

Under the Items secFor the following item• P7_ASSIGNED_TO • P7_STATUS • P7_PRIORITY • P7_TARGET_RESOLUTION_DATE • P7_PROGRESS

Page 30 of 30

Page 31: Oracle HTML DB Tutorial

3. egion, select Resolution: UTION_DATE

4. n, select Audit Information:

ARY, for Width 60.

7. RESOLUTION_DATE, for Width, enter 12. 8. For P7_ACTUAL_RESOLUTION_DATE, for Width, enter 12.

For the following items, for R• P7_ACTUAL_RESOL• P7_RESOLUTION_SUMMARYFor the following items, for Regio• P7_CREATED_DATE • P7_CREATED_BY • P7_LAST_MODIFIED_DATE • ED_BY P7_LAST_MODIFI

5. For P7_ISSUE_SUMM , enter6. For P7_IDENTIFIED_DATE, for Width, enter 12.

For P7_TARGET_

9. Click Apply Changes. 10. Click the edit page icon in the upper right ( ) to return to editing Page 7,

Create/Edit Issue. The bu e Button Region.

1. Under the Buttons section, click the Buttons heading.

ttons need to be moved to th

2. For all buttons, for Region, select Buttons. 3. Click Apply Changes. 4. Click the edit page icon in the upper right ( ).

The Auonly. This region will only display when editing an existing issue, not when creating a new one.

on, select Audit Information.

Expression 1 is NOT NULL.

Now you n play only.

1. (saves

enter Created Date:. ith Help.

• , enter DD-MON-YYYY.

dit columns should be viewable but cannot be modified. You will make them display

1. Under the Regions secti2. Under the Conditional Display section:

• For Condition Type, select Value of Item in• For Expression 1, enter P7_ISSUE_ID.

3. cCli k Apply Changes.

eed to change the audit columns to dis

Under the Items section, select P7_CREATED_DATE. • Under the Identification section, for Display As, select Display as Text

state). • For Lab , el• For Template, select Optional Label w• For HTML Table Cell Attributes, enter class="instructiontext".

Under the Source section, for Format Mask

• Click . 2.

Display As, select Display as Text (saves You will now be on P7_CREATED_BY. • Under the Identification section, for

state). • For Label, enter Created By:.

Page 31 of 31

Page 32: Oracle HTML DB Tutorial

• For Template, select Optional Label with Help. For HT• ML Table Cell Attributes, enter class="instructiontext".

• Click . 3.

, enter DD-MON-YYYY.

You will now be on P7_LAST_MODIFIED_DATE. • Under the Identification section, for Display As, select Display as Text (saves

state). • For Label, enter Last Modified Date:. • For HTML Table Cell Attributes, enter class="instructiontext".

Under t• he Source section, for Format Mask

• Click . 4. ST_MODIFIED_BY.

• Under the Identification section, for Display As, select Display as Text (saves

ML Table Cell Attributes, enter class="instructiontext". • Click Apply Changes.

The Wizard created not null validations for Issue Summary, Identified By, Related Project, Status, Created Date and Created By. The Audit columns are set by trigger so those validations need to

1. EATED_DATE not null. • Click Delete.

e delete action.

This Cr e users are finished with the display, they should be returned to the calling page. To do this, an Item must be created and the branching is page is called, the item must be set with the nu

con (

You will now be on P7_LA

state). • For Label, enter Last Modified By:. • For HT

be removed.

Under the Validations section, select P7_CR

• Click OK to confirm the delete action. 2. Under the Validations section, select P7_CREATED_BY not null.

• Click Delete. • Click OK to confirm th

eat /Edit page will be called from several places. When

on this page needs to be changed. Every time thmber of the calling page.

1. click the create iUnder the Items section, ).

2. Page, enter &P7_PREV_PAGE..

er the Branching section, select the After Processing Branch. • Under the Branch Action section, for Page, enter &P7_PREV_PAGE..

• For Choose Item Type, select Hidden. Click Next>. • For Item Name, enter P7_PREV_PAGE.

Identification. • For Region, select Issue• Click Next>. • Click Create Item.

lick Cancel. Under the Buttons section, c• Under the Optional URL Redirect section, for

Note: You do need the trailing period for ‘&P7_PREV_PAGE.’. • Click Apply Changes.

3. Und

Page 32 of 32

Page 33: Oracle HTML DB Tutorial

• Click Apply Changes. For use t would be nice if they were not returned to the calling page but instead could enter one issue after another. First you will create a new b

1. Under the Buttons section, click the copy icon (

rs that will be entering more than one issue at a time, i

utton.

).

The button does nothing different than the CREATE button but you will create a branch that will fire for the new button, keeping the user on the create page. The branch will also reset P7_PREV_PAGE because the value of that item will be lost when the cache of the page is cleared nch will be 0. That will make it fire before the default branch but only when the Create and Create Another button is used.

nching section, click the create icon (

2. Under Name, select CREATE. 3. For New Page, keep the default and click Next>. 4. For Button Name, enter CREATE_AGAIN. 5. For Label, enter Create and Create Another. 6. Click Copy Button.

. The sequence of this new bra

1. Under the Bra ). pe, keep the defaults and click Next>.

7. 5. For Set these items, enter P7_PREV_PAGE.

9. For When Button Pressed, select CREATE_AGAIN.

12. Under the Branch Action section, check include process success message. 13. Click Apply Changes.

To see the changes, click the run page icon (

2. For Branch Point and Ty3. For Page, enter 7. 4. For Clear Cache, enter

6. For With these values, enter &P7_PREV_PAGE.. 7. Click Next>. 8. For Sequence, enter 0.

10. Click Create Branch.

11. Under the Branching section, select the newly created branch.

). You should not create or edit using this page right now. The branching is looking for a value in P7_PREV_PAGE but, because the page was not called from another page, the value has not been set. You will fix that next.

Page 33 of 33

Page 34: Oracle HTML DB Tutorial

Image 10 - Revised Create/Edit Issue

Refine Issues Report The defaulted report page will be overhauled to allow for the dynamic modification of the query. You will move and re-label the create button, create items that will allow the user to restrict the query, add a WHERE clause to reference those items, change report column attributes to display People’s Name and the Project Name and modify headings.

Page 34 of 34

Page 35: Oracle HTML DB Tutorial

The first step is to create a region for the button:

1. Navigate to the Page Definition for page 6, Issues. 2. Under the Regions section, click the create icon ( ). 3. For Select a common region type:, keep the default of HTML and click Next>. 4. For Title, enter Buttons. 5. For Region Template, select Button Region without Title. 6. For Display Point, select Page Template Body (2. items below region content). 7. Click Next>. 8. Keeping the Source blank, click Create Region.

The next step is to move the Create button into the new region.

1. Under the Buttons section, select CREATE. 2. For Text Label, enter Add a New Issue. 3. For Display in Region, select Buttons. 4. Under the Optional URL Redirect section:

• For Set These Items, enter P7_PREV_PAGE. • For With These Values, enter 6.

5. Click Apply Changes. Now, you will clean up the query to display the actual values for people and projects, rather than the IDs and clean up the display:

1. Under the Regions section, select Q to the left of Issues. 2. Click the edit link to the left of ISSUE_ID.

• Under the Column Link section, for Item 2, Name, enter P7_PREV_PAGE. For Item 2, Value, enter 6.

• Click Apply Changes. 3. Click the edit link to the left of IDENTIFIED_BY.

• Under the Tabular Form Element section, for Display As, select Display as Text (based on LOV, does not save state).

• Under the List of Values section, for Named LOV, select PEOPLE.

• Click to navigate to the next Report Item. 4. You will now be on RELATED_PROJECT.

• Under the Tabular Form Element section, for Display As, select Display as Text (based on LOV, does not save state).

• Under the List of Values section: JECTS. For Named LOV, select PRO

t Yes. For Display Null, selec For Null Text, enter -.

• Click to navigate to the next Re5.

port Item. You will now be on ASSIGNED_TO. • Under the Tabular Form Element section, for Display As, select Display as Text

(based on LOV, does not save state). PLE. For Named LOV, select PEO

Page 35 of 35

Page 36: Oracle HTML DB Tutorial

For Display Null, select Yes. -.

. ter Summary.

8. • r Target<br>Resolution<br>Date. This will force the

9. olution<br>Date.

For Null Text, enter• Click Apply Changes.

6. For ISSUE_ID, remove the Heading (currently set to Edit)7. For ISSUE_SUMMARY, for Heading, en

For TARGET_RESOLUTION_DATE: For Heading, enteheading to wrap.

• For Column Align., select center. • For Heading Align. select center. For ACTUAL_RESOLUTION_DATE: • For Heading, enter Actual<br>Res

For Column Align., select center. • • For Heading Align. select center.

10. For all columns except ISSUE_ID, check Sort. 11. For ISSUE_SUMMARY, for Sort Sequence, select 1. 12. Under the Layout and Pagination section, for Show Null Values as, enter -. For

Number of Rows, enter 5. 13. Under the Sorting section, for Ascending and Descending Image, select the light

gray arrow ( ) by clicking on it. 14. Under the Messages sec

found.. tion, for When No Data Found Message, enter No Issues

against. These will e in a region that will appear above the report. To create t w region:

15. Click Apply Changes. Now the report will display nicely but does not allow for any filtering by the end user. To do his, you will first create items that will allow the user to set values to queryt

b he ne

1. Under the Regions section, click the create icon ( ). 2. For Select a common region type:, keep the default of HTM

eport Parameters. L and click Next>.

eep the default of Reports Region.

that th Region exists, you will create the items. First you will create the item for Identified By.

3. For Title, enter Issue Remplate, k4. For Region T

5. For Sequence, enter 5. 6. Click Next>. 7. Keeping the Source blank, click Create Region.

Now e

1. Under the Items section, click the create icon ( ).

Next>. 2. For Choose Item Type, select Select List. Clicke3. For Pick Select List Control Type, keep the d

e, enter P6_IDENTIFIED_BY. fault of Select List and click Next>.

meters.

PLE. -.

4. For Item Nam5. For Region, enter Issue Report Para6. Click Next>.

EO7. For Named LOV, select P8. For Null Text, enter - All

Page 36 of 36

Page 37: Oracle HTML DB Tutorial

9. For Null Value, enter -1.

ep the defaults and click Next>. .

13. Click Create Item.

ext, create the item for Related Project.

10. Click Next>. 11. For Item Attributes, ke12. For Default, enter -1

N

1. Under the Items section, click the create icon ( ). 2. For Choose Item Type, select Select List. Click Next>. 3. For Pick Select List Control Type, keep the default of Select List and click Next>.

ECT. nter Issue Report Parameters.

JECTS. -.

e, enter -1.

ep the defaults and click Next>. .

13. Click Create Item.

reate the item for Assigned To.

4. For Item Name, enter P6_RELATED_PROJ5. For Region, e6. Click Next>. 7. For Named LOV, select PRO8. For Null Text, enter - All 9. For Null Valu10. Click Next>. 11. For Item Attributes, ke12. For Default, enter -1

C

1. Under the Items section, click the create icon ( ). 2. For Choose Item Type, select Select List. Click Next>. 3. For Pick Select List Control Type, keep the default of Select List and click Next>.

nter Issue Report Parameters.

PLE. -.

e, enter -1.

ep the defaults and click Next>. .

13. Click Create Item.

reate the item for Status.

4. For Item Name, enter P6_ASSIGNED_TO. 5. For Region, e6. Click Next>. 7. For Named LOV, select PEO8. For Null Text, enter - All 9. For Null Valu10. Click Next>. 11. For Item Attributes, ke12. For Default, enter -1

C

1. Under the Items section, click the create icon ( ). 2. For Choose Item Type, select Select List. Click Next>. 3. For Pick Select List Control Type, keep the default of Select List and click Next>.

nter Issue Report Parameters.

TUS.

4. For Item Name, enter P6_STATUS. 5. For Region, e6. Click Next>. 7. For Named LOV, select STA

Page 37 of 37

Page 38: Oracle HTML DB Tutorial

8. For Null Text, enter - All -. e, enter -1.

ep the defaults and click Next>. .

13. Click Create Item.

astly, create the item for Priority.

9. For Null Valu10. Click Next>. 11. For Item Attributes, ke12. For Default, enter -1

L

1. Under the Items section, click the create icon ( ). 2. For Choose Item Type, select Select List. Click Next>. 3. For Pick Select List Control Type, keep the default of Select List and click Next>.

nter Issue Report Parameters.

ORITIES. -.

e, enter -1.

ep the defaults and click Next>. .

13. Click Create Item.

cute

just to the right of the last port parameter so you will create it among the region’s items.

(

4. For Item Name, enter P6_PRIORITY. 5. For Region, e6. Click Next>. 7. For Named LOV, select PRI8. For Null Text, enter - All 9. For Null Valu10. Click Next>. 11. For Item Attributes, ke12. For Default, enter -1

Now that you have the items, you need to create a Go button. This will allow the user to exethe query once they have selected their report parameters. Buttons can be created in region positions or displayed among items. Your Go button will displayre

1. Under the Buttons section, click the create icon ). lect Issue Report Parameters.

ct Create a button displayed among this region’s items.

late Based Button. utton.

9. Click Create Button.

ey

d past the normal window size. You will place two on the first line and three n the second line.

2. LATED_PROJECT, P6_STATUS, and P6_PRIORITY, for New Line, select No.

2. For Region, se3. Click Next>. 4. For Task, sele5. Click Next>. 6. For Button Name, enter P6_GO. 7. For Button Style, select Temp8. For Template, select B

If you were to run the page now you would see all the items stacked on top of one another. Thwill use much less space if they were displayed next to each other but if they were all on one line, they may exteno

1. Under the Items section, click the Items heading. For P6_RE

Page 38 of 38

Page 39: Oracle HTML DB Tutorial

3. Click Apply Changes. 4. Click the edit page icon in the upper right ( ).

The parameters will now be displayed but the report needs to be modified to react to the parameters. To do this, you need to modify the where clause of the query. You could just add the following where clause:

WHERE (IDENTIFIED_BY = :P6_IDENTIFIED_BY OR :P6_IDENTIFIED_BY = '-1') AND (RELATED_PROJECT = :P6_RELATED_PROJECT OR :P6_RELATED_PROJECT = '-1') AND (ASSIGNED_TO = :P6_ASSIGNED_TO OR :P6_ASSIGNED_TO = '-1') AND (STATUS = :P6_STATUS OR :P6_STATUS = '-1') AND (PRIORITY = :P6_PRIORITY OR :P6_PRIORITIY = '-1')

Although this method is valid, the query will execute faster if you generate it with just the where clause that it needs. This can be done by turning the region into a PL/SQL Function Body Returning a SQL Query.

1. Under the Regions section, select Issues. 2. For Type, select SQL Query (Pl/Sql Function Body Returning Sql Query). 3. For Region Source, enter:

declare q varchar2(32767); -- query w varchar2(4000) ; -- where clause we varchar2(1) := 'N'; -- identifies if where clause exists begin q := 'select "ISSUE_ID", '|| ' "ISSUE_SUMMARY", '|| ' "IDENTIFIED_BY", '|| ' "RELATED_PROJECT", '|| ' "ASSIGNED_TO", '|| ' "STATUS", '|| ' "PRIORITY", '|| ' "TARGET_RESOLUTION_DATE", '|| ' "ACTUAL_RESOLUTION_DATE" '|| ' from "#OWNER#"."HT_ISSUES" '; if :P6_IDENTIFIED_BY != '-1' then w := ' IDENTIFIED_BY = :P6_IDENTIFIED_BY '; we := 'Y'; end if; if :P6_RELATED_PROJECT != '-1' then if we = 'Y' then

Page 39 of 39

Page 40: Oracle HTML DB Tutorial

w := w || ' AND RELATED_PROJECT = :P6_RELATED_PROJECT '; else w := ' RELATED_PROJECT = :P6_RELATED_PROJECT '; we := 'Y'; end if; end if; if :P6_ASSIGNED_TO != '-1' then if we = 'Y' then w := w || ' AND ASSIGNED_TO = :P6_ASSIGNED_TO '; else w := ' ASSIGNED_TO = :P6_ASSIGNED_TO '; we := 'Y'; end if; end if; if :P6_STATUS != '-1' then if we = 'Y' then w := w || ' AND STATUS = :P6_STATUS '; else w := ' STATUS = :P6_STATUS '; we := 'Y'; end if; end if; if :P6_PRIORITY != '-1' then if we = 'Y' then w := w || ' AND PRIORITY = :P6_PRIORITY '; else w := ' PRIORITY = :P6_PRIORITY '; we := 'Y'; end if; end if; if we = 'Y' then q := q || ' WHERE '|| w; end if; return q; end;

4. Click Apply Changes.

This function begins by setting the variable q to the original select statement. It then builds up a where clause, w, composed of just the variables that were set by the user. Lastly, if there were any variables set, it appends the where clause to the original select and passes that new select to the database.

Page 40 of 40

Page 41: Oracle HTML DB Tutorial

The report is now complete. Click the run page icon ( ). You can change the report parameters, click Go and see the result set change. Image 11 - Revised Issue Report

Assigning Issues Although an issue can be assigned by selecting to edit it, this page will allow the assignment of multiple issues at once. It will also allow the user to modify the Related Project, Status and Priority of the issue.

1. Navigate to the Application Builder Home page. 2. Click Create Page >. 3. Select Page with Component and click Next>. 4. Select Form and click Next>. 5. Select Tabular Form and click Next>. 6. For Table/View Owner, select the appropriate schema. 7. The purpose of this form is to allow users to Assign Issues. That means they will

only be updating existing records, not creating or deleting Issues. To enforce this, for Allowed Operations, select Update Only. Click Next>.

8. For Table/View Name, enter HT_ISSUES and click Next>. 9. For Select Column(s), click to select the following columns:

• ISSUE_SUMMARY • IDENTIFIED_BY

Page 41 of 41

Page 42: Oracle HTML DB Tutorial

• IDENTIFIED_DATE • RELATED_PROJECT • ASSIGNED_TO • STATUS • PRIORITY

10. Click Next>. 11. For Primary Key Column 1, keep ISSUE_ID and click Next>. 12. For Primary Key Source Type, keep Existing trigger and click Next>. 13. For Updateable Column(s), click to select the following columns:

• RELATED_PROJECT • _TO ASSIGNED• STATUS

• PRIORITY14. Click Next>. 15. For the Page and Region Attributes:

• For Page, enter 8. • For Page Name, enter Assign Issues. • For Region Title, enter Assign Issues.

17. l, leave the default. For Submit Button Label, enter Apply

Next>. 19. Review your selections and click Finish.

for the user and you will also restrict the query to only display those issues that re unassigned.

1. e Success page, select Edit Page. This will leave you on page 8, Assign

select Assign Issues. 3. For Region Source, enter:

", O",

mmary.

t 1.

• Click Next>. 16. For Tab Options, keep Do not use tabs and click Next>.

For Cancel Button LabeChanges. Click Next>.

18. For Branching, keep the defaults and click

Now that the initial tabular form has been created, you will add in lists of values to make the selections easier a

From thIssues.

2. Under the Regions section,

select "ISSUE_ID", "ISSUE_SUMMARY", "IDENTIFIED_BY", "IDENTIFIED_DATE", "RELATED_PROJECT "ASSIGNED_T "STATUS", "PRIORITY" from "#OWNER#"."HT_ISSUES" where assigned_to is null

4. Select the Report Attributes subtab. 5. For ISSUE_SUMMARY, for Heading, enter Su6. For all columns except ISSUE_ID, check Sort. 7. For IDENTIFIED_DATE, for Sort Sequence, selec

Page 42 of 42

Page 43: Oracle HTML DB Tutorial

8. • n, for Display As, select Display as Text

OV, select PEOPLE.

Click the edit link to the left of IDENTIFIED_BY. Under the Tabular Form Element sectio(based on LOV, does not save state).

• Under the List of Values section, for Named L

to navigate to the next Report I• Click tem. 9.

• n Formatting section, for Number/Date Format, enter DD-You will now be on IDENTIFIED_DATE.

Under the ColumMON-YYYY.

to navigate to the next Report Ite• Click m. 10.

• r Form Element section, for Display As, select Select List

OV, select PROJECTS.

You will now be on RELATED_PROJECT. Under the Tabula(Named LOV).

• Under the List of Values section, for Named L

to navigate to the next Re• Click port Item. 11.

n, for Named LOV, select PEOPLE. t Yes.

You will now be on ASSIGNED_TO. Under the Tabular Form Element section, for Display As, select Select List (Named LOV).

• Under the List of Values sectio• For Display Null, selec• For Null Text, enter -.

Click • to navigate to the next Report Item. You will now be on STATUS. 12.

t List

OV, select STATUS.

• Under the Tabular Form Element section, for Display As, select Selec(Named LOV).

• Under the List of Values section, for Named L

• Click to navigate to the next Report Item. You will now be on PRIORITY. 13.

t

n, for Named LOV, select PRIORITIES. Yes.

light

• Under the Tabular Form Element section, for Display As, select Select Lis(Named LOV).

s sectio• Under the List of Value• For Display Null, select• For Null Text, enter -. • Click Apply Changes.

14. Under the Sorting section, for Ascending and Descending Image, select the gray arrow ( ) by clicking on it.

tion, for When No Data Found Message, enter No Unassigned Issues..

The wizard created a Cancel button that is not needed. You will delete that button.

EL. 2. Click Delete. 3. Click OK to confirm the delete action.

15. Under the Messages sec

16. Click Apply Changes.

1. Under the Buttons section, select CANC

Page 43 of 43

Page 44: Oracle HTML DB Tutorial

The tabular form is now complete. Click the run page icon ( ). You can change the sorting by clicking on the headings. You can assign an Issue and click Apply Changes. You will notice that the assigned issue is no longer displayed. Image 12 - Assign Issues

Reports The last new pages to be added are the four final reports. Issue Summary, by Project The Issue Summary report will allow the user to select a project and then see a summary of issues for that project. The summary information will include:

• date first issue identified • date last issue closed • total number of issues • number of issues by status • number of open issues by priority • assignments by status

This information will be coded in two SQL statements. The first will gather the information that has a singular result, the second will gather the information that will have multiple results.

1. Navigate to the Application Builder Home page.

Page 44 of 44

Page 45: Oracle HTML DB Tutorial

2. Click Create Page >. 3. Select Page with Component and click Next>.

SQL Report and click Next>.

e, enter Issue Summary, by Project.

not use tabs and click Next>. 10. For SQL SELECT, enter:

d,

es,

,

,

_prior,

open_low_prior

where related_project = :P9_PROJECT

12. Template, select default: vertical report, look 1 (include null

ame, enter Issue Summary, by Project.

15. Review your selections and click Finish.

First you will create a region to display above the report. It will contain the roject parameter.

1. , select Edit Page. This will leave you on page 9, Issue

4. Keep the default of Report and click Next>. 5. Keep the default of6. For Page, enter 9. 7. For Page Nam8. Click Next>. 9. For Tab Options, keep Do

select min(identified_date) first_identifie max(actual_resolution_date) last_closed, count(issue_id) total_issues, sum(decode(status,'Open',1,0)) open_issues, sum(decode(status,'On-Hold',1,0)) onhold_issues, sum(decode(status,'Closed',1,0)) closed_issu sum(decode(status, 'Open',decode(priority,null,1,0), 0)) open_no_prior sum(decode(status,

ecode(priority,'High',1,0), 'Open',d 0)) open_high_prior sum(decode(status, 'Open',decode(priority,'Medium',1,0), 0)) open_medium sum(decode(status,

'Open',decode(priority,'Low',1,0), 0)) from ht_issues

11. Click Next>. For Reportcolumns).

13. For Region N14. Click Next>.

Now that you have the first query, you must clean up the headings and create the item to control the related project. P

From the Success pageSummary, by Project.

2. Under the Regions section, click the create icon ( ). 3. For Select a common region type:, keep the default of HTML and click Next>.

t Page Template Body (2. items below region content). , enter 5.

8. Keeping the Source blank, click Create Region.

4. For Title, enter Issue Summary Report Parameters. 5. For Display Point, selec6. For Sequence7. Click Next>.

Page 45 of 45

Page 46: Oracle HTML DB Tutorial

Now that the Region exists, you will create the Project item.

1. Under the Items section, click the create icon ( ). 2. For Choose Item Type, select Select List and click Next>. 3. For Pick Select List Control Type, keep the default of Select List and click Next>.

lect Issue Summary Report Parameters.

ECTS. ct -.

e, enter -1.

ep the defaults and click Next>. .

13. Click Create Item.

ou need a Go button to execute the query.

4. For Item Name, enter P9_PROJECT. 5. For Region, se6. Click Next>. 7. For Named LOV, select PROJ8. For Null Text, enter - Sele9. For Null Valu10. Click Next>. 11. For Item Attributes, ke12. For Default, enter -1

Y

1. Under the Buttons section, click the create icon ( ). 2. For Region, enter Issue Summary Report Parameters and click Next>.

For Tas3. k, select Create a button displayed among this region’s items and click

late Based Button. utton.

7. Click Create Button.

ll also set e report regions to conditionally display only when the user has selected a project.

the left of Issue Summary, by Project.

. 3.

tified:. ed:.

.

iority:. Issues of Low Priority:.

4.

For Pagination Scheme select - No Pagination Selected -.

Next>. 4. For Button Name, enter P9_GO. 5. For Button Style, select Temp6. For Template, select B

Now you will clean up the headings and report settings for the report region. You with

1. Under the Regions section, select Q to2. For Headings Type:, select Custom

For Headings, enter the following: • For FIRST_IDENTIFIED enter First Issue Iden• For LAST_CLOSED enter Last Issue Clos• For TOTAL_ISSUES enter Total Issues:• For OPEN_ISSUES enter Open Issues:. • For ONHOLD_ISSUES enter On-Hold Issues:. • For CLOSED_ISSUES enter Closed Issues:. • For OPEN_NO_PRIOR enter Open Issues with No Priority:.

. • For OPEN_HIGH_PRIOR enter Open Issues of High Priority:Open Issues of Medium Pr• For OPEN_MEDIUM_PRIOR enter

pen• For OPEN_LOW_PRIOR enter OUnder the Layout and Pagination section: • For Show Null Values as enter -. •

Page 46 of 46

Page 47: Oracle HTML DB Tutorial

5. Select the Region Definition subtab. Under the Conditional Display section, for Condition Type, select Value of Item i6. n

lon Delimited List in Expression 2. PROJECT.

ter -1. 7. Click Apply Changes.

al query on the page is the last thing to create. This query will retrieve assignments by atus.

Expression 1 Is NOT Contained within Co• For Expression 1 enter P9_• For Expression 2 en

The finst

1. Under the Regions section, click the create icon ( ). 2. For Select a common region type:, select Report and click Next>. 3. For Report Implementation, select SQL Report and click Next>.

ents by Status. select 2.

7. For Enter SQL Query:, enter:

id) issues

CT _id

atus

lumns select Column 1.

8. n lon Delimited List in Expression 2.

PROJECT. nter -1.

11. Click Create Region.

ow yo

the l .

5. ction, for When No Data Found Message, enter No Issues

6. Click Apply Changes.

4. For Title enter Assignm5. For Column, 6. Click Next>.

select p.person_name, i.status,

e_ count(i.issu from ht_issues i, ht_people p

PROJE where i.related_project = :P9_ and i.assigned_to = p.person group by person_name, st

8. For Rows Per Page, enter 20. 9. For Break Co10. Click Next>.

Under the Conditional Display section, for Condition Type, select Value of Item iExpression 1 Is NOT Contained within Co• For Expression 1 enter P9_• For Expression 2 e

N u will clean up the headings and report settings.

1. Under the Regions section, select Q to eft of Assignments by Status2. For Headings Type:, select Custom. 3. For PERSON_NAME, for Heading, enter Assigned To.

Under the Layout and Pagination s4. ection, for Pagination Scheme, select Row Ranges 1-15 16-30 in select list. Under the Messages sefound..

Page 47 of 47

Page 48: Oracle HTML DB Tutorial

To see your newly created report, click the run page icon ( ). You will see that no data will be displayed at first because there will not be a selected project. Select a project and click Go to see the reports. Image 13 - Issue Summary, by Project

Resolved by Month Identified The Re v irst calculate the number of days it took to resolve each closed issue, average that by the month the issue was identified and finally

lder Home page.

Resolved by Month Identified. 8. Click Next>. 9. For Tab Options, keep Do not use tabs and click Next>. 10. For Series Name, enter Resolved.

sol ed by Month Identified report will be a line chart. It will f

plot the result by month.

1. Navigate to the Application Bui2. Click Create Page >. 3. Select Page with Component and click Next>. 4. Select Chart and click Next>. 5. Select Line and click Next>. 6. For Page, enter 10. 7. For Page Name and Region Name, enter

Page 48 of 48

Page 49: Oracle HTML DB Tutorial

11. For SQL, enter:

select null l, to_char(identified_date,'Mon YYYY') month, avg(actual_resolution_date-identified_date) days from ht_issues where status = 'Closed' group by to_char(identified_date,'Mon YYYY')

The query has no link (that is the l column). It extracts the month from the identified date so that the data can be grouped by month. Lastly, it calculates the average number of days it took for the issues to be closed that were identified in that month.

12. For When No Data Found Message, enter No Closed Issues found.. 13. Click Next>. 14. Review your selections and click Finish.

The chart needs to have the axis labeled correctly. You will also turn off the Chart Title and the legend.

1. From the Success page, select Edit Page. This will leave you on page 10, Resolved by Month Identified.

2. Under the Regions section, select Chart to the left of Resolved by Month Identified.

3. Under the Chart Settings section: • For Chart Height, enter 300 • For Show Legend, click to turn it off

4. Under the Axes Setting section: • For X Axis Title, enter Date Identified • For Y Axis Title, enter Days to Resolve

5. Click Apply Changes. To see your newly created line chart, click the run page icon ( ).

Page 49 of 49

Page 50: Oracle HTML DB Tutorial

Image 14 - Resolved by Month Identified

Target Resolution Dates The Resolved by Month Identified report will be a calendar. It will display each issue that is not yet closed, along with the person that the issue is assigned to, on the day that corresponds to its target resolution date.

1. Navigate to the Application Builder Home page. 2. Click Create Page >. 3. Select Page with Component and click Next>. 4. Select Calendar and click Next>. 5. Select SQL Calendar and click Next>. 6. For Page, enter 11. 7. For Page Name and Region Name, enter Target Resolution Dates. 8. Click Next>. 9. For Tab Options, keep Do not use tabs and click Next>. 10. For Enter SQL Query, enter:

select I.TARGET_RESOLUTION_DATE, I.ISSUE_SUMMARY || ' ('||nvl(P.PERSON_NAME,'Unassigned') ||') ' disp, I.ISSUE_ID from HT_ISSUES I, HT_PEOPLE P where I.ASSIGNED_TO = P.PERSON_ID (+) AND (I.RELATED_PROJECT = :P11_PROJECT OR :P11_PROJECT = '-1') AND I.STATUS != 'Closed'

Page 50 of 50

Page 51: Oracle HTML DB Tutorial

This query includes the target_resolution_date. It is the date on which the Issue will be displayed. It also has the issue_summary concatenated with the person assigned. Lastly, it includes the issue_id. The issue_id will not be displayed but will be used to create a link that will allow the user to view/edit the issue.

11. Click Next>. 12. For Date Column, select TARGET_RESOLUTION_DATE. 13. For Display Column, select DISP. 14. Click Next>. 15. Review your selections and click Finish.

The first modification will allow the user to be able to look at all projects or just one project. This will require a new item.

1. From the Success page, select Edit Page. This will leave you on page 11, Target

Resolution Dates. 2. Under the Items section, click the create icon ( ). 3. Select Select List and click Next>. 4. For Pick Select List Control Type, leave the default of Select List and click Next>. 5. For Item Name, enter P11_PROJECT and click Next>. 6. For Named LOV, select PROJECTS. 7. For Null Text, enter - All Projects -. 8. For Null Value, enter -1. 9. Click Next>. 10. For Item Attributes, keep the defaults and click Next>. 11. For Default, enter -1. 12. Click Create Item.

You need a Go button to execute the query.

1. Under the Buttons section, click the create icon ( ). 2. For Region, select Target Resolution Dates and click Next>. 3. For Task, select Create a button displayed among this region’s items and click

Next>. 4. For Button Name, enter P11_GO. 5. For Button Style, select Template Based Button. 6. For Template, select Button. 7. Click Create Button.

The last thing to do is to modify the Calendar Attributes to make a link to view/edit the Issues displayed. You will call the View/Edit Issues page, page 7, clear any data from the page and pass in the current Issue ID along with the fact that page 11 was the calling page. Lastly, you will add a note to display that the query excludes Closed issues.

1. Under the Regions section, select CAL to the left of Target Resolution Dates. 2. Under the Column Link section:

Page 51 of 51

Page 52: Oracle HTML DB Tutorial

• For Page, enter 7 • For Clear Cache, enter 7 • For Set these items, enter P7_ISSUE_ID,P7_PREV_PAGE • For With these values, enter #ISSUE_ID#,11

3. Select the Region Definition subtab. 4. Under the Header and Footer Text section, for Region Footer, enter This excludes

Closed issues.. 5. Click Apply Changes.

To see your newly created calendar, click the run page icon ( ). You can click the text displayed for an issue and notice that you will be taken to the Edit Issue page and when you click Cancel, you will be returned to the Calendar Report. Image 15 - Target Resolution Dates

Page 52 of 52

Page 53: Oracle HTML DB Tutorial

Average Days to Resolve The Average Days to Resolve report will be a bar chart. It will calculate the number of days it took to resolve each closed issue and average that by assigned person.

1. Navigate to the Application Builder Home page. 2. Click Create Page >. 3. Select Page with Component and click Next>. 4. Select Chart and click Next>. 5. Select Bar (HTML) and click Next>. 6. For Page, enter 12. 7. For Page Name, enter Average Days to Resolve. 8. For Region Name, enter Average Days to Resolve. 9. Click Next>. 10. For Tab Options, keep Do not use tabs and click Next>. 11. For Chart SQL, enter:

select null l, nvl(p.person_name,'None Assigned') person, avg(i.actual_resolution_date-i.identified_date) days from ht_issues i, ht_people p where i.assigned_to = p.person_id (+) and i.status = 'Closed' group by p.person_name

In the above select statement, the first item selected is the link. Because this report will not link to any other page, null was selected. The second item is the person’s name, or None Assigned if assigned_to is nul,l. The third item selected is the average number of days it took for that person to resolve all the issues that are assigned to them and have the status of closed.

12. For Include in summary, uncheck all options except Number of data points. 13. Click Next>. 14. Review your selections and click Finish.

This chart does not need any modifications. To see your newly created bar chart, select Run Page.

Page 53 of 53

Page 54: Oracle HTML DB Tutorial

Image 16 - Average Days to Resolve

Home Page Now that you have all the detailed pages complete, you will add content to the empty home page and tie all the pages together into an application. The page will be modified to display the following information:

• A Menu of all available reports • Navigation to the maintenance pages • A button to Add a New Issue • Overdue Issues • Recently Opened Issues • Open Issues by Project as a chart • Unassigned Issues

Reports Menu

ou will begin with the menu. It will be implemented as a List. Y

1. Navigate to the Application Builder Home page. 2. Select Shared Compnents.

section, select Lists. 3. Under the NavigationCreate List>4. Click .

5. For Name, enter Main Menu.

Page 54 of 54

Page 55: Oracle HTML DB Tutorial

6. For List Template, select Vertical Sidebar List. 7. Click Create.

o it. One list item will be created for ach report page. The first one will be for Assign Issues.

r Assign Issues. 4. n:

t pagination for this page. 5. Click Create.

ow you will create four more list items, one for each of the other reports you have created.

nu.

r Issues. 5. n:

or page 6 from the

.

r Issue Summary, by Project. 10. Under the Target section:

page.

ther.

r Resolved by Month Identified (chart).

ther.

r Target Resolution Dates (calendar). 20.

Now that the list has been created, you can add list items te

1. Click Create List Entry>. 2. For List, select Main Menu. 3. For List Entry Label, ente

Under the Target sectio• For Page, enter 8. • Check rese

N

1. Click Create List Entry>. 2. For List, select Main Me3. For Sequence, enter 20. 4. For List Entry Label, ente

Under the Target sectio• For Page, enter 6. • Check reset pagination for this page.

For Clear Cac• he, enter 6. This will clear any selections fsession state.

6. Click Create and Create Another

7. For List, select Main Menu. 8. For Sequence, enter 30. 9. For List Entry Label, ente

• For . Page, enter 9• Check reset pagination for this • For Clear Cache, enter 9.

11. Click Create and Create Ano

12. For List, select Main Menu. 13. For Sequence, enter 40. 14. nteFor List Entry Label, e15. Under the Target section:

• For Page, enter 10. 16. Click Create and Create Ano

17. For List, select Main Menu. 18. For Sequence, enter 50. 19. nteFor List Entry Label, e

Under the Target section:

Page 55 of 55

Page 56: Oracle HTML DB Tutorial

• For Page, enter 11. • Check reset pagination for this page.

ther.

24. nter Average Days to Resolve (chart). et section:

• For Page, enter 12.

ow that the list is created, you need to include it on the Home Page. To get it to display in the left ma

(

21. Click Create and Create Ano

22. For List, select Main Menu. 23. For Sequence, enter 60.

For List Entry Label, e25. Under the Targ

26. Click Create. N

rgin, you need to change the page template to one that has the appropriate region position.

1. Click the edit page icon ). You should be on page 12, Average Days to Resolve.

3. ibutes. Display section, for Page Template, select 10. No Tabs

with Sidebar.

ow that you have selected a template with the proper region position you can create the region that wi

on, click the create icon (

2. For Page, enter 1 and click Go. Click Edit Attr

4. Under the Primary Page

5. Click Apply Changes. N

ll contain your menu.

1. Under the Regions secti ). st and click Next>.

mplate, select No Template. ck pick of [Pos. 2].

7. For List, select Main Menu. st Region.

2. For Select a common region type:, select Li3. For Title, enter Menu. 4. For Region Te5. For Display Point, use the qui6. Click Next>.

8. Click Create Li Maintenance Navigation The Maintenance navigation will also be implemented as a list. It will be displayed just below the rep

age. onents.

lect Lists.

r Maintenance. 6. For List Template, select Vertical Sidebar List.

ou will create three list items. The first will act as a separator between the two navigation regions. The other two will be to view People and to view Projects.

orts in the left margin.

1. Navigate to the Application Builder Home p2. Select Shared Comp3. Under the Navigation section, se4. Click Create List>. 5. For Name, ente

7. Click Create. Y

Page 56 of 56

Page 57: Oracle HTML DB Tutorial

ce. 3. enter &nbsp;.

• For Page, enter 1. nother.

.

9. enter Projects. 10.

• Check reset pagination for this page. her.

14. enter People. 15.

nter 4.

1. Click Create List Entry>. 2. For List, select Maintenan

For List Entry Label, 4. Under the Target section:

5. Click Create and Create A

6. Click Create List Entry>7. For List, select Maintenance. 8. For Sequence, enter 20.

For List Entry Label, Under the Target section: • For Page, enter 2.

11. Click Create and Create Anot

12. For List, select Maintenance. 13. For Sequence, enter 30.

For List Entry Label, Under the Target section: • For Page, e• Check reset pagination for this page.

16. Click Create. Just as with the reports, you will now create a region to display the new list.

1. Click the edit page icon ( ). 2. Under the Regions section, click the create icon ( ).

Next>.

. k pick [Pos. 2].

Maintenance.

3. For Select a common region type:, select List and click4. For Title, enter Maintenance. 5. For Region Template, select No Template6. For Display Point, use the quic7. Click Next>. 8. For List, select 9. Click Create List Region.

Add New Issue Button Next, you will create a button to navigate the user to page 7 ate/Edit Issue. The button will need to

on (

, Cre belong to a region.

1. Under the Regions section, click the create ic ). lt of HTML and click Next>.

6. Click Next>.

2. For Select a common region type:, keep the defau3. For Title, enter Buttons. 4. For Region Template, select No Template. 5. For Display Point, use the quick pick of [Pos. 1].

Page 57 of 57

Page 58: Oracle HTML DB Tutorial

7. Keeping the Source blank, click Create Region.

8. Under the Buttons section, click the create icon ( ). 9. For Region, select Buttons and click Next>.

in a region position and click Next>.

er Add a New Issue.

mplate, select Button and click Next>. 16. For Position, select Top of Region.

Under the Branching section, the following will call the correct page, clear the cache and d cancel buttons will return the user to the home page.

ter P7_PREV_PAGE. 21. For With these values, enter 1.

te Button.

10. Keep the default of Create a button11. For Button Name, enter ADD. 12. For Label, ent13. For Action, select Redirect URL. 14. Click Next>. 15. For Button Te

17. Click Next>.

make it so the create an

18. For Page, enter 7. 19. For Clear Cache, enter 7. 20. For Set these items, en

22. Click Crea Add Overdue Issues The Home page needs some content. First you will add a report to display Overdue Issues. The query will retrieve all issues that are not closed whose target resolution date has passed.

1. Under the Regions section, click the create icon ( ). 2. For Select a common region type:, select Report and click Next>.

plementation, select SQL Report and click Next>. .

5. Click Next>. 6. , enter:

signee, ution_date,

project_id

ary because the assignment is optional. 7. Click Create Region.

3. For Report Im4. For Title, enter Overdue Issues

For Enter SQL Query:

select i.issue_id, i.priority,

, i.issue_summary as p.person_name

i.target_resol r.project_name from ht_issues i, ht_people p, ht_projects r

.person_id (+) where i.assigned_to = p and i.related_project = r.

and i.target_resolution_date < sysdate and i.status != 'Closed' The outer join is necess

Page 58 of 58

Page 59: Oracle HTML DB Tutorial

Now that the region has been created, the headings need to be cleaned up. You will also turn the ummary into a link to display the issue details.

the left of Overdue Issues.

ary. ned To.

6. olution<br>Date.

7. mn. It is necessary in the yed.

nce, select 1.

. 12. :

the quick pick of [Icon 3].

PREV_PAGE.

13. Under the Layout and Pagination section: .

.

w (

s

1. Under the Regions section, select Q to2. For Headings Type:, select Custom. 3. For ISSUE_ID, remove the Heading. 4. For ISSUE_SUMMARY, for Heading, enter Summ5. For ASSIGNEE, for Heading, enter Assig

For TARGET_RESOLUTION_DATE: • For Heading enter Target<br>Res• For Column Align., select center. • For Heading Align., select center. For ISSUE_ID, for Show, click to not display the coluquery to pass in the link but should not be displa

8. For all columns except ISSUE_ID, check Sort. 9. For TARGET_RESOLUTION_DATE, for Sort Seque10. For ISSUE_SUMMARY, for Sort Sequence, select 2. 11. Click the Edit link to the left of ISSUE_SUMMARY

Under the Column Link section, enter the following• For Link Text, use• For Page, enter 7.

For Clear Cache, enter 7. • • For Item 1, for Name, enter P7_ISSUE_ID.

SUE_ID#. • For Item 1, for Value, enter #ISnter P7_• For Item 2, for Name, e

• For Item 2, for Value, enter 1. • Click Apply Changes.

• For Pagination Scheme, select Search Engine 1,2,3,4 (set based pagination)• For Number of Rows, enter 5

14. Under the Sorting section, for Ascending and Descending Image, select the light gray arro ) by clicking on it.

tion, for When No Data Found Message, enter No Overdue Issues..

hanges.

15. Under the Messages sec

16. Click Apply C Add Unassigned Issues The next report you will add will display unassigned, open Issues. This report is very similar to

verdue Issues. Rather than creating it manually, you will copy the Overdue Issues report and modify

icon (

O it.

1. Under the Regions section, click the copy ).

1 and click Next>. 4. For Region Name, enter Unassigned Issues.

2. Under Name, select Overdue Issues. 3. Keep the To Page as

5. Click Copy Region.

Page 59 of 59

Page 60: Oracle HTML DB Tutorial

Now y the report region.

1. Under the Regions section, select Unassigned Issues. 2. r:

, dentifiee

columns that were already

4. r Heading, enter Identified By. tion, for When No Data Found Message, enter No

Unassigned Issues.. es.

ou will modify the query and make some minor changes to

For Region Source, ente

select i.issue_id, i.priority, i.issue_summary,

lution_date, i.target_reso r.project_name p.person_name i from ht_issues i, ht_people p, ht_projects r where i.assigned_to is null and i.status != 'Closed' and i.related_project = r.project_id and i.identified_by = p.person_id

3. Select the Report Attributes tab. You will see that thedefined have retained their modified attributes. For IDENTIFIEE, fo

5. Under the Messages sec

6. Click Apply Chang Add Recently Opened Issues The last report you will add is Recently Opened Issues. The query will retrieve all issues entered into the system within the past 7 days but will only display the most recent 5 issues. As with

nassigned Issues, you will copy a report and modify it. This works for the Home page because the rep to create from scratch.

icon (

Uorts share so many attributes that it is quicker to copy an th

1. Under the Regions section, click the copy ).

1 and click Next>. 4. For Region Name, enter Recently Opened Issues.

Now yo

1. d Issues region. off column heading sorting. The sorting is

included in the query. For all columns, for Sort Sequence, set to -. 3. Select the Region Definition subtab.

2. Under Name, select Unassigned Issues. 3. Keep the To Page as

5. Click Copy Region.

u will modify the query and make some minor changes to the report attributes.

Under the Regions section, click the Q to the left of Recently Opene2. For all columns, for Sort, click to turn

Page 60 of 60

Page 61: Oracle HTML DB Tutorial

4. For Region Source, enter:

select issue_id, priority, issue_summary, assignee, target_resolution_date, project_name, identifiee from ( select i.issue_id, i.priority, i.issue_summary, p.person_name assignee, i.target_resolution_date, r.project_name, p2.person_name identifiee from ht_issues i, ht_people p, ht_people p2, ht_projects r where i.assigned_to = p.person_id (+) and i.related_project = r.project_id and i.identified_by = p2.person_id and i.created_date > (sysdate - 7) order by i.created_date desc ) where rownum < 6

5. Select the Report Attributes tab. You will see that the columns that were already

defined have retained their modified attributes. ASSIGNEE, which did not exist in the copied report, was created but is displayed at the bottom of the attributes. That is what happens with new attributes. You will just shift it up into the proper position.

6. For ASSIGNEE, click the gray up arrow ( ) to the right of the Edit column. Repeat this two more times until ASSIGNEE is just after ISSUE_SUMMARY.

7. For ASSIGNEE, for Heading, enter Assigned To. 8. Under the Layout and Pagination section, for Pagination Scheme, select - No

Pagination Selected -. There is no need for pagination because the query is limited to 5 rows.

9. Under the Messages section, for When No Data Found Message, enter No Recently Opened Issues..

10. Click Apply Changes.

Page 61 of 61

Page 62: Oracle HTML DB Tutorial

Add Open Issues by Project The last thing needed is a pie chart displaying Open Issues by Project.

1. Under the Regions section, click the create icon ( ). 2. For Select a common region type:, select Chart and click Next>. 3. Select Pie and click Next>. 4. For Title, enter Open Issues by Project and click Next>. 5. For Enter SVG Chart SQL Query:, enter:

select null link, nvl(r.project_name,'No Project') label, count(r.project_name) value from ht_issues i, ht_projects r where i.status = 'Open' and i.related_project = r.project_id group by null, r.project_name order by r.project_name

This query does not include a link, the label is the Project Name and the value that will be calculated and used for the pie chart is the total number of open issues by project.

6. Click Create Region.

Now you will clean up the chart.

1. Under the Regions section, select Chart to the left of Open Issues by Project. 2. For Chart Width, enter 500. 3. For Chart Height, enter 200. 4. For Chart Title, remove the title. 7. Under the Chart Query section, for When No Data Found Message, enter No Open

Issues.. 5. Under the Font Settings section, for Legend, for Font Size enter 14. 6. Click Apply Changes.

Breadcrumb Menu You have created menus on the Home page that allow for navigation to various functions. Now you need to provide a way for users to return to the home page. This will be accomplished with a breadcrumb menu. You will create a menu, add menu options to it and then include that menu within a region on Page 0. Including something on page 0 makes it display on all pages within an application.

1. Under the Shared Components section, click on the Menus heading. 2. Click Create>.

• For Name, enter Breadcrumb. • Click Create.

3. Click Create Menu Option>.

Page 62 of 62

Page 63: Oracle HTML DB Tutorial

• For Menu, select Breadcrumb. • For Page, enter 1. • For Short Name, enter Home. • Under the Menu Target section, for Page, enter 1. • Click Create.

4. Click Create Menu Option>. • For , select Breadcrumb. Menu• For Page, enter 2.

or Parent Menu Option, select Home. • Under the Menu Option section, f• For Short Name, enter Projects.

u Target section, for Page, enter 2. • Under the Men• Click Create.

5. Click Create Menu Option>. • For Menu, select Breadcrumb.

enu Option, select Projects.

u Target section, for Page, enter 3.

6. readcrumb.

, select Home.

tion, for Page, enter 4.

7.

People. .

ion, for Page, enter 5.

8. ption>.

Option, select Home. e, enter Issues.

ion, for Page, enter 6.

9. ption>.

Option, select Home. ate/Edit Issue. ion, for Page, enter 7.

• For Page, enter 3. • Under the Menu Option section, for Parent M• For Short Name, enter Create/Edit Project. • Under the Men• Click Create. Click Create Menu Option>. • For Menu, select B• For Page, enter 4. • Under the Menu Option section, for Parent Menu Option• For Short Name, enter People. • Under the Menu Target sec• Click Create.

ption>. Click Create Menu O• For Menu, select Breadcrumb. • For Page, enter 5.

Option, select • Under the Menu Option section, for Parent Menue, enter Create/Edit Person Information• For Short Nam

• Under the Menu Target sect• Click Create. Click Create Menu O• For Menu, select Breadcrumb. • For Page, enter 6. • Under the Menu Option section, for Parent Menu • For Short Nam• Under the Menu Target sect• Click Create. Click Create Menu O• For Menu, select Breadcrumb. • For Page, enter 7. • Under the Menu Option section, for Parent Menu • For Short Name, enter Cre• Under the Menu Target sect

Page 63 of 63

Page 64: Oracle HTML DB Tutorial

• Click Create. 10. ption>.

Option, select Home. .

or Page, enter 8.

11.

Option, select Home. e Summary, by Project.

or Page, enter 9.

12.

u Option section, for Parent Menu Option, select Home. olved by Month Identified.

or Page, enter 10.

13.

tion, for Parent Menu Option, select Home. esolution Dates. or Page, enter 11.

14.

Under the Menu Option section, for Parent Menu Option, select Home. • For Short Name, enter Average Days to Resolve. • Under the Menu Target section, for Page, enter 12. • Click Create.

Click Create Menu O• For Menu, select Breadcrumb. • For Page, enter 8. • Under the Menu Option section, for Parent Menu • For Short Name, enter Assign Issues• Und Menu Ter the arget section, f• Click Create.

c Cli k Create Menu Option>. • For Menu, select Breadcrumb. • For Page, enter 9.

u Option section, for Parent Menu • Under the Men• For Short Name, enter Issu• Under the Menu Target section, f• Click Create. Click Create Menu Option>. • For Menu, select Breadcrumb. • For Page, enter 10. • Under the Men• For Short Name, enter Res• Under the Menu Target section, f• Click Create. Click Create Menu Option>. • For Menu, select Breadcrumb. • For Page, enter 11. • Under the Menu Option sec• For Short Name, enter Target R

get section, f• Under the Menu Tar• Click Create. Click Create Menu Option>. • For Menu, select Breadcrumb.

12. • For Page, enter•

Page 64 of 64

Page 65: Oracle HTML DB Tutorial

Now that the menu exists, it needs to be included in the application.

1. Click the edit page icon ( ). 2. Under the Page section, click Create >. 3. Select Blank Page and click Next>. 4. For Page, enter 0 and click Next>. 5. For Name, enter Breadcrumbs and click Next>. 6. For Tab Options, keep Do not use tabs and click Next>. 7. Review your selections and click Finish.

8. From the Success page, select Edit Page. This will leave you on page 0, Breadcrumbs. 9. Under the Regions section, click the create icon ( ). 10. For Select a common region type, select Menu and click Next>. 11. For Title, enter Breadcrumbs. 12. For Region Template, select No Template. 13. For Display Point, select Page Template Region Position 1. That will make it display

above any other content on each page. 14. Click Next>. 15. For Menu, select Breadcrumbs. 16. For Menu Template, select Breadcrumb Menu. 17. Click Create Menu Region.

Page 65 of 65

Page 66: Oracle HTML DB Tutorial

Revised Home Page

Return to the Home page by clicking the next page icon ( ). To see your complete Home page, click the run icon ( ). Notice the Breadcrumb in the top bar. Click on one of the items on the maintenance menu and watch the breadcrumb change. Use the navigation to access the reports. Image 17 - Revised Home Page

At this stage the application is fully function but is missing the requested security and email notification. Those topics will be discussed in the next section.

Page 66 of 66

Page 67: Oracle HTML DB Tutorial

9 Adding Advanced Features Now that the basic application is complete, you will add some advanced features.

Email Notification The requirements specify to:

• Notify people when an issue is assigned to them • Notify the project lead when any issue becomes overdue

To send mail from within an Oracle HTML DB application, you create a PL/SQL process that calls the supplied HTMLDB_MAIL package. E-mail is not sent immediately from Oracle HTML DB but rather is stored in a temporary queue until a DBMS_JOB pushes the queue. The DBMS_JOB utilizes two preferences (also known as “HTML DB Engine Settings”) named SMTP_HOST_ADDRESS and SMTP_HOST_PORT to send mail in the queue. By default, these preferences are set to localhost and 25. If the server where Oracle HTML DB is installed is not configured for SMTP services, you will need to change the SMTP_HOST_ADDRESS preference. Check with your Oracle HTML DB administrator to make sure the instance you are using is properly configured to send e-mail. The following is a description of the SEND procedure of the HTMLDB_MAIL package. PROCEDURE SEND Argument Name Type In/Out Default? ------------------------------ ----------------------- ------ -------- P_TO VARCHAR2 IN P_FROM VARCHAR2 IN P_BODY VARCHAR2 IN P_BODY_HTML VARCHAR2 IN DEFAULT P_SUBJ VARCHAR2 IN DEFAULT P_CC VARCHAR2 IN DEFAULT P_BCC VARCHAR2 IN DEFAULT New Assignment First, you will add the notification to a person when they have a new assignment. An assignment can be made or changed from two different pages, Create/Edit Issue and Assign Issues. On the Create/Edit Issue page, you can store the initial values and then check them against any changes to see if an assignment was made or changed. Because Assign Issues is a tabular form, there is no way to check the old values against the new values. Given this, the best way to implement the notification is with a before insert and update trigger on HT_ISSUES. You will create this trigger programmatically using the SQL Workshop.

1. Navigate to the HTML DB Home page. 2. Select SQL Workshop. 3. Select Create Object. 4. For Select the type of database object you wish to create:, select Trigger and click

Next>. 5. For Schema, select the appropriate schema and click Next>.

Page 67 of 67

Page 68: Oracle HTML DB Tutorial

6. For Table Name, enter HT_ISSUES and click Next>. 7. For Action, keep the default of Create Trigger and click Next>. 8. For Trigger Name, enter BIU_HT_ISSUES_NOTIFY_ASSIGNEE. 9. For Firing Point, select AFTER. 10. For Options, select insert, update. 11. For Trigger Body, enter:

if (inserting and :new.assigned_to is not null) or (updating and (:old.assigned_to is null or :new.assigned_to != :old.assigned_to) and :new.assigned_to is not null) then for c1 in (select person_name, person_email from ht_people where person_id = :new.assigned_to) loop if c1.person_email is not null then for c2 in (select project_name from ht_projects where project_id = :new.related_project) loop htmldb_mail.send( p_to => c1.person_email, p_from => c1.person_email, p_body => 'You have been assigned a new issue. '|| 'The details are below. ' ||chr(10)|| chr(10)|| ' Project: '|| c2.project_name ||chr(10)|| ' Summary: '||:new.issue_summary ||chr(10)|| ' Status: '||:new.status ||chr(10)|| 'Priority: '||nvl(:new.priority,'-'), p_subj => 'New Issue Assignment'); end loop; end if; end loop; end if;

12. Click Next>. 13. To review the code, click the expand icon ( ) to the left of SQL. 14. Click Finish. 15. You will be left on the Success page. Select SQL Workshop Home.

Page 68 of 68

Page 69: Oracle HTML DB Tutorial

Below is what an email would look like. Image 18 - Example Assignment Email

Note: If you plan on using the application, you should either disable this trigger or change the p_to and p_from to your own email so that you will not create emails with invalid addresses each time you assign or reassign an issue. Overdue Issues The second email notification is to the project lead whenever an issue becomes overdue. An issue becomes overdue when the target resolution date is past but the issue is not yet Closed. Because there is no human interaction that makes an issue overdue you cannot check for it on a page or in a trigger. The best way to check for overdue issues is to write a package that will query the HT_ISSUES table, and if it finds any overdue issues, to have it initiate an email to the Project Lead. This procedure will be written to check for issues by project so that the project lead will get just one email with all overdue issues rather than an email per issue. The package will be called once a day by a dbms_job. You can use the Create Object function within the SQL Workshop to create the package and package body or you can use the SQL Command Processor to run the create commands. You will use the SQL Command Processor.

1. You should be on the SQL Workshop home page. 2. Select SQL Command Processor. 3. For Schema, select the appropriate schema. 4. For Enter a SQL or PL/SQL Statement enter:

create or replace package ht_check_overdue_issues as procedure email_overdue; end; /

5. Click Run SQL.

Now you will create the package body:

Page 69 of 69

Page 70: Oracle HTML DB Tutorial

6. For Enter a SQL or PL/SQL Statement enter:

create or replace package body ht_check_overdue_issues as procedure email_overdue is l_msg_body varchar2(32000) := null; l_count number := 0; begin for c1 in (select pr.project_id, pr.project_name, pe.person_name, pe.person_email from ht_projects pr, ht_people pe where pr.project_id = pe.assigned_project and pe.person_role = 'Lead') loop for c2 in (select i.target_resolution_date, i.issue_summary, p.person_name, i.status, i.priority from ht_issues i, ht_people p where i.assigned_to = p.person_id (+) and i.related_project = c1.project_id and i.target_resolution_date < sysdate and i.status != 'Closed' order by i.target_resolution_date, i.issue_summary) loop if l_count = 0 then l_msg_body := 'As of today, the following issues '|| 'are overdue:'||chr(10)|| chr(10)|| ' Project: '|| c1.project_name ||chr(10)|| chr(10)|| ' Target: '||c2.target_resolution_date ||chr(10)|| ' Summary: '||c2.issue_summary ||chr(10)|| ' Status: '||c2.status ||chr(10)|| ' Priority: '||c2.priority ||chr(10)|| 'Assigned to: '||c2.person_name; else l_msg_body := l_msg_body ||chr(10)|| chr(10)|| ' Target: '||c2.target_resolution_date ||chr(10)|| ' Summary: '||c2.issue_summary ||chr(10)|| ' Status: '||c2.status ||chr(10)|| ' Priority: '||c2.priority ||chr(10)|| 'Assigned to: '||c2.person_name; end if; l_count := l_count + 1;

Page 70 of 70

Page 71: Oracle HTML DB Tutorial

end loop; if l_msg_body is not null then htmldb_mail.send( p_to => c1.person_email, p_from => c1.person_email, p_body => l_msg_body, p_subj => 'Overdue Issues for Project '|| c1.project_name); end if; l_count := 0; end loop; end email_overdue; end ht_check_overdue_issues; /

7. Click Run SQL.

Lastly you will create the dbms_job:

8. For Enter a SQL or PL/SQL Statement enter:

declare jobno number; begin dbms_job.submit( job => jobno, what => 'begin ht_check_overdue_issues.email_overdue; end;', next_date => sysdate, interval => 'trunc(sysdate)+(25/24)' ); commit; end; /

9. Click Run SQL.

Page 71 of 71

Page 72: Oracle HTML DB Tutorial

This dbms_job executes just after midnight each day. Below is what an email would look like. Image 19 - Example Overdue Issues Email

Note: You should either change the p_to and p_from in the ht_check_overdue_issues package body to your own email address or not create the dbms_job. Running the code as written will result in the creation of email to invalid address and they will sit in the mail queue. For more information about how to send email from within Oracle HTML DB, refer to the Send Mail in Oracle HTML DB How-To on OTN.

Application Security There are two security requirements that have not yet been addressed:

• Only the CEO and Managers can define and maintain projects and people • Once assigned, only the person assigned or a project lead can change data about the

issue Within Oracle HTML DB, you can define Authorization Schemes. Once defined, an Authorization Scheme can be associated with any page, region or item to restrict access. Each Authorization Schema is run only when needed and is defined to validate either once per page view or once per session. Restrict Project and People Definition To address the first requirement, you will create an Authorization scheme that will check the current user’s role. That scheme will then be associated with the items on the Projects and People report that navigate to the Create/Edit pages. For additional security, you will also associate the scheme with the Create/Edit pages themselves so that a user cannot bypass the security by changing their URL to the target page. To reference the current user, you will use the session variable :APP_USER. This will be compared with the person’s email address (which is the same as their HTML DB user name). Whenever coding this type of security, you should always code in a user that can pass all security. This user will be very useful for development and testing. If you do not accommodate

Page 72 of 72

Page 73: Oracle HTML DB Tutorial

this in the code you will not be able to access the restricted pages unless you define yourself as CEO or Manager. In the code below, you will allow the user HOWTO to pass this security check. First, you will create the Authorization Scheme:

1. Navigate to the HTML DB Home page. 2. Select Application Builder. 3. Select Shared Components. 4. Under the Security section, select Authorization. 5. Click Create>. 6. For Create Authorization Scheme:, keep From Scratch and click Next>. 7. For Name, enter USER_CEO_OR_MANAGER. 8. For Scheme Type, select Exists SQL Query. 9. For Expression 1, enter:

select '1' from ht_people where (upper(person_email) = upper(:APP_USER) and person_role in ('CEO','Manager')) or (upper(:APP_USER) = 'HOWTO')

10. For Identify error message displayed when scheme violated, enter You are not

authorized to access this function.. 11. Under the Evaluation Point section, for Validate authorization scheme, select Once

per session. This is sufficient for this check because the assigned role will not typically change within a given session.

12. Click Create. Now you need to associate the Authorization Scheme with the appropriate objects. The first is the edit link in the Projects report.

1. Click the edit page icon ( ). 2. For Page:, enter 2 and click Go. 3. Under the Regions section, select Q to the left of Projects. 4. Click the edit link to the left of PROJECT_ID. 5. Under the Authorization section, for Authorization Scheme, select

USER_CEO_OR_MANAGER. 6. Click Apply Changes. 7. Click Cancel.

Next is the Create button on the Projects report.

1. Still on page 2, under the Buttons section, select CREATE. 2. Under the Authorization section, for Authorization Scheme, select

USER_CEO_OR_MANAGER. 3. Click Apply Changes.

Page 73 of 73

Page 74: Oracle HTML DB Tutorial

Lastly, for Projects, is associating the schema with the Create/Edit Project page.

1. In the Page section, click the next page icon ( ). You should now be on page 3, Create/Edit Project.

2. In the Page section, click Edit Attributes. 3. Under the Security section, for Authorization Scheme, select

USER_CEO_OR_MANAGER. 4. Click Apply Changes.

Now this needs to be repeated for People.

1. In the Page section, click the next page icon ( ). You should now be on the page 4, People.

2. Under the Regions section, select Q to the left of People. 3. Click the edit link to the left of PERSON_ID. 4. Under the Authorization section, for Authorization Scheme, select

USER_CEO_OR_MANAGER. 5. Click Apply Changes. 6. Click Cancel. 7. Under the Buttons section, select CREATE. 8. Under the Authorization section, for Authorization Scheme, select

USER_CEO_OR_MANAGER. 9. Click Apply Changes.

Lastly, apply to the Create/Edit Person Information page.

1. In the Page section, click the next page icon ( ). You should now be on page 5, Create/Edit Person Information.

2. In the Page section, click Edit Attributes. 3. Under the Security section, for Authorization Scheme, select

USER_CEO_OR_MANAGER. 4. Click Apply Changes.

Page 74 of 74

Page 75: Oracle HTML DB Tutorial

You can test this creating a user with the username of HOWTO. That user should be able to see the edit link. Create another user, HOWTO2, and you should not be able to see the link. You will find information on how to create a user in the Deploying the Application, Creating Users section below. Image 20 - Projects page running as HOWTO2

Below is the error message displayed if a user tries to access a restricted page directly by changing the URL. Image 21 - Create/Edit Projects being accessed by unauthorized user

Page 75 of 75

Page 76: Oracle HTML DB Tutorial

Restrict Issue Modification Now you need to address the other security requirement. It is that once an issue is assigned, only the person assigned or a project lead can change data about the issue. This is a little trickier because it changes for every issue. There are two pages that allow for the modification of an Issue, the Create/Edit Issue page and the Assign Issues page. On the Assign Issues page, the only issues that are displayed are those that are not yet assigned. Without an assignment, there is no security necessary. There are many places that a user can navigate to edit an issue. On the Home page, there are 3 regions that display issues and have a link for edit. The Issues report has links to edit each issue and the Target Resolution Dates report allows for selection of an issue to edit. Although other users are not allowed to change the data, you do want to allow other users to view all the detailed data about an issue so that they can view the progress and resolution. Given these considerations, the best way to implement this would be to create an Authorization Scheme that will be evaluated once per page view. The Authorization Scheme will be associated with both the Apply Changes and Delete buttons on the Create/Edit Issue page. This way, unauthorized users can view all the details, but if they do change something, they have no way of saving that change. To add extra security, you will also associate the Authorization Scheme with the process that performs the insert, update and delete on HT_ISSUES. This protects against someone changing the URL to call the Apply Changes process. To let users know why they are not able to make changes, you will add an html region containing an explanation that will only display when the authorization fails. The SQL for this Scheme will be specific to the Create/Edit Issues page because it needs to reference P7_ISSUE_ID. It will need to retrieve data from the database because at the time it will be evaluated, the necessary data will not be available in the session state. The only item that will be available will be P7_ISSUE_ID because it will be passed by the link. Just as before, first, you create the Authorization Scheme:

1. Navigate to the Application Builder Home page. 2. Select Shared Components. 3. Under the Security section, select Authorization. 4. Click Create>. 5. For Create Authorization Scheme:, keep From Scratch and click Next>. 6. For Name, enter P7_ASSIGNED_OR_PROJECT_LEAD. 7. For Scheme Type, select PL/SQL Function Returning Boolean. 8. For Expression 1, enter:

declare l_related_project integer; l_assigned_to integer; l_person_id integer; l_person_role varchar2(7); l_assigned_project integer; begin -- User is HOWTO or new Issue if :APP_USER = 'HOWTO' or :P7_ISSUE_ID is null

Page 76 of 76

Page 77: Oracle HTML DB Tutorial

then return true; end if; for c1 in (select related_project, assigned_to from ht_issues where issue_id = :P7_ISSUE_ID) loop l_related_project := c1.related_project; l_assigned_to := c1.assigned_to; end loop; -- Issue not yet assigned if l_assigned_to is null then return true; end if; for c2 in (select person_id, person_role, assigned_project from ht_people where upper(person_email) = upper(:APP_USER)) loop l_person_id := c2.person_id; l_person_role := c2.person_role; l_assigned_project := c2.assigned_project; end loop; -- User is lead of related project if l_person_role = 'Lead' and l_assigned_project = l_related_project then return true; -- User is assigned to issue elsif l_assigned_to = l_person_id then return true; else return false; end if; end;

9. For Identify error message displayed when scheme violated, enter This issue is

not assigned to you, nor are you the Project Lead. Therefore you are not authorized to modify the data..

10. Under the Evaluation Point section, for Validate authorization scheme, keep Once per page view. This is necessary because each issue may have a different result.

11. Click Create.

Page 77 of 77

Page 78: Oracle HTML DB Tutorial

Now you need to associate the Authorization Scheme with the appropriate objects on the Create/Edit Issue page.

1. Click the edit page icon ( ). 2. For Page:, enter 7 and click Go. 3. Under the Buttons section, select DELETE. 4. Under the Authorization section, for Authorization Scheme, select

P7_ASSIGNED_OR_PROJECT_LEAD. 5. Click Apply Changes.

6. Under the Buttons section, select SAVE. 7. Under the Authorization section, for Authorization Scheme, select

P7_ASSIGNED_OR_PROJECT_LEAD. 8. Click Apply Changes.

9. Under the Processes section, select Process Row of HT_ISSUES. 10. Under the Authorization section, for Authorization Scheme, select

P7_ASSIGNED_OR_PROJECT_LEAD. 11. Click Apply Changes.

Lastly, you will create the new region.

1. Under the Regions section, click the create icon ( ). 2. For Select a common region type:, keep HTML and click Next>. 3. For Title, enter Not Authorized. 4. For Display Point, select Page Template Body (2. items below region content). 5. Click Next>. 6. For Enter HTML Text Region Source:, enter:

You are not authorized to modify the data for this issue because<br>you are not the Project Lead nor is the issue assigned to you.

7. Click Next>. 8. For Authorization Scheme, select {Not}P7_ASSIGNED_OR_PROJECT_LEAD.

This will make the region only display when the Authorization Scheme fails. 9. Click Create Region.

Below is the Create/Edit Issue page being run by a person for whom the Authorization fails. Notice the new region and that the only button being displayed is Cancel.

Page 78 of 78

Page 79: Oracle HTML DB Tutorial

Image 22 - Create/Edit Issue when user not assigned nor Project Lead

Page 79 of 79

Page 80: Oracle HTML DB Tutorial

A more elegant solution to this security requirement would be to create a different page for viewing the details of an issue. You would need to have a procedure that would take in the issue_id and current user and pass back a flag for view only or edit. Then you could dynamically build the link for all the reports to call either the View page or the Edit page based upon a call to that procedure. You would still want to protect against someone accessing the edit page without using a link so you would also check permission before firing the insert, update and delete process.

10 Deploying the Application Now that your application is complete, you should be planning for deployment. Applications are typically created on one server and deployed on another. This separation is not necessary but it is useful so that bugs can be worked on without affecting the production instance. To deploy your application on another server, you would need to have an Oracle HTML DB instance configured there.

Moving the Application Definition The definition for your application lives within the Oracle database. It includes everything that makes up the application, including templates, but not database object definitions or the data. To move the application to another Oracle HTML DB instance, you must export the application definition from your development server and import it onto your production server. On your development instance:

1. Navigate to the Application Builder Home page. 2. Select Export / Import. 3. For Select Task:, keep Export and click Next>. 4. For Application, select the application created in this exercise. 5. Click Export Application. 6. When prompted, click to Save the file. 7. Specify a location on your local harddrive where you want the file to be stored and

click Save. On your production instance, you should follow the directions in this exercise to create the object necessary to support this application. Once they exist, you can import your application. They do not need to exist before the import, but you cannot test the code until the objects exist. Login to your production instance:

1. Navigate to the Application Builder Home page. 2. Select Export / Import. 3. For Select Task:, select Import and click Next>. 4. For Import File, use the Browse button to locate your exported file. 5. For File Type, select Application Export.

Page 80 of 80

Page 81: Oracle HTML DB Tutorial

6. For File Character Set, keep the default and click Next>. 7. The file should be imported successfully, now you need to install it. Click Install>. 8. For Parse As Schema, select the schema on your production server that contains your

application objects. 9. For Build Status, you can select Run and Build Application. This will allow the

application to be run but will still allow you to login and change the code if necessary. This would be useful to make quick bug fixes. You can alternatively select Run Application Only and then you will not be able to access the source code for the application.

10. For Install As Application, you can Reuse Application ID if it is not already used on the production instance. You can also allow the process to Auto Assign New Application ID or you can Change the Application ID. If you select Change Application ID, you will be prompted to enter a new ID for New Application.

When you install an application having the same ID as an existing application in the current workspace, the existing application is deleted and then the new application is installed. When you attempt to install an application having the same ID as an existing application in a different workspace, an error message is shown and no harm is done. If all statements are successful the install commits and becomes permanent. If any errors are encountered, the install is rolled back, resulting in no permanent changes.

11. Click Install Application. 12. If the install is successful, it should leave you on Post-App Install Utility Options.

From here, you can either Run Application to see application running or Edit Application Attributes to review the application definition within HTML DB.

Loading Data If this were an actual application being deployed you would want to load data prior to the deployment. At a minimum, the Project and People would need to be populated. There are various mechanisms you could use, some of which were demonstrated in this exercise.

• Use the application itself to create data. • Use the Data Loader to load data copied from a spreadsheet. • Use the SQL Workshop and run scripts to create data. • If you have data existing already within an Oracle database, use either export/import to

move data between machines or use SQL to retrieve and transform existing data and load it into the application tables.

Page 81 of 81

Page 82: Oracle HTML DB Tutorial

Alternate Authentication Mechanisms When your application's login page calls the Oracle HTML DB login API with a username and password, the engine calls the credentials verification method specified in the application's current authentication scheme. You have three choices about how credentials are verified from within the login API:

• Implement the method yourself as a PL/SQL function returning boolean and put it in your application's schema.

• Use the built-in LDAP authentication method, which checks username and password against the LDAP directory that you specify.

• Use the built-in Oracle HTML DB authentication method, which checks username and password against the Oracle HTML DB account repository.

Your application is currently using HTML DB authentication. It is also possible to use an external authentication service like Oracle AS Single Sign-On, but Oracle HTML DB redirects to these services instead of showing a login page. For more information on authentication methods called during the processing of the application's login page, refer to the Changing Authentication Methods How-To on OTN. For more instructions about using Oracle AS Single Sign-On with Oracle HTML DB, refer to the Using Oracle AS Single Sign-On with HTML DB Applications How-To on OTN.

Creating Users For the application to be accessible, you need to create users. If you are still using HTML DB authentication, the simplest way to create users it to use the Administration capabilities within the workspace that owns the application. You will need to have been granted Administration capability on the workspace in order to access Administration.

1. Navigate to the HTML DB home page. 2. Under Workspace Administration on the right, select Manage Users. 3. Select Create New User. 4. Under the User Identification section, enter the required information. Remember to

set the User Name the same as the Email Address so that the application security will work correctly.

5. Under the Developer Privileges section, for User is a developer, select No and for User is an administrator, select No. This will allow the user to run the application but not access the HTML DB Application Builder.

6. Click Create or Create and Create Another.

Page 82 of 82

Page 83: Oracle HTML DB Tutorial

Publishing the URL Now that you have your application, your data and your users, you can publish your production URL and your application is complete. The URL to your application can most easily be determined by hovering over the Run icon on the Application Builder home page. This icon gets its value from the Home link found under the Session Management section of the Application Attributes page. This link is only referenced by this icon and by applications that do not use the HTML DB Login API. For the Issue Tracker on the public Oracle HTML DB development environment, the URL would look like:

http://htmldb.oracle.com/pls/otn/f?p=11563:1:3397731373043366363 The components of the url are:

Component Definition htmldb.oracle.com The URL of the server pls Indicator to use the mod pl/sql cartridge otn The DaD name f?p= A prefix used by Oracle HTML DB 11563 The Application being called 1 The Page, within the Application, to be displayed 3397731373043366363 The session number

To run this Application, use http://htmldb.oracle.com/pls/otn/f?p=11563:1. Upon login, each user will receive a session number, it should not be in the URL. Specifically for the Issue Tracker, the application was created by using the Application Wizard. This wizard created a process on the Login page, page 101, that controls authentication. The contents of the process are:

wwv_flow_custom_auth_std.login( P_UNAME => :P101_USERNAME, P_PASSWORD => :P101_PASSWORD, P_SESSION_ID => :FLOW_SESSION, P_FLOW_PAGE => :APP_ID||':1' );

You should notice that the Page is hardcoded into this process. Because of this, the page you pass in the URL is overwritten and does not need to be included. This application can be accessed by just using http://htmldb.oracle.com/pls/otn/f?p=11563. As you can see from the example used, the URL has no meaning and can be rather long. The host name can be changed to make it more symbolic. You can configure Apache to rewrite your url so that you can publish an abbreviated format and a URL that would be more intuitive to your users. Consult Apache documentation for details. Discuss this tutorial on the HTML DB OTN Discussion Forum.

Page 83 of 83

Page 84: Oracle HTML DB Tutorial

Appendix A: Application DDL -- -- This DDL creates all the database objects used by the -- Issue Management Application featured in -- the Oracle HTML DB Development Document -- -- HT_PROJECTS -- -- The HT_PROJECTS DDL: -- + creates the projects table with the necessary columns, -- including a new column for a system generated primary key -- + declares the new primary key -- + implements the real primary key, project name, as a unique key -- + implements a sequence to generate project id -- + assigns the sequence to populate the project id -- whenever a new record is created -- + declares table and column comments -- create table ht_projects ( project_id integer not null, project_name varchar2(100) not null, start_date date not null, target_end_date date not null, actual_end_date date ) / alter table ht_projects add constraint ht_projects_pk primary key (project_id) / alter table ht_projects add constraint ht_projects_uk unique (project_name) / create sequence ht_projects_seq increment by 1 start with 40 / create or replace trigger bi_ht_projects before insert on ht_projects for each row begin if :new.project_id is null then select ht_projects_seq.nextval into :new.project_id from dual; end if; end; / comment on table ht_projects is 'All projects currently underway.' / comment on column ht_projects.project_id is 'The system generated unique identifier for the project.' / comment on column ht_projects.project_name is 'The unique name of the project.' / comment on column ht_projects.start_date is 'The start date of the project.'

Page 84 of 84

Page 85: Oracle HTML DB Tutorial

/ comment on column ht_projects.target_end_date is 'The targeted end date of the project.' / comment on column ht_projects.actual_end_date is 'The actual end date of the project.' / -- -- HT_PEOPLE -- -- The HT_PEOPLE DDL: -- + creates the people table with the necessary columns, -- including a new column for a system generated primary key -- + declares the new primary key -- + implements the real primary key, person name, as a unique key -- + implements a check constraint to validate the roles that people -- can be assigned -- + implements a foreign key to validate that people are assigned to -- valid projects -- + implements a check constraint to enforce that all project leads -- and team members are assigned to projects -- + implements a sequence to generate person id -- + assigns the sequence to populate the person id whenever a -- new record is created -- + declares table and column comments -- create table ht_people ( person_id integer not null, person_name varchar2(100) not null, person_email varchar2(100) not null, person_role varchar2(7) not null, assigned_project integer ) / alter table ht_people add constraint ht_people_pk primary key (person_id) / alter table ht_people add constraint ht_people_uk unique (person_name) / alter table ht_people add constraint ht_people_role_cc check (person_role in ('CEO','Manager','Lead','Member')) / alter table ht_people add constraint ht_people_project_fk foreign key (assigned_project) references ht_projects / alter table ht_people add constraint ht_people_assignment_cc check ( (person_role in ('Lead','Member') and assigned_project is not null) or (person_role in ('CEO','Manager') and assigned_project is null) ) / create sequence ht_people_seq increment by 1 start with 40 /

Page 85 of 85

Page 86: Oracle HTML DB Tutorial

create or replace trigger bi_ht_people before insert on ht_people for each row begin if :new.person_id is null then select ht_people_seq.nextval into :new.person_id from dual; end if; end; / comment on table ht_people is 'All people within the company.' / comment on column ht_people.person_id is 'The system generated unique identifier for the person.' / comment on column ht_people.person_name is 'The unique name of the person.' / comment on column ht_people.person_role is 'The role the person plays within the company.' / comment on column ht_people.assigned_project is 'The project that the person is currently assigned to.' /

Page 86 of 86

Page 87: Oracle HTML DB Tutorial

-- -- HT_ISSUES -- -- The HT_ISSUES DDL: -- + creates the table with the necessary columns, including a new column -- for a system generated primary key -- + declares the new primary key -- + implements a foreign key to validate that the issue is identified by a -- valid person -- + implements a foreign key to validate that the issue is assigned to a -- valid person -- + implements a foreign key to validate that the issue is associated with -- a valid project -- + implements a check constraint to validate the status that is assigned -- to the issue -- + implements a check constraint to validate the priority that is assigned -- to the issue -- + implements a sequence to generate issue id -- + assigns the sequence to populate the issue id and the creation date -- whenever a new record is created, records the user creating the -- row and also assigns status of 'Open' if no status is provided -- + records the current date and the user whenever an issue is edited and -- sets the status to 'Closed' if an ACTUAL_RESOLUTION_DATE is -- provided -- + declares table and column comments -- create table ht_issues ( issue_id integer not null, issue_summary varchar2(200) not null, issue_description varchar2(2000), identified_by integer not null, identified_date date not null, related_project integer not null, assigned_to integer, status varchar2(8) not null, priority varchar2(6), target_resolution_date date, progress varchar2(2000), actual_resolution_date date, resolution_summary varchar2(2000), created_date date not null, created_by varchar2(60) not null, last_modified_date date, last_modified_by varchar2(60) ) / alter table ht_issues add constraint ht_issues_pk primary key (issue_id) / alter table ht_issues add constraint ht_issues_identified_by_fk foreign key (identified_by) references ht_people / alter table ht_issues add constraint ht_issues_assigned_to_fk foreign key (assigned_to) references ht_people / alter table ht_issues add constraint ht_issues_project_fk foreign key (related_project) references ht_projects

Page 87 of 87

Page 88: Oracle HTML DB Tutorial

/ alter table ht_issues add constraint ht_issues_status_cc check (status in ('Open','On-Hold','Closed')) / alter table ht_issues add constraint ht_issues_priority_cc check (priority in ('High','Medium','Low')) / create sequence ht_issues_seq increment by 1 start with 40 / create or replace trigger bi_ht_issues before insert on ht_issues for each row begin if :new.issue_id is null then select ht_issues_seq.nextval into :new.issue_id from dual; end if; if :new.status is null then :new.status := 'Open'; end if; :new.created_date := sysdate; :new.created_by := nvl(wwv_flow.g_user,user); end; / create or replace trigger bu_ht_issues before update on ht_issues for each row begin if :new.actual_resolution_date is not null then :new.status := 'Closed'; end if; :new.last_modified_date := sysdate; :new.last_modified_by := nvl(wwv_flow.g_user,user); end; / comment on table ht_issues is 'All issues related to the projects being undertaken by the company.' / comment on column ht_issues.issue_id is 'The system generated unique identifier for the issue.' / comment on column ht_issues.issue_summary is 'A brief summary of the issue.' / comment on column ht_issues.issue_description is 'A full description of the issue.' / comment on column ht_issues.identified_by is 'The person who identified the issue.' / comment on column ht_issues.identified_date is 'The date the issue was identified.' / comment on column ht_issues.related_project is

Page 88 of 88

Page 89: Oracle HTML DB Tutorial

'The project that the issue is related to.' / comment on column ht_issues.assigned_to is 'The person that the issue is assigned to.' / comment on column ht_issues.status is 'The current status of the issue.' / comment on column ht_issues.priority is 'The priority of the issue. How important it is to get resolved.' / comment on column ht_issues.target_resolution_date is 'The date on which the issue is planned to be resolved.' / comment on column ht_issues.actual_resolution_date is 'The date the issue was actually resolved.' / comment on column ht_issues.progress is 'Any progress notes on the issue resolution.' / comment on column ht_issues.resolution_summary is 'The description of the resolution of the issue.' / comment on column ht_issues.created_date is 'Audit Column: Date the record was created.' / comment on column ht_issues.created_by is 'Audit Column: The user who created the record.' / comment on column ht_issues.last_modified_date is 'Audit Column: Date the record was last modified.' / comment on column ht_issues.last_modified_by is 'Audit Column: The user who last modified the record.' /

Page 89 of 89

Page 90: Oracle HTML DB Tutorial

Appendix B: Demonstration Data

Create Projects Data The following data was copied from a Microsoft Excel worksheet. project_id project_name start_date target_end_date 1 Internal Infrastructure 02-Jan-2006 01-Jun-2006 2 New Payroll Rollout 01-Mar-2006 01-Jul-2006 3 Email Integration 01-Feb-2006 01-Apr-2006 4 Public Website Operational 01-Apr-2006 01-Jul-2006 5 Employee Satisfaction Survey 01-Jun-2006 01-Aug-2006

Update Project Dates Script update ht_projects set start_date = sysdate-150, target_end_date = sysdate-30 where project_id = 1 / update ht_projects set start_date = sysdate-150, target_end_date = sysdate+15 where project_id = 2 / update ht_projects set start_date = sysdate-120, target_end_date = sysdate-60 where project_id = 3 / update ht_projects set start_date = sysdate-60, target_end_date = sysdate+30 where project_id = 4 / update ht_projects set start_date = sysdate-30, target_end_date = sysdate+60 where project_id = 5 /

Create People Script insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (1, 'Joe Cerno', '[email protected]', 'CEO', null) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (2, 'Kim Roberts', '[email protected]', 'Manager', null) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (3, 'Tom Suess', '[email protected]', 'Manager', null) /

Page 90 of 90

Page 91: Oracle HTML DB Tutorial

insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (4, 'Al Bines', '[email protected]', 'Lead', 1) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (5, 'Carla Downing', '[email protected]', 'Lead', 2) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (6, 'Evan Fanner', '[email protected]', 'Lead', 3) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (7, 'George Hurst', '[email protected]', 'Lead', 4) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (8, 'Irene Jones', '[email protected]', 'Lead', 5) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (9, 'Karen London', '[email protected]', 'Member', 1) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (10, 'Mark Nile', '[email protected]', 'Member', 1) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (11, 'Jane Kerry', '[email protected]', 'Member', 5) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (12, 'Olive Pope', '[email protected]', 'Member', 2) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (13, 'Russ Sanders', '[email protected]', 'Member', 3) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (14, 'Tucker Uberton', '[email protected]', 'Member', 3) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (15, 'Vicky Williams', '[email protected]', 'Member', 4) / insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (16, 'Scott Tiger', '[email protected]', 'Member', 4) /

Page 91 of 91

Page 92: Oracle HTML DB Tutorial

insert into ht_people (person_id, person_name, person_email, person_role, assigned_project) values (17, 'Yvonne Zeiring', '[email protected]', 'Member', 4) /

Create Issues Script -- -- Email Integration Issues -- insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (1, 'Midwest call center servers have no failover due to Conn Creek plant fire','', 6, sysdate-80, 3, 6, 'Closed', 'Medium', sysdate-73, 'Making steady progress.', sysdate-73, '') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (2, 'Timezone ambiguity in some EMEA regions is delaying bulk forwarding to mirror sites','', 6, sysdate-100, 3, 14, 'Open', 'Low', sysdate-80, '','','') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (3, 'Some vendor proposals lack selective archiving and region-keyed retrieval sections','', 6, sysdate-110, 3, 13, 'Closed', 'Medium', sysdate-90, '', sysdate-95, '') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (4, 'Client software licenses expire for Bangalore call center before cutover','', 1, sysdate-70, 3, 6, 'Closed', 'High', sysdate-60, '',sysdate-66,'Worked with HW, applied patch set.') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date,

Page 92 of 92

Page 93: Oracle HTML DB Tutorial

progress, actual_resolution_date, resolution_summary) values (5, 'Holiday coverage for DC1 and DC3 not allowed under union contract, per acting steward at branch 745','', 1, sysdate-100, 3, 13, 'Closed', 'High', sysdate-90, '',sysdate-95, 'Worked with HW, applied patch set.') / -- -- Employee Satisfaction Survey Issues -- insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (6, 'Review rollout schedule with HR VPs/Directors','', 8, sysdate-30, 5, null, 'Closed', 'Medium', sysdate-15, '',sysdate-20,'') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (7, 'Distribute translated categories and questions for non-English regions to regional team leads','', 8, sysdate-2, 5, 8, 'Open', 'Medium', sysdate+10, 'currently beta testing new look and feel','','') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (8, 'Provide survey FAQs to online newsletter group','', 1, sysdate-10, 5, 11, 'Open', 'Medium', sysdate+20, '','','') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (9, 'Need better definition of terms like work group, department, and organization for categories F, H, and M-W','', 1, sysdate-8, 5, null, 'Open', 'Low', sysdate+15, '','','') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values

Page 93 of 93

Page 94: Oracle HTML DB Tutorial

(10, 'Legal has asked for better definitions on healthcare categories for Canadian provincial regs compliance','', 1, sysdate-10, 5, 11, 'Closed', 'Medium', sysdate+20, '',sysdate-1,'') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (11, 'Action plan review dates conflict with effectivity of organizational consolidations for Great Lakes region','', 1, sysdate-9, 5, 11, 'Open', 'Medium', sysdate+45, '','','') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (12, 'Survey administration consulting firm requires indemnification release letter from HR SVP','', 1, sysdate-30, 5, 11, 'Closed', 'Low', sysdate-15, '', sysdate-17, '') / -- -- Internal Infrastructure Issues -- insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (13, 'Facilities, Safety health-check reports must be signed off before capital asset justification can be approved','', 4, sysdate-145, 1, 4, 'Closed', 'Medium', sysdate-100, '',sysdate-110,'') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (14, 'Cooling and Power requirements exceed 90% headroom limit -- variance from Corporate requested','', 4, sysdate-45, 1, 9, 'Closed', 'High', sysdate-30, '',sysdate-35,'') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values

Page 94 of 94

Page 95: Oracle HTML DB Tutorial

(15, 'Local regulations prevent Federal contracts compliance on section 3567.106B','', 4, sysdate-90, 1, 10, 'Closed', 'High', sysdate-82, '',sysdate-85,'') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (16, 'Emergency Response plan failed county inspector''s review at buildings 2 and 5','', 4, sysdate-35, 1, null, 'Open', 'High', sysdate-5, '','','') / -- -- New Payroll Rollout Issues -- insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (17, 'Training for call center 1st and 2nd lines must be staggered across shifts','', 5, sysdate-8, 2, 5, 'Closed', 'Medium', sysdate+10, '',sysdate-1,'') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (18, 'Semi-monthly ISIS feed exceeds bandwidth of Mississauga backup site','', 5, sysdate-100, 2, 12, 'On-Hold', 'Medium', sysdate-30, 'pending info from supplier','','') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (19, 'Expat exception reports must be hand-reconciled until auto-post phaseout complete','', 5, sysdate-17, 2, 12, 'Closed', 'High', sysdate+4, '',sysdate-4,'') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (20, 'Multi-region batch trial run schedule and staffing plan due to directors by end of phase review','',

Page 95 of 95

Page 96: Oracle HTML DB Tutorial

5, sysdate, 2, null, 'Open', 'High', sysdate+15, '','','') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (21, 'Auditors'' signoff requires full CSB compliance report','', 5, sysdate-21, 2, 5, 'Open', 'High', sysdate-7, '','','') / -- -- Public Website Operational Issues -- insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (22, 'Review security architecture plan with consultant','', 1, sysdate-60, 4, 7, 'Closed', 'High', sysdate-45, '',sysdate-40,'') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (23, 'Evaluate vendor load balancing proposals against capital budget','', 7, sysdate-50, 4, 7, 'Closed', 'High', sysdate-45, '',sysdate-43,'') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (24, 'Some preferred domain names are unavailable in registry','', 7, sysdate-55, 4, 15, 'Closed', 'Medium', sysdate-45, '',sysdate-50,'') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (25, 'Establish grid management capacity-expansion policies with ASP','', 7, sysdate-20, 4, 16, 'Open', 'Medium', sysdate-5, '','','') / insert into ht_issues (issue_id, issue_summary, issue_description,

Page 96 of 96

Page 97: Oracle HTML DB Tutorial

identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (26, 'Access through proxy servers blocks some usage tracking tools','', 7, sysdate-10, 4, 15, 'Closed', 'High', sysdate-5, '',sysdate-1,'') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (27, 'Phase I stress testing cannot use production network','', 7, sysdate-11, 4, 17, 'Open', 'High', sysdate, '','','') / insert into ht_issues (issue_id, issue_summary, issue_description, identified_by, identified_date, related_project, assigned_to, status, priority, target_resolution_date, progress, actual_resolution_date, resolution_summary) values (28, 'DoD clients must have secure port and must be blocked from others','', 7, sysdate-20, 4, 17, 'On-Hold', 'High', sysdate, 'Waiting on Security Consultant, this may drag on.','','') /

Page 97 of 97