Loading TOC...

MarkLogic 9 Product Documentation
plugin:install-from-zip

plugin:install-from-zip(
   $scope as xs:string,
   $zip as binary()
) as xs:integer

Summary

Installs a Library Module plugin from a zip file provided as a parameter into the Extensions database. Any application that calls this function must do so through a function amped to the application-plugin-registrar role. Returns an integer representing the number of plugins installed.

Parameters
scope A scope identifier. This must be a "dotted" package-style path, which will be resolved relative to the marklogic-dir/Assets/plugins directory. For example, a $scope value of my-plugin-scope is resolved to the marklogic-dir/Assets/plugins/myplugin-scope directory and a $scope value of my.plugin.scope is resolved to the marklogic-dir/Assets/plugins/my/plugin/scope directory.
zip A zip file, consisting of the zipped directory of a Library Module plugin (that is, manifest.xml must exist at the root level, with assets/ and lib/ subdirectories).

Example

xquery version "1.0-ml"; 
 
import module namespace plugin = "http://marklogic.com/extension/plugin" 
      at "/MarkLogic/plugin/plugin.xqy";

plugin:install-from-zip("
      marklogic.appservices.collector-test", 
      xdmp:document-get("Assets/plugins/marklogic/appservices/collector-test.zip")/node())

(: Installs the plugin code from the 'collector-test.zip' file. :)         
      

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.