Wiki source for ModuleExist


Show raw source

======eXist Module======

**//NOTE: The eXist module is currently in PRE-ALPHA stage. For testing only. Do not use in production environements !//**


Connectivity to a [[http://exist-db.org/ eXist-db]] server is supported with an extension module.

eXist support is via an [[Modules 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 [[http://sourceforge.net/projects/xmlsh/files/ 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 $XMODPATH
Suggested 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 [[ExistCommonOptions eXist Common Options]]


=====Running=====
Your now ready to run eXist commands from within xmlsh.

The following commands are supported

||[[ExistDel del]]||Deletes a resource||
||[[ExistGet get]]||Gets a resource||
||[[ExistInvoke invoke]]||Invokes a stored query||
||[[ExistPut put]]||Puts (stores) a resource.||
||[[ExistQuery query]]||Invokes an 'ad-hoc' query||
||[[ExistList list]]||Lists contents of a collection||


----
[[Modules Extension Modules]]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki