Home : OpenEdit SDK : Programming OpenEdit : Triggers
Triggers
Triggers
Triggers allow you to run arbitrary scripts when certain events take place with the content management system. For example, you can set up a trigger to run each time any page is approved, where you can then execute any arbitrary OpenEdit action, including your own custom actions (see the section on actions for information on creating your own actions). This allows existing infrastructure to extend and expand the capabilties of OpenEdit.
To configure your site to run a javacsript file called "/deploy.js" when a page is approved, , for example, , create a file called:
/openedit/triggers/pageApproved.xconf
Place the following content in the file:
<?xml version="1.0" encoding="UTF-8"?>
<page>
<page-action name="Script.run">
<script>
/deploy.js
</script>
</page-action>
</page>
The following triggers are run automatically:
- pageAdded
- pageModified
- pageRemoved
- pageApproved
- pageDeleted
