<?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.
-->
<!-- Default Forrest locationmap -->
<locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
  <components>
    <matchers default="lm">
      <matcher 
        name="lm" 
        src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
    </matchers>
    <selectors default="exists">
      <selector name="exists" logger="sitemap.selector.exists"  
                    src="org.apache.forrest.sourceexists.SourceExistsSelector" />
    </selectors>
  </components>
  <locator>
<!-- ================================== -->
<!-- Mount project specific locationmap -->
<!-- ================================== -->
    <select>
<!-- Normally it is discouraged to use the cocoon:
      protocol in the locationmap as this provides too much indirection.
      
      However, this is a special case since it allows individual 
      projects to dynamically generate their locationmap. This is
      required when content is being drawn from a remote repository
      and we want the site structure to also come from that repository
      -->
      <mount src="cocoon://locationmap-project.xml"/>
    </select>
<!-- ================================== -->
<!-- Mount plugin specific locationmap -->
<!-- project files                      -->
<!-- ================================== -->
    <select>
      <mount src="{properties:temp-dir}/locationmap.xml"/>
    </select>
<!-- ================================== -->
<!-- Forrest files                      -->
<!-- ================================== -->
    <match pattern="forrest.schema.**">
      <location src="{forrest:forrest.context}/resources/schema/dtd/{1}.dtd" />
    </match>
<!-- ================================== -->
<!-- Mount forrest locationmaps         -->
<!-- ================================== -->
    <select>
      <mount src="{forrest:forrest.context}/locationmap-transforms.xml"/>
    </select>
    <select>
      <mount src="{forrest:forrest.context}/locationmap-skins.xml"/>
    </select>
    <select>
      <mount src="{forrest:forrest.context}/locationmap-i18n.xml"/>
    </select>
    <select>
      <mount src="{forrest:forrest.context}/locationmap-skinconf.xml"/>
    </select>
    <select>
      <mount src="{forrest:forrest.context}/locationmap-plugin.xml"/>
    </select>
<!--  FIXME: this should be part of a chaperon plugin -->
    <select>
      <mount src="{forrest:forrest.context}/locationmap-chaperon.xml"/>
    </select>
<!-- ================================== -->
<!-- project files                      -->
<!-- ================================== -->
    <match pattern="project.xmap.sitemap">
      <location src="{properties:sitemap}" />
    </match>
    <match pattern="project.build-info">
      <location src="{properties:temp-dir}/build-info.xml" />
    </match>
    <match pattern="project.images.**.*">
      <select>
        <location src="{properties:resources.images}{1}.{2}" />
        <location src="{properties:content}../resources/images/{1}.{2}" />
        <location src="{properties:content.xdocs}images/{1}.{2}" />
        <location src="{properties:content.xdocs}{1}.{2}" />
      </select>
    </match>
    <match pattern="project.js.**">
      <location src="{properties:resources}scripts/{1}.js" />
    </match>
    <match pattern="project.css.**">
      <location src="{properties:resources}css/{1}.css" />
    </match>
    <match pattern="project.xml.site">
      <location src="{properties:content.xdocs}site.xml" />
    </match>
    <match pattern="project.**">
      <location src="{properties:content.xdocs}{1}" />
    </match>
  </locator>
</locationmap>
