Loading TOC...

MarkLogic 9 Product Documentation
plugin:register

plugin:register(
   $capabilities as map:map,
   $plugin-uri as xs:string
) as xs:string

Summary

This function registers the capabilities map for use by MarkLogic Server. It returns the URI of the plugin.

Parameters
capabilities The map of capabilities to be registered.
plugin-uri An identifier that uniquely identifies this plugin. If a plugin is added with the same identifier as an existing plugin, then the newly registered plugin will be used.

Required Privileges

http://marklogic.com/xdmp/privileges/plugin-register

Example

  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. :)
      

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