Loading TOC...

alert.makeAction

alert.makeAction(
   $name as String,
   $description as String,
   $module-db as String,
   $module-root as String,
   $module as String,
   $options as Object
) as Object

Summary

This function creates the specified action. When a rule associated with the action matches a document, the action's module will be invoked with the following external variables set:

         var configUri;
         var doc;
         var rule;
         var action;
     

All actions must accept these external variables.

Parameters
$nameThe name give to the action.
$descriptionA text description of the action.
$module-dbThe database ID where the XQuery modules reside. Use xdmp.modulesDatabase to specify the configured database.
$module-rootThe path to the module root. Use to specify the xdmp.modulesRoot configured root.
$moduleThe URI of the module to invoke.
$optionsOptional information specific to the action.

Example

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

  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"}]
    }) 
  => Returns the JSON Object representing an action with the specified information
  

Comments

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