The table below lists all the
trgr built-in
functions (in this namespace:
http://marklogic.com/xdmp/triggers
).
The triggers function module is installed as the following file:
install_dir/Modules/MarkLogic/triggers.xqy
where install_dir
is the directory in which
MarkLogic Server is installed.
To use the triggers.xqy
module in your own XQuery modules,
include the following line in your XQuery prolog:
import module namespace trgr="http://marklogic.com/xdmp/triggers"
at "/MarkLogic/triggers.xqy";
The triggers module is used for manually creating and managing triggers. If you use the Content Processing Framework, it automatically creates and manages the triggers.
The function to create a new trigger,
trgr.createTrigger
, uses
the other trigger functions to construct the trigger XML document and insert
it into the triggers database. The trigger functions should all be run
against the triggers database of the database in which the content is
stored.
For more information on using triggers, see "Using Triggers to Spawn Actions" in the Application Developer's Guide.
Function name | Description |
---|---|
trgr.anyPropertyContent | Returns the XML representation of an all-properties part to a triggering event, usable as the content parameter of a trigger event constructor such as trgr.triggerDataEvent . |
trgr.collectionScope | Returns the XML representation of a collection scope, usable as the scope parameter of a trigger event constructor such as trgr.triggerDataEvent . |
trgr.createTrigger | Creates a new trigger in the context database. |
trgr.directoryScope | Returns the XML representation of a directory scope, usable as the scope parameter of a trigger event constructor such as trgr.triggerDataEvent . |
trgr.documentContent | Returns the XML representation of a document part of a triggering event, usable as the content parameter of a trigger event constructor such as trgr.triggerDataEvent . |
trgr.documentScope | Returns the XML representation of a document scope, usable as the scope parameter of a trigger event constructor such as trgr.triggerDataEvent . |
trgr.getTrigger | Returns the XML representation of a trigger with the given name. |
trgr.getTriggerById | Returns the XML representation of the trigger with the given trigger id. |
trgr.postCommit | Returns the XML representation of a post-commit trigger timing. |
trgr.preCommit | Returns the XML representation of a pre-commit trigger timing. |
trgr.propertyContent | Returns the XML representation of a property part to a triggering event, usable as the content parameter of a trigger event constructor such as trgr.triggerDataEvent . |
trgr.removeTrigger | Removes the named trigger. |
trgr.triggerAddPermissions | Adds permissions to the set of permissions on the named trigger. |
trgr.triggerDatabaseOnlineEvent | Returns the XML representation of a database coming online event, usable as the event parameter of trgr.createTrigger . |
trgr.triggerDataEvent | Returns the XML representation of a triggering eventa, usable as the event parameter of trgr.createTrigger . |
trgr.triggerDisable | Disables the named trigger. |
trgr.triggerEnable | Enables the named trigger. |
trgr.triggerGetPermissions | Returns the permissions for the named trigger. |
trgr.triggerModule | Returns the XML representation of a trigger module which can be used as the module parameter of trgr.createTrigger . |
trgr.triggerRemovePermissions | Removes a set of permissions from the set of permissions on the named trigger. |
trgr.triggersChangeModulesDatabase | Any Trigger with a module referring to $old-db will be updated to refer to $new-db. |
trgr.triggerSetDescription | Sets the description of the named trigger. |
trgr.triggerSetEvent | Assigns a triggering event to the named trigger. |
trgr.triggerSetModule | Sets or replaces the action module associated with the named trigger. |
trgr.triggerSetName | Changes the name of a trigger. |
trgr.triggerSetPermissions | Sets the permissions that determine which roles are permitted to modify the named trigger. |
trgr.triggerSetRecursive | Sets the recursive setting of the identified trigger. |
trgr.triggerSetTaskPriority | Sets the task priority setting of the identified trigger. |