Loading…
Transcript

Managing Multiple

APEX Applications

Scott Wesley

grassroots-oracle.com

Scott Wesley

Managing Multiple Applications

@swesley_perth

#orclAPEX

30h travel

APEX

commons.wikimedia.org/wiki/Mount_Rainier#/media/File:Mount_Rainier_cloud_cover.jpg

https://twitter.com/hashtag/orclapex

more than 5?

*

APEX can do anything

*anything you've seen another website do

Imagine a world ...

f?p=4550

aim

f1801

f1850

Weblogic

Avoid the Monolith

Aim /

tl ; dr

Aim /

18.1

/ords/f?p=LEMENU:HOME:5885404473198::::

3) Done.

Workspace Sharing

Aim /

Authentication Scheme

Independent Release Cycles

Aim /

ACC_A1.fmb

ACC_A2.fmb

PER_B1.fmb

PER_A2.fmb

PER_C1.fmb

COMMON.mmb

FORM_UTIL.pll

all "one app"

Sub Topic

Main Topic /

Upgrade APEX Features by App

Aim /

t2

jquery Migrate

Universal Theme Version

Aim / By App /

Compatibility Mode

Aim / By App /

New templates

New Template Options

Corrections

beyond

Component Upgrades

Aim / By App /

jQuery Changes

Aim / By App /

New field types

AnyChart -> OracleJET

Tabular -> IG

Form Regions

openModal()

.bind()

Summary

Aim /

Migration

Heterogeneous Authentication

Beyond Basics /

Centralisation

Beyond Basics / Authentication /

LEMENU:LOGIN

f1810, f1820, f1830, f1840

OAuth2

(Azure)

lose intended destination?

Beyond Basics / Authentication /

Social Sign-In

An outstanding process problem

Switch on deploy, no API

Switch in Session

Beyond Basics / Authentication /

Alternative

f?p=&APP_ID.:1:&APP_SESSION.:APEX_AUTHENTICATION=dbaccounts

Menus

Beyond Basics /

+ Report Template

(options)

+ APEX_Applications

+ Custom tables

(attribs/security)

Assessing Link Usage

Beyond Basics /

Navigation Bar

Beyond Basics /

select

2 lvl

,application_name label

,apex_page.get_url

(p_application => app_id

,p_page => 1

,p_request => 'MENU') -- let's track popular usage

,null is_current_list_entry

,icon img

,null imgattr

,null imgalt

,null attribute01

,null attribute02

,null attribute03

,'drop' page_group_name

,app_id order_dropdown

from lemenu_apps

Common to all apps

Reporting Monolith

Beyond Basics /

y = a(1 + r)x

{500+ pages} = 15mb

{1 page} = 100kb

Page Export

groups \ sub

page-groups

page-sub-groups

Template Application

Beyond Basics /

f1801 - Login/Menu

f1810 - Land

f1820 - Sea

f1830 - Air

f1840 - Space

f1850 - Underground

Subscriptions

Beyond Basics /

  • Authentication Schemes
  • Authorisation Schemes
  • LOVs
  • Plugins
  • Shortcuts
  • (Templates)

Subscriptions

Beyond Basics /

f1899

Push change to all

Subscriptions / Verify Theme

Beyond Basics /

Universal Theme manages subscription internally

security

5.x+

Blueprints

Beyond Basics /

Create new application...

f101 - Login

Pre-built bits!

f1810

f1820

f1830

Application Items

Beyond Basics /

Define in each app

Share value across apps

pk_pref.date(:app_user);

&F_DATE_FORMAT.

Globalisation =>

Main Bytes

Beyond Basics /

- Mix authentication

- Embrace Data driven concepts

- Go Universal Theme (UT)

- Re-use stuff

Parsing Schema

Security /

#SmartDB

Authorisation Schemes

Security /

What is a role?

Security /

Sharing Features

Security /

Application Access Control

'Y' in (:F_ADMIN, :F_DEV)

Roles

"complexity goes somewhere"

OK for smaller deployments?

Authorisation Schemes

Privileges

Security /

AAAA - View Access

AAAC - Remove Access

AAAB - Add Access

Securing the Page

Security /

Verify Function

Security /

f?p=LEMENU:LOGIN

Link to page

The page itself

Logs out if function returns false

Immediate employee exits...

or Branch away

App-level Authorisation

Security /

Generic options?

monitoring

Suspend Application

Security /

Application Process

On Load: Before Header

- Check user still valid

- Check app availability

l_url := APEX_UTIL.PREPARE_URL

('f?p=LEMENU:HOME:' -- app:page

||v('SESSION') -- retain session

||':APP_SUSPENDED'); -- request

htp.init();

apex_util.redirect_url(l_url, false);

Session Timeout URL

Security /

Declarative solution

Custom Session Timeout

Security /

App Error Handler

IF p_error.apex_error_code =

'APEX.SESSION.EXPIRED' then

l_result.message := 'Your session was left unattended' --...

||htf.script('document.addEventListener("DOMContentLoaded",

function(event) {

$(".t-Icon").removeClass("t-Icon")

.addClass("fa fa-emoji-sleeping fa-5x u-color-12-text");

$(".t-Alert-body p").hide();

});');

Manage Instance

Security /

Little Nybbles

Security /

- Parse Smartly

- Privilege Granularity

- Page Protection Options

Login message

www.grassroots-oracle.com/2015/12/customising-apex-50-workspace-login.html

Logging

Monitoring /

Every render, submit, AJAX call

select 'javascript:$s(''P88_HOUR'','''

||to_char(view_date,'mm/dd/yy hh24')||''');' lnk

,to_char(view_date,'mm/dd hh24') label

,count(*) hits -- green line series

,sum(elapsed_time) wait_time -- blue bar series

from apex_workspace_activity_log

where view_date between ...

and app_id ...

and page_id ...

and apex_user ..

apex_workspace_activity_log

Pulse

Monitoring /

hour

Fluctuation

Monitoring /

App Variation

Monitoring /

aggregate

Web Services

Monitoring /

18.1 - rolling 24 hours

business data

Web Services

Monitoring /

Different Behaviour

Decades of change

Digital Natives

New needs

Balance Legacy

no magic pill

read consistent

"Digital Transformation"

I don't know if you've noticed...

f101 Login / Menu App

- 103 Module E

- 102 Module A

- 104 Module F

- 110 Reports Module

WebLogic

Tomcat

ORDS

Different release cycle

Defined scope

User set

Internal Feedback Loop

data

APEX

New privileges

IDE

survival of the fittest

java -> XML

Share credentials

Limited Feedback

Sessions

Monitoring /

Share Business Data

from devs

from users

C#

Forms

.fmx

FSAL

count(*) v$session every 15 mins

ancient survivor

Forms sessions

fin

Forms users

APEX interactions

Layer 8

~100 users each

Forms

Monitoring /

Form

User

Date

Host

form_visits

+ security_vw

=

which forms have our

user group been using

last month?

log.form_visit

(p_current_form => name_in('SYSTEM.CURRENT_FORM')

,p_user => GET_APPLICATION_PROPERTY(username)

,p_host => sys_context('userenv','host')

);

proof

It Depends

Migration /

Summary

Closing /

AUSOUG

#SmartDB

directory_parser

Reporting just grows

UT 1.2

Rome wasn't built in a day

data

apex_190100

Subscriptions / App Items

1899 - Template

- App

- App

Theme 25

Needs security upgrade

Post-Authentication

Users

something slow

generally tightened rules

iframe, wait for result

t

apex_workspace_activity_log

#Kscope19

APEX

Managing

Multiple

Applications

Built with by Scott Wesley

grassroots-oracle.com

f1810

Pull update to app

1899

f102 - CRM

SELECT some_stuff

EXECUTE some_stuff

1.2

1.0

Business Role

  • Workspace Admin {a, b, c}
  • Developer {d, e, f}
  • End User {g}

1) Create > 1 apps with Cookie Name

Template

Produce File

www.grassroots-oracle.com/2019/01/oracle-apex-application-session-sharing.html

Tomcat

PDF

New Needs

Selected Modules

UT 1.0

Untouched in 5+ years

DB Accounts

b) import

(n)

DML

commit;

reporting_parser

f?p=100

Convert

IR / Charts / Drill

blogs.oracle.com/apex/thats-a-classic-report-really

Workspace Sharing

Avoid the monolith

Life-cycle control

Mitigate APEX

upgrade delay

UT 1.2

Recently migrated to UT

Motivation & tools to divide & conquer

Stats

SELECT

1 lvl

,'' label

,apex_page.get_url

(p_application => '1801'

,p_page => 'STATS'

,p_items => 'P102_APP_ID,P102_PAGE_ID'

,p_values => v('APP_ID')||','||v('APP_PAGE_ID')

) target

,null is_current_list_entry

,'fa-combo-chart' img

,null imgattr

,null imgalt

,null attribute01

,null attribute02

,null attribute03

,'bar' page_group_name

,10 order_dropdown

FROM dual

union all

Report App

Pages

Time

101 Login / Menu App

- 102 Module A

- 103 Module B

- 104 Module C

- 110 Reports Module

f1820

f1810

f1830

f1840

Graphs make Monitoring magnificent

crm_parser

transactional

Privileges

commons.wikimedia.org/wiki/File:Siamese_Crocodile_white_background.jpg

Roles

copy &

subscribe

Video

- App

- App

Master

Subscribers

Developer changes code

Business Roles

analytics

cntr

+1

+7

+43

T

W

M

Weekend

Blog

Book

AnyChart

Tabular Form

AnyChart

f101 (global)

:f_alien := 'Y';

50h+ stuff

Sunday Symposium

+ Geek night

Monday

+ community event

Tuesday

+ Happy hour

Wednesday

+ Special Event

Thursday Morning

?

Define granular Security

PDF

Use many times

1810, 1820, 1830, ...

log

commons.wikimedia.org/wiki/File:Changyuraptor.png

a) export

f101.sql

twitter.com/joelkallman/status/1126460098895855616

101

102

103

105

211

202

108

App

UT

CM

js

JET/IG/...

Updated regularly

UT 1.2

Menu

APEX

- App

.

18.2

4.0

- App

when

who

what

apex_application_pages

page_security

Similar concept:

www.grassroots-oracle.com/2015/12/customising-apex-50-workspace-login.html

UT 1.1

Users want more

f4500

f4000

f4750

f4800

Display Login

Login window can also time out

What about...?

Sharing

Menus

Subscriptions

Security

Monitoring

Privilege

  • View User {a}
  • Edit User {b}
  • Reset User Password {c}
  • Deactivate User {d}
  • Change User Role {e}

Forum

hit flurry

Untouched in 7+ years

Theme 2

A

B

- Module A

- Module B

- Module C

- Reports*n

Debug

Home

f210 - Reporting

SELECT many_many_things

job

,apex_page.get_url

(p_application => app_id

,p_page => 1

,p_request => 'MENU')

legacy.fmb

crutch.rep

,apex_page.get_url

(p_application => app_id

,p_page => 1

,p_request => 'CARD')

f1820 (local)

:f_alien := 'N'

f1810 (global)

where :f_alien = 'Y'

- Builder

- My Apps

HR clicks button

f111 - Directory

SELECT emp_list_vw

EXECUTE pk_emp_dir

accidental flood

of AJAX requests

f?p=1801:101

minute

Use many times

2) Link apps

Define Once

1899

Users