Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Triggers

David Cassel edited this page Mar 22, 2016 · 2 revisions

Yes, you can deploy triggers with Roxy (as of Roxy version 1.7.3-dev).

Config file

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.

Parameters

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)

Commands

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.

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.