Re: XUpdate on Collection?

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

Re: XUpdate on Collection?

Jean-Marc Vanel-3
Phillip B Oldham wrote:

> Hi all
>
> I've been trying to change the name of a collection using a simple
> XUpdate via the REST interface (POST). I'm having no luck. Here's what
> I'm doing:
>
> <xupdate:modifications version="1.0"
>       xmlns:xupdate="http://www.xmldb.org/xupdate">
>   <xupdate:rename select="/documents/pending/" >active</xupdate:rename>
> </xupdate:modifications>
>
> And I'm posting this to: /exist/servlet
>
> PUT, GET, and DELETE work absolutely fine using the tool I've created.
> XUpdate works fine for xml docs.
>
> Any ideas?

I suggest to implement an XQuery function that rely on the XML:DB
CollectionManagementService

Then you can send a XQuery using the new function via REST .

This should not be too difficult, starting from an existing XQuery
function .

--
Jean-Marc Vanel
Conseil et Services / développement & intégration logiciels
Logiciel libre, Web, Java, XML ...
A la pointe de la technique, au service des projets
http://jmvanel.free.fr/ ===) CV, software resources

Mes journaux:
- sujets généraux en Français: http://jmvanel.free.fr/Block-note.html
- sujets informatiques en Français: http://jmvanel.free.fr/notes-informatiques.html
- computer science diary : http://jmvanel.free.fr/computer-notes.html

Worldwide Botanical Knowledge Base
http://wwbota.free.fr/ 
test XML query engine: http://jmvanel.free.fr/protea.html




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: XUpdate on Collection?

Phillip B Oldham

>--__--__--
>
>Message: 7
>Date: Tue, 27 Sep 2005 16:40:18 +0200
>From: Jean-Marc Vanel <[hidden email]>
>To:  [hidden email]
>Subject: Re: [Exist-open] XUpdate on Collection?
>
>Phillip B Oldham wrote:
>
>  
>
>>Hi all
>>
>>I've been trying to change the name of a collection using a simple
>>XUpdate via the REST interface (POST). I'm having no luck. Here's what
>>I'm doing:
>>
>><xupdate:modifications version="1.0"
>>      xmlns:xupdate="http://www.xmldb.org/xupdate">
>>  <xupdate:rename select="/documents/pending/" >active</xupdate:rename>
>></xupdate:modifications>
>>
>>And I'm posting this to: /exist/servlet
>>
>>PUT, GET, and DELETE work absolutely fine using the tool I've created.
>>XUpdate works fine for xml docs.
>>
>>Any ideas?
>>    
>>
>
>I suggest to implement an XQuery function that rely on the XML:DB
>CollectionManagementService
>
>Then you can send a XQuery using the new function via REST .
>
>This should not be too difficult, starting from an existing XQuery
>function .
>
Is this the only way to do it? Only I need to build into my app the
ability to rename collections. Seems silly that GET and DELETE will work
happily on collections, but POST won't.

phillip.oldham.vcf (179 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: XUpdate on Collection?

Pierrick Brihaye
Hi,

Phillip B Oldham a écrit :

[huge snip]

>> This should not be too difficult, starting from an existing XQuery
>> function .
>>
> Is this the only way to do it? Only I need to build into my app the
> ability to rename collections. Seems silly that GET and DELETE will work
> happily on collections, but POST won't.

Do you mean that you are able to rename a collection using a GET or
DELETE HTTP request ?

Feature or... bug ?

More explanations would be welcome.

Cheers,

p.b.


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Re: XUpdate on Collection?

Phillip B Oldham
Sorry, no. I mean that I do a simple GET request which pulls back a listing, or a DELETE request which removes the whole collection.

From a user's perspective, it seems a little odd that you can use XUpdate to rename a node/attribute, but not a collection (not tested documents yet).

Pierrick Brihaye wrote:
Hi,

Phillip B Oldham a écrit :

[huge snip]

This should not be too difficult, starting from an existing XQuery function .

Is this the only way to do it? Only I need to build into my app the ability to rename collections. Seems silly that GET and DELETE will work happily on collections, but POST won't.

Do you mean that you are able to rename a collection using a GET or DELETE HTTP request ?

Feature or... bug ?

More explanations would be welcome.

Cheers,

p.b.


--
Phillip B Oldham
kilo75 ltd
a: Round Foundry Media Centre, Foundry St, Leeds, LS11 5QP
t: +44 (0) 870 420 2410
e: [hidden email]
w: //kilo75.com/

Policies

This e-mail and its attachments are intended for the above named
recipient(s) only and may be confidential. If they have come to you
in error, please reply to this e-mail and highlight the error. No action
should be taken regarding content, nor must you copy or show them
to anyone.

This e-mail has been created in the knowledge that Internet e-mail
is not a 100% secure communications medium, and we have taken
steps to ensure that this e-mail and attachments are free from any
virus. We must advise that in keeping with good computing practice
the recipient should ensure they are completely virus free, and that
you understand and observe the lack of security when e-mailing us.



phillip.oldham.vcf (179 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: XUpdate on Collection?

Pierrick Brihaye
Hi again,

Phillip B Oldham a écrit :

> Sorry, no. I mean that I do a simple GET request which pulls back a
> listing, or a DELETE request which removes the whole collection.

Phew ! I thought you were actually able to rename a collection with just
a single GET request.

> From a user's perspective, it seems a little odd that you can use
> XUpdate to rename a node/attribute, but not a collection (not tested
> documents yet).

It isn't in the specs :
http://xmldb-org.sourceforge.net/xapi/api/org/xmldb/api/modules/CollectionManagementService.html

Renaming is always a complex problem. With the current specs, your would
create a new collection, copy the resources then delete your old collection.

[yet another huge snip]

Cheers,

p.b.




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Re: XUpdate on Collection?

Phillip B Oldham
Ahh... haven't come across that documentation before. Will have a look through, see if there's any other way of doing things. Will also post a new feature request.

Thanks!

Phill

Pierrick Brihaye wrote:
Hi again,

Phillip B Oldham a écrit :

Sorry, no. I mean that I do a simple GET request which pulls back a listing, or a DELETE request which removes the whole collection.

Phew ! I thought you were actually able to rename a collection with just a single GET request.

From a user's perspective, it seems a little odd that you can use XUpdate to rename a node/attribute, but not a collection (not tested documents yet).

It isn't in the specs :
http://xmldb-org.sourceforge.net/xapi/api/org/xmldb/api/modules/CollectionManagementService.html

Renaming is always a complex problem. With the current specs, your would create a new collection, copy the resources then delete your old collection.

[yet another huge snip]

Cheers,

p.b.




--
Phillip B Oldham
kilo75 ltd
a: Round Foundry Media Centre, Foundry St, Leeds, LS11 5QP
t: +44 (0) 870 420 2410
e: [hidden email]
w: //kilo75.com/

Policies

This e-mail and its attachments are intended for the above named
recipient(s) only and may be confidential. If they have come to you
in error, please reply to this e-mail and highlight the error. No action
should be taken regarding content, nor must you copy or show them
to anyone.

This e-mail has been created in the knowledge that Internet e-mail
is not a 100% secure communications medium, and we have taken
steps to ensure that this e-mail and attachments are free from any
virus. We must advise that in keeping with good computing practice
the recipient should ensure they are completely virus free, and that
you understand and observe the lack of security when e-mailing us.



phillip.oldham.vcf (179 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: XUpdate on Collection?

wolfgangmm
In reply to this post by Phillip B Oldham
>  From a user's perspective, it seems a little odd that you can use XUpdate
> to rename a node/attribute, but not a collection (not tested documents yet).

XUpdate by definition operates on xml nodes. It can't be used for
anything else than modifying a node tree. Resource management is
implementation dependant and thus beyond the scope of XUpdate, which
has to address in-memory implementations as well as databases.

eXist provides the required functionality for copy/move/rename, but it
is neither exposed through the REST interface nor XQuery functions.
The WebDAV servlet supports the extended HTTP methods COPY and MOVE,
and you could basically use these from a REST client too.

The official XML:DB API does also not support copy and move. However,
eXist extends CollectionManagementService to provide the missing
functionality, see:

http://exist-db.org/api/org/exist/xmldb/CollectionManagementServiceImpl.html

Based on this interface, it should be easily possible to write an
xquery extension function along the lines of the other functions in
the xmldb module.

Wolfgang


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open