<?xml version="1.0"?>
<!--
  Copyright 1999-2004 The Apache Software Foundation

  Licensed 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.
-->

<!-- sitemap for yapt - Yet Another Presentation Tool -->

<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!-- =========================== Views =================================== -->

<map:views>
	<map:view from-position="last" name="links">
		<map:serialize type="links"/>
	</map:view>

   <map:view from-label="raw-content" name="raw-content">
		<map:serialize type="xml"/>
	</map:view>
	<map:view from-label="phase2" name="phase2">
		<map:serialize type="xml"/>
	</map:view>
	<map:view from-label="yapt-content" name="yapt-content">
		<map:serialize type="xml"/>
	</map:view>

</map:views>

    <map:pipelines>

        <map:pipeline type="noncaching">

			<!-- CSS stylesheets, from common directory -->
			<map:match pattern="**/*.css">
				<map:read src="css/{2}.css" mime-type="text/css"/>
			</map:match>

			<!-- images, from slides directory -->
			<map:match pattern="presentations/**/*.jpg">
				<map:read src="presentations/{1}/{2}.jpg" mime-type="image/jpeg"/>
			</map:match>
			<map:match pattern="presentations/**/*.png">
				<map:read src="presentations/{1}/{2}.png" mime-type="image/png"/>
			</map:match>
			<map:match pattern="presentations/**/*.gif">
				<map:read src="presentations/{1}/{2}.gif" mime-type="image/gif"/>
			</map:match>
			<map:match pattern="presentations/**/html/*.wav">
				<map:read src="presentations/{2}.wav" mime-type="audio/x-wav"/>
			</map:match>
			<map:match pattern="presentations/**/html/*.mp3">
				<map:read src="presentations/{2}.mp3" mime-type="audio/mpeg"/>
			</map:match>


            <!-- index of available presentations -->
            <map:match pattern="index.html">
                <map:generate label="raw-content" type="directory" src="presentations"/>
                <map:transform src="stylesheets/dir-to-html.xsl">
                    <map:parameter name="baseDir" value="presentations"/>
                </map:transform>
                <map:serialize type="html"/>
            </map:match>

            <!-- Raw ASCII data of a complete presentation -->
            <map:match pattern="presentations/**/txt/presentation.html">
                <map:read src="presentations/{1}.txt" mime-type="text/plain"/>
            </map:match>

            <!-- XML data of a complete presentation -->
            <map:match pattern="presentations/**/xml/presentation.html">
                <map:generate label="raw-content" type="slop" src="presentations/{1}.txt">
                    <map:parameter name="encoding" value="iso-8859-1"/>
                    <map:parameter name="preserve-space" value="true"/>
                </map:generate>
                <map:transform src="stylesheets/filter-slop-output.xsl"/>
                <map:serialize type="xml"/>
            </map:match>

            <!-- XML data of a single slide -->
            <map:match pattern="presentations/**/xml/slide-*.html">
                <map:generate src="cocoon:/presentations/{1}/xml/presentation.html"/>
                <map:transform src="stylesheets/select-slide.xsl">
                    <map:parameter name="slideId" value="{2}"/>
                </map:transform>
                <map:serialize type="xml"/>
            </map:match>

            <!-- index (list of slides) of a presentation -->
            <map:match pattern="presentations/**/html/index.html">
                <map:generate src="cocoon:/presentations/{1}/xml/presentation.html"/>
                <map:transform src="stylesheets/html-index.xsl"/>
                <map:serialize type="html"/>
            </map:match>

            <!-- single slide or full presentation in HTML -->
            <map:match pattern="presentations/**/html/*.html">
                <map:generate src="cocoon:/presentations/{1}/xml/{2}.html"/>
                <map:transform src="stylesheets/html-slides.xsl"/>
                <map:serialize type="html"/>
            </map:match>

        </map:pipeline>

    </map:pipelines>

</map:sitemap>
