Loading TOC...

alert.actionInsert

alert.actionInsert(
   $config-uri as String,
   $action as Object
) as null

Summary

This function inserts the specified action into the collection. The caller must have the alert-admin privilege to call this function.

Parameters
$config-uriThe URI passed to alert.makeConfig.
$actionThe representation of an action.

Required Privileges

http://marklogic.com/xdmp/privileges/xdmp-alert-admin, http://marklogic.com/xdmp/privileges/xdmp-invoke-modules-change (if changing the modules database), http://marklogic.com/xdmp/privileges/xdmp-invoke-modules-change-fs (if changing the modules db to someplace on the filesystem)

Example

  var alert = require("/MarkLogic/alert.xqy");

  declareUpdate();
  alert.actionInsert(
         "http://acme.com/alert/message-board",
         alert.makeAction(
             "sms",
             "Sends basic SMS text message",
              xdmp.modulesDatabase(),
              xdmp.modulesRoot(),
              "/modules/sms.xqy",
              {"provider":[{"name":"T-Mobile", "domain":"tmomail.net"},
                           {"name":"Virgin", "domain":"vmobl.com"},
                           {"name":"Cingular", "domain":"cingularme.com"},
                           {"name":"Sprint", "domain":"messaging.sprintpcs.com"},
                           {"name":"Verizon", "domain":"vtext.com"},
                           {"name":"Nextel", "domain":"messaging-nextel.com"}]}
   ))
  

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy