Difference between revisions of "Integrating oXygen"

From BaseX Documentation
Jump to navigation Jump to search
Line 1: Line 1:
 
This tutorial is part of the [[Getting Started]] Section.
 
This tutorial is part of the [[Getting Started]] Section.
It describes how to use the BaseX [[XQuery]] Processor
+
It describes how to access BaseX from the [http://www.oxygenxml.com oXygen XML Editor].
to execute queries in the [http://www.oxygenxml.com oXygen XML Editor].
+
Currently, there are two variants how to use BaseX in oXygen:
You can access the [[database|databases]] from BaseX within oXygen
+
 
and work with the results as XML.
+
* Resources in [[database|databases]] can be opened and modified.
+
* XPath/XQuery expressions can be run by the [[Query|query processor]] of BaseX.
==Required Downloads==
+
 
 +
==Access Database Resources==
 +
 
 +
# Start the [[WebDAV]] service first, which will allow you to access all resources via the client/server architecture.
 +
* Choose ''File'' → ''Open URL...''.<br/>
 +
[[File:Webdav-oxygen01.png]]<br/><br/>
 +
* Enter the corresponding user name and password (if needed), the URL of the BaseX WebDAV Server, and then click "Browse".<br/>
 +
[[File:Oxygen02.png]]
  
# [http://files.basex.org/maven/basex.jar basex.jar]: Main code
+
==Perform Queries==
# [http://files.basex.org/maven/basex-api.jar basex-api.jar]: Implementation of the XQJ API
 
# [http://files.basex.org/maven/xqj-api.jar xqj-api.jar]: XQuery for Java (Interface)
 
# [http://www.oxygenxml.com oXygen XML Editor]: Install the oXygen XML Editor on your computer
 
  
==Setting up==
 
 
 
===Data Source===  
 
===Data Source===  
 
# Start oXygen and go to ''Options'' → ''Preferences'' → ''Data Sources''.  
 
# Start oXygen and go to ''Options'' → ''Preferences'' → ''Data Sources''.  
 
# Add a new Data Source with the ''New'' button.  
 
# Add a new Data Source with the ''New'' button.  
# Enter Name "BaseX" and choose ''XQuery API for Java(XQJ)'' as type.  
+
# Enter Name "BaseX" and choose ''XQuery API for Java (XQJ)'' as type.  
 
# Add the three JAR files with the ''Add'' Button.  
 
# Add the three JAR files with the ''Add'' Button.  
 
# Now press ''OK'', and your Data Source is ready.  
 
# Now press ''OK'', and your Data Source is ready.  
Line 26: Line 28:
 
# 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 13:22, 12 October 2011

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

  1. Start the WebDAV service first, which will allow you to access all resources via the client/server architecture.
  • 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:Oxygen02.png

Perform Queries

Data Source

  1. Start oXygen and go to OptionsPreferencesData Sources.
  2. Add a new Data Source with the New button.
  3. Enter Name "BaseX" and choose XQuery API for Java (XQJ) as type.
  4. Add the three JAR files with the Add Button.
  5. Now press OK, and your Data Source is ready.

Connection

  1. Now press New in the Connection Panel (located in Data Sources).
  2. Enter Name "BaseXConnection" and select "BaseX" in the Data Source box.
  3. 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. Press the plus sign to add a new scenario.
  3. Enter a Name, XML URL (your xml file or leave it empty) and the XQuery URL (your query file).
  4. Choose "BaseXConnection" in the combo box.
  5. Press OK, and your scenario is ready. Now you can start the transformation.
  6. The results should immediately occur in the result panel.