2

I have issues with the RESTXQ implementation in exist-db. I think it might be the RestXQTrigger which is not working correctly.

The problem: I deleted (via the Dashboard) a collection including RESTXQ services inside several .xqm files. However, the services are not unregistered and are still available, even after restarting eXist.

Is there any way to force this unregistring, I mean other than recreate the previous collections/files and delete each .xqm files one by one (this way, the trigger seems to work) ?

adamretter
  • 3,885
  • 2
  • 23
  • 43
Eric S
  • 452
  • 4
  • 10

2 Answers2

4

RESTXQ in eXist at the moment only implements the Document Trigger events and not the Collection Trigger events. This is just a limitation which needs to be resolved when there is time to implement it.

There is an XQuery module provided with eXist in the namespace: http://exquery.org/ns/restxq/exist. The functions in this module enable you to manually manipulate the RESTXQ Registry. You can enable it in $EXIST_HOME/conf.xml. If you then restart eXist and re-build the function documentation you should be able to see the documentation in the function browser app for these functions. In particular you most likely want the functions:

exrest:deregister-module(xs:anyURI("/db/my-module.xqm")) and exrest:register-module(xs:anyURI("/db/my-module.xqm")).

There are also functions for registering and deregistering individual functions from a module, which are called register-resource-function and deregister-resource-function they are similar to above but take a second argument which is a function signature (as a xs:string) in the form of qname#arity e.g. "fn:substring#2"

adamretter
  • 3,885
  • 2
  • 23
  • 43
  • Thanks for the precisions ! This documentation was welcome :-) This way, I feel more comfortable to use RESTXQ in our production plateform. Thanks again. – Eric S Dec 22 '14 at 21:40
  • 1
    Apart from the eXist O'Reilly book, the documentation for RESTXQ is quite lacking, the next best source is probably http://www.adamretter.org.uk/presentations.xml#xmlprague12. However, eXist is an Open Source project, and I would welcome a pull-request that adds some documentation for RESTXQ, see: https://github.com/exist-db/documentation – adamretter Dec 23 '14 at 12:45
2

You can stop the database, and manually remove the registry file $EXIST_HOME/webapp/WEBINF/data/restxq.registry

DiZzZz
  • 621
  • 3
  • 12
  • I was looking for this for soooooo long !!! Thank you !! Can't find this anywhere in the documentation, is it ? – Eric S Dec 19 '14 at 16:41
  • it is documented, but i had to digg deep. https://www.google.nl/search?client=safari&rls=en&q=restxq+registry&ie=UTF-8&oe=UTF-8&gfe_rd=cr&ei=wlSUVN2-AdeCUNb0gcgC#rls=en&q=restxq+restxq.registry showed that it is at least mentioned in the just released 'eXist' book by AdamR and ErikS – DiZzZz Dec 19 '14 at 16:43
  • Nope, it does not seem to be documented in the eXist-db documentation, sorry. – DiZzZz Dec 19 '14 at 16:45
  • Ok. I already bought the adam's book :-D, but don't have it yet. I still have a question, would you consider RestXQ as fully operationnal or still in beta-mode ? Because we're considering using it in production mode. – Eric S Dec 19 '14 at 17:00
  • I'd say it is production worthy. It has been quite well tested and it is actively maintained. – DiZzZz Dec 19 '14 at 22:23