Difference between revisions of "Integrating oXygen"
Jump to navigation
Jump to search
Line 33: | Line 33: | ||
===Preparations=== | ===Preparations=== | ||
# Download one of the complete [http://basex.org/download BaseX distributions] (ZIP, EXE) | # Download one of the complete [http://basex.org/download BaseX distributions] (ZIP, EXE) | ||
− | # | + | # 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 [[Startup#BaseX Server|BaseX Server]] instance |
===Data Source=== | ===Data Source=== | ||
Line 63: | Line 63: | ||
# Press ''OK'', and your scenario is ready. Now you can start the transformation, e.g. by clicking on the red ''Play'' button. | # 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. | ||
+ | --[[User:CG|CG]] 14:45, 29 January 2015 (CET) |
Revision as of 15:45, 29 January 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:
- Resources in databases can be opened and modified.
- XPath/XQuery expressions can be run by the query processor of BaseX.
Contents
Access Database Resources
Preparations
- First, start the BaseX WebDAV service.
Configuration
- Go to menu Options → Preferences → Data Sources
- In the Connections panel, click the New button (
+
) - Enter "BaseX-WebDAV" as connection name
- Select "WebDAV" in the Data Source combo box
- 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
- Set the URL to
- Now press OK, and your Data Source is ready for use
You can now open single database files as follows:
- Choose File → Open URL....
- Enter the corresponding user name and password (if needed), the URL of the BaseX WebDAV Server, and then click "Browse".
Perform Queries
Preparations
- Download one of the complete BaseX distributions (ZIP, EXE)
- 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
- Start oXygen and go to Options → Preferences → Data Sources
- Add a new Data Source with the New button (
+
) - Enter "BaseX-XQJ" as connection name and choose XQuery API for Java (XQJ) as type
- Add the following JAR files above with the Add Button:
xqj-api-1.0.jar
,xqj2-0.2.0.jar
andbasex-xqj-1.3.0.jar
(the versions of the JAR file may differ). If you add the BaseX library as wellbasex7.9.jar
, you can also use the local XQJ driver. - Unter "Driver class", choose the default or the local XQJ driver (
net.xqj.basex.BaseXXQDataSource
vs.net.xqj.basex.local.BaseXXQDataSource
). - Press OK
Connection
- Press New (
+
) in the Connection Panel below. - Enter Name "BaseX" and select "BaseX-XQJ" in the Data Source box.
- If you use the default driver, you need to enter connection details:
- Port: 1984
- serverName: localhost
- user: admin
- password: admin
- Now press OK, and your connection is ready.
Usage
The query execution works as follows:
- Configure a new transformation scenario in Window → Show View → Transformation Scenarios.
- Choose the XQuery Transformation tree entry.
- Press the
plus
sign to add a new scenario. - Enter a Name and an optional XML and XQuery URL (e.g. your query document/file).
- Choose "BaseX" as Transformer from the combo box.
- 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.
--CG 14:45, 29 January 2015 (CET)