Upload
austin-randall
View
220
Download
1
Embed Size (px)
Citation preview
1© Copyright Trivadis SA
TVD-XORA : an Oracle XDB based Web Reporting Framework
Marc Lieber
| October 2003 |
2© Copyright Trivadis SA
Agenda
01 – History of the framework
02 – Oracle XML overview
03 – TVD-XORA Working environment
04 – TVD-XORA Demo
05 – What’s next ?
3© Copyright Trivadis SA
History of the framework
Hoffmann La Roche ltd Basel– Master Data Management Services : Trivadis SLA
WebDB Portal ?– WEBDB has some strong limitations (Rowid, aggregated
views, HTP, Excel or PDF output, etc . . .)– The new Release is integrated in IAS Portal
New Projects– New requirements : Excel, PDF, SVG, Multiple updates, etc ....– Low budgets, rapid development– Basic know how : PL/SQL, Webdb, javascript, XML– Web server is an old OAS– Other options : java + Struts + Cocoon
4© Copyright Trivadis SA
Agenda
01 – History of the framework
02 – Oracle XML overview
03 – TVD-XORA Working environment
04 – TVD-XORA Demo
05 – What’s next ?
5© Copyright Trivadis SA
Oracle XML Components
Oracle XML Developer's Kit (XDK) – XML Parser and XML Schema Processor– XSLT Processor– XML SQL Utility (XSU)– XSQL Servlet
Oracle9i features– New datatypes XMLTYPE and URITYPE– The PL/SQL package DBMS_XMLGEN– Oracle XML DB
Oracle Text, Advanced Queuing, etc ….
6© Copyright Trivadis SA
XDB
Foldering
Versioning
ACL
Webdav, FTP
Schema Validation
SQLX functions
Etc ...
7© Copyright Trivadis SA
Oracle9i XML Generation : Overview SQLX Functions
XMLElement
XMLForest
XMLColAttrVal
XMLConcat
XMLAgg
PL/SQL Package
DBMS_XMLGEN
SQL Functions
SYS_XMLGEN
SYS_XMLAGG
XMLSequence
Generated XML
XMLType instance
XML as DOM
XML as String
Varray of XMLType Sequences
Forest of XML Elements
8© Copyright Trivadis SA
XDB Features used in our framework (1)
XMLType datatype– To manipulate, store, validate, transform XML data
in the database– The object type XMLType provides a number of
useful methods that operates on XML content
DBMS_XMLSchema– To register an XML Schema in the database– XML documents can than be validated against it– An XMLType can be associated with an XML Schema
to store data in an Object-relational way instead as a CLOB
9© Copyright Trivadis SA
XDB Features used in our framework (2)
DBMS_XMLGEN Package – to generate a result set based on a select statement
SQLX functions – to aggregate XML outputs
XML Stylesheets transformation capabilities in the Database
XMLType Views
10© Copyright Trivadis SA
Agenda
01 – History of the framework
02 – Oracle XML overview
03 – TVD-XORA Working environment
04 – TVD-XORA Demo
05 – What’s next ?
11© Copyright Trivadis SA
XML tool : XMLSpy
Maintain XML Documents
Maintain XML Schemas
Maintain Stylesheets
Test result set transformation with stylesheets
Stylesheets generator : HTML, PDF
Strong integration of Oracle XDB features
12© Copyright Trivadis SA
What is an XML Schema ?
Commonly used as a validation mechanism
Gradually replacing the traditional DTD
A rich grammar describes XML documents
XML Parser checks XML document against grammar valid
InvoiceInvoice
OrderItemOrderItem
13© Copyright Trivadis SA
XML Stylesheet transformation
An XML Stylesheet transforms an XML document into another XML document, or another type of textual document.
This transformation can take place in the Database, on the application server or on the client
XSLT is a language for transforming XML documents into HTML, Text, XML, SVG, Excel, Word, etc …
XSL Formatting Objects (XSL-FO) is a vocabulary for formatting XML documents into PDFs
14© Copyright Trivadis SA
What is an SVG ?
It‘s an XML based graphic representation
It‘s a W3C recommendation
Data can be extracted from the DB in an XML format and transformed with a stylesheet into an SVG.
SVG Graphics requires a viewer such as Adobe SVGViewer
15© Copyright Trivadis SA
XML DB and XML Schema
XML Schema controls all aspects of processing – Storage mappings – In-memory representations– Language Bindings
XML Schema Registration Process– Associates XML Schema with URL– Generates Object types, Nested tables and Varrays– Creates default tables
XMLType column can be constrained to a global element of registered schema
16© Copyright Trivadis SA
Object-Relational Storage of XML Documents
An XMLType table can store XML documents as a CLOB or as Object-Relational.
The XML documents are ’broken up (decomposed)’ into object-types, nested tables, varrays and CLOBs.
Native XMLType instances contain hidden columns that store this extra information that does not quite fit in the SQL object model
An XML Schema must be registered in order to store the documents as Object-Relational
17© Copyright Trivadis SA
XML Schema Registration
XML Schema are registered by using procedure DBMS_XMLSCHEMA.REGISTERSCHEMA()
BEGIN dbms_xmlschema.registerSchema( schemaURL => 'http://linux:8080/optw/optwgen.xsd', schemaDoc => httpuritype('http://linux:8080/optw/optwgen.xsd'), local => true, genTypes => false, -- can be used to generate Types genTables => false, -- can be used to generate default table genBean => false, force => false, owner => USER );END;
BEGIN dbms_xmlschema.registerSchema( schemaURL => 'http://linux:8080/optw/optwgen.xsd', schemaDoc => httpuritype('http://linux:8080/optw/optwgen.xsd'), local => true, genTypes => false, -- can be used to generate Types genTables => false, -- can be used to generate default table genBean => false, force => false, owner => USER );END;
BEGIN dbms_xmlschema.registerSchema('report.xsd', getDocument('report.xsd'),TRUE, TRUE, FALSE, TRUE);END;
BEGIN dbms_xmlschema.registerSchema('report.xsd', getDocument('report.xsd'),TRUE, TRUE, FALSE, TRUE);END;
18© Copyright Trivadis SA
XML Schema Deletion
The package DBMS_XMLSCHEMA contains a procedure to delete the XML schema
Deleteschema removes all related objects to this XML schema (Tables, collections, object types)
The cleanup doesn‘t work properly in some cases.– Bug !
BEGIN dbms_xmlschema.deleteschema( schemaurl => ‘report.xsd', delete_option => dbms_xmlschema.DELETE_CASCADE_FORCE );END;
BEGIN dbms_xmlschema.deleteschema( schemaurl => ‘report.xsd', delete_option => dbms_xmlschema.DELETE_CASCADE_FORCE );END;
SQL> select SCHEMA_URL from USER_XML_SCHEMAS;report.xsdtree.xsdreport.xsdreport.xsd
SQL> select SCHEMA_URL from USER_XML_SCHEMAS;report.xsdtree.xsdreport.xsdreport.xsd
19© Copyright Trivadis SA
XML Schema : Oracle User-Defined Mapping
XDB uses annotated XML Schema as metadata, that is, the standard XML Schema definitions along with several Oracle XML DB-defined attributes– These attributes are in a different namespace and control how
instance documents get mapped into the database– The Oracle XML DB namespace: http://xmlns.oracle.com/xdb
<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb"><xs:element name="report" type="ReportingType" xdb:defaultTable="XML_REPORTS" xdb:tableProps="tablespace users"/>
<xs:complexType name="ReportingType" xdb:SQLType="REP_REPORTING_T"><xs:sequence> . . . . ..
<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb"><xs:element name="report" type="ReportingType" xdb:defaultTable="XML_REPORTS" xdb:tableProps="tablespace users"/>
<xs:complexType name="ReportingType" xdb:SQLType="REP_REPORTING_T"><xs:sequence> . . . . ..
20© Copyright Trivadis SA
XML Views
XML views (known as XMLType views as XML document represented using built-in XMLType)– wrap existing relational as well as object-relational data into
XML formats
CREATE OR REPLACE VIEW Emp_view OF XMLTYPE WITH OBJECT ID (EXTRACT(sys_nc_rowinfo$,'/Emp/@empno').getnumberval()) AS SELECT XMLELEMENT("Emp", XMLAttributes(empno), XMLForest(e.fname ||' '|| e.lname AS "name", e.hire AS "hiredate")) AS "result" FROM employees e WHERE salary > 20000;
-- empno attribute in the document should become the unique identifier for each row. -- SYS_NC_ROWINFO$ is a virtual column that references the row XMLType instance.
CREATE OR REPLACE VIEW Emp_view OF XMLTYPE WITH OBJECT ID (EXTRACT(sys_nc_rowinfo$,'/Emp/@empno').getnumberval()) AS SELECT XMLELEMENT("Emp", XMLAttributes(empno), XMLForest(e.fname ||' '|| e.lname AS "name", e.hire AS "hiredate")) AS "result" FROM employees e WHERE salary > 20000;
-- empno attribute in the document should become the unique identifier for each row. -- SYS_NC_ROWINFO$ is a virtual column that references the row XMLType instance.
21© Copyright Trivadis SA
XML Schema validated views
The output is an XMLType result setCREATE OR REPLACE VIEW v_regions_countries_oo OF XMLTYPE XMLSCHEMA "REPORT_OO.XSD" ELEMENT "REPORT" WITH OBJECT OID (EXTRACT(SYS_NC_ROWINFO$,'/REPORT/ID/TEXT()').GETNUMBERVAL())ASSELECT xmlelement("REPORT",xmlforest(r.region_id AS "ID",'DEPT_REPORT' AS "REPORT_NAME", 'Test Report DEPT' as "TITLE", '100%' as "WIDTH", 0 as "BORDER"), xmlelement("BLOCK",XMLATTRIBUTES(1 AS "id", '65%' as "width", 1 as "colspan",0 as "border" ),xmlforest('Region Info' TITLE), XMLelement("ROWSET",XMLATTRIBUTES('100%' as "width",1 as "border" ),xmlforest('--' TITLE), XMLELEMENT("ROW", XMLCOLATTVAL ( R.REGION_id,'Region ID' as "text")), XMLELEMENT("ROW", XMLCOLATTVAL (R.REGION_NAME,'Region Name' as "text")))), xmlelement("BLOCK",XMLATTRIBUTES(2 AS "id", '100%' as "width", 2 as "colspan",1 as "border" ), xmlforest('Countries Info' TITLE), XMLelement("ROWSET",XMLATTRIBUTES('100%' as "width",1 as "border" ),xmlforest('having employees' TITLE), XMLELEMENT("ROW_TITLE", xmlForest ('Country ID' as "TEXT", 'Country Name' as "TEXT",'Flag' as "TEXT")), ( select xmlagg(XMLELEMENT("ROW",XMLCOLATTVAL (C.COUNTRY_ID,c.country_name ))) FROM hr.COUNTRIES C where C.REGION_id=r.region_id))))from hr.REGIONS r
CREATE OR REPLACE VIEW v_regions_countries_oo OF XMLTYPE XMLSCHEMA "REPORT_OO.XSD" ELEMENT "REPORT" WITH OBJECT OID (EXTRACT(SYS_NC_ROWINFO$,'/REPORT/ID/TEXT()').GETNUMBERVAL())ASSELECT xmlelement("REPORT",xmlforest(r.region_id AS "ID",'DEPT_REPORT' AS "REPORT_NAME", 'Test Report DEPT' as "TITLE", '100%' as "WIDTH", 0 as "BORDER"), xmlelement("BLOCK",XMLATTRIBUTES(1 AS "id", '65%' as "width", 1 as "colspan",0 as "border" ),xmlforest('Region Info' TITLE), XMLelement("ROWSET",XMLATTRIBUTES('100%' as "width",1 as "border" ),xmlforest('--' TITLE), XMLELEMENT("ROW", XMLCOLATTVAL ( R.REGION_id,'Region ID' as "text")), XMLELEMENT("ROW", XMLCOLATTVAL (R.REGION_NAME,'Region Name' as "text")))), xmlelement("BLOCK",XMLATTRIBUTES(2 AS "id", '100%' as "width", 2 as "colspan",1 as "border" ), xmlforest('Countries Info' TITLE), XMLelement("ROWSET",XMLATTRIBUTES('100%' as "width",1 as "border" ),xmlforest('having employees' TITLE), XMLELEMENT("ROW_TITLE", xmlForest ('Country ID' as "TEXT", 'Country Name' as "TEXT",'Flag' as "TEXT")), ( select xmlagg(XMLELEMENT("ROW",XMLCOLATTVAL (C.COUNTRY_ID,c.country_name ))) FROM hr.COUNTRIES C where C.REGION_id=r.region_id))))from hr.REGIONS r
22© Copyright Trivadis SA
DBMS_XMLGEN Package
DBMS_XMLGEN generates XML documents from any SQL query
It returns the XML document as a CLOB or XMLType
Provides a "fetch" interface very useful for pagination requirements in Web applications– setMaxRows(): specifies the maximum of rows returned by the
Web Application– SetSkipRows(): specifies the amount of rows to skip
SELECT dbms_xmlgen.getxml('SELECT * FROM emp WHERE ename=''WARD''')FROM dual
SELECT dbms_xmlgen.getxml('SELECT * FROM emp WHERE ename=''WARD''')FROM dual
23© Copyright Trivadis SA
DBMS_XMLGEN Package
"fetch" interface– setNullHandling(): if set to 1, the resulting XML document
contains empty elements when a value is NULL. The becomes very handy for reports generated out of the resulting XML document
– getNumRowsProcessed(): returns the number of rows processed. This count does not include the number of rows skipped before generating the XML
– setConvertSpecialChars(): to replace characters such as <, > etc.. by their codes (<, > etc..)
The "fetch" interface is very performant
24© Copyright Trivadis SA
DBMS_XMLGEN Package
FUNCTION xtes(p_block IN NUMBER, p_max_rows IN NUMBER, p_statement VARCHAR2) RETURN xmltype
IS v_return xmltype; qryCtx dbms_xmlgen.ctxHandle;BEGIN qryCtx := dbms_xmlgen.newContext(p_statement); dbms_xmlgen.setrowsettag(qryctx,'My_Query'); dbms_xmlgen.setMaxRows(qryCtx, p_max_rows); dbms_xmlgen.setskiprows(qryCtx,(p_block-1)*p_max_rows); dbms_xmlgen.setnullhandling(qryctx, 1); v_return := dbms_xmlgen.getXMLTYPE(qryCtx); dbms_xmlgen.closeContext(qryCtx); RETURN v_return;END;
FUNCTION xtes(p_block IN NUMBER, p_max_rows IN NUMBER, p_statement VARCHAR2) RETURN xmltype
IS v_return xmltype; qryCtx dbms_xmlgen.ctxHandle;BEGIN qryCtx := dbms_xmlgen.newContext(p_statement); dbms_xmlgen.setrowsettag(qryctx,'My_Query'); dbms_xmlgen.setMaxRows(qryCtx, p_max_rows); dbms_xmlgen.setskiprows(qryCtx,(p_block-1)*p_max_rows); dbms_xmlgen.setnullhandling(qryctx, 1); v_return := dbms_xmlgen.getXMLTYPE(qryCtx); dbms_xmlgen.closeContext(qryCtx); RETURN v_return;END;
25© Copyright Trivadis SA
Generate HTML Output with XMLTransform
Create PROCEDURE TESTDEP ascursor cv1 isSELECT XMLTRANSFORM ( (SELECT XMLELEMENT ("set", dbms_xmlgen.getxmltype('select * from department') , SYS.XMLTYPE.createxml ('<session_infos> <name>Test Report Techevent</name> <created>'||to_char(sysdate,'DD-MON-YYYY
HH:MI:SS')||'</created> <by>Marc Lieber</by></session_infos>') ) FROM DUAL), xdburitype ('/home/SCOTT/xsl/dep.xslt').getxml () ).getclobval () AS RESULT FROM DUAL;begin for rv1 in cv1 loop htp.p(rv1.result); end loop;end;
Create PROCEDURE TESTDEP ascursor cv1 isSELECT XMLTRANSFORM ( (SELECT XMLELEMENT ("set", dbms_xmlgen.getxmltype('select * from department') , SYS.XMLTYPE.createxml ('<session_infos> <name>Test Report Techevent</name> <created>'||to_char(sysdate,'DD-MON-YYYY
HH:MI:SS')||'</created> <by>Marc Lieber</by></session_infos>') ) FROM DUAL), xdburitype ('/home/SCOTT/xsl/dep.xslt').getxml () ).getclobval () AS RESULT FROM DUAL;begin for rv1 in cv1 loop htp.p(rv1.result); end loop;end;
26© Copyright Trivadis SA
Agenda
01 – History of the framework
02 – Oracle XML overview
03 – TVD-XORA Working environment
04 – TVD-XORA Demo
05 – What’s next
27© Copyright Trivadis SA
Web reporting Application
This XDB based Web Reporting framework generates public reports as well as maintenance reports
The demo application is based on this technology and uses the Oracle HR schema to demonstrate the use of such an application
The reports/forms technical descriptions as well as the documentation are stored in schema-validated XML documents
28© Copyright Trivadis SA
Parameter Screen and Menu
29© Copyright Trivadis SA
Generated HTML output
30© Copyright Trivadis SA
HTML Maintenance Form
31© Copyright Trivadis SA
HTML Report with Blocks
32© Copyright Trivadis SA
Excel output
33© Copyright Trivadis SA
PDF Output
34© Copyright Trivadis SA
Master Detail HTML Output
35© Copyright Trivadis SA
HTML Output based on XMLType Views
36© Copyright Trivadis SA
SVG Graphs
37© Copyright Trivadis SA
Web reporting : concept
XMLEditor
( XMLSpy, Jdeveloper,Others, ... )
FormsReportsMenuLOV
PopupOthers
FormsReportsMenuLOV
PopupOthers
Runtime Processor
(Package PL/SQL)
PL/SQL HTP
JSP
Metadata XML
Cocoon
Client
XMLStylesheets
XMLStylesheets
Document ValidationXML Schema
Document ValidationXML Schema
Oracle DB
Relational
Tables, views
Extract
Data
XML Result Set
CLOB
38© Copyright Trivadis SA
FormsReportsMenuLOV
PopupOthers
FormsReportsMenuLOV
PopupOthers
XDB Application : transformation
Stylesheet 1Stylesheet 1
FormsReportsMenuLOV
PopupOthers
FormsReportsMenuLOV
PopupOthers
XML Document for HR Departments Report
XML Document for HR Employees Report
Stylesheet 2Stylesheet 2
Stylesheet 4Stylesheet 4
Stylesheet 3Stylesheet 3
Stylesheet 5Stylesheet 5
Maintance FormMaintance Form
EXCEL ReportEXCEL Report
Select StatementSelect Statement
DocumentationDocumentation
HTML REPORTHTML REPORT
Stylesheet 6Stylesheet 6PDFPDF
39© Copyright Trivadis SA
Web reporting Application
The development and maintenance of the XML reporting documents is done with XMLSpy
Each document is validated against an XML Schema (Report.xsd) inside and outside the database
The load process of the XML documents in the XMLType table is done via FTP– Note: XMLSpy version 5.0 has the option to directly read or
update XML documents stored in XMLType tables
A PL/SQL package generates the reports, forms and SELECT statements based on the information contained in the XML document
40© Copyright Trivadis SA
Web Reporting : XML Schema
The report.xsd XML schema describes the structure, content and semantics of all Reporting XML documents
Special attributes in the XML schema are interpreted as instructions by ORACLE XML DB
<xs:element name="report" type="ReportingType" xdb:defaultTable="XML_REPORTS" xdb:tableProps="tablespace users"/>
<xs:element name="report" type="ReportingType" xdb:defaultTable="XML_REPORTS" xdb:tableProps="tablespace users"/>
41© Copyright Trivadis SA
Web reporting : implementation
Application ServerApache
+Mod PLSQL
PL/SQL Package
Public Interface+
LDAP Security
PL/SQL Package
Runtime Processor
XMLType Table
XML Metadata
XMLType Table
XML Metadata
XMLType Table
Stylesheets
XMLType Table
Stylesheets
CLOB
+ Mime Type
Oracle9i Release 2Client
HTML, PDF, etc..
42© Copyright Trivadis SA
Web reporting : Database storage
The stylesheets are stored in a relational table: TVDXORA_XSLT– Only one column of this table is of type XMLType
The tree menu is stored in a separate XMLType table: XML_MENU
The reports in an XMLType schema-validated table: XML_REPORTS
BEGIN dbms_xmlschema.registerSchema('report.xsd', getDocument('report.xsd'),TRUE, TRUE, FALSE, FALSE);END;/
CREATE TABLE xml_reports OF XMLType XMLSCHEMA "report.xsd" ELEMENT "report";
ALTER TABLE xml_reports ADD CONSTRAINT reference_is_unqiue -- UNIQUE (extractValue('/report/Reference'))UNIQUE (xmldata."Reference");
BEGIN dbms_xmlschema.registerSchema('report.xsd', getDocument('report.xsd'),TRUE, TRUE, FALSE, FALSE);END;/
CREATE TABLE xml_reports OF XMLType XMLSCHEMA "report.xsd" ELEMENT "report";
ALTER TABLE xml_reports ADD CONSTRAINT reference_is_unqiue -- UNIQUE (extractValue('/report/Reference'))UNIQUE (xmldata."Reference");
43© Copyright Trivadis SA
The TVD-XORA Application
Run ReportRun Report
HTMLHTML
ExcelExcel
PDFPDF
DocumentationDocumentation
View select statement
View select statement
XMLXML
WordWord
SVG GraphicsSVG Graphics
ParameterScreen Form
InsertsUpdatesDeletes
PopupPopup
44© Copyright Trivadis SA
Views and Instead of triggers
The select statement use to generate the XML result set is generally based on a VIEW associated with an INSTEAD OF TRIGGER.
There is still some HTML coding in theses view, but future releases will remove it.
The HTML error messages are defined in the Instead of trigger
SELECT job_id, 'lt-;A HREF="HR_report.show_form?
p_rpt_name=RPT_JOBS&p_request=show&p_arg_old=‚ || '&p_arg_names=JOB_ID&p_arg_values='|| j.job_id|| '"><b>'|| j.job_id|| '</b></A>', job_title, min_salary, max_salary, TO_DATE ('01-01-2003', 'dd-mm-yyyy') FROM hr.jobs j
SELECT job_id, 'lt-;A HREF="HR_report.show_form?
p_rpt_name=RPT_JOBS&p_request=show&p_arg_old=‚ || '&p_arg_names=JOB_ID&p_arg_values='|| j.job_id|| '"><b>'|| j.job_id|| '</b></A>', job_title, min_salary, max_salary, TO_DATE ('01-01-2003', 'dd-mm-yyyy') FROM hr.jobs j
45© Copyright Trivadis SA
The XML Result set
XML Resultset
XML Resultset
SELECT STATEMENTSELECT STATEMENT
List of parameters(Block #, output type,report Name, etc ....
List of parameters(Block #, output type,report Name, etc ....
Stylesheet Stylesheet
Transform
DBMS_XMLGENGenerated XML Document
DBMS_XMLGENGenerated XML Document
Aggregate with SQLXFunctions
OutputHTML, Excel
, etc ..
OutputHTML, Excel
, etc ..
46© Copyright Trivadis SA
SQLX aggregation SELECT XMLELEMENT ("set", dbms_xmlgen.getxmltype( 'select * from department') , XMLTYPE.createxml ('<session_infos> <name>Test Report Workshop</name> <created>'|| to_char(sysdate,'DD-MON-YYYY') ||'</created> <by>Marc Lieber</by> </session_infos>‚) ).getClobval() xml
FROM DUAL;
SELECT XMLELEMENT ("set", dbms_xmlgen.getxmltype( 'select * from department') , XMLTYPE.createxml ('<session_infos> <name>Test Report Workshop</name> <created>'|| to_char(sysdate,'DD-MON-YYYY') ||'</created> <by>Marc Lieber</by> </session_infos>‚) ).getClobval() xml
FROM DUAL;
<set><ROWSET> <ROW> <DEPTNO>10</DEPTNO> <DNAME>ACCOUNTING</DNAME> <LOC>NEW YORK</LOC> <EMPLOYEES> <EMP_T> <EMPNO>7782</EMPNO> <ENAME>CLARK</ENAME> <JOB>MANAGER</JOB> <SAL>2450</SAL>
<HIREDATE>09-JUN-81</HIREDATE>
<MANAGER> <EMPNO>7839</EMPNO> <ENAME>KING</ENAME> <JOB>PRESIDENT</JOB> </MANAGER> </EMP_T></ROWSET><session_infos> <name>Test Report
Workshop</name> <created>24-SEP-2003</created> <by>Marc Lieber</by></session_infos></set>
<set><ROWSET> <ROW> <DEPTNO>10</DEPTNO> <DNAME>ACCOUNTING</DNAME> <LOC>NEW YORK</LOC> <EMPLOYEES> <EMP_T> <EMPNO>7782</EMPNO> <ENAME>CLARK</ENAME> <JOB>MANAGER</JOB> <SAL>2450</SAL>
<HIREDATE>09-JUN-81</HIREDATE>
<MANAGER> <EMPNO>7839</EMPNO> <ENAME>KING</ENAME> <JOB>PRESIDENT</JOB> </MANAGER> </EMP_T></ROWSET><session_infos> <name>Test Report
Workshop</name> <created>24-SEP-2003</created> <by>Marc Lieber</by></session_infos></set>
47© Copyright Trivadis SA
TVD-XORA Application: Stylesheets
The stylesheet s01_select.xslt generates the SQL SELECT statement
The SELECT statement sent do DBMS_XMLGEN is only keeping the selected options in the where clause for better performances 1 COLMN HTML Y department_link P1 2 COLMN PDF Y department_id P2 3 COLMN ALL N department_name P3 4 COLMN ALL Y manager_name P4 5 COLMN ALL Y location_id P5 6 COLMN ALL Y street_address P6 7 COLMN ALL Y postal_code P7 8 COLMN ALL Y city P8 9 COLMN HTML/PDF Y state_province P9 10 COLMN ALL Y Country_name P10 11 COLMN HTML/PDF Y region_name P11 12 FROM V_DEPARTMENTS A 13 WHERE N department_id LIKE :department_id 14 WHERE N upper(department_name) LIKE
upper(:department_name) 15 WHERE N upper(region_name) LIKE upper(:region_name) 16 WHERE N upper(country_name) LIKE upper(:country_name) 17 WHERE N manager_name LIKE :manager_name 18 WHERE N location_id LIKE :location_id 19 ORDERBY :sort :ascend
1 COLMN HTML Y department_link P1 2 COLMN PDF Y department_id P2 3 COLMN ALL N department_name P3 4 COLMN ALL Y manager_name P4 5 COLMN ALL Y location_id P5 6 COLMN ALL Y street_address P6 7 COLMN ALL Y postal_code P7 8 COLMN ALL Y city P8 9 COLMN HTML/PDF Y state_province P9 10 COLMN ALL Y Country_name P10 11 COLMN HTML/PDF Y region_name P11 12 FROM V_DEPARTMENTS A 13 WHERE N department_id LIKE :department_id 14 WHERE N upper(department_name) LIKE
upper(:department_name) 15 WHERE N upper(region_name) LIKE upper(:region_name) 16 WHERE N upper(country_name) LIKE upper(:country_name) 17 WHERE N manager_name LIKE :manager_name 18 WHERE N location_id LIKE :location_id 19 ORDERBY :sort :ascend
SELECT department_link P1 , department_name P3 , manager_name P4 , location_id P5 , street_address P6 , postal_code P7 , city P8 , state_province P9 , Country_name P10 , region_name P11 FROM V_DEPARTMENTS A WHERE location_id LIKE '1100' ORDER BY DEPARTMENT_ID DESC
SELECT department_link P1 , department_name P3 , manager_name P4 , location_id P5 , street_address P6 , postal_code P7 , city P8 , state_province P9 , Country_name P10 , region_name P11 FROM V_DEPARTMENTS A WHERE location_id LIKE '1100' ORDER BY DEPARTMENT_ID DESC
XML generated SELECT Resulting SELECT
48© Copyright Trivadis SA
TVD-XORA Application Summary
The application is easy to implement– About 20 Stylesheets– 2 XML Schemas– A central PLSQL packages in 1 DB Schema export and import
possible
It’s a simple and fast way to generate forms and reports for reporting environments– Only XMLSpy knowledge and some SQL knowledge is required
to design reports
The application documentation is automatically generated– Interesting for validated applications
Better performances when compared to WEBDB/Portal
49© Copyright Trivadis SA
Agenda
01 – History of the framework
02 – Oracle XML overview
03 – TVD-XORA Working environment
04 – TVD-XORA Demo
05 – What’s next ?
50© Copyright Trivadis SA
TVD-XORA Success story
ROCHE– Meanwhile we have implemented this Framework in three
new projects– More XML Based projects are in the pipeline
- XDB + Mod/PLSQL- XDB + Cocoon
ORANGE Lausanne – An application based on this framwork is now running
productive
Our experience shows that Oracle XML DB is a robust platform for building XML applications
51© Copyright Trivadis SA
Planned improvements
Possibility to access the application with JSP instead of mod_plsql– The final stylesheet transformation will take place on the
application server
COCOON Integration with XDB– It‘s a XML based technology
New stylesheets,documentation, better naming conventions, etc ... but still maintaining back compatiblity