Hi Florent, I think Andrew is right. It is good to be aware how Trigger databases are referenced. You are executing your query against a specific AppServer that has a Documents database setting of its own. So just executing your query will insert the trigger into the Triggers database assigned to the Documents database that has been associated with the AppServer you are using. (Still following? :-P)
Using the eval approach described by Andrew helps in so far that it ensures you will be using the Triggers database associated with the db-xxx database. But your description below shows that you haven't associated a Triggers database at all. That will be necessary to see the triggers on the console, but might also be necessary to create the trigger itself (not sure though, you seem to get an ID back).. Kind regards, Geert > drs. G.P.H. (Geert) Josten Consultant Daidalos BV Hoekeindsehof 1-4 2665 JZ Bleiswijk T +31 (0)10 850 1200 F +31 (0)10 850 1199 mailto:[email protected] http://www.daidalos.nl/ KvK 27164984 P Please consider the environment before printing this mail. De informatie - verzonden in of met dit e-mailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: [email protected] > [mailto:[email protected]] On Behalf Of > Florent Georges > Sent: maandag 22 maart 2010 18:31 > To: MarkLogic General ML > Subject: [MarkLogic Dev General] Create trigger from XQuery, > not see it in the console > > Hi, > > I have a database configured as: > > Name: db-xxx > Security db: Security > Schema db: Schemas > Triggers db: (none) > > I create a new trigger by using the following code: > > xquery version "1.0"; > import module namespace tr = "http://marklogic.com/xdmp/triggers" > at "/MarkLogic/triggers.xqy"; > declare namespace xdmp = "http://marklogic.com/xdmp"; > > tr:create-trigger( > 'xxx', > 'no description', > tr:trigger-data-event( > tr:collection-scope('tmp'), > tr:document-content('create'), > tr:pre-commit() > ), > tr:trigger-module(xdmp:database('db-xxx'), 'tmp/', 'test.xqy'), > true(), > xdmp:default-permissions(), > false() > ) > > It runs correctly and returns an integer (the ID of the > trigger if I am right). So I expected to see the trigger in > the console, in the tab "Databases/db-xxx/Triggers", but this > one is empty. > > Did I miss anything? Can I provide more infos? > > Regards, > > -- > Florent Georges > http://www.fgeorges.org/ > > > > > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general > _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
