You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Erik Buene <er...@idium.no> on 2008/07/31 11:56:33 UTC

Delete child nodes with post

Hi,

An app I'm making will have a trashcan implemented as a node, with child 
nodes being trashed items.

Is there an easy way to delete all children of a node with http post 
without specifying every child node?

Btw. Kudos to Lars Trieloff for a great cheat sheet :)

Regards,
Erik Buene

Re: Delete child nodes with post

Posted by Erik Buene <er...@idium.no>.
Bertrand Delacretaz wrote:
> On Thu, Jul 31, 2008 at 12:40 PM, Erik Buene <er...@idium.no> wrote:
>   
>> Ok, have thought of that, but then it's probably more robust to get and
>> specify all nodes.
>> In case something goes wrong client side between requests it's better not to
>> potentially lose the parent node....
>>     
>
> Yes, but you could maybe use an intermediate node, trash/items, and
> delete the items node.
>
> And then, when you want to put something into the trash, post to
> trash/items/something, and items will be created anew if needed.
>   
Not a bad idea, thank you :)

Regards,
Erik Buene


Re: Delete child nodes with post

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Thu, Jul 31, 2008 at 12:40 PM, Erik Buene <er...@idium.no> wrote:
> Bertrand Delacretaz wrote:
>> ...The easiest is probably to delete the parent node, and recreate it
>> right away, if that works in your context.
>>
>>
>
> Ok, have thought of that, but then it's probably more robust to get and
> specify all nodes.
> In case something goes wrong client side between requests it's better not to
> potentially lose the parent node....

Yes, but you could maybe use an intermediate node, trash/items, and
delete the items node.

And then, when you want to put something into the trash, post to
trash/items/something, and items will be created anew if needed.

-Bertrand

Re: Delete child nodes with post

Posted by Erik Buene <er...@idium.no>.
Hi Bertrand,

Bertrand Delacretaz wrote:
> On Thu, Jul 31, 2008 at 11:56 AM, Erik Buene <er...@idium.no> wrote:
>   
>> ...Is there an easy way to delete all children of a node with http post without
>> specifying every child node?...
>>     
>
> The easiest is probably to delete the parent node, and recreate it
> right away, if that works in your context.
>
>   
Ok, have thought of that, but then it's probably more robust to get and 
specify all nodes.
In case something goes wrong client side between requests it's better 
not to potentially lose the parent node.

Was hoping for something magical like ":applyTo" = "/node/path/*", but 
that did not work of course :)

Regards,
Erik Buene


Re: Delete child nodes with post

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Thu, Jul 31, 2008 at 11:56 AM, Erik Buene <er...@idium.no> wrote:
> ...Is there an easy way to delete all children of a node with http post without
> specifying every child node?...

The easiest is probably to delete the parent node, and recreate it
right away, if that works in your context.

-Bertrand