Skip to content

Commit

Permalink
marklogic-community#109 updates based on @grtjns review
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcassel committed Mar 22, 2016
1 parent ffa0574 commit 3725f06
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
14 changes: 14 additions & 0 deletions deploy/sample/log-create.xqy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
xquery version '1.0-ml';

(:
: This is a sample triggers module, which simply logs the creation of a new document.
:)

import module namespace trgr='http://marklogic.com/xdmp/triggers'
at '/MarkLogic/triggers.xqy';

declare variable $trgr:uri as xs:string external;

xdmp:log(fn:concat('*****Document ', $trgr:uri, ' was created.*****'))


12 changes: 4 additions & 8 deletions deploy/sample/triggers-config.sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@
<trgr:depth>1</trgr:depth>
</trgr:directory-scope>
<trgr:document-content>
<trgr:update-kind>modify</trgr:update-kind>
<trgr:update-kind>create</trgr:update-kind>
</trgr:document-content>
<trgr:when>pre-commit</trgr:when>
</trgr:data-event>
<!--
<trgr:database-online-event>
<trgr:user-name>admin</trgr:user-name>
</trgr:database-online-event>
-->
<trgr:module>
<trgr:database>${modules-db}</trgr:database>
<trgr:root>/triggers/</trgr:root>
Expand All @@ -27,7 +22,7 @@
<sec:permission>
<sec:capability>read</sec:capability>
<sec:role-name>${app-role}</sec:role-name>
</sec:permission>,
</sec:permission>
<sec:permission>
<sec:capability>update</sec:capability>
<sec:role-name>${app-role}</sec:role-name>
Expand All @@ -36,6 +31,7 @@
<trgr:recursive>false</trgr:recursive>
<trgr:task-priority>normal</trgr:task-priority>
</trgr:trigger>

<trgr:trigger>
<trgr:name>OnlineTrigger</trgr:name>
<trgr:description>Online Event trigger</trgr:description>
Expand All @@ -52,7 +48,7 @@
<sec:permission>
<sec:capability>read</sec:capability>
<sec:role-name>${app-role}</sec:role-name>
</sec:permission>,
</sec:permission>
<sec:permission>
<sec:capability>update</sec:capability>
<sec:role-name>${app-role}</sec:role-name>
Expand Down

0 comments on commit 3725f06

Please sign in to comment.