Search:

Apache » Lenya
project logo
  • Project
  • Developer
  • Community
  • 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

Built with Apache Lenya

Deactivate a document

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

Introduction

We have to :

  • look if there are some live children, if no other language version is live
  • delete the live contents (xml file) for the given document id and the given language
  • delete the live resources for the given document id only if no other language version is live
  • delete the language from the node corresponding to given the document id or all the node, if no other language version is live.

Implementation

It is implemented in a sequence of usecases to get all needed parameters, and uses the task concept to execute some ant task

Parameters

The parameters are string-value parameters

Required parameters:

  • the document id
  • the language
  • the task id

usecase

They are implemented in the usecase sitmap (core)

Deactivate screen

URL :

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

usecase sitemap:

          <map:match pattern="deactivate" type="usecase">
            <map:match pattern="showscreen" type="step">
              <map:generate src="content/info/deactivate.xsp" type="serverpages"/>
              <map:transform src="xslt/info/deactivate.xsl">
                <map:parameter name="use-request-parameters" value="true"/>
              </map:transform>
              <map:transform src="cocoon:/notification/{../../1}/deactivate.xsl"/>
              <map:transform src="cocoon://scheduler/{../../1}/{../../2}/{../../3}.xsl"/>
              <map:call resource="style-cms-page"/>
            </map:match>
          </map:match>
        

In the serverpage, we get the required parameters and if no other language version is live, we look for the live children. The stylesheet xslt/info/deactivate.xsl builds a form, if the requirement are achieved, else shows a message.

Deactivate confirmation

URL :

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

usecase sitemap:

          <map:match pattern="deactivate" type="usecase">
            <map:match pattern="deactivate" type="step">
              <map:act type="task">
                <map:redirect-to session="true" uri="{request:requestURI}"/>
              </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 deactivateDocumentis in the publication :

{publication}/config/tasks/targets.xml

and depends on the target livedocumentpath, to compute the live directory of the contents

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

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

Apache Lenya, Apache, and the Apache feather logo are trademarks of The Apache Software Foundation.