You are previewing Expert Oracle Application Express.
O'Reilly logo
Expert Oracle Application Express

Book Description

Expert Oracle Application Express brings you groundbreaking insights into developing with Oracle's enterprise-level, rapid-development tool from some of the best practitioners in the field today. Oracle Application Express (APEX) is an entirely web-based development framework that is built into every edition of Oracle Database. The framework rests upon Oracle's powerful PL/SQL language, enabling power users and developers to rapidly develop applications that easily scale to hundreds, even thousands of concurrent users.

The 13 authors of Expert Oracle Application Express build their careers around APEX. They know what it takes to make the product sing—developing secure applications that can be deployed globally to users inside and outside a large enterprise. The authors come together in this book to share some of their deepest and most powerful insights into solving the difficult problems surrounding scalability, globalization, configuration and lifecycle management, and more. You'll learn about debugging and performance, deep secrets to customizing your application user interface, how to secure applications from intrusion, and about deploying globally in multiple languages. Expert Oracle Application Express is truly a book that will move you and your skillset a big step towards the apex of Application Express development.

  • Presents best-practices and development insights from leading experts in the field

  • Addresses globalization, scalability, security, and other concerns of enterprise-level development

  • Shows how to customize APEX for your own application needs

What you'll learn

  • Solve tough problems in scalability in order to serve thousands of users

  • Design applications to sidestep performance problems and easily scale upwards

  • Deploy applications globally while respecting linguistic and cultural differences

  • Customize applications by exploiting APEX's roots in PL/SQL

  • Reduce the stress of managing application lifecycle and configuration

  • Secure outwardly-facing applications and their data from intrusion

Who this book is for

Expert Oracle Application Express is aimed at APEX developers who seek the deepest possible knowledge of Oracle Application Express and how to develop with it. Readers should know and be proficient with APEX, and be prepared to expend some mental energy in absorbing the high-end material in this book.

Table of Contents

  1. Copyright
  2. Foreword
  3. About the Authors
  4. About the Technical Reviewers
  5. Acknowledgments
  6. 1. OHS, EPG, and APEX Listener Compared
    1. 1.1. Why Should I Care About This Chapter?
    2. 1.2. Web Server Basics
    3. 1.3. The Oracle HTTP Server (OHS)
      1. 1.3.1. Installing the OHS
      2. 1.3.2. Configuring the OHS
      3. 1.3.3. Digging into HTTPD.CONF
      4. 1.3.4. Configuring Virtual Hosts
      5. 1.3.5. Prefork or Multi-Processing Module?
      6. 1.3.6. Web Server Compression
      7. 1.3.7. Expiry Headers
    4. 1.4. Embedded PL/SQL Gateway
      1. 1.4.1. Compression and Expiry Headers with the EPG
      2. 1.4.2. Configuring SHARED_SERVERS
      3. 1.4.3. Configuring EPG Parameters and DADS
      4. 1.4.4. Debugging Issues with the EPG
      5. 1.4.5. Configuring Virtual Hosts with the EPG
    5. 1.5. The APEX Listener
      1. 1.5.1. Stand-Alone Installation
      2. 1.5.2. Installing via Glassfish or Web Logic Server
      3. 1.5.3. Compression with the APEX Listener
      4. 1.5.4. Interesting APEX Listener Features
    6. 1.6. Conclusion
  7. 2. Oracle APEX 4.0 Charts Inside Out
    1. 2.1. HTML Charts
      1. 2.1.1. Using the HTML Charts Wizard
      2. 2.1.2. The Result
      3. 2.1.3. Debugging and Performance
      4. 2.1.4. Behind the Scenes
      5. 2.1.5. Inline HTML Charts in Report
    2. 2.2. Flash Charts
      1. 2.2.1. Background
      2. 2.2.2. Creating a Flash Chart
      3. 2.2.3. The Result
      4. 2.2.4. Understanding the Chart Region
      5. 2.2.5. Understanding the Chart Attributes
    3. 2.3. Adding Multiple Series and Combined Charts
    4. 2.4. Different Flash Chart Types
    5. 2.5. Behind the Scenes
    6. 2.6. Debug and Performance
    7. 2.7. Upgrading Oracle APEX 3.x Flash and SVG Charts
    8. 2.8. Screen Reader Mode and Charts
    9. 2.9. Extending Flash Charts
      1. 2.9.1. Customizing Charts by Using Custom XML
      2. 2.9.2. Customizing Charts by Using Custom XML, Dynamic Actions, and JavaScript
      3. 2.9.3. Creating Charts Manually
    10. 2.10. Drill-Down Charts, Dashboards, and Interactivity
      1. 2.10.1. Simple Dashboard with Submit
      2. 2.10.2. Simple Dashboard with JavaScript
      3. 2.10.3. Complex Dashboard with Actions
    11. 2.11. Most Common Issues
      1. 2.11.1. Search for a Specific Feature
      2. 2.11.2. Invalid #HOST# with Reverse Proxy or HTTPS
      3. 2.11.3. Flash Security Error
    12. 2.12. Charts in the Future
    13. 2.13. Resources
    14. 2.14. Conclusion
  8. 3. Tabular Forms
    1. 3.1. Changes in APEX 4.0
    2. 3.2. Constraints
    3. 3.3. Purpose of Tabular Forms
    4. 3.4. Tabular Forms Are Not Spreadsheets
    5. 3.5. New Features in APEX 4
      1. 3.5.1. New Item Types
        1. 3.5.1.1. Single Checkbox
        2. 3.5.1.2. jQuery Date Picker
        3. 3.5.1.3. Radio Group
        4. 3.5.1.4. Popup Key LOV
      2. 3.5.2. Declarative Validations
        1. 3.5.2.1. Validations Created by Tabular Form Wizard
        2. 3.5.2.2. Highlighting Validation Errors
      3. 3.5.3. Other Features
        1. 3.5.3.1. Lost Update Protection
        2. 3.5.3.2. Client-Side Add Row Functionality
        3. 3.5.3.3. Reduced Number of Processes
      4. 3.5.4. Future Features We'd Like to See
    6. 3.6. Custom Coding in Tabular Forms
      1. 3.6.1. Processing the Correct Rows
      2. 3.6.2. Data Integrity
        1. 3.6.2.1. Checksum
        2. 3.6.2.2. Validations
      3. 3.6.3. Manual Tabular Forms
      4. 3.6.4. Tabular Forms and Collections
        1. 3.6.4.1. Creating a Collection
        2. 3.6.4.2. Using Instead of Trigger
        3. 3.6.4.3. Writing Packaged Update Procedures
        4. 3.6.4.4. Updating a Collection via an On-Demand Process
    7. 3.7. Interesting Techniques
      1. 3.7.1. Simple Autocomplete
      2. 3.7.2. Autocomplete Returning Key Value
      3. 3.7.3. Clone Rows
    8. 3.8. Summary
  9. 4. Team Development
    1. 4.1. Milestones
      1. 4.1.1. The Basics
      2. 4.1.2. Extending Milestone Functionality
    2. 4.2. Features
      1. 4.2.1. The Basics
      2. 4.2.2. Extending the Features Functionality
    3. 4.3. To Do's
      1. 4.3.1. The Basics
      2. 4.3.2. Extending the To Do Functionality
    4. 4.4. Bugs
    5. 4.5. Feedback
      1. 4.5.1. Feedback Process
      2. 4.5.2. Enable Feedback
      3. 4.5.3. Exporting Feedback to Development
      4. 4.5.4. Importing Feedback into Development
      5. 4.5.5. Processing Feedback
      6. 4.5.6. Exporting Response to Deployment
      7. 4.5.7. Importing Response into Deployment
      8. 4.5.8. Extending Feedback: Create a Report
      9. 4.5.9. Extending Feedback: Feeding Back the Follow Up
      10. 4.5.10. Further Enhancements
    6. 4.6. Wrap Up
  10. 5. Globalization
    1. 5.1. Loading Languages
    2. 5.2. Translating Applications
      1. 5.2.1. Application Language Derived From
      2. 5.2.2. Mapping
      3. 5.2.3. CSV Encoding
      4. 5.2.4. Translating an Application
        1. 5.2.4.1. Seed Translatable Text toTranslation Repository
        2. 5.2.4.2. Download Translatable Text from Repository to Translation File (XLIFF File)
        3. 5.2.4.3. Translate Text
        4. 5.2.4.4. Apply XLIFF Translation File to Translation Repository
        5. 5.2.4.5. Publish Translated Application
      5. 5.2.5. Manually Translate an Application
    3. 5.3. Translating Data in the Database
    4. 5.4. Dynamic Translations
    5. 5.5. Translating APEX Internal Text
    6. 5.6. Copying Translations to Other Environments
      1. 5.6.1. Copying Only the Applications
      2. 5.6.2. Copy the Primary Application and Publish
      3. 5.6.3. Changing the Application ID
    7. 5.7. Localization
      1. 5.7.1. SINCE Format Mask
      2. 5.7.2. Numeric Formats
      3. 5.7.3. Time Zones and Territories
    8. 5.8. Switching Languages
    9. 5.9. Translation logs
      1. 5.9.1. Developer Log
      2. 5.9.2. Dashboard
    10. 5.10. Conclusion
  11. 6. Debugging
    1. 6.1. Principles of Code Instrumentation
    2. 6.2. Debugging Basics
      1. 6.2.1. Page Processing and Rendering
      2. 6.2.2. Enabling Debug
      3. 6.2.3. Debug Information
        1. 6.2.3.1. Developer Toolbar
        2. 6.2.3.2. Application Utilities
    3. 6.3. Benefits of Debug Mode
      1. 6.3.1. Graphs and Charts
      2. 6.3.2. Interactive Reports
    4. 6.4. APEX Debugging API
      1. 6.4.1. APEX_DEBUG_MESSAGE
        1. 6.4.1.1. ENABLE_DEBUG_MESSAGES Procedure
          1. 6.4.1.1.1. Syntax
          2. 6.4.1.1.2. Parameters
          3. 6.4.1.1.3. Usage Notes
        2. 6.4.1.2. DISABLE_DEBUG_MESSAGES Procedure
          1. 6.4.1.2.1. Syntax
          2. 6.4.1.2.2. Usage Notes
        3. 6.4.1.3. REMOVE_SESSION_MESSAGES Procedure
          1. 6.4.1.3.1. Syntax
          2. 6.4.1.3.2. Parameters
        4. 6.4.1.4. REMOVE_DEBUG_BY_APP Procedure
          1. 6.4.1.4.1. Syntax
          2. 6.4.1.4.2. Parameters
        5. 6.4.1.5. REMOVE_DEBUG_BY_AGE Procedure
          1. 6.4.1.5.1. Syntax
          2. 6.4.1.5.2. Parameters
        6. 6.4.1.6. REMOVE_DEBUG_BY_VIEW Procedure
          1. 6.4.1.6.1. Syntax
          2. 6.4.1.6.2. Parameters
        7. 6.4.1.7. LOG_MESSAGE Procedure
          1. 6.4.1.7.1. Syntax
          2. 6.4.1.7.2. Parameters
          3. 6.4.1.7.3. Usage Notes
        8. 6.4.1.8. LOG_LONG_MESSAGE Procedure
          1. 6.4.1.8.1. Syntax
          2. 6.4.1.8.2. Parameters
          3. 6.4.1.8.3. Usage Notes
        9. 6.4.1.9. LOG_PAGE_SESSION_STATE Procedure
          1. 6.4.1.9.1. Syntax
          2. 6.4.1.9.2. Parameters
          3. 6.4.1.9.3. Usage Notes
      2. 6.4.2. Programmatic Debugging
      3. 6.4.3. Instrumenting Your Own Code
        1. 6.4.3.1. Logging Custom Messages
        2. 6.4.3.2. Logging Session State
    5. 6.5. The Data Behind Debugging
      1. 6.5.1. Tables and View
      2. 6.5.2. Examining the Debug Data
      3. 6.5.3. Using Debug Data for More Than Debugging
    6. 6.6. Debugging Dynamic Actions
    7. 6.7. What Debug Doesn't Capture
      1. 6.7.1. AJAX Calls
      2. 6.7.2. FLASH Charts
      3. 6.7.3. Reports
    8. 6.8. Summary
  12. 7. Dynamic Actions
    1. 7.1. Custom JavaScript vs. Dynamic Actions
      1. 7.1.1. Manual (Old Method)
      2. 7.1.2. Dynamic Action (New Method)
    2. 7.2. Dynamic Actions in Detail
      1. 7.2.1. Identification
      2. 7.2.2. When
      3. 7.2.3. Advanced
      4. 7.2.4. Actions
        1. 7.2.4.1. Identification
        2. 7.2.4.2. Execution Options
        3. 7.2.4.3. Settings
        4. 7.2.4.4. Affected Elements
    3. 7.3. Dynamic Actions in Action
      1. 7.3.1. Business Case
      2. 7.3.2. Setup
      3. 7.3.3. Create Department Employee Report
      4. 7.3.4. Refresh Department Employees Report
      5. 7.3.5. Highlight Row
      6. 7.3.6. Row Click
      7. 7.3.7. Emphasize Employee Change
      8. 7.3.8. Modal Window
    4. 7.4. Summary
  13. 8. Security
    1. 8.1. Tools and Techniques
    2. 8.2. Authorized Access
      1. 8.2.1. An APEX Example
        1. 8.2.1.1. The Details
        2. 8.2.1.2. The Easy Fix
      2. 8.2.2. The Real Solution
    3. 8.3. Denial of Service
      1. 8.3.1. Denial of Service in an APEX Environment
      2. 8.3.2. The Details
      3. 8.3.3. The Fix
    4. 8.4. SQL Injection
      1. 8.4.1. A SQL Injection Primer
      2. 8.4.2. Custom Developed Applications vs. Commercial Off the Shelf Products
      3. 8.4.3. SQL Injection in an APEX Environment
    5. 8.5. Password Cracking
    6. 8.6. Cross Site Scripting
    7. 8.7. Conclusion
  14. 9. Lifecycle Management
    1. 9.1. Challenges
      1. 9.1.1. Working Concurrently on the Same Source Code
      2. 9.1.2. Propagating All Required Changes for a New Release
      3. 9.1.3. Parallel Development on Different Application Versions
      4. 9.1.4. What Is the Current Status?
      5. 9.1.5. Which Requirements Were Implemented in This Release?
    2. 9.2. The Sample Application
    3. 9.3. The Approach
      1. 9.3.1. Version Numbering Scheme and the Overall Delivery Process
      2. 9.3.2. Storing Files on the Application Server
      3. 9.3.3. Requirements for Designing the Server Environments
        1. 9.3.3.1. Hotfixes
        2. 9.3.3.2. Consolidating Environments
    4. 9.4. Project Management Related Aspects
      1. 9.4.1. Version Control
        1. 9.4.1.1. Shared Instance vs. Local Sandbox
        2. 9.4.1.2. Subversion and TortoiseSVN
        3. 9.4.1.3. Version Control of Database Objects
        4. 9.4.1.4. Parallel Development (Branching and Merging)
      2. 9.4.2. Naming Conventions
        1. 9.4.2.1. Naming Conventions for Database Objects
        2. 9.4.2.2. Prefix Notation for Column Names
      3. 9.4.3. Naming Conventions for the File System
    5. 9.5. Rollout Procedures
      1. 9.5.1. Initialize Patch
      2. 9.5.2. Making Changes
      3. 9.5.3. Finalizing the Patch
      4. 9.5.4. Installation in the Test Environment
      5. 9.5.5. Update the Documentation
      6. 9.5.6. Installation in the Production Environment
    6. 9.6. Summary
  15. 10. Working with APEX Collections
    1. 10.1. When to Use APEX Collections
      1. 10.1.1. Session State Management: A Quick Overview
      2. 10.1.2. Session State Managed Tables
      3. 10.1.3. Logically Walking Through a Web Shopping Cart Implementation
    2. 10.2. A Look Under the Covers
      1. 10.2.1. Private Collections Objects Inside the APEX Engine
      2. 10.2.2. Public Collections Objects Inside the APEX Engine
    3. 10.3. Getting Started with Collections
      1. 10.3.1. Initializing a Collection
      2. 10.3.2. Adding and Removing Data from Collections
      3. 10.3.3. Using the Collection Contents
      4. 10.3.4. Expanding Our Example
      5. 10.3.5. Passing Data to the Form
      6. 10.3.6. Creating a Tabular Form to Be Validated
      7. 10.3.7. Collecting and Processing Submitted Data
    4. 10.4. Summary
  16. 11. Plug-Ins
    1. 11.1. The APEX Plug-in Architecture
      1. 11.1.1. Create/Edit Page for Plug-ins
        1. 11.1.1.1. Name
        2. 11.1.1.2. Subscription
        3. 11.1.1.3. Settings
        4. 11.1.1.4. Source
        5. 11.1.1.5. Callbacks
        6. 11.1.1.6. Standard Attributes
        7. 11.1.1.7. Custom Attributes
        8. 11.1.1.8. Files
        9. 11.1.1.9. Events
        10. 11.1.1.10. Information
        11. 11.1.1.11. Help Text
        12. 11.1.1.12. Comments
      2. 11.1.2. PL/SQL APIs
        1. 11.1.2.1. APEX_PLUGIN
        2. 11.1.2.2. APEX_PLUGIN_UTIL
        3. 11.1.2.3. APEX_CSS
        4. 11.1.2.4. APEX_JAVASCRIPT
        5. 11.1.2.5. APEX_WEB_SERVICE
        6. 11.1.2.6. Other Packages
    2. 11.2. Other Tools of the Trade
      1. 11.2.1. jQuery UI Widget Factory
      2. 11.2.2. jQuery UI CSS Framework
    3. 11.3. Plug-in Tutorials
      1. 11.3.1. Developing a Process Plug-in
      2. 11.3.2. Developing a Dynamic Action Plug-in
      3. 11.3.3. Developing an Item Plug-in
      4. 11.3.4. Developing a Region Plug-in
    4. 11.4. Best Practices for Developing Plug-ins
    5. 11.5. Conclusion
  17. 12. Architecture
    1. 12.1. Oracle APEX Engine
    2. 12.2. Installing and Upgrading
    3. 12.3. Applications
    4. 12.4. Application Pages
      1. 12.4.1. Session State Management
      2. 12.4.2. Connection Management
      3. 12.4.3. Application Logging
      4. 12.4.4. Running SQL and PL/SQL Contained Within an Application
      5. 12.4.5. Workspaces and Multi-Tenancy
    5. 12.5. Automatic Data Manipulation Language (DML)
    6. 12.6. Application Extensibility
      1. 12.6.1. Customizing User Interface Templates
      2. 12.6.2. Using Static HTML
      3. 12.6.3. Using PL/SQL to Generate HTML
      4. 12.6.4. Plug-Ins
    7. 12.7. Separation of Presentation and Logic
    8. 12.8. Conclusion
  18. 13. Advanced Interactive Reporting
    1. 13.1. Creating a Report
    2. 13.2. Data Formatting
      1. 13.2.1. Report and Column Attributes
      2. 13.2.2. Column Groups
    3. 13.3. Including Links
      1. 13.3.1. Filtering Using Items
      2. 13.3.2. Column List of Values
    4. 13.4. Creating Default and Saved Reports
    5. 13.5. Charting
    6. 13.6. Linking to Saved Interactive Reports
    7. 13.7. Report Settings
      1. 13.7.1. Report-Level Settings
      2. 13.7.2. Column-Level Settings
    8. 13.8. Utilities
      1. 13.8.1. APEX_UTIL functions
        1. 13.8.1.1. IR_CLEAR and IR_RESET
        2. 13.8.1.2. IR_FILTER
        3. 13.8.1.3. IR_DELETE_REPORT
        4. 13.8.1.4. IR_DELETE_SUBSCRIPTION
      2. 13.8.2. User Interface Defaults
      3. 13.8.3. Activity Log
    9. 13.9. Security
    10. 13.10. Performance
    11. 13.11. Conclusion