Professional Documents
Culture Documents
March 2011
Oracle Application Express Listener Installation and Developer Guide, Release 1.1 E21058-01 Copyright 2011, Oracle and/or its affiliates. All rights reserved. Primary Author: Terri Jennings Contributors: Colm Divilly, Hilary Farrell, Sharon Kennedy, Elizabeth Saunders, and Jason Straub This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065. This software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. This software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.
Contents
Preface ................................................................................................................................................................ vii
Topic Overview .......................................................................................................................................... Audience...................................................................................................................................................... Documentation Accessibility ................................................................................................................... Related Documents ................................................................................................................................... Conventions ................................................................................................................................................. Third-Party License Information............................................................................................................... vii vii viii viii ix ix
iii
Create Users .............................................................................................................................. Install the Deployment ................................................................................................................... Access Oracle Application Express Listener Administration................................................... Installing with Oracle Containers for J2EE (OC4J) ........................................................................ Download and Unzip Oracle Application Express Listener .................................................... Copy Oracle Application Express Images ................................................................................... Start the OC4J Server ...................................................................................................................... Start the Application Server Control Console............................................................................. Create Users and Roles................................................................................................................... Create Roles .............................................................................................................................. Create Users .............................................................................................................................. Install the Deployment .................................................................................................................. Access Oracle Application Express Listener Administration................................................... Upgrading Oracle Application Express Listener ............................................................................ Redeploy Oracle WebLogic Server ............................................................................................... Redeploy Oracle GlassFish Server................................................................................................ Redeploy Oracle Containers for J2EE (OC4J).............................................................................. Upgrading Oracle Application Express Images .............................................................................. Copy Application Express Images When Using Oracle WebLogic Server............................. Copy Application Express Images When Using Oracle GlassFish Server ............................. Copy Application Express Images When Using Oracle Containers for J2EE (OC4J) ...........
1-14 1-15 1-16 1-17 1-17 1-17 1-18 1-18 1-18 1-18 1-19 1-19 1-20 1-20 1-21 1-22 1-22 1-23 1-23 1-24 1-24
iv
About Statistics ................................................................................................................................ About Error Tracking ..................................................................................................................... About Logging................................................................................................................................. Configuring Miscellaneous Options.................................................................................................
B Troubleshooting
Oracle Application Express Images Not Displaying........................................................................ B-1 Cannot Log In to Oracle Application Express Listener Administration ...................................... B-3
Index
vi
Preface
Oracle Application Express Listener Installation and Developer Guide explains how to install and configure Oracle Application Express Listener as well as utilize exposed RESTful Application Programming Interfaces (APIs). Topics: Topic Overview
Topic Overview
This document contains the following sections:
Title Installing Oracle Application Express Listener Configuring Oracle Application Express Listener Description Describes how to download and install Oracle Application Express Listener in various environments. Explains how to use Oracle Application Express Listener Administration to set up a database connection, configure security and file caching, and perform other tasks. Explains how to use RESTful APIs to expose data stored in the Oracle Database. Describes the Oracle Application Express Listener configuration file. Describes common installation issues and offers solutions.
RESTful APIs and Resource Templates About the Configuration File Troubleshooting
Audience
This document is intended for system administrators or application developers who are installing Oracle Application Express Listener. This guide assumes you are familiar with Web technologies and have a general understanding of Windows and UNIX platforms.
vii
Documentation Accessibility
Our goal is to make Oracle products, services, and supporting documentation accessible to all users, including users that are disabled. To that end, our documentation includes features that make information available to users of assistive technology. This documentation is available in HTML format, and contains markup to facilitate access by the disabled community. Accessibility standards will continue to evolve over time, and Oracle is actively engaged with other market-leading technology vendors to address technical obstacles so that our documentation can be accessible to all of our customers. For more information, visit the Oracle Accessibility Program Web site at http://www.oracle.com/accessibility/. Accessibility of Code Examples in Documentation Screen readers may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on an otherwise empty line; however, some screen readers may not always read a line of text that consists solely of a bracket or brace. Accessibility of Links to External Web Sites in Documentation This documentation may contain links to Web sites of other companies or organizations that Oracle does not own or control. Oracle neither evaluates nor makes any representations regarding the accessibility of these Web sites. Access to Oracle Support Oracle customers have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/support/contact.html or visit http://www.oracle.com/accessibility/support.html if you are hearing impaired.
Related Documents
For more information, see these Oracle resources:
Oracle Application Express Listener Release Notes Oracle Application Express Installation Guide Oracle Application Express Release Notes Oracle Database 2 Day + Application Express Developer's Guide Oracle Application Express Application Builder User's Guide Oracle Application Express SQL Workshop and Utilities Guide Oracle Application Express API Reference Oracle Application Express Migration Guide Oracle Application Express Administration Guide Oracle Database Concepts Oracle Database Advanced Application Developer's Guide Oracle Database Administrator's Guide
For information about Oracle error messages, see Oracle Database Error Messages. Oracle error message documentation is available only in HTML. If you have access to the Oracle Database Documentation Library, you can browse the error messages by
viii
range. Once you find the specific range, use your browser's "Find in Page" feature to locate the specific message. When connected to the Internet, you can search for a specific error message using the error message search feature of the Oracle online documentation. Many books in the documentation set use the sample schemas of the seed database, which is installed by default when you install Oracle. See Oracle Database Sample Schemas for information about how these schemas were created, and how you can use them yourself. For additional application examples, go to the Learning Library. Search for free online training content, including Oracle by Example (OBE), demos, and tutorials. To access the Oracle Learning Library, go to:
http://www.oracle.com/technetwork/tutorials/index.html
Printed documentation is available for sale in the Oracle Store at: http://shop.oracle.com/ To download free release notes, installation documentation, white papers, or other collateral, visit the Oracle Technology Network (OTN). You must register online before using OTN; registration is free and can be done at: http://www.oracle.com/technology/membership/ If you have a user name and password for OTN, then you can go directly to the documentation section of the OTN Web site at: http://www.oracle.com/technology/documentation/
Conventions
The following text conventions are used in this document:
Convention boldface italic monospace Meaning Boldface type indicates graphical user interface elements associated with an action, or terms defined in text or the glossary. Italic type indicates book titles, emphasis, or placeholder variables for which you supply particular values. Monospace type indicates commands within a paragraph, URLs, code in examples, text that appears on the screen, or text that you enter.
ix
1
1
This section describes how to install Oracle Application Express Listener. Topics: About Oracle Application Express Listener
About System Requirements Oracle Application Express Listener Installation Overview Downloading Oracle Application Express Listener Installing in Standalone Mode Installing with Oracle WebLogic Server Installing with Oracle GlassFish Server Installing with Oracle Containers for J2EE (OC4J) Upgrading Oracle Application Express Listener Upgrading Oracle Application Express Images
1-1
Application Server Oracle WebLogic Server Oracle GlassFish Server Oracle Containers for J2EE
Supported Release 11g Release 1 (10.3.3) or higher Release 3 or higher Release 10.1.3.4 or higher
Oracle Database (Enterprise Edition, Standard Edition or Standard Edition One) release 10.2.0.3 or higher, or Oracle Database 10g Release 2 Express Edition or higher. Java 6 Update 20 JDK or higher. Java Servlet Specification 2.3 or higher. Web browser requirements: Microsoft Internet Explorer 8.0 or higher. Mozilla Firefox 3.0 or higher. Google Chrome 2.0 or higher.
Download and unzip Oracle Application Express Listener. See "Downloading Oracle Application Express Listener" on page 1-2. Install Oracle Application Express Listener. Options include:
Standalone Mode. See "Installing in Standalone Mode" on page 1-3. Oracle WebLogic Server. See "Installing with Oracle WebLogic Server" on page 1-5. Oracle GlassFish Server. See "Installing with Oracle GlassFish Server" on page 1-12. Oracle Containers for J2EE (OC4J). See "Installing with Oracle Containers for J2EE (OC4J)" on page 1-17.
3.
Configure Oracle Application Express Listener. See "Configuring Oracle Application Express Listener" on page 2-1.
See Also: "Upgrading Oracle Application Express Listener" on page 1-20 and "Troubleshooting" on page B-1
Download the file apex_listener.version.number.zip from the Oracle Application Express Listener download page. See:
http://www.oracle.com/technetwork/developer-tools/apex-listener/dow nloads/index.html
Note that the version.number in the filename reflects the current release number.
2.
Unzip the downloaded zip file into a directory (folder) of your choice:
UNIX and Linux: Unzip apex_listener.version.number.zip Windows: Double click the file apex_listener.version.number.zip in Windows Explorer
About Standalone Configuration Options About Stopping the Server in Standalone Mode About JServ Protocol (AJP) Support
Download and unzip Oracle Application Express Listener. See "Downloading Oracle Application Express Listener" on page 1-2. Execute the following command:
java jar <temp directory>\apex.war
Where <temp directory> is the directory location of the unzipped Oracle Application Express Listener.
3. 4.
When prompted, specify the location of the folder containing the static resources used by Oracle Application Express. When prompted, choose a user name and password for the Oracle Application Express Listener Administrator and Manager roles.
Tip: You will only be prompted for the usernames and passwords the first time you launch Oracle Application Express Listener.
Where:
<host> is the DNS name or IP address of the Administration Server <port> is the listen port on which the Administration Server is listening for requests (port 8080 by default)
5.
Configure Oracle Application Express Listener. See "Configuring Oracle Application Express Listener" on page 2-1.
1-3
Where <temp directory> is the directory location of the unzipped Oracle Application Express Listener. The following output displays:
java [options] -jar apex.war [--help] Options: -Dapex.home=/path/to/apex : Path to the folder used to store the web container runtime, defaults to: ${java.io.tmpdir}/apex -Dapex.port=nnnn -Dapex.ajp=nnnn : HTTP listen port, default 8080 : AJP (mod_jk) listen port, default none If an AJP Port is specified then HTTP access is disabled
-Dapex.images=/images/location : Path to the folder containing static resources required by APEX -Dapex.erase=true : Erase the contents of ${apex.home} before launching : Print this usage message
--help
Erase the contents of /tmp/apex. Extract the run-time files to /tmp/apex. Configure the run-time to listen on HTTP port 8585. Use the contents of /usr/local/apex/images for serving the static content required by Oracle Application Express.
To learn more about installing Oracle WebLogic Server, see Oracle Fusion Middleware Getting Started With Installation for Oracle WebLogic Server and Oracle Fusion Middleware Installation Guide for Oracle WebLogic Server.
Tip: This section assumes that you have completed the installation process and are familiar with Oracle WebLogic Server. If you are unfamiliar with domains, managed servers, deployment, security, users and roles, refer to your Oracle WebLogic Server documentation.
Create Web Archive for Oracle Application Express Images Launch the Administration Server Console Install the Deployment Create Users and Roles Access Oracle Application Express Listener Administration
Where:
<temp directory> is the directory location of the unzipped Oracle Application Express Listener file. <apex directory> is the directory location of Oracle Application Express.
1-5
Tip:
The space and period (.) at the end of the command is required.
Start an Administration Server. Launch the WebLogic Administration Console by typing the following URL in your Web browser:
http://<host>:<port>/console
Where:
<host> is the DNS name or IP address of the Administration Server <port> is the listen port on which the Administration Server is listening for requests (port 7001 by default)
3. 4.
Enter your WebLogic Administrator username and password. If your domain is in Production mode, click the Lock & Edit button on the left-pane below the submenu Change Center. If your domain is in Development mode this button will not appear.
Go to the WebLogic Server Home Page. Below Domain Configuration, select Deployments. The Summary of Deployments displays.
2.
Click Install.
3.
Specify the location of the apex.war file and click Next. The apex.war file is located in the folder where you unzipped the Oracle Application Express Listener ZIP file. See "Downloading Oracle Application Express Listener" on page 1-2. Install Application Assistant appears.
4. 5.
Select Install this deployment as an application and click Next. Select the servers and/or clusters to which you want to deploy the application or module and click Next.
Tip: If you have not created additional Managed Servers or clusters, you will not see this assistant page.
6.
Name - Enter:
apex
b.
Security - Select the following: Custom Roles: Use roles that are defined in the Administration Console; use policies that are defined in the deployment descriptor
c.
Source accessibility - Select: Use the defaults defined by the deployments targets
7.
Click Next.
1-7
Yes, take me to the deployments configuration - Displays the Configuration page. No I will review the configuration later - Returns you to the Summary of Deployments page.
9.
10. Click Finish. 11. Repeat the previous steps and deploy the i.war file.
Name - Enter:
i
b.
Security - Select: DD Only: Use only roles and policies that are defined in the deployment descriptors
c.
Source Accessibility - Select: Use the defaults defined by the deployments targets
12. If your domain is in Production Mode, then on the Change Center click Activate
Changes. Verifying the State and Health of apex and i In the Summary of Deployments, select the Control tab and verify that both the apex and i State are Active and the Health status is OK.
If apex or i are not Active, then enable them. In the Deployments table, select the check box adjacent to apex and/or i. Click Start and select Servicing all requests to make them active.
If your domain is in Production mode, click Lock & Edit on the left pane below Change Center. If your domain is in Development mode, this button does not display. On the left pane below Domain Structure, click Security Realms.
2.
1-9
Create Users
Next, create two users. Create an administrator user to access the Oracle Application Express Listener Administration page and a manager user to access the Oracle Application Express Listener Status page. To create users:
1. 2.
In the left pane of the Administration Console, select Security Realms. See "View Security Realms" on page 1-9. Select a security realm by clicking the security realm name (for example, myrealm). The Settings page displays.
3.
Click the Users and Groups tab and then click the Users tab. The User table displays the names of all defined users.
4. 5.
Click New. In Name, enter the name of the user. For example:
adminlistener
User names are case sensitive and must be unique. Do not use commas, tabs or any other characters in the following comma-delimited list:
<>, #, |, &, ?, ( ), { } 6.
7.
From the Provider list, select the Authentication provider for the user. Next, define a password for the user. Note that the minimum password length for a user defined in the WebLogic Authentication provider is 8 characters.
8. 9.
Create Roles
Oracle Application Express Listener requires you assign users roles to access the Application Express Listener Administration. There are two types of roles:
Admin - The user has permission to access the Oracle Application Express Listener Administration page. Manager - The user has permission to access the Oracle Application Express Listener Status Information Page.
To create roles:
1. 2.
In the left pane of the Administration Console, select Security Realms. See "View Security Realms" on page 1-9. On the Summary of Security Realms page, select the name of the realm you want to secure the resource (for example, myrealm). The Settings page displays.
3.
Select the Roles and Policies tab and then select the Realm Roles. The Roles page organizes all of the domain's resources and corresponding roles in a hierarchical tree control.
4.
In the Roles table, expand the Deployment node in the Names column until you find the resource apex. Expand apex and click Roles.
5. 6.
On the Stand-Alone Web Application Scoped Roles table, click New. On Create Stand-Alone Web Applications Scoped Roles, specify the following:
a. b. c.
Name - Enter Admin Select the Provider Name for the role mapper (for example, XACMLRoleMapper). Click OK.
The Stand-Alone Web Application Scoped Roles table with the Admin role displays.
7.
Click the Admin role. The Edit Stand-Alone Web Application Scoped Roles page displays.
8.
Create a role condition, which specifies who is in the scoped role and under which set of conditions:
a. b. c.
Under Role Condition, click Add Conditions. In Predicate List, select User and click Next. In User Argument Name, add adminlistener. Then, click Add and then Finish. The user adminlistener appears.
d.
9.
Repeat the steps above starting at step 5 and create another role with the following information:
a.
b. c.
In the Role Conditions Predicate List for Manager, select User and add managerlistener. Once you have completed creating the Manager role, click Save.
10. If your domain is in Production Mode, in the left pane below the Change Center,
Next, configure Oracle Application Express Listener. See "Configuring Oracle Application Express Listener" on page 2-1.
To learn more about installing Oracle GlassFish Server, see GlassFish Server Quick Start Guide and Oracle GlassFish Server Installation Guide.
Tip: This section assumes that you have completed the installation process and are familiar with GlassFish Server. If you are unfamiliar with domains, servers, applications, security, or users, see your Oracle GlassFish Server documentation.
Copy Oracle Application Express Images Launch the Administration Console Create Users and Roles Install the Deployment Access Oracle Application Express Listener Administration
2.
Copy all files and folders in the Oracle Application Express images directory:
<apex directory>/images
Tip: Do not include the images folder. Copy only the files and folders below the Oracle Application Express images folder.
If the images are not in this location, the Oracle Application Express login page will appear to be missing images and style sheets.
Launch the Administration Console by typing the following URL in your Web browser:
http://localhost:4848
2.
Create Users
About Roles
Oracle Application Express Listener requires you assign users roles to access the Application Express Listener Administration. There are two types of roles:
Admin - The user has permission to access the Oracle Application Express Listener Administration page. Manager - The user has permission to access the Oracle Application Express Listener Status Information Page.
You can enable a default principal-to-role mapping on the Application Server using the Admin Console if the group list names is defined the same as the role names To enable a default principal-to-role mapping:
1.
On the navigation tree, select Configuration and then Security. The Security page displays.
2. 3.
Select the check box next to Default Principal to Role Mapping. Click Save.
Tip: Enabling the Default Principal to Role requires the Group List to be the same as the role name as described in the sect section.
Create Users
You must create users to access the Oracle Application Express Administration page and Status page. To create users:
1. 2. 3. 4.
In the navigation tree, expand the Configuration node. Expand the Security node. Expand the Realms node. Select the realm to which to add your user (for example, file). The Edit Realm page appears.
5.
On the Edit Realm page, click the Manage Users button. The File Users page appears.
6.
On the File Users page, click New. The New File Realm User page appears.
7.
User ID - Enter the name of the Oracle Application Express Listener administrator: adminlistener
b.
Group List - Enter the role to which the user belong: Admin
c. d. e.
New Password - Enter a unique password. Confirm New Password - Enter the password again. Click OK.
8.
Repeat the previous steps and create another user for the Oracle Application Express Listener manager, by specifying the following:
a. b. c.
On the navigation tree, click the Application node. The Applications page displays.
2.
Click the Deploy button. The Deploy Applications or Modules page displays.
3. 4.
Select Packaged File to be Uploaded to the Server and click Browse. Navigate to the location of the apex.war file, select the file, and click Open. The Deploy Applications or Modules page displays.
5.
Type: Web Application Context Root: apex Application Name: apex Status: Enabled Description: Application Express Listener Accept all other default settings and click OK.
The Applications page appears. A check mark should appear in the Enabled field for apex
Tip:
If a check mark does not appear in the Enabled column for apex, then select the check box next to apex and click Enable.
Where:
<host> is the DNS name or IP address of the Administration Server <port> is the listen port on which the Administration Server is listening for requests
Next, configure Oracle Application Express Listener. See "Configuring Oracle Application Express Listener" on page 2-1.
To learn more about installing Oracle Containers for J2EE (OC4J), see Oracle Containers for J2EE Installation Guide.
Tip: This section assumes that OC4J is already installed and you are familiar with OC4J. If you are unfamiliar with servers, deployment, security, users, and roles, refer to your Oracle Containers for J2EE documentation.
Copy Oracle Application Express Images Start the OC4J Server Start the Application Server Control Console Create Users and Roles Install the Deployment Access Oracle Application Express Listener Administration
2.
Copy all files and folders in the Oracle Application Express images directory:
<apex directory>/images
Tip: Do not include the images folder. Copy only the files and folders below the Oracle Application Express images folder.
If the images are not in this location, the Oracle Application Express login page will appear and be missing images and style sheets.
You must start the OC4J Server before you start the Application Server Control Console. Consider the following example:
cd <oc4j install directory>/j2ee/home java -jar oc4j.jar
2.
Create Users
Create Roles
Oracle Application Express Listener requires you assign users roles to access the Application Express Listener Administration. There are two types of roles:
Admin - The user has permission to access the Oracle Application Express Listener Administration page. Manager - The user has permission to access the Oracle Application Express Listener Status Information Page.
To create roles:
1. 2. 3. 4.
On the OC4J Home page, click the Administration tab. Expand the Security node. Locate Security Providers and click the Go To Task icon. Click Instance Level Security. The Instance Security Level page displays.
5. 6. 7.
Click the Realms tab. Use an existing realm or create a realm. Click the selected realms Roles number. The Roles page displays.
8.
Click the Create button. On the Name field enter Admin. Click OK.
9.
Create Users
You must create users to access the Oracle Application Express Administration page and Status page. To create users:
1.
In the Instance Security Level page, click the selected realms Users number. The Users page displays.
2.
Click the Create button. In Name, enter adminlistener and a password. For Selected Roles, select Admin. Click OK.
3.
Create another user for the Oracle Application Express Listener manager:
a. b. c. d.
Click the Create button. In Name, enter managerlistener and specify a password. For Selected Roles, select Manager. Click OK.
4.
On the OC4J Home page, click the Applications tab. The Applications page displays.
2.
Click the Deploy button. The Deploy: Select Archive page displays.
3.
Select Archive is present on local host. Upload the archive to the server where Application Server Control is running. Specify the location of the apex.war. file. Click Next.
In the Application Name field, enter apex and click Next. The Deploy: Deployment Settings displays.
5.
In the Deployment Tasks, click Configure Class Loadings Go To Task. The Deployment Settings: Configure Class Loading page displays.
6.
In the Import Shared Libraries, deselect the Inherit parent applications shared library imports check box. Oracle Application Express Listener contains its own libraries in the apex.war file and does not use the OC4J Shared Libraries. Also, verify that the Import column check boxes for all the Shared Library deselected.
b. 7.
Click OK.
Click the Deploy button. A confirmation message with the following message displays:
The Application apex has been successfully deployed.
8. 9.
Return to the Application page by clicking the Return button. Verify that apex is listed on the Applications page and the Status displays a green up-arrow indicating that it is Active.
Next, configure Oracle Application Express Listener. See "Configuring Oracle Application Express Listener" on page 2-1.
Redeploy Oracle GlassFish Server Redeploy Oracle Containers for J2EE (OC4J)
Download and unzip Oracle Application Express Listener. See "Downloading Oracle Application Express Listener" on page 1-2. Start an Administration Server domain. Launch the Administration Server console:
a. b.
Start an Administration Server. Launch the WebLogic Administration Console by typing the following URL in your Web browser:
http://<host>:<port>/console
Where:
c. d.
<host> is the DNS name or IP address of the Administration Server <port> is the listen port on which the Administration Server is listening for requests (port 7001 by default)
Enter the WebLogic Administrator username and password. If your domain is in Production mode, click the Lock & Edit button on the left-pane below the submenu Change Center. If your domain is in Development mode this button will not appear.
4.
Go to the WebLogic Server Home Page. Below the Domain Configuration, select Deployments. The Summary of Deployments displays.
5. 6.
Click the check box next to apex to enable the Update button. Click the Update button. The Update Application Assistant displays.
7. 8. 9.
Specify the location of your apex.war file. Click Next. Review your choices and click the Finish button. The Summary of Deployments. Messages appear indicating the status of apex deployment.
10. Follow any additional instructions provided in the Messages. 11. If your domain is in Production Mode, on the Change Center click Activate
Changes.
Unzip Oracle Application Express Listener. See "Downloading Oracle Application Express Listener" on page 1-2. Launch the Administration Console:
a.
Launch the Administration Console by typing the following URL in your Web browser:
http://localhost:4848
b.
3.
On the navigation tree, click the Application node. The Applications page displays.
4. 5.
Select the check box next to apex. Click the Disable button. An X appears in the Enabled field next to apex.
6.
Click the Redeploy link for apex. The Redeploy Applications or Modules page displays.
7. 8.
Specify the location of your apex.war file. Click OK. The Application page appears.
9.
Verify that a check mark displays on the Enabled field next to apex.
Unzip Oracle Application Express Listener. See "Downloading Oracle Application Express Listener" on page 1-2. Start the OC4J Server. See "Start the OC4J Server" on page 1-18.
Tip: You must start the OC4J Server before you start the Application Server Control Console.
3.
b. 4.
Click the check box next to apex and then select the Redeploy button. The Redeploy: Select Archive and deployment plan page displays.
6. 7.
Specify the location of your apex.war file. Click Next. The Redeploy: Application Attributes page displays.
8. 9.
Review the information. Click Next. The Redeploy: Deployment Settings displays.
Up (Active).
Copy Application Express Images When Using Oracle GlassFish Server Copy Application Express Images When Using Oracle Containers for J2EE (OC4J)
Create a Web archive for the images directory. See "Create Web Archive for Oracle Application Express Images" on page 1-5. Start an Administration Server domain. Launch the Administration Server console:
a. b.
Start an Administration Server. Launch the WebLogic Administration Console by typing the following URL in your Web browser:
http://<host>:<port>/console
Where:
c.
<host> is the DNS name or IP address of the Administration Server <port> is the listen port on which the Administration Server is listening for requests (port 7001 by default)
d.
If your domain is in Production mode, click the Lock & Edit button on the left-pane below the submenu Change Center. If your domain is in Development mode this button will not appear.
4.
Go to the WebLogic Server Home Page. Below the Domain Configuration, select Deployments. The Summary of Deployments displays.
5. 6.
Click the check box next to i to enable the Update button. Click the Update button. The Update Application Assistant displays.
7. 8. 9.
Specify the location of your i.war file. Click Next. Review your choices and click the Finish button. The Summary of Deployments. Messages appear indicating the status of apex deployment.
10. Follow any additional instructions provided in the Messages. 11. If your domain is in Production Mode, on the Change Center click Activate
Changes.
2.
Follow the instructions in "Copy Oracle Application Express Images" on page 1-13.
Copy Application Express Images When Using Oracle Containers for J2EE (OC4J)
To copy Application Express images when using J2EE (OC4J):
1.
2.
Follow the instructions in "Copy Oracle Application Express Images" on page 1-17.
2
2
About Oracle Application Express Listener Administration Establishing a Database Connection Configuring Security Defining Caching Creating Pre- Post Processing Procedures Viewing Status Configuring Miscellaneous Options
2-1
Once you have completed the configuration process, use the following URL to access Oracle Application Express Listener Administration:
1.
2.
When prompted, enter your credentials. Note that in order to log in using this URL, a user must have the Admin role.
Note that in order to log in using this URL, a user must have the Manager role.
Connection - See "Establishing a Database Connection" on page 2-2. Security - "Configuring Security" on page 2-5. Caching - "Defining Caching" on page 2-9. Pre-Post Processing - "Creating Pre- Post Processing Procedures" on page 2-10. Status - "Viewing Status" on page 2-11. Miscellaneous - "Configuring Miscellaneous Options" on page 2-12.
Tip: Every category (or tab) has an Apply button. Every time you click Apply, Oracle Application Express Listener Administration saves the information and returns you to the defined default Web page. If you need to update information on multiple tabs, make all your updates and then click Apply.
Username - Defines the name of the database user for the connection. Password - Defines the password of the specified database user. Connection Type - Select Basic, TNS, or Advanced. The fields that display depend on the type selected.
Note that Username, Connection Type, Port, and SID contain default values. Topics: Establish a Basic Connection Establish a TNS Connection Establish an Advanced Connection
Click the Connection tab. For Username, enter the name of the database user for the connection. For Password, enter the password of the specified database user. For Connection Type, select Basic. Specify the following:
a. b.
Hostname - Enter host system for the Oracle database. Port - Enter the database listener port.
6.
SID - Enter the name of the database. Service name - Network service name of the database.
7.
Click Apply.
Click the Connection tab. For Username, enter the name of the database user for the connection. For Password, enter the password of the specified database user. For Connection Type, select TNS. Specify the following:
a. b.
TNS Alias Name - The TNS alias name must match the name in the tnsnames.ora file. TNS Directory - The directory location of your tnsnames.ora file.
If you define the environment variables TNS_ADMIN or ORACLE_HOME, then the listener checks if the file, tnsnames.ora, exists in either the TNS_ADMIN directory or [ORACLE_HOME]/NETWORK/ADMIN directory. If the file exists, then the TNS Directory will contain the default directory location. Otherwise, the user required to specify the TNS Directory.
6.
Click Apply.
Click the Connection tab. For Username, enter the name of the database user for the connection. For Password, enter the password of the specified database user.
2-3
4.
For Connection Type, select Advanced. The Custom JDBC URL field displays.
5.
In Custom JDBC URL, enter a custom URL. You can specify different formats for the custom JDBC URL. Consider the following examples:
SID:
jdbc:oracle:thin:<host>:<port>:<sid>
Example:
jdbc:oracle:thin:myhost:1521:orcl jdbc:oracle:oci8:myhost:1521:orcl
Service name:
jdbc:oracle:thin:@//<host>:<port>/<servicename>
Example:
jdbc:oracle:thin:@//myhost:1521/orcl.us.oracle.com
6.
Click Apply.
See Also: Oracle Database Net Services Administrator's Guide for more information about connection formats.
Click the Connection tab. For Username, enter the name of the database user for the connection. For Password, enter the password of the specified database user. For Connection Type, select a connection type. To expand the JDBC Settings heading, click JDBC Settings. Specify the following:
JDBC Driver Type - Select either thin or oci8. Initial Pool Size - Specify the initial pool size for the number of connections that will be created. Minimum Connections - Define the minimum number of connections. Maximum Connections - Specify the maximum number of connections. Maximum Statements - Define the maximum number of statements to cache for each connection.
Configuring Security
Inactivity Timeout - Indicate how long (in seconds) an available connection can remain idle before it is closed. Abandoned Connection Timeout - Determine how long a borrowed (in use) connection can remain unused (in seconds) before it is considered as abandoned and reclaimed.
7.
Click Apply.
Tip: Except for the JDBC Driver type, JDBC options can also be changed during run time
Configuring Security
Use the Security tab to validate procedure requests and determine if a user is allowed to access the procedure. Click each section heading to expose the content. Topics: About Allowed Procedures
About Blocked Procedures About the Internal Exclusion List About Database Validation Function About Security Settings Understanding Security Processing
Click the Security tab. Click Allowed Procedures to expand or hide the content. In Inclusion list, enter the procedure name or procedure patterns separated by commas.
Note that the wildcard characters asterisk (*) and question mark (?) are supported. Use an asterisk (*) to substitute zero or more characters and a question mark (?) to substitute for any one character.
2-5
Configuring Security
If the Inclusion list field is left blank, then the Oracle Application Express Listener does not validate the procedure names to determine if the procedure is allowed for processing.
4.
Click Apply.
Tip: The advantage of using Allowed Procedures is that the procedure names and procedure patterns are stored in the Oracle Application Express Listener, whereas invoking the Database Validation Function requires a database round-trip.
Click the Security tab. Click Blocked Procedures to expand or hide the content. In Inclusion list, enter the procedure name or procedure patterns separated by commas.
Note that the wildcard characters asterisk (*) and question mark (?) are supported. Use an asterisk (*) to substitute zero or more characters and a question mark (?) to substitute for any one character. If the Exclusion list field is left blank, then the Oracle Application Express Listener does not validate the procedure names to determine if the procedure is allowed for processing.
4. 5.
To disable this feature, select Disable Default Internal Exclusion List. See "About the Internal Exclusion List" on page 2-6. Click Apply.
Configuring Security
This option enables you to disable the default internal exclusion list, however, Oracle does not recommend this approach. Instead, Oracle recommends using the external exclusion list solely for debugging purposes. Disabling the Internal Exclusion List To disable the internal exclusion list:
1. 2. 3. 4.
Click the Security tab. Click Blocked Procedures to expand the content. Select the Disable Default Internal Exclusion List check box. Click Apply.
Click the Security tab. Click Database Validation Function to expand or hide the section. In the field provided, enter the name of the Database Validation Function.
The validation function you specify is a stored function that resides in the database. If the validation function you specify does not exist, an error message displays. The validation function returns true if the procedure is allowed for processing. Otherwise, it returns false. If the Validation Functions field is left blank, then Oracle Application Express Listener does not validate the procedure name to determine if the procedure should be allowed for processing.
4.
Click Apply.
2-7
Configuring Security
Click the Security tab. Click Security Settings to expand or hide the content.
3.
Maximum Cache Entries - Specify the maximum cache size. When the maximum entries have been reached, the older (or stale) procedure name that was least recently used is removed from the cache and a new procedure name is added to the cache.
Total Cache Entries - Displays the total number of procedure names that are valid or invalid in the Security Cache. Clear Cache - If the total cache entries is greater than zero, then the Clear Cache button displays, enabling you to delete the cache entries. As a best practice, clear the cache whenever a Database Validation Function is updated.
4.
Click Apply.
Database Validation Function - Checks if the procedure name is valid. Allowed Procedures - Checks if the procedure name is in the inclusion list. Blocked Procedures - Checks if the procedure is NOT in the exclusion list.
Defining Caching
Defining Caching
The Oracle Application Express Listener enables you to cache file-based content for quick access. Caching is only enabled if you specify the procedure names. Topics: Specify Procedure Names to Cache Files
2.
If selected, files that are most recently used will remain in the cache. Specify the maximum number of files to cache. When the maximum entries have been reached, the older files are removed from the cache when a new file is added. If selected, files that are cached expire after the specified length of time. Specify the length of time after the files expire. Note the selected value must be a numeric value greater than 0. Select the amount of time from the list. Options include: days, hours, or minutes.
2-9
Tip: Once you specify a Procedure Name, the Keep files for the specified duration and Keep most recently used files button are enabled.
3.
Total Cache Entries - Displays the total number of files that are cached. Clear Cache - If the total cache entries is greater than zero, then the Clear Cache button displays, enabling you to delete the cache entries. Directory - Specify the directory location for the cache files.
Click Apply.
Oracle Application Express Listener executes the procedures in the order specified in the Procedure Names field (for example, proc1, proc2, . . . , procN).
Viewing Status
Oracle Application Express Listener executes the procedures in the order specified in the Procedure Names field (for example, proc1, proc2, . . . , procN).
Viewing Status
Click the Status tab to view statistics, error tracking, and logging information.
Tip:
Users with the manager role only see the Status tab.
About Statistics
Click Statistics to expand or hide this section. Statistics displays the following Oracle Application Express Listener information:
Server uptime. Total accesses, total traffic, total errors, total file downloads, and total processing time. Processing time in milliseconds for minimum, average, median, and maximum. Database time in milliseconds for minimum, average, median, and maximum. Active requests. Active and available connections in the pool. Security enabled or disabled, and its cache entries and maximum entries. Cache file enabled or disabled, and its cache entries and maximum entries.
About Logging
Click Logging to expand or hide the log of the different types of activities that occur in the Oracle Application Express Listener. The log includes activities such as adding a procedure to the cache, finding a procedure in the cache, or reloading a procedure. The log displays the database time and processing time in milliseconds for that procedure.
2.
Default Web Page - Specify the default page to display (for example, apex). Show debug messages on console - Select this option to display debugging messages on the application server console. Show error messages on browser - Select this option to display error messages on the browser. Keep most recent error messages - Select this option to retain the error messages. Maximum Error Entries - Specify the total number of error messages to retain. Total Error Entries - If the total error entries is greater than zero, then the Clear Cache button is enabled. Click the Clear Cache button to delete the error entries.
Under Logging:
Keep most recent log messages - Select this option to retain log messages. Maximum Log Entries - Specify the total number of error messages to retain. Total Log Entries - If the total log entries is greater than zero, then the Clear Cache button is enabled. Click the Clear Cache button to delete log entries.
3.
Click Apply. If the Oracle Application Express Listener detects missing data or incorrect information, then an error message displays. When saved, the data is written to the Oracle Application Express Listener configuration file and the specified default Web page appears.
See Also:
3
3
About Resource Template Administration About Resource Handler Types Example: Creating an Image Gallery About Resource Template Security
Data is modelled as a set of resources. Resources are identified by URLs. A small set of operations are used to manipulate resources (for example, PUT, POST, GET, DELETE). A resource can have multiple representations (for example, a blog might have a HTML representation and a RSS representation). Services are stateless and since it is likely that the client will want to access related resources, these should be identified in the representation returned, typically by providing hypertext links.
The URI template may contain zero or more parameters (for example, {userid}) which along with the HTTP headers sent with a HTTP request can be bound to parameters in the SQL query or anonymous PL/SQL block.
RESTful APIs and Resource Templates 3-1
2.
Enter your Oracle Application Express Listener Administrator credentials. The Oracle Application Express Listener Administration Resource Templates page appears.
The Oracle Application Express Listener Administration Resource Templates page displays a list of the currently defined resource templates and provides buttons to create a new resource template, import resource template definitions, and to export the existing definitions to a zip file. Topics: Create a Resource Template About the Entity Tag About Resource Handlers
The literal value World is bound to the URI Template parameter named person. About URI Template Grammar Currently there is no standardized URI Template syntax. Oracle Application Express Listener supports a limited subset of the current draft specification. The following grammar rules apply:
URI Templates must not start with a slash (/) character. URI Templates can contain any Unicode character. Parameters are declared with the use of curly braces ({}) Parameter names must start with an alphabetic character followed by zero or more alphanumeric characters and the characters: underscore (_) or hyphen (-). There is no support for optional parameters.
Secure Hash - The contents of the returned resource representation are hashed using a secure digest function to provide a unique fingerprint for a given resource version. Query - Manually define a query that uniquely identifies a resource version. Instead of hashing the entire resource representation, only the result of the query is hashed. A manually defined query can often generate an entity tag more efficiently than hashing the entire resource representation. None - Do not generate an entity tag.
About Supported HTTP Methods Strategies When Choosing a Resource Handler Type About Resource Handler Parameters Referencing Parameters About Acceptable Media Types About Security Constraints
Click the Add Handler button. The Add HTTP Method Handler dialog box appears.
2. 3.
Choose the HTTP method you wish to implement. See "About Supported HTTP Methods" on page 3-3. Click Add. Each resource handler displays as a separate tab identified by the HTTP method that it implements.
GET - Retrieves a representation of a resource POST - Creates a new resource or adds a resource to a collection
RESTful APIs and Resource Templates 3-3
Comma Separated Values Query - Executes an SQL and transforms the result set into a CSV representation. Query - Executes an SQL Query and transforms the result set into a JSON (JavaScript Object Notation) representation. A specialization of this strategy, generates a single JSON result. Note that the result is not wrapped in a JSON array. PL/SQL Block - Executes an anonymous PL/SQL block and transforms any OUT or INOUT parameters into a JSON representation. Media Resource - Executes a SQL Query conforming to a specific format and turns the result set into a binary representation with an accompanying HTTP Content-Type header identifying the internet media type of the representation.
Name - Enter the name of the parameter as passed to the resource handler (required). Aliasing - Enter the original name of the parameter if you wish to rename a parameter (optional). Source - Enter either the header (that is, the HTTP header) or URI (that is, the parameter from the URI template). Access - IN, INOUT, or OUT. URI Template parameters can only be IN. A value of IN for a header parameter implies the header will be present in the HTTP request. A value of INOUT indicates the value will be present in both the HTTP request and response. A value of OUT indicates the value will only be present in the HTTP response. Type - The primitive data type of the parameter: String, Integer, Double, Boolean, or Long
Tip:
Referencing Parameters
You can reference parameters in the resource handler definition by prefixing the parameter name with a colon character, for example:
3-4 Oracle Application Express Listener Installation and Developer Guide
select 'Hello ' || :person || ' from APEX' greeting from dual
This example causes the :person token to be replaced with the actual value of the person parameter when the resource template is evaluated. Parameter substitution uses the standard Oracle Prepared Statement facilities, so the normal rules apply as to when and where parameters can be placed. For example the following example is not valid, because the table name cannot be specified using a parameter:
select * from :table where some_id = :id
None - Any user is allowed access to the resource. Authenticated - A user must be logged in to access the resource. Secure - The resource must be accessed over a secure channel (for example, HTTPS). Secure & Authenticated - User must be logged in and the channel must be secure.
The security constraint can only be applied when the Oracle Application Express Listener is correctly configured to use one of the supported security configurations. For more information, see "About Resource Template Security" on page 3-16
Query
This resource handler type evaluates the supplied query and turns the resulting rows into a JSON representation. Consider the following example:
select 'Hello ' || :person || ' from APEX' greeting from dual
3-5
In this example:
The Content-Type of the response will be application/json The root the JSON document will be a JSON Object The JSON Object will contain a property named: items The value of the property will be an array Each row in the result set will map to a JSON object Each column in a row will map to a JSON property The column name will always be in lower-case and the case of the value will be preserved If the query has no results, the items property referred to above will just contain an empty array
Since a query can only retrieve data and can never change the state of the database, the Query resource handler can only be used the HTTP GET Method.
If an invalid order_id value is provided then a 404 - Not Found response is generated.
hardware4,memory components/upgrades,14,10 hardware5,"processors, sound and video cards, network cards, motherboards",15,10 ...
In this example:
Each column is delimited by a comma Each row is delimited by a new line character Columns containing commas or double quotes will be quoted with the double quote character
Media Resource
This resource handler type evaluates a specially structured SQL query and returns the resulting row as a binary representation. The query must follow the following format:
select <content_type>, <content_body> from ... where ...
In this format:
The query must return one row and one row only The result set must consist of two columns: The first <content_type> must be a string indicating the internet media type of the representation The second <content_body> must contain the content of the representation. This column must be one of the following types: VARCHAR, CLOB, BLOB, RAW, LONG RAW, or XMLType
Similar to the Query resource handler, the Media resource handler can only be used for the HTTP GET method, since it can only evaluate an SQL Query. This resource handler type is very useful for generating XML and HTML representations. The following example generates a KML representation of customer locations by state, making it possible to easily share customer location data with GIS applications:
select 'application/vnd.google-earth.kml+xml', xmlquery(' <k:kml xmlns:k="http://www.opengis.net/kml/2.2"> <k:Folder> <k:name>{$state}</k:name> { for $c in ora:view("oe","customers")/ROW let $loc := $c/CUST_GEO_LOCATION/SDO_POINT where $c/CUST_ADDRESS/STATE_PROVINCE = $state return <k:Placemark> <k:name>{concat($c/CUST_FIRST_NAME," ", $c/CUST_LAST_NAME)}</k:name> <k:Point> <k:coordinates>{$loc/X/text()}, {$loc/Y/text()},0</k:coordinates> </k:Point> </k:Placemark> } </k:Folder> </k:kml>' passing :state as "state" returning content) from dual
3-7
PL/SQL Block
This resource handler type evaluates the supplied PL/SQL block and turns any outbound parameters into a JSON representation. This resource handler type is typically used to service HTTP POST,PUT and DELETE operations. This handler has several features aimed at increasing ease of use, including:
When a HTTP request includes a content body, two parameters named :contentType and :body are automatically passed to the handler. The former provides the Content-Type of the request and the latter provides the content body of the request as a BLOB. When the HTTP request includes a content body with a Content-Type of application/x-www-form-urlencoded, the body is automatically parsed and each field in the form is converted to a parameter passed to the handler. The PL/SQL block can indicate the HTTP Status code using the X-APEX-STATUS-CODE response header. The PL/SQL block can indicate the location of the updated resource using the X-APEX-FORWARD response header.
For example, suppose you have a Resource Template with the following definition:
URI Template - gallery/ HTTP Method - POST Handler Type - PL/SQL Block
The above handler inserts the supplied image into the scott.gallery table, returns the location of the stored image, and indicates the operation created a new resource. Note the following:
The :contentType and :body parameters are automatically passed to the handler. You do not need to define them manually. You must manually define the :name parameter to map it from the Slug header. The :status parameter is mapped to the X-APEX-STATUS-CODE header as an Integer. The value of 201 is specified by HTTP to indicate a new resource was created. The :location parameter is mapped to the X-APEX-FORWARD header.
When the Oracle Application Express Listener sees this header in the response, it abandons generating a JSON representation of the outbound parameters and attempts to return a representation of the indicated location. Note that this example assumes that there is a separately defined Resource Template that retrieves resources of the form gallery/<name>.
Create a Database Schema Upload Images Create an Image Upload Form Display the Image Display the Gallery Improve the Appearance of the Gallery About the RESTful API
About URIs
Throughout this example, URIs and URI Templates are referenced using an abbreviated form that omits the host name and context path. Consider the following example:
gallery
To access this URI in your Web browser, you would use a URI in the following format:
http://<host>:<port>/apex/gallery
Where:
<host> is the host on which the Oracle Application Express Listener is running. <port> is the port on which the Oracle Application Express Listener is running. apex is the Web application context where the Oracle Application Express Listener is deployed.
3-9
Enumerates all the images in the gallery. For each image, you must know: The URI of the image The title of the image
Provides a link to the URI to which to post new images Provides a link to an alternate JSON representation of the gallery that includes all the information above
Upload Images
This gallery URI functions as the endpoint to which clients can submit new images. The upload facility should be able to accept requests containing the actual image data and also requests containing multipart form-data (as generated by HTML forms). To build the upload features:
1.
URI Template - gallery HTTP Method - POST Handler Type - PL/SQL Block
2.
3.
PL/SQL block assigns a unique id to the image (image_id) and inserts the image data, image title, and image content type into the scott.gallery table. Block returns a 201 status which indicates a new resource has been created. Block indicates the location of the created resource is of the form gallery/<imageid>.
4.
Once you create the Resource Template, save it, and proceed to the next step.
URI Template - upload HTTP Method - GET Handler Type - Media Resource
2.
Note that:
This illustrates a simple way to generate static text resources using Oracle Application Express Listener. Notice that the first column in the query is mapped to the content type of the resource and the second column becomes the body of the resource. Oracle does not typically recommend this approach since the SQL literal strings cannot be very big and it involves a database round-trip for data that is not actually retrieved from the database. Instead, Oracle recommends having your Web application serve static resources directly.
This form contains two fields. The first indicates the image title and the second the image content
3.
When you have created the Resource Template, try it in your browser. Enter a URL with the format:
http://<host>:<port>/apex/upload
Try choosing an image, giving it a title, and uploading it. When you click the Upload button, the browser should result in a 404 Not Found error. Remember that the POST handler you configured tells the Web browser to redirect to a gallery/<imageid> URI which you have not yet defined. However the image data will be stored in the scott.gallery table.
URI Template - gallery/image/{imageid} HTTP Method - GET Handler Type - Media Resource
2.
Name imageid 3.
Note that this query retrieves the content type and image data for the specified image.
Open the gallery Resource Template and add the following data for a GET resource handler:
This will enable you to display the data stored in the gallery.
2.
Media resource handler is used to define a HTML resource and the HTML is generated dynamically using the xmlquery() SQL function. Content type of the resource is specified as text/x-apex-html. This is an Oracle Application Express specific content type. When Oracle Application Express Listener encounters this content type it expects the content of the resource to be well formed XML. It then transforms this XML into HTML. Generated HTML includes a link to an alternate JSON representation of the gallery data:
<link rel="alternate" type="application/json" href="gallery?alt=json"/>
This representation is automatically generated by Oracle Application Express Listener using its capability to transform HTML marked up with Microdata into JSON.
RESTful APIs and Resource Templates 3-13
For each image in the gallery a <li> element is generated. The <li> element is marked up with Microdata to assist clients in extracting the gallery data from the HTML. Microdata is a feature of HTML5 enabling structured semantic data to be interwoven into HTML documents. This semantic data can be easily and reliably parsed by clients.
3.
When you have updated the Resource Template go ahead and try it. In your Web browser, enter a URL using the format:
http://<host>:<port>/<apex>/gallery
Create gallery.js
Create gallery.css
To create gallery.css:
1.
URI Template - gallery.css HTTP Method - GET Handler Type - Media Resource
2.
#images li:nth-child(8n) a { position: relative; right: 5px; top: 8px; } #images li:nth-child(11n) a { position: relative; left: -5px; top: 3px; } #images li.messy a { margin-top: -375px; margin-left: 160px; -webkit-transform: rotate(-5deg); -moz-transform: rotate(-5deg); } #images li a:hover { -webkit-transform: scale(1.25); -moztransform: scale(1.25); -webkit-box-shadow: 0 3px 6px rgba(0,0,0,.5); -moz-box-shadow: 0 3px 6px rgba(0,0,0,.5); position: relative; z-index: 5; } .buttons { float: right; margin-top: 1em; margin-bottom: 1em; } label {font-weight: bold; text-align: right;float: left; width: 120px; margin-right: 0.625em; } label :after {content(":")} input, textarea { width: 250px; margin-bottom: 5px;textalign: left} textarea {height: 150px;} br { clear: left; } ' from dual
This style sheet transforms the numbered list of images into a series of thumbnails. It uses some modern CSS features such as transforms and shadows which will not work on older Web browsers.
3.
When you have created the Resource Template edit the gallery Resource Template and add the following in the <head> section:
<link rel="stylesheet" href="gallery.css" type="text/css"/>
4.
Save your changes and view the gallery again using a URL in the format:
http://<host>:<port>/apex/gallery
Create gallery.js
To create gallery.js:
1.
URI Template - gallery.js HTTP Method - GET Handler Type - Media Resource
2.
This script uses the JQuery UI framework to transform the Upload Image link to a clickable button.
The structured semantic data that clients need to interact with the API is encoded in the HTML as microdata. Clients have two choices for processing this microdata, they can either:
Parse it directly from the HTML (browser-based applications will be able to use the HTML5 Microdata JavaScript APIs) Process the alternate JSON representation that Oracle Application Express Listener generates automatically
The alternate representation is identified by the <link> element in the <head> section of the gallery resource. The link element has a rel attribute with the value alternate and a type attribute of application/json. Consider the following example:
{ "items": [ { "properties": { "gallery": ["http://localhost:8080/apex/gallery"] } }, { "properties": { "image": ["http://localhost:8080/apex/gallery/images/13"], "title": ["Cherries"] } }, ... { "properties": { "image": ["http://localhost:8080/apex/gallery/images/4"], "title": ["Bay"] } } ] }
The location of an image is indicated by the image property The title of an image is indicated by the title property New Images can be uploaded by posting data to the URI indicated by the gallery property.
Note that the client only knows about a single URI (gallery) and discovers all other URIs from this initial URI. It does not know anything about the structure of the URIs. It only knows the names of properties that identify certain link types. As the application evolves, the URIs are free to change and clients will not be affected.
Oracle Single Sign On Integration (OSSO) External authentication using Apache JServ Protocol (AJP)
When you configure either of these two options, Oracle Application Express Listener can honor any Security Constraint values specified in the Resource Template. Note
3-16 Oracle Application Express Listener Installation and Developer Guide
that the identity of the authenticated user is available to the Resource Template using the X-APEX-USER header that is passed with the request. Topics: Integration with Oracle Single Sign On
External Authentication Using Apache JServ Protocol Example: Protecting Gallery Uploads
In this example, osso-proxy.example.com is the hostname of the server that forwards requests to Oracle Application Express Listener.
2. 3.
Change the Security Constraint of the GET handler to Authenticated. Click Save.
Edit the gallery Resource Template. Change the Security Constraint of the POST handler to Authenticated. Click Save.
2.
3.
A
A
The section describes the Oracle Application Express Listener configuration file. Topics: About the Listener Configuration File
2.
Locate the web.xml initialization parameter, config.dir. This parameter specifies the location of the configuration file.
${config.dir}/<Mount-Point>/apex-config.xml (from web.xml, if specified) ${config.dir}/apex-config.xml (from web.xml, if specified) ${user.home}/<Mount-Point>/apex-config.xml. ${java.io.tmpdir}/<Mount-Point>/apex-config.xml (default for new installs)
A-1
5. 6.
If no existing apex-config.xml is found in any of the above locations, then a new apex-config.xml is created and stored as follows:
If a config.dir value was specified in web.xml, then apex-config.xml is stored in $config.dir/<Mount-Point>. If the folder does not exist, then it is created. Otherwise, if a folder named ${user.home}/<Mount-Point> exists, then apex-config.xml is stored in there. Otherwise, apex-config.xml is created in the default location ${java.io.tmpdir}/<Mount-Point>/apex-config.xml
Where:
${config.dir} is the initialization parameter named config.dir in the Oracle Application Express Listener web.xml file. <Mount-Point> is the Context Path at which Oracle Application Express Listener is deployed on the application server. Note if the application is deployed in the default context path ('/'), then <Mount-Point> defaults to a value of apex. ${user.home} is the value of the Java System Property named user.home. ${java.io.tmpdir} is the value the Java System Property named: java.io.tmpdir.
Unzip apex.war into a temporary folder. Edit the WEB-INF/web.xml file. Remove the comment markers (<!--, -->) around the <init-param> for config.dir. Edit the value of the <param-value> element to point to the location where you created apex-config.xml. Rezip the modified files into a new apex.war file. Deploy the modified apex.war file.
Note that some application servers unzip the apex.war file into a folder after deploying the application. In that case, navigate to the unpacked version of web.xml created by the application server and edit it directly. After editing the file, restart the application server.
<entry key="key.name">value</entry> <entry key="key.name">value</entry> . . . <entry key="key.name">value</entry> </properties> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <comment> Created: Tue Apr 27 03:00:39 PDT 2010 Version: 0.10.111.13.51 </comment> <entry key="apex.db.username">APEX_PUBLIC_USER</entry> <entry key="apex.db.password">@05D783103A9583BF206ABCA52F7D2E850B</entry> <entry key="apex.db.connectionType">basic</entry> <entry key="apex.db.hostname">localhost</entry> <entry key="apex.db.port">1521</entry> <entry key="apex.db.sid">ora111</entry> <entry key="apex.db.servicename"></entry> <entry key="apex.db.tnsAliasName">MY_TNSALIAS</entry> <entry key="apex.db.tnsDirectory">C:\ORACLE\NETWORK\ADMIN</entry> <entry key="apex.db.customURL"> jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=myhost)(PORT=1521))(CONNECT_DATA=(SERVICE_ NAME=ora111.us.oracle.com)))</entry> <entry key="apex.jdbc.DriverType">thin</entry> <entry key="apex.jdbc.InitialLimit">3</entry> <entry key="apex.jdbc.MinLimit">1</entry> <entry key="apex.jdbc.MaxLimit">10</entry> <entry key="apex.jdbc.MaxStatementsLimit">10</entry> <entry key="apex.jdbc.InactivityTimeout">1800</entry> <entry key="apex.jdbc.AbandonedConnectionTimeout">900</entry> <entry key="apex.security.inclusionList">apex, p, v, f, wwv_*, apple, y*, c*</entry> <entry key="apex.security.exclusionList">customer_account,bank*, employe?</entry> <entry key="apex.security.disableDefaultExclusionList">false</entry> <entry key="apex.security.requestValidationFunction">CHECK_VALID_PROCEDURE</entry> <entry key="apex.security.maxEntries">2000</entry> <entry key="apex.cache.caching">true</entry> <entry key="apex.cache.procedureNameList">p,download_file</entry> <entry key="apex.cache.type">lru</entry> <entry key="apex.cache.maxEntries">500</entry> <entry key="apex.cache.expiration">7</entry> <entry key="apex.cache.duration">days</entry> <entry key="apex.cache.monitorInterval">60</entry> <entry key="apex.cache.directory">C:\data\cachefiles</entry> <entry key="apex.procedure.preProcess">SCOTT.PREPROC1, INITIALIZE, PKG1.PROC</entry> <entry key="apex.procedure.postProcess">SCHEMA1.SUBMIT.REQUEST,FINISHTASK</entry> <entry key="apex.misc.defaultPage">apex</entry> <entry key="apex.debug.debugger">false</entry> <entry key="apex.debug.printDebugToScreen">false</entry> <entry key="apex.error.keepErrorMessages">true</entry> <entry key="apex.error.maxEntries">50</entry> <entry key="apex.log.logging">true</entry> <entry key="apex.log.maxEntries">50</entry> </properties>
Oracle Application Express Listener Configuration File Parameters Type boolean Description Supported values:
Example true
For caching to be enabled, this must be set to true and the procedureNameList must have a procedure. apex.cache.directory apex.cache.duration string string The directory location for the cache files. Supported values:
C:\data\cachefiles days
Required for expire cache type. apex.cache.expiration numeric Required for expire cache type. Defaults to 7. apex.cache.maxEntries numeric Required for lru cache type. Defaults to 500. apex.cache.monitorInter numeric val Interval time is specified in minutes. If the cache type is expire, Oracle Application Express Listener will check the cache every NN minutes for files that have expired. For example, if the monitorInterval is 60, then it will check the cache every 60 minutes. Defaults to 60. apex.cache.procedureNam string eList Specify the procedure names to allow for caching of their files. Procedure names can contain the wildcard characters asterisk (*) or question mark (?). Use an asterisk (*) to substitute zero or more characters and a question mark (?) to substitute for any one character. Each procedure name must be separated by a comma. apex.cache.type string Supported values:
500
60
p, download_file
iru
apex.db.connectionType
string
Table A1 (Cont.) Oracle Application Express Listener Configuration File Parameters Key apex.db.customURL Type string Description The JDBC URL connection to connect to the database. Example jdbc:oracle:thin:@(DESCR IPTION=(ADDRESS= (PROTOCOL=TCP) (HOST=myhost)(PORT=1521) ) (CONNECT_DATA=(SERVICE_ NAME=ora111.us.example.c om))) apex.db.hostname apex.db.password string string The host system for the Oracle database. The password of the specified database user. Include an exclamation at the beginning of the password so that it can be stored encrypted. The database listener port. The network service name of the database. The name of the database. The TNS alias name that matches the name in the tnsnames.ora file. The directory location of your tnsnames.ora file. The name of the database user for the connection. Indicate whether to display debugging messages on the application server console. Supported values:
myhostname !password4user
apex.error.maxEntries
numeric
A-5
Table A1 (Cont.) Oracle Application Express Listener Configuration File Parameters Key Type Description Example
900 Specify how long a borrowed (in use) connection can remain unused before it is considered as abandoned and reclaimed. The abandoned connection timeout is in seconds. Defaults to 900.
apex.jdbc.DriverType
string
thin
thin oci8
Specify how long an available 1800 connection can remain idle before it is closed. The inactivity connection timeout is in seconds. Defaults to 1800.
apex.jdbc.InitialLimit
numeric
Specify the initial size for the number of connections that will be created. Defaults to 3
apex.jdbc.MaxLimit
numeric
10
Specify the maximum number of statements to cache for each connection. Defaults to 10.
10
apex.jdbc.MinLimit
numeric
apex.log.logging
boolean
true
apex.log.maxEntries
numeric
apex.misc.defaultPage
string
The default page to display. The Oracle Application Express home page, apex, is commonly used. Specify the procedure name(s) to execute after executing the procedure specified on the URL. Multiple procedure names must be separated by commas.
apex
SCHEMA1.SUBMIT.REQUEST,F INISHTASK
Table A1 (Cont.) Oracle Application Express Listener Configuration File Parameters Key Type Description Specify the procedure name(s) to execute prior to executing the procedure specified on the URL. Multiple procedure names must be separated by commas. Supported values:
apex.procedure.preProce string ss
false
Specify a pattern for procedures, packages, or schema names which are forbidden to be directly executed from a browser. Procedure names can contain the wildcard characters asterisk (*) or question mark (?). Use an asterisk (*) to substitute zero or more characters and a question mark (?) to substitute for any one character. Note: Separate multiple patterns using commas.
Specify a pattern for procedures, packages, or schema names which are allowed to be directly executed from a browser. Procedure names can contain the wildcard characters asterisk (*) or question mark (?). Use an asterisk (*) to substitute zero or more characters and a question mark (?) to substitute for any one character. Note: Separate multiple patterns using commas.
Specify the maximum cache size. Defaults to 2000. Specify a validation function to determine if the requested procedure in the URL should be allowed or disallowed for processing. The function should return true if the procedure is allowed; otherwise, return false.
2000
CHECK_VALID_PROCEDURE
A-7
B
B
Troubleshooting
This appendix contains information on troubleshooting. Topics: Oracle Application Express Images Not Displaying
For Oracle WebLogic Server - See "Create Web Archive for Oracle Application Express Images" on page 1-5 and "Install the Deployment" on page 1-6. For Oracle GlassFish Server - See "Copy Oracle Application Express Images" on page 1-13. For Oracle Containers for J2EE (OC4J) - See "Copy Oracle Application Express Images" on page 1-17.
Issue 1: Oracle Application Express Images Copied But Still Not Displaying You have copied the Oracle Application Express images to your application server as described in "Installing Oracle Application Express Listener" on page 1-1. However, the images are still not displaying: Resolution: 1. Make sure the Oracle Application Express images that you copied to your application server are the same Oracle Application Express version that is installed in your database.
2.
If you upgraded Oracle Application Express, see "Upgrading Oracle Application Express Images" on page 1-23.
Issue 2: Images Copied Using a Different Web Applications Context Root You have copied Oracle Application Express images and used a different Web applications context root other than the default context root (for example, i). The images are not displaying.
Troubleshooting B-1
Resolution: 1. Execute reset_image_prefix.sql utility located in Oracle Application Express to change the default image prefix path (for example, /i/ ) to your Web applications context root for the images. Execute this utility using SQL*Plus and connect as SYS. See Oracle Application Express Installation Guide. The default Web applications context root for the Oracle Application images is i. Oracle recommends to use the default context root, i, for the Oracle Application images unless your business practice requires to change it.
Note:
Example: If you copied Oracle Application Express images using a different context root name (for example, apeximages) instead of using the default context root name (for example, i), then you must specify the different context root in the prefix path (for example, /apeximages/). If the images are located in a folder (for example, myfolder) of a context root, then you must specify the context root and the folder in the prefix path, for example:
/apeximages/myfolder/
The prefix path is case-sensitive and must begin and end with a forward slash. Consider the following example:
SQL> @<apex directory>\utilities\reset_image_prefix.sql Enter the Application Express image prefix [/i/] /apeximages/myfolder/ . . . Image Prefix update complete
2.
Next, update the image prefix for each application in Oracle Application Express Application Builder. To update the image prefix for each application in Oracle Application Express, release 4.0:
a. b. c. d.
Log in to Oracle Application Express. On the Workspace home page, click the Application Builder icon. Select an application. Click the Edit Application Properties button to the right of the application name. The Edit Application page appears.
e.
Under Name, locate Image Prefix. By default, this attribute is defined as /i/. Change Image Prefix to the prefix that you specified in the reset_image_prefix.sql utility as described in the previous section. For example:
/apeximages/myfolder/
f.
To update the image prefix for each application in Oracle Application Express, release 3.0:
a. b. c. d.
Log in to Oracle Application Express. On the Workspace home page, click the Application Builder icon. Select an application. Click Shared Components. The Shared Components page appears.
e.
Under Application, click Application Definition. The Edit Definition page appears.
f.
Scroll down to Image Prefix. By default, this attribute is defined as /i/. Change Image Prefix to the prefix that you specified in the reset_image_prefix.sql utility as described in the previous section. For example:
/apeximages/myfolder/
g.
"Installing with Oracle WebLogic Server" on page 1-5 "Installing with Oracle GlassFish Server" on page 1-12 "Installing with Oracle Containers for J2EE (OC4J)" on page 1-17
Troubleshooting B-3
Index
A
Apache JServ Protocol (AJP), 3-17 apex-config.xml, A-1 about configuration parameters, A-2 configurable parameters, A-3 locating, A-1 setting config.dir parameter, A-2 apex-config.xml parameters apex.cache.caching, A-4 apex.cache.directory, A-4 apex.cache.duration, A-4 apex.cache.expiration, A-4 apex.cache.maxEntries, A-4 apex.cache.monitorInterval, A-4 apex.cache.procedureNameList, A-4 apex.cache.type, A-4 apex.db.connectionType, A-4 apex.db.customURL, A-5 apex.db.hostname, A-5 apex.db.port, A-5 apex.db.servicename, A-5 apex.db.sid, A-5 apex.db.tnsAliasName, A-5 apex.db.tnsDirectory, A-5 apex.db.username, A-5 apex.debug.debugger, A-5 apex.debug.printDebugToScreen, A-5 apex.error.keepErrorMessages, A-5 apex.error.maxEntries, A-5 apex.jdbc.DriverType, A-6 apex.jdbc.InactivityTimeout, A-6 apex.jdbc.InitialLimit, A-6 apex.jdbc.MaxLimit, A-6 apex.jdbc.MaxStatementsLimit, A-6 apex.jdbc.MinLimit, A-6 apex.log.logging, A-6 apex.log.maxEntries, A-6 apex.misc.defaultPage, A-6 apex.procedure.postProcess, A-6 apex.procedure.preProcess, A-7 apex.security.disableDefaultExclusionList, A-7 apex.security.exclusionList, A-7 apex.security.inclusionList, A-7 apex.security.maxEntries, A-7 apex.security.requestValidationFunction, A-7 Application Express missing images, B-1 Application Express Listener about, 1-1 about RESTful APIs, 3-1 about upgrading, 1-20 accessing Listener Administration, 2-1 configuration file, A-1 configuration file, locating, A-1 configuring, 2-1 default Web page, 2-12 downloading, 1-2 error reporting, 2-12 installation overview, 1-2 logging, 2-12 redeploying Oracle Containers for J2EE (OC4J), 1-22 redeploying Oracle GlassFish Server, 1-22 redeploying Oracle WebLogic Server, 1-21 supported Java Enterprise Edition application servers, 1-1 system requirements, 1-2 viewing status information, 2-2 Application Express Listener Administration about, 2-2 accessing, 2-1 cannot log in, B-3 configuring miscellaneous, 2-12 configuring security, 2-5 creating Pre-Post processing procedures, 2-10 defining caching, 2-9 establishing a database connection, 2-2 viewing status, 2-11 Application Express Listener caching specifying procedure names to allow, 2-9 Application Express Listener post-processing about, 2-10 Application Express Listener pre-processing about, 2-10
D
database connection Advanced connection, 2-3 Basic connection, 2-3 establishing, 2-2
Index-1
JDBC settings, 2-4 TNS connection, 2-3 default Web page, 2-12
E
entity tag strategies to generate, 3-3 error reporting, 2-12
G
GlassFish Server See Oracle GlassFish Server, 1-24
I
installation overview, 1-2 installation options Oracle Containers for J2EE (OC4J), 1-17 Oracle GlassFish Server, 1-12 Oracle WebLogic Server, 1-5 standalone mode, 1-3
installing the deployment, 1-15 installing with, 1-12 launching Administration Console, 1-13 redeploying when upgrading, 1-22 Oracle Web Logic Server, 1-2 Oracle WebLogic Server accessing Application Express Listener Administration, 1-12 copying Application Express images directory, 1-23 creating roles, 1-10 creating users, 1-10 creating users and roles, 1-9 installing, 1-5 installing the deployment, 1-6 installing with, 1-5 redeploying when upgrading, 1-21
R
resource handler, 3-3 about parameters, 3-4 about security constraints, 3-5 about types, 3-5 acceptable media types, 3-5 Comma Separated Values type, 3-6 Media Resource type, 3-7 PL/SQL Block type, 3-8 Query type, 3-5 type strategies, 3-4 resource handler type, 3-5 Comma Separated Values, 3-6 Media Resource, 3-7 PL/SQL block, 3-8 Query, 3-5 Resource Template Administration accessing, 3-2 resource template security example, 3-17 integration with Oracle Single Sign On, 3-17 using Apache JServ Protocol (AJP), 3-17 resource templates, 3-1 about entity tags (ETag), 3-3 about resource handlers, 3-3 about security, 3-16 about Uniform Resource Identifier (URI), 3-2 adding other handlers, 3-3 adding other handles to a resource template, 3-3 creating, 3-2 resource handler parameters, 3-4 resource handler type strategies, 3-4 RESTful APIs, 3-1 about, 3-1 about resource templates, 3-1 example, 3-9
L
Listener security about security settings, 2-8 specifying allowed procedures, 2-5 specifying blocked procedures, 2-6 specifying database validation functions, understanding security processing, 2-8 logging, 2-12
2-7
O
Oracle Containers for J2EE (OC4J), 1-2 accessing Application Express Listener Administration, 1-20 copying Application Express images, 1-17 copying Application Express images directory, 1-24 creating roles, 1-18 creating users, 1-19 creating users and roles, 1-18 installing the deployment, 1-19 installing with, 1-17 redeploying when upgrading, 1-22 starting the Application Server Control Console, 1-18 starting the OC4J server, 1-18 Oracle GlassFish Server, 1-2 about roles, 1-14 accessing Application Express Listener Administration, 1-16 copying Application Express images, 1-13 copying Application Express images directory, 1-24 create users and roles, 1-13 creating users, 1-14
S
standalone mode about JServ Protocol (AJP) support, 1-5
Index-2
configuration options, 1-4 installing and running in, 1-3 stopping the server, 1-4
T
troubleshooting, B-1 Application Express missing images, B-1 cannot log in to Listener Administration, B-3
U
Uniform Resource Identifier (URI), 3-2 grammar, 3-2 upgrading Application Express about, 1-23 copying images directory with J2EE (OC4J), 1-24 copying images directory with Oracle GlassFish Server, 1-24 copying images directory with Oracle WebLogic Server, 1-23
Index-3
Index-4