On Fri, Jan 21, 2011 at 12:58 PM, Markus Joschko
<[email protected]> wrote:
> Hi,
> I face some difficulties in realizing the following case:
>
> I have a node to which I want to add children. The problem is, that
> (depending on the content of the to be created node) it is not added
> to the node directly but a folder is created to which the node is
> added. Like that
>
> + parent
>     + folderA (dynamically created)
>         - childABC
>     + folderB (dynamically created)
>         -childBAC
>
> Because the folders might not be available, I post to parent/* and
> registered a postprocessor to create the folder and move the just
> created child to the corresponding folder.
> That works fine. However the redirect url is still pointing to the
> previous location (parent/childABC) instead of
> parent/folderA/childABC.
> And I can't find a way to modify the location of the response within
> the postprocessor.
>
> So I wonder whether I am on the right track or should choose a
> different approach. Alternatively I could create my own postoperation
> but that seems to be cumbersome as extending from ModifyOperation
> isn't easy because of the dependencies in the constructor and
> AbstractCreateOperation is package private. So I would basically need
> to copy code directly.
>
> Any thoughts on this?

If you can modify the client's behaviour, you can add a :redirect
field to the POST request.
:redirect=parent/folderA/childABC

See 
http://sling.apache.org/site/manipulating-content-the-slingpostservlet.html#ManipulatingContent-TheSlingPostServlet-%257B%257B%253Aredirect%257D%257D



-- 
Vidar S. Ramdal <[email protected]> - http://www.idium.no
Sommerrogata 13-15, N-0255 Oslo, Norway
+ 47 22 00 84 00
Quando omni flunkus moritatus!

Reply via email to