eXist Module
NOTE: The eXist module is currently in PRE-ALPHA stage. For testing only. Do not use in production environements !
Connectivity to a eXist-db server is supported with an extension module.
eXist support is via an Extension Module. It must be downloaded separately from xmlsh and imported to run.
Download
eXist extension module is on sourceforge in the exist_ext package under xmlsh.Dowload the latest binary from xmlsh files
Choose the "exist_ext" folder and download the latest release.
Dependancies
The current eXist extension (0.4) requires xmlsh version 1.1.8 or greater.Installing
Like all extension modules you must install the files under bin/ into a directory under $XMODPATHSuggested is to use $XMODPATH/exist and it should contain only the files from the bin/ directory (module.xml, exist_ext.jar)
Importing
Import the eXist extension in xmlsh with an "import module" statement.
The module can be found using the XMODPATH variable or explicitly by specifying the module.xml file
Copy the files in the "bin" direcectory to a directory named "exist" as a sub-directory of any path in the XMODPATH directory.
Then import the module using the "import module" command
Assuming you put the eXist files in the directory /usr/local/xmlsh/ext/exist
XMODPATH=/usr/local/xmlsh/ext import module e=exist
Configuring
To run eXist commands you need to configure the connection information to access your eXist-db server. All exist commands require a connection string, and optional authentication and connection related parameters.
The connection string and (optional) authentication can be supplied via command line arguments or environment variables.
The examples shown assume environment variables.
Supported eXist Environment variables
Name | Meaning | Example |
EXIST_CONNECT | Connection URL to REST protocol on your eXist server | http://localhost:8080/exist/rest |
EXIST_USER | Username | admin |
EXIST_PASSWORD | Password | mypass |
Example
$ EXIST_CONNECT=http://localhost:8080/exist/rest
Instead of using an environment variable, you can also pass in the connection URI as a command argument using -c or -connect, the username via -user and the password via -password.
Example
e:query -c http://localhost:8080/exist/rest -q "'Hello World'"
Common Parameters
All eXist commands support a set of common command arguments. These are detailed in eXist Common OptionsRunning
Your now ready to run eXist commands from within xmlsh.The following commands are supported
del | Deletes a resource |
get | Gets a resource |
invoke | Invokes a stored query |
put | Puts (stores) a resource. |
query | Invokes an 'ad-hoc' query |
list | Lists contents of a collection |
Extension Modules