This page was generated
January  28,  2016
4:06  AM
XQuery & XSLT Built-In & Modules Function Reference

Module: Admin Library - Mimetypes Functions

Function Summary
admin:mimetype This function constructs a mimetype specification.
admin:mimetypes-add This function adds mimetypes to the configuration.
admin:mimetypes-delete This function deletes mimetypes from the configuration.
admin:mimetypes-get This function returns all the mimetypes from the configuration.
Function Detail
admin:mimetype(
$name as xs:string,
$extensions as xs:string,
$format as xs:string
)  as   element(mt:mimetype)
Summary:

This function constructs a mimetype specification.

Parameters:
$name : The name of the mimetype.
$extensions : The extension(s) for the mimetype.
$format : A valid format for the mimetype. Must be on of: binary,xml, or text.

Example:
  xquery version "1.0-ml";

  import module namespace admin = "http://marklogic.com/xdmp/admin" 
      at "/MarkLogic/admin.xqy";
  return  
  admin:mimetype("application/foo","foo bar","binary")
  (: returns the mimetype specification :)  
  

admin:mimetypes-add(
$config as element(configuration),
$mimetypes as element(mt:mimetype)*
)  as   element(configuration)
Summary:

This function adds mimetypes to the configuration. This function always requires a server restart to take effect.

Parameters:
$config : A configuration specification, typically as returned from one of the Admin module functions.
$mimetypes : A mimetype specification, typically the result of an admin:mimetype call.

Example:
  xquery version "1.0-ml";

  import module namespace admin = "http://marklogic.com/xdmp/admin" 
      at "/MarkLogic/admin.xqy";
    
  let $config := admin:get-configuration()
  let $mimetype := admin:mimetype("application/foo","foo bar","binary")
  return
  admin:mimetypes-add($config, $mimetype)
  (: returns the new configuration element -- use admin:save-configuration
     to save the changes to the configuration or pass the configuration
     to other Admin API functions to make other changes.  :)  
  

admin:mimetypes-delete(
$config as element(configuration),
$mimetypes as element(mt:mimetype)*
)  as   element(configuration)
Summary:

This function deletes mimetypes from the configuration. This function always requires a server restart to take effect.

Parameters:
$config : A configuration specification, typically as returned from one of the Admin module functions.
$mimetypes : A mimetype specification, typically the result of an admin:mimetype call.

Example:
  xquery version "1.0-ml";

  import module namespace admin = "http://marklogic.com/xdmp/admin" 
      at "/MarkLogic/admin.xqy";
    
  let $config := admin:get-configuration()
  let $mimetype := admin:mimetype("application/foo","foo bar","binary")
  return
  admin:mimetypes-delete($config, $mimetype)
  (: returns the new configuration element -- use admin:save-configuration
     to save the changes to the configuration or pass the configuration
     to other Admin API functions to make other changes.  :)  
  

admin:mimetypes-get(
$config as element(configuration)
)  as   element(mt:mimetype)*
Summary:

This function returns all the mimetypes from the configuration.

Parameters:
$config : A configuration specification, typically as returned from one of the Admin module functions.

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:mimetypes-get($config)
  (: returns the mimetypes specifications for the cluster :)