0% found this document useful (0 votes)
36 views

Oracle Application Express-What's It All About?: The Guided Tour

Oracle Application Express (APEX) is a free web development tool that allows users to quickly build database-centric web applications without needing to know HTML, CSS, or JavaScript. It uses the PL/SQL programming language to directly generate and manipulate web pages from the database. APEX applications are developed within a customizable "workspace" that provides tools for application building, SQL management, and administration. Key features include wizard-based construction of forms, reports, charts and master-detail relationships. It also offers tight Microsoft Excel integration for importing spreadsheets and generating applications from them.

Uploaded by

amirge
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Oracle Application Express-What's It All About?: The Guided Tour

Oracle Application Express (APEX) is a free web development tool that allows users to quickly build database-centric web applications without needing to know HTML, CSS, or JavaScript. It uses the PL/SQL programming language to directly generate and manipulate web pages from the database. APEX applications are developed within a customizable "workspace" that provides tools for application building, SQL management, and administration. Key features include wizard-based construction of forms, reports, charts and master-detail relationships. It also offers tight Microsoft Excel integration for importing spreadsheets and generating applications from them.

Uploaded by

amirge
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Oracle Application Express—What’s it All About?

—Peter Lorenzen
WM-data, Denmark
Editor’s Note: If you’re not familiar with APEX, Peter’s article Apache HTTP Server is no longer installed by default. You
will point you in the right direction. If you already use APEX, have to install it from the companion CD. It is not possible to
you might want to give it a quick read to see if you agree install the normal APEX version on Oracle Database XE in a
with what he says. supported fashion. To see how APEX in XE differs from the
standard APEX, check http://tinyurl.com/uu6pl.
Introduction
Oracle Application Express (APEX) applications are The Guided Tour
popping up all over the place. The product is free and All development in APEX takes place in a workspace.
has a lot of things going for it. My associates and I have Workspaces can be created and maintained in the
successfully used APEX for a number of smaller development Administration Services application by an administrator.
projects. One project was for RTX Telecom that uses APEX When a developer logs into a workspace, the Workspace
to control over one million DECT telephones in Romania. In home page appears. Here the three main parts of a
this article I will try to explain what APEX is and what it workspace are presented: Application Builder, SQL
can be used for, based on our experiences. Workshop, and Utilities.

APEX?
Application Builder is where most of the application
development takes place. SQL Workshop consists of tools
APEX is a browser-based Web development environment that will help you view and manage database objects. It’s the
that enables you to quickly develop database-centric Web stuff you would otherwise use Oracle SQL Developer or Toad
applications. APEX was launched as an MS Access/Excel for. You can upload your script collection, run scripts, or use
killer. The focus has been on consolidating fragmented the visual query builder. All in all, it is a nice set of tools.
information into the database in a user-friendly manner. Most developers probably would not use the tools, but for
APEX does this well, but it also makes sense to use it in casual users they are fine. APEX Utilities lets you import/
a range of other situations. Oracle developed APEX from export data from the database, generate DLL, view object
scratch and it is not based directly on any other product. So reports, and restore dropped database objects.
it’s not a new release of Oracle WebDB! APEX debuted in
On the right side of the Workspace home page are some
2004 when version 1.5 was released with Oracle Database
administration links that let you maintain users, user
10gR1. It was first named HTML DB, but later renamed. At
groups, and miscellaneous workspace stuff (see Figure 1).
the time of writing the current version of APEX is 2.2.1.
APEX demands at least a version 9.2.0.3 database. APEX
is built on the Apache HTTP Server and the mod_plsql
Apache module. This is a proven architecture that has
been around for a long time. Mod_plsql makes it possible to
generate Web pages directly from PL/SQL. If you have used
the PL/SQL Web toolkit or generated WSG modules with Figure 1. Workspace Components
Oracle Designer, you have used mod_plsql. This architecture
makes APEX perform well and scale with the database. It
is possible to use the Apache HTTP Server from an Oracle
Application Development
In the Application Builder you can develop applications
Application Server (OAS). You don’t need an OAS unless
as you do in Oracle Designer. When you change a property,
you have a very high load and need the better integration to
metadata is saved to the database. Creation of objects
performance tools that OAS offers.
is mostly wizard-based, but when you need to change
The free Oracle Database10g Express Edition (XE) has something later you need to know which property to change.
a default APEX installed. What a cool package; a trimmed Designing a page is not WYSIWYG, but you can see the
down 10.2 database and APEX included absolutely free! The order of items, buttons, and so on. APEX has a string of
APEX is a special release 2.1 that does not use the Apache built-in page types such as Forms, Reports, and Charts.
HTTP Server and the mod_plsql module. Instead it uses the
embedded Apache HTTP Server and the PL/SQL gateway, FORMS
which were introduced with Oracle XML DB in release 9.2 Forms can be built with a wizard or manually. They can
of the database. TIP: If you are using a 10g database, the be based on a table, view, procedure, SQL query, or Web
Continued
ODTUG TECHNICAL JOURNAL SECOND QUARTER 2007 13
Oracle Application Express—What’s it All About? (Continued)
service. Forms items are HTML form elements; some are being very pleased with a built-in theme. A theme consists
enriched with extra features, for example, the date fields, of templates. Each template controls the layout of a specific
which can have an associated pop-up calendar. Aside from component, for example, a button. Templates consist of
normal Forms, it is also possible to create master detail HTML, CSS, and graphics. The theme concept is very flexible
Forms, tabular Forms, and others. and makes it possible to get exactly the layout you want
REPORTS without changing your code.
You can create HTML reports based on SQL. Currently SECURITY
HTML is your only option for report output. I think this is With APEX it’s possible to create public applications, or
disappointing, but PDF reports are on the horizon for release applications that require authentication. APEX contains a
3.0. At the moment we use Apache FOP for our PDF reports. number of built-in authentication schemes. The standard
FOP is fine and free, but complicated to use. I have heard scheme is called Application Express. The users are “thin”
good things about PL/PDF, but it’s not free. There is, of users, stored in a table. Groups of users can be created,
course, always the option of using Reports or XML Publisher but they only can be used with this authentication scheme.
if you already have the skills and licenses. Other authentication schemes are based on database users,
CHARTS an external LDAP server, or an Oracle Single Sign-On (SSO)
server. It is also possible to use custom authentication if you
It’s possible to create HTML and SVG charts. You can
need something different. We have used the SSO integration
create charts where you drill down from one chart to another.
and it works fine even though it is not so straightforward to
Charts can also be refreshed using Partial Page Rendering
set up.
(PPR), avoiding the need to refresh an entire page.
Authorization schemes can be used to extend
MS EXCEL INTEGRATION authentication schemes to allow a more granular access
One of the strong features of APEX is the close MS Excel
control. You can control access to an entire application, a
integration. Via a wizard, you can upload a spreadsheet to a
page, or a component on a page. An authorization scheme is
table. You can use an existing table or generate a new one in
based on custom SQL or PL/SQL code.
the process. It is also possible to base an entire application
on a spreadsheet (see Figure 2). The wizard guides you APEX also has advanced built-in security functions that
through the upload and the application generation. The will help you with session state protection and cross-site
uploaded data can be maintained in the new application. A scripting protection.
simple SVG chart is also generated by default. In minutes DEPLOYMENT
you go from Excel to an APEX application. This cool feature An application consists of the application itself and
can be used for prototyping, or to get a quick start. supporting objects such as images, CSS, JavaScript, and
SQL scripts. You can deploy every type in its own file, or
as a single SQL script file called a packaged application.
You create an export file and import it on the other system.
Brilliantly easy! It shows how well the metadata repository
approach works.

Figure 2. Data Load/Unload SESSION STATE


As for most other HTML applications, APEX is stateless,
USER INTERFACE meaning that the Web browser is only connected to the
When an application is executing, the screens are server while it requests or is downloading a page. One
rendered run-time from the metadata in the database. request is not related to the other, so if you put a value
This is a little different from WebDB and Oracle Portal into a PL/SQL package variable on one page, it will not be
that generate PL/SQL packages for every module. APEX there on the next page, because the next page is a different
separates the presentation from the application logic. APEX session. Normally in mod_plsql Web applications you can
operates with UI themes. There are 18 standard built-in get around this via cookies or URL parameters. This is very
themes to choose from. The themes can be customized as cumbersome, though. Luckily, APEX has an elegant solution
much as you want. You can create your own themes based in the session state feature. APEX transparently manages
on the built-in ones, build from scratch, or build from an session state in the database. All items on a page are
export file. The standard themes are quite nice. We have had automatically saved in the session state. You can get and set
customers who were very focused on the layout, but ended up the session state as you want. This is a very strong feature.

14 SECOND QUARTER 2007 ODTUG TECHNICAL JOURNAL


AJAX its commitment to the product and Oracle themselves use
Everything has to be Ajax these days, and of course APEX APEX a lot. Metalink and Ask Tom are two examples, but
supports Ajax. It is used for PPR of reports and charts, and there are hundreds of internal applications. Oracle has
you can use it in your own code. I don’t believe you should released a Statement of direction for APEX and from this
use Ajax unless you really need it, because I find it a little you can see that Oracle is planning on releasing version
difficult to maintain and debug. At the moment we only use 3.0 in the first half of 2007. This release will focus on four
it to create cascading related lists of values (LOVs). APEX key areas: improved printing capabilities, improved Web
simply can’t handle this properly in a Form, but with Ajax it Service support, Microsoft Access migration assistant,
is fixed quickly. and Flash charts. There will be support for PDF and Word
output via integration to XML Publisher. The big question
WEB SERVICE is whether the product still will be free or if there will be an
You can consume Web service in APEX but not publish it.
extra charge for the printing option. XML Publisher does
The Web service has to use SOAP binding 1.1 and, according
not normally come cheap. Flash charts are good news since
to Metalink, the only supported message format is RPC-
Adobe will end its support for SVG at the end of 2007.
Literal. I have only tested using the Google search API and it
worked like a charm. I have also seen postings on the Oracle
Technology Network (OTN) forums reporting that others Conclusion
have been successful using other message formats. Our experiences with APEX have generally been
positive. I think that APEX is a good choice for smaller Web
PRODUCTIVITY BOOSTERS applications. It’s very productive, and you can create simple
APEX contains a couple of things that will help you applications quickly. APEX fills the gap where you don’t
be more productive. UI Defaults let you create default UI want to use a full-blown enterprise solution like ADF. I don’t
properties for a table, view, or column. This saves a lot of think of APEX as an end-user tool. Casual users can use
time and will give you more consistency across pages. When APEX, but as soon as you go beyond the wizards the learning
you start a new project, one of the first things you should do curve is high. You really need to know SQL, PL/SQL, HTML,
is to go through all tables and views and create UI Defaults. JavaScript, and CSS to get the most from APEX. If you don’t
UI Defaults will only help when you create new pages. have those skills you will soon be stuck. But if you do, you
When you change existing pages Application Reports come quickly can be productive. As with everything, APEX has its
in handy. They not only show you information but also let good and bad sides.
you change it. Say, for instance, you want to change Family
Name to Last Name throughout an application. You can use
the Item Label report to show you all Item Labels and let you
The Good
I love that APEX is so close to the database. I don’t need
edit them in a grid.
help from Java heads or to fiddle around in a container

Packaged Applications and Open Source


on the Application server. I can stay in the comfort of the
database where I feel at home. And since everything is in the
The number of off-the-shelf applications is probably going database, it scales and performs with the base.
to be limited, since the source code for your application
APEX is very flexible, so even where standard APEX
cannot be protected in any way. Fortunately, there are other
sets some limits, you can usually code your way around the
initiatives at work. Oracle has created a number of standard
problems. This flexibility is one of the best features.
APEX applications that solve common business problems,
like a forum and an online store. Oracle calls them Packaged Another thing the product has going for it is the developer
Applications because that’s what they are. Currently there community. The APEX OTN forum is really, really good! I
are eight Packaged Applications. They are free and can don’t think APEX would have been such a success without
be downloaded from OTN. Packaged Applications are a it. The forum can be used as knowledge repository, since
powerful feature that can solve a specific problem or help you most questions have already been answered there, and as
get started with APEX. a place to post your own questions. People from the APEX
development team answer questions daily, but there are also
There is also a budding Open Source APEX community.
a growing number of non-Oracle developers that are very
Currently there are two projects; a general one driven by
knowledgeable and helpful.
people from the APEX development team and ApexLib
created by Patrick Wolf. ApexLib is focused on solving some THE BAD
of the shortcomings of APEX. There is no version control in APEX. If you only use it
for small projects this is not a big issue, but it sets an upper
Here Today, Gone Tomorrow? limit on the size APEX project you can do. When we had
WebDB had a short life span. Will APEX also be a short- two developers working on a project we used to export the
lived visitor? I don’t think so. Oracle has demonstrated application to file and save it in CVS a couple of times a day.
Continued
ODTUG TECHNICAL JOURNAL SECOND QUARTER 2007 15
Oracle Application Express—What’s it All About? (Continued)
This worked fine, but if you add more developers it starts to Resources
get complicated. It helps to use the Lock Page feature. This OTN http://tinyurl.com/pogay
locks the page so only the person that has locked the page
APEX Wiki http://tinyurl.com/kgdj3
can change it.
APEX SIG http://tinyurl.com/y247e8
There are standard texts in APEX that you can’t
translate. APEX supports 10 languages, but if you need Packaged Applications http://tinyurl.com/zhqvr
others you will see English texts that you cannot translate. APEX production sites http://tinyurl.com/k79md
You can code your way around this, but it takes time, costs
Sourceforge project http://tinyurl.com/g72kq
money, and it is not always a reliable solution. Oracle is
aware of the problems and has made it possible to translate ApexLib http://tinyurl.com/2xafq3
the untranslatable messages associated with Reports. Look Sr. Technical Editor’s Note: Also see the ODTUG APEX SIG
for “Translating Messages Used for Reports” in the User’s at www.odtug.com.
Guide. I hope Oracle wil solve the problem completely with
release 3.0. About the Author
I truly miss PL/SQL exception handling in APEX. If an Peter Lorenzen is a technology
unexpected error occurs, APEX navigates to an error page manager at WM-data, Denmark.
and shows the raw ORA error. This also happens if you He works in the consulting
have validations in database triggers that raise an error. division and specializes in Oracle
It would be nice to have a way to catch exceptions, with an development tools.
on-error PL/SQL block. You end up writing extra validation
code in APEX for things like unique keys. This means extra
roundtrips to the database that could have been avoided if
validations were performed by the database, and the errors Peter Lorenzen
could be trapped in APEX.
LOVs or Select Lists as they are called in APEX, have
some limitations in APEX and hopefully will be enhanced in
APEXposed!
the next version, maybe to work a bit more like they do in
June 18 and 19
Forms. Daytona Beach, Florida
There are no keyboard shortcuts in the Application Presented during the first
Builder. This means that people with carpal tunnel two days of ODTUG
syndrome should take care. It would be very nice with a few Kaleidoscope, this training
short cuts, for example, the Apply Changes button. conference is the first of its
FINAL THOUGHTS kind. Two tracks, Novice and Experienced, will be
APEX is a great tool, which keeps getting better with offered. The Novice track participants will learn
each release. Use it for smaller Web projects and for more ad from a primarily hands-on environment, while the
hoc tasks. If you want to take APEX for a spin, Oracle has a Experienced participants will tackle more complex
really cool service. They will host APEX workspaces online issues in a lecture format followed by a hands-
for free. You can request a workspace at apex.oracle.com. on session. Both groups will receive seriously
You are not allowed to use the service commercially, but practical tips, techniques, and solutions taught by
otherwise it’s up to you. Everything works pretty much like the world’s leading APEXperts, including:
a normal APEX. The only thing I have noticed is that the
use of Web Service is disabled for security reasons. There are Mike Hichwa, Oracle Corporation
over 11,000 active workspaces.
Scott Spendolini, Sumner Technologies, LLC
Josh Millinger, Sumner Technologies, LLC
Raj Mattamal, Sumner Technologies, LLC
Register now at www.odtugapextraining.com

16 SECOND QUARTER 2007 ODTUG TECHNICAL JOURNAL

You might also like