<?xml version="1.0" encoding="UTF-8"?>
<!--+
    | This is the 'heart' of Cocoon. The sitemap maps URI space to 
    | resources. It consists basicaly of two parts: components and
    | pipelines. Pipelines are made out of components. There is such a
    | vast number of components available that it would be impossible to
    | describe them here, please refer to the accompanying
    | documentation. For specific components, have a look also at the
    | javadocs for them. Most pipelines are present to demonstrate some
    | feature or technique, often they are explained in more detail in 
    | the accompanying documentation.
    |
    | CVS $Id: sitemap.xmap 3767 2006-06-30 21:34:08Z wolfgang_m $
    +-->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">

<!-- =========================== Components ================================ -->

    <map:components>

  <!--+
      | All pipelines consist at least of two components: a generator, that
      | produces the content, and a serialiser, that delivers the content to
      | the client.
      | 
      | More precisely: a generator generates SAX events and a serializer
      | consumes these events and produces a byte stream.
      | 
      | Some things to note here: each generator has a unique name, this
      | name is mapped to a java class, one name is declared as the default
      | generator. Each generator may have additional configurations as
      | child elements.
      | 
      | Additional attributes are targeted at the component manager. The optional
      | "label" attribute is relevant for the view concept below. The optional
      | "logger" attribute defines the logging category where messages produced
      | by a component should go. If there's no "logger" attribute, the category
      | used is the one defined for the "sitemap" component in cocoon.xconf.
      | 
      | We have chosen in this sitemap to use a different logging category
      | for each component, which allows fine-grained classification of log
      | messages. But you are free to use any category you want.
      | 
      | It is possible to have the same java class declared as different
      | generators by using different names. No configuration options are
      | shared between these instances, however.
      | 
      | All components follow this scheme.
      +-->
  <map:generators default="file">
    <map:generator label="content" logger="sitemap.generator.file" name="file" pool-grow="4" pool-max="32" pool-min="8" src="org.apache.cocoon.generation.FileGenerator"/>
    <map:generator label="content" logger="sitemap.generator.directory" name="directory" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.generation.DirectoryGenerator"/>
    <map:generator label="content" logger="sitemap.generator.xpathdirectory" name="xpathdirectory" src="org.apache.cocoon.generation.XPathDirectoryGenerator"/>
    <map:generator label="content" logger="sitemap.generator.imagedirectory" name="imagedirectory" src="org.apache.cocoon.generation.ImageDirectoryGenerator"/>
    <map:generator label="content" logger="sitemap.generator.mp3directory" name="mp3directory" src="org.apache.cocoon.generation.MP3DirectoryGenerator"/>
    <map:generator label="content" logger="sitemap.generator.request" name="request" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.generation.RequestGenerator"/>
    <map:generator label="content" logger="sitemap.generator.stream" name="stream" pool-grow="2" pool-max="16" pool-min="1" src="org.apache.cocoon.generation.StreamGenerator"/>
    <map:generator label="content" logger="sitemap.generator.status" name="status" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.generation.StatusGenerator"/>
    <map:generator label="content" logger="sitemap.generator.jx" name="jx" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.generation.JXTemplateGenerator"/>
    <!-- The notifying generator can only be used in a <handle-errors> section : it produces an XML
         representation of the exception that caused the error handler to be executed -->
    <map:generator name="notifying" src="org.apache.cocoon.sitemap.NotifyingGenerator"/>
  
    <map:generator label="content" logger="sitemap.generator.serverpages" name="serverpages" pool-grow="2" pool-max="32" pool-min="4" src="org.apache.cocoon.generation.ServerPagesGenerator"/>
    
	<!--#######################################################-->
    <!-- Status generator for eXist                            -->
    <!--#######################################################-->
    <map:generator label="content,data" name="exist-status" src="org.exist.cocoon.StatusGenerator"/>

      <!--#######################################################-->
      <!-- Cluster topology generator for eXist                            -->
      <!--#######################################################-->
      <map:generator label="content,data" name="exist-cluster" src="org.exist.cluster.cocoon.ClusterGenerator"/>

      <map:generator label="content,data" name="cluster-info" src="org.exist.cluster.cocoon.ClusterInfoGenerator"/>
      
      <map:generator name="xquery" 
        logger="sitemap.generator.xquery"
		src="org.exist.cocoon.XQueryGenerator">
    </map:generator>
</map:generators>

  <!--+
      | Transformers can be placed inside the pipeline between the generator
      | and the serializer. You may have as many transformers as you
      | like. Transformers consume SAX events and emit SAX events.
      |
      | The "xslt" transformer is an example of a component with additional
      | configuration.
      +-->
  <map:transformers default="xslt">

    <!-- NOTE: This is the default XSLT processor. -->
    <map:transformer logger="sitemap.transformer.xslt" name="xslt" pool-grow="2" pool-max="32" pool-min="8" src="org.apache.cocoon.transformation.TraxTransformer">
      <use-request-parameters>false</use-request-parameters>
      <use-session-parameters>false</use-session-parameters>
      <use-cookie-parameters>false</use-cookie-parameters>
      <xslt-processor-role>xalan</xslt-processor-role>
      <check-includes>true</check-includes>
    </map:transformer>

    <!-- NOTE: This is the same as the default processor but with a different name (for compatibility) -->
    <map:transformer logger="sitemap.transformer.xalan" name="xalan" pool-grow="2" pool-max="32" pool-min="8" src="org.apache.cocoon.transformation.TraxTransformer">
      <use-request-parameters>false</use-request-parameters>
      <use-session-parameters>false</use-session-parameters>
      <use-cookie-parameters>false</use-cookie-parameters>
      <xslt-processor-role>xalan</xslt-processor-role>
      <check-includes>true</check-includes>
    </map:transformer>

    <!-- NOTE: You can also try XSLTC as the default processor. If you use Xalan extensions, use the "xalan" transformer. -->
    <map:transformer logger="sitemap.transformer.xsltc" name="xsltc" pool-grow="2" pool-max="32" pool-min="8" src="org.apache.cocoon.transformation.TraxTransformer">
      <use-request-parameters>false</use-request-parameters>
      <use-session-parameters>false</use-session-parameters>
      <use-cookie-parameters>false</use-cookie-parameters>
      <xslt-processor-role>xsltc</xslt-processor-role>
      <check-includes>true</check-includes>
    </map:transformer>

    <map:transformer logger="sitemap.transformer.xinclude" name="xinclude" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.transformation.XIncludeTransformer"/>
    <map:transformer logger="sitemap.transformer.cinclude" name="cinclude" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.transformation.CIncludeTransformer"/>
    <map:transformer logger="sitemap.transformer.encodeURL" name="encodeURL" src="org.apache.cocoon.transformation.EncodeURLTransformer"/>
    <map:transformer logger="sitemap.transformer.write-source" name="write-source" src="org.apache.cocoon.transformation.SourceWritingTransformer"/>
    <map:transformer logger="sitemap.transformer.jpath" name="jpath" src="org.apache.cocoon.transformation.JPathTransformer"/>
    <map:transformer logger="sitemap.transformer.filter" name="filter" src="org.apache.cocoon.transformation.FilterTransformer"/>
    <map:transformer logger="sitemap.transformer.writeDOMsession" name="writeDOMsession" src="org.apache.cocoon.transformation.WriteDOMSessionTransformer"/>
    <map:transformer logger="sitemap.transformer.readDOMsession" name="readDOMsession" src="org.apache.cocoon.transformation.ReadDOMSessionTransformer"/>
    <map:transformer logger="sitemap.transformer.log" name="log" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.transformation.LogTransformer"/>
    <map:transformer logger="sitemap.transformer.jx" name="jx" pool-grow="2" pool-max="16" pool-min="2" src="org.apache.cocoon.transformation.JXTemplateTransformer"/>
    <map:transformer logger="sitemap.transformer.paginate" name="paginate" src="org.apache.cocoon.transformation.pagination.Paginator"/>
  

   <map:transformer logger="sitemap.transformer.sql" name="sql" src="org.apache.cocoon.transformation.SQLTransformer"/>



    <map:transformer logger="sitemap.transformer.xmldb" name="xmldb" src="org.apache.cocoon.transformation.XMLDBTransformer">
      <!-- Driver class (optional). Uncomment if you want XMLDBTransformer
           to create and register XML:DB database. Keep commented out if
           database created somewhere else (for example, by XML:DB source factory)
      <driver>org.apache.xindice.client.xmldb.embed.DatabaseImpl</driver>
      -->
      <base>xmldb:xindice-embed:///db</base>
    </map:transformer>
    
	<!--#######################################################-->
    <!-- eXist's XMLDBTransformer                              -->
    <!--#######################################################-->
    <map:transformer name="xmldb" src="org.exist.cocoon.XMLDBTransformer"/>
</map:transformers>

  <!--+
      | Serializers consume SAX events and produce a character stream. Every
      | pipeline needs to be terminated by a serializer.
      +-->
  <map:serializers default="html">
    <map:serializer logger="sitemap.serializer.links" name="links" src="org.apache.cocoon.serialization.LinkSerializer"/>
    <map:serializer logger="sitemap.serializer.xml" mime-type="text/xml" name="xml" src="org.apache.cocoon.serialization.XMLSerializer"/>
    <map:serializer logger="sitemap.serializer.html" mime-type="text/html" name="html" pool-grow="4" pool-max="32" pool-min="4" src="org.apache.cocoon.serialization.HTMLSerializer">
      <doctype-public>-//W3C//DTD HTML 4.01 Transitional//EN</doctype-public>
      <doctype-system>http://www.w3.org/TR/html4/loose.dtd</doctype-system>
    </map:serializer>
    <map:serializer logger="sitemap.serializer.wml" mime-type="text/vnd.wap.wml" name="wml" src="org.apache.cocoon.serialization.XMLSerializer">
     <doctype-public>-//WAPFORUM//DTD WML 1.1//EN</doctype-public>
     <doctype-system>http://www.wapforum.org/DTD/wml_1.1.xml</doctype-system>
     <encoding>ASCII</encoding>
     <omit-xml-declaration>yes</omit-xml-declaration>
    </map:serializer>
    <map:serializer logger="sitemap.serializer.chtml" mime-type="text/html" name="chtml" src="org.apache.cocoon.serialization.HTMLSerializer">
     <!--+ Compact HTML for Small Information Appliances,
         | based on http://www.w3.org/TR/1998/NOTE-compactHTML-19980209/
         + -->
     <doctype-public>-//W3C//DTD Compact HTML 1.0 Draft//EN</doctype-public>
    </map:serializer>
    <map:serializer logger="sitemap.serializer.svgxml" mime-type="image/svg+xml" name="svgxml" src="org.apache.cocoon.serialization.XMLSerializer">
     <doctype-public>-//W3C//DTD SVG 1.0//EN</doctype-public>
     <doctype-system>http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd</doctype-system>
    </map:serializer>
    <map:serializer logger="sitemap.serializer.xhtml" mime-type="text/html" name="xhtml" pool-grow="2" pool-max="64" pool-min="2" src="org.apache.cocoon.serialization.XMLSerializer">
      <!--+
          | You can choose from Strict, Transitional, or Frameset XHTML.
          | For Strict XHTML set doctype to:
          |   <doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
          |   <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</doctype-system>
          | For Transitional XHTML set doctype to:
          |   <doctype-public>-//W3C//DTD XHTML 1.0 Transitional//EN</doctype-public>
          |   <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</doctype-system>
          | For Frameset XHTML set doctype to:
          |   <doctype-public>-//W3C//DTD XHTML 1.0 Frameset//EN</doctype-public>
          |   <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd</doctype-system>
          |
          | Default XHTML doctype in Cocoon is XHTML Strict. If you want to use more than one
          | XHTML DTD simultaneously, you can define several XHTML serializers.
          +-->
      <doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
      <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</doctype-system>
      <encoding>UTF-8</encoding>
    </map:serializer>
    <map:serializer logger="sitemap.serializer.xhtml" mime-type="application/xhtml+xml" name="xhtml11" pool-grow="2" pool-max="64" pool-min="2" src="org.apache.cocoon.serialization.XMLSerializer">
      <doctype-public>-//W3C//DTD XHTML 1.1//EN</doctype-public>
      <doctype-system>http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</doctype-system>
      <encoding>UTF-8</encoding>
    </map:serializer>   
    <map:serializer logger="sitemap.serializer.text" mime-type="text/plain" name="text" src="org.apache.cocoon.serialization.TextSerializer"/>
    <map:serializer logger="sitemap.serializer.vrml" mime-type="model/vrml" name="vrml" src="org.apache.cocoon.serialization.TextSerializer"/>
    <map:serializer logger="sitemap.serializer.zip" mime-type="application/zip" name="zip" src="org.apache.cocoon.serialization.ZipArchiveSerializer"/>
    <map:serializer logger="sitemap.serializer.sxw" mime-type="application/vnd.sun.xml.writer" name="sxw" src="org.apache.cocoon.serialization.ZipArchiveSerializer"/>
    <map:serializer logger="sitemap.serializer.sxc" mime-type="application/vnd.sun.xml.calc" name="sxc" src="org.apache.cocoon.serialization.ZipArchiveSerializer"/>
    <map:serializer logger="sitemap.serializer.sxd" mime-type="application/vnd.sun.xml.draw" name="sxd" src="org.apache.cocoon.serialization.ZipArchiveSerializer"/>
    <map:serializer logger="sitemap.serializer.sxi" mime-type="application/vnd.sun.xml.impress" name="sxi" src="org.apache.cocoon.serialization.ZipArchiveSerializer"/>
  </map:serializers>

  <!--+
      | Readers circumvent the XML oriented SAX pipeline model, think of a reader
      | being a generator and a serializer at once thus a pipeline may not
      | contain any generator, transformer or serializer in addition to a
      | reader. They are useful for delivering binary content like images.
      +-->
  <map:readers default="resource"> 
    <map:reader logger="sitemap.reader.resource" name="resource" pool-max="32" src="org.apache.cocoon.reading.ResourceReader"/>
    <map:reader logger="sitemap.reader.image" name="image" pool-max="32" src="org.apache.cocoon.reading.ImageReader"/>
  </map:readers>

  <!--+
      | Matchers are executed during pipeline setup. They decide if a
      | pipeline fragment is used within a pipeline. Usually, the decision
      | is based on a match on the requested URI but matchers exist, that
      | match different things as well. Most often the fragment contained in
      | a matcher has a generator as well as a serializer. This is not a
      | necessity, matchers can be nested while chaining does not work.
      +-->
  <map:matchers default="wildcard">
    <map:matcher logger="sitemap.matcher.wildcard" name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcher"/>
    <map:matcher logger="sitemap.matcher.regexp" name="regexp" src="org.apache.cocoon.matching.RegexpURIMatcher"/>
    <map:matcher logger="sitemap.matcher.request-parameter" name="request-parameter" src="org.apache.cocoon.matching.RequestParameterMatcher"/>
    <map:matcher logger="sitemap.matcher.cookie" name="cookie" src="org.apache.cocoon.matching.CookieMatcher"/>
    <map:matcher logger="sitemap.matcher.header" name="header" src="org.apache.cocoon.matching.HeaderMatcher"/>
    <map:matcher logger="sitemap.matcher.parameter" name="parameter" src="org.apache.cocoon.matching.ParameterMatcher"/>
    <map:matcher logger="sitemap.matcher.sessionstate" name="sessionstate" src="org.apache.cocoon.matching.WildcardSessionAttributeMatcher">
      <attribute-name>org.apache.cocoon.SessionState</attribute-name>
    </map:matcher>
    <map:matcher logger="sitemap.matcher.referer-match" name="referer-match" src="org.apache.cocoon.matching.WildcardHeaderMatcher">
      <header-name>referer</header-name>
    </map:matcher>
    <map:matcher name="mount-table" src="org.apache.cocoon.matching.MountTableMatcher">
      <map:parameter name="ignore-missing-tables" value="true"/>
    </map:matcher>
  </map:matchers>

  <!--+
      | Selectors are executed during pipeline setup. They can be used to
      | determine which pipeline fragments should be combined. They are best
      | compared with a java switch statement.
      +-->
  <map:selectors default="browser">
   <map:selector logger="sitemap.selector.browser" name="browser" src="org.apache.cocoon.selection.BrowserSelector">
    <!--+
        | NOTE: The appearance indicates the search order. This is very important since
        |       some words may be found in more than one browser description. (MSIE is
        |       presented as "Mozilla/4.0 (Compatible; MSIE 4.01; ...")
        +-->
    <browser name="explorer" useragent="MSIE"/>
    <browser name="pocketexplorer" useragent="MSPIE"/>
    <browser name="handweb" useragent="HandHTTP"/>
    <browser name="avantgo" useragent="AvantGo"/>
    <browser name="imode" useragent="DoCoMo"/>
    <browser name="opera" useragent="Opera"/>
    <browser name="lynx" useragent="Lynx"/>
    <browser name="java" useragent="Java"/>
    <browser name="wap" useragent="Nokia"/>
    <browser name="wap" useragent="UP"/>
    <browser name="wap" useragent="Wapalizer"/>
    <browser name="mozilla5" useragent="Mozilla/5"/>
    <browser name="mozilla5" useragent="Netscape6/"/>
    <browser name="netscape" useragent="Mozilla"/>
   </map:selector>
   
   <!--+
       | Exception selector : used in <map:handle> errors to build different pipelines
       | depending on the error that occured.
       | The configuration allows to associate a symbolic name to exception classes
       | which is used in the <map:when> tests.
       | An exception can also be "unrolled", meaning that cascaded exception will be checked.
       +-->
   <map:selector logger="sitemap.selector.exception" name="exception" src="org.apache.cocoon.selection.ExceptionSelector">
     <exception class="org.apache.cocoon.ResourceNotFoundException" name="not-found"/>
     <exception class="org.apache.cocoon.components.flow.InvalidContinuationException" name="invalid-continuation"/>
     <!-- The statement below tells the selector to unroll as much exceptions as possible -->
     <exception class="java.lang.Throwable" unroll="true"/>
   </map:selector>

   <map:selector logger="sitemap.selector.request-method" name="request-method" src="org.apache.cocoon.selection.RequestMethodSelector"/>
   <map:selector logger="sitemap.selector.resource-exists" name="resource-exists" src="org.apache.cocoon.selection.ResourceExistsSelector"/>
   <map:selector logger="sitemap.selector.request-parameter" name="request-parameter" src="org.apache.cocoon.selection.RequestParameterSelector">
    <!-- Define now which request parameter to use; or do it later,
         when using this selector, via "parameter-name" parameter.
    <parameter-name>myparam</parameter-name> 
    -->
   </map:selector>
   <map:selector logger="sitemap.selector.request-attribute" name="request-attribute" src="org.apache.cocoon.selection.RequestAttributeSelector">
    <!-- <attribute-name>myparam</attribute-name> -->
   </map:selector>
   <map:selector logger="sitemap.selector.session-attribute" name="session-attribute" src="org.apache.cocoon.selection.SessionAttributeSelector">
    <!-- <attribute-name>myparam</attribute-name> -->
   </map:selector>
   <map:selector logger="sitemap.selector.parameter" name="parameter" src="org.apache.cocoon.selection.ParameterSelector"/>
   <map:selector logger="sitemap.selector.header" name="header" src="org.apache.cocoon.selection.HeaderSelector">
    <!-- <header-name>myparam</header-name> -->
   </map:selector>
   <map:selector logger="sitemap.selector.host" name="host" src="org.apache.cocoon.selection.HostSelector"/>
   <map:selector logger="sitemap.selector.simple" name="simple" src="org.apache.cocoon.selection.SimpleSelector"/>
  </map:selectors>

  <!--+
      | Actions are executed during pipeline setup. Their purpose is to
      | execute some code that doesn't involve touching the stream of
      | pipeline events. Example usage is to update databases, check external 
      | resources, etc.. The execution may fail or complete successfully. Only 
      | if the execution of the action was successful, the pipeline fragment 
      | nested inside the action element is executed, otherwise, it's skipped
      | entirely and execution proceeds from the element right below the action.
      +-->
  <map:actions>
   <map:action logger="sitemap.action.request" name="request" src="org.apache.cocoon.acting.RequestParamAction"/>
   <map:action logger="sitemap.action.requestParamExists" name="req-params" src="org.apache.cocoon.acting.RequestParameterExistsAction"/>
   <map:action logger="sitemap.action.form-validator" name="form-validator" src="org.apache.cocoon.acting.FormValidatorAction"/>
   <map:action logger="sitemap.action.session-state" name="session-state" src="org.apache.cocoon.acting.SessionStateAction"/>
   <map:action logger="sitemap.action.session-isvalid" name="session-isvalid" src="org.apache.cocoon.acting.SessionIsValidAction"/>
   <map:action logger="sitemap.action.session-validator" name="session-validator" src="org.apache.cocoon.acting.SessionValidatorAction"/>
   <map:action logger="sitemap.action.session-invalidator" name="session-invalidator" src="org.apache.cocoon.acting.SessionInvalidatorAction"/>
   <map:action logger="sitemap.action.resource-exists" name="resource-exists" src="org.apache.cocoon.acting.ResourceExistsAction"/>
   <map:action logger="sitemap.action.set-header" name="set-header" src="org.apache.cocoon.acting.HttpHeaderAction"/>
   <map:action logger="sitemap.action.clear-cache" name="clear-cache" src="org.apache.cocoon.acting.ClearCacheAction"/>
   <map:action logger="sitemap.action.clear-persistent-store" name="clear-persistent-store" src="org.apache.cocoon.acting.ClearPersistentStoreAction"/>
   <map:action logger="sitemap.action.locale" name="locale" src="org.apache.cocoon.acting.LocaleAction"/>
  
   <map:action logger="sitemap.action.serverpages" name="serverpages" pool-grow="2" pool-max="32" pool-min="4" src="org.apache.cocoon.acting.ServerPagesAction"/>

   <!--#######################################################-->
   <!-- Register eXist's XMLDBSessionLoginAction              -->
   <!--#######################################################-->
   <map:action logger="sitemap.action.xmldb.login" name="xmldb-login" src="org.exist.cocoon.XMLDBSessionLoginAction"/>
   <map:action logger="sitemap.action.xmldb.shutdown" name="xmldb-shutdown"
		src="org.exist.cocoon.ShutdownAction"/>
</map:actions>

  <!--+
      | The different pipe implementations
      | 
      | NON-CACHING:
      |   The non caching implementation of cocoon pipelines.
      | 
      | CACHING:
      |   Traditional longest cacheable key caching.
      | 
      | CACHING-POINT:
      |   The caching-point pipeline implements an extended             
      |   caching algorithm which is of particular benefit for use with 
      |   those pipelines that utilise cocoon-views and/or provide      
      |   drill-down functionality.                                     
      | 
      | The autoCachingPoint algorithim (if enabled) will automatically
      | cache common elements of the pipeline currently being processed - as well
      | as the entire cacheable pipeline according to the "longest cacheable key"
      | algorithm.
      | 
      | Consider the following simple pipeline, where generator G is labelled with
      | a cocoon-view enabling the pipeline to serialize data to either html or pdf 
      | depending on the value of cocoon-view (as provided by the request):
      | G - T -  S(html)
      | |__ T -  S(pdf)
      | 
      | If cocoon-view=html, then the caching-point algorithm will not only cache 
      | the longest cacheable path, which would be GTS(html) but also the
      | *common element* which in this case would be the results from G. If the
      | next request to this pipeline was cocoon-view=pdf, then there would be no
      | need to invoke the generator a second time, as it's value has already been
      | cached (provided G generates the same cache key)
      | 
      | Also note: One can switch "Off" autoCachingPoint and use "pipeline-hints" to
      | manually indicate that certain pipeline-components should be considered as
      | cache points.
      +-->
   <map:pipes default="caching">
     <map:pipe name="caching" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline">
       <!--+
           | If not specified, the value of the outputBufferSize parameter is -1.
           | This will cause Cocoon to buffer all output until processing has finished
           | before sending it to the client. This has the advantage that in case
           | an error occurs during the processing of the SAX-pipeline, Cocoon is still
           | able to reset the response and send an error page instead. Otherwise the
           | error page will be appended to the output already send to the client. 
           | If you are generating larger pages, it might be benificial to enable
           | this parameter, so that output is gradually send to the client as it
           | is being generated.
           | For more granularity, you can also supply this parameter to
           | individual map:pipeline elements (using map:parameter syntax).
           +-->
       <!-- parameter name="outputBufferSize" value="8192"/ -->
     </map:pipe>
     <map:pipe name="caching-point" src="org.apache.cocoon.components.pipeline.impl.CachingPointProcessingPipeline">
       <parameter name="autoCachingPoint" value="On"/>
       <!-- parameter name="outputBufferSize" value="8192"/ -->
     </map:pipe>
     <map:pipe name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline">
       <!-- parameter name="outputBufferSize" value="8192"/ -->
     </map:pipe>
   </map:pipes>

    </map:components>

<!-- =========================== Views =================================== -->

  <!--+
      | Views provide different, well, views to resources. Views are
      | orthogonal to pipelines. Please refer to the docs.
      |
      | It would be wise to disable any unneeded views in a 
      | production environment in order to avoid exposing data
      | that you may not necessarily wish to.
      +-->
    <map:views>
        <map:view from-label="content" name="content">
            <map:serialize type="xml"/>
        </map:view>

        <map:view from-label="data" name="pretty-content">
            <map:transform src="stylesheets/system/xml2html.xslt"/>
            <map:serialize type="html"/>
        </map:view>

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

<!-- =========================== 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:resources>

<!-- ========================== Action sets ================================ -->

 <!--+
     | Action sets group actions together. If some actions are often used
     | together in pipeline fragments, it's easier to group them and refer
     | to the group. For more info, please see the docs.
     +-->
    <map:action-sets></map:action-sets>

<!-- =========================== 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>

  <!-- main pipeline -->

        <map:pipeline>
 
               <!-- This causes directories added under "mount"
               (even with Cocoon already running) to be activated automagically
               if they contain a sitemap.xmap, without having to modify the main
               sitemap.xmap
             -->
            <map:match pattern="mount/*/**">
                <map:mount check-reload="yes" src="mount/{1}/" uri-prefix="mount/{1}"/>
            </map:match>
        </map:pipeline>

        <map:pipeline>
            <!-- graphics etc. -->
            <map:match pattern="xmldb/db/shakespeare/plays/**.css">
                <map:read src="xmldb:exist:///db/shakespeare/plays/{1}.css"
                    mime-type="text/css"/>
            </map:match>

            <map:match pattern="**.css">
                <map:read mime-type="text/css" src="{1}.css"/>
            </map:match>
            <map:match pattern="**.jpeg">
                <map:read type="image" mime-type="image/jpeg" src="{1}.jpg" />
            </map:match>               
            <map:match pattern="**.jpg">
                <map:read type="image" mime-type="image/jpeg" src="{1}.jpg" />
            </map:match>         
            <map:match pattern="**.gif">
                <map:read mime-type="image/gif" src="{1}.gif"/>
            </map:match>
            <map:match pattern="**.png">
                <map:read mime-type="image/png" src="{1}.png"/>
            </map:match>
            <map:match pattern="**.dtd">
                <map:read mime-type="text/text" src="{1}.dtd"/>
            </map:match>
            <map:match pattern="**.js">
                <map:read mime-type="text/javascript" src="{1}.js"/>
            </map:match>
            <map:match pattern="**.html">
                <map:read src="{1}.html" mime-type="text/html"/>
            </map:match>
            
            <!-- pipelines using the xmldb:// pseudo-protocol -->

            <map:match pattern="xmldb/db/xinclude/**.xml">
                <map:generate src="xmldb:exist:///db/xinclude/{1}.xml"/>
                <map:transform src="stylesheets/db2html.xsl"/>
                <map:serialize type="html"/>
            </map:match> 

			<map:match pattern="xmldb/db/xinclude/**.jpg">
				<map:read type="image" src="xmldb:exist:///db/xinclude/{1}.jpg"/>
			</map:match>

            <!-- apply stylesheet shakes.xsl to all XML documents -->
            <!-- in xmldb-collection /db/shakespeare/plays -->
            <map:match pattern="xmldb/db/shakespeare/plays/**.xml">
                <map:match pattern="xpath" type="request-parameter">
                    <!-- check if an xpath query has been passed in the request -->
                    <map:generate src="xmldb:exist:///db/shakespeare/plays/{../1}.xml#{1}"/>
                    <map:act type="request">
                        <!-- convert request parameters into sitemap parameters -->
                        <map:parameter name="parameters" value="true"/>
                        <map:parameter name="default.howmany" value="10"/>
                        <map:parameter name="default.start" value="1"/>
                        <!-- we don't want to display all results on one page,
                     so we use the filter-transformer to filter out 
                     everything except the block we would like to see.
                 -->
                        <map:transform type="filter">
                            <map:parameter name="element-name" value="result"/>
                            <map:parameter name="count" value="{howmany}"/>
                            <map:parameter name="blocknr" value="{start}"/>
                        </map:transform>
                        <map:transform src="stylesheets/xmldb-query.xsl">
                            <map:parameter name="block" value="{start}"/>
                            <map:parameter name="collection" value="/db/shakespeare/plays"/>
                            <map:parameter name="resource" value="{../../1}.xml"/>
                        </map:transform>
                    </map:act>
                    <map:serialize type="html"/>
                </map:match>
                <map:generate src="xmldb:exist:///db/shakespeare/plays/{1}.xml"/>
                <map:transform src="xmldb:exist:///db/shakespeare/plays/shakes.xsl"/>
                <map:serialize type="html"/>
            </map:match> 

            <!-- browse collections -->
            <map:match pattern="xmldb/**/">
                <!-- check if an xpath query has been passed in the request -->
                <map:match pattern="xpath" type="request-parameter">
                    <map:generate src="xmldb:exist:///{../1}/#{1}"/>
                    <map:act type="request">
                        <!-- convert request parameters into sitemap parameters -->
                        <map:parameter name="parameters" value="true"/>
                        <map:parameter name="default.howmany" value="10"/>
                        <map:parameter name="default.start" value="1"/>
                        <!-- we don't want to display all results on one page,
                     so we use the filter-transformer to filter out 
                     everything except the block we would like to see.
                 -->
                        <map:transform type="filter">
                            <map:parameter name="element-name" value="result"/>
                            <map:parameter name="count" value="{howmany}"/>
                            <map:parameter name="blocknr" value="{start}"/>
                        </map:transform>
                        <map:transform src="stylesheets/xmldb-query.xsl">
                            <map:parameter name="block" value="{start}"/>
                            <map:parameter name="collection" value="{../../1}"/>
                        </map:transform>
                    </map:act>
                    <map:serialize type="html"/>
                </map:match>
                <!-- no xpath query has been specified: display collection contents -->
                <map:generate src="xmldb:exist:///{1}/"/>
                <map:transform src="stylesheets/xmldb-collection.xsl">
                    <map:parameter name="collection" value="{1}"/>
				</map:transform>
				<map:transform type="encodeURL"/>
				<map:serialize type="html" encoding="UTF-8"/>
            </map:match>
            
            <!-- display source XML for other resources -->
            <map:match pattern="xmldb/**">
                <map:match pattern="xpath" type="request-parameter">
                    <!-- check if an xpath query has been passed in the request -->
                    <map:generate src="xmldb:exist:///{../1}#{1}"/>
                    <map:act type="request">
                        <!-- convert request parameters into sitemap parameters -->
                        <map:parameter name="parameters" value="true"/>
                        <map:parameter name="default.howmany" value="10"/>
                        <map:parameter name="default.start" value="1"/>
                        <!-- we don't want to display all results on one page,
                     so we use the filter-transformer to filter out 
                     everything except the block we would like to see.
                 -->
                        <map:transform type="filter">
                            <map:parameter name="element-name" value="result"/>
                            <map:parameter name="count" value="{howmany}"/>
                            <map:parameter name="blocknr" value="{start}"/>
                        </map:transform>
                        <map:transform src="stylesheets/xmldb-query.xsl">
                            <map:parameter name="block" value="{start}"/>
                            <map:parameter name="collection" value="{../../1}"/>
                        </map:transform>
                    </map:act>
                    <map:serialize type="html"/>
                </map:match>
				<map:generate src="xmldb:exist:///{1}"/>
				<map:transform type="encodeURL"/>
                <map:select type="browser">
                    <map:when test="explorer">
                        <map:serialize type="xml"/>
                    </map:when>
                    <map:otherwise>
                        <map:transform src="stylesheets/system/xml2html.xslt"/>
                        <map:serialize type="html" encoding="UTF-8"/>
                    </map:otherwise>
                </map:select>
            </map:match>

            <map:match pattern="**.xmap">
                <map:generate src="{1}.xmap"/>
                <map:transform src="stylesheets/sitemap/simple-sitemap2html.xsl"/>
                <map:serialize type="html"/>
            </map:match>

            <map:match pattern="">
                <map:redirect-to uri="/exist/index.xml"/>
            </map:match>
            
            <!-- *********** All Cluster information *************** -->
             <map:match pattern="cluster">
                 <map:generate type="exist-cluster"/>
                 <map:transform type="cinclude"/>
                 <map:transform src="stylesheets/cluster.xsl">
                     <map:parameter name="use-request-parameters"
                             value="true"/>
                 </map:transform>
                 <map:serialize type="html"/>
             </map:match>

            <!-- *********** Single node of cluster information *************** -->
             <map:match pattern="clusterinfo">
                 <map:generate type="cluster-info"/>
                 <map:transform type="cinclude"/>
                 <map:transform src="stylesheets/clusterinfo.xsl">
                     <map:parameter name="use-request-parameters" value="true"/>
                 </map:transform>
                 <map:serialize type="html"/>
             </map:match>

            <map:match pattern="index.xml">
                <map:generate src="index.xml"/>
                <map:transform type="xinclude"/>
                <map:transform src="stylesheets/doc2html-2.xsl"/>
                <map:serialize type="html"/>
            </map:match>

            <map:match pattern="library/**">
                <map:mount check-reload="yes" src="library/sitemap.xmap" uri-prefix="library"/>
            </map:match>

            <map:match pattern="simple/**">
                <map:mount check-reload="yes" src="simple/sitemap.xmap" uri-prefix="simple"/>
            </map:match>

            <map:match pattern="examples/**">
                <map:mount check-reload="yes" src="examples/sitemap.xmap" uri-prefix="examples"/>
            </map:match>
				
            <map:match pattern="acronyms/**">
                <map:mount check-reload="yes" src="acronyms/sitemap.xmap" uri-prefix="acronyms"/>
            </map:match>
				
            <map:match pattern="xquery/**">
                <map:mount check-reload="yes" src="xquery/sitemap.xmap"
                        uri-prefix="xquery"/>
            </map:match>

			<map:match pattern="sandbox/">
                <map:redirect-to uri="sandbox.xql"/>
            </map:match>
            
            <map:match pattern="mods/**">
                <map:mount check-reload="yes" src="mods/sitemap.xmap"
                uri-prefix="mods"/>
            </map:match>
            
            <map:match pattern="apps/**">
                <map:mount check-reload="yes" src="apps/sitemap.xmap"
                    uri-prefix="apps"/>
            </map:match>
            
            <map:match pattern="spatial-index/**">
                <map:mount check-reload="yes" src="spatial-index/sitemap.xmap"
                    uri-prefix="spatial-index"/>
            </map:match>            
        
            <map:match pattern="examples.xml">
                <map:generate src="examples.xml"/>
                <map:transform type="xinclude"/>
                <map:transform src="stylesheets/doc2html-2.xsl"/>
                <map:serialize type="html"/>
            </map:match>

            <map:match pattern="facts.xml">
                <map:generate src="facts.xml"/>
                <map:transform type="xinclude"/>
                <map:transform src="stylesheets/facts.xsl"/>
                <map:serialize type="html"/>
            </map:match>

            <map:match pattern="status">
                <map:generate type="exist-status"/>
                <map:transform src="stylesheets/status.xsl">
                    <map:parameter name="use-request-parameters"
                            value="true"/>
                </map:transform>
                <map:serialize type="html"/>
            </map:match>
				
            <map:match pattern="shutdown">
                <map:act type="xmldb-shutdown">
                    <map:redirect-to uri="status"/>
                </map:act>
                <map:redirect-to uri="status"/>
            </map:match>

            <map:match pattern="changes.xml">
                <map:generate src="changes.xml"/>
                <map:transform src="stylesheets/changes.xsl"/>
                <map:serialize type="html"/>
            </map:match>
            
            <!-- the login-form for the database admin servlet -->
            <map:match pattern="adminLogin.xml">
                <map:generate src="adminLogin.xml"/>
                <map:transform type="encodeURL"/>
                <map:serialize type="html"/>
            </map:match>
				
            <map:match pattern="request.xml">
                <map:generate type="request">
                		<!--map:parameter name="container-encoding" value="ISO-8859-1"/-->
                    <map:parameter name="form-encoding" value="UTF-8"/>
                </map:generate>
                <map:serialize type="xml"/>
            </map:match>

            <map:match pattern="**.xsp">
                <map:generate src="{1}.xsp" type="serverpages"/>
                <map:transform type="cinclude"/>
                <map:transform src="stylesheets/doc2html-2.xsl"/>
                <map:serialize encoding="UTF-8" type="html"/>
            </map:match>
            
            <!-- Documentation -->
            <map:match pattern="roadmap.xml">
            	<map:generate src="roadmap.xml"/>
                <map:transform type="cinclude"/>
                <map:transform src="stylesheets/roadmap.xsl"/>
                <map:serialize type="html"/>
            </map:match>
            
            <map:match pattern="docquery.xq">
            	<map:generate src="docquery.xq" type="xquery"/>
                <map:transform type="cinclude"/>
                <map:transform src="stylesheets/db2html.xsl"/>
                <map:serialize type="html"/>
            </map:match>
            
            <map:match pattern="**.xml">
                <map:generate src="{1}.xml"/>
                <map:transform type="cinclude"/>
                <map:transform src="stylesheets/db2html.xsl"/>
                <map:serialize type="html"/>
            </map:match>

            <map:match pattern="**/">
                <map:generate src="{1}" type="directory"/>
                <map:transform src="stylesheets/system/directory2html.xslt"/>
                <map:serialize/>
            </map:match>
 
            <!-- allows to automagically activate a subdirectory having its own sitemap.xmap -->
            <map:match pattern="*/**">
                <map:mount check-reload="yes" src="{1}/sitemap.xmap"
                        uri-prefix="{1}" />
            </map:match>
       
    <!--+
        | At the very end of a pipeline, you can catch the errors triggered
        | by the pipeline execution. The error handler is an internal sitemap
        | component that when triggered by an error takes over the normal
        | pipeline execution.
        | You can here use the "notifying" generator that produces an XML
        | representation and further manipulate this document for presentation
        | on screen.
        | You can also use any other generator you want if you don't want the
        | error to be displayed on screen. The "exception" selector can help
        | you to define different screens for different error types.
        +-->
            <map:handle-errors>
                <map:select type="exception">

                    <map:when test="not-found">
                        <map:generate type="notifying"/>
                        <map:transform src="stylesheets/system/error2html.xslt">
                            <map:parameter name="contextPath" value="{request:contextPath}"/>
                            <map:parameter name="pageTitle" value="Resource not found"/>
                        </map:transform>
                    </map:when>

                    <map:when test="invalid-continuation">
                        <map:generate src="not-found.xml"/>
                        <map:transform src="welcome.xslt">
                            <map:parameter name="contextPath" value="{request:contextPath}"/>
                        </map:transform>
                    </map:when>

                    <map:otherwise>
                        <map:generate type="notifying"/>
                        <map:transform src="stylesheets/system/error2html.xslt">
                            <map:parameter name="contextPath" value="{request:contextPath}"/>
                        </map:transform>
                    </map:otherwise>
                </map:select>

                <map:serialize/>
            </map:handle-errors>

        </map:pipeline>
    </map:pipelines>

</map:sitemap>
