Oracle Berkeley DB XML support

Introduction

This tutorial explains how to configure the Oracle Berkeley DB XML support in Oxygen XML Editor, browse and edit resources stored in the database, as well as writing, running, and debugging XQuery interrogations.

Oracle Berkeley DB XML is an open source, embeddable XML database with XQuery-based access to documents stored in containers and indexed based on their content. Oracle Berkeley DB XML is built on top of Oracle Berkeley DB and inherits its rich features and attributes. A detailed description can be found at: http://www.oracle.com/database/berkeley-db/xml/index.html

The tutorial assumes that you have a basic knowledge of databases, XML technologies, and of Oxygen XML Editor tool. The explanations and screenshots are given for the standalone version of Oxygen XML Editor. However, the same set of features are available in the Eclipse plugin version of the product with minor interface differences.

How to Configure the Oracle Berkeley DB XML Support in Oxygen

There are two notions you need to understand in order to configure the Oracle Berkeley DB XML support in Oxygen:

  • Data Source
  • Connection

A data source defines all that is needed to have a connection to the database. Oxygen currently supports Oracle Berkeley DB XML version 2.5 or higher.

The data source drivers can be configured in the Data Source preferences page.

Berkeley DataSource Dialog

For specific instructions on how to configure the data source drivers, see the following topic in our Users Manual: http://www.oxygenxml.com/doc/ug-editor/topics/configure-berkeley-datasource.html#configure-berkeley-datasource.

Once you have created the data source, you may proceed further by defining one or more connections. The connections can be configured in the same Data Source preferences page.

Berkeley Connection Dialog

For specific instructions on how to configure the connections, see the following topic in our Users Manual: http://www.oxygenxml.com/doc/ug-editor/topics/configure-berkeley-connection.html#configure-berkeley-connection.

Data Source Explorer View

Once you finish the configuration of the connection, you can browse the database content using the Data Source Explorer view from the Database perspective.

Each node from the Data Source Explorer view features a set of operations that are available on the contextual menu. One of the operations available on the connection node is the possibility to add a new container.

Add Container Dialog

The contextual menu of a container node features operations such as add resource, rename, delete, or edit indices.

Edit Indices Dialog

A database resource node features the following list of operations: rename, move, delete or open the content to be edited in Oxygen. When the editor content is saved, the changes are stored back in the database.

XQuery Editing Support

Oxygen runs XQuery interrogations against the stored XML content of a Berkeley DB XML database as a transaction through the transaction support of the server. For example, if you want to create an XQuery to generate a report with the billing contact data from the latest purchase notifications, you can open an XQuery document (an XQuery template is available from the File/New menu), configure the transformation scenario to match the Berkeley DB XML connection for the transformer field, write the XQuery, and then run the scenario.

Configure Transformation Scenario Dialog

The XQuery editor features an XQuery Outline view as well as a powerful Content Completion Assistant, including descriptions of Berkeley DB XML predefined functions.

XQuery Editing Support

XQuery Debugger for the Oracle Berkeley DB XML Database

The debugging interface of Oracle Berkeley DB XML 2.5 database has been integrated with the Oxygen XQuery Debugger and Profiler. All the debugging and profiling views (Stack, Trace, Conditional Breakpoints, Breakpoints, Hotspots, Invocation Tree, etc.) are available.

When entering in the XQuery Debugging mode, Oxygen provides a special layout that displays the XML source (optional) and the XQuery documents side by side. It can also show the debugging output and specific XQuery debugging views and toolbars that allow you to set breakpoints, inspect variable bindings, or evaluate expressions in the request context.

XQuery Debugging Interface

More details about the Oxygen XQuery Debugger can be found here: http://www.oxygenxml.com/xquery_debugger.html

Two special views (Hotspots and Invocation Tree) allows profiling of the XQuery execution.

XQuery Profiling Interface

More details about the Oxygen XQuery Profiler can be found here: http://www.oxygenxml.com/doc/ug-editor/topics/working-with-XSLT-profiler.html