Search:

Apache » Lenya
project logo
  • Project
  • Developer
  • Community
  • Version 2.2
  • Version 2.0
  • Version 1.2
  • Version 2.0
    • FAQs
    • Installation
      • Download
      • Subversion Access
      • Install Instructions
    • Tutorials
      • Create a Publication
      • Create a Resource Type
        • Declaration
        • Creation
        • Presentation
        • Editing (One-Form)
        • Editing (BXE)
      • Implement a Usecase
        • Prerequisites
        • The Usecase
      • Setting up Eclipse
      • Proxying
        • Proxying
        • mod_proxy
        • mod_proxy_ajp
      • Best Practises
      • Production Checklist
      • Writing Tests
    • Concepts
      • Publication
      • Working with Documents
      • Authoring and Live mode
      • WYSIWYG
    • Technical Reference
      • Overview of Lenya Sitemaps
      • Repository
      • Access Control Specification
      • Usecase Framework
        • Overview
        • AbstractUsecase
      • Publications
        • Configuration
        • Publication Templating
      • Resource Types
      • Modules
      • Meta data
      • Protocols
        • lenya Protocol
        • lenya-document Protocol
        • site Protocol
        • lenyadoc Protocol
        • fallback Protocol
      • URLs and Links
        • URL Mapping
        • Link Management
    • Core API
    • Core Modules
      • ac
        • Overview
        • API
      • acusecases
        • Overview
        • API
      • administration
        • Overview
        • API
      • cache
        • Overview
        • API
      • janitor
        • Overview
        • API
      • ldap
        • Overview
        • API
      • linking
        • Overview
        • API
      • observation
        • Overview
        • API
      • properties
        • Overview
        • API
      • sitemanagement
        • Overview
        • API
      • templating
        • Overview
        • API
      • usecase
        • Overview
        • API
      • workflow
        • Overview
        • API
    • Standard Modules
      • blog
        • Overview
        • API
      • bxe
        • Overview
      • cforms
        • Overview
        • API
      • collection
        • Overview
        • API
      • contactform
        • Overview
        • API
      • development
        • Overview
        • API
      • editors
        • Overview
        • API
      • export
        • Overview
        • API
      • fckeditor
        • Overview
        • API
      • kupu
        • Overview
        • API
      • languageselector
        • Overview
      • lenyadoc
        • Overview
        • API
      • linkcheck
        • Overview
        • API
      • links
        • Overview
        • API
      • lucene
        • Overview
        • API
      • migration
        • Overview
        • API
      • navigation
      • neutron
        • Overview
      • news
        • Overview
        • API
      • notification
        • Overview
        • API
      • opendocument
        • Overview
        • API
      • prettyprinting
        • Overview
      • profiling
        • Overview
      • resource
        • Overview
        • API
      • simplesite
        • Overview
        • API
      • sitetree
        • Overview
        • API
      • sourcerepository
        • Overview
        • API
      • svg
        • Rounded Corners
        • Resizing Images
        • API
      • tinymce
        • Overview
        • API
      • usecasedocument
        • Overview
        • API
      • webdav
        • Getting started
        • Monitoring
        • WebDAV Servers
        • API
      • xhtml
        • Overview
        • API
      • xopus
        • Overview

Current Event

Meeting Bad Säckingen 2009

Built with Apache Lenya

The properties Module

Table of Contents
  • Introduction
  • Sample
  • Order of precedence
  • Locations
  • Usage
    • sitemap.xmap
    • java

Introduction

The properties module provides a service (InputModule) to configure publications using properties. The idea is to have a fallback of properties.

Sample

<properties>
  <property name="pubs.default.author" value="Miguel de Cervantes Saavedra"/>
</properties>

Order of precedence

note

The first values set get precedence, as in AntProperties

  1. Publication (lazy loaded in loadPublicationPropertiesIfNotDone())
  2. Lenya local
  3. Modules (all modules, not only the ones referenced in the publication)
  4. Lenya

Locations

  1. {pubDir}/lenya.properties.xml
  2. $LENYA_HOME/src/webapp/local.lenya.properties.xml
  3. {module}/lenya.properties.xml
  4. $LENYA_HOME/src/webapp/lenya.properties.xml

Usage

To activate your properties you need to save the above sample file in one of the above locations.

  1. Publication - on a publication level you are able to implement all properties and override all possible default ones.
  2. Lenya local - use this for global properties for all your lenya based pubs
  3. Modules - modules can use properties to allow user to override module specific properties.
  4. Lenya - global default properties

sitemap.xmap

Since the properties module is a cocoon input module, you can use it as any other input module.

...
<map:transform src="cocoon:/getDoctypeXSLT/{4}">
  <map:parameter name="author" value="{properties:pubs.default.author}"/>
  ...
</map:transform>
        

java

In your custom cocoon components use like follows.

 InputModule inputModule = null;
 ServiceSelector selector = null;
 String propKey = "pubs.default.author";
   try {
     selector = (ServiceSelector) m_manager.lookup(InputModule.ROLE + "Selector");
     inputModule = (InputModule) selector.select("properties");   
     String propValue = (String) inputModule.getAttribute(propKey, null,
                    objectModel)
...
        

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