Solprovider Lenya Kongregate Registration for Free Flash Games and Chat with solprovider

Usecase Sitemaps

"Usecases" are special Sitemaps used for modular XMAP functionality. Most functions of any websites should be handled with Usecases. They are easy to maintain, since the pipelines are mostly contained in their own files, which makes them easy to copy to other publications. They are called by adding "lenya.usecase={usecaseName}" to the parameters of any URL.


The Lenya process truly starts with:
- build\lenya\webapp\sitemap.xmap. It checks for the login and logout usecases (making any override a server-wide change), then passes control to:
- build\lenya\webapp\global-sitemap.xmap. It checks for internal pipelines like navigation. It also checks for a usecase. If one is found, control is passed to:
- build\lenya\webapp\lenya\usecase.xmap. It decides if there is a publication or global usecase. Publication usecases are passed to:
- {pub}\usecase-{usecaseName}.xmap.

The importance is this is a method to easily interrupt the normal processing.

Also, the original URL is intact. Login can return to the page failing access. The Contact Us page can include which page incited the comment. The Website Map knows what page called it for "You are here".


Create a file named:

A very simple file is used by the Website Map:
<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:map="">
<map:match pattern="**">
<map:generate src="cocoon://{page-envelope:publication-id}/
<map:transform src="../../xslt/util/strip_namespaces.xsl"/>
<map:serialize type="html"/>

Every XMAP file should have the sitemap\pipelines\pipeline\match XML structure. This example has only one match. It calls a pipeline in publication-sitemap.xmap, but sets the doctype to "map" so a different XSLT (page2xhtml-map.xsl) is used.

Usecase MATCHes

Lenya provides easy matching on certain URL parameters. If a parameter name starts with "lenya." (with period), then it is available as a match Type. Example: index.html?lenya.usecase=xsl&lenya.xsl=mystyle
Usecase and XSL can be matched using:
<map:match type="usecase" pattern="xsl">
<map:match type="xsl" pattern="mystyle">

Type="usecase" is useless in Usecase XMAPs because all pages requested must match in a sitemap. It is mostly useless in the publication-sitemap.xmap because the process would be routed to the Usecase XMAP if the setting exists. That match is only useful in XMAPs mounted from another XMAP.

It is also dangerous to use in Usecase XMAPs because every pipe will match it:
<map:match type="usecase" pattern="xsl">
<map:call function="main"/>
<map:match pattern="flow-pipe-from-javascript">

<map:generate src="flow/template.xml"/>
<map:transform src="resources/forms-samples-styling.xsl"/>
<map:serialize type="html" />
The first match passes control to JavaScript. The JavaScript tries to call the second match, but is caught by the first match which calls the JavaScript again: INFINITE LOOP! OUT OF MEMORY ERROR!
It is better to use:
<map:match pattern="**.html">
because it will only match the entry URL.

<< BreakpointsLenya Process >>

Contact Solprovider
Paul Ercolino