Application express has been enthusiastically adopted by many clients as a tool for the rapid development of database centric web applications. This presentation discusses some of the techniques used to develop Apex applications. It provides guidelines on best practices and includes the initial steps that should be considered when embarking on an Apex development. The presentation includes a look at development techniques for the 2.2 version, and a preview of some of the features that are available in version 3.0.
Right Money Management App For Your Financial Goals
Application Express - A web development environment for the masses - and for serious application development
1. www.sagecomputing.com.auwww.sagecomputing.com.au
Application ExpressApplication Express –– aa
Development Environment for theDevelopment Environment for the
MassesMasses
Penny Cookson – Managing Director
SAGE Computing ServicesSAGE Computing Services
Customised Oracle Training WorkshopsCustomised Oracle Training Workshops
and Consultingand Consulting
www.sagecomputing.com.auwww.sagecomputing.com.au
3. www.sagecomputing.com.auwww.sagecomputing.com.au
Why Apex?Why Apex?
Wizard driven development environment
Entirely within the Oracle database
Declarative approach
Meta data generated HTML pages
Targeted at hosted small-medium
systems development
Uses traditional skills
Rapid development
Independent workspace
Data where it belongs
4. www.sagecomputing.com.auwww.sagecomputing.com.au
Its easy (but not so easy you’ll lose your job)
Its fast (so quote fixed price not T and M)
It uses your existing skills (and you thought you
were obsolete)
You don’t have to learn Java (So you can have a
life)
It looks quite reasonable (How would I know, I’m
a developer)
You don’t need to buy App Server (So you can
afford a life)
Why Apex?Why Apex?
7. www.sagecomputing.com.auwww.sagecomputing.com.au
Single User ApplicationsSingle User Applications
Used by one
individual
Access data for
which a single
individual is the
custodian
Tables will be
created
specifically to
support the
application
No references
or links to data
used in
corporate
applicationsDeveloped
using products
such as MS
Access in the
past
Consider
development in
production
environment
Enforce
minimum
controls
8. www.sagecomputing.com.auwww.sagecomputing.com.au
Multi User ApplicationsMulti User Applications
Used by
multiple users
Access data
which is used by
major corporate
applications
or which is of
critical
importance to the
organisation
Sufficient controls
to ensure the
integrity of the
organisation’s data
and processing
Developed
using products
such as Oracle
Forms in the
past
Data may contain
references or links
to data used in
corporate
applications
System development
methodology similar
to that used for the
development of
significant
applications
Separate
development
environment
9. www.sagecomputing.com.auwww.sagecomputing.com.au
WorkspacesWorkspaces
Create a workspace for each business area
Each workspace can have multiple
applications
Apex administrator allocates workspace
manager
Workspace manager creates developers and
users
Objects cannot easily be shared across
workspaces
Users are not shared across workspaces
Its all mine, no-one else can mess with it
10. www.sagecomputing.com.auwww.sagecomputing.com.au
Themes and TemplatesThemes and Templates
Organisation theme files/images in file system
Developers have no access and cannot apply
their poor artistic skills to it
Templates reference custom theme
files/images in Apex repository
Developers have access
13. www.sagecomputing.com.auwww.sagecomputing.com.au
Setting up ThemesSetting up Themes
Create STANDARD_APP based on the Theme that
most closely matches your requirements (theme_10
in the example)
Export theme
Import as new theme
Switch to new theme and change name to sage
Delete old theme
Export the application to a file
Replace all style names (t10 with sage)
Replace all template names (theme_10 with
sagetheme)
Reimport the application
Make any modifications to the templates and theme
file
24. www.sagecomputing.com.auwww.sagecomputing.com.au
Page URLSPage URLS
f is a PL/SQL wrapper for wwv_flow.show
f?p=App:Page:Session:Request:Debug:C
learCache:itemNames:itemValues:
PrinterFriendly
Do not use hard coded APP_ID
f?p=100:1:&SESSION. = WRONG
f?p=&APP_ID.:1:&SESSION. = RIGHT
28. www.sagecomputing.com.auwww.sagecomputing.com.au
UI DefaultsUI Defaults -- LOVLOV
Named LOV created when a wizard is
used to create a form for the table
LOV is named for the page that has been
created e.g. P17_PARTIES_PAR_TYPE
Multiple named LOV created
Do not record LOV’s in UI Defaults
Create a named LOV for each foreign key
29. www.sagecomputing.com.auwww.sagecomputing.com.au
Page 0Page 0
Page 0 items appear on all pages
Conditionally suppress when not required
Use for objects common to multiple
pages
Navigation
Task lists
Contact details (so they call you next time they
want some development)
Copyright/Privacy text
38. www.sagecomputing.com.auwww.sagecomputing.com.au
UsingUsing JavascriptJavascript
Client side manipulation
Setting field values
Hiding/displaying fields
Disabling fields
Standard routines in:
/i/javascript/core.js, /i/javascript/functions.js,
/i/javascript/htmldb_data.js,
/i/javascript/htmldb_html_elements.js,
/i/javascript/htmldb_objectlist.js,
/i/javascript/htmldb_validate.js, /i/javascript/htmldb_xml.js
Can upload / include custom files
If you are over 30 get a graduate to write it – too many
curly brackets
Always steal someone else’s code if possible
40. www.sagecomputing.com.auwww.sagecomputing.com.au
Set an Item from a CheckboxSet an Item from a Checkbox
Function in custom Javascript file
function setRequestDate(flag,request)
{
if(document.getElementById(flag).checked == true)
{
document.getElementById(request).value = getCurDate();
}
else
{
document.getElementById(request).value = "";
}
}
46. www.sagecomputing.com.auwww.sagecomputing.com.au
Disable items dependent onDisable items dependent on
another itemanother item
Call from item
onChange="javascript:setIndividualOrganisation
(document.getElementById('P3_PAR_TYPE').value);"
Call from Region Footer to initialise display
of items
47. www.sagecomputing.com.auwww.sagecomputing.com.au
Custom LOVCustom LOV
<script language="JavaScript">
function passBack(passVal1)
{
var returnTo = document.getElementById('P58_RETURN_ITEM').value ;
opener.document.getElementById(returnTo).value = passVal1;
opener.document.getElementById(returnTo).focus();
close(); }
</script>
<script language="JavaScript" type="text/javascript">
function callpartylov (returnTo,partyId) {
var partyVal = document.getElementById(partyId).value;
var url;
url = 'f?p=&APP_ID.:58:&SESSION_ID.:::58:P58_RETURN_ITEM,P58_NO_CHANGE,P58_PAR_ID:‘
+returnTo+',Y,'+partyVal;
w = open(url,"winLov","Scrollbars=1,resizable=1,width=850,height=600,top=40, left=40");
if (w.opener == null)
w.opener = self;
w.focus(); }
</script>
<a href="javascript:callpartylov('P34_VEQ_RESPONSIBLE_PAR_ID','P34_VEQ_RESPONSIBLE_PAR_ID');">
<IMG SRC="/i/list_gray.gif" width="13" height="13" alt="Popup Lov" alt="List" border="0" align="bottom"></a>
Display LOV icon
Call LOV popup
Return selected value
58. www.sagecomputing.com.auwww.sagecomputing.com.au
Increment a DateIncrement a Date
Function in custom Javascript file
function incRequestDate(request) {
var dateStr = document.getElementById(request).value;
if (dateStr != "") {
var dayStr = dateStr.substr(0,2);
var monthStr = dateStr.substr(3,3);
var yearStr = dateStr.substr(7,4);
if (yearStr.substr(0,2) != "20" )
{yearStr2 = "20" + yearStr;}
else {yearStr2 = yearStr;}
var incDateStr = monthStr + " " + dayStr + "," + yearStr2;
var d = new Date(incDateStr);
var n = d.getTime()+86400000;
var d1 = new Date(n);
var monthname=new Array
("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC");
var newDateStr = d1.getDate()+"-"+monthname[d1.getMonth()]+"-"+d1.getYear();
document.getElementById(request).value = newDateStr;}
}
78. www.sagecomputing.com.auwww.sagecomputing.com.au
Date picker using default format mask
Improved Web services
Page Type displayed in Application
page
Additions to item finder (css, images)
Developer toolbar has Home and
Workspace Activity links
Pre element item attribute
DML locking with WAIT/NOWAIT
Other New FeaturesOther New Features
79. www.sagecomputing.com.auwww.sagecomputing.com.au
Thank You
For Your Attention
Enquiries@sagecomputing.com.au
SAGE Computing ServicesSAGE Computing Services
Customised Oracle Training WorkshopsCustomised Oracle Training Workshops
and Consultingand Consulting
www.sagecomputing.com.auwww.sagecomputing.com.au