| XQUERY/XSLT API DOCUMENTATION 4.2 |
All XQuery & XSLT Functions MarkLogic Built-In Functions Admin (xdmp:) AppServer (xdmp:) Classifier (cts:) Debug (dbg:) Document Conversion (xdmp:) Extension (xdmp:) Documents, Directories, Properties, and Locks Functions Extension Functions Function Values Functions HTTP Functions JSON Functions MarkLogic Server Functions Search Functions XML Functions XQuery Context Functions XSLT Functions map (map:) Math (math:) Profile (prof:) Search (cts:) cts:query Constructors Functions Geospatial Functions Geospatial Lexicon Functions Lexicon Functions Search Functions Search Clustering Functions Security (xdmp:) Server Monitoring (xdmp:) Spell (spell:) Update (xdmp:) XQuery Library Modules Admin Library (admin:) Actions Functions Appserver Functions Database Functions Forest Functions Group Functions Host Functions Mimetypes Functions Scheduler Functions Alerting (alert:) Elastic Compute Cloud (ec2:) Entity Enrichment (entity:) Flexible Replication (flexrep:) Geospatial Supporting Functions GEO Functions GeoRSS Functions GML Functions KML Functions MCGM Functions Information Studio (info:) Information Studio Developer (infodev:) Library Services (dls:) cts:query Constructor Functions Document Management Functions Document Update Functions Retention Policy Functions XInclude Functions Modular Documents XInclude Functions XPointer Functions PKI (pki:) Plugin (plugin:) Search (search:) Security-sec (sec:) Spelling Dictionary Management (spell:) Thesaurus (thsr:) Triggers (trgr:) Triggers Library (trgr:) WordProcessingML (ooxml:) ZIP Package (ooxml:) CPF Functions Content Processing Framework (cpf:) CSS Conversion (css:) DocBook Conversion (dbk:) Domains (dom:) Excel Conversion (excel:) Generic Conversion (cvt:) Links (lnk:) MSWord Conversion (msword:) PDF Conversion (pdf:) Pipelines (p:) Powerpoint Conversion (ppt:) XHTML Conversion (xhtml:) W3C-Standard Functions Accessor (fn:) AnyURI (fn:) Boolean (fn:) Context (fn:) DurationDateTime (fn:) Error and Trace (fn:) Node (fn:) Numeric (fn:) QName (fn:) Sequence (fn:) String (fn:) XSLT (fn:) W3C XQuery/XSLT Reference W3C XQuery Functions W3C XQuery Language W3C XSLT Language
This page was generated September 12, 2012 5:59 AM | XQuery & XSLT Built-In & Modules Function Reference
Module: Admin Library - Mimetypes Functions
The Admin module is an XQuery library module that allows you to script administrative tasks that you otherwise would need the Admin Interface to perform. Most functions in this library perform adminstrative tasks and therefore require the user who runs the XQuery program to have the Admin role. Many of these functions provide new configuration information. In most cases, you must save the configuration (with `admin:save-configuration`, for example) in the same statement that you use the functions in order for them to take effect. To use the Admin module as part of your own XQuery module, include the following line in your XQuery prolog: `import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy" ;` The library namespace prefix `admin` is not predefined in the server.
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 :)

© Copyright 2002-2012 MarkLogic Corporation. All rights reserved.