64
Going Public with your APEX Applica7on 25.03.2014 APEX World Peter Raganitsch

going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Embed Size (px)

Citation preview

Page 1: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Going  Public  -­‐  with  your  APEX  Applica7on

25.03.2014 APEX World

Peter Raganitsch

Page 2: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Peter Raganitsch !!!

[email protected] http://www.oracle-and-apex.com

!@PeterRaganitsch

Page 3: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

What is “Public” ?

• Internet oder Intranet

• -> Bereiche ohne Login

Page 4: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

What is “Public” ?

• Internet

• Intranet

• Extranet

• possibly large audience

• no user login needed

Page 5: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

APEX as a CMS?

Page 6: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

APEX as a CMS

• possible to do

• lot of coding involved

• easy way out: use an existing CMS

Page 7: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Security

Page 8: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Security - Server

• HW

• DMZ

• Schema

• Daten

• SSP

• XSS

Firewall

DMZ

HW+SWReliability

Page 9: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Security - DB

• HW

• DMZ

• Schema

• Daten

• SSP

• XSS

Schema

Data

Privs

Page 10: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Security - APEX

• HW

• DMZ

• Schema

• Daten

• SSP

• XSS XSSSQL Injection

Schema-Mapping

Page 11: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Security - Books

Page 12: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Design

• Gutes Aussehen ist alles

Page 13: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Example

Page 14: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Example

Page 15: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Example

Page 16: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Example

Page 17: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Example

Page 18: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Example

Page 19: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Example

Page 20: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Example

• find more examples by searching for

allinurl:apex/f?p

Page 21: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Example

• find more examples by searching for

allinurl:ords/f?p

2.0.6: APEX Listener is now Oracle REST Data Services !

Page 22: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Design

• Good looks sell

• Webdesigner

• Templatemonster/Themeforrest

• Responsive Web Design

• Intuitive User Experience

Page 23: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Website Templates

Page 24: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Website Templates

Page 25: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

APEX Templates

Page 26: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

APEX Templates

Page 27: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Theming Competition

Page 28: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Bookmarks

• Lesezeichen setzen - Session 0

Page 29: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Bookmark

• setting Bookmarks

• send Links per Email

Better: Redirect from a shortcut URL

www.myapplication.nl

Page 30: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Session 0

• for public Pages

• APEX_UTIL.Prepare_URL

• APEX_APPLICATION.g_use_zero_sid

Page 31: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Get found

• Suchmaschinen

Page 32: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Search Engines

Use Session 0!

Otherwise you could get many, many visits from search robots

Page 33: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Search Engines

http://jeffkemponoracle.com/2011/10/07/googlebot-apex-session-ids-and-cookies/

• Google visits f?p=100:1:123123123

• Session invalid

• APEX replies with a redirect to a new Session-Id f?p=100:1:9898434508

• Google stores that new URL...

• …and returns later (Goto 10)

Page 34: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Page Title

• set Page-Title in APEX

• and make sure its used in the Page-Template

• set Page-Security to “Page is Public”

Page 35: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Meta-Tags

• set Meta Tags in the HTML Header

• Important for Search Engines

•<meta name=”Description” content=”...”>

•<meta name=”keywords” content=”...”>

Page 36: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Sitemap• Sitemap.xml contains website structure

• http://de.wikipedia.org/wiki/Sitemap

• https://support.google.com/webmasters/answer/183668?hl=de

• can be created through an On-Demand-Prozess, Restful Webservice or DB-Function

<?xml version="1.0" encoding="UTF-8"?>!<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" ! xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" ! xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">! <url> ! <loc>http://www.example.com/foo.html</loc> !...

Page 37: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Content Search

Page 38: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

APEX Report

Page 39: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Content Search

• APEX Views

• Eigene Tabellen

• als Report darstellen

Page 40: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

nicer URL

f p=

Page 41: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

normal

apex/f?p=123:456

Page 42: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

nicer

apex/f?p=mobile:home

Page 43: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

nicer URL

• Application Alias

• Page Alias

Page 44: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Links created by APEX

• Problem: APEX always uses IDs, never Alias

Page 45: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Beautify Links

• Global PageDynamic ActionorHTML Region

Page 46: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Application Alias

• Watch out when using Application Alias !

• Has to be unique, but that is neither checked nor enforced

• An Application in a different Workspace can use the same Alias(the Author of this presentation claims this is a BUG)

Page 47: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

much nicer URL

hrURL*hrURL = human readable URL

Page 48: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

normal

apex/f?p=123:456

Page 49: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

nicer

apex/f?p=mobile:home

Page 50: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

much nicer

apex/mobile/home

Page 51: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

iFrame

• Apache mod_rewrite

• Entweder fixe Regeln, oder Mapping-Datei

http://www.inside-oracle-apex.com/nicer-url-for-an-oracle-apex-application/

Page 52: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Apache mod_rewrite

• Apache mod_rewrite

• use RewriteRules or a Mapping-File

http://www.oracle.com/webfolder/technetwork/de/community/apex/tipps/mod_rewrite/index.html http://monkeyonoracle.blogspot.de/2010/02/nice-url-in-public-facing-oracle-apex.html

Page 53: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

APEX Listener / ords

• APEX Listener via RESTful Webservice

• URL: <server>/<dad>/<workspace>/[<ws>]

http://krisrice.blogspot.co.at/2013/07/nicer-urls-for-apex-yet-another-option_25.html

Page 54: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

EPG and mod_plsql

• Path-Alias points to a DB procedure

• URL: <server>/<dad>/<prozedur>

http://docs.oracle.com/cd/B19306_01/server.102/b14337/concept.htm#i1006110 http://ora-00001.blogspot.de/2009/07/creating-rest-web-service-with-plsql.html

Page 55: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

URL Mapping Procedure

Page 56: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Members only Area

By Chris Messina (http://wiki.oauth.net/Logo) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons

Page 57: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Public Website Logins

Page 58: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Public Website Logins

• http://en.wikipedia.org/wiki/OAuth

• Google & Facebook OAuth 2

• Twitter OAuth 1.1

• or Custom Login (local tables/procedures)

• Tipp: APEX Authentication Plugins !

Page 59: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Example OAuth via Google

https://developers.google.com/accounts/docs/OAuth2?hl=de

Page 60: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Google/Facebook Plugin

Page 61: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

- end -

Page 62: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

hrURL Demo

http://apex.oracle/com/pls/apex/hrul/home

Page 63: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

i n f o @ t r y f o e x n o w . c o m

w w w. t r y f o e x n o w . c o m

1 of 2 Single Developer Licenses

each Valued at 5,000 EUR

Win

Ask Matt or Peter for a Registration form

Page 64: going public - Peter Raganitsch - nlOUG • Apache mod_rewrite! • Entweder fixe Regeln, oder Mapping-Datei

Peter Raganitsch !!!

[email protected] http://www.oracle-and-apex.com

!@PeterRaganitsch

Find me at the FOEX Booth!