[documentation] improved non-working XQuery Trigger example
[documentation] improved non-working XQuery Trigger example

Some things I noticed:
[1] With this XQuery code, following events don't get logged:
    -trigger:before-update-collection() / trigger:after-update-collection()
    -trigger:before-copy-document() / trigger:after-copy-collection()
    -trigger:before-move-document() / trigger:after-move-document() 
    -trigger:after-copy-document()
[2] Apparently, org.exist.collections.triggers.XQueryTrigger doesn't allow to set global variables for the XQuery module: if a module variable is declared as global (e.g. declare variable $trigger:triggersLogFile := '/db/triggersLog.xml';), references to that variable throw following error:
    XMLDBException: Failed to invoke method parse in class org.exist.xmlrpc.RpcConnection: org.exist.xquery.XPathException: err:XPDY0002 undefined value for variable '$trigger:triggersLogFile' [at line 107, column 29, source: /db/myTrigger.xql]
    In function:
    local:logEvent(element()*) [67:9:/db/myTrigger.xql]
    trigger:before-update-document(xs:anyURI*) [-1:-1:/db/myTrigger.xql] 
(this does not happen when the code is invoked via XQueryServlet)
    ==> worked around in the example by passing that variable externally via the trigger configuration
[3] While the Java source code at src/org/exist/collections/triggers/XQueryTrigger.java lists following external variables: 'type', 'collection', 'uri', 'new-uri', 'event', only 'uri' and 'new-uri' seem available in the XQuery functions.

svn path=/trunk/eXist/; revision=16800

adamretter/exist,ambs/exist,zwobit/exist,joewiz/exist,dizzzz/exist,jensopetersen/exist,kohsah/exist,jensopetersen/exist,ambs/exist,olvidalo/exist,shabanovd/exist,MjAbuz/exist,patczar/exist,lcahlander/exist,hungerburg/exist,shabanovd/exist,opax/exist,eXist-db/exist,joewiz/exist,dizzzz/exist,adamretter/exist,hungerburg/exist,adamretter/exist,jessealama/exist,windauer/exist,kohsah/exist,wolfgangmm/exist,kohsah/exist,ambs/exist,wolfgangmm/exist,eXist-db/exist,wshager/exist,jensopetersen/exist,MjAbuz/exist,zwobit/exist,windauer/exist,olvidalo/exist,opax/exist,olvidalo/exist,olvidalo/exist,MjAbuz/exist,wolfgangmm/exist,hungerburg/exist,jessealama/exist,patczar/exist,wshager/exist,zwobit/exist,jensopetersen/exist,jessealama/exist,eXist-db/exist,RemiKoutcherawy/exist,ljo/exist,shabanovd/exist,RemiKoutcherawy/exist,windauer/exist,RemiKoutcherawy/exist,wshager/exist,jensopetersen/exist,MjAbuz/exist,shabanovd/exist,kohsah/exist,shabanovd/exist,lcahlander/exist,ambs/exist,zwobit/exist,kohsah/exist,wolfgangmm/exist,joewiz/exist,opax/exist,joewiz/exist,windauer/exist,shabanovd/exist,ljo/exist,MjAbuz/exist,hungerburg/exist,adamretter/exist,hungerburg/exist,lcahlander/exist,adamretter/exist,dizzzz/exist,lcahlander/exist,MjAbuz/exist,wolfgangmm/exist,RemiKoutcherawy/exist,opax/exist,RemiKoutcherawy/exist,patczar/exist,windauer/exist,joewiz/exist,kohsah/exist,lcahlander/exist,patczar/exist,lcahlander/exist,eXist-db/exist,ambs/exist,wshager/exist,ambs/exist,eXist-db/exist,zwobit/exist,adamretter/exist,windauer/exist,dizzzz/exist,wshager/exist,joewiz/exist,jessealama/exist,olvidalo/exist,opax/exist,ljo/exist,dizzzz/exist,patczar/exist,ljo/exist,ljo/exist,ljo/exist,wshager/exist,zwobit/exist,eXist-db/exist,RemiKoutcherawy/exist,jessealama/exist,jessealama/exist,jensopetersen/exist,wolfgangmm/exist,patczar/exist,dizzzz/exist