Sunteți pe pagina 1din 40

S298825 : APEX and XML DB:

A Match Made in the Database


Mark D Drake
Manager, Product Management
The following is intended to outline our general
product direction. It is intended for information
purposes only, and may not be incorporated into any
contract. It is not a commitment to deliver any
material, code, or functionality, and should not be
relied upon in making purchasing decisions.
The development, release, and timing of any
features or functionality described for Oracle’s
products remains at the sole discretion of Oracle.
<Insert Picture Here>

APEX and XMLDB


Introduction
What is XML DB ?

• XMLType: Native flexible, scalable, XML


storage, processing and indexing
• XQuery, XML Schema, XSLT : enable
XML centric development
• XMLDB repository: XML specific content
management
• File / Folder access metaphors
• Xlink for integrity management
• Xinclude for compound documents
• SQL/XML for SQL-Centric XML publish
and SQL/Xquery interaction
• SQL/XML and XML/SQL interoperability
• Standards compliant
Advanced XML Capabilities

Native storage for


schema-based and
XML Application schema-less XML
JDBC
Files XMLType
XML views of
.NET relational Content
XDK XML
Folders Schema
OCI
Native XQuery
SOAP ACLS XQuery Engine

HTTP XML and Full-Text


Versioning SQL/XML
indexing
FTP
Metadata XSLT
WebDav
Document Document and data
or Message Events Centric Access
DOM

6
Oracle Application Express Introduction

• Unique Rapid Application Development


(RAD) tool for the Oracle Database
• Browser based for Development, Deployment
and Use
• Declaratively build professional Web 2.0
applications that are fast and secure
• Leverages full Oracle database capabilities
and existing SQL & PL/SQL skills
• Standard component of the database
• Fully supported, “no-cost” option with all
editions of the Oracle Database

Easy to develop • Easy to deploy • Easy to manage


Oracle Application Express Introduction

Data-driven Applications Oracle Forms


Develop opportunistic and departmental Modernization
productivity applications Leverage SQL & PL/SQL declarative
programming skills to move Forms
applications to HTML / Web 2.0

Online Reporting
Build SQL-based reporting
applications on existing
database schemas

Spreadsheet Web-ification Access Replacement


Consolidate outgrown Access applications
Convert spreadsheets to Web applications
to the Oracle database with an APEX Web
where they can be concurrently viewed and
front end
edited

© 2008 Oracle Corporation – Proprietary


Apex and XML DB integration
Oracle XML DB PL/SQL Gateway

• Oracle XML DB HTTP server add support for


embedded PL/SQL gateway
• Eliminate APEX’s dependency on MOD PL/SQL
• APEX runs inside the database
• No need for an Application Server
• Zero effort / cost deployment of Application Express
• Supported for development environment and end-user
applications
• Available in Oracle Database 11g (and Oracle XE)
<Insert Picture Here>

APEX and XMLDB


The Great Divide
The Great Divide

• Displaying XML Content


• XML Vs Relational Paradigm
• Database Vs Custom Authentication
<Insert Picture Here>

Bridging the Chasm


Rendering XML Content
Rendering XML in APEX

• Apex does not yet understand how to render XML


content
• Display an XMLType
OBJECT_VALUE
• XMLType displayed as [datatype]
• Convert to CLOB
xmlSerialize(document OBJECT_VALUE as CLOB)
• Renders XML in browser without tags
Rendering XML as XML
Server side transformation using XML DB XSTL-VM

• Oracle XML DB includes a powerful XSLT-VM


• Use XMLPrettyPrint.xsl to create an HTML friendly
representaton of the XML content
XMLTRANSFORM
(
OBJECT_VALUE,
XDBURITYPE('/XFILES/common/xsl/XMLPrettyPrint.xsl').getXML()
).getClobVal()

• Preserves tags and attributes


•Content accessed via xdburitype() operator
• PrettyPrintXML.xsl originally developed by Steve
Meunch
Rendering XML as XML
Server side transformation using XML DB XSTL-VM
Rendering XML as XML
Client side transformation

• Use APEX’s AJAX capability to fetch XSL and XML


content from the database
• Use browser based XSL transformation to render
XML as HTML
• Fetch XSL in onload() event
• Provide on demand transformation of selected XML content
• Offload XSL transformation from database to browser
Browser specific code or wrapper class required
• Appropriate when not all XML needs to rendered in the
browser
D E M O N S T R A T I O N

Rendering XML in APEX


<Insert Picture Here>

Bridging the Chasm


Relational Views of XML
Content
XMLTable
Enabling relational access to XML

• XMLTable() : A relational view of XML content


• Flattens elements and attributes from into relational columns
that APEX understands
• Nested XMLTable() operators are used to map
collections into detail views
• Works best with Oracle XML DB object-relational
storage
• XMLTable operators map directly to underlying storage
structure
• Operations on view map 1:1 into operations on underlying
tables
XMLTable
Mapping non-repeating values

• Each non repeating element or attribute becomes a


column in the view
XMLTable
Mapping repeating values

• Each repeating element generates a row in the view,


• Elements and attributes are mapped to columns
Master – Detail report on XML content
D E M O N S T R A T I O N

Apex accessing XML


content
XMLTable()
Enabling APEX access to XDB Repository

• Oracle XML DB includes the XML DB repository


• Provides a framework for XML Content Mgt
• Allows XML content to be organized in a file / folder hierarchy
• Support basic CM operations
• (Works with other content too)
• Based on the IETF DAV standard
• Metadata is tracked as an XML Document (Resource)
• Repository directly accessible from SQL
• RESOURCE_VIEW & PATH_VIEW
• DBMS_XDB package
PATH_VIEW in detail

• PATH_VIEW enables hierarchical traversal


• PATH is the path to the resource (file or folder)
• RES and LINK contain metadata about the resource and
link object.
• Meta data is represented as an XMLType
Querying PATH_VIEW
Finding Resources

• Never use PATH = ‘/public/T1’ or PATH LIKE “/public/%’


• Use equals_path() or under_path()
• To find a file or folder : equals_path(res,’/public/T1’) = 1
• To find files in a folder : under_path(res,’/public) =1
Querying PATH_VIEW
Accessing Metadata

• RES and LINK contain the interesting metadata


• XMLType : not understood natively by APEX
• RES : standard data about the resource
• Owner, Creator, Date Created, DisplayName
• LINK : data related to location of the resource
• Name, Parent
• Paths are based on link Name, not DisplayName (bug in Windows)
Enable APEX to access RES and LINK

• Use XMLTable to provide APEX with a relational view


of RES and LINK
• Map content of RES and LINK to relational columns
• Nodes in RES are in the namespace
http://xmlns.oracle.com/xdb/XDBResource.xsd
• Nodes in Link are in the namespace
http://xmlns.oracle.com/xdb/XDBStandard
APEX_PATH_VIEW
Enabling access to RES and LINK


Application on APEX_PATH_VIEW
Key Features

• Navigate the repository using APEX_PATH_VIEW


• CRUD (Create, Retrieve, Update & Delete) features
using DBMS_XDB and DBMS_XDB_VERSION
• AJAX based menus
• AJAX based tree control supports COPY, MOVE and
LINK operations
• Support for XCM features
• Lock, Unlock, Make Versioned, Check-in and Check-out
• Icons indicate current status of each resource
D E M O N S T R A T I O N

APEX implementation of
XFiles
<Insert Picture Here>

Bridging the Chasm


Custom Authentication
in XML DB
Oracle XML DB repository security

• Oracle XML DB repository provides ACL based


security
• Allows access to content to be restricted by principle
• Enforced using VPD (Row Level Security)
• ACLs are an XML document stored in XML DB
• An ACL grants or revokes permission to a principle
• Principles are defined as
• A database user or role
• An Oracle LDAP defined user or group
Custom Authentication model

• Oracle XML DB and APEX development teams are


investigating enabling custom authentication
• Prototype based on concept of a Distinguished Name or DN
• An DN uniquely identifies a user across multiple sources
• Email address is an example Distinguished Name
• XML DB will allow trusted sources to provide a DN for
their users and groups
• XML DB must be configured to ‘trust’ a DN source
• NTLM, Apex Users, Active Directory
• DN will assigned an GUID and treated as a repository
principle
Trusted sources

• Applications will be able authenticate users and


identify them to XML DB
• XML DB will be able to authenticate HTTP and FTP
requests with external directories
• Enabling of custom authentication will require XDBADMIN
• ACLs can be defined in terms of the trusted sources
DN
D E M O N S T R A T I O N

Custom Authentication
The preceding is intended to outline our general
product direction. It is intended for information
purposes only, and may not be incorporated into any
contract. It is not a commitment to deliver any
material, code, or functionality, and should not be
relied upon in making purchasing decisions.
The development, release, and timing of any
features or functionality described for Oracle’s
products remains at the sole discretion of Oracle.
For More Information

search.oracle.com

or
oracle.com

S-ar putea să vă placă și