Skip to content

Latest commit

 

History

History
71 lines (49 loc) · 5 KB

connect.md

File metadata and controls

71 lines (49 loc) · 5 KB

Connect your APEX app

To enable APEX Nitro in your app, you must make two small changes in your application Shared Components to allow APEX Nitro to communicate properly with APEX.

Changes to your application Shared Components

1) Build Option

APEX Nitro is only relevant in your development environment. For security purposes, a build option is used to limit APEX Nitro running only in the development environment.

Go to Shared Components > Build Options and create a new build option with the following attributes:

Attribute Value
Build Option DEV_ONLY
Status Include
Default on Export Exclude

Note: When you export your application in a different environment, our DEV_ONLY components will be excluded. If you re-import your application back into a development environment, make sure to manually change the status to back to Include.

2) Application Process

Go to Shared Components > Application Processes and create a new application process with the following attributes:

Attribute Value Comment
Name APEX Nitro
Sequence -999 Ensures this happens first
Process Point On Load: Before Header (page template header)
Condition see below #1
Source see below #2 Choose PL/SQL Expression
Build Option DEV_ONLY Ensures this only gets run in a development environment
  • #1 (condition)
owa_util.get_cgi_env('APEX-Nitro') is not null
  • #2 (source)
apex_application.g_flow_images := owa_util.get_cgi_env('APEX-Nitro'); /* (1) */
-- apex_application.g_company_images := owa_util.get_cgi_env('APEX-Nitro'); /* (2) */
-- apex_application.g_theme_file_prefix := owa_util.get_cgi_env('APEX-Nitro'); /* (3) */
-- :G_APEX_NITRO_IMAGES := owa_util.get_cgi_env('APEX-Nitro'); /* (4) */

There are four choices (see commented lines), but you must pick one. Refer to the Matrix below to choose the best option for your application.

Option Files location in APEX Substitution String Override How to use
1 Application Static Files apex_application.g_flow_images #APP_IMAGES#app#MIN#.js
#APP_IMAGES#app#MIN#.css
2 Workspace Static Files apex_application.g_company_images #WORKSPACE_IMAGES#app#MIN#.js
#WORKSPACE_IMAGES#app#MIN#.css
3 Theme Static Files apex_application.g_theme_file_prefix #THEME_IMAGES#app#MIN#.js
#THEME_IMAGES#app#MIN#.css
4 Custom Application Item that contains the path for your files (supports APEX plugin development) :G_APEX_NITRO_IMAGES &G_APEX_NITRO_IMAGES.app#MIN#.js
&G_APEX_NITRO_IMAGES.app#MIN#.css

setup-application-process

APEX Plugin Development

APEX Nitro is useful for APEX plugin development, because often times plugins comes with important JavaScript, CSS and other files bundled. To enable APEX Nitro for plugin development, follow those simple steps:

  • Add an application item called G_APEX_NITRO_IMAGES plugin-item
  • In your Application Processes > APEX Nitro PL/SQL source code, use :G_APEX_NITRO_IMAGES := owa_util.get_cgi_env('APEX-Nitro'); plugin-process
  • In the APEX plugin you are developing, under the section Files, add &G_APEX_NITRO_IMAGES. to the File Prefix: plugin-prefix

Notes:

  • In the development environment, G_APEX_NITRO_IMAGES will be populated when APEX Nitro is launched and the plugin file prefix will point to the APEX Nitro files.
  • In the production environment, G_APEX_NITRO_IMAGES will be empty, and the plugin file prefix will point to the database files as it should.