Difference between revisions of "Integrating oXygen"

From BaseX Documentation
Jump to navigation Jump to search
Line 16: Line 16:
 
==Perform Queries==
 
==Perform Queries==
  
===Prerequisites===  
+
===Preparations===  
  
# BaseX distribution with all libraries included: http://basex.org/download
+
# Download a BaseX distribution with libraries included (ZIP, EXE, WAR, DMG): http://basex.org/download
# Compatible versions of the three libaries <code>basex.jar</code>, <code>basex-api.jar</code>, and <code>xqj-api.jar</code>
+
# Start oXygen and go to ''Options'' → ''Preferences'' → ''Data Sources''.  
  
 
===Data Source===  
 
===Data Source===  
# 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 "BaseX" as name and choose ''XQuery API for Java (XQJ)'' as type.  
 
# Enter "BaseX" as name and choose ''XQuery API for Java (XQJ)'' as type.  
# Add the three JAR files above with the ''Add'' Button.
+
# Add the following three JAR files above with the ''Add'' Button: <code>basex.jar</code>, <code>basex-api.jar</code>, and <code>xqj-api.jar</code>. The JAR files might include version names.
 
# Now press ''OK'', and your Data Source is ready for use.
 
# Now press ''OK'', and your Data Source is ready for use.
  
 
===Connection===
 
===Connection===
# Now press ''New'' in the Connection Panel (located in ''Data Sources'').  
+
# Now press ''New'' in the Connection Panel below.  
# Enter Name "BaseXConnection" and select "BaseX" in the Data Source box.  
+
# Enter Name "BaseX" and select "BaseX" in the Data Source box.  
 
# 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:
 
    
 
    
 
# Configure a new transformation scenario in ''Window'' → ''Show View'' → ''Transformation Scenarios''.
 
# Configure a new transformation scenario in ''Window'' → ''Show View'' → ''Transformation Scenarios''.
 
# Press the <code>plus</code> sign to add a new scenario.  
 
# Press the <code>plus</code> sign to add a new scenario.  
# Enter a Name, XML URL (your xml file or leave it empty) and the XQuery URL (your query file).  
+
# Enter a Name, XML URL (your xml file or leave it empty) and the XQuery URL (your query file).
# Choose "BaseXConnection" in the combo box.  
+
# Choose "BaseX" in the combo box.  
# Press ''OK'', and your scenario is ready. Now you can start the transformation.  
+
# Press ''OK'', and your scenario is ready. Now you can start the transformation, e.g. by clicking on the red ''Play'' button.  
 
# The results should immediately occur in the result panel.
 
# The results should immediately occur in the result panel.
  
 
[[Category:Instructions]]
 
[[Category:Instructions]]

Revision as of 13:28, 25 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

  • 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

Preparations

  1. Download a BaseX distribution with libraries included (ZIP, EXE, WAR, DMG): http://basex.org/download
  2. Start oXygen and go to OptionsPreferencesData Sources.

Data Source

  1. Add a new Data Source with the New button.
  2. Enter "BaseX" as name and choose XQuery API for Java (XQJ) as type.
  3. Add the following three JAR files above with the Add Button: basex.jar, basex-api.jar, and xqj-api.jar. The JAR files might include version names.
  4. Now press OK, and your Data Source is ready for use.

Connection

  1. Now press New in the Connection Panel below.
  2. Enter Name "BaseX" 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 "BaseX" in the combo box.
  5. Press OK, and your scenario is ready. Now you can start the transformation, e.g. by clicking on the red Play button.
  6. The results should immediately occur in the result panel.