| <?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"> |
| |
| <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:transform type="proxy"/> |
| <map:transform src="context://lenya/xslt/util/strip_namespaces.xsl"/> |
| <map:transform src="fallback://lenya/modules/prettyprinting/xslt/xml2nicexml.xsl"/> |
| </map:resource> |
| |
| <map:resource name="i18n"> |
| <map:transform type="i18n"> |
| <map:parameter name="locale" value="{request:locale}"/> |
| </map:transform> |
| </map:resource> |
| |
| <!-- do proxy transformation on css files for url('') links --> |
| <map:resource name="proxy-css"> |
| <map:act type="resource-exists" |
| src="{url}.xml"> |
| <map:generate src="{../url}.xml"/> |
| <map:transform src="fallback://lenya/resources/css/css.xsl"> |
| <map:parameter name="root" value="/{page-envelope:publication-id}/{page-envelope:area}"/> |
| </map:transform> |
| <map:call resource="prepare-proxy-css"/> |
| </map:act> |
| <map:generate type="text" src="{url}.css"/> |
| <map:call resource="prepare-proxy-css"/> |
| </map:resource> |
| |
| <!-- |
| chaperon magic: parse css files, convert url('') links into xml snippets, feed them |
| to the standard proxy transformer, then convert the intermediate xml back to valid css. |
| --> |
| <map:resource name="prepare-proxy-css"> |
| <map:transform type="pattern" |
| src="fallback://lenya/chaperon/grammars/link.xlex"/> |
| <map:transform |
| src="fallback://lenya/chaperon/stylesheets/pattern-to-link.xsl"/> |
| <map:transform type="proxy"/> |
| <map:transform |
| src="fallback://lenya/chaperon/stylesheets/a-to-txt.xsl"/> |
| <map:serialize type="text" mime-type="text/css"/> |
| </map:resource> |
| |
| </map:resources> |
| |
| |
| |
| <map:pipelines> |
| |
| <map:component-configurations> |
| <global-variables> |
| <!-- |
| pipeline expiration time (governs the setting of "expires" headers for browser-side |
| caching), see http://cocoon.apache.org/2.1/userdocs/concepts/caching.html |
| --> |
| <pipeline-expiration>now</pipeline-expiration> |
| </global-variables> |
| </map:component-configurations> |
| |
| <!-- create a list of publications for the global welcome page: --> |
| <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> |
| |
| <!-- FIXME: this should go into a cforms support module --> |
| |
| <map:pipeline> |
| <map:match pattern="cforms/ajax/**"> |
| <map:read src="resource://org/apache/cocoon/ajax/resources/{1}"/> |
| </map:match> |
| </map:pipeline> |
| <map:pipeline> |
| <map:match pattern="cforms/dojo/**"> |
| <map:read src="resource://org/apache/cocoon/dojo/resources/{1}"/> |
| </map:match> |
| </map:pipeline> |
| <map:pipeline> |
| <map:match pattern="cforms/forms/**"> |
| <map:read src="resource://org/apache/cocoon/forms/resources/{1}"/> |
| </map:match> |
| </map:pipeline> |
| |
| |
| <map:pipeline> |
| <!-- serve "lenya/" resources (GUI and utilities) --> |
| <map:match pattern="lenya/**"> |
| <map:mount uri-prefix="lenya" src="lenya/lenya.xmap" check-reload="true" reload-method="synchron" pass-through="true"/> |
| </map:match> |
| </map:pipeline> |
| |
| <!-- Menu generation: --> |
| <map:pipeline internal-only="true"> |
| |
| <!-- Generate a meta-stylesheet that adds the Lenya GUI menu to pages --> |
| <!-- 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> |
| <!-- for everything else: --> |
| <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:transform src="fallback://lenya/xslt/menu/menubar2xhtml.xsl"> |
| <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-uuid}"/> |
| <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:call resource="i18n"/> |
| <!-- Generate the meta-stylesheet --> |
| <map:transform src="fallback://lenya/xslt/menu/menu2xslt.xsl"> |
| <map:parameter name="publicationid" value="{1}"/> |
| <map:parameter name="area" value="{2}"/> |
| <map:parameter name="documenturl" value="{page-envelope:document-url}"/> |
| </map:transform> |
| <map:serialize type="xml"/> |
| </map:match> |
| |
| |
| <!-- collect the menu items for all modules used in the publication --> |
| <!-- menu-xml/modules/{pub-id}/{area}.xml --> |
| <map:match pattern="menu-xml/modules/*/*.xml"> |
| <map:generate src="aggregate-fallback://config/publication.xml"/> |
| <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> |
| |
| <!-- query menu items from modules (used by the xinclude above) --> |
| <!-- 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" pass-through="true"/> |
| </map:when> |
| <map:otherwise> |
| <map:generate type="serverpages" src="lenya/content/menus/live.xsp"/> |
| <map:serialize type="xml"/> |
| </map:otherwise> |
| </map:select> |
| </map:match> |
| |
| <!-- global admin menu items --> |
| <!-- FIXME: this is actually independent from the publication-id! --> |
| <!-- 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> |
| |
| <!-- include publication-specific menus --> |
| <!-- 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" pass-through="true"/> |
| </map:match> |
| |
| <!-- FIXME: this is currently unused --> |
| <!-- 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" pass-through="true"/> |
| </map:match> |
| --> |
| </map:pipeline> |
| |
| |
| <!-- Module requests --> |
| |
| <!-- an extra handler for internal module requests to avoid the resource-exists check |
| in the external requests matcher |
| FIXME: is the overhead reduction worth the extra complication? |
| FIXME: doesn't this mean that internal requests aren't served statically (see below) and |
| resources might not even be available to internal requests if the module sitemap doesn't |
| handle them? |
| --> |
| <map:pipeline internal-only="true"> |
| <map:match pattern="modules/*/**"> |
| <map:mount uri-prefix="modules/{1}/" src="fallback://lenya/modules/{1}/sitemap.xmap" check-reload="true" reload-method="synchron"/> |
| </map:match> |
| <map:match pattern="*/modules/*/**"> |
| <map:mount uri-prefix="{1}/modules/{2}/" src="fallback://lenya/modules/{2}/sitemap.xmap" check-reload="true" reload-method="synchron"/> |
| </map:match> |
| </map:pipeline> |
| |
| |
| <map:pipeline> |
| |
| <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 --> |
| <!-- NOTE: the use of publication-specific modules is discouraged, since all modules are actually in one global scope.. --> |
| <!-- {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 --> |
| <!-- |
| We match internal requests to the publication sitemap early to avoid the |
| time-consuming resource-exists operations in the subsequent pipelines |
| before the final publication matcher is reached. |
| --> |
| <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> |
| |
| <!-- enter a module via request parameter --> |
| <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> |
| |
| <!-- delegate usecases to the usecase sitemap --> |
| <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> |
| |
| <!-- the Lenya welcome page with a list of available publications --> |
| <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> |
| |
| <!-- any root-level request is directed to the welcome page --> |
| <map:match pattern="*"> |
| <map:redirect-to uri="{proxy:/index.html}"/> |
| </map:match> |
| |
| <!-- FIXME: this is apparently WebDAV-related. Does it have to be here, and what does it do? --> |
| <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> |
| |
| <!-- redirect publication root requests to the publication's welcome page --> |
| <map:match pattern="*/"> |
| <map:redirect-to uri="{proxy:/introduction.html}"/> |
| </map:match> |
| <map:match pattern="*/index.html"> |
| <map:redirect-to uri="{proxy:/introduction.html}"/> |
| </map:match> |
| |
| <!-- generate welcome pages for each publication with an aggregation of relevant READMEs --> |
| <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.xml"/> |
| </map:aggregate> |
| <map:transform src="lenya/xslt/util/introduction.xsl"/> |
| <map:call resource="style-cms-page"/> |
| <map:serialize /> |
| </map:match> |
| |
| </map:pipeline> |
| |
| <!-- an extra handler for internal publication requests to avoid the resource-exists check |
| in the external requests matcher --> |
| <!-- FIXME: see comments for internal module request matcher above. --> |
| <map:pipeline internal-only="true"> |
| <map:match pattern="*/**"> |
| <map:mount uri-prefix="{1}" src="{fallback:sitemap.xmap}" check-reload="true" reload-method="synchron"/> |
| </map:match> |
| </map:pipeline> |
| |
| <map:pipeline> |
| |
| <!-- Resources --> |
| <!-- FIXME: doesn't this create a hefty overhead for all publication documents? --> |
| <!-- {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> |
| <!-- FIXME: please document the "shared" resources concept. Or maybe we can ditch it? --> |
| <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} --> |
| <!-- FIXME: what is this mechanism used for? please document or provide a pointer to existing docs --> |
| <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> |
| |
| <!-- delegate publication requests to the publication sitemap --> |
| <map:match pattern="*/**"> |
| <map:select type="parameter"> |
| <map:parameter name="parameter-selector-test" value="{page-envelope:publication-id}"/> |
| <map:when test=""> |
| <map:generate type="jx" src="lenya/content/exception/publication-does-not-exist.jx"> |
| <map:parameter name="publicationId" value="{1}"/> |
| </map:generate> |
| <map:transform type="i18n"> |
| <map:parameter name="locale" value="{request:locale}"></map:parameter> |
| </map:transform> |
| <map:call resource="style-cms-page"/> |
| <map:serialize status-code="404" /> |
| </map:when> |
| <map:otherwise> |
| <map:mount uri-prefix="{1}" src="{fallback:sitemap.xmap}" check-reload="true" reload-method="synchron"/> |
| </map:otherwise> |
| </map:select> |
| </map:match> |
| </map:pipeline> |
| |
| </map:pipelines> |
| |
| </map:sitemap> |