Integrating IntelliJ IDEA

From BaseX Documentation

(Difference between revisions)
Jump to: navigation, search
Line 49: Line 49:
==Querying Your Data==
==Querying Your Data==
 +
===Create a New Project===
* To create a new project choose the ''Create new project'' option from the start screen or select ''New''→''Project...'' from the ''File'' menu.
* To create a new project choose the ''Create new project'' option from the start screen or select ''New''→''Project...'' from the ''File'' menu.
* 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.
 +
 +
===Customize the XQuery Module===
* Click the ''Add Configuration'' button below the IntelliJ IDEA menu bar.
* Click the ''Add Configuration'' button below the IntelliJ IDEA menu bar.
[[File:Intellij-add-configuration.png]]
[[File:Intellij-add-configuration.png]]
Line 71: Line 74:
* 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.
 +
 +
===Create a Query File===
* 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''→''File'' or by selecting ''New''→''File'' from the File menu. Enter a file name and click ''OK''.
-
* Type in your query.
+
* Type in your query and save your file.
 +
 
 +
===Create a New Configuration===
* Click on the ''Add Configuration'' button once again.
* Click on the ''Add Configuration'' button once again.
* In the ''Run/Debug Configurations'' dialog, click the {{Code|+}} button to create a new configuration based on a template.
* In the ''Run/Debug Configurations'' dialog, click the {{Code|+}} button to create a new configuration based on a template.
Line 83: Line 90:
* Now, the configuration should be set and the green ''Run'' button should be available below the IntelliJ IDEA menu bar.
* Now, the configuration should be set and the green ''Run'' button should be available below the IntelliJ IDEA menu bar.
[[File:Intellij-run-button.png]]
[[File:Intellij-run-button.png]]
 +
 +
===Execute Your Query===
* If the configuration does not run as a standalone instance, make sure that BaseX is up and running.
* If the configuration does not run as a standalone instance, make sure that BaseX is up and running.
* Click the ''Run'' button to execute your query.
* Click the ''Run'' button to execute your query.

Revision as of 10:36, 8 March 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 and both plugins:

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

Intellij-xquery-settings-2.png

Querying Your Data

Create a New Project

Customize the XQuery Module

Intellij-add-configuration.png

Intellij-new-query-processor.png

Create a Query File

Create a New Configuration

Intellij-xquery-configuration.png

Intellij-run-button.png

Execute Your Query

XQuery Support

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

Intellij-query.png

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export