Difference between revisions of "Integrating oXygen"

From BaseX Documentation
Jump to navigation Jump to search
Line 6: Line 6:
 
* XPath/XQuery expressions can be run by the [[Query|query processor]] of BaseX.<br/><br/>
 
* XPath/XQuery expressions can be run by the [[Query|query processor]] of BaseX.<br/><br/>
  
==Access Database Resources==
+
=Access Database Resources=
  
 
===Preparations===  
 
===Preparations===  
Line 29: Line 29:
 
[[File:Webdav-oxygen02.png]]
 
[[File:Webdav-oxygen02.png]]
  
==Perform Queries==
+
=Perform Queries=
  
 
===Preparations===  
 
===Preparations===  
Line 43: Line 43:
 
# Press ''OK''
 
# Press ''OK''
  
===Connection===
+
==Connection==
 
# Press ''New'' ({{Code|+}}) in the Connection Panel below.  
 
# Press ''New'' ({{Code|+}}) in the Connection Panel below.  
 
# Enter Name "BaseX" and select "BaseX-XQJ" in the Data Source box.  
 
# Enter Name "BaseX" and select "BaseX-XQJ" in the Data Source box.  
Line 53: Line 53:
 
# Now press ''OK'', and your connection is ready.
 
# Now press ''OK'', and your connection is ready.
  
===Usage===
+
==Usage==
 
The query execution works as follows:
 
The query execution works as follows:
 
    
 
    

Revision as of 18:24, 27 March 2015

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, 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

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

Data Source

  1. Start oXygen and go to OptionsPreferencesData Sources
  2. Add a new Data Source with the New button (+)
  3. Enter "BaseX-XQJ" as connection name and choose XQuery API for Java (XQJ) as type
  4. Add the following JAR files above with the Add Button: xqj-api-1.0.jar, xqj2-0.2.0.jar and basex-xqj-1.3.0.jar (the versions of the JAR file may differ). If you add the BaseX library as well basex7.9.jar, you can also use the local XQJ driver.
  5. Unter "Driver class", choose the default or the local XQJ driver (net.xqj.basex.BaseXXQDataSource vs. net.xqj.basex.local.BaseXXQDataSource).
  6. Press OK

Connection

  1. Press New (+) in the Connection Panel below.
  2. Enter Name "BaseX" and select "BaseX-XQJ" in the Data Source box.
  3. If you use the default driver, you need to enter connection details:
    • Port: 1984
    • Server name: localhost
    • User: admin
    • Password: admin
  4. Now press OK, and your connection is ready.

Usage

The query execution works as follows:

  1. Configure a new transformation scenario in WindowShow ViewTransformation Scenarios.
  2. Choose the XQuery Transformation tree entry.
  3. Press the plus sign to add a new scenario.
  4. Enter a Name and an optional XML and XQuery URL (e.g. your query document/file).
  5. Choose "BaseX" as Transformer from the combo box.
  6. Press OK, and your scenario is ready. Now you can start the transformation, e.g. by clicking on the red Play button.
  7. The results should immediately occur in the result panel.

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