Move up/down
Table of Contents
Introduction
To move up or down a node in the sitetree
Implementation
It uses the task concept to execute some ant task
Parameters
The parameters are string-value parameters
Required parameters:
- the document id
- the direction (up or down)
- the task id
usecase
URL :
{document-URL}?properties.movenode.direction=up&lenya.usecase=move-node&lenya.step=move-node
usecase sitemap:
<map:match pattern="move-node" type="usecase"> <map:match pattern="move-node" type="step"> <map:act type="task"> <map:parameter name="task-id" value="movenode"/> <map:parameter name="properties.movenode.documentid" value="{page-envelope:document-id}"/> <map:redirect-to session="true" uri="{request:requestURI}"/> </map:act> </map:match> </map:match>
The parameter for the direction is a request parameter in the URL (fom the menu). The task id is set in the sitemap and the document id is get through the page envelope.
The action org.apache.lenya.cms.cocoon.acting.TaskAction calls the execution of the ant task.
Ant Task
The ant target movenode
is in the publication :
{publication}/config/tasks/targets.xml
For more information about the Ant task, see the documentation Ant Task and the Javadocs.