There are two problems as I see it (the first one is minor and the
second one is the answer to what you asked):
1) web:redirect() doesn't work with absolute paths, they instead strip
off the Tomcat webapp name from the url.
For example, my BaseX lives in a webapp called BaseX811, so the base-url
I have, is ```http://something:port/BaseX811```.
But doing ```web:redirect('/dba')``` redirects to a url with the webapp
name and port chopped off, e.g http://something/dba
2) The file module behaves strangely:
```file:current-dir()``` returns on my development setup (fedora)
"/usr/share/tomcat/" which is a symbolic link on my system to the Tomcat
webapps folder. In my production setup (a Bitnami virtual server with
only Tomcat) it returns "/opt/bitnami/apache-tomcat/logs/" -- not the
BaseX webapp folder which I would expect
```file:base-dir()``` returns on my development box the BaseX webapp
folder e.g "/usr/share/tomcat/webapps/BaseX811/" (hurray!) but on my
production setup it returns the empty string!
This is why I have to use absolute paths in my "deployment" code that I
run from the DBA.
Vielen dank!
Kristian
05.05.2015 02:24, Christian Grün kirjutas:
Hi Kristian,
I wonder though what would be a straightforward way to use
relative paths instead, since not all users can afford knowing the absolute
paths. Do you have any pointers on this?
In our ZIP distribution and with Jetty, the DBA code runs out of the
box. Could you please give us more hints what you needed to do to get
DBA running in your environment?
Tänan,
Christian
30.04.2015 11:47, Christian Grün kirjutas:
Hi Kristian,
My problem is that the Tomcat is available only through HTTP and I
wouldn't
like to open up the function for the outside world using RESTXQ. Is there
a
way to "talk" with the BaseX in the Tomcat?
Have you already thought about adding the DBA interface [1]? It might
be extended with new functionality to store and invoke server-side
code, and you can already use it to run arbitrary XQuery expressions.
Another choice is our classical REST interface, which can also be used
to run server-side queries or command scripts.
Just remember that these interfaces can potentially be accessed by
other people as well, even those who are not supposed to access it, so
you should e.g. change the default admin password, etc.
Best,
Christian
[1] http://docs.basex.org/wiki/DBA
I have full access to the
machine via SSH. Another way I thought of would be to just upload the
data
folder from my local setup, but it doesn't feel the right way to do it.
Best regards
Kristian K