-
Notifications
You must be signed in to change notification settings - Fork 66
Triggers
Yes, you can deploy triggers with Roxy (as of Roxy version 1.7.3-dev).
A sample configuration file is provided at deploy/sample/triggers-config.sample.xml. Copy that to deploy/triggers-config.xml. (You can call it something else. If you want to do so, set the triggers.file
property in build.properties.)
The sample file contains two triggers: one specifies a data event and one specifies a database online event. The XQuery code for the create trigger is in deploy/sample/log-create.xqy. If you want to run this trigger, copy that file to src/triggers/log-create.xqy and deploy modules.
You must specify the following:
- name
- an event
- a module
- enabled
The following are optional:
- description
- permissions (xdmp:default-permissions() assumed if not provided)
- recursive (default: true)
- priority (default: normal)
Use ./ml {env} deploy triggers
to deploy your trigger(s) to MarkLogic. Use ./ml {env} clean triggers
to remove ALL triggers from the targeted triggers database.
You must configure a triggers database to deploy triggers. Note that "clean triggers" will remove ALL triggers from the specified triggers database. You should set up a database specifically for your application's triggers, not use the provided Triggers database.
Specify the triggers database with the triggers-db
property in build.properties.