Apex Shared Components
Aljaž Mali
2
Quick introduction
• IT Solutions Architect at Abakus plus, d.o.o
• SIOUG - Member of Executive Committee
• Oracle Database Certified Professional 9i, 11g
• Oracle Application Express Developer Certified Expert
• SIOUG and Apex Meetups
3
Public appearances
• HTMLDB – just a toy?, SIOUG, Portorož 2004
• It's good to know your own backyard (Trace Analyzer, dbms_profiler), SIOUG, Portorož 2005
• Oracle Database Standard Edition, SIOUG, Portorož 2008
• Create table, SIOUG, Portorož 2009
• With Oracle Forms to future, SIOUG, Portorož 2010
• Oracle Listener, SIOUG, Portorož 2011
• Apex Plugins, SIOUG, Ljubljana 2012
• Apex Workshop: All you need to start working with Apex, Ljubljana 2012
• Apex Listener, SIOUG, Mengeš 2013
• Apex and jQuery, SIOUG, Mengeš 2013
• Apex Dynamic Actions, SIOUG, Mengeš 2013
• JavaScript in Apex, SIOUG, Ljubljana 2014
• JavaScript in Apex, SROUG, Zlatibor, Serbia, 2015
• Apex Meetups, Ljubljana, Kranj, 2015
• Apex Shared Components, SIOUG, Portorož, 2015
• JavaScript in Apex, HROUG, Rovinj, Croatia, 2015
4
Abakus plus, d.o.o.
History
from 1992, ~20 employees
Applications:
special (DB – Newspaper Distribution, FIS – Flight Information System)
ARBITER – the ultimate tool in audit trailing
APPM – Abakus Plus Performance and Monitoring Tool
Services:
DBA, OS administration, programming (MediaWiki, Oracle)
networks (services, VPN, QoS, security)
open source, monitoring (Nagios, OCS, Wiki)
Hardware:
servers, backup server, SAN storage, firewalls
Infrastructure:
from 1995 GNU/Linux (20 years of experience!)
Oracle on GNU/Linux: since RDBMS 7.1.5 & Forms 3.0 (before Oracle!)
>20 years of experience with High-Availability!
6
Shared Components
Shared components can display or be applied on any page within an application.
This section describes the advantages of using shared components and specifically
how to manage static application files, static workspace files, images, application-
level items, lists of values, lists, shortcuts, and report output.
https://docs.oracle.com/cd/E59726_01/doc.50/e39147/shared_comp.htm#HTMDB29851
7
8
Agenda
• Shared Components - new features
• Theme Subscriptions
• Theme Styles – “Sharing”
• Rejoin session
• Build options
• Shortcuts
• Text Messages
9
New features
• OTN New Features in Release 5
http://www.oracle.com/technetwork/developer-tools/apex/learnmore/apex-
50-new-features-2517998.html
Universal Theme, Template Options, Responsive Design
• Changes in Oracle Application Express 5.0
https://
docs.oracle.com/cd/E59726_01/doc.50/e39147/release_changes.htm#H
TMDB29121
Universal Theme, Theme Styles, Theme Roller, Template Options, Theme
Subscriptions, Better Navigation, Static File Upload
10
Theme Subscriptions
• Themes and templates can be subscribed on a theme level now
• Developers subscribe to a theme when
Running the Create Application Wizard ( validate theme )
Creating a new theme from the Theme repository
• When an application subscribes to a master theme, all theme attributes,
subscribed template options, and subscribed templates are set to read-only
11
Theme Subscriptions
• Verify if a Theme Refresh is Needed
• Refreshing a Subscribed Theme
Refresh Theme ( pull - one )
Publish Theme ( push – to all )
• Subscribed to Standard Theme : Universal Theme
After patching / upgrading – REFRESH!
12
Theme Subscriptions
13
Theme Styles – “Sharing”
• Theme styles are CSS files that are referenced in the page template using
the #THEME_STYLE_CSS#
• A theme can have multiple theme styles with one style set active
• “Sharing”
Theme Roller JSON Configuration
apex.utr.config() (Theme Roller must be running)
14
Rejoin session
The Rejoin Sessions attribute controls if Oracle Application Express supports
application URLs that do not contain session IDs. When rejoin sessions is
enabled, Oracle Application Express attempts to use the session cookie to join
an existing session, when a URL does not contain a session ID.
Enabling rejoin sessions exposes your application to possible security
breaches, as it can enable attackers to take over existing end user
sessions.
15
Rejoin session
When rejoin sessions is enabled, Application Express attempts to use the
session cookie to join an existing session, when a URL does not contain a
session ID.
• Disabled
• Enabled for Public Sessions
• Enabled for All Sessions
• Can be also set on pages
• A more restrictive instance level setting overrides this page level value
16
Rejoin session
• Enabled for Public Sessions
If the URL goes to a public page and does not contain a session ID, Application Express attempts to utilize the
existing session cookie established for that application. For applications with both public and authenticated
pages, a session ID is defined after the end user authenticates. Application Express only joins using the cookie
when the session is not yet authenticated.
• Enabled for All Sessions
If the URL does not contain a session ID, Application Express attempts to utilize the existing session cookie
established for that application, providing the following conditions are met:
Session State Protection is enabled for the application and the URL includes a valid checksum. For public
bookmarks, the most restrictive item level protection must be either Unrestricted or Checksum Required -
Application Level.
OR, the URL does not contain payload (a request parameter, clear cache or data value pairs). This setting
also requires that Embed In Frames is set to Allow from same origin or to Deny for the application.
17
Rejoin session - security
Enabling rejoin sessions exposes your application to possible security
breaches, as it can enable attackers to take over existing end user
sessions.
• Triggering malicious session state changes or other modifications
• Triggering unintended changes between applications
For security reasons, Oracles recommends that administrators disable Rejoin Sessions
unless they implement workspace isolation by configuring the Allow Hostname attribute
at the workspace or instance-level.
http://docs.oracle.com/cd/E59726_01/doc.50/e39147/sec_admin_ssl.htm#CIHHIFBG
18
Build options
• Build options enable you to conditionally display specific functionality within
an application
• Don’t use “Conditional display - never”, use Build Options
• Two possible values
INCLUDE
EXCLUDE
• Value can be different on export
• APEX_UTIL.SET_BUILD_OPTION_STATUS
• APEX_UTIL.GET_BUILD_OPTION_STATUS
19
Shortcuts
• Use Shortcuts to write frequently used code once and then reference it in
many places within your application
• Shortcuts also allow for dynamic generation of code in places that typically
only support static text
• Shortcuts are substitution strings that are expanded using the syntax:
"SHORTCUT_NAME“
• Subscriptions
20
Shortcuts – used in locations
• Region Source for regions of type HTML_WITH_SHORTCUTS
• Region Templates, Region Headers & Footers
• Item Labels
• Item Default Value
• Item Post Element Text
• Item Help Text
• HTML Header of a page
21
Shortcuts - types
• PL/SQL Function Body
• HTML Text
• HTML Text with Escaped Special Characters
• Image
• Text with JavaScript Escaped Single Quotes
• Message
• Message with JavaScript Escaped Special Quotes
22
Shortcuts – Item Substitutions
Creating shortcuts on page item labels and page item post element text
attributes can include the following substitution strings:
• #CURRENT_FORM_ELEMENT#
• #CURRENT_ITEM_ID#
• #CURRENT_ITEM_NAME#
• #CURRENT_ITEM_HELP_TEXT#
23
Text Messages
• Text Messages can be used to build translatable text strings with substitution
variables that can be called from PL/SQL packages, procedures, and functions
Oracle Application Express is translated into German, Spanish, French, Italian, Japanese,
Korean, Brazilian Portuguese, Simplified Chinese, and Traditional Chinese. If your application
uses a language that is not among the ten languages into which Oracle Application Express is
translated, you must translate messages displayed by the Application Express reporting
engine.
https://docs.oracle.com/database/121/HTMDB/global_messages.htm#HTMDB25939
24
Manage Text Messages
25
What component did we miss?
• What can we also share?
26
Knowledge!
Apex Shared Components
Aljaž Mali