REST - adding document to database with specified name
Monday, 18 October 2010 · 7 messages · last reply 19 Oct 2010
CG
Christian Grün18 Oct 2010 10:35 #
Dear Ivan,
this is one of the features which is currently discussed for the next release; additionally, you'll soon be allowed to support hierarchic collection paths, such as..
http://localhost:8984/basex/jax-rx/collection/path/to/filename.xml
Some JaxRX interface issues have to be solved first to make this possible.
Hope this helps,
Christian
Quoted text · 19 lines
On Mon, Oct 18, 2010 at 10:25 AM, <ilagunov at evelopers.com> wrote: > Hello, > > I've tried using RESTful API HTTP methods PUT and POST for adding a new document to the database. But it appeared to be impossible to specify the name of file to be added. > > In POST method we must specify the following URL: > http://localhost:8984/basex/jax-rx/collection > > In PUT method it's almost the same. > > The result is that the file is added with a name like "1287390239789". > > Why cannot we specify the URL this way: > http://localhost:8984/basex/jax-rx/collection/filename.xml > so that the file is added with a name filename.xml? > > Best regards, > Ivan >
IL
Ivan Lagunov18 Oct 2010 10:46 #
Dear Christian,
Thanks, I'm glad to hear it! Is there some estimated date for the next release?
Best regards,
Ivan
Quoted text · Christian Grün · 36 lines
On 10/18/2010 12:35 PM, Christian Grün wrote: > Dear Ivan, > > this is one of the features which is currently discussed for the next > release; additionally, you'll soon be allowed to support hierarchic > collection paths, such as.. > > http://localhost:8984/basex/jax-rx/collection/path/to/filename.xml > > Some JaxRX interface issues have to be solved first to make this possible. > > Hope this helps, > Christian > > > > On Mon, Oct 18, 2010 at 10:25 AM,<ilagunov at evelopers.com> wrote: >> Hello, >> >> I've tried using RESTful API HTTP methods PUT and POST for adding a new document to the database. But it appeared to be impossible to specify the name of file to be added. >> >> In POST method we must specify the following URL: >> http://localhost:8984/basex/jax-rx/collection >> >> In PUT method it's almost the same. >> >> The result is that the file is added with a name like "1287390239789". >> >> Why cannot we specify the URL this way: >> http://localhost:8984/basex/jax-rx/collection/filename.xml >> so that the file is added with a name filename.xml? >> >> Best regards, >> Ivan >> >
CG
Christian Grün18 Oct 2010 10:56 #
Quoted text · Ivan Lagunov · 2 lines
> Thanks, I'm glad to hear it! Is there some estimated date for the next > release?
Yes: exactly between Nov 10 and Jan 11. ;)
The next release was planned somewhat earlier; instead, we decided to increase the frequency of stable minor releases. With the next official release, JaxRx will be updated more often, and included in the Maven repository.
Christian
Quoted text · Ivan Lagunov · 46 lines
> Best regards, > Ivan > > On 10/18/2010 12:35 PM, Christian Grün wrote: >> >> Dear Ivan, >> >> this is one of the features which is currently discussed for the next >> release; additionally, you'll soon be allowed to support hierarchic >> collection paths, such as.. >> >> http://localhost:8984/basex/jax-rx/collection/path/to/filename.xml >> >> Some JaxRX interface issues have to be solved first to make this possible. >> >> Hope this helps, >> Christian >> >> >> >> On Mon, Oct 18, 2010 at 10:25 AM,<ilagunov at evelopers.com> wrote: >>> >>> Hello, >>> >>> I've tried using RESTful API HTTP methods PUT and POST for adding a new >>> document to the database. But it appeared to be impossible to specify the >>> name of file to be added. >>> >>> In POST method we must specify the following URL: >>> http://localhost:8984/basex/jax-rx/collection >>> >>> In PUT method it's almost the same. >>> >>> The result is that the file is added with a name like "1287390239789". >>> >>> Why cannot we specify the URL this way: >>> http://localhost:8984/basex/jax-rx/collection/filename.xml >>> so that the file is added with a name filename.xml? >>> >>> Best regards, >>> Ivan >>> >> > > >
IL
Ivan Lagunov18 Oct 2010 11:22 #
Good news but now it's time to choose which database will be used in our project. However, I couldn't fulfill the following scenario with existing REST API:
1. Add a document to existing database/collection.
2. Retrieve contents of this document at any moment later.
3. Update this document partly or overwrite.
4. Delete this document.
I hope it'll be covered in the next release. I might have missed something. If there is a way to perform these actions from a remote client machine, please advise. Thanks!
Best regards,
Ivan
Quoted text · Christian Grün · 57 lines
On 10/18/2010 12:56 PM, Christian Grün wrote: >> Thanks, I'm glad to hear it! Is there some estimated date for the next >> release? > Yes: exactly between Nov 10 and Jan 11. ;) > > The next release was planned somewhat earlier; instead, we decided to > increase the frequency of stable minor releases. With the next > official release, JaxRx will be updated more often, and included in > the Maven repository. > > Christian > > > >> Best regards, >> Ivan >> >> On 10/18/2010 12:35 PM, Christian Grün wrote: >>> Dear Ivan, >>> >>> this is one of the features which is currently discussed for the next >>> release; additionally, you'll soon be allowed to support hierarchic >>> collection paths, such as.. >>> >>> http://localhost:8984/basex/jax-rx/collection/path/to/filename.xml >>> >>> Some JaxRX interface issues have to be solved first to make this possible. >>> >>> Hope this helps, >>> Christian >>> >>> >>> >>> On Mon, Oct 18, 2010 at 10:25 AM,<ilagunov at evelopers.com> wrote: >>>> Hello, >>>> >>>> I've tried using RESTful API HTTP methods PUT and POST for adding a new >>>> document to the database. But it appeared to be impossible to specify the >>>> name of file to be added. >>>> >>>> In POST method we must specify the following URL: >>>> http://localhost:8984/basex/jax-rx/collection >>>> >>>> In PUT method it's almost the same. >>>> >>>> The result is that the file is added with a name like "1287390239789". >>>> >>>> Why cannot we specify the URL this way: >>>> http://localhost:8984/basex/jax-rx/collection/filename.xml >>>> so that the file is added with a name filename.xml? >>>> >>>> Best regards, >>>> Ivan >>>> >> >> >
CG
Christian Grün18 Oct 2010 11:36 #
Quoted text · Ivan Lagunov · 12 lines
> Good news but now it's time to choose which database will be used in our > project. However, I couldn't fulfill the following scenario with existing > REST API: > > 1. Add a document to existing database/collection. > 2. Retrieve contents of this document at any moment later. > 3. Update this document partly or overwrite. > 4. Delete this document. > > I hope it'll be covered in the next release. I might have missed something. > If there is a way to perform these actions from a remote client machine, > please advise. Thanks!
All this can be easily done with our database commands and the client-/server architecture, which will give you more freedom than REST. Some online examples can be found here:
– Version 6.1:
http://basex.org/developing
– Latest versions:
https://svn.uni-konstanz.de/dbis/basex/trunk/examples/src/main/java/org/basex/examples/
We know that the current documentation on the latest project code is not sufficient, so feel free to ask for more,
Christian
Quoted text · Ivan Lagunov · 70 lines
> > Best regards, > Ivan > > On 10/18/2010 12:56 PM, Christian Grün wrote: >>> >>> Thanks, I'm glad to hear it! Is there some estimated date for the next >>> release? >> >> Yes: exactly between Nov 10 and Jan 11. ;) >> >> The next release was planned somewhat earlier; instead, we decided to >> increase the frequency of stable minor releases. With the next >> official release, JaxRx will be updated more often, and included in >> the Maven repository. >> >> Christian >> >> >> >>> Best regards, >>> Ivan >>> >>> On 10/18/2010 12:35 PM, Christian Grün wrote: >>>> >>>> Dear Ivan, >>>> >>>> this is one of the features which is currently discussed for the next >>>> release; additionally, you'll soon be allowed to support hierarchic >>>> collection paths, such as.. >>>> >>>> http://localhost:8984/basex/jax-rx/collection/path/to/filename.xml >>>> >>>> Some JaxRX interface issues have to be solved first to make this >>>> possible. >>>> >>>> Hope this helps, >>>> Christian >>>> >>>> >>>> >>>> On Mon, Oct 18, 2010 at 10:25 AM,<ilagunov at evelopers.com> wrote: >>>>> >>>>> Hello, >>>>> >>>>> I've tried using RESTful API HTTP methods PUT and POST for adding a new >>>>> document to the database. But it appeared to be impossible to specify >>>>> the >>>>> name of file to be added. >>>>> >>>>> In POST method we must specify the following URL: >>>>> http://localhost:8984/basex/jax-rx/collection >>>>> >>>>> In PUT method it's almost the same. >>>>> >>>>> The result is that the file is added with a name like "1287390239789". >>>>> >>>>> Why cannot we specify the URL this way: >>>>> http://localhost:8984/basex/jax-rx/collection/filename.xml >>>>> so that the file is added with a name filename.xml? >>>>> >>>>> Best regards, >>>>> Ivan >>>>> >>> >>> >> > > >
MS
Hi Ivan,
I hope I'm still on time with some examples that might faciliate your decision: http://www.inf.uni-konstanz.de/dbis/basex/code/server/CollectionsServerExample It's just a brief overview, but hopefully something to get you started. Our webserver tries to interpret the XML-fragment I put in the code, so you might want to download the file without highlighting directly via [1].
Hope this helps, feel free to ask for more detailed explanations, I'll try my best :-)
Kind regards
Michael
[1] https://svn.uni-konstanz.de/dbis/basex/trunk/examples/src/main/java/org/basex/examples/server/CollectionsServerExample.java
Quoted text · Ivan Lagunov · 5 lines
Am 18.10.2010 um 11:22 schrieb Ivan Lagunov: > 1. Add a document to existing database/collection. > 2. Retrieve contents of this document at any moment later. > 3. Update this document partly or overwrite. > 4. Delete this document.
IL
Ivan Lagunov19 Oct 2010 09:13 #
Hi Michael,
Thanks! I've already got acquainted with the examples on this site. For now it's clear to me.
Best regards,
Ivan
Quoted text · Michael Seiferle · 21 lines
On 10/18/2010 09:30 PM, Michael Seiferle wrote: > Hi Ivan, > > I hope I'm still on time with some examples that might faciliate your decision: > http://www.inf.uni-konstanz.de/dbis/basex/code/server/CollectionsServerExample > It's just a brief overview, but hopefully something to get you started. > Our webserver tries to interpret the XML-fragment I put in the code, so you might want to download the file without highlighting directly via [1]. > > Hope this helps, feel free to ask for more detailed explanations, I'll try my best :-) > > Kind regards > Michael > [1] https://svn.uni-konstanz.de/dbis/basex/trunk/examples/src/main/java/org/basex/examples/server/CollectionsServerExample.java > > Am 18.10.2010 um 11:22 schrieb Ivan Lagunov: > >> 1. Add a document to existing database/collection. >> 2. Retrieve contents of this document at any moment later. >> 3. Update this document partly or overwrite. >> 4. Delete this document. >
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery