From: Wolfgang M. <wol...@ex...> - 2012-08-31 19:43:58
|
Actually I'm getting different errors now when enabling restxq: Caused by: org.exist.extensions.exquery.restxq.impl.RestXqServiceCompilationException: Invalid document location for XQu ery: /db/test/expath-pkg.xml at org.exist.extensions.exquery.restxq.impl.RestXqTrigger.findServices(RestXqTrigger.java:123) at org.exist.extensions.exquery.restxq.impl.RestXqTrigger.afterCreateDocument(RestXqTrigger.java:64) at org.exist.collections.triggers.DocumentTriggersVisitor.afterCreateDocument(DocumentTriggersVisitor.java:84) at org.exist.collections.Collection.storeXMLInternal(Collection.java:1359) at org.exist.collections.Collection.store(Collection.java:1256) at org.exist.xmldb.LocalCollection.storeXMLResource(LocalCollection.java:821) ... 65 more expath-pkg.xml is neither a binary resource nor an XQuery!?! I don't understand why the RestXqTrigger is trying to compile it. Here's a small test query with which reproduces the issue for me (note that the db will be damaged after running this and has to be cleaned): xquery version "3.0"; declare function local:store-expath($collection as xs:string?, $userData as xs:string*, $permissions as xs:int?) { let $descriptor := <package xmlns="http://expath.org/ns/pkg" name="{request:get-parameter('name', ())}" abbrev="{request:get-parameter('abbrev', ())}" version="{request:get-parameter('version', ())}" spec="1.0"> <title>{request:get-parameter("title", ())}</title> </package> return ( xmldb:store($collection, "expath-pkg.xml", $descriptor, "application/xml"), xmldb:set-resource-permissions($collection, "expath-pkg.xml", $userData[1], $userData[2], $permissions) ) }; local:store-expath("/db/test", ("admin"), xmldb:string-to-permissions("rw-rw-rw-")) Wolfgang |