Difference between revisions of "Graphical User Interface"
(21 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
The BaseX homepage gives you a [http://basex.org/products/gui visual impression] of the graphical user interface (GUI) of BaseX, and an [http://www.youtube.com/watch?v=xILHKGPGaJ4&hd=1 introductory video] is available, which presents some of its interactive features. | The BaseX homepage gives you a [http://basex.org/products/gui visual impression] of the graphical user interface (GUI) of BaseX, and an [http://www.youtube.com/watch?v=xILHKGPGaJ4&hd=1 introductory video] is available, which presents some of its interactive features. | ||
− | + | =Startup= | |
First of all, launch a GUI instance of BaseX. Depending on your operating system, double click on the '''BaseX GUI''' start icon or run the <code>basexgui</code> script. Beside that, some more [[Startup#BaseX GUI|startup options]] are available. | First of all, launch a GUI instance of BaseX. Depending on your operating system, double click on the '''BaseX GUI''' start icon or run the <code>basexgui</code> script. Beside that, some more [[Startup#BaseX GUI|startup options]] are available. | ||
Line 10: | Line 10: | ||
Select ''Database'' → ''New'' and browse to an XML document of your choice. As an example, you can start with the {{Code|factbook.xml}} document, which contains statistical information on the worlds' countries. It is included in our official releases and can also be [http://files.basex.org/xml/factbook.xml downloaded] (1.3 MB). If you type nothing in the input field, an empty database will be created. Next, choose the ''OK'' button, and BaseX will create a database that you can visually explore and query. | Select ''Database'' → ''New'' and browse to an XML document of your choice. As an example, you can start with the {{Code|factbook.xml}} document, which contains statistical information on the worlds' countries. It is included in our official releases and can also be [http://files.basex.org/xml/factbook.xml downloaded] (1.3 MB). If you type nothing in the input field, an empty database will be created. Next, choose the ''OK'' button, and BaseX will create a database that you can visually explore and query. | ||
− | If no XML document is available, the [[#Text Editor|Text Editor]] can also be used to create an initial XML document. After saving the entered XML document to harddisk, it can be | + | If no XML document is available, the [[#Text Editor|Text Editor]] can also be used to create an initial XML document. After saving the entered XML document to harddisk, it can be supplied as database input in the above dialog. |
− | = | + | =Input Bar= |
− | + | On top of the main window, you can find an input bar. The attached dropdown menu provides three modes: '''Find''', '''XQuery''' and '''Command''': | |
− | + | [[Image:InputBar.png|Input Bar]] | |
− | |||
− | [[ | ||
− | + | The upcoming example queries can all be used with an instance of the <code>factbook</code> database: | |
− | == | + | ==Find== |
− | + | In the '''Find''' mode, the input bar can be used to find single elements and texts in the currently opened database. The following syntax is supported: | |
− | the | ||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
!Query | !Query | ||
!Description | !Description | ||
|- | |- | ||
− | |<code> | + | |<code>city</code> |
− | |Find | + | |Find elements named {{Code|city}}, and texts containing this token. |
+ | |- | ||
+ | |<code>=India</code> | ||
+ | |Find texts matching the exact string {{Code|India}}. | ||
|- | |- | ||
− | |<code> | + | |<code>~Cing</code> |
− | |Find | + | |Find texts equal or similar to the token {{Code|Cingdom}}. |
|- | |- | ||
− | |<code> | + | |<code>id</code> |
− | |Find | + | |Find attributes named {{Code|id}} and attribute values containing this token. |
|- | |- | ||
− | |<code>@ | + | |<code>@=f0_119</code> |
− | |Find | + | |Find attribute values matching the exact string {{Code|f0_119}}. |
|- | |- | ||
− | |<code> | + | |<code>"European Chinese"</code> |
− | |Find | + | |Find texts containing the phrase {{Code|"European Chinese"}}. |
|- | |- | ||
− | |<code> | + | |<code>//city</code> |
− | | | + | |Leading slash: Interpret the input as XPath expression (see below). |
|} | |} | ||
− | == | + | ==XQuery== |
− | + | In the '''XQuery''' mode, XPath and XQuery expressions can be entered in the input bar. | |
− | To | + | To evaluate the following example queries: enter them in the input bar, and press ENTER or click on the START button: |
− | + | {| class="wikitable" | |
+ | !Query | ||
+ | !Description | ||
+ | |- | ||
+ | |<code>//country</code> | ||
+ | |Return all <code>country</code> elements. | ||
+ | |- | ||
+ | |<code>//country[name = "Switzerland"]</code> | ||
+ | |Return the <code>country</code> element of "Switzerland". | ||
+ | |- | ||
+ | |<code>for $city in //city<br/>where $city/population > 1000000<br/>order by $city ascending<br/>return $city/name</code> | ||
+ | |Return the names of all cities with a population larger than one million and order the results by the name of the city. | ||
+ | |} | ||
− | + | ==Command== | |
− | + | In the '''Command''' mode, [[Commands|BaseX Commands]] can be entered and executed. Just try the following examples: | |
− | + | * <code>INFO</code>: Returns system information. | |
+ | * <code>CREATE DB TEST</code>: Creates an empty database named "TEST". | ||
+ | * <code>LIST</code>: Lists all databases. | ||
− | + | =Text Editor= | |
− | The | + | The powerful text editor can be used to write and edit [[XQuery]] code (simple queries, modules), XML documents, [[Commands#Basics|Command Scripts]], and any other textual files: |
− | + | * XQuery and command scripts can be '''executed''' by clicking on the green triangle. | |
+ | * XQuery, XML and JavaScript will be '''syntax highlighted'''. | ||
+ | * XQuery and XML will automatically '''parsed''' with each key click, and '''errors''' will be highlighted. | ||
− | + | Numerous [[Shortcuts|keyboard shortcuts]] are available to speed up editing and debugging. | |
− | + | ==Project View== | |
− | + | The Project View is attached to the editor panel. It displays all files of the current project directory in a tree structure. Files can be renamed and deleted by right-clicks on the files. The project directory can be changed by clicking on the button with the three dots <code>...</code> in the upper left corner of the project view panel. | |
− | + | Erroneous XQuery modules, and all queries importing these modules, will be highlighted. Highlighting can be disabled in the GUI preferences dialog. | |
− | ==Visualizations | + | =Realtime Options= |
+ | |||
+ | Via the ''Options'' menu, you can change how queries are executed and visualized: | ||
+ | |||
+ | * '''Realtime Execution''': If realtime execution is enabled, your searches and queries will be executed with each key click and the results will be instantly shown. | ||
+ | * '''Realtime Filtering''': If enabled, all visualizations will be limited to the actual results in realtime. If this feature is disabled, the query results are highlighted in the visualizations and can be explicitly filtered with the 'Filter' button. | ||
+ | |||
+ | =Visualizations= | ||
The BaseX GUI offers various visualizations, | The BaseX GUI offers various visualizations, | ||
Line 127: | Line 148: | ||
</td></tr></table> | </td></tr></table> | ||
− | + | =Look and Feels= | |
<table> | <table> | ||
Line 133: | Line 154: | ||
<td> | <td> | ||
By default, the Look and Feel of your operating system will be used in the GUI. | By default, the Look and Feel of your operating system will be used in the GUI. | ||
− | In the ''Preferences'' dialog, you can choose some more window themes. | + | In the ''Preferences'' dialog, you can choose among some more window themes. |
− | The | + | The [http://www.jtattoo.net/ScreenShots.html JTattoo library] offers some more |
− | + | look and feels. If you download and copy the JTattoo jar file into the {{Code|lib}} | |
− | and copy the | + | directory provided by the ZIP and EXE distribution of BaseX, |
− | + | 13 additional looks and feels will get available. | |
− | will get available. | ||
</td> | </td> | ||
<td>[[Image:defaultlaf.png|thumb|Default Look & Feel]]</td> | <td>[[Image:defaultlaf.png|thumb|Default Look & Feel]]</td> | ||
Line 146: | Line 166: | ||
</table> | </table> | ||
− | + | =Changelog= | |
− | + | ||
− | + | ;Version 8.4 | |
+ | |||
+ | * Added: highlighting of erroneous XQuery modules in the project view. | ||
+ | |||
+ | ;Version 8.0 | ||
+ | |||
+ | * Updated: support for dark look and feels; support for JTatto library |
Revision as of 22:39, 9 October 2016
This page is part of the Getting Started Section. The BaseX homepage gives you a visual impression of the graphical user interface (GUI) of BaseX, and an introductory video is available, which presents some of its interactive features.
Contents
Startup
First of all, launch a GUI instance of BaseX. Depending on your operating system, double click on the BaseX GUI start icon or run the basexgui
script. Beside that, some more startup options are available.
Create Database
Select Database → New and browse to an XML document of your choice. As an example, you can start with the factbook.xml
document, which contains statistical information on the worlds' countries. It is included in our official releases and can also be downloaded (1.3 MB). If you type nothing in the input field, an empty database will be created. Next, choose the OK button, and BaseX will create a database that you can visually explore and query.
If no XML document is available, the Text Editor can also be used to create an initial XML document. After saving the entered XML document to harddisk, it can be supplied as database input in the above dialog.
Input Bar
On top of the main window, you can find an input bar. The attached dropdown menu provides three modes: Find, XQuery and Command:
The upcoming example queries can all be used with an instance of the factbook
database:
Find
In the Find mode, the input bar can be used to find single elements and texts in the currently opened database. The following syntax is supported:
Query | Description |
---|---|
city
|
Find elements named city , and texts containing this token.
|
=India
|
Find texts matching the exact string India .
|
~Cing
|
Find texts equal or similar to the token Cingdom .
|
id
|
Find attributes named id and attribute values containing this token.
|
@=f0_119
|
Find attribute values matching the exact string f0_119 .
|
"European Chinese"
|
Find texts containing the phrase "European Chinese" .
|
//city
|
Leading slash: Interpret the input as XPath expression (see below). |
XQuery
In the XQuery mode, XPath and XQuery expressions can be entered in the input bar.
To evaluate the following example queries: enter them in the input bar, and press ENTER or click on the START button:
Query | Description |
---|---|
//country
|
Return all country elements.
|
//country[name = "Switzerland"]
|
Return the country element of "Switzerland".
|
for $city in //city
|
Return the names of all cities with a population larger than one million and order the results by the name of the city. |
Command
In the Command mode, BaseX Commands can be entered and executed. Just try the following examples:
INFO
: Returns system information.CREATE DB TEST
: Creates an empty database named "TEST".LIST
: Lists all databases.
Text Editor
The powerful text editor can be used to write and edit XQuery code (simple queries, modules), XML documents, Command Scripts, and any other textual files:
- XQuery and command scripts can be executed by clicking on the green triangle.
- XQuery, XML and JavaScript will be syntax highlighted.
- XQuery and XML will automatically parsed with each key click, and errors will be highlighted.
Numerous keyboard shortcuts are available to speed up editing and debugging.
Project View
The Project View is attached to the editor panel. It displays all files of the current project directory in a tree structure. Files can be renamed and deleted by right-clicks on the files. The project directory can be changed by clicking on the button with the three dots ...
in the upper left corner of the project view panel.
Erroneous XQuery modules, and all queries importing these modules, will be highlighted. Highlighting can be disabled in the GUI preferences dialog.
Realtime Options
Via the Options menu, you can change how queries are executed and visualized:
- Realtime Execution: If realtime execution is enabled, your searches and queries will be executed with each key click and the results will be instantly shown.
- Realtime Filtering: If enabled, all visualizations will be limited to the actual results in realtime. If this feature is disabled, the query results are highlighted in the visualizations and can be explicitly filtered with the 'Filter' button.
Visualizations
The BaseX GUI offers various visualizations, which help you to explore your XML data instances from different perspectives:
Result
|
Map
|
Tree
|
Folder
|
Plot
|
Table
|
Explorer
|
Info
|
Look and Feels
By default, the Look and Feel of your operating system will be used in the GUI. In the Preferences dialog, you can choose among some more window themes. The JTattoo library offers some more
look and feels. If you download and copy the JTattoo jar file into the |
Changelog
- Version 8.4
- Added: highlighting of erroneous XQuery modules in the project view.
- Version 8.0
- Updated: support for dark look and feels; support for JTatto library