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

Mapping URLs to Documents

Table of Contents
  • URL Axioms
  • Language Versions

URL Axioms

Lenya 2.0 is based on the following axioms:

  • A URL is represented by exactly one document.
  • A document can be represented by an arbitrary number of URLs.
  • For each document, there is exactly one canonical URL.

This is reflected in the following methods:

  • DocumentBuilder.buildDocument(...)
  • DocumentBuilder.buildCanonicalUrl(...)

The concept of multiple URLs per document is typically used for language versions (foo_{defaultlanguage}.html = foo.html) and to support different URL suffixes (foo, foo.htm, foo.html, foo.pdf).

The site structure is tightly connected to the URL space. Link URLs are derived directly from the site structure. The bar node in the following example

<node id="foo">
  <node id="bar"/>
</node>

is accessed using an URL containing the snippet /foo/bar.

Language Versions

The different language versions of a document can either be accessed using suffixes (foo_en, foo_de), or by attaching them to different nodes with the same UUID attribute in the site structure. In the following example, the top-level nodes "en" and "de" are used as entry points for the respective language.

<site>
  <node id="en">
    <node id="welcome" uuid="def456...">
      <label xml:lang="en">Welcome</label>
    </node>
  </node>
  <node id="de">
    <node id="willkommen" uuid="def456...">
      <label xml:lang="de">Willkommen</label>
    </node>
  </node>
</site>

This results in the following URLs:

  • /en/welcome - "Welcome"
  • /de/willkommen - "Willkommen"

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