Hello,
As this is my first post on the list I’ll introduce myself first. My name is Ignacio Hernandez-Ros (if you google my name there is only me and my son with that name…) and I’m from Madrid - Spain. About 15 years ago I learned about XQuery using “tamino” form Software-AG and now I’ve discovered baseX that looks amazing to me.
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 http://docs.basex.org/wiki/Web_Application
I would like to know more about how the org.basex.http.restxq.RestXqServlet works and looking at the source code on GitHub I’m missing the org.basex.http package so I cannot see how can I improve it to allow it to connect to an existing server.
I will appreciate any hint on how can I continue, either about where the source code is and how to contribute to it or how to set the WebApplication to run under client-server mode
Best regards Ignacio
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
Hello Christian
Thank you for your prompt response.
YES! I’ve been able to start the GUI, store files, perform XQueries against the stored documents and everything looks great! (Side Note: There is just one issue when exiting the GUI because in my Mac the application keeps running and the main menu is still visible (but the main window is made not visible). This might be due to a non daemon thread that is still running on the JVM or something like that because of the nuances of Swing. I can debug that later… This is not a big issue for me at this time.)
I’ve also tested to launch the basexserver using the same sample database I created with the GUI. It starts fine.
Then, I use basexclient on another terminal and I can connect to the basexserver, execute LIST command and I see all databases created with the GUI. Then I can run XQueries and everything works like a charm.
I tested to stop the basexserver and start the basexclient and, obviously, I receive a Connection failed (port: 1984) that is OK because there is no server running.
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 mailto: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/ 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 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
[1] http://docs.basex.org/wiki/Startup http://docs.basex.org/wiki/Startup
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
Is this correct?
Yes. that is the idea.
Maybe you could give us a quick example of a request
When you say “request” do you mean the "http request” and the process?
Let me give you another example that might give you more light and do not require http requests at all.
Imagine I’ve basexserver running on 192.168.1.33 and port 1984 Now, I want to use basexGUI to connect to that host and port.
You’ll notice this is not possible. The GUI is also running the server in its own JVM process.
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.
The options documented here: http://docs.basex.org/wiki/Options 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 mailto: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 mailto: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/ 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 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
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
basex-talk@mailman.uni-konstanz.de