| ||
![]() |
Lenya Process for Displaying Documents | |
|
This article follows the process Lenya uses to turn standard Lenya documents into HTML with navigation.
It starts in publication-sitemap.xmap: <map:match pattern="**.html">
Notice the {page-envelope:document-type}. That is when Lenya checks parameter-doctype.xmap to get a value. Each numbered variable is set to the * in the match pattern: {1} = "view" {2} = publication-id {3} = area {4} = document-type {5} = document-url with first slash removed. 2, 3, and 4 could (or should) have been added to the code later rather than passed as parameters. Doing it in the match pattern accomplishes: 1. Getting document-type requires some processing, so this calls that code once. 2. It allows shorter names in the src parameters. 3. It confuses everybody because they have to remember which number refers to which variable. 4. It allows other pipelines to call this pipeline overriding these variables. This is very useful for things like my Website Map because they can change the body without repeating the code for formatting. <map:match pattern="lenyabody-*/*/*/*/**">
Skip to the content, since the navigation pulls from other files. The parameters are: <map:match pattern="lenya-document-*/*/*/**.xml">
doctypes.xmap {1} = "view" {2} = area {3} = document-type {4} = document=path with final ".xml" removed <map:match pattern="*/*/*/**.xml">
This pulls the XML from {pub}/content, and performs a transformation xslt/{document-type}2xhtml.xsl. NavigationYou probably do not need to understand this, but here is how the navigation XML is generated:global-sitemap.xmap The navigation elements come from here, passing the parameters after removing the first. <map:match pattern="navigation/**"> <map:mount uri-prefix="navigation" src="lenya/navigation.xmap" check-reload="true" reload-method="synchron"/> </map:match> navigation.xmap {1} = publication-id {2} = area {3} = navigation element name {4} = document-url with first slash and final ".xml" removed <!-- pattern: {pub-id}/{area}/{nav-element}/{url}.xml -->
The XML source comes from pubs/{publication-id}/content/{area}/sitetree.xml, and is passed through sitetree2nav.xsl: {1} = publication-id {2} = area {3} = document-url with first slash and final ".xml" removed <map:match pattern="*/*/sitetree/**.xml">
|