eXist DB: processor names, document name and @collection

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

eXist DB: processor names, document name and @collection

Florent Georges
  Hi

  I'm currently testing querying eXist.  I try to find help
within both the examples and the Java sources.  I have three
questions / remarks (please forgive me if I made wrong
guesses):

  1/ Processor names.  The XMLDB processor names are
'oxf:xmldb-insert', 'oxf:xmldb-query', 'oxf:xmldb-delete'
and 'oxf:xmldb-update'.  Their 'query' inputs take
respectively elements 'xdb:insert', 'xdb:query',
'xdb:delete' and 'xdb:update'.

  Why not have a single processor, 'oxf:xmldb', the kind of
command being determined by the element used?

  2/ Insert: document name.  I didn't find a way to name the
inserted document with 'oxf:xmldb-insert'.

  3/ @collection is required.  This attribute is required on
'xdb:insert', 'xdb:query', 'xdb:delete' and 'xdb:update'.
But in a query, the way to access documents is by the
collection() function.  So it is superfluous to use both
@collection and collection(), isn't it?  Is it really on
purpose?

  Thanks in advance.

  Regards,

--drkm




















       

       
               
___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences.
http://fr.answers.yahoo.com 




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: eXist DB: processor names, document name and @collection

Alessandro  Vernet
Administrator
Florent,

On 8/8/06, Florent Georges <[hidden email]> wrote:
>   1/ Processor names.  The XMLDB processor names are
> 'oxf:xmldb-insert', 'oxf:xmldb-query', 'oxf:xmldb-delete'
> and 'oxf:xmldb-update'.  Their 'query' inputs take
> respectively elements 'xdb:insert', 'xdb:query',
> 'xdb:delete' and 'xdb:update'.
>
>   Why not have a single processor, 'oxf:xmldb', the kind of
> command being determined by the element used?

There are arguments for and against having multiple processors. To
deal with XML:DB, PresentationServer provides multiple processors, but
there is only one processor (the Delegation processor) to access
JavaBeans, web services, and EJBs.

>   2/ Insert: document name.  I didn't find a way to name the
> inserted document with 'oxf:xmldb-insert'.

I am not sure if you can set the name of the document you want to
insert with the XML:DB API. If it is possible, and you wish to modify
the XML:DB Insert processor, you can submit your patch in this list
and we'll look at integrating it in the code base.

Alternatively, if you use the submit.xpl pipeline, you will be able to
set the name of the document. See an example in this stub of eXist
documentation:

https://wiki.objectweb.org/ops/Wiki.jsp?page=EXist

>   3/ @collection is required.  This attribute is required on
> 'xdb:insert', 'xdb:query', 'xdb:delete' and 'xdb:update'.
> But in a query, the way to access documents is by the
> collection() function.  So it is superfluous to use both
> @collection and collection(), isn't it?  Is it really on
> purpose?

In a query, you can use collection() to access other collections, but
you don't have to use collection(). For instance the default query in
the XQuery sandbox is just:

<company>
    {
    for $d in /company/department return
    <department employee-count="{count($d/employee)}"/>
    }
</company>

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: eXist DB: processor names, document name and @collection

Florent Georges
Alessandro Vernet wrote:

  Hi

> >   2/ Insert: document name.  I didn't find a way to name
> > the inserted document with 'oxf:xmldb-insert'.

> I am not sure if you can set the name of the document you
> want to insert with the XML:DB API.

  Yes, I think you're right.  I didn't find a way to do that in the
XML:DB API.

> Alternatively, if you use the submit.xpl pipeline, you will
> be able to set the name of the document. See an example in
> this stub of eXist documentation:

> https://wiki.objectweb.org/ops/Wiki.jsp?page=EXist

  Mmh, I'm not sure to understand.  Do you mean by using the REST API
of eXist?  If you do, it is not XML:DB anymore, and it is restricted to
eXist.  In this case, I'd prefer to use a query and use the eXist's
xmldb:store() extension function.

  Regards,

--drkm






















       
 p5.vert.ukl.yahoo.com uncompressed/chunked Sun Aug 13 13:13:38 GMT 2006
       
               
___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences.
http://fr.answers.yahoo.com 




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: eXist DB: processor names, document name and @collection

Alessandro  Vernet
Administrator
Florent,

On 8/13/06, Florent Georges <[hidden email]> wrote:
>   Mmh, I'm not sure to understand.  Do you mean by using the REST API
> of eXist?  If you do, it is not XML:DB anymore, and it is restricted to
> eXist.  In this case, I'd prefer to use a query and use the eXist's
> xmldb:store() extension function.

Yes, using the REST API works on eXist and any other system that
provides a similar REST API. Essentially, to create gaga.xml in
myCollection, you PUT the XML data to the URL
http://localhost/yourApp/exist/db/myCollection/gaga.xml. I think this
is fairly elegant. But of course if you have some other backend in
mind that supports XML:DB but doesn't have a similar REST API, then
XML:DB will be more portable for you.

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet