blob: 3a021b4c708bbaa8e686396d7235a7149e6ce347 [file] [log] [blame]
<?xml version="1.0"?>
<!--
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.
-->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!-- =========================== Components ================================ -->
<map:components>
<map:generators default="file">
<map:generator
name="traverse"
src="org.apache.cocoon.generation.TraversableSourceDescriptionGenerator"
logger="generator.traverse"
label="content"
pool-max="16"
/>
<map:generator name="jx"
src="org.apache.cocoon.generation.JXTemplateGenerator"
logger="generator.jx"
label="content"
pool-max="16"
/>
</map:generators>
<map:transformers default="xslt">
<map:transformer
name="spw"
src="org.apache.cocoon.transformation.SourcePropsWritingTransformer"
logger="transformer.spw"
pool-max="16"
/>
</map:transformers>
<!-- If event caching is enabled you'll need to uncomment this in order
for PROPPATCH to work properly
<map:pipes default="caching">
<map:pipe name="event-caching"
src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"
>
<parameter name="cache-role" value="org.apache.cocoon.caching.Cache/EventAware"/>
</map:pipe>
</map:pipes>
-->
<map:matchers default="wildcard">
<map:matcher
name="destination"
src="org.apache.cocoon.matching.WildcardHeaderMatcher"
>
<header-name>Destination</header-name>
</map:matcher>
</map:matchers>
</map:components>
<!-- ========================== Flowscript ================================= -->
<map:flow language="javascript">
<map:script src="webdav.js"/>
</map:flow>
<!-- =========================== Views ===================================== -->
<map:views>
<map:view name="content" from-label="content">
<map:serialize type="xml" />
</map:view>
</map:views>
<map:pipelines>
<map:component-configurations>
<global-variables>
<staging>repository:./repo/</staging>
</global-variables>
</map:component-configurations>
<!-- ========================= Private Resources =========================== -->
<map:pipeline type="noncaching" internal-only="true">
<!-- Read the request for binaries PUT -->
<!--
<map:match pattern="request/read">
<map:read type="request" />
</map:match>
-->
<map:match pattern="request/generate">
<map:generate type="stream" />
<map:serialize type="xml" />
</map:match>
<!--+
| If you need to check or change the XML that is being PUT
| you can do that here. This is the pipeline that will
| generate the input for the PUT method.
+ -->
<map:match pattern="request/PUT">
<map:generate type="stream">
<map:parameter name="defaultContentType" value="text/xml" />
</map:generate>
<map:serialize type="xml" />
</map:match>
</map:pipeline>
<!-- ========================= Public Resources =========================== -->
<!--map:pipeline type="event-caching"-->
<map:pipeline type="caching">
<map:match pattern="repo">
<map:call function="selectMethod">
<map:parameter name="page" value=""/>
<map:parameter name="requestURI" value="{request:requestURI}" />
</map:call>
</map:match>
<map:match pattern="repo/**">
<map:call function="selectMethod">
<map:parameter name="page" value="{1}"/>
<map:parameter name="requestURI" value="{request:requestURI}" />
</map:call>
</map:match>
<map:match pattern="GET/**">
<map:match pattern="GET/**.*">
<map:generate src="{global:staging}{1}.{2}"/>
<map:serialize type="xml"/>
</map:match>
<map:generate type="traverse" src="{global:staging}{1}">
<map:parameter name="depth" value="1"/>
<map:parameter name="dateFormat" value="EEE, d MMM yyyy HH:mm:ss z" />
<map:parameter name="timeZone" value="GMT" />
<map:parameter name="properties" value="false" />
<map:parameter name="locks" value="false" />
<map:parameter name="permissions" value="false" />
<map:parameter name="version" value="false" />
</map:generate>
<map:transform src="styles/collection2html.xsl">
<map:parameter name="requestURI" value="{request:requestURI}" />
<map:parameter name="footer"
value="{cocoon-properties:fullname} {cocoon-properties:released.version}" />
</map:transform>
<map:serialize type="html"/>
</map:match>
<map:match pattern="PROPFIND/**">
<map:generate type="traverse" src="{global:staging}{1}">
<map:parameter name="depth" value="{request-header:Depth}" />
<map:parameter name="dateFormat" value="EEE, d MMM yyyy HH:mm:ss z" />
<map:parameter name="locale" value="en" />
<map:parameter name="timeZone" value="GMT" />
<map:parameter name="properties" value="false" />
<map:parameter name="locks" value="false" />
<map:parameter name="permissions" value="false" />
<map:parameter name="version" value="false" />
</map:generate>
<map:transform src="styles/collection2propfind.xsl">
<map:parameter name="requestURI" value="{flow-attribute:requestURI}"/>
</map:transform>
<map:serialize type="xml" status-code="207" />
</map:match>
<map:match pattern="OPTIONS/**">
<map:call function="options">
<map:parameter name="uri" value="{request:requestURI}" />
</map:call>
</map:match>
<map:match pattern="HEAD/**">
<map:generate src="dummy.xml"/>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="TRACE/**">
<map:generate src="dummy.xml"/>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="POST/**">
<map:generate src="dummy.xml"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
<map:pipeline type="noncaching">
<map:match pattern="PUT/**.*">
<map:call function="put">
<map:parameter name="src" value="cocoon:/request/PUT" />
<map:parameter name="dest" value="{global:staging}{1}.{2}" />
</map:call>
</map:match>
<map:match pattern="MKCOL/**">
<map:match pattern="MKCOL/**.*">
<map:call function="sendStatus">
<map:parameter name="status" value="405" />
</map:call>
</map:match>
<map:call function="mkcol">
<map:parameter name="location" value="{global:staging}{1}" />
</map:call>
</map:match>
<map:match pattern="DELETE/**">
<map:call function="remove">
<map:parameter name="location" value="{global:staging}{1}" />
</map:call>
</map:match>
<map:match pattern="COPY/**">
<map:match pattern="http://**/repo/**" type="destination">
<map:call function="copy">
<map:parameter name="from" value="{global:staging}{../1}" />
<map:parameter name="to" value="{global:staging}/{2}" />
<map:parameter name="depth" value="{request-header:Depth}" />
<map:parameter name="overwrite" value="{request-header:Overwrite}" />
</map:call>
</map:match>
<map:call function="sendStatus">
<map:parameter name="status" value="405" />
</map:call>
</map:match>
<map:match pattern="MOVE/**">
<map:match pattern="http://**/repo/**" type="destination">
<map:call function="move">
<map:parameter name="from" value="{global:staging}{../1}" />
<map:parameter name="to" value="{global:staging}/{2}" />
<map:parameter name="depth" value="{request-header:Depth}" />
<map:parameter name="overwrite" value="{request-header:Overwrite}" />
</map:call>
</map:match>
<map:call function="sendStatus">
<map:parameter name="status" value="405" />
</map:call>
</map:match>
<!--+
| In order for proppatch to work you need to uncomment
| the simple jdbc source descriptor in cocoon.xconf
| and then define which properties you want to proppatch.
+ -->
<map:match pattern="PROPPATCH/**">
<map:generate type="stream" />
<map:transform src="styles/proppatch2propwrite.xsl">
<map:parameter name="location" value="{global:staging}{1}" />
</map:transform>
<map:transform type="spw" />
<map:serialize type="xml" />
</map:match>
<map:match pattern="LOCK/**">
<map:generate src="dummy.xml"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>