Connectivity to a Mark Logic server is supported with an extension module.
Mark Logic support is via an Extension Module. It must be downloaded separately from xmlsh and added to the classpath in order to run.
Dowload the latest binary from xmlsh files
Choose the "marklogic_ext" folder and download the latest release.
You also need the latest "XCC" connector .jar file file from XCC for MarkLogic (the Java XCC Distribution). The current version of the MarkLogic extension was built using the file "marklogic-xcc-5.0.1.jar".
Copy the files (marklogic_ext.jar, marklogic-xcc-5.0.1.jar, module.xml) to a directory named "marklogic" as a sub-directory of any path in the XMODPATH directory.
If you are using a different version of the marklogic XCC jar then you can edit module.xml to reflect the actual file used.
Import the marklogic 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
Assuming you put the marklogic files in the directory /usr/local/xmlsh/ext/marklogic
XMODPATH=/usr/local/xmlsh/ext import module ml=marklogic
To run Mark Logic commands you need to configure the connection information to access your Mark Logic server. All the Mark Logic commands require an environment variable, MLCONNECT to specify the connection. The format is the URI used by the XCC API.
Note: the Port is the port number of an XDBC "Host" defined on the Mark Logic server.
Instead of using an environment variable, you can also pass in the connection URI as a command argument using -c or -connect
ml:query -c xcc://me:password@server:8003/Test -q "'Hello World'"
Currently only SSL Encryption, not Client and server certificate chain validation is supported.
The following commands are supported
|direxists||Tests whether a directory exists|
|exists||Tests whether a document exists|
|get||Gets documents from the server|
|get-permissions||List document permissions|
|invoke||Invokes a remotely stored query|
|list-collections||List all collection URI's|
|put||Puts one or more files to the server|
|move-forest||Move a document from one forest to another|
|query||Invokes an ad-hoc query|
|rename||Renames (moves) a document|
|set-permissions||Set document permissions|