Dear BaseX-Community,
I try to access my BaseX-Database or Collection over the Web-Interface.
This is what I´ve done so far:
1) Installed Jetty und started it.
2) Downloaded the BaseX76.war, extracted it to the folder BaseX76 and placed the folder in the Directory "<user>/jetty/webapps".
3) Now I started my Browser (Safari) and went to "http://localhost:8080" => Ok, the jetty-Startpage on my local web server is shown.
4) Now on the Browser, I navigate to "http://localhost:8080/BaseX76/" => OK, the Welcome-Page of baseX-Http-Services is shown. On this page, I click on the link "RestXQ and I get the Page "Welcome to the RestXQ-Service" which has the path "<user>/jetty/webapps/BaseX76/restxq/restxq.xqm". The examples HelloWorld and HelloUniverse give the right responses.
5) I modified the response of the POST-Handler (form) to find out, if this is the right place to do such things:
(This is the modified content:)
-------------- declare %restxq:path("form/") %restxq:POST %restxq:form-param("message","{$message}", "'no message delivered'") function page:hello-postman($message as xs:string) {
let $ZaVar := 'Dies ist Dieter' let $ZaVar2 := ' und dies ist Anne' return <response>
<title>Hello!</title> <info>It seems you posted a message: { $message }</info>
<Za> Dies ist mein Text in Zrestxq und { $ZaVar } { $ZaVar2 } </Za>
</response> ----------------
=> my changes are given as response when I click on the Button of the "Welcome to the RestXQ-Service" page. So far, everything works.
6) My question is now:
a) How do I access my local BaseX-Database (named "ZaTest", which I created and queried successfully by use of the BaseX-Gui?
b) Are there examples or does anybody give me an advice, which settings in the jetty-preferences-files I do have to change, or what text I do have to put into the file "<user>/jetty/webapps/BaseX76/restxq/restxq.xqm".
c) Where (which Filepath) do I have to place the Database-Folder "ZaTest", which I created with the Gui?
d) If I have to connect or open or close the database - how is this done with the restxq-Interface (please example(s)).
------- Thanks in advance. I think, this is a real beginner´s example for people like me, which are very new to jetty and baseX, as well to restxq. I searched all documentation, but didn´t find, what I needed.
Sincerely
Dieter Zanzinger zanzinger@alice-dsl.de
Dear Dieter,
if you don’t run services other than BaseX, I would recommend you to check out the ZIP version of BaseX [1], which already includes the Jetty web server and some startup scripts [2], and which will ensure that your web application will find all relevants directories. We even think about removing the WAR distribution from our download page, as it required too much manual interventions. Some more information is given on our Wiki page on web applications, which also describes the options in the jetty.xml and web.xml files [3].
This may hopefully give you some answers on your questions; if you want to know more, please don’t hesitate and ask again,
Best, Christian
[1] http://basex.org/products/download/all-downloads/ [2] http://docs.basex.org/wiki/Startup#BaseX_HTTP_Server [3] http://docs.basex.org/wiki/Web_Application
basex-talk@mailman.uni-konstanz.de