Changes

Jump to navigation Jump to search
1,076 bytes added ,  10:29, 3 August 2022
m
Text replacement - "8984" to "8080"
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=== # Go to menu ''Options'' → ''Preferences'' → ''Data Sources''Download one of the [https://basex.org/download BaseX distributions].# In the Connections panel Start BaseX (in the lower area of the screensee [[Startup]]).# Create 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
[[File:Oxygen-WebDAV-1.png]]===Configuration===
# In oXygen, go to menu ''Options'' → ''Preferences'' → ''Data 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><nowiki>http://localhost:8080/webdav</nowiki></code>.#* Set the username to <code>admin</code> and enter your password.#: [[File:Oxygen-WebDAV-1.png]]# Now press ''OK'', and your Data Source is ready for use. You can then access the your database files file(s) via the Data Source Explorer: ''WindowsWindow'' → ''Show View'' → ''Data Source Explorer''.
[[File:Oxygen-WebDAV-2.png]]
=Perform Queries=
 
==One-Time Setup==
===Preparations===
 # Download one of the complete [httphttps://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#BaseX Server|BaseX Server]] instance.
===Configure Data Source===
 # Start In oXygen and , select ''Options'' → ''Preferences'' → ''Data Sources''.
# In the Data Sources panel, add a new data source using the ''New'' button ({{Code|+}}).
# Enter "BaseX XQJ" as Name name and select ''XQuery API for Java (XQJ)'' as from the ''Type'' dropdown box.
# Add the following JAR files (downloaded in Preparations procedure) with the ''Add Files'' Button. The 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-89.60.jar}}#* {{Code|basex/BaseX.jar}}, if you want to use BaseX embedded
# Under "Driver class", choose the preferred driver class:
#* EmbeddedClient/server communication: {{Code|net.xqj.basex.BaseXXQDataSource}}#* Client/serverEmbedded use (standalone): {{Code|net.xqj.basex.local.BaseXXQDataSource}}
# Click ''OK''.
===Configure Connection===
 # In the Connections section (in the same Preferences dialog from lower half of the Configure Data Source proceduredialog), click ''New'' ({{Code|+}}). # Enter "BaseXXQJ" as Name name and select "BaseX XQJ" as Data Sourcedata source. # If you use the default driver, enter these the following values in the Connection Details section:
#* port: {{Code|1984}}
#* serverName: {{Code|localhost}}
#* user: {{Code|admin}}
#* password: {{Code|admin}}''your password''
# Click ''OK'' to complete the connection configuration.
# Click ''OK'' again to close the Preferences dialog.
===Configure New Transformation Scenario===
 
# Select ''Window'' → ''Show View'' → ''Transformation Scenarios''.
# Select In the ''XQuery transformationTransformation Scenarios'' tree entry, and click {{Code|+}} to add a new scenario. #:If this entry does not appear in the treepanel, click {{Code|+}} and select ''XQuery transformation'' in the lower part of the dropdown list.# Enter a Name and name for your transformation, e.g. "BaseX" like in the screenshot below.# 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.
# Click ''OK'' to complete the scenario configuration.
 
[[File:Oxygen-WebDAV-3.png]]
==Execute Query==
After the one-time setup steps are complete, execute a query using the transformation scenario. Start the transformation by clicking the red ''Apply associated scenarios'' button in the Transformation Scenarios window.
 
The results should immediately occur in the result panel.
After the one--[[User:CG|CG]] 14:45time setup steps are complete, 29 January 2015 you can execute your query using the new transformation scenario. Start the transformation by clicking the red Run button (CET''Apply associated scenarios'')in the Transformation Scenarios window, while your scenario is selected. The results should be immediately displayed in the result panel.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu