Difference between revisions of "Graphical User Interface"
(48 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | This page is part of the [[Getting Started]] Section. | + | This page is part of the [[Getting Started]] Section. BaseX comes with a graphical user interface that offers you marvellous tools for managing, querying and visualizing your data and write complex applications in XQuery. |
=Startup= | =Startup= | ||
− | + | The graphical user interface can be started as follows: | |
+ | |||
+ | * If you have installed BaseX on ''Windows'', click on the '''BaseX GUI''' icon. | ||
+ | * Run one of the {{Code|[[Start_Scripts#Linux.2FMac:_basex|basexgui]]}} or {{Code|[[Start Scripts#Windows: basex.bat|basexgui.bat]]}} scripts. | ||
+ | * You can also double-click on the {{Code|BaseX.jar}} file (this way, no libraries will be added). | ||
+ | * For developers: type in {{Code|mvn exec:java}} in the main directory of the {{Code|basex}} project. | ||
+ | |||
+ | Some additional [[Command-Line_Options#GUI|command-line options]] are available. | ||
+ | |||
+ | Please note that the standalone client must not be used if you perform parallel (concurrent) read and write operations on your databases. See [[Startup#Concurrent Operations|Concurrent Operations]] for more details. | ||
+ | |||
+ | =Introduction= | ||
+ | |||
+ | The BaseX GUI window is divided into various bars and panels. | ||
+ | |||
+ | At the top of the BaseX window, the menu bar resides. It houses all important features of the BaseX GUI. Use the ''Database'' menu to [[Graphical_User_Interface#Database Management|create and manage your XML databases]]. The ''Editor'' menu gives you access to a variety of tools and options for working with files. The ''View'' menu lets you toggle between the bars and panels described below. The ''Vizualization'' menu offers you a comprehensive set of data representations that will help you to understand your data even better. Use the ''Options'' menu to set your preferences regarding realtime execution, colors, fonts and packages. | ||
+ | |||
+ | [[File:Basex-menu-bar.png|600px]] | ||
+ | |||
+ | Right below the menu bar, you can find the ''Buttons'' bar and just below that the ''Input Bar''. The ''Buttons'' bar offers you a wide range of shortcuts, mostly for menu options, such as managing databases and displaying views and visualizations, but also for navigating through your data. With the [[Graphical_User_Interface#Input Bar|''Input Bar'']], you can query your data using three different kinds of query syntax. | ||
+ | |||
+ | [[File:Basex-buttons-input-bar.png]] | ||
+ | |||
+ | The ''Status Bar'' is situated at the bottom of the BaseX window. | ||
+ | |||
+ | The BaseX [[Graphical_User_Interface#Editor|editor]] consists of the ''Project'' view, a file browser with optional input fields for searching files, and the actual ''Editor'' panel with buttons for creating, opening, saving, searching, executing and debugging your files. | ||
+ | |||
+ | [[File:Basex-editor-panel.png]] | ||
+ | |||
+ | In addition to that, the ''Result'' view displays the output of queries and database operations and the ''Info'' view shows you information about database processes and query execution. | ||
+ | |||
+ | [[File:Basex-result-info-panel.png]] | ||
+ | |||
+ | To gain further insights into your data, you can choose to display various [[Graphical_User_Interface#Visualizations|visualizations]] such as ''Map'', ''Tree'', ''Folder'', ''Plot'', ''Table'' and ''Explorer''. | ||
=Database Management= | =Database Management= | ||
− | The BaseX GUI is a great place for creating and | + | The BaseX GUI is a great place for creating and managing your XML databases. |
To '''create a new database''', select ''Database'' → ''New'' from the menu and browse to an XML document of your choice. You can start with the {{Code|factbook.xml}} document, which contains statistical information on the worlds' countries. It is included in the {{Code|etc}} directory of our [http://basex.org/download full distributions] ( ZIP Package and Windows Installer) or can be downloaded [http://files.basex.org/xml/factbook.xml here] (1.3 MB). In the ''Create Database'' dialog, specify the path to your input file and the name of the new database. If you leave the input file field empty, an empty database will be created. Click the ''OK'' button to create the database. | To '''create a new database''', select ''Database'' → ''New'' from the menu and browse to an XML document of your choice. You can start with the {{Code|factbook.xml}} document, which contains statistical information on the worlds' countries. It is included in the {{Code|etc}} directory of our [http://basex.org/download full distributions] ( ZIP Package and Windows Installer) or can be downloaded [http://files.basex.org/xml/factbook.xml here] (1.3 MB). In the ''Create Database'' dialog, specify the path to your input file and the name of the new database. If you leave the input file field empty, an empty database will be created. Click the ''OK'' button to create the database. | ||
Line 13: | Line 46: | ||
'''Note:''' You can also use the GUI's [[Graphical_User_Interface#Editor|editor]] to create and edit your own XML document. Just specify it as input file for the creation of a new database after saving the document to disk. | '''Note:''' You can also use the GUI's [[Graphical_User_Interface#Editor|editor]] to create and edit your own XML document. Just specify it as input file for the creation of a new database after saving the document to disk. | ||
− | To '''open, rename, copy or drop a database''', choose ''Database'' → ''Open & Manage...'' from the menu. Select one of the available databases on the left-hand side and click on one of the buttons on the right: ''Open'', ''Rename | + | To '''open, rename, copy or drop a database''', choose ''Database'' → ''Open & Manage...'' from the menu. Select one of the available databases on the left-hand side and click on one of the buttons on the right: ''Open'', ''Rename'', ''Copy'' or ''Drop''. To open a database, you can also double-click on the database name. |
− | Opening a database activates three more options in the ''Database'' menu | + | Opening a database activates three more options in the ''Database'' menu: |
+ | |||
+ | * The ''Properties'' item gives you access to a variety of database options and information: | ||
+ | ** Add resources and/or set parsing preferences. | ||
+ | ** Gain insights into element and attribute names, paths and other meta information. | ||
+ | ** Create and manage text, attribute, token and full-text indexes. Customize indexes by specifying language, stemming, case-sensitivity and diacritics settings or include a stop word list. | ||
+ | * With the ''Export'' item, you can serialize your database into a whole range of different output formats, including XML, JSON and CSV. | ||
+ | * The ''Close'' item closes the database. Currently open databases are closed automatically as soon as another database is opened. | ||
+ | |||
+ | '''Note:''' You can also access the menu options ''New'', ''Open & Manage'', ''Properties'' and ''Close'' from BaseX's Buttons bar. | ||
+ | |||
+ | [[File:Basex-buttons-bar-database.png]] | ||
=Editor= | =Editor= | ||
− | + | The built-in editor of BaseX is a powerful tool which allows you to edit text documents (XML, JSON, JavaScript, …), write and run XQuery files and modules, assemble [[Commands#Basics|Command Scripts]] and develop [[RESTXQ]] applications: | |
− | * XQuery, XML and JSON files will be '''parsed''' in realtime | + | * The editor offers '''Syntax highlighting''' for XML, XQuery, JSON and JavaScript files. |
− | * XQuery code and command scripts can be '''executed''' (via Ctrl Enter | + | * XQuery, XML and JSON files will be '''parsed''' in realtime and '''errors''' will be highlighted. |
− | + | * XQuery code and command scripts can be '''executed''' (via Ctrl Enter or by clicking on the green triangle). | |
Numerous [[Shortcuts|keyboard shortcuts]] are available to speed up editing and debugging. Some examples: | Numerous [[Shortcuts|keyboard shortcuts]] are available to speed up editing and debugging. Some examples: | ||
Line 30: | Line 74: | ||
* Ctrl .: Jump to the next erroneous code in your project. | * Ctrl .: Jump to the next erroneous code in your project. | ||
− | + | If you right-click on an XML document in the ''Project'' view, the selected file will be parsed and bound to the context item: | |
[[Image:BaseX-Editor-Context.png|449px]] | [[Image:BaseX-Editor-Context.png|449px]] | ||
Line 36: | Line 80: | ||
==Project View== | ==Project View== | ||
− | The Project | + | 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-clicking on the files. The project directory can be changed as well; the most recent directories will be kept in the history. |
All XQuery files in the project directory will be parsed in the background. Buggy XQuery modules, and files importing these modules, will be marked red. With the text fields on top, you can interactively search for file names and contents. | All XQuery files in the project directory will be parsed in the background. Buggy XQuery modules, and files importing these modules, will be marked red. With the text fields on top, you can interactively search for file names and contents. | ||
+ | |||
+ | {{Mark|Updated with Version 9.3:}} If a directory contains a {{Code|.ignore}} file, its files and contents will be ignored. | ||
=Input Bar= | =Input Bar= | ||
− | + | The ''Input Bar'' is situated on top of the main window. It offers you three different modes to query your XML databases: '''Find''', '''XQuery''' and '''Command'''. | |
[[Image:InputBar.png|Input Bar]] | [[Image:InputBar.png|Input Bar]] | ||
Line 62: | Line 108: | ||
|Find texts matching the exact string {{Code|India}}. | |Find texts matching the exact string {{Code|India}}. | ||
|- | |- | ||
− | |<code>~ | + | |<code>~Cingdom</code> |
|Find texts equal or similar to the token {{Code|Cingdom}}. | |Find texts equal or similar to the token {{Code|Cingdom}}. | ||
|- | |- | ||
− | |<code>id</code> | + | |<code>@id</code> |
|Find attributes named {{Code|id}} and attribute values containing this token. | |Find attributes named {{Code|id}} and attribute values containing this token. | ||
|- | |- | ||
Line 82: | Line 128: | ||
In the '''XQuery''' mode, XPath and XQuery expressions can be entered in the input bar. | In the '''XQuery''' mode, XPath and XQuery expressions can be entered in the input bar. | ||
− | To evaluate the following example queries | + | To evaluate the following example queries, type them in the input bar and press Enter or click on the ''Run query'' button (green triangle) adjacent to the input bar: |
{| class="wikitable" | {| class="wikitable" | ||
Line 100: | Line 146: | ||
==Command== | ==Command== | ||
− | In the '''Command''' mode, [[Commands| | + | In the '''Command''' mode, BaseX [[Commands|Commands]] can be entered and executed. Just try the following examples: |
* <code>INFO</code>: Returns system information. | * <code>INFO</code>: Returns system information. | ||
* <code>CREATE DB TEST</code>: Creates an empty database named "TEST". | * <code>CREATE DB TEST</code>: Creates an empty database named "TEST". | ||
* <code>LIST</code>: Lists all databases. | * <code>LIST</code>: Lists all databases. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=Visualizations= | =Visualizations= | ||
Line 118: | Line 157: | ||
which help you to explore your XML data instances from different perspectives: | which help you to explore your XML data instances from different perspectives: | ||
− | <table cellpadding="0" cellspacing="10"><tr><td valign="top"> | + | <table cellpadding="0" cellspacing="10"><tr><td valign="top" width="50%"> |
− | [[Image:Result.png|thumb| | + | [[Image:Result.png|thumb|200px|Result View]] |
+ | |||
+ | '''Result''' (''View'' menu) | ||
+ | :Displays query results and other textual output (e.g. content of the currently open database). Query results can be saved in a file. | ||
+ | </td><td valign="top" width="50%"> | ||
+ | [[Image:InfoView.png|thumb|200px|Info View]] | ||
− | ''' | + | '''Info''' (''View'' menu) |
− | : | + | :Helpful for analyzing the query plans of your XQuery expressions. It also displays information on the compilation and evaluation of queries. |
− | </td><td valign="top"> | + | </td></tr><tr><td valign="top" width="50%"> |
− | [[Image:Map.png|thumb|Map View]] | + | [[Image:Map.png|thumb|200px|Map View]] |
'''Map''' | '''Map''' | ||
:Displays all data in a [http://en.wikipedia.org/wiki/Treemap TreeMap]. All nodes of the XML document are represented as rectangles, filling the complete area. You can choose different layout algorithms in the Menu ''Options'' → ''Map Layout''. | :Displays all data in a [http://en.wikipedia.org/wiki/Treemap TreeMap]. All nodes of the XML document are represented as rectangles, filling the complete area. You can choose different layout algorithms in the Menu ''Options'' → ''Map Layout''. | ||
− | </td | + | </td><td valign="top" width="50%"> |
− | [[Image:Tree.png|thumb|Tree View]] | + | [[Image:Tree.png|thumb|200px|Tree View]] |
'''Tree''' | '''Tree''' | ||
:Displays all XML nodes in a top down tree with edges and nodes. You can change some settings of the Tree in the Menu ''Options'' → ''Tree Options''. | :Displays all XML nodes in a top down tree with edges and nodes. You can change some settings of the Tree in the Menu ''Options'' → ''Tree Options''. | ||
− | </td><td valign="top"> | + | </td></tr><tr><td valign="top" width="50%"> |
− | [[Image:Folder.png|thumb|Folder View]] | + | [[Image:Folder.png|thumb|200px|Folder View]] |
'''Folder''' | '''Folder''' | ||
:Displays all nodes in an Explorer-like folder view. Nodes can be expanded or closed by clicking on the arrows. | :Displays all nodes in an Explorer-like folder view. Nodes can be expanded or closed by clicking on the arrows. | ||
− | </td | + | </td><td valign="top" width="50%"> |
− | [[Image:Scatterplot.png|thumb|Scatterplot View]] | + | [[Image:Scatterplot.png|thumb|200px|Scatterplot View]] |
'''Plot''' | '''Plot''' | ||
:Displays all nodes in a scatterplot, which is particularly helpful if you want to explore analyze your data. Three drop down menus allow custom axis assignments. | :Displays all nodes in a scatterplot, which is particularly helpful if you want to explore analyze your data. Three drop down menus allow custom axis assignments. | ||
− | </td><td valign="top"> | + | </td></tr><tr><td valign="top" width="50%"> |
− | [[Image:Table.png|thumb|The Table View]] | + | [[Image:Table.png|thumb|200px|The Table View]] |
'''Table''' | '''Table''' | ||
:Comes in handy if your data is highly regular. It displays all nodes in a table with rows and columns. Different assignments can be chosen by clicking on the arrow in the right upper corner. | :Comes in handy if your data is highly regular. It displays all nodes in a table with rows and columns. Different assignments can be chosen by clicking on the arrow in the right upper corner. | ||
− | </td | + | </td><td valign="top" width="50%"> |
− | [[Image:Explorer.png|thumb|Explorer View]] | + | [[Image:Explorer.png|thumb|200px|Explorer View]] |
'''Explorer''' | '''Explorer''' | ||
:Can be used to explore the contents of your database via drop-down menus, search fields and double sliders. | :Can be used to explore the contents of your database via drop-down menus, search fields and double sliders. | ||
− | </td>< | + | </td></tr></table> |
− | + | ||
+ | =Realtime Options= | ||
− | ''' | + | In 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. | ||
− | =Look and | + | =Look and Feel= |
<table> | <table> | ||
<tr> | <tr> | ||
− | <td> | + | <td valign="top"> |
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 | + | In the ''Preferences'' dialog, you can choose from additional window themes. |
The [http://www.jtattoo.net/ScreenShots.html JTattoo library] offers some more | 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}} | look and feels. If you download and copy the JTattoo jar file into the {{Code|lib}} | ||
directory provided by the ZIP and EXE distribution of BaseX, | directory provided by the ZIP and EXE distribution of BaseX, | ||
− | 13 additional | + | 13 additional themes will get available. |
</td> | </td> | ||
<td>[[Image:defaultlaf.png|thumb|Default Look & Feel]]</td> | <td>[[Image:defaultlaf.png|thumb|Default Look & Feel]]</td> | ||
Line 179: | Line 225: | ||
=Changelog= | =Changelog= | ||
+ | |||
+ | ;Version 9.3 | ||
+ | |||
+ | * Updated: Project View: ignore directories with {{Code|.ignore}} file | ||
;Version 9.1 | ;Version 9.1 |
Revision as of 16:41, 27 February 2020
This page is part of the Getting Started Section. BaseX comes with a graphical user interface that offers you marvellous tools for managing, querying and visualizing your data and write complex applications in XQuery.
Contents
Startup
The graphical user interface can be started as follows:
- If you have installed BaseX on Windows, click on the BaseX GUI icon.
- Run one of the
basexgui
orbasexgui.bat
scripts. - You can also double-click on the
BaseX.jar
file (this way, no libraries will be added). - For developers: type in
mvn exec:java
in the main directory of thebasex
project.
Some additional command-line options are available.
Please note that the standalone client must not be used if you perform parallel (concurrent) read and write operations on your databases. See Concurrent Operations for more details.
Introduction
The BaseX GUI window is divided into various bars and panels.
At the top of the BaseX window, the menu bar resides. It houses all important features of the BaseX GUI. Use the Database menu to create and manage your XML databases. The Editor menu gives you access to a variety of tools and options for working with files. The View menu lets you toggle between the bars and panels described below. The Vizualization menu offers you a comprehensive set of data representations that will help you to understand your data even better. Use the Options menu to set your preferences regarding realtime execution, colors, fonts and packages.
Right below the menu bar, you can find the Buttons bar and just below that the Input Bar. The Buttons bar offers you a wide range of shortcuts, mostly for menu options, such as managing databases and displaying views and visualizations, but also for navigating through your data. With the Input Bar, you can query your data using three different kinds of query syntax.
File:Basex-buttons-input-bar.png
The Status Bar is situated at the bottom of the BaseX window.
The BaseX editor consists of the Project view, a file browser with optional input fields for searching files, and the actual Editor panel with buttons for creating, opening, saving, searching, executing and debugging your files.
In addition to that, the Result view displays the output of queries and database operations and the Info view shows you information about database processes and query execution.
File:Basex-result-info-panel.png
To gain further insights into your data, you can choose to display various visualizations such as Map, Tree, Folder, Plot, Table and Explorer.
Database Management
The BaseX GUI is a great place for creating and managing your XML databases.
To create a new database, select Database → New from the menu and browse to an XML document of your choice. You can start with the factbook.xml
document, which contains statistical information on the worlds' countries. It is included in the etc
directory of our full distributions ( ZIP Package and Windows Installer) or can be downloaded here (1.3 MB). In the Create Database dialog, specify the path to your input file and the name of the new database. If you leave the input file field empty, an empty database will be created. Click the OK button to create the database.
Note: You can also use the GUI's editor to create and edit your own XML document. Just specify it as input file for the creation of a new database after saving the document to disk.
To open, rename, copy or drop a database, choose Database → Open & Manage... from the menu. Select one of the available databases on the left-hand side and click on one of the buttons on the right: Open, Rename, Copy or Drop. To open a database, you can also double-click on the database name.
Opening a database activates three more options in the Database menu:
- The Properties item gives you access to a variety of database options and information:
- Add resources and/or set parsing preferences.
- Gain insights into element and attribute names, paths and other meta information.
- Create and manage text, attribute, token and full-text indexes. Customize indexes by specifying language, stemming, case-sensitivity and diacritics settings or include a stop word list.
- With the Export item, you can serialize your database into a whole range of different output formats, including XML, JSON and CSV.
- The Close item closes the database. Currently open databases are closed automatically as soon as another database is opened.
Note: You can also access the menu options New, Open & Manage, Properties and Close from BaseX's Buttons bar.
File:Basex-buttons-bar-database.png
Editor
The built-in editor of BaseX is a powerful tool which allows you to edit text documents (XML, JSON, JavaScript, …), write and run XQuery files and modules, assemble Command Scripts and develop RESTXQ applications:
- The editor offers Syntax highlighting for XML, XQuery, JSON and JavaScript files.
- XQuery, XML and JSON files will be parsed in realtime and errors will be highlighted.
- XQuery code and command scripts can be executed (via Ctrl Enter or by clicking on the green triangle).
Numerous keyboard shortcuts are available to speed up editing and debugging. Some examples:
- Ctrl H: Search the currently selected string in your complete project.
- Ctrl .: Jump to the next erroneous code in your project.
If you right-click on an XML document in the Project view, the selected file will be parsed and bound to the context item:
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-clicking on the files. The project directory can be changed as well; the most recent directories will be kept in the history.
All XQuery files in the project directory will be parsed in the background. Buggy XQuery modules, and files importing these modules, will be marked red. With the text fields on top, you can interactively search for file names and contents.
Template:Mark If a directory contains a .ignore
file, its files and contents will be ignored.
Input Bar
The Input Bar is situated on top of the main window. It offers you three different modes to query your XML databases: 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 .
|
~Cingdom
|
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, type them in the input bar and press Enter or click on the Run query button (green triangle) adjacent to the input bar:
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.
Visualizations
The BaseX GUI offers various visualizations, which help you to explore your XML data instances from different perspectives:
Result (View menu)
|
Info (View menu)
|
Map
|
Tree
|
Folder
|
Plot
|
Table
|
Explorer
|
Realtime Options
In 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.
Look and Feel
By default, the Look and Feel of your operating system will be used in the GUI. In the Preferences dialog, you can choose from additional window themes. The JTattoo library offers some more
look and feels. If you download and copy the JTattoo jar file into the |
Changelog
- Version 9.3
- Updated: Project View: ignore directories with
.ignore
file
- Version 9.1
- Added: Project View, set XML document as context.
- 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