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

Meta Data

Table of Contents
  • Introduction
  • Implementation
    • Create Meta Data
    • Display Meta Data
    • Modify Meta data
  • Involved classes, XSPs and XSLTs

Introduction

Meta data is kept directly inside the xml document. It is based on the Dublin Core standard.

There are basically three use cases:

  1. Create Meta Data
  2. Display Meta Data
  3. Modify Meta Data

Implementation

Create Meta Data

Upon creation of a document a sample is copied from the sample doctype directory. This sample already contains some sample meta data. The creator then applies an XSLT transformation to this sample which adapts the sample values to the values suplied in the creator request. This values are partially filled in by the user (subject, desciption, etc.) and partly by the system (creator, creation data). This is done in the create ant task which at the end invokes an xslt task which applies the addMetaData.xsl stylesheet which adapts the meta data according to the request values.

Display Meta Data

The display of meta data is handled by the meta.xsp xsp.

Modify Meta data

The modification of meta data is handled in the info.xmap sitemap. The matcher makes sure to check the document out before the modification and checking it back in after the modification. This is done using the ReservedCheckoutTestAction and ReservedCheckinAction. If there is an error the request is redirected to the meta data screen which displays a warning saying that the checkout or checkin failed and who was locking the document since what date and time.

Once the document is checked out the modifications are applied with the help of an ant task. There is a target named save-meta-data which simply invokes the ant task WriteDCParametersTask. This task saves the meta data using the DublinCore interface.

Involved classes, XSPs and XSLTs

The following classes, XSPs and XSLTs are involved in meta data handling:

org.apache.lenya.cms.ant.WriteDCParametersTask
A simple ant task which saves the meta data which is passed as arguments to file using the DublinCore class.
$publication-id/config/tasks/targets.xml
Defines the save-meta-data target which handles saving of meta data with the help of the WriteDCParametersTask ant task. Also defines the create target which is used create new documents and to change the meta data according to the request values from the creation request.
org.apache.lenya.cms.publication.DublinCore
A simple interface to save and retrieve dublin core meta data.
org.apache.lenya.cms.cocoon.acting.ReservedCheckoutTestAction
Action that tests if a document can be checked out and if yes does check it out (See Revision Controller).
org.apache.lenya.cms.cocoon.acting.ReservedCheckinAction
Action that checks a document in (See Revision Controller).
src/webapp/lenya/content/info/meta.xsp, src/webapp/lenya/xslt/info/info.xsl
Handle the display of the meta data in the info area. This is also a form which can be used to modify the meta data via a POST request.
src/webapp/lenya/xslt/authoring/addMetaData.xsl
Simple XSLT stylesheet that modifies the meta data according to the input parameters.

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.