blob: 5c87728aba911d0e77b44683230f50808538fa24 [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$ -->
<!--
This sitemaps provides fallback message catalogues and catalogue merging.
The reason for the existence of this sitemap is mainly to avoid endless loops caused by mounts
in sitemap.xmap and global-sitemap.xmap.
-->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:resources>
<map:resource name="serializeCatalogue">
<map:select type="parameter">
<map:parameter name="parameter-selector-test" value="{page-envelope:is-publication}"/>
<map:when test="true">
<map:transform src="resources/i18n/modules2xinclude.xsl">
<map:parameter name="pubId" value="{page-envelope:publication-id}"/>
<map:parameter name="catalogue" value="{catalogue}"/>
</map:transform>
</map:when>
</map:select>
<map:transform type="xinclude"/>
<map:serialize type="xml"/>
</map:resource>
</map:resources>
<map:pipelines>
<map:pipeline type="caching">
<!-- i18n-catalogue/module/{module-id}/{catalogue}-->
<map:match pattern="i18n-catalogue/module/*/*">
<map:select type="resource-exists">
<map:when test="aggregate-fallback://lenya/modules/{1}/resources/i18n/{2}">
<map:generate src="aggregate-fallback://lenya/modules/{1}/resources/i18n/{2}"/>
</map:when>
<!-- Modules are not required to contain a catalogue. -->
<map:otherwise>
<map:generate src="resources/i18n/emptyCatalogue.xml"/>
</map:otherwise>
</map:select>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="i18n-catalogue/**">
<map:select type="resource-exists">
<map:when test="aggregate-fallback://lenya/resources/i18n/{1}">
<map:generate src="aggregate-fallback://lenya/resources/i18n/{1}"/>
<map:call resource="serializeCatalogue">
<map:parameter name="catalogue" value="{1}"/>
</map:call>
</map:when>
<!-- We don't return an empty catalogue, otherwise the fallback from "en_us" to "en" wouldn't be triggered. -->
</map:select>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>