blob: a0965c60da79240358427e2bcbd6fe89fa5a380c [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!-- =========================== Resources ================================= -->
<!--+
| Resources are pipeline fragments that may be used from different
| pipeline fragments. For our needs, they behave exactly like
| pipelines, only that they are not accessible from outside.
| Hence I will explain what's inside below for pipelines.
+-->
<map:resources>
<map:resource name="style-cms-page">
<map:transform type="i18n">
<map:parameter name="locale" value="{request:locale}"/>
</map:transform>
<map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl">
<map:parameter name="contextprefix" value="{request:contextPath}"/>
</map:transform>
<map:transform src="context://lenya/xslt/util/strip_namespaces.xsl"/>
</map:resource>
<map:resource name="i18n">
<map:transform type="i18n">
<map:parameter name="locale" value="{request:locale}"/>
</map:transform>
</map:resource>
</map:resources>
<!-- =========================== Pipelines ================================= -->
<!--+
| Pipelines. The beef. Pipelines specify how the processing of your
| content is done. Usually, a pipeline consists of several fragments
| that specify the generation, transformation, and serialization of
| SAX events.
|
| Processing is done in two steps:
|
| 1) The top level elements are executed in order of appearance until
| one signals success. These top level elements are usually
| matchers.
|
| Other components are called depth-first to determine what
| fragments make up the processing pipeline. When a component
| fails, no nested components are called but the next component on
| the same level.
|
| 2) Once it is determined which generator, which transformers and
| wich serializer is used, these components are executed. During
| this, the pipeline may not be changed.
|
| You may have as many pipelines in your sitemap as you like.
+-->
<map:pipelines>
<map:component-configurations>
<global-variables>
<!--+
| Define global parameters here:
| <skin>my_skin</skin>
| ...
| You can access them by {global:*name*}, e.g. {global:skin}.
| These values are inherited into sub-sitemaps and can
| be extended there.
+-->
</global-variables>
</map:component-configurations>
<!-- =========================== Pipelines ================================= -->
<map:pipeline>
<map:match pattern="aggregate-publications">
<map:generate type="directory" src="lenya/pubs"/>
<map:transform src="lenya/xslt/util/aggregate-publications.xsl"/>
<map:transform type="xinclude"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
<!-- ajax -->
<map:pipeline>
<map:match pattern="cforms/ajax/**">
<map:read src="resource://org/apache/cocoon/ajax/resources/{1}"/>
</map:match>
</map:pipeline>
<!-- dojo -->
<map:pipeline>
<map:match pattern="cforms/dojo/**">
<map:read src="resource://org/apache/cocoon/dojo/resources/{1}"/>
</map:match>
</map:pipeline>
<!-- cforms -->
<map:pipeline>
<map:match pattern="cforms/forms/**">
<map:read src="resource://org/apache/cocoon/forms/resources/{1}"/>
</map:match>
</map:pipeline>
<map:pipeline>
<!-- Lenya GUI -->
<map:match pattern="lenya/**">
<map:mount uri-prefix="lenya" src="lenya/lenya.xmap" check-reload="true" reload-method="synchron"/>
</map:match>
<!-- Lenya page transformation for adding a Lenya menu -->
<!-- lenya-page/{publication-id}/{area}/... -->
<map:match pattern="lenya-page/*/*/**">
<!-- no menu for revisions -->
<map:match type="request-parameter" pattern="lenya.revision">
<map:generate src="lenya/xslt/util/identity.xsl"/>
<map:serialize type="xml"/>
</map:match>
<map:aggregate element="menu" ns="http://apache.org/cocoon/lenya/menubar/1.0">
<map:part src="cocoon:/menu-xml/{1}/{2}/{3}" strip-root="true"/>
<map:part src="cocoon:/menu-xml/modules/{1}/{2}.xml" strip-root="true"/>
</map:aggregate>
<map:transform src="lenya/xslt/menu/merge-menus.xsl"/>
<map:transform src="lenya/xslt/menu/filter-menu.xsl">
<map:parameter name="tabGroup" value="{usecase:tabGroup:{request-param:lenya.usecase}}"/>
</map:transform>
<!-- Disable menu items according to usecase policies -->
<map:transform type="usecasemenu"/>
<map:select type="request-parameter">
<map:parameter name="parameter-name" value="uiml"/>
<map:when test="xul">
<map:transform src="fallback://lenya/xslt/menu/menu2xul.xsl">
<map:parameter name="contextprefix" value="{request:contextPath}"/>
<map:parameter name="publicationid" value="{1}"/>
<map:parameter name="area" value="{2}"/>
<map:parameter name="documenturl" value="{page-envelope:document-url}"/>
<map:parameter name="documentid" value="{page-envelope:document-id}"/>
<map:parameter name="userid" value="{access-control:user-id}"/>
<map:parameter name="servertime" value="{date-i18n:currentDate}"/>
<map:parameter name="workflowstate" value="{workflow:state}"/>
<map:parameter name="islive" value="{workflow:variable.is_live}"/>
<map:parameter name="usecase" value="{request-param:lenya.usecase}"/>
<map:parameter name="tabGroup" value="{usecase:tabGroup:{request-param:lenya.usecase}}"/>
<map:parameter name="newMessages" value="{inbox:newMessageCount}"/>
</map:transform>
</map:when>
<map:otherwise>
<map:transform src="fallback://lenya/xslt/menu/menu2xhtml.xsl">
<map:parameter name="contextprefix" value="{request:contextPath}"/>
<map:parameter name="publicationid" value="{1}"/>
<map:parameter name="area" value="{2}"/>
<map:parameter name="documenturl" value="{page-envelope:document-url}"/>
<map:parameter name="documentid" value="{page-envelope:document-id}"/>
<map:parameter name="userid" value="{access-control:user-id}"/>
<map:parameter name="servertime" value="{date-i18n:currentDate}"/>
<map:parameter name="workflowstate" value="{workflow:state}"/>
<map:parameter name="islive" value="{workflow:variable.is_live}"/>
<map:parameter name="usecase" value="{request-param:lenya.usecase}"/>
<map:parameter name="tabGroup" value="{usecase:tabGroup:{request-param:lenya.usecase}}"/>
<map:parameter name="newMessages" value="{inbox:newMessageCount}"/>
</map:transform>
</map:otherwise>
</map:select>
<map:call resource="i18n"/>
<!-- Generate the meta-stylesheet -->
<map:select type="request-parameter">
<map:parameter name="parameter-name" value="uiml"/>
<map:when test="xul">
<map:transform src="fallback://lenya/xslt/menu/menu2xsltwithxul.xsl">
<map:parameter name="contextprefix" value="{request:contextPath}"/>
<map:parameter name="publicationid" value="{1}"/>
<map:parameter name="area" value="{2}"/>
<map:parameter name="documenturl" value="{page-envelope:document-url}"/>
</map:transform>
</map:when>
<map:otherwise>
<map:transform src="fallback://lenya/xslt/menu/menu2xslt.xsl">
<map:parameter name="contextprefix" value="{request:contextPath}"/>
<map:parameter name="publicationid" value="{1}"/>
<map:parameter name="area" value="{2}"/>
<map:parameter name="documenturl" value="{page-envelope:document-url}"/>
</map:transform>
</map:otherwise>
</map:select>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
<!-- menus -->
<map:pipeline type="profile-noncaching">
<!-- menu-xml/modules -->
<!-- menu-xml/modules/{pub-id}/{area}.xml -->
<map:match pattern="menu-xml/modules/*/*.xml">
<map:generate src="aggregate-fallback://config/publication.xconf"/>
<map:transform src="lenya/xslt/modules/modules2xinclude.xsl">
<map:parameter name="area" value="{2}"/>
</map:transform>
<map:transform type="xinclude"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
<map:pipeline>
<!-- menu-xml/module/{area}/{module-id}.xml -->
<map:match pattern="menu-xml/module/*/*.xml">
<map:select type="resource-exists">
<map:when test="fallback://lenya/modules/{2}/menus.xmap">
<map:mount uri-prefix="menu-xml/module/{1}/" src="fallback://lenya/modules/{2}/menus.xmap" check-reload="true" reload-method="synchron"/>
</map:when>
<map:otherwise>
<map:generate type="serverpages" src="lenya/content/menus/live.xsp"/>
<map:serialize type="xml"/>
</map:otherwise>
</map:select>
</map:match>
<!-- menu-xml/{publication-id}/admin/... -->
<map:match pattern="menu-xml/*/admin/**" internal-only="true">
<map:generate type="serverpages" src="lenya/content/menus/admin.xsp"/>
<map:serialize type="xml"/>
</map:match>
<!-- menu-xml/{publication-id}/... -->
<map:match pattern="menu-xml/*/**" internal-only="true">
<map:mount uri-prefix="menu-xml/{1}/" src="{fallback:menus.xmap}" check-reload="true" reload-method="synchron"/>
</map:match>
<!-- Access Control Policies -->
<map:match pattern="*/policies/**">
<map:mount uri-prefix="{1}/policies" src="lenya/pubs/{1}/policies-sitemap.xmap" check-reload="true" reload-method="synchron"/>
</map:match>
</map:pipeline>
<map:pipeline>
<!-- Module requests -->
<map:match pattern="modules/*/**">
<map:select type="resource-exists">
<!-- resource exists - serve statically -->
<map:when test="fallback://lenya/modules/{1}/resources/{2}">
<map:mount uri-prefix="modules/" src="fallback://lenya/module-resources.xmap" check-reload="true" reload-method="synchron" pass-through="true"/>
</map:when>
</map:select>
<!-- resource doesn't exist or not handled by lenya/module-resources.xmap - delegate to module -->
<map:mount uri-prefix="modules/{1}/" src="fallback://lenya/modules/{1}/sitemap.xmap" check-reload="true" reload-method="synchron"/>
</map:match>
<!-- Publication specific Module requests -->
<!-- {publication-id}/modules/{module-id}/... -->
<map:match pattern="*/modules/*/**">
<map:select type="resource-exists">
<!-- resource exists - serve statically -->
<map:when test="fallback://lenya/modules/{2}/resources/{3}">
<map:mount uri-prefix="{1}/modules/" src="fallback://lenya/module-resources.xmap" check-reload="true" reload-method="synchron" pass-through="true"/>
</map:when>
</map:select>
<!-- resource doesn't exist or not handled by lenya/module-resources.xmap - delegate to module -->
<map:mount uri-prefix="{1}/modules/{2}/" src="fallback://lenya/modules/{2}/sitemap.xmap" check-reload="true" reload-method="synchron"/>
</map:match>
</map:pipeline>
<!-- Internal usecases -->
<map:pipeline internal-only="true">
<map:match pattern="*/**">
<map:mount uri-prefix="{1}" src="lenya/pubs/{1}/sitemap.xmap" check-reload="true" reload-method="synchron"/>
</map:match>
</map:pipeline>
<map:pipeline>
<!-- Usecases -->
<map:match type="usecase" pattern="*">
<map:mount uri-prefix="" src="lenya/usecase.xmap" check-reload="true" reload-method="synchron"/>
</map:match>
</map:pipeline>
<map:pipeline>
<map:match pattern="index.html">
<map:aggregate element="aggregation-wrapper" label="aggregate">
<map:part src="cocoon:/aggregate-publications"/>
<map:part src="lenya/content/welcome.xml"/>
<map:part src="readme.xml"/>
</map:aggregate>
<map:transform src="lenya/xslt/util/welcome.xsl"/>
<map:call resource="style-cms-page"/>
<map:serialize />
</map:match>
<map:match pattern="about.html">
<map:generate src="lenya/content/about.xml"/>
<map:call resource="style-cms-page"/>
<map:serialize />
</map:match>
<map:match pattern="*">
<map:redirect-to uri="index.html"/>
</map:match>
<!-- Publications -->
<map:match pattern="*">
<map:select type="request-method">
<map:when test="PROPFIND">
<map:generate type="file" src="context://lenya/content/util/empty.xml"/>
<map:transform src="fallback://lenya/modules/webdav/xslt/init.xsl">
<map:parameter name="pubid" value="{page-envelope:publication-id}"/>
<map:parameter name="context" value="{request:contextPath}"/>
</map:transform>
<map:serialize type="xml" status-code="207"/>
</map:when>
<map:when test="OPTIONS">
<map:mount uri-prefix="" src="{fallback://lenya/modules/webdav/sitemap.xmap}" check-reload="true" reload-method="synchron"/>
</map:when>
</map:select>
</map:match>
<map:match pattern="{page-envelope:publication-id}/">
<map:select type="request-method">
<map:when test="PROPFIND">
<map:generate type="file" src="context://lenya/content/util/empty.xml"/>
<map:transform src="fallback://lenya/modules/webdav/xslt/init.xsl">
<map:parameter name="pubid" value="{page-envelope:publication-id}"/>
<map:parameter name="context" value="{request:contextPath}"/>
</map:transform>
<map:serialize type="xml" status-code="207"/>
</map:when>
<map:when test="OPTIONS">
<map:mount uri-prefix="" src="{fallback://lenya/modules/webdav/sitemap.xmap}" check-reload="true" reload-method="synchron"/>
</map:when>
</map:select>
</map:match>
<map:match pattern="*/">
<map:redirect-to uri="introduction.html"/>
</map:match>
<map:match pattern="*/index.html">
<map:redirect-to uri="introduction.html"/>
</map:match>
<!-- About Publication -->
<map:match pattern="*/introduction.html">
<map:aggregate element="aggregation-wrapper">
<map:part src="aggregate-fallback://readme.xml"/>
<map:part src="lenya/pubs/{1}/config/publication.xconf"/>
</map:aggregate>
<map:transform src="lenya/xslt/util/introduction.xsl"/>
<map:call resource="style-cms-page"/>
<map:serialize />
</map:match>
<!-- Enter a module -->
<map:match type="request-parameter" pattern="lenya.module">
<map:mount uri-prefix="" src="fallback://lenya/modules/{1}/sitemap.xmap" check-reload="true" reload-method="synchron"/>
</map:match>
<!-- Resources -->
<!-- {publication-id}/{area}/{file} -->
<map:match pattern="*/*/**">
<map:act type="resource-exists-enhanced">
<map:parameter name="url" value="fallback://resources/{2}/{3}"/>
<map:parameter name="type" value="file"/>
<map:mount uri-prefix="" src="{fallback://lenya/resources.xmap}" check-reload="true" reload-method="synchron"/>
</map:act>
<map:act type="resource-exists-enhanced">
<map:parameter name="url" value="fallback://resources/shared/{3}"/>
<map:parameter name="type" value="file"/>
<map:mount uri-prefix="" src="{fallback://lenya/resources-shared.xmap}" check-reload="true" reload-method="synchron"/>
</map:act>
<!-- Ancestors resources, css, js, etc... -->
<!-- {publication-id}/{area}/{filename}.inherited.{extention} -->
<map:match pattern="*/*/**.inherited.*">
<map:act type="resource-exists-enhanced">
<map:parameter name="url" value="template-fallback://resources/shared/{3}.{4}"/>
<map:parameter name="type" value="file"/>
<map:mount uri-prefix="" src="{fallback://lenya/resources-shared.xmap}" check-reload="true" reload-method="synchron"/>
</map:act>
</map:match>
</map:match>
<!-- Enter the actual publication -->
<map:match pattern="*/**">
<map:mount uri-prefix="{1}" src="{fallback:sitemap.xmap}" check-reload="true" reload-method="synchron"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>