Eclipse Plugin Setup Instructions
XQDT is a set of open source plugins for the Eclipse IDE, providing support for syntax highlighting and content-assisted editing of XQuery modules, and a framework for executing and debugging modules in a supported XQuery interpreter. The MarkLogic-specific extensions currently available add support for MarkLogic's syntax extensions, and auto-completion and integrated reference material for the entire MarkLogic API. Modules can be executed on the server, with results displayed in the IDE. Debugging is not yet supported.
Eclipse requires but does not include a Java Virtual Machine. Most developers will already have Java installed, though non-Java developers on Windows machines may need to install Java before installing Eclipse. Java can generally be obtained here:
While many versions of Java are capable of running Eclipse without any problems, if you have difficulty with these instructions, the version of Java installed on your machine may be the source of the problem. Check eclipse.org for information about versions of Java used in formal testing of Eclipse:
The screenshots herein are from Mac OS X, but binaries for the Eclipse IDE are available for virtually any desktop environment, and XQDT should work on any of them. The version of XQDT we provide can be used with Eclipse 3.6 (Helios) or Eclipse 3.7 (Indigo). Unless you need to run a different version, 3.6 (Helios) is recommended.
The MarkLogic capabilities of XQDT can interoperate with any version of MarkLogic Server. The server need not be running on the workstation where the IDE is installed. An XDBC server must be configured through which XQDT can send semantic validation and module execution requests.
It is beyond the scope of this document to describe the procedure for downloading and installing MarkLogic Server, or to detail the configuration of the server. Assuming you have the server installed and running, enabling XQDT simply requires creating an XDBC server.
In the Admin Interface, navigate to Groups > Default > App Servers.
Select the Create XDBC tab, fill in the required fields, and click Ok
Remember the port number for the new server for use in setting up XQDT.
Before installing XQDT, you need a copy of Eclipse IDE. You will generally be able to install XQDT in an existing copy, but if you prefer to keep your XQDT environment separate, or run into trouble getting XQDT to work properly, you may wish to install a fresh copy. You can download an installer from one of the following links:
Eclipse 3.6.2 (Helios) [ Recommended ]
Eclipse 3.7 (Indigo)
When you launch Eclipse you will be prompted for a workspace location. The workspace will be the parent directory of your eclipse projects. You may wish to check the box indicating that Eclipse should use your workspace at startup automatically. The workspace can always be changed from within Eclipse by selecting File > Switch Workspace from the menu.
If you are using a Windows environment, you may find it easier to install a pre-configured version of Eclipse. This is a 32-bit version of eclipse, which requires a 32-bit version of Java. You can also find a copy of Windows 32-bit Java at java32_usefor64too.zip. This version of Java will run on 32-bit or 64-bit Windows machines.
[ This package contains an older version of the software, so self-installation is recommended. ]
From the menu bar, select File > New > Project...
Choose XQuery / XQuery Project and click [Next...]
Enter a name for your project, and click [Configure interpreters...] to configure XQDT to communicate with MarkLogic Server.
In the interpreters dialog, click [Add...]
Change Interpreter type to "MarkLogic Server" and configure the connection with the URL for accessing your XDBC server, (Example: xcc://localhost:8888), and the username and password for authentication of requests to the server.
Click [Ok] to save the new interpreter, and again to exit the interpreters dialog.
When Eclipse asks if you would like to switch to the XQuery perspective, click [Yes]
From the menu bar, select File > New > XQuery Module
(This option appears if you're in the XQuery perspective. You can also select it from the New > Other... dialog)
Choose a module type and give it a name, click [Finish].
From a module editor window, ensure the module is saved, and run it by selecting Run > Run from the menu bar. There are a number of other ways to run a module, using context menus or toolbar buttons. Your results will be displayed in the Eclipse Console panel. Note that only main modules can be executed.
XQuery Version Prolog
XQDT uses the version prolog to enable MarkLogic-specific features. It is always good practice to begin your modules with a version prolog, in order to guarantee correct behavior independent of the default settings of a particular MarkLogic Server instance. In general, your modules should start with the following:
xquery version "1.0-ml";
XQuery Module Directory
XQDT requires that XQuery modules be stored inside your project directory; XQuery modules outside the project directory can be opened and the XQuery editor will be mostly functional, but some features will not work in this scenario.
XQDT project page at eclipse.org:
Please file bug or enhancement requests in eclipse bugzilla; free account setup is quick and painless.
XQDT commercial adopters website / blog: