Search:

Apache » Lenya
project logo
  • Project
  • Developer
  • Community
  • Version 2.2
  • Version 2.0
  • Version 1.2
  • Version 1.2
    • Installation
      • Download
      • Subversion Access
      • Install Instructions
    • Tutorial
      • Introduction
      • 1. Understanding Lenya
      • 2. Installing Lenya
      • 3. Anatomy of the Pipeline
      • 4. Editing in Lenya
      • 5. Custom Navigation in Lenya
      • 6a. Mod Proxy and Lenya
      • 6b. Mod Proxy and Lenya
    • How-To
      • FAQ
      • New Publication
      • Deploy Publication
      • Look and Feel
      • Custom Resource Type
      • Adding Mime Types
      • Site Navigation
      • LDAP Authentication
      • CMS Menus
      • CMS Screens
      • Search Publications
      • External Data
      • Unit Tests
    • Components
      • Access Control
        • Basic Terms
        • Access Controllers
        • Access Controller Resolvers
        • Authenticators
        • Authorizers
        • Policies and Policy Managers
        • Accreditable Managers
        • SSL Encryption
      • Authoring
        • Adding a new document creator
        • Image Upload
        • OpenOffice
      • Deployment
        • Proxying
      • Editors
        • HTML Form Editor
        • HTML One Form Editor
        • Bitflux Editor
        • Kupu
        • Xopus
      • Layout
        • Navigation
        • XHTML templating
        • Serving static resources
        • Lenya Menubar
      • Publication
        • PageEnvelopeModule
        • Site tree
      • Resource Types
        • Resource Types
      • Revision Control
        • Revision Controller
        • RCML
        • Check In
        • Check Out
        • Revisions
        • Rollback
      • Repository
        • WebDAV Servers
      • Search
        • Searching with Lucene
      • URI Handling
        • URI Parametrizer
        • URI Scheme
        • Usecases
      • Asset Management
        • Asset Management
      • Link Management
        • Link Management
      • Meta Data
        • Meta Data Handling
      • Multilingual Documents
        • Multilingual Document Handling
      • Tasks
        • The Task Concept
        • Defining Tasks
        • The TaskAction
        • Scheduling a Task
        • Included tasks
          • AntTask
          • DefaultFilePublisher
          • StaticHTMLExporter
          • MailTask
        • Developing Tasks
      • Workflow
        • Terms
        • The State Machine
        • Configuration
        • Implementation
      • Site Management
        • Archive
        • Copy
        • Deactivate
        • Delete
        • Delete the trash
        • Move
        • Move Up/Down
        • Rename
        • Restore
    • Miscellaneous
      • Namespaces
      • Reserved Names
      • XInclude Processor
    • 1.2 API (Javadoc)

Current Event

Meeting Bad Säckingen 2009

Built with Apache Lenya

Restore

Table of Contents
  • Introduction
  • Implementation
  • Parameters
  • usecase
    • Delete screen
    • Restore confirmation
  • Ant Task

Introduction

The restore operation corresponds to a move operation from an area, trash or archive, to the authoring

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

Delete screen

URL :

{document-URL}?lenya.usecase=restore&lenya.step=showscreen

usecase sitemap:

          <map:match pattern="restore" type="usecase">
            <map:match pattern="showscreen" type="step">
              <map:generate src="content/info/restore.xsp" type="serverpages"/>
              <map:transform src="xslt/info/restore.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 destination document id is computed in the serverpage from the identifier. The destination source is set to area in the stylesheet. A form (build with the xslt transformation) sends then the parameters as request parameters with the new URL.

Restore confirmation

URL :

{document-URL}?lenya.usecase=restore&lenya.step=restore&...{source parameters}

usecase sitemap:

          <map:match pattern="restore" type="usecase">
            <map:match pattern="restore" type="step">
              <map:act type="task">
                <map:redirect-to session="true" uri="{request:contextPath}/{../../../1}/{../../../2}/"/>
              </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 restoreDocument is in the publication :

{publication}/config/tasks/targets.xml

The target for the restore operation depends on the different targets

  • firstareaproperties, to set the needed properties dependent of the area of the source
  • secareaproperties, to set the needed properties dependent of the area of the destination
  • newcopydocumentid, to compute the unique destination id (Same logic like for the copy operation).
  • firstdocumentpath, to compute the directory of the contents for the source (Needed for the revisions and the rcml files)
  • secdocumentpath, to compute the directory where are the contents for the destination (Needed for the revisions and the rcml files)
  • move, to execute the different move operations

For more information about the Ant task, see the documentation Ant Task and the Javadocs.

Copyright © 1999-2009 The Apache Software Foundation. All rights reserved.