Download presentation
Presentation is loading. Please wait.
Published byKerrie Blake Modified over 9 years ago
1
Using oXygen 12 with XQuery Using oXygen to build and execute XQuery XQuery applications on eXist Date: April 2011 Dan McCreary President Dan McCreary & Associates dan@danmccreary.com (952) 931-9198 M D Metadata Solutions
2
M D Copyright 2008 Dan McCreary & Associates 2 Overview Why oXygen? Screen layout Customizing screen layout –Toolbar –Perspectives Editing Setting the Default XQuery engine Auto-completion Using the XPath Builder
3
M D Copyright 2008 Dan McCreary & Associates 3 Why oXygen? Tools are Important oXygen has become the premiere tool for working with native XML databases oXygen will be our primary XQuery development tool It is important that people feel comfortable with both the tools and the theory behind XQuery Getting to know your tools will make you more productive
4
M D Copyright 2008 Dan McCreary & Associates 4 oXygen Data Sources Tools -> Preferences
5
M D Copyright 2008 Dan McCreary & Associates 5 5 eXist driver “jar” files This files are part of the eXist distribution but are used by oXygen to connect to the database The constitute the "database driver" for your eXist connection They must match the version of the database you are using. The files are: –One file from $EXIST_HOME exist.jar –Four files from the lib/core xmldb.jar Xmlrpc client jar files Utility jar files that the XML RPC depends on
6
M D Copyright 2008 Dan McCreary & Associates 6 Data Source Drivers Note: These are the files for eXist 1.4 and 1.5
7
M D Copyright 2008 Dan McCreary & Associates 7 Connection to Localhost XML DB URI: xmldb:exist://localhost:8080/exist/xmlrpc
8
M D Copyright 2008 Dan McCreary & Associates 8 Windows WebDAV Folder http:// localhost:8080/exist/webdav/db
9
M D Copyright 2008 Dan McCreary & Associates 9 WebDAV vs ReST When using the windows Add Network Place make sure to use the WebDAV url http://localhost:8080/exist/rest/db http://localhost:8080/exist/webdav/db Web Browser (to execute any XQuery) Windows File System (drag and drop)
10
M D XQuery Validate From the main oXygen menu select Options -> Preferences Copyright 2008 Dan McCreary & Associates 10 Type "XQuery" to filter the preferences Select the data connection name of your eXist server
11
M D Copyright 2008 Dan McCreary & Associates 11
12
M D Copyright 2008 Dan McCreary & Associates 12 Major Screen Areas Database browser Editor –note the tabs on the top XPath Expression Builder
13
M D Copyright 2008 Dan McCreary & Associates 13 Hello World in XQuery xquery version "1.0"; let $message := 'Hello World' return $message
14
M D Copyright 2008 Dan McCreary & Associates 14 input output Execute Validity
15
M D Copyright 2008 Dan McCreary & Associates 15 Transformation Scenario A transformation senerio is a specific configuration on how you want to run your transforms You can use oXygen’s built-in Saxon XQuery processor for doing standard XQuery testing on small local files Saxon is highly compliant with XQuery 1.0 and because it runs as part of oXygen you can do advanced stepwise debugging within oXygen You will not be able to use Saxon if you are using any of eXist’s XQuery extension in your XQuery
16
M D Copyright 2008 Dan McCreary & Associates 16 Testing with Saxon The default oXygen XQuery engine is Saxon. Saxon XQuery XML Output
17
M D Copyright 2008 Dan McCreary & Associates 17 Executing on eXist oXygen eXist “jars” XQuery XML Output eXist
18
M D Copyright 2008 Dan McCreary & Associates 18 Return results from eXist to oXygen
19
M D Copyright 2008 Dan McCreary & Associates 19 HTML Rendering Within oXygen Configure oXygen to render results directly into web browser view Note this is part of the transformation scenario Check Here
20
M D Copyright 2008 Dan McCreary & Associates 20 HTML Output in Lower Window
21
M D Copyright 2008 Dan McCreary & Associates 21 Note Many context-aware functions that will run correctly if executed from a browser may not run within oXygen oXygen does not pull in server-side CSS files There is currently no way to configure what rendering engine oXygen uses (IE, FireFox, Chrome etc) For best results, test in at least two different browsers, especially if you are using complex CSS files
22
M D Copyright 2008 Dan McCreary & Associates 22 Toolbars Can be customized to your preferences Highly recommended for this class: –File –Edit –Transformation –XPath
23
M D Copyright 2008 Dan McCreary & Associates 23 Configure Toolbars I use the following In this class: XPath Validate Transform
24
M D Copyright 2008 Dan McCreary & Associates 24 Saving Your Perspective This will save the positions of all your views within oXygen.
25
M D Copyright 2007 Dan McCreary & Associates 25 of N Default XQuery Valuator
26
M D Autocomplete Types of Autocomplete 1.Built-in XPath/XQuery functions Examples: concat, sum, current-date 2.eXist extension modules (request, xmldb) 3.Your own custom modules (style, auth) 4.Module variables ( they start with your $your-namespace ) 5.Local variables Things to watch for Copyright 2008 Dan McCreary & Associates 26
27
M D Auto-completion XPath Copyright 2010 Dan McCreary & Associates 27 of N Type "fn:" in any part of your xquery Type "fn:s" to find all built-in functions that start with "s"
28
M D Autocomplete eXist Modules Copyright 2008 Dan McCreary & Associates 28 Type in "xmldb:" in any part of your XQuery The drop-down list will appear
29
M D As you type field-specification As you type a function oXygen tells you what the parameter is and its type Copyright 2010 Dan McCreary & Associates 29 Current parameter and type in bold
30
M D Test eXist Module Auto-compleation Copyright 2010 Dan McCreary & Associates 30 Type "xmldb:" in any part of your xquery
31
M D Copyright 2008 Dan McCreary & Associates 31 Subversion Version control system Examples stored at Google Code –http://xrx.googlecode.com/svn/trunk/ You can “checkout” a read-only copy using Subversion’s Subversion Client (Syncro SVN) From oXygen: –Tools -> SVN Client
32
M D Copyright 2008 Dan McCreary & Associates 32 Subversion Access
33
M D Copyright 2008 Dan McCreary & Associates 33 Thank You! Please contact me for more information: Metadata Management Services Web Services Service Oriented Architectures Business Intelligence and Data Warehouse Metadata Registries Semantic Web Dan McCreary, President Dan McCreary & Associates Metadata Strategy Development dan@danmccreary.com (952) 931-9198
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.