1 XML in Reality: Software AG Thursday, January 07, 2016 “The XML Company” Steve Hamby IT...
-
Upload
allyson-casey -
Category
Documents
-
view
213 -
download
0
Transcript of 1 XML in Reality: Software AG Thursday, January 07, 2016 “The XML Company” Steve Hamby IT...
1
XML in Reality:
Software AG Friday, April 21, 2023
“The XML Company” Steve Hamby
IT Architect
404-441-4498
A Case Study AnalysisA Case Study Analysis
2
Agenda
XML Uses and Case Studies
XSL
Java and XML
Native vs. XML-Enabled
Software AG’s Tamino
Accessing Tamino
Summary
3
providing the leading software platform to enable companies to transactbusiness, integrate applications and to collaborate over the internet by
leveraging XML.
4
XML Leadership from Software AG
Michael Champion, DOM Working Group http://www.w3.org/TR/DOM-Level-2-Core
Michael Kay, XSL Working Group Widely published author and expert on XSL and XSLT Creator of SAXON – http://users.iclway.co.uk/mhkay/
Jonathan Robie, Query Working Group model http://www.w3.org/TR/query-data
Juliane Harbarth, XSL Working Group
Dr. Dietmar Gaerner, XML Standards & DOM Working Groups
Nigel Hutchison, Tamino Chief Architect
5
Why XML?
XML is the eXtensible Markup Language
XML is simple and easy to understand and use
XML is dynamic and can change with data
XML makes data self-describing
XML is a user-driven standard
XML is platform and application independent
XML is application and human readable
XML embraces all types of data
XML is at the heart of the web
6
XML: Separation of Document Components
TextText
PicturesPictures
ContentContent
ABCABC
PresentationPresentationStructureStructure
7
XML is eXtensible
<?xml version=“1.0”?><weather-report> <date>November 28, 2001</date> <time>9am</time> <area> <city>San Francisco</city> <country>USA</country> </area> <measurements> <skies>sunny</skies> <temp scale=“C”>22</temp> </measurements> </weather-report>
8
XML is eXtensible
<?xml version=“1.0”?><weather-report> <date>November 28, 2001</date> <time>9am</time> <area> <city>San Francisco</city> <state>California</state> <country>USA</country> </area> <measurements> <skies>sunny</skies> <temp scale=“C”>22</temp> </measurements> </weather-report>
9
XML Uses – XML Importance
Document / Content Management
Internet and Wireless
Portals
Application Integration
Publishing
Data Exchange
Electronic Business
10
XML Uses – Document / Content Management
Content Sources – Standard
Process Oriented QA / Approval
Content Access and Security
Versioning and Control
Repurposing Content
Document or Content based
WebDAV
11
memIQ
Offers personal internet serviceLegal documents, Bank statements, Tax receipts, etcDelivers documents electronically via powerful query GUIStrong encryption and security
Architecture built for performance and fail-over Redundant hardware (switches, firewalls, servers, etc)Redundant BEA Web Logic servers accessing redundant
Tamino databases “Tamino … is the only vehicle that has shown the ability to
accommodate very demanding, high volume XML retrieval applications.” – IDC on memIQ architecture
12
memIQ
13
Lear
Lear is the fifth largest supplier of vehicle parts and the largest supplier Lear is the fifth largest supplier of vehicle parts and the largest supplier of car seats and car seat safety equipmentof car seats and car seat safety equipment
14
Lear
Record
Archive
Manage:
Manufacturing
Testing
Assembly Data for Car Seats Which Include:Texts
Statistics
Diagrams
Images
15
Lear Requirements
Legal Requirement
Speed of Data Access
Supply Chain
Ease of Use
Accessibility
Types of Data Supported
Multi-Language
Quick Implementation – Less than 6 weeks & 3 employees
16
What is the Lexign Trusted Content Alliance?
A true end-to-end solution Comprehensive features, including:
XML forms Signing Process Automation Content Management Certificate Authentication
Best-of-breed technologies, including: Zions Bancorp: ThinkXML, Digital Signature Trust, eLock, IcomExpress Authentidate: Date/time stamping, version managment Software AG: The market leading XML Server
The Trusted Content Alliance will save the world!
17
Lexign Trusted Content Alliance
Ensure that employees follow pre-defined company procedures designed to comply with regulations
Secure, restrict, and control access to documents by staff and public
Improve security by authenticating users while verifying that data has not been altered
Digitally sign and authorize transactions online Create clear audit trails for compliance documentation Five technologies all built on Tamino
18
Trusted Content Alliance
E-Government Portal
E-Form
Tamino
X_________
a 14:40.102 08-08-2001
DigitalSignature
Timestamp
Repository
Workflow
EntireXIntegration
Dept Dept DeptDept Dept Dept
19
XML Uses – Internet and Wireless
HTML Maintenance
Personalization
WML
VoiceXML
Web Content Sources
Reuse
20
DaimlerChrysler FleetBoard
Existing customer system
Links the existing customer system via XML
Browser
WAP
The access via browser enables each registered users to access relevant data.
All information is attainable via WAP independent of location. (mobile phone)
Internet
Logistical information loaded to Tamino for access from WAP client
21
XML Uses – Portals
Content Source – Disparate Systems Personalization Wireless Access Security Categorization Search Complex Links Reuse Across Enterprise, Intranet, and Extranet
22
Content Management – European Parliament
Challenge : Management of Tons of legislative documents11 .. soon15 languagesShort delivery timeframesReuse of existing information
Problem : Gathering existing Information into 1 document Spread in multiple locations / DBsContent changing continuously “Not easily reusable because hierarchies are stored in
RDBMSs”
23
Content Management – European Parliament
PV ReportPV ReportPV ReportPV Report XQuery
Java XML
XQuery
HTML
WAP
RTF
…
XML
DB
24
Corechange Portal
Access to other systems
Solution that would work across multiple platforms
Access from multiple devices
Better management of metadata
Security of content
25
WebBrowser
B2BApplication
Mobile/Ubiquitous
DesktopViewer
Content Management and Presentation Services
Personalization Content WorkflowProfiling CategorizationDynamic Publishing SubscriptionPortal Services
Security SearchSystems Management CategorizationTransaction Management Globalization
Portal SystemsManagement
Metadata& ContentRepository
Unstructured Data ERPCRM Mainframe Data
Corechange Portal
26
Aylesbury Vale District CouncilLocal Authority Implementing e-Government The project
Front End Intranet Customer Management
Hierarchy-Controlled Workflow
Legacy Integration
XML content
Component Based Architecture
Web publishing & page creation
Customer Management
Security
Storage
Delivery
27
XML Uses – Application Integration
EAI “Adapters”
Web Services
XML-based Applications
Peer-To-Peer Collaboration
XML “Log“
audit trail
what is being used
28
XML Uses – Web Services
Model for creating dynamic distributed applications
Based on emerging standards using the Web infrastructure (XML, SOAP, WSDL, UDDI)
Publishing of Application Functionality through Internet Interfaces
Examples
Credit card validation
Hotel reservation
Credit checkBuyer
Internet
B2B Hub
Supplier
ACMESupplies
Get Q
uo
teR
ese
rvatio
n P
urc
ha
seO
rde
r
XML
29
California State Board Of EqualizationEnables Government to Accept Sales and Use Tax Returns Online
Mission: Allow businesses to use real-time Internet technology to file their Sales and Use Tax returns and arrange for payment of tax.
Solution:Implement Tamino native XML database as a middle tier component to store Sales and Use Tax returns filed online from business owners. Result:- Facilitates e-government initiatives- Allows extending current mainframe system to the Internet- Reduced data entry, administration and errors
30
XML Uses – Publishing
Electronic Forms
Many Formats
XSL:FO
31
MCIWorldComm
Publish telephone bills to multiple formats (PDF, Word, print, etc)
Use existing data
Allow data to be queried via text searching
Allow access from multiple devices
Also use for press articles and testimonials for sales force
32
MCI WorldComm Tamino
• Internet
• Wireless• Voice (future)
AdabasNatural
JavaFront-endApplicationDevelopedIn Bolero
33
XML Uses – Data Exchange
Extensible - Easy Maintenance
Routing Rules as XML Metadata
Exchange Different Formats
Access to Data
Audit Trail
34
About Leeds & Holbeck
Leeds & Holbeck Building Society
Leeds & Holbeck Building Society
Established in 1875
Over half million members
Over £3 billion pounds assets
62 branches throughout the UK
Rated as one of the Top 10 building societies.
35
Why XML?Solid foundation for e-Business
Embraces and utilizes industry standards for both storing and transferring data
Taps into emerging channels to business
XML based integration provides a sound foundation on which future developments can be based to accommodate the changes that are envisaged for the future.
36
Features of the solution:
Exploits existing investment
Delivers new channels for customers
Establishes a platform for growth
37
Mortgage Processing Requirements
Deploy a system over the Internet
Quoteon different types of mortgages
Provide a “mortgage decision over the Internet”
38
XML Based Approach
Oracle
MTS
VBVB VB
Browser Digital TV PDAs / Mobiles
XML
Intermediaries
AssureWeb
OtherPortals
MISYS
Customer
Search Engines/Agents
IFA
HTML WML
e-Branch
The way customers locate information has changed
Need a more flexible extensible approach
Need to interact with customers and other organizations in different ways
Need to transform data to the appropriate display.
39
XML Uses – Electronic Business
CMS, eCatalogs, and Publishing
Data Integration and Exchange
Search
Internet and Wireless
Ease of maintenance
40
Customer
1. selects articles2. enters customer information
3. checks availability
4. authorization inquiry
7. order confirmation by E-mail
5. orders articles
6. credit card charge
8. invoicing information
9. invoice
Südkraft shipping, storage
credit card payment system
BOCinvoices,refunds
Order transaction
41
Agenda
XML Uses and Case Studies
XSL
Java and XML
Native vs. XML-Enabled
Software AG’s Tamino
Accessing Tamino
Summary
42
XSL
eXtensible Stylesheet Language
Consists of:
Transformation (XSLT)
Formatting Objects (XSL:FO)
Processing oriented
Either linked or called
Anatomy of an XSL Style Sheets
XSL Style Sheet
XML Tree
<xsl:template match="pattern">
</xsl:template>
<xsl:template match="pattern">
</xsl:template>
1. Pattern matching
HTML Tagsmore Style Sheet processing
2. Formatting
XSL Syntax
<xsl:apply-templates> Process children of current node
<xsl:apply-templates select=".."> Process specified nodes
<xsl:for-each select=".."> Iterative processing
<xsl:if test="expression"> Conditional processing
<xsl:choose> Decide structure
<xsl:when test="expr"> Element of Decide structure
<xsl:otherwise> "else" processing
<xsl:sort> Process child nodes in sorted order
<xsl:value-of select=".."> Insert text
Style Sheet Processing
XML
XSL Style Sheet
Style SheetProcessor
HTML Page
XSL Style Sheet
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"><xsl:template match="/"> <HTML> <HEAD><TITLE>Weather Report</TITLE></HEAD> <BODY><H1>Weather Report</H1> <xsl:for-each select="//Weather-Report"> <P><xsl:apply-templates/></P> </xsl:for-each> </BODY> </HTML></xsl:template><xsl:template match=„temperature"> <xsl:value-of /><BR/></xsl:template></xsl:stylesheet>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"><xsl:template match="/"> <HTML> <HEAD><TITLE>Weather Report</TITLE></HEAD> <BODY><H1>Weather Report</H1> <xsl:for-each select="//Weather-Report"> <P><xsl:apply-templates/></P> </xsl:for-each> </BODY> </HTML></xsl:template><xsl:template match=„temperature"> <xsl:value-of /><BR/></xsl:template></xsl:stylesheet>
47
XSL as Part of an XML Application
DTD
HTMLPage
Style Sheet Processor
StyleSheet
Document Tree
Application
<?xml?><weather-report> <date>September 10, 1999</date> <time>08:00 </time> <area> <city>Darmstadt</city> <temperature scale=“C”>25</temperature>
Parser
48
XSL:FO
2nd part of XSL
XML application
Describes how XML will look
Defines four basic area types
1. regions
2. block areas
3. line areas
4. inline areas
49
XSL:FO Formatting Objects
fo:basic-link fo:bidi-override fo:block fo:block-container fo:character fo:color-profile fo:conditional-page-master-
reference fo:declarations fo:external-graphic fo:float fo:flow fo:footnote fo:footnote-body fo:initial-property-set fo:inline fo:inline-container fo:instream-foreign-object fo:layout-master-set fo:leader
fo:repeatable-page-master-alternatives
fo:repeatable-page-master-reference
fo:retrieve-marker fo:root fo:simple-page-master fo:single-page-master-reference fo:static-content fo:table fo:table-and-caption fo:table-body fo:table-caption fo:table-cell fo:table-column fo:table-footer fo:table-header fo:table-row fo:title fo:wrapper
fo:list-block fo:list-item fo:list-item-body fo:list-item-label fo:marker fo:multi-case
fo:multi-properties fo:multi-property-set fo:multi-switch fo:multi-toggle fo:page-number fo:page-number-citation fo:page-sequence fo:page-sequence-master fo:region-after fo:region-before fo:region-bodyfo:region-end fo:region-start
50
XSL:FO Example
<?xml version="1.0"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="only"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-name="only"> <fo:flow flow-name="xsl-region-body"> <fo:block font-size="20pt" font-family="serif" line-height="30pt"> Hydrogen </fo:block> <fo:block font-size="20pt" font-family="serif" line-height="30pt" > Helium </fo:block> </fo:flow> </fo:page-sequence> </fo:root>
51
Agenda
XML Uses and Case Studies
XSL
Java and XML
Native vs. XML-Enabled
Software AG’s Tamino
Accessing Tamino
Summary
52
Does XML compete with Java? NO!!!
“Java is for portable code, XML is for portable data”
Jon Bosak of Sun was one of the primary authors of the XML 1.0 specification
The majority of XML applications are written in Java
Sun’s ONE Web services initiative is the Java counterpart to Microsoft .NET
XML tools will be baked in to the core of JDK 1.4
53
Java and XML – Similarities
Designed for the Internet
Simplicity
Portability
Flexibility
Open development process
54
XML Buzzwords – the JAX Pack
“JAXP (Processing): DOM, SAX, XSLT and schema processing
JAXM (Messaging): SOAP and others
JAXB (Data Binding): Generating Java classes from XML schemas/DTDs
JAXR (Registry): UDDI and ebXML registries
JAXRPC (Remote Procedure Calls) Java RPCs using XML
55
XML in JDK 1.4 “Merlin”
“JAX Pack” tools are currently separate products
XML support will be bundled in JDK itself (in rt.jar?)
JAXP – parser, SAX, DOM, XSLT
JAXB – data binding tool
Pluggability layer
User can select from any conformant parser or transformer implementing the abstract API
JDOM will not be bundled with Merlin
561
Document Tree
JAXP Programming – SAX and DOM
Parser
Docu-ment DTD
Applicationimplements
DocumentHandler
endDocument
startDocument
endElement
endElement
startElement
startElement
DOM SAX
571
Prescod
PrenticeHall
<?xml version="1.0"?><books> <book> <title>The XML Handbook</title> <author>Goldfarb</author> <author>Prescod</author> <publisher>Prentice Hall</publisher> <pages>688</pages> <isbn>0130811521</isbn> <price currency="USD">44.95</price>
</book> <book> <title>XML Design</title> <author>Spencer</author> <publisher>Wrox Press</publisher>
...</book>
</books>
The Document Object Model
XML DocumentStructure
The XMLHandbook Goldfarb 655
books
book
publisher pages isbnauthortitle
...
58
The Document Object Model
Provides a standard interface for access to and manipulation of XML structures.
Represents documents in the form of a hierarchy of nodes. Is platform- and programming-language-neutral
Is a recommendation of the W3C (October 1, 1998)
Is implemented by many parsers
591
DOM - Structure Model
Document
Node
NodeList
Element
Prescod
book
PrenticeHall
The XMLHandbook Goldfarb 655
books
book
publisher pages isbnauthortitle
...
60
DOM Methods for Navigation
firstChild lastChild
nextSiblingpreviousSibling
parentNode
getElementsByTagNamechildNodes
(length, item())
61
DOM Methods for Manipulation
appendChildinsertBeforereplaceChildremoveChild
createElementcreateAttributecreateTextNode
621
SAX - Simple API for XML
Docu-ment DTD
Applicationimplements
DocumentHandler
endDocument
startDocument
endElement
endElement
startElement
startElement
Parser
63
SAX - Simple API for XML
Event-driven parsing model
"Don't call SAX, the parser calls you."
Developed by the members of the XML-DEV Mailing List
Released on May 11, 1998
Supported by many parsers and now made official by Sun
64
DOM and SAX Design Patterns
DOM
Creating a parser instance
Parsing the whole document
Processing the DOM tree
SAX
Creating a parser instance
Registrating event handlers with the parser
Parser calls the event handler during parsing
651
“Data Binding” – Alternative to SAX or DOM
Uses XML DTD or Schema to generate code that automatically handles data conforming to those constraints
Supported by numerous tools
Optimal for simple “data” formats – insulates programmers from XML syntax
Doesn’t work well for “document” formats with recursive elements, mixed content, etc.
66
JAXB
Starts with an XML Schema
Generates Java classes automatically that
Parse
Load
Validate data corresponding to the schema.
Code formerly required to parse XML text into meaningful objects not required.
Application focuses on semantics represented by the data, not the syntax.
67
Other Java APIs for XML
JDOM
Originally independent effort, now JCP activity
DOM is generic, JDOM is Java-specific
DOM defines interfaces, JDOM classes
Main focus is on convenience for user
dom4j
Main focus is on lightweight implementation
Defines interfaces, not classes
Supports more W3C specs (XPath, XSD)
68
Agenda
XML Uses and Case Studies
XSL
Java and XML
Native vs. XML-Enabled
Software AG’s Tamino
Accessing Tamino
Summary
69
What is an XML Server ?
a server offering services to
store, manage, publish and exchange
XML documents
70
EJB/COM+ / CORBA
Message Middleware
The Need For A Complete XML Platform
SQLRDBMS
Remote applications
NativeXML DatabaseXML to SQL
Mapping
XML to AppMapping
Web-Based XML Applications
Web Server
Machines Humans
Core Transaction
Systems
71
Tamino – The XML Server
Tamino Database
X-Node
X-Tension
X-Application / XML Tools
Web Server
Machines Humans
SQLDBMS
Remote applications
Core Transaction
Systems
72
Native XML Database Requirements
XML Storage ModelPhysically store data compatible with XML structure
XML for Database DefinitionImport DTD or Schema to define the database structure
Dynamic Format EvolutionEasy to change database structure as schema evolves
XPath for QueriesXPath supported as XML Query Language
DOM API SupportDOM API for data access and manipulation
Standards BasedAdherence to all applicable standards
73
Native XML vs. XML-Enabled RDBMS
Ease of use and setup with no “hidden costs” Advanced query and indexing capabilities
Boolean and relational operators vs. no boolean or predicate expressions
Full XPath support with Structure Indexing vs. limited XPath with text indexing only; no structure indexing
XQuery support Performance Fully supports Unicode Support for recursive schemas Stylesheet transformations within native platform
74
Native XML vs. XML-Enabled RDBMS
Few RDBMS’s have support for XML standards like XPath or XML Schema
Normalizing data is expensive and cannot handle very complex structures
Data structure and content integrity
Overhead of continuous bi-directional data formatting
The XML mapping information is stored externally - potential integrity exposure
Performance – Tamino is as much as 50X faster than leading RDBMS’s in recent 3rd party benchmarks
Benefits of implementing Native XML
Speed
Rapid development
Easy learning curve
Flexibility
Minimal Risk – Architecturally & Technically
Better position to respond to external challenges
Efficiency
Leverages existing applications and infrastructure
Reduces Total Cost of Ownership
76
Agenda
XML Uses and Case Studies
XSL
Java and XML
Native vs. XML-Enabled
Software AG’s Tamino
Accessing Tamino
Summary
77
Tamino Business Case
Business Issues and Requirements Store, Publish, & Exchange Electronic Documents
Single Content, Multiple Formats
Information Exchange
B2B, EAI, EDI
Existing Data Integration
RDBMS
Legacy Applications
Other 85% of Data 100 % pure XML
78
Worldwide Market Leader
16.8%
40.5%
23.3%
19.4%
Other
Software AG
eXcelon Corp.
ComputerAssociates
International
Source IDC 2001
Worldwide XML and Virtual DBMS Market Shareby Vendor, 2000
79
Tamino – Conceptual View
80
Core Services
Storage Service Query Service Full-Text Retrieval Service XML Schema Service X-Tension Service Administration Service Security Service
81
Enabling Services
HTTP Service API Services / EJB Service External Database Service Interactive Service Application Framework Service Tamino WebDAV Service UDDI Service Mobile Synchronization Service Integration with EntireX Service Repository Service Transformation Service XForms Service
82
Architecture
The Complete XML Platform for Electronic Business
83
Software AG Solution – Tamino
Oracle
• Internet• Wireless
AdabasNatural
• COBOL• CICS• OS/390
DB2MS SQLServer
• Lotus Notes• NT• Unix• Linux
• Java• C++• VB
84
EntireX CommunicatorCommunication Broker
EntireX OrchestratorIntegration Broker
EntireX AdaptersAdapter Technology
Entir
eX W
orkb
ench
Leveraging EntireX and Tamino
Integration Services
Tamino server extensions (written in Java, VB, or C++) can hook into EntireX
Open Interfaces to Enterprise Applications
Standardized Adapters for Enterprise Resources
Standardized Business Services (Web Services)
Tamino XML Server
Services Services Services
85
EntireX Orchestrator
TransformationTransformation
RoutingRouting
RulesRules
Web Applications
Web Applications CRMCRM ERPERP LegacyLegacy DatabaseDatabase MiddlewareMiddleware
Repository
AdapterAdapter AdapterAdapter AdapterAdapter AdapterAdapter AdapterAdapter AdapterAdapter
Management
Integration
* via EntireX Communicator
WebSphereWebLogic
BroadVision
WebSphereWebLogic
BroadVision
SiebelVantiveClarify
SiebelVantiveClarify
SAPPoeopleSoftJDEdwards
Oracle
SAPPoeopleSoftJDEdwards
Oracle
CICS, IMS, 3270, 5250
COBOL NaturalVSAM
File, Program
CICS, IMS, 3270, 5250
COBOL NaturalVSAM
File, Program
DB2, OracleSybaseInformix
SQL ServerAdabas
DB2, OracleSybaseInformix
SQL ServerAdabas
MQSeriesSocketCOM*
CORBA*
MQSeriesSocketCOM*
CORBA*
86
Agenda
XML Uses and Case Studies
XSL
Java and XML
Native vs. XML-Enabled
Software AG’s Tamino
Accessing Tamino
Summary
87
DOM API Implementations
Active X C++ and VB
Java
Java Script (Interactive Interface)
Perl
C
88
Tamino DOM API Architecture
Java HTTP APIMicrosoft.XMLHTTP LWPHTTP Layer
DOM DocuverseMicrosoft.XMLDOM XML::DOMDOM Layer
Java
Java Script
Active X Perl
Language Layer
Bolero, Natural,Visual Basic, IE5, C++Application
89
Java API Architecture Overview
Command Invocation
Connection AccessorDOM SAXJDOM
Info Content Query ContentStream Meta-Data Non-XML XML
Object ModelObject Model
Response
Client
Tamino
HTTP XTS (Future)
90
Transaction Management
JTS
JTA
JNDIT
am
ino
EJ
B
AP
I
Tamino API
TaminoServer
EnterpriseJavaBean
DataSource/ Driver
Tamino API Wrapper(1) begin
newConnection()(2)
lookup()(3)
reg
iste
r
(4)
query / insert /update / delete
(5)
commit/rollback(6)
commit/rollback
(7)
com
mit/
rollb
ack
(8)commit/rollback (9)
(10)commit/rollback
91
DOM API
All implementations have the same functionality
Supports transactionality
start session, stop session
rollback and commit
Basis functionality
define, undefine Schema, XML load
insert, delete, update
query
92
DOM API
Advanced functions
insert before, append child* remove-, replace child* *Only available with ISAPI Filter Server Side Update
first, next, last and previous Result Set
get / set NonXml
Diagnose functions
echo, ping
93
Java API Architecture
Extensibility
Conform to new functionality without having to touch given functionality
Provide means so that the API client can add functionality as well
Flexibility
Client accesses Tamino in the way it wants (Stream, DOM, JDOM etc.)
Client defines Parser (SAX, DOM) that should be used
High level object models for access are plugged in (DOM, JDOM, etc.)
Robustness
API provides well defined exception handling
API has to be robust against communication or server problems
API is robust against functional extensions
94
Component Interfaces: Services
TConnection
TLocalTransaction
Connection
TConnectionFactory
TXPath
TXMLMetaDataAccessorTNonXMLObjectAccessor
TXMLObjectAccessorTXMLStreamAccessor
Accessor TXMLObjectIteratorTXMLObject
TNonXMLObject TNonXMLObjectIterator
ObjectModel
TResponseQueryContent
TResponse
Response
TResponseInfoContent
95
General Use Case
Establish Connection
Obtain concrete Accessor from Connection
Use the Connection to set the Local Transaction Mode
Invoke an access operation on the Accessor
Obtain the Response
Commit/Rollback the operation
Use the Connection to set the Auto Commit Mode
Process the Response
96
Coding Example: Javascript
var client=new TaminoClient(databaseURL+'/ino:collection',0);var result= client.query("ino:collection");var nodes;if (result && (nodes=result.nodes())) { for (var i = 0;i< nodes.length;i++) { : }: }
Coding Examples: JavaScript GET Method
<HTML><HEAD></HEAD><BODY><B>HTTP Headers:</B><BR><DIV ID="header"></DIV><P><B>Tamino Response:</B><BR><DIV ID="response"></DIV><script language="JScript"> var method = "GET"; // In all upper case letters var url = http://localhost/tamino/xml/sailing?_xql=/yacht ; var data = null; var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.open(method,url,false); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); xmlhttp.send(data); header.innerText = "HTTP-Status: " + xmlhttp.status + " " + xmlhttp.statusText + "\n\n" + xmlhttp.getAllResponseHeaders(); response.innerText = xmlhttp.responseText;</script></BODY></HTML>
<HTML><HEAD></HEAD><BODY><B>HTTP Headers:</B><BR><DIV ID="header"></DIV><P><B>Tamino Response:</B><BR><DIV ID="response"></DIV><script language="JScript"> var method = "GET"; // In all upper case letters var url = http://localhost/tamino/xml/sailing?_xql=/yacht ; var data = null; var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.open(method,url,false); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); xmlhttp.send(data); header.innerText = "HTTP-Status: " + xmlhttp.status + " " + xmlhttp.statusText + "\n\n" + xmlhttp.getAllResponseHeaders(); response.innerText = xmlhttp.responseText;</script></BODY></HTML>
Coding Examples: XML Data Islands and asp
<XML ID="xmlDoc" SRC="http://.../xml/sailing?_xql=/yacht">
</XML>
<XML ID="xmlDoc" SRC="http://.../xml/sailing?_xql=/yacht">
</XML>
With MSIE 5 XML Data Islands
Var xmlDoc;xmlDoc = new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async = false;xmlDoc.load
("http://.../xml/sailing?_xql=/yacht");
Var xmlDoc;xmlDoc = new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async = false;xmlDoc.load
("http://.../xml/sailing?_xql=/yacht");
With the MS XMLDOM ActiveX Object
99
Jscript Example – MSXMLDOM
<html><head><title>Tamino Example</title></head><body><script language="JScript">var xmlDoc, inoReturnValue, inoMessageLine;var url = "http://www.ebiz1.com/tamino/xml/sailing";var query = "_xql=yacht[name='AQUIVA']";xmlDoc = new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async = false;xmlDoc.load(url + "?" + query);
inoReturnValue = xmlDoc.documentElement. getElementsByTagName("ino:message"). item(0).getAttribute("ino:returnvalue");document.writeln("Tamino Return Value: " + inoReturnValue);</script></body></html>
<html><head><title>Tamino Example</title></head><body><script language="JScript">var xmlDoc, inoReturnValue, inoMessageLine;var url = "http://www.ebiz1.com/tamino/xml/sailing";var query = "_xql=yacht[name='AQUIVA']";xmlDoc = new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async = false;xmlDoc.load(url + "?" + query);
inoReturnValue = xmlDoc.documentElement. getElementsByTagName("ino:message"). item(0).getAttribute("ino:returnvalue");document.writeln("Tamino Return Value: " + inoReturnValue);</script></body></html>
JScript API – Tamino DOM
<html><head><title>All Yachts</title><script src="TaminoLib.js"></script></head><body> <div id="space"><div><script> var myDatabase="http://localhost/tamino/xml/sailing"; var myQuery="/yacht"; var client = new TaminoClient(myDatabase); client.pageSize = 0; var result= client.query(myQuery); if (result.errorNo == "0") { var xqlResult=result.getResult(); if (xqlResult) { var yachts = xqlResult.childNodes; for (i=0;i<yachts.length;i++) { var yacht = yachts.item(i); document.write("Name : " + yacht.getElementsByTagName("name") .item(0).childNodes.item(0).data + "<BR>"); document.write("Type : " + yacht.getElementsByTagName("type") .item(0).childNodes.item(0).data + "<P>"); }} else document.write("No Data Returned"); } else document.write("Error = "+result.errorText);</script></body></html>
<html><head><title>All Yachts</title><script src="TaminoLib.js"></script></head><body> <div id="space"><div><script> var myDatabase="http://localhost/tamino/xml/sailing"; var myQuery="/yacht"; var client = new TaminoClient(myDatabase); client.pageSize = 0; var result= client.query(myQuery); if (result.errorNo == "0") { var xqlResult=result.getResult(); if (xqlResult) { var yachts = xqlResult.childNodes; for (i=0;i<yachts.length;i++) { var yacht = yachts.item(i); document.write("Name : " + yacht.getElementsByTagName("name") .item(0).childNodes.item(0).data + "<BR>"); document.write("Type : " + yacht.getElementsByTagName("type") .item(0).childNodes.item(0).data + "<P>"); }} else document.write("No Data Returned"); } else document.write("Error = "+result.errorText);</script></body></html>
101
JScript API - POST
<HTML><HEAD></HEAD><BODY><B>HTTP Headers:</B><BR><DIV ID="header"></DIV><P><B>Tamino Response:</B><BR><DIV ID="response"></DIV><script language="JScript"> var method = "POST"; // In all upper case letters var url = http://localhost/tamino/xml/sailing ; var data = "_xql=/yacht"; var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.open(method,url,false); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); xmlhttp.send(data); header.innerText = "HTTP-Status: " + xmlhttp.status + " " + xmlhttp.statusText + "\n\n" + xmlhttp.getAllResponseHeaders(); response.innerText = xmlhttp.responseText;</script></BODY></HTML>
<HTML><HEAD></HEAD><BODY><B>HTTP Headers:</B><BR><DIV ID="header"></DIV><P><B>Tamino Response:</B><BR><DIV ID="response"></DIV><script language="JScript"> var method = "POST"; // In all upper case letters var url = http://localhost/tamino/xml/sailing ; var data = "_xql=/yacht"; var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.open(method,url,false); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); xmlhttp.send(data); header.innerText = "HTTP-Status: " + xmlhttp.status + " " + xmlhttp.statusText + "\n\n" + xmlhttp.getAllResponseHeaders(); response.innerText = xmlhttp.responseText;</script></BODY></HTML>
Coding Examples: HTML Form
<FORM ACTION="http://.../tamino/xml/sailing"METHOD="POST"ENCTYPE="multipart/form-data">
<INPUT TYPE=TEXT SIZE=64 NAME=_xql(1,16)><INPUT TYPE=FILE SIZE=64 NAME=_Process><INPUT TYPE=SUBMIT VALUE="Process"></FORM>
<FORM ACTION="http://.../tamino/xml/sailing"METHOD="POST"ENCTYPE="multipart/form-data">
<INPUT TYPE=TEXT SIZE=64 NAME=_xql(1,16)><INPUT TYPE=FILE SIZE=64 NAME=_Process><INPUT TYPE=SUBMIT VALUE="Process"></FORM>
103
Coding Example: Java HTTP
InoConnection inoConnection = new InoConnection("http://localhost/tamino/xml/sql");
query = “customer[custnumber=\'" + sqlKey + "\']";String result1 = inoConnection.xql(query);int inoidStart = result1.indexOf("ino:id");int inoidEnd = result1.indexOf("\">", inoidStart) + 1;inoid = result1.substring(inoidStart,inoidEnd);...String query = “customer[custnumber=\'" + sqlKey + "\']";result = inoConnection.process(query);
104
Coding Example: Java DOM API
c = new BasicElement(doc,"Fax"); c.appendChild(new BasicText(doc,"06150-896177")); adresse.appendChild(c); telephone.appendChild(adresse); /* Now the DOM Element telephone is complete /* Use method printTree of class TaminoClient to printout the just created document tree */ TaminoClient.printTree(telephone);/* use method insert of class TaminoClient to insert the document into tamino database , default collection*/ TaminoResult tr= tamino.insert(telephone); /* end of transaction */ tamino.commit(false);
105
Coding Example: Java DOM API – Insert XML
...
TConnection connection = TConnectionFactory.newConnection( url , userId , passwd);
TAccessLocation accLoc = new TAccessLocation( collection )
TXMLObjectAccessor xmlObjectAccessor = connection.newXMLObjectAccessor( accLoc , JDOM.getInstance() );
TXMLObject xmlObject = TXMLObject.newInstance( jdomElement , collection , doctype );
LocalTransaction localTransaction = connection.useLocalTransactionMode();
try {
TResponse response = xmlObjectAccessor.insert( xmlObject );
System.out.println( “Response:“ + response );
localTransaction.commit();
}
catch (TInsertException insertException) {
localTransaction.rollback();
System.out.println( “Insert Failure:“ + insertException.getAccessFailureMessage() );
}
finally {
connection.useAutoCommitMode();
}
...
106
Coding Example: EJBConnection
public MyAccountPK ejbCreate(String accountID, String owner, double amount) throws CreateException, RemoteException
{ try {
this.accountID = accountID; // set local fields representing the persistent state of the databasethis.ownerName = owner;this.balance = amount;
TEJBConnectionFactory tcf = TEJBConnectionFactory.getInstance(); // get connection TEJBConnection conn = tcf.newConnection("java:comp/env/tamino/accountDS");
TXMLStreamAccessor taminoAccessor = conn.newXMLStreamAccessor(); // get accessorTXMLObject tXMLObject = TXMLObject.newInstance(
newDoc(accountID, ownerName, mount), “Account”, “Account” ); TInputStream tIn = taminoAccessor.insert(tXMLObject);conn.close();return new MyAccountPK(accountID);}
catch ......
107
Coding Examples: Tamino Browse C++
if (m_lpDOMDocument != NULL)if (m_lpDOMDocument != NULL){{
// Update XMLStatement// Update XMLStatementUpdateData(TRUE);UpdateData(TRUE);CWaitCursor wait; CWaitCursor wait;
lpRet=m_CTaminoX.GetNext (m_lpDOMDocument);lpRet=m_CTaminoX.GetNext (m_lpDOMDocument);PrintMessage("GetNext");PrintMessage("GetNext");CheckError();CheckError();
}}
108
Coding Examples: Tamino Modify C++Coding Examples: Tamino Modify C++
if (lpDOMElement != NULL)if (lpDOMElement != NULL) { { UpdateData (TRUE); UpdateData (TRUE);
piDOMElement = new IXMLDOMElement; piDOMElement = new IXMLDOMElement; piDOMElement->AttachDispatch(lpDOMElement); piDOMElement->AttachDispatch(lpDOMElement); piDOMNode = new IXMLDOMNode; piDOMNode = new IXMLDOMNode; piDOMNode->AttachDispatch(lpDOMElement); piDOMNode->AttachDispatch(lpDOMElement); vOrt = piDOMElement->getAttribute ("city"); vOrt = piDOMElement->getAttribute ("city"); vName = piDOMElement->getAttribute ("name"); vName = piDOMElement->getAttribute ("name"); vPLZ = piDOMElement->getAttribute ("zip"); vPLZ = piDOMElement->getAttribute ("zip");
PrintMessage("GetInoId");PrintMessage("GetInoId"); COleVariant vaInoID = m_CTaminoX.GetInoId(piDOMElement->m_lpDispatch); COleVariant vaInoID = m_CTaminoX.GetInoId(piDOMElement->m_lpDispatch);
CheckError();CheckError(); }}
109
Coding Examples: VB
'Create a late-binding til the TAMINOX 'Create a late-binding til the TAMINOX Set TaminoTree = CreateObject("TAMINOX.TaminoX1") Set TaminoTree = CreateObject("TAMINOX.TaminoX1")
'Initialize the connection to the Tamino 'Initialize the connection to the Tamino lngError = TaminoTree.Initialize() lngError = TaminoTree.Initialize() 'Creates a connection to a DB with a URL 'Creates a connection to a DB with a URL TaminoTree.csDatabaseUrl = "http://localhost/tamino/RealEstate/Property" TaminoTree.csDatabaseUrl = "http://localhost/tamino/RealEstate/Property"
'No. of results in a page 'No. of results in a page TaminoTree.lPageSize = 5 TaminoTree.lPageSize = 5
'Creates a Xpath Query 'Creates a Xpath Query Set trees = TaminoTree.DoQuery("Property[@PropertyReference='CASAN00001']") Set trees = TaminoTree.DoQuery("Property[@PropertyReference='CASAN00001']")
'Puts the result from the query in a DOM-tree structure (use locals view to view this) 'Puts the result from the query in a DOM-tree structure (use locals view to view this) Set result = TaminoTree.ReturnNodes(trees) Set result = TaminoTree.ReturnNodes(trees) 'This is a VERY simple example of getting the data 'This is a VERY simple example of getting the data For Each child In result.Item(0).childNodes For Each child In result.Item(0).childNodes MsgBox child.Text MsgBox child.Text Next Next
110
Solution: Key Benefits
Support of XML Standards
non-proprietary
Speed of implementation
quick ROI
High availability
fail-over and load balancing options
High performance
robust and fast
NT to UNIX to OS/390
multi-platform support
access to backend systems
111
Summary – Software AG Value Add:
Providing the leading software platform to enable companies to
transact business,
integrate applications and
to collaborate over the Internet
by leveraging XML