Difference between revisions of "Graphical User Interface"
|Line 21:||Line 21:|
In addition to that,
In addition to that, the ''Result'' view displays the output of queries and database operations and the ''Info'' view shows information about database processes and query execution.
Revision as of 11:12, 1 March 2019
This page is part of the Getting Started Section. In addition to its standalone console mode, BaseX comes with its own graphical user interface which offers you great tools for managing, querying and visualizing your (XML) data.
Depending on your operating system, you can launch a GUI instance of BaseX by double-clicking on the BaseX GUI start icon (Windows only) or running the
basexgui script. Additional startup options are listed in the Startup article.
All important features of the BaseX GUI can be accessed from the menu bar. With the Database menu, you can create and manage your XML databases. The Editor menu offers you a variety of tools and options for working with files. Toggle between various Views and Vizualizations to edit and explore your data or set further Options regarding realtime execution, colors, fonts and packages.
The BaseX GUI window is divided into a number of additional bars and panels that can be displayed or hidden using the View or Visualization menu.
On the upper border, right below the menu bar, you can find the Buttons bar and just below that the Input Bar.
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.
You can also toggle between Editor, Result and Info view using the Buttons bar.
To gain further insights into your data, you can choose from various visualizations such as Map, Tree, Folder, Plot, Table and Explorer.
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.
BaseX's built-in editor is a powerful tool which allows you to create and edit XML, JSON and any other kind of text document, write and run XQuery files and modules, assemble Command Scripts and develop RESTXQ applications:
- 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.
Template:Mark: If you right-click on an XML document in the Project view, the selected file will be parsed and bound to the context item:
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.
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
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:
||Find elements named |
||Find texts matching the exact string |
||Find texts equal or similar to the token |
||Find attributes named |
||Find attribute values matching the exact string |
||Find texts containing the phrase |
||Leading slash: Interpret the input as XPath expression (see below).|
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:
||Return all |
||Return the |
||Return the names of all cities with a population larger than one million and order the results by the name of the city.|
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.
The BaseX GUI offers various visualizations, which help you to explore your XML data instances from different perspectives:
Result (View menu)
Info (View menu)
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
- 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