Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue importing a directory: eXide version 2.1.2 #176

Closed
orazionelson opened this issue Nov 10, 2017 · 10 comments · Fixed by #186
Closed

issue importing a directory: eXide version 2.1.2 #176

orazionelson opened this issue Nov 10, 2017 · 10 comments · Fixed by #186
Labels

Comments

@orazionelson
Copy link

I'm testing eXist 3.0.5 on my home PC (Ubuntu 14.04 LTS)
When I try to upload a directory with exide it fails and doesn't create the tree, eXide imports all the files with the directory as prefix of the name.

I made a screenshot: http://www.nelsonweb.it/exide.png

Also in the collection manages is the same.

@dariok
Copy link
Contributor

dariok commented Jan 16, 2018

The same is true for eXide 2.4.2 on eXist 3.6.1 on a Ubuntu 16.04 LTS.

screenshot from 2018-01-16 16-58-09

Whatever is created during upload cannot be removed, though.

2018-01-16 17:05:10,645 [qtp1237743088-32] ERROR (PermissionsFunction.java [functionHasAccess]:389) - exerr:ERROR Resource or collection '/db/apps/edoc/data/1700/1703/08/1703-08-08.xml' does not exist.
org.exist.xquery.XPathException: exerr:ERROR Resource or collection '/db/apps/edoc/data/1700/1703/08/1703-08-08.xml' does not exist.
    at org.exist.xquery.functions.securitymanager.PermissionsFunction.getPermissions(PermissionsFunction.java:421) ~[exist.jar:3.6.1]
    at org.exist.xquery.functions.securitymanager.PermissionsFunction.functionHasAccess(PermissionsFunction.java:386) [exist.jar:3.6.1]
    at org.exist.xquery.functions.securitymanager.PermissionsFunction.eval(PermissionsFunction.java:285) [exist.jar:3.6.1]
    at org.exist.xquery.BasicFunction.eval(BasicFunction.java:74) [exist.jar:3.6.1]
    at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:41) [exist.jar:3.6.1]
    at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) [exist.jar:3.6.1]
    at org.exist.xquery.PathExpr.eval(PathExpr.java:276) [exist.jar:3.6.1]
    at org.exist.xquery.OpAnd.eval(OpAnd.java:69) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:99) [exist.jar:3.6.1]
    at org.exist.xquery.UserDefinedFunction.eval(UserDefinedFunction.java:160) [exist.jar:3.6.1]
    at org.exist.xquery.FunctionCall.evalFunction(FunctionCall.java:302) [exist.jar:3.6.1]
    at org.exist.xquery.FunctionCall.eval(FunctionCall.java:223) [exist.jar:3.6.1]
    at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58) [exist.jar:3.6.1]
    at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:102) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:99) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) [exist.jar:3.6.1]
    at org.exist.xquery.ForExpr.processItem(ForExpr.java:251) [exist.jar:3.6.1]
    at org.exist.xquery.ForExpr.eval(ForExpr.java:189) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:99) [exist.jar:3.6.1]
    at org.exist.xquery.UserDefinedFunction.eval(UserDefinedFunction.java:160) [exist.jar:3.6.1]
    at org.exist.xquery.FunctionCall.evalFunction(FunctionCall.java:302) [exist.jar:3.6.1]
    at org.exist.xquery.FunctionCall.eval(FunctionCall.java:223) [exist.jar:3.6.1]
    at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:100) [exist.jar:3.6.1]
    at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58) [exist.jar:3.6.1]
    at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:102) [exist.jar:3.6.1]
    at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58) [exist.jar:3.6.1]
    at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:102) [exist.jar:3.6.1]
    at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58) [exist.jar:3.6.1]
    at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:102) [exist.jar:3.6.1]
    at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) [exist.jar:3.6.1]
    at org.exist.xquery.PathExpr.eval(PathExpr.java:276) [exist.jar:3.6.1]
    at org.exist.xquery.TryCatchExpression.eval(TryCatchExpression.java:142) [exist.jar:3.6.1]
    at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:3.6.1]
    at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) [exist.jar:3.6.1]
    at org.exist.xquery.PathExpr.eval(PathExpr.java:276) [exist.jar:3.6.1]
    at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) [exist.jar:3.6.1]
    at org.exist.xquery.XQuery.execute(XQuery.java:261) [exist.jar:3.6.1]
    at org.exist.xquery.XQuery.execute(XQuery.java:185) [exist.jar:3.6.1]
    at org.exist.http.RESTServer.executeXQuery(RESTServer.java:1539) [exist-optional.jar:3.6.1]
    at org.exist.http.RESTServer.doGet(RESTServer.java:515) [exist-optional.jar:3.6.1]
    at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:248) [exist-optional.jar:3.6.1]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [servlet-api-3.1.jar:3.1.0]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [servlet-api-3.1.jar:3.1.0]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841) [jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535) [jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566) [jetty-security-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) [jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:163) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:73) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:50) [exist-optional.jar:3.6.1]
    at org.exist.http.urlrewrite.XQueryURLRewrite.doRewrite(XQueryURLRewrite.java:548) [exist-optional.jar:3.6.1]
    at org.exist.http.urlrewrite.XQueryURLRewrite.service(XQueryURLRewrite.java:352) [exist-optional.jar:3.6.1]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [servlet-api-3.1.jar:3.1.0]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841) [jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650) [jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
    at de.betterform.agent.web.filter.XFormsFilter.doFilter(XFormsFilter.java:171) [betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629) [jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533) [jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) [jetty-security-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) [jetty-servlet-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:527) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.Server.handle(Server.java:561) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:334) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [jetty-server-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279) [jetty-io-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104) [jetty-io-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124) [jetty-io-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247) [jetty-util-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140) [jetty-util-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [jetty-util-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:243) [jetty-util-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:679) [jetty-util-9.4.7.v20170914.jar:9.4.7.v20170914]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:597) [jetty-util-9.4.7.v20170914.jar:9.4.7.v20170914]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]

when trying to delete any of the "resources". It is necessary to remove the whole collection.

@dizzzz
Copy link
Member

dizzzz commented Jan 16, 2018

" upload a directory" ... please state the browser vendor and exact version of the browser.

In the past uploading a complete directory was only possible with chrome. @wolfgangmm ?

@dariok
Copy link
Contributor

dariok commented Jan 17, 2018

In my case, it was Chrome 63.0.3239.108.

@orazionelson
Copy link
Author

Versione 65.0.3325.181 on Ubuntu 14.04

@dizzzz
Copy link
Member

dizzzz commented Apr 12, 2018

confirmed :-/ also for recent firefox

@dizzzz
Copy link
Member

dizzzz commented Apr 12, 2018

The line

if (matches($path, "/[^/]+$")) then
might not be correct here . There is some regex fiddling going on for directories that should end up into collections

@duncdrum
Copy link
Contributor

duncdrum commented Apr 12, 2018

@dizzzz you could be right given $path /laa/dee/doo (true match) $split[1] returns /laa/dee shouldn't that be /laa/dee/?

@dizzzz
Copy link
Member

dizzzz commented Apr 12, 2018

and... in a regex a "/" should be listed as a escaped one, "/", what would mean that the this regex has never worked ?

@dizzzz
Copy link
Member

dizzzz commented Apr 12, 2018

And.... how does it work for windows based file-path separators?

@duncdrum
Copy link
Contributor

@dizzzz it works, i don't understand why but \/actually raises errors, something about the translation of xquery RE-syntax, into java RE… 🤷‍♂️

As for windows, afaik it doesn't ❓

Maybe turn this into switch statement along the lines of

switch(ends-with($path))
case '/' return unixy stuff
case '\' return windows stuff
default return tokenize($path)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants