Loading TOC...

MarkLogic 12 EA 1 Product Documentation
admin:appserver-add-namespace

admin:appserver-add-namespace(
   $config as element(configuration),
   $appserver-id as xs:unsignedLong,
   $namespaces as element(gr:namespace)*
) as element(configuration)

Summary

Add one or more namespaces to an App Server configuration, which will predefine the namespace(s) for all requests evaluated against the App Server.

Parameters
config The configuration for the cluster, typically the result of admin:get-configuration() call.
appserver-id The ID of the App Server. Typically, this is the result of an admin:appserver-get-id call.
namespaces

A list of namespaces to add. Each namespace specification has the following form:


  <namespace xmlns="http://marklogic.com/xdmp/group">
    <prefix>myprefix</prefix>
    <namespace-uri>http://myuri/forthisprefix</namespace-uri>
  </namespace>
	 
Typically the result of an admin:group-namespace call.

Required Privileges

This operation requires at least one of the following privileges:

http://marklogic.com/xdmp/privileges/admin/app-server

http://marklogic.com/xdmp/privileges/admin/app-server/{id}

http://marklogic.com/xdmp/privileges/admin/group

http://marklogic.com/xdmp/privileges/admin/group/{id}

Example


  xquery version "1.0-ml";

  import module namespace admin = "http://marklogic.com/xdmp/admin"
		  at "/MarkLogic/admin.xqy";

  let $config := admin:get-configuration()
  return
  admin:appserver-add-namespace($config,
    admin:appserver-get-id($config,(), "Docs"),
    <namespace xmlns="http://marklogic.com/xdmp/group">
      <prefix>myprefix</prefix>
      <namespace-uri>http://myuri/forthisprefix</namespace-uri>
    </namespace>)

  => The XML for new configuration with this namespace added.  Use
     this as the argument to admin:save-configuration to change
     the configuration.
  

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