TROUG Jan, 2014

Complex
Applications with
APEX

Ergem PEKER
Who am I
❖

12 years of DBA

❖

OCP and RAC Expert

❖

3 years of TROUG Contribu tor

❖

Blogger since 2007 (ergem p.blogs...
Contents
❖

Intro

❖

ApEx Listener 2.0.5

❖

RESTfu l Services

❖

Au thorization Schem es

❖

Dynam ic Actions

❖

Displ...
Intro
APEX 4.3

APEX 3.0
H TMLDB

XMLDB
Intro
LISTEN ER

CLIEN T

http:/ / localhost:8080/ apex/
f?p =AppId :PageId :Session:Requ est:Debu g:ClearCache:
Param s:P...
APEX Listener 2.0

❖

Pro’s & Con’s

❖

Installation

❖

SQL Developer Integration

❖

Docu m entation
APEX Listener 2.0
Pro’s & Con’s

❖

Pro’s
❖

Enables Proxy to m ore than one APEX instances

❖

Separates Application Serv...
APEX Listener 2.0
Pro’s & Con’s

❖

Con’s
❖

More Com plex to install

❖

EPG is sim pler to install and m anage (hence th...
APEX Listener 2.0
Pro’s & Con’s
APEX Listener 2.0
Installation

❖

Install Java 6 Upd ate 20 or new er

❖

http:/ / w w w .oracle.com / technetw ork/ d ev...
APEX Listener 2.0
Installation (Tips)

D ont forget to disable embedded plsql gatew ay
EXEC DBMS_XDB.SETHTTPPORT(0);
EXEC ...
APEX Listener 2.0
SQL Developer Integration

apex_040200w w v_flow _epg_inclu d e_m od _local
APEX Listener 2.0
Documentation

❖

http:/ / w w w .oracle.com / technetw ork/ d eveloper tools/ apex-listener/ d ocu m en...
RESTful Services
❖

What are RESTfu l services

❖

Enabling RESTfu l services for APEX

❖

H ow to create a RESTfu l servi...
RESTful Services
❖

Representational State Transfer

❖

A new stand ard for w eb services

❖

Easier to consu m e and serv...
RESTful Services
@apex_rest_config.sql
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL
(
'power_users.xml',
'ACL that lets power users t...
RESTful Services
RESTful Services
RESTful Services
RESTful Services
RESTful Services
RESTful Services

{"next":{"$ref":"http:/ / 192.168.100.101:8080/ apex/ w s_d ev/ svc_test2?page=1"},"item s":[{"v_typ
e_n...
RESTful Services
RESTful Services
RESTful Services
RESTful Services
RESTful Services
RESTful Services
RESTful Services
RESTful Services
RESTful Services
RESTful Services
Authorization Schemes
❖

H elps to stand ard ize the Au thorization ru les across all
over the application

❖

re-u sabili...
Authorization Schemes
create or replace FUNCTION "FNC_IS_ADMIN"
(G_USERNAME varchar2) RETURN NUMBER AS
var_return number;
...
Authorization Schemes
create or replace FUNCTION "FNC_IS_READONLY"
(G_USERNAME varchar2) RETURN NUMBER AS
var_return numbe...
Authorization Schemes
Authorization Schemes
Authorization Schemes
Authorization Schemes
Dynamic Actions

❖

Im plem enting Javascript is now easier

❖

H and y on ru ntim e generated page item s
Dynamic Actions
Dynamic Actions
Dynamic Actions
Dynamic Actions
Dynamic Actions
Dynamic Actions
Dynamic Actions
Used Case
On Click Su bm it page
Dynamic Actions
Used case
Q/ A
Upcoming SlideShare
Loading in …5
×

Complex Applications with APEX - Ergem Peker

1,591 views
1,406 views

Published on

Ergem Peker'in TROUG DBA/Developer SIG 2014'de yaptığı sunum

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,591
On SlideShare
0
From Embeds
0
Number of Embeds
347
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Complex Applications with APEX - Ergem Peker

  1. 1. TROUG Jan, 2014 Complex Applications with APEX Ergem PEKER
  2. 2. Who am I ❖ 12 years of DBA ❖ OCP and RAC Expert ❖ 3 years of TROUG Contribu tor ❖ Blogger since 2007 (ergem p.blogspot.com ) ❖ ApEx Developer
  3. 3. Contents ❖ Intro ❖ ApEx Listener 2.0.5 ❖ RESTfu l Services ❖ Au thorization Schem es ❖ Dynam ic Actions ❖ Displaying Im ages ❖ Reports w ith H TML Tags
  4. 4. Intro APEX 4.3 APEX 3.0 H TMLDB XMLDB
  5. 5. Intro LISTEN ER CLIEN T http:/ / localhost:8080/ apex/ f?p =AppId :PageId :Session:Requ est:Debu g:ClearCache: Param s:Param Valu es:PrinterFriend ly DB/ PLSQL http:/ / 192.168.100.101:8080/ apex/ f?p =102:21:2843631787738::N O:21,22,23::
  6. 6. APEX Listener 2.0 ❖ Pro’s & Con’s ❖ Installation ❖ SQL Developer Integration ❖ Docu m entation
  7. 7. APEX Listener 2.0 Pro’s & Con’s ❖ Pro’s ❖ Enables Proxy to m ore than one APEX instances ❖ Separates Application Server and Database ❖ Perform s faster than Em bed d ed PLSQL Gatew ay ❖ Secu res d atabase to ou tsid e thread s ❖ Enables to install on Weblogic and Glassfish App. Servers ❖ Can u se RAC d atabase benefits ❖ (be able to u se SERVICE_N AME d efined on DB Instance) ❖ Recom m end ed for Prod u ction Environm ents ❖ Integrated w ith PLSQL d eveloper (w ith lots of featu res)
  8. 8. APEX Listener 2.0 Pro’s & Con’s ❖ Con’s ❖ More Com plex to install ❖ EPG is sim pler to install and m anage (hence there are not m any features) ❖ Recom m end ed for Developm ent and Test Env.
  9. 9. APEX Listener 2.0 Pro’s & Con’s
  10. 10. APEX Listener 2.0 Installation ❖ Install Java 6 Upd ate 20 or new er ❖ http:/ / w w w .oracle.com / technetw ork/ d eveloper tools/ apex-listener/ d ow nload s/ ind ex.htm l ❖ Unzip the d ow nload ed file ❖ cd to the extracted fold er ❖ java -jar apex.w ar ❖ java -jar apex.w ar u ser ad m in "Listener Ad m inistrator"
  11. 11. APEX Listener 2.0 Installation (Tips) D ont forget to disable embedded plsql gatew ay EXEC DBMS_XDB.SETHTTPPORT(0); EXEC DBMS_XDB.SETFTPPORT(0); SELECT DBMS_XDB.GETHTTPPORT FROM DUAL; SELECT DBMS_XDB.GETFTPPORT FROM DUAL; Create necessary D B Users APEX_PUBLIC_USER —db user invokes plsql gateway operations APEX_REST_PUBLIC USER APEX_LISTENER —db user invokes restful services —db user for restful service defined holder#vi defaults.xml All Restful service calls are forbidden over http by default #vi defaults.xml <entry key="security.verifySSL">false</entry> </properties>
  12. 12. APEX Listener 2.0 SQL Developer Integration apex_040200w w v_flow _epg_inclu d e_m od _local
  13. 13. APEX Listener 2.0 Documentation ❖ http:/ / w w w .oracle.com / technetw ork/ d eveloper tools/ apex-listener/ d ocu m entation/ ind ex.htm l ❖ http:/ / d ocs.oracle.com / cd / E39885_01/ appd ev.40/ e384 14/ toc.htm
  14. 14. RESTful Services ❖ What are RESTfu l services ❖ Enabling RESTfu l services for APEX ❖ H ow to create a RESTfu l service in APEX ❖ H ow to consu m e a RESTfu l service ❖ Docu m entation
  15. 15. RESTful Services ❖ Representational State Transfer ❖ A new stand ard for w eb services ❖ Easier to consu m e and serve (m etad ata inclu d ed ) ❖ Faster protocol (com m u nicates over H TTP) ❖ Lighter form at (JSON , CSV instead of XML) ❖ APEX listener has to be enabled in ord er to u se RESTfu l services in APEX
  16. 16. RESTful Services @apex_rest_config.sql DBMS_NETWORK_ACL_ADMIN.CREATE_ACL ( 'power_users.xml', 'ACL that lets power users to connect to everywhere', 'APEX_040200', TRUE, 'connect' ); DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL ( 'power_users.xml', '*', 0, 9999 );
  17. 17. RESTful Services
  18. 18. RESTful Services
  19. 19. RESTful Services
  20. 20. RESTful Services
  21. 21. RESTful Services
  22. 22. RESTful Services {"next":{"$ref":"http:/ / 192.168.100.101:8080/ apex/ w s_d ev/ svc_test2?page=1"},"item s":[{"v_typ e_nam e":"SAN STORAGE"},{"v_type_nam e":"DATABASE SOFTWARE"},{"v_type_nam e":"SERVER"},{"v_type_nam e":"FIREWALL"},{"v_type_nam e":"LO AD BALAN CER"},{"v_type_nam e":"MODEM"},{"v_type_nam e":"SWITCH "},{"v_type_nam e":"ROU TER"},{"v_type_nam e":"N AS STORAGE"},{"v_type_nam e":"DATABASE SERVER"},{"v_type_nam e":"WEB SERVER”}]}
  23. 23. RESTful Services
  24. 24. RESTful Services
  25. 25. RESTful Services
  26. 26. RESTful Services
  27. 27. RESTful Services
  28. 28. RESTful Services
  29. 29. RESTful Services
  30. 30. RESTful Services
  31. 31. RESTful Services
  32. 32. RESTful Services
  33. 33. Authorization Schemes ❖ H elps to stand ard ize the Au thorization ru les across all over the application ❖ re-u sability of the cod e ❖ Once im plem ented , easy to d efine in every elem ent ❖ Cu stom d isplay to every u ser accord ing to their privileges
  34. 34. Authorization Schemes create or replace FUNCTION "FNC_IS_ADMIN" (G_USERNAME varchar2) RETURN NUMBER AS var_return number; B E GI N var_return :=0 ; select count(1) into var_return from t_forum_user t1 JOIN t_forum_privs t2 ON t1.n_user_id = t2.n_user_id where t2.is_admin=1 and lower(t1.v_username)=lower(g_username); RETURN var_return; END FNC_IS_ADMIN;
  35. 35. Authorization Schemes create or replace FUNCTION "FNC_IS_READONLY" (G_USERNAME varchar2) RETURN NUMBER AS var_return number; B E GI N var_return :=0 ; select count(1) into var_return from t_forum_user t1 JOIN t_forum_privs t2 ON t1.n_user_id = t2.n_user_id where t2.is_readonly=1 and lower(t1.v_username)=lower(g_username); RETURN var_return; END FNC_IS_READONLY;
  36. 36. Authorization Schemes
  37. 37. Authorization Schemes
  38. 38. Authorization Schemes
  39. 39. Authorization Schemes
  40. 40. Dynamic Actions ❖ Im plem enting Javascript is now easier ❖ H and y on ru ntim e generated page item s
  41. 41. Dynamic Actions
  42. 42. Dynamic Actions
  43. 43. Dynamic Actions
  44. 44. Dynamic Actions
  45. 45. Dynamic Actions
  46. 46. Dynamic Actions
  47. 47. Dynamic Actions Used Case On Click Su bm it page
  48. 48. Dynamic Actions Used case
  49. 49. Q/ A

×