Integrating IntelliJ IDEA

From BaseX Documentation

(Difference between revisions)
Jump to: navigation, search
Line 82: Line 82:
* In the ''New Project'' dialog choose ''Empty Project'' from the left-hand column and click the ''Next'' button.
* In the ''New Project'' dialog choose ''Empty Project'' from the left-hand column and click the ''Next'' button.
* Enter a name and location for your project.
* Enter a name and location for your project.
-
* In the project view, create a new XQuery file, either by right-clicking on the project name and choosing ''New''→''XQuery File'' or by selecting ''New''→''XQuery File'' from the File menu.
+
* In the project view, create a new XQuery file, either by right-clicking on the project name and choosing ''New''→''XQuery File'' or by selecting ''New''→''XQuery File'' from the File menu. Enter a file name and click ''OK''.
* Type in your query.
* Type in your query.
* Click the green ''Run'' button below the IntelliJ IDEA menu bar.
* Click the green ''Run'' button below the IntelliJ IDEA menu bar.
Line 132: Line 132:
** <code>Name = BaseX</code>
** <code>Name = BaseX</code>
** <code>Implementation = BaseX</code> (should be preset!)
** <code>Implementation = BaseX</code> (should be preset!)
-
** <code>Implementation = BaseX</code>
 
** <code>JAR File = basex/BaseX.jar</code>
** <code>JAR File = basex/BaseX.jar</code>
** <code>Hostname = localhost</code>
** <code>Hostname = localhost</code>
Line 142: Line 141:
* The ''Query Processor'' dropdown box in the ''Run/Debug Configurations'' dialog should now also display "BaseX 9.1.1 (BaseX)". If not, select it from the dropdown box.
* The ''Query Processor'' dropdown box in the ''Run/Debug Configurations'' dialog should now also display "BaseX 9.1.1 (BaseX)". If not, select it from the dropdown box.
* Click ''Apply'' and then ''OK'' to close the ''Run/Debug Configurations'' dialog.
* Click ''Apply'' and then ''OK'' to close the ''Run/Debug Configurations'' dialog.
-
 
+
* In the project view, create a new XQuery file, either by right-clicking on the project name and choosing ''New''→''File'' or by selecting ''New''→''File'' from the File menu. Enter a file name and click ''OK''.
-
* In the project view, create a new XQuery file, either by right-clicking on the project name and choosing ''New''→''XQuery File'' or by selecting ''New''→''XQuery File'' from the File menu.
+
* Type in your query.
* Type in your query.
-
* Click the green ''Run'' button below the IntelliJ IDEA menu bar.
+
* Click on the ''Add Configuration'' button once again.
-
* In the ''Edit Configuration'' dialog choose one of the two data source from the dropdown box, either "BaseX" or "BaseX (native embedded)". If you select "BaseX", make sure that BaseX is up and running.
+
* In the ''Run/Debug Configurations'' dialog click the {{Code|+}} button to create a new configuration based on a template.
 +
* Chose the "XQuery" template you configured earlier.
 +
* Enter a name, e.g. "BaseX" into the ''Name'' field.
 +
* The query processor should be preset to "BaseX 9.1.1 (BaseX)".
 +
* In the ''Script File'' field enter the path to your query file.
 +
* Click ''Apply'' and then ''OK'' to close the ''Run/Debug Configurations'' dialog.
 +
* Now, the green ''Run'' button should be available below the IntelliJ IDEA menu bar.
* Click ''Run'' to execute your query.
* Click ''Run'' to execute your query.

Revision as of 14:35, 24 January 2019

This article is part of the Getting Started Section. It describes how to run XPath/XQuery code from within the IntelliJ IDEA IDE. There are currently two XQuery plugins for IntelliJ IDEA on the market:

Contents

Preparations

The following steps apply to all operating systems:

XQuery Support + MarkLogic Debugger

This section focuses on Grzegorz Ligas' XQuery Support plugin.

Installation

After installing IntelliJ IDEA and BaseX, install the XQuery Support plugin by one of the following methods:

From the Start Screen

Intellij-startbildschirm.png

From the IntelliJ IDEA Menu

Setting Up

File Extensions and XQuery Flavor

Intellij-xquery-settings.png

Configuring The Processor

You can set up the plugin as a standalone processor or client.

Standalone

Client

This assumes that you already have a BaseX database named factbook.

Intellij-basex-data-source.png

Querying Your Data

xquery-intellij-plugin

This section focuses on Reece H. Dunn's xquery-intellij-plugin.

Installation

After installing IntelliJ IDEA and BaseX, install the xquery-intellij-plugin by one of the following methods:

From the Start Screen

From the IntelliJ IDEA Menu

Configuring The Processor

Querying Your Data

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export