Top Banner
Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101
100

Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Mar 27, 2015

Download

Documents

Kayla Thomas
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Pennsylvania Banner Users Group APEX Day at Immaculata

APEX 101

Page 2: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Lehigh Carbon Community College (LCCC)

Developer: Wayne Youngblood [email protected]

DBA: Don Thaler [email protected] Over 40 APEX applications used in

Production at LCCC

Page 3: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Objectives

Show some useful APEX links A quick look at LCCC’s current APEX architecture A look at the APEX development environment Build a simple application from scratch. Create a

region, item, button, process, and SQL report. Introduce a simple JavaScript call Export the application to an OS file Import the application to another Database Instance

Page 4: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

What is APEX

Oracle’s Application Express (formerly called HTMLDB)

A hosted declarative development environment for developing and deploying database-centric Web applications.

Users work in a dedicated work area called a workspace.

A workspace is a virtual private database that enables multiple users to work within the same Oracle Application Express installation while keeping their objects, data and applications private.

Page 5: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Some useful APEX links

APEX Forum http://www.oracle.com/splash/forums/index.html

APEX User Guide http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/index.htm

APEX Advanced Tutorial http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/toc.htm

JavaScript Tutorial http://www.w3schools.com/js/default.asp

Page 6: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

LCCC’s APEX Setup

APEX engine is installed in LCCC’s Banner instances The Application Server is Windows Server 2003 Entries in the Application Server’s marvel.conf file determine

what URL points to what Banner Database instance (mod_plsql cartridge)

Examples:

1. Entries within this tag <Location /pls/htmldb> are for LCCC’s production Banner instance. The URL to the Production APEX development environment is http://banforms:7778/pls/htmldb/f?p=4550:8

2. Entries within this tag <Location /pls/pprd> are for LCCC’s pre-production Banner instance. The URL to the Pre-Production APEX development environment is http://banforms:7778/pls/pprd/f?p=4550:8

Page 7: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

The APEX Development Environment Application Builder (the focus of today) SQL Workshop Utilities

Page 8: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Application Builder

Lists all of the applications residing in the Workspace you are logged on to.

Page 9: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Application Builder

Can display icons (previous slide) or details (below)

Page 10: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Application Builder

When “clicking” into an application, the pages of the application are available to edit

New pages can be created Additional icons appear at the top of the

screen for1. Running the application (to test any

functionality)

2. Supporting Objects (not in today’s scope)

3. Shared Components

4. Export/Import

Page 11: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Application Builder

Page 12: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Build an Application

Page 13: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Build an Application Name & Schema

Page 14: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Build an Application Add Page(s)

Page 15: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Build an Application Add Page(s)

Page 16: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Build an Application Add Tabs

Page 17: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Build an Application Shared Components

Page 18: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Build an Application Authentication

Page 19: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Build an Application Theme

Page 20: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Build an Application Confirmation

Page 21: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Build an Application Ready to Edit

Page 22: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page layout

Three areas of page editing

1. Page Rendering

2. Page Processing

3. Shared Components

Page 23: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Region Creation

Add a region to hold items you create, even hidden items

Page 24: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Region Creation

Page 25: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Region Creation

Add Region name and choose display point

Page 26: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Region Creation

New region appears in Region section of Page Rendering.

Page 27: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Items

Create a Banner Term select list using a query

Page 28: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Items

Select list with submit. Submitting will save the selected value in the item.

Page 29: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Items

Choose a name for the item and select the region it will reside in.

Page 30: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Items

Enter Null Text, Null Value, and the query for the select list.

Page 31: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Items

Page 32: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Items

A closer look at the select query (in previous slide)select distinct substr(SOBTERM_TERM_CODE,1,4) || ' ' ||

decode(substr(SOBTERM_TERM_CODE,5,2), '10', 'Spring', '20', 'Summer', '40', 'Fall', '15', 'Spring', '45', 'Fall') || ' ' ||

decode(substr(SOBTERM_TERM_CODE,6), '0', 'Credit ','Non Credit ')

d,

SOBTERM_TERM_CODE r

from sobterm

where sobterm_term_code >= (select max(sobterm_term_code) - 200 from sobterm)

order by 2 desc

Page 33: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Items

Add Label. Default is the item name without the “P1_” prefix.

Page 34: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Items

Enter the Source. This was done in the previous step with the query. No Action needed.

Page 35: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Items

Derive Item Source. Leave the default.

Page 36: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Items

The new item now appears in the Item section of page rendering.

Page 37: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Select list with submit warning

When you use a select list with submit (or any other item with submit), you need to create an unconditional branch to return to the current page or you will see this error message when selecting from the list:

Page 38: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Unconditional Branch

Create the unconditional branch in the Branches section under Page Processing

Page 39: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Unconditional Branch

Use the Branch Point default and select the “Branch to Page” Branch Point

Page 40: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Unconditional Branch

Select the page to branch to. In this case there is only page 1. Select the include process success message.

Page 41: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Unconditional Branch

There are no conditions, so click the “Create Branch” button.

Page 42: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Unconditional Branch

The new branch will be listed under the Branches section of Page Processing.

Page 43: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Buttons

Create a button in the “Item Hold Region”.

Page 44: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Buttons

Keep default of “Create button in region position”.

Page 45: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Buttons

Give the button a name and Label. Leave default action to submit the page.

Page 46: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Buttons

Keep the button template default

Page 47: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Buttons

Select the region position and the alignment for the button.

Page 48: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Buttons

Enter page to branch to when button is pressed. In this case we branch back to the current (and only) page in the application.

Page 49: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Buttons

Select when or if you want the button displayed. In this case we have no conditions, so we just click the “Create Button” button.

Page 50: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Editing a page Buttons

The new button now appears in the Button section of Page Rendering. Additionally, a new branch appears in the Branches section of Page Processing.

Page 51: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Create a Process

Use the default PL/SQL process

Page 52: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Create a Process

Name the process (spaces in name okay) and keep the default Process Point, On Submit.

Page 53: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Create a Process

Enter the PL/SQL. In PL/SQL any page item must be referenced like a bind variable (with the colon). You can also use anonymous blocks. This example is simply setting the P1_TERM item to null.

Page 54: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Create a Process

Enter Success or Failure messages. In more complex processes you would capture SQLERRM and display here in a hidden page item (e.g. P1_MSG). This is a simple process that does not access Banner, so leave blank.

Page 55: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Create a Process

Choose the CLEAR button from the “When button Pressed” list. Any button you create on a page will appear in this list. Click the “Create Process” button.

Page 56: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Create a Process

The new process now appears in the Processes section of Page Processing.

Page 57: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Running the Application in the Development environment When you run the application in the development environment, the

bottom of the screen allows you to go back to editing the Application or individual page you are working on. Edit links and debug are also available.

Page 58: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Creating as SQL report

Create a new Region. This is a Report Region.

Page 59: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Creating a Report

Specifically, an SQL report.

Page 60: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Creating an SQL report

Enter a title for the report. Select your desired display point (leaving the default in this example).

Page 61: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Creating an SQL report

Enter SQL for the report.

Page 62: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Creating an SQL report

Closer look at the report SQL:select SSBSECT_SUBJ_CODE,

SSBSECT_CRSE_NUMB,

SSBSECT_SEQ_NUMB,

SSBSECT_CREDIT_HRS,

SSRMEET_DAYS_CODE,

SSRMEET_BEGIN_TIME,

SSRMEET_END_TIME,

SSRMEET_BLDG_CODE,

SSRMEET_ROOM_CODE

from ssbsect, ssrmeet

where SSBSECT_TERM_CODE = :P1_TERM

and SSBSECT_TERM_CODE = SSRMEET_TERM_CODE

and SSBSECT_CRN = SSRMEET_CRN

Page 63: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Creating an SQL report

Choose the look of the report (default used here).

Page 64: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Creating an SQL report

Put a condition on the report. In this case we are using a PL/SQL expression the :P1_TERM is not null.

Page 65: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Creating an SQL report

The report now appears in the Regions section under Page Rendering.

Page 66: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Displaying the report

You can modify the report attributes to give columns more meaningful names than the Banner table names.

Page 67: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Displaying the report

By the report Title (Courses) is a link Report. When you click on that link you are in the Report Attributes area.

Page 68: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Displaying the report

Choose Custom radio button for “Headings Type” and you can change the headings.

Page 69: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Displaying the report

The changed headings. You can use HTML <bra> tag in the headings.

Page 70: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Displaying the report

The report after changing the headings.

Page 71: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Adding JavaScript Hourglass

You can add JavaScript in the HTML Header of the Page section under Page Rendering. LCCC’s practice is to paste a template (next slide) that contains the JavaScript tags. The template also includes functions for changing the mouse pointer to an hourglass and changing the mouse pointer back to the default when entering (or re-entering) the page.

Page 72: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Adding JavaScript Tags and common mouse pointer functions.

<script type="text/javascript">

function initPage()

{

document.body.style.cursor = "default";

}

function mouseWait()

{

document.body.style.cursor = "wait";

}

function mouseDefault()

{

document.body.style.cursor = "default";

}

</script>

Page 73: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Adding JavaScript onLoad function

In the HTML Body Attribute we call the initPage() function on the “onLoad” JavaScript event. When you do this you must set Cursor focus to “Do not focus cursor” in the Display Attributes section. Using JavaScript you can place focus on any item you want.

Page 74: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Adding JavaScript

Now you can see we have JavaScript entered in the HTML Header. We can add functions in there for page items by clicking on the link and editing the HTML Header area.

Page 75: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Adding JavaScript Clear button

To add JavaScript the Clear button, we will … Create a new Clear button that will call the JavaScript

function. Hide the current Clear button. This is still linked to our

process. The JavaScript function we create will submit this button.

Create the JavaScript function to confirm that we want to clear the contents of the page (i.e. setting the P1_TERM to null.

Page 76: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Adding JavaScript Clear button

Create a new button named CLEAR_D (needs a different name). We use _D for “display”, but it can be named anything other than CLEAR.

The Label can be the same. For Action, select the radio button labeled “Redirect to URL without submitting page”

Page 77: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Adding JavaScript Clear button

Don’t forget where you want the button to be displayed.

Page 78: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Adding JavaScript Clear button

Because we selected “Redirect to URL without submitting page” in the previous step, a branching section appears. Select “URL” for target and enter javascript:confirmClear(); as the URL target. confirmClear() can be any name you want as long as it matches the function you enter in the HTML Header.

Page 79: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Adding JavaScript Clear button

Hide the original Clear button we created. Click on the link and make the condition “never”. Note the new button is listed and the JavaScript function it is linked to is displayed.

Page 80: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Adding JavaScript Clear button

After the original Clear button is hidden. Again, this button is still linked to the process so we still need it. Next we create the function confirmClear() in the HTML Header.

Page 81: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Adding JavaScript Clear button

Edit the HTML Header and create the confirmClear() function:

function confirmClear()

{

var msg = 'Do you really want to clear this page for term ' + $x('P1_TERM').value + '?';

if ( confirm (msg) )

{

mouseWait(); // set the hourglass on

doSubmit('CLEAR'); // the hidden button linked to the process

}

}

Page 82: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Adding JavaScript Clear button

Now when you click the Clear button you are prompted with the below message to confirm. This is useful when you are updating Banner and you want to give the user a chance to back out.

Page 83: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Exporting

To export an application, click the Export/Import icon at the application level and follow the prompts.

Page 84: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Exporting

All the values are pre-populated.

Page 85: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Exporting

After clicking the “Export Application” button, the File Download dialog appears. Note the file name F121.sql. 121 is the application’s unique ID in this database instance.

Page 86: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Exporting

Save the file to whatever directory you keep your applications, preferably a server that gets backed up.

Page 87: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Importing

Log into the instance you want the users to access the application (if it is a different instance). Go to application builder and Click the Import button.

Page 88: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Importing

Use the Browse button to find your application.

Page 89: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Importing

Use the Browse button to find your application.

Page 90: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Importing

Click “Next” until you see this screen. Select the parsing schema and Reuse Application ID and click the Install button.

Page 91: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Importing

After the application is installed you can click the Run Application icon and copy the URL for your users.

Page 92: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Importing

After the application is installed you can click the Run Application icon and copy the URL for your users. You only need to copy up to the f?p=121:1 That is the application id and page. The rest is the current session id.

Page 93: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Importing

When the user enters http://banforms:7778/pls/htmldb/f?p=121:1 they will get the application only, not the APEX development environment.

Page 94: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Importing Application as seen by the user

Page 95: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Some LCCC Applications

Pennsylvania Secure ID Reports students who have PA assigned

Secure IDs (GORADID). Extracts students from Banner who need IDs

assigned. Creates csv file in the state’s required format.

Updates GORADID table when state assigns IDs. Application uploads the csv file, then updates GORADID.

Page 96: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Some LCCC Applications

Course Date Change Change start and end dates for part of terms. Can move CRNs to different part of terms. Change dates for non-credit courses.

Page 97: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Some LCCC Applications

Student Email Lookup Allows the help desk or student services to fix

student email issues. Show last accessed. Allows manual creation of email accounts in

case that is needed.

Page 98: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Some LCCC Applications

Population Selection Allows users the ability to paste Student IDs

from various spreadsheets and create a mass entry into GLBEXTR.

Non-Credit Course Lookup A tool for the website manager to quickly

check Banner if non-credit courses are missing from the website. Tools like this are handy for people that do not use Banner.

Page 99: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Some LCCC Applications

Send Student Email Application lets the user paste student IDs

from a spreadsheet to obtain email addresses.

Choose who the “from” will be (registrar, bursar, marketing, etc.)

Compose and send email. All email addresses put in blind copy.

Send out in batches when blind copy gets close to 4000 characters.

Page 100: Pennsylvania Banner Users Group APEX Day at Immaculata APEX 101.

Open to the Floor

Questions Comments