FW: [MarkLogic Dev General] Triggers works fine when documentcreatedusing xdmp:document-insert, but not when document loaded using webdav

Isha Chadha i.chadha at mpstechnologies.com
Thu Jul 10 21:24:20 PDT 2008


Also my WebDAV Server points to the same *content* database as my
document-insert is pointing to. The content database in turn, also happens
to be my Triggers database. 

 

 

  _____  

From: Isha Chadha [mailto:i.chadha at mpstechnologies.com] 
Sent: Friday, July 11, 2008 9:51 AM
To: 'General Mark Logic Developer Discussion'
Subject: RE: [MarkLogic Dev General] Triggers works fine when
documentcreatedusing xdmp:document-insert,but not when document loaded using
webdav

 

Hey Danny,

 

Thanks for replying :-)

 

Root of webdav server is: myRootDir/

 

My trigger definition which calls a logging module is: 

 

import module namespace trgr="http://marklogic.com/xdmp/triggers"

at "/MarkLogic/triggers.xqy"

trgr:create-trigger("myTrigger", "Simple trigger example",

trgr:trigger-data-event(

trgr:directory-scope("/myRootDir/", "1"),

trgr:document-content("create"),

trgr:post-commit()),

trgr:trigger-module(xdmp:database("myDatabase"), "/modules/", "log.xqy"),

fn:true(), xdmp:default-permissions() )

 

 

and module to be called when triggered is:

 

xdmp:document-insert("/modules/log.xqy",

text{ "

import module namespace trgr='http://marklogic.com/xdmp/triggers'

at '/MarkLogic/triggers.xqy'

define variable $trgr:uri as xs:string external

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

} 

 

And lastly document insert uri which successfully fires the trigger is:

 

xdmp:document-insert("/myRootDir/test.xml", <test><abc>nsdasf</abc></test>)

 

Thanks

 

Isha 

 

  _____  

From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: Thursday, July 10, 2008 9:42 PM
To: General Mark Logic Developer Discussion
Subject: RE: [MarkLogic Dev General] Triggers works fine when
documentcreatedusing xdmp:document-insert,but not when document loaded using
webdav

 

Hi Isha,

 

Is it possible that your trigger scope does not cover the root of the WebDAV
server?  To answer this:

 

* What is the document-insert URI that is successfully firing the trigger?

* What is the root of the WebDAV server?

* What is the trigger definition?

 

Also, you say "my WebDAV Server uses the same database against which the
trigger is created".  What exactly do you mean there?  The WebDAV server
should point to the same *content* database as your document-insert is
pointing to.  The content database in turn references the triggers database
(where the triggers are stored).  

 

-Danny

 

From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of Isha Chadha
Sent: Wednesday, July 09, 2008 9:46 PM
To: general at developer.marklogic.com
Subject: [MarkLogic Dev General] Triggers works fine when document
createdusing xdmp:document-insert,but not when document loaded using webdav

 

Hi,

 

I created a trigger which gets activated when I use xdmp:document-insert,
following all steps as mentioned in dev_guide.pdf.

 

It is working as expected.

 

But if I insert another document using Marklogic WebDav server
(Drag-n-Drop).They don't seem to be get activated...My WebDav server uses
the same database against which trigger was created.

 

Is there some other way to do this or am I missing something here?

 

 

Thanks,

 

Isha

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xqzone.marklogic.com/pipermail/general/attachments/20080711/df268932/attachment.html


More information about the General mailing list