Changes

Jump to navigation Jump to search
1,416 bytes added ,  13:28, 8 March 2019
no edit summary
After installing IntelliJ IDEA and BaseX, install the xquery-intellij-plugin by one of the following methods:
==='''From the Start Screen==='''
[[File:intellij-startbildschirm.png]]
* You will be prompted to restart IDEA to load the new plugin.
==='''From the IntelliJ IDEA Menu==='''
* Select ''Settings'' (Windows)/''Preferences'' (macOS) in the ''IntelliJ IDEA'' menu.
* In the Settings/Preferences window, select ''Plugins''.
==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.
* 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 projectand click on the ''Finish'' button.
==='''Customize the XQuery Module==='''
* Click the ''Add Configuration'' button below the IntelliJ IDEA menu bar.
[[File:Intellij-add-configuration.png]]
* 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''.
* Type in your query , e.g. <code>db:open("factbook")</code>, and save your file.
==='''Create a New Configuration==='''
* 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.
[[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.
* Click the ''Run'' button to execute your query.
=XQuery SupportPlugin=
This section focuses on Grzegorz Ligas' [https://plugins.jetbrains.com/plugin/7262-xquery-support XQuery Support plugin].
After installing IntelliJ IDEA and BaseX, install the XQuery Support plugin by one of the following methods:
==='''From the Start Screen==='''
* Start IntelliJ IDEA and select ''Configure''→''Plugins''.
* You will be prompted to restart IDEA to load the new plugin.
==='''From the IntelliJ IDEA Menu==='''
* Select ''Settings'' (Windows)/''Preferences'' (macOS) from the ''IntelliJ IDEA'' menu.
* In the Settings/Preferences window, select ''Plugins''.
==Setting Up==
==='''File Extensions and XQuery Flavor==='''
* Start IntelliJ IDEA and navigate to ''Settings'' (Windows)/''Preferences'' (macOS) either using the ''Configure'' button on the start screen or the ''IntelliJ IDEA'' menu.
* In the Settings/Preferences window, expand the ''Languages & Frameworks'' item, select ''XQuery'' and choose which default file extensions and which XQuery flavor you would like to use.
==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.
* 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 projectand click on the ''Finish'' button. '''Customize the XQuery Module'''* Click the ''Add Configuration'' button below the IntelliJ IDEA menu bar.[[File:Intellij-add-configuration.png]]* In the project view''Run/Debug Configurations'' dialog, create a new expand the Templates list and choose the ''XQuery file, either by right-clicking Main Module'' entry.* Click on the project name ''Configure'' button next to the ''Data Source'' field and choosing either choose the previously configured standalone version (''BaseX (native embedded)'' item) or the client version (''BaseX'' item) from the list.* Click ''NewApply''and then ''XQuery FileOK'' or by selecting to close the ''NewRun/Debug Configurations''dialog. ''XQuery 'Create a Query File'' from '* In the project view, create a new XQuery file by right-clicking on the project name and choosing New→XQuery File menu. Enter a file name and click , select ''Main Module'' from the ''OKKind''dropdown and click OK.* Type in your queryand save your file.
[[File:Intellij-query.png]]
 '''Create a New Configuration'''* Click on the green ''RunAdd Configuration'' button below the IntelliJ IDEA menu baronce again.* In the ''Edit ConfigurationRun/Debug Configurations'' dialog, choose one of click the two data sources from {{Code|+}} button to create a new configuration based on a template.* Choose the dropdown box"XQuery Main Module" template you configured earlier.* Enter a name, either e.g. "BaseX" or , into the ''Name'' field.* The data source should be preset either to "BaseX (native embedded)"or ''BaseX'' depending on your processor configuration.* In the ''Main file'' field, enter the path to your query file.[[File:Intellij-xquery-configuration2.png]]* Click ''Apply'' and then ''OK'' to close the ''Run/Debug Configurations'' dialog. * 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]]  '''Execute Your Query'''* If you select "BaseX"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.
administrator, editor
162

edits

Navigation menu