Changes

Jump to navigation Jump to search
1,483 bytes added ,  13:30, 2 July 2020
no edit summary
This tutorial is part of the [[Getting Started]] Section.
It describes how to access BaseX from the [httphttps://www.oxygenxml.com oXygen XML Editor].Currently, there are two variants alternatives how to use BaseX in oXygen:
* Resources in BaseX [[databases]] can be opened and modified.* XPath/XQuery 1.0 expressions can be run by the [[Query|query processor]] of BaseX.* '''Note:''' BaseX itself is a highly compliant XQuery 3.1 processor. The restriction to XQuery 1.0 arises from the XQJ Interface which is used to establish the connection between oXygen and BaseX. We strongly encourage you to use the [[Graphical_User_Interface#Text_Editor|XML editor]] integrated into the BaseX GUI to edit and query your XML data!<br/><br/>
==Access Database Resources==
===Preparations=== * First, start the BaseX [[WebDAV]] service.
===Configuration=== # Download one of the [https://basex.org/download BaseX distributions].# Go to menu ''Options'' → ''Preferences'' → ''Data Sources''Start BaseX (see [[Startup]]).# In the Connections panelCreate a BaseX database, click the ''New'' button if necessary ({{Code|+}}see [[Databases]]).# Enter "Start the BaseX-WebDAV" as connection name# Select "[[WebDAV" in the Data Source combo box# Fill in the appropriate connection details]] service. Below, the default values are shown:#* Set the URL to <code><nowiki>http://localhost:8984/webdav</nowiki></code>#* Set the user name to <code>admin</code>#* Set the password to <code>admin</code># Now press ''OK'', and your Data Source is ready for use
You can now open single database files as follows:===Configuration===
* Choose # In oXygen, go to menu ''Options'' → ''FilePreferences'' → ''Open URLData Sources''.# In the Connections panel (in the lower half of the screen), click the ''New'' button ({{Code|+}}).# Enter "BaseX WebDAV" as connection name.''# Select "WebDAV (S)FTP" in the Data Source dropdown box.# Fill in the appropriate connection details as follows:#* Set the WebDAV/FTP URL to <code><brnowiki>http://>[[Filelocalhost:Webdav-oxygen01.png]]8984/webdav<br/nowiki><br/code>.#* Enter Set the corresponding user name and to <code>admin</code>.#* Set the password (if needed), the URL of the BaseX WebDAV Server, and then click "Browse".to <code>admin<br/code>.#: [[File:WebdavOxygen-oxygen02WebDAV-1.png]]# Now press ''OK'', and your Data Source is ready for use.
==Perform Queries==You can then access your database file(s) via the Data Source Explorer: ''Window'' → ''Show View'' → ''Data Source Explorer''.
===Preparations=== # Download one of the complete [http[File://basexOxygen-WebDAV-2.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 Serverpng]] instance
=Perform Queries==Data Source=== # Start oXygen and go to ''Options'' → ''Preferences'' → ''Data Sources''# Add a new Data Source with the ''New'' button ({{Code|+}})# 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: {{Code|xqj-api-1.0.jar}}, {{Code|xqj2-0.2.0.jar}} and {{Code|basex-xqj-1.3.0.jar}} (the versions of the JAR file may differ). If you add the BaseX library as well {{Code|basex7.9.jar}}, you can also use the local XQJ driver.# Unter "Driver class", choose the default or the local XQJ driver ({{Code|net.xqj.basex.BaseXXQDataSource}} vs. {{Code|net.xqj.basex.local.BaseXXQDataSource}}).# Press ''OK''
===Connection=One-Time Setup==# Press ''New'' ({{Code|+}}) 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.
===UsagePreparations=== # Download one of the complete [https://basex.org/download BaseX distributions] (ZIP, EXE), if necessary.# Start BaseX (see [[Startup]]). '''Note:''' 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#Server|BaseX Server]] instance. ===Configure Data Source=== # In oXygen, select ''Options'' → ''Preferences'' → ''Data Sources''.# In the Data Sources panel, add a new data source using the ''New'' button ({{Code|+}}).# Enter "BaseX" as name and select ''XQuery API for Java(XQJ)'' from the ''Type'' dropdown box.# Add the following JAR files (downloaded in Preparations procedure) with the ''Add Files'' Button. The query execution works versions of the JAR files may differ.#* {{Code|basex/lib/xqj-api-1.0.jar}}#* {{Code|basex/lib/xqj2-0.2.0.jar}}#* {{Code|basex/lib/basex-xqj-9.0.jar}}#* {{Code|basex/BaseX.jar}}, if you want to use BaseX embedded# Under "Driver class", choose the preferred driver class:#* Embedded: {{Code|net.xqj.basex.BaseXXQDataSource}}#* Client/server: {{Code|net.xqj.basex.local.BaseXXQDataSource}}# Click ''OK''. ===Configure Connection=== # In the Connections section (in the lower half of the Data Source dialog), click ''New'' ({{Code|+}}).# Enter "BaseX XQJ" as name and select "BaseX" as followsdata source.# If you use the default driver, enter the following values in the Connection Details section:#* port:{{Code|1984}} #* serverName: {{Code|localhost}}#* user: {{Code|admin}}#* password: {{Code|admin}}# Click ''OK'' to complete the connection configuration.# Click ''OK'' again to close the Preferences dialog. ===Configure a new transformation scenario in New Transformation Scenario=== # Select ''Window'' → ''Show View'' → ''Transformation Scenarios''.# Choose In the ''Transformation Scenarios'' panel, click {{Code|+}} and select ''XQuery Transformationtransformation'' tree entryin the lower part of the dropdown list.# Press Enter a name for your transformation, e.g. "BaseX" like in the <code>plus</code> sign to add a new scenarioscreenshot below. # Enter a Name and Specify an optional XML and XQuery URL (e.g#* If you would like to query the BaseX database you connected to via WebDAV, leave the ''XML URL'' field empty. To access your database, you can use the following function from the BaseX [[Database_Module|Database Module]] in your ''XQuery URL'' file:#: [[File:Oxygen-query -example.png]]#* If you specify an XML document/in the ''XML URL'' field, you can query its content using {{Code|.}} (dot operator) in your ''XQuery URL'' file).# Choose "BaseXXQJ" as Transformer from the combo box. # Press Click ''OK'', and your to complete the scenario is readyconfiguration. [[File:Oxygen-WebDAV-3. Now png]] ==Execute Query== After the one-time setup steps are complete, you can start execute your query using the new transformation, e.gscenario. Start the transformation by clicking on the red Run button (''PlayApply associated scenarios'' button) in the Transformation Scenarios window, while your scenario is selected. # The results should be immediately occur displayed in the result panel.--[[User:CG|CG]] 14:45, 29 January 2015 (CET)
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu