Wiki source for ModuleMarkLogic
======Mark Logic Module======
Connectivity to a [[http://www.marklogic.com Mark Logic]] server is supported with an extension module.
Mark Logic support is via an [[Modules Extension Module]]. It must be downloaded separately from xmlsh and added to the classpath in order to run.
=====Download=====
Mark Logic extension module is on sourceforge in the marklogic_ext package under xmlsh.
Dowload the latest binary from [[http://sourceforge.net/projects/xmlsh/files/ xmlsh files]]
Choose the "marklogic_ext" folder and download the latest release.
You also need the latest "XCC" connector .jar file file from [[http://developer.marklogic.com/products/xcc/6.0 XCC for MarkLogic]] (the Java XCC Distribution). The current version of the MarkLogic extension was built using the file "marklogic-xcc-6.0.1.jar".
====Dependancies====
The current ""MarkLogic"" extension (1.20) requires xmlsh version 1.2.4 or greater.
=====Importing=====
Copy the files (marklogic_ext.jar, marklogic-xcc*.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
%%
=====Configuring =====
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.
""xcc://user:password@host:port/Database""
Note: the Port is the port number of an XDBC "Host" defined on the Mark Logic server.
Example
%%
$ MLCONNECT=xcc://me:password@server:8003/Test
%%
Instead of using an environment variable, you can also pass in the connection URI as a command argument using -c or -connect
Example
%%
ml:query -c xcc://me:password@server:8003/Test -q "'Hello World'"
%%
=====SSL / xccs=====
Starting with version 1.10 (2010-12-25) the ""MarkLogic"" extension module supports SSL connections to 4.1 or later servers. SSL is enabled by using the "xccs://" scheme (instead of "xcc://").
Currently only SSL Encryption, not Client and server certificate chain validation is supported.
=====Running=====
Your now ready to run Mark Logic commands from within xmlsh.
The following commands are supported
||[[MarkLogicCreatedir createdir]]||Creates directories||
||[[MarkLogicDel del]]||Deletes documents||
||[[MarkLogicDeldir deldir]]||Deletes directories||
||[[MarkLogicDirexists direxists]]||Tests whether a directory exists||
||[[MarkLogicExists exists]]||Tests whether a document exists||
||[[MarkLogicGet get]]||Gets documents from the server||
||[[MarkLogicGetPermissions get-permissions]]||List document permissions||
||[[MarkLogicInvoke invoke]]||Invokes a remotely stored query||
||[[MarkLogicList list]]||Lists documents||
||[[MarkLogicListCollections list-collections]]||List all collection URI's||
||[[MarkLogicListdir listdir]]||Lists directories||
||[[MarkLogicPut put]]||Puts one or more files to the server||
||[[MarkLogicMoveForest move-forest]]||Move a document from one forest to another||
||[[MarkLogicQuery query]]||Invokes an ad-hoc query||
||[[MarkLogicRename rename]]||Renames (moves) a document||
||[[MarkLogicSetPermissions set-permissions]]||Set document permissions||
----
[[Modules Extension Modules]]
Connectivity to a [[http://www.marklogic.com Mark Logic]] server is supported with an extension module.
Mark Logic support is via an [[Modules Extension Module]]. It must be downloaded separately from xmlsh and added to the classpath in order to run.
=====Download=====
Mark Logic extension module is on sourceforge in the marklogic_ext package under xmlsh.
Dowload the latest binary from [[http://sourceforge.net/projects/xmlsh/files/ xmlsh files]]
Choose the "marklogic_ext" folder and download the latest release.
You also need the latest "XCC" connector .jar file file from [[http://developer.marklogic.com/products/xcc/6.0 XCC for MarkLogic]] (the Java XCC Distribution). The current version of the MarkLogic extension was built using the file "marklogic-xcc-6.0.1.jar".
====Dependancies====
The current ""MarkLogic"" extension (1.20) requires xmlsh version 1.2.4 or greater.
=====Importing=====
Copy the files (marklogic_ext.jar, marklogic-xcc*.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
%%
=====Configuring =====
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.
""xcc://user:password@host:port/Database""
Note: the Port is the port number of an XDBC "Host" defined on the Mark Logic server.
Example
%%
$ MLCONNECT=xcc://me:password@server:8003/Test
%%
Instead of using an environment variable, you can also pass in the connection URI as a command argument using -c or -connect
Example
%%
ml:query -c xcc://me:password@server:8003/Test -q "'Hello World'"
%%
=====SSL / xccs=====
Starting with version 1.10 (2010-12-25) the ""MarkLogic"" extension module supports SSL connections to 4.1 or later servers. SSL is enabled by using the "xccs://" scheme (instead of "xcc://").
Currently only SSL Encryption, not Client and server certificate chain validation is supported.
=====Running=====
Your now ready to run Mark Logic commands from within xmlsh.
The following commands are supported
||[[MarkLogicCreatedir createdir]]||Creates directories||
||[[MarkLogicDel del]]||Deletes documents||
||[[MarkLogicDeldir deldir]]||Deletes directories||
||[[MarkLogicDirexists direxists]]||Tests whether a directory exists||
||[[MarkLogicExists exists]]||Tests whether a document exists||
||[[MarkLogicGet get]]||Gets documents from the server||
||[[MarkLogicGetPermissions get-permissions]]||List document permissions||
||[[MarkLogicInvoke invoke]]||Invokes a remotely stored query||
||[[MarkLogicList list]]||Lists documents||
||[[MarkLogicListCollections list-collections]]||List all collection URI's||
||[[MarkLogicListdir listdir]]||Lists directories||
||[[MarkLogicPut put]]||Puts one or more files to the server||
||[[MarkLogicMoveForest move-forest]]||Move a document from one forest to another||
||[[MarkLogicQuery query]]||Invokes an ad-hoc query||
||[[MarkLogicRename rename]]||Renames (moves) a document||
||[[MarkLogicSetPermissions set-permissions]]||Set document permissions||
----
[[Modules Extension Modules]]