Difference between revisions of "Integrating oXygen"

From BaseX Documentation
Jump to navigation Jump to search
(A few more clarifications and readability improvements)
Line 13: Line 13:
 
===Configuration===  
 
===Configuration===  
 
# Go to menu ''Options'' → ''Preferences'' → ''Data Sources''
 
# Go to menu ''Options'' → ''Preferences'' → ''Data Sources''
# In the Connections panel, click the ''New'' button ({{Code|+}})
+
# In the Connections panel (in the lower area of the screen), click the ''New'' button ({{Code|+}})
 
# Enter "BaseX-WebDAV" as connection name
 
# Enter "BaseX-WebDAV" as connection name
 
# Select "WebDAV" in the Data Source combo box
 
# Select "WebDAV" in the Data Source combo box

Revision as of 13:23, 14 January 2017

This tutorial is part of the Getting Started Section. It describes how to access BaseX from the oXygen XML Editor. Currently, there are two variants how to use BaseX in oXygen:

Access Database Resources

Preparations

  • First, start the BaseX WebDAV service.

Configuration

  1. Go to menu OptionsPreferencesData Sources
  2. In the Connections panel (in the lower area of the screen), click the New button (+)
  3. Enter "BaseX-WebDAV" as connection name
  4. Select "WebDAV" in the Data Source combo box
  5. Fill in the appropriate connection details. Below, the default values are shown:
    • Set the URL to http://localhost:8984/webdav
    • Set the user name to admin
    • Set the password to admin
  6. Now press OK, and your Data Source is ready for use

You can now open single database files as follows:

  • Choose FileOpen URL....

File:Webdav-oxygen01.png

  • Enter the corresponding user name and password (if needed), the URL of the BaseX WebDAV Server, and then click "Browse".

File:Webdav-oxygen02.png

Perform Queries

One-Time Setup

Preparations

  1. Download one of the complete BaseX distributions (ZIP, EXE).
  2. Charles Foster's XQJ implementation provides a default (client/server) and a local driver. If you want to use the first flavor, you need to start a BaseX Server instance.

Configure Data Source

  1. Start oXygen and select OptionsPreferencesData Sources.
  2. In the Data Sources section, add a new data source using the New button (+).
  3. Enter "BaseX-XQJ" as Name and select XQuery API for Java (XQJ) as Type.
  4. Add the following JAR files (downloaded in Preparations procedure) with the Add Files Button. The versions of the JAR files may differ.
    • lib/xqj-api-1.0.jar
    • lib/xqj2-0.2.0.jar
    • lib/basex-xqj-1.3.0.jar
    • basex.jar, if you want to use the local XQJ driver
  5. Under "Driver class", choose the default or the local XQJ driver (net.xqj.basex.BaseXXQDataSource vs. net.xqj.basex.local.BaseXXQDataSource).
  6. Click OK.

Configure Connection

  1. In the Connections section (in the same Preferences dialog from the Configure Data Source procedure), click New (+).
  2. Enter "BaseX" as Name and select "BaseX-XQJ" as Data Source.
  3. If you use the default driver, enter these values in the Connection Details section:
    • port: 1984
    • serverName: localhost
    • user: admin
    • password: admin
  4. Click OK to complete the connection configuration.
  5. Click OK again to close the Preferences dialog.

Configure New Transformation Scenario

  1. Select WindowShow ViewTransformation Scenarios.
  2. Select the XQuery transformation tree entry, and click + to add a new scenario.
    If this entry does not appear in the tree, click + and select XQuery transformation in the dropdown list.
  3. Enter a Name and an optional XML and XQuery URL (e.g. your query document/file).
  4. Choose "BaseX" as Transformer from the combo box.
  5. Click OK to complete the scenario configuration.

Execute Query

After the one-time setup steps are complete, execute a query using the transformation scenario. Start the transformation by clicking the red Apply associated scenarios button in the Transformation Scenarios window.

The results should immediately occur in the result panel.

--CG 14:45, 29 January 2015 (CET)