
plugin:register( $capabilities as map:map, $plugin-uri as xs:string ) as xs:string
This function registers the capabilities map for use by MarkLogic Server. It returns the URI of the plugin.
http://marklogic.com/xdmp/privileges/plugin-register
xquery version "1.0-ml";
declare namespace testdoc = "http://marklogic.com/extension/plugin/testdoc";
import module namespace plugin = "http://marklogic.com/extension/plugin"
at "/MarkLogic/plugin/plugin.xqy";
declare function testdoc:capabilities()
as map:map
{
let $map := map:map()
let $_ := map:put($map,
"http://marklogic.com/appservices/infostudio/collector/model",
xdmp:function(xs:QName("testdoc:model")))
let $_ := map:put($map,
"http://marklogic.com/appservices/infostudio/collector/start",
xdmp:function(xs:QName("testdoc:start")))
let $_ := map:put($map,
"http://marklogic.com/appservices/infostudio/collector/config-view",
xdmp:function(xs:QName("testdoc:view")))
let $_ := map:put($map,
"http://marklogic.com/appservices/infostudio/collector/cancel",
xdmp:function(xs:QName("testdoc:cancel")))
let $_ := map:put($map,
"http://marklogic.com/appservices/infostudio/collector/abort",
xdmp:function(xs:QName("testdoc:abort")))
let $_ := map:put($map,
"http://marklogic.com/appservices/infostudio/collector/validate",
xdmp:function(xs:QName("testdoc:validate")))
let $_ := map:put($map, "http://marklogic.com/appservices/string",
xdmp:function(xs:QName("testdoc:string")))
return $map
};
(: Implement the functions in the capabilities map. :)
plugin:register(testdoc:capabilities(), "testdoc.xqy")
(: Registers the capabilities in the map for this plugin. :)