Hi Ignacio,
You’ll notice this is not possible. The GUI is also running the server in its own JVM process.
If you run the BaseX GUI, or a standalone instance of BaseX, there will be no thing as a server that could be processed from another process. This is particularly important to stress for the GUI: If the visualizations are rendered, thousands of local database requests will take place, and it would be much too slow indeed (at least with the current way how the visualizations are built) to replace all those database operations with atomic client requests.
As you mentioned RESTXQ before: We thought about creating a light-weight client version of RESTXQ at some time in the past. We decided against this solution, because we would have needed an extensive API to make this happen. Additionally, features like streaming or iterative query evaluation get harder if you add an additional layer to your system.
What is missing in the API is the concept of a “connection” and the properties related to a “connection” so the GUI cannot “connect” to an existing server and the web application also cannot “connect” to a running server.
As BaseX provides a number of different APIs… Which API do you refer to? Which ones did you look at so far?
If you are interested in the classical BaseX Server (without HTTP services), you might want to have a look at our server protocol [1]. It is pretty slick and efficient (but at the same time very low level), and it could surely be enhanced in many ways to provide additional features.
Hope this helps, Christian
[1] http://docs.basex.org/wiki/Server_Protocol
The options documented here: http://docs.basex.org/wiki/Options contains almost all the information needed to establish a connection to a server. There is a HOST, PORT, USER, PASSWORD, etc… why not you just add a new one called “URL” and combine them together in the same way they exist on existing jdbc drivers? The idea is to allow any application to connect to a basexserver using the basexserver URL the same way basexclient is connecting to an existing basexserver
Best regards Ignacio
El 27 jul 2017, a las 18:30, Christian Grün christian.gruen@gmail.com escribió:
Ignacio,
Thanks for your feedback, and your offer to help.
I alerady have a vague idea now about the architecture you are aiming for. If I got you right, …
• you would like to start the BaseX server as a separate instance (outside the web application); • you want your WAR file to be restricted to RESTXQ files; and • you would like to have a thin layer that passes on everything to the server layer.
Is this correct? Maybe you could give us a quick example of a request, and how you believe it shall be processed step by step?
Christian
The problem is that I want to have the same client-server architecture using a “web-client” running restxq. I’ve successfully deployed the WAR file on tomcat and I’ve tuned the parameters on web.xml to access the same “files” the basexserver is serving but this is not a real “client-server” architecture because the JVM on the web application server is not connecting to the basexserver but just sharing the same files! In the example above, I can stop my basexserver and the web application is still running because it hosts its own server.
I’m a experience developer and I think I might be capable of help you decouple the processing of the restxq message and the execution of the query on a remote server. At least if I’d access to the source code I could eventually understand why I cannot properly do that now.
Best regards Ignacio
El 27 jul 2017, a las 14:11, Christian Grün christian.gruen@gmail.com escribió:
Hola Ignacio,
Welcome to the list.
Usually, the best way to get started is to download the ZIP or EXE version of BaseX and follow the instructions in our documentation [1]:
• If you start the BaseX GUI, you can create databases, run queries, view your data via various visualizations, etc. • If you start the BaseX HTTP Server, you can simply open your browser and visit http://localhost:8984/dba/ to access the web-based administration interface.
Now some more specific replies on your questions:
I’ve been trying to configure the web administration portal to be used with a remote server with no success. It looks like it is not possible to take advantage of the client-server architecture from the Web Application http://docs.basex.org/wiki/Web_Application
What kind of remote server do you work with? Indeed BaseX provides a client/server architecture – which will be made available after starting the BaseX Server – but I assume you are rather interested in the HTTP services, such as RESTXQ? Have you already tried to embed BaseX as a servlet?
Saludos de Alemania, Christian