Archive
Table of Contents
Introduction
The archive operation corresponds to a move operation from the authoring area to the archive
Implementation
Similar to the operation move
Parameters
Required parameters:
- the area for the source document
- the document id for the source document
- the task id
usecase
Archive screen
URL :
{document-URL}?lenya.usecase=archive&lenya.step=showscreen
usecase sitemap:
<map:match pattern="archive" type="usecase"> <map:match pattern="showscreen" type="step"> <map:generate src="content/info/archive.xsp" type="serverpages"/> <map:transform src="xslt/info/archive.xsl"> <map:parameter name="use-request-parameters" value="true"/> </map:transform> <map:call resource="style-cms-page"/> </map:match> </map:match>
The parameters for the source are get with the serverpage through the page envelope input module. The area for the destination is set to archive in the stylesheet. A form (build with the xslt transformation) sends then the parameters as request parameters with the new URL.
Archive confirmation
URL :
{document-URL}?lenya.usecase=archive&lenya.step=step&...{source parameters}
usecase sitemap:
<map:match pattern="archive" type="usecase"> <map:match pattern="archive" type="step"> <map:act type="task"> <map:redirect-to session="true" uri="{request-param:parenturl}"/> </map:act> </map:match> </map:match>
The action org.apache.lenya.cms.cocoon.acting.TaskAction calls the execution of the ant task.
Ant Task
The ant target archiveDocument
is in the publication :
{publication}/config/tasks/targets.xml
and depends on the different targets
-
firstareaproperties
, to set the needed properties dependent of the source area -
secareaproperties
, to set the needed properties dependent of the destination area -
newarchivedocumentid
, to compute the unique destination id from the source document id -
firstdocumentpath
, to compute the directory of the source contents (Needed for the revisions and the rcml files) -
secdocumentpath
, to compute the directory where are the destination contents (Needed for the revisions and the rcml files) -
setIdentifier
, to save the source document id (in the dc:identifier). Necessary to be able to restore later the document -
move
, to execute the different move operations
For more information about the Ant task, see the documentation Ant Task and the Javadocs.