exist-db restxq trigger : Services deleted but still active

337 views Asked by At

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) ?

2

There are 2 answers

5
DiZzZz On BEST ANSWER

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

2
adamretter On

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"