add resource from client
Tuesday, 24 May 2016 · 8 messages
GW
Gilad Wagner24 May 2016 09:47 #
Hi There,
I need to load our db from a client xml, the problem is the server cannot reach the client so remote url is not an option.
I think I need to use the -I/-i options, but I couldn't find documentation about how to use it. Can you show me a little example?
Thank you!
Gilad.
CG
Christian Grün24 May 2016 12:18 #
Hi Gilad,
Welcome. Some questions:
Quoted text · Gilad Wagner · 1 line
> I need to load our db from a client xml
What do you mean with "load our db from a client xml"? Do you want to retrieve documents from a BaseX database or store new documents?
Quoted text · Gilad Wagner · 2 lines
> the problem is the server cannot > reach the client so remote url is not an option.
So you would like to access a client machine from the server?
Looking forward to more details,
Christian
GW
Gilad Wagner24 May 2016 12:34 #
Hi Christian,
Sorry for lazy explanation.
I will try to rephrase:
Given a server with basex-server and a remote client, I want to take xml from the client machine and store it on the basex server.
(I know I can copy the file from client to server and then store it, but it¹s not possible in my case)
Thanks!
Gilad.
Quoted text · Christian Grün · 17 lines
On 5/24/16, 1:18 PM, "Christian Grün" <christian.gruen at gmail.com> wrote: >Hi Gilad, > >Welcome. Some questions: > >> I need to load our db from a client xml > >What do you mean with "load our db from a client xml"? Do you want to >retrieve documents from a BaseX database or store new documents? > >> the problem is the server cannot >> reach the client so remote url is not an option. > >So you would like to access a client machine from the server? > >Looking forward to more details, >Christian
CG
Christian Grün24 May 2016 12:36 #
Quoted text · Gilad Wagner · 2 lines
> (I know I can copy the file from client to server and then store it, but > it¹s not possible in my case)
Did you already have a look at our existing APIs (REST, Client Bindings, etc.)? See our documentation for more details [1].
Hope this helps,
Christian
[1] http://docs.basex.org/wiki/API
GW
Gilad Wagner24 May 2016 12:52 #
Can’t I do it with BaseXClient? I couldn’t find docs for BaseXClient and the –I/-i options…
BTW: The xml I need to store is someithing like 4MB so the command “Add test.xml <XML content…>" is not working.
Quoted text · Christian Grün · 11 lines
On 5/24/16, 1:36 PM, "Christian Grün" <christian.gruen at gmail.com> wrote: >> (I know I can copy the file from client to server and then store it, but >> it¹s not possible in my case) > >Did you already have a look at our existing APIs (REST, Client >Bindings, etc.)? See our documentation for more details [1]. > >Hope this helps, >Christian > >[1] http://docs.basex.org/wiki/API
CG
Christian Grün24 May 2016 12:53 #
See e.g. [1] It is linked from our documentation: Developing → APIs → Clients → Java.
[1] https://github.com/BaseXdb/basex/blob/master/basex-examples/src/main/java/org/basex/examples/api/AddExample.java
Quoted text · Gilad Wagner · 20 lines
On Tue, May 24, 2016 at 12:52 PM, Gilad Wagner <giladw at mintigo.com> wrote: > Can’t I do it with BaseXClient? I couldn’t find docs for BaseXClient and > the –I/-i options… > > BTW: The xml I need to store is someithing like 4MB so the command “Add > test.xml <XML content…>" is not working. > > On 5/24/16, 1:36 PM, "Christian Grün" <christian.gruen at gmail.com> wrote: > >>> (I know I can copy the file from client to server and then store it, but >>> it¹s not possible in my case) >> >>Did you already have a look at our existing APIs (REST, Client >>Bindings, etc.)? See our documentation for more details [1]. >> >>Hope this helps, >>Christian >> >>[1] http://docs.basex.org/wiki/API >
CG
Christian Grün24 May 2016 12:58 #
PS: Maybe it could help if you spend a bit more time in your wording.. Are you talking about the BaseXClient Java class or the "basexclient" startup script? With the latter one, if you use -i, your input will be bound to the context item. You could potentially store such a file via
db:add: basexclient -i doc.xml -q "db:add('database', ., 'doc.xml')"Quoted text · Christian Grün · 28 lines
On Tue, May 24, 2016 at 12:53 PM, Christian Grün <christian.gruen at gmail.com> wrote: > See e.g. [1] It is linked from our documentation: Developing → APIs → > Clients → Java. > > [1] https://github.com/BaseXdb/basex/blob/master/basex-examples/src/main/java/org/basex/examples/api/AddExample.java > > > On Tue, May 24, 2016 at 12:52 PM, Gilad Wagner <giladw at mintigo.com> wrote: >> Can’t I do it with BaseXClient? I couldn’t find docs for BaseXClient and >> the –I/-i options… >> >> BTW: The xml I need to store is someithing like 4MB so the command “Add >> test.xml <XML content…>" is not working. >> >> On 5/24/16, 1:36 PM, "Christian Grün" <christian.gruen at gmail.com> wrote: >> >>>> (I know I can copy the file from client to server and then store it, but >>>> it¹s not possible in my case) >>> >>>Did you already have a look at our existing APIs (REST, Client >>>Bindings, etc.)? See our documentation for more details [1]. >>> >>>Hope this helps, >>>Christian >>> >>>[1] http://docs.basex.org/wiki/API >>
GW
Gilad Wagner24 May 2016 13:24 #
Awesome!
This is exactly what I needed.
Quoted text · Christian Grün · 45 lines
On 5/24/16, 1:58 PM, "Christian Grün" <christian.gruen at gmail.com> wrote: >PS: Maybe it could help if you spend a bit more time in your wording.. >Are you talking about the BaseXClient Java class or the "basexclient" >startup script? With the latter one, if you use -i, your input will be >bound to the context item. You could potentially store such a file via >db:add: > > basexclient -i doc.xml -q "db:add('database', ., 'doc.xml')" > > > >On Tue, May 24, 2016 at 12:53 PM, Christian Grün ><christian.gruen at gmail.com> wrote: >> See e.g. [1] It is linked from our documentation: Developing → APIs → >> Clients → Java. >> >> [1] >>https://github.com/BaseXdb/basex/blob/master/basex-examples/src/main/java >>/org/basex/examples/api/AddExample.java >> >> >> On Tue, May 24, 2016 at 12:52 PM, Gilad Wagner <giladw at mintigo.com> >>wrote: >>> Can’t I do it with BaseXClient? I couldn’t find docs for BaseXClient >>>and >>> the –I/-i options… >>> >>> BTW: The xml I need to store is someithing like 4MB so the command “Add >>> test.xml <XML content…>" is not working. >>> >>> On 5/24/16, 1:36 PM, "Christian Grün" <christian.gruen at gmail.com> >>>wrote: >>> >>>>> (I know I can copy the file from client to server and then store it, >>>>>but >>>>> it¹s not possible in my case) >>>> >>>>Did you already have a look at our existing APIs (REST, Client >>>>Bindings, etc.)? See our documentation for more details [1]. >>>> >>>>Hope this helps, >>>>Christian >>>> >>>>[1] http://docs.basex.org/wiki/API >>>
Written for BaseX 8.4. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery