<?xml version="1.0" encoding="UTF-8"?>
<!--

    The contents of this file are subject to the license and copyright
    detailed in the LICENSE and NOTICE files at the root of the source
    tree and available online at

    http://www.dspace.org/license/

-->

<!--

The Discovery Aspect is responsible for managing search/browse facets/filters
and the recent submissions listing

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

        
        <map:transformers>

            <map:transformer name="Navigation" src="org.dspace.app.xmlui.aspect.discovery.Navigation"/>
            <map:transformer name="SimpleSearch" src="org.dspace.app.xmlui.aspect.discovery.SimpleSearch"/>
            <map:transformer name="BrowseFacet" src="org.dspace.app.xmlui.aspect.discovery.BrowseFacet"/>
            <map:transformer name="SearchFacetFilter" src="org.dspace.app.xmlui.aspect.discovery.SearchFacetFilter"/>
            <map:transformer name="FrontPageFeeds" src="org.dspace.app.xmlui.aspect.discovery.SiteViewer"/>
            <map:transformer name="SiteRecentSubmissions" src="org.dspace.app.xmlui.aspect.discovery.SiteRecentSubmissions"/>
            <map:transformer name="SidebarFacetsTransformer" src="org.dspace.app.xmlui.aspect.discovery.SidebarFacetsTransformer"/>

            <map:transformer name="CommunitySearch" src="org.dspace.app.xmlui.aspect.discovery.CommunitySearch"/>
            <map:transformer name="CommunityRecentSubmissions" src="org.dspace.app.xmlui.aspect.discovery.CommunityRecentSubmissions"/>

			<map:transformer name="CSVExportDiscoveryNavigation" src="org.dspace.app.xmlui.aspect.discovery.CSVExportDiscoveryNavigation"/>

            <map:transformer name="CollectionSearch" src="org.dspace.app.xmlui.aspect.discovery.CollectionSearch"/>
            <map:transformer name="CollectionRecentSubmissions" src="org.dspace.app.xmlui.aspect.discovery.CollectionRecentSubmissions"/>


            <map:transformer name="RelatedItems" src="org.dspace.app.xmlui.aspect.discovery.RelatedItems"/>

            <map:transformer name="RestrictedItem" src="org.dspace.app.xmlui.aspect.artifactbrowser.RestrictedItem"/>
            <map:transformer name="RecentSubmissionTransformer" src="org.dspace.app.xmlui.aspect.discovery.recentSubmissions.RecentSubmissionTransformer"/>

            <map:transformer name="RobotsNoIndexTransformer" src="org.dspace.app.xmlui.aspect.discovery.RobotsNoIndexTransformer"/>
        </map:transformers>
               
        <map:actions>
            <map:action name="DiscoverySearchLoggerAction" src="org.dspace.app.xmlui.aspect.discovery.DiscoverySearchLoggerAction"/>
        </map:actions>

        <map:matchers default="wildcard">
            <map:matcher name="HandleTypeMatcher" src="org.dspace.app.xmlui.aspect.general.HandleTypeMatcher"/>
            <map:matcher name="HandleAuthorizedMatcher" src="org.dspace.app.xmlui.aspect.general.HandleAuthorizedMatcher"/>
            <map:matcher name="ContainerHomePageSelector" src="org.dspace.app.xmlui.aspect.viewArtifacts.ContainerHomePageMatcher"/>
        </map:matchers>
    <map:selectors>
        <map:selector name="AuthenticatedSelector" src="org.dspace.app.xmlui.aspect.general.AuthenticatedSelector"/>
    </map:selectors>

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


            <map:generate/>

            <!--
                    Add the basic navigation content to every page. This includes:

                    1) Metadata about the current page (really just what the current
                       context path is)
                    2) Navigation links to browse the repository.
                       - This includes links that are relative to the currently
                         selected community or collection.
                    3) Metadata about the search urls.
                    -->
            <map:transform type="Navigation"/>
            
            <!--
                    Display the DSpace homepage. This includes the news.xml file
                    along with a list of top level communities in DSpace.
                    -->
            <map:match pattern="">
                <map:transform type="SidebarFacetsTransformer"/>
                <map:transform type="FrontPageFeeds"/>

                <map:transform type="SiteRecentSubmissions"/>

                <map:serialize type="xml"/>
            </map:match>

            <map:match pattern="recent-submissions">
                <map:transform type="RecentSubmissionTransformer">
                    <map:parameter name="isHomePage" value="false"/>
                </map:transform>

                <map:serialize type="xml"/>
            </map:match>


            <!-- List all communities & collections in DSpace
            <map:match pattern="community-list">
                <map:transform type="CommunityBrowser">
                    <map:parameter name="depth" value="999"/>
                </map:transform>
                <map:serialize type="xml"/>
            </map:match>  -->


			<!-- Search -->
			<map:match pattern="discover">
				<map:transform type="CSVExportDiscoveryNavigation"/>
                <map:act type="DiscoverySearchLoggerAction"/>
				<map:transform type="SidebarFacetsTransformer"/>
                <map:transform type="SimpleSearch"/>
                <map:transform type="IncludePageMeta">
                    <map:parameter name="stylesheet.screen.discovery#1" value="../../static/css/discovery/discovery-style.css"/>

                    <map:parameter name="javascript.static#1" value="loadJQuery.js"/>
                    <map:parameter name="javascript.static#2" value="static/js/discovery/search-controls.js"/>
                </map:transform>
				<map:serialize type="xml"/>
			</map:match>

            <!--<map:match pattern="browse-discovery">-->
				<!--<map:transform type="BrowseFacet"/>-->
				<!--<map:serialize type="xml"/>-->
			<!--</map:match>-->

            <map:match pattern="search-filter">
                <map:transform type="SearchFacetFilter"/>
                <map:serialize type="xml"/>
            </map:match>

            <!-- Handle specific features -->
            <map:match pattern="handle/*/**">

                <!-- Scoped browse by features  -->
                <map:match type="HandleAuthorizedMatcher" pattern="READ">
                    <map:match type="HandleTypeMatcher" pattern="community,collection">

                        <!-- Browse (by anything) -->
                        <!--<map:match pattern="handle/*/*/browse-discovery">-->
                            <!--<map:transform type="BrowseFacet"/>-->
                            <!--<map:serialize type="xml"/>-->
                        <!--</map:match>-->

                        <!-- Simple search -->
						<map:match pattern="handle/*/*/discover">
							<map:transform type="CSVExportDiscoveryNavigation"/>
                            <map:act type="DiscoverySearchLoggerAction"/>
                            <map:transform type="SidebarFacetsTransformer"/>
                            <map:transform type="SimpleSearch"/>
                            <map:transform type="IncludePageMeta">
                                <map:parameter name="stylesheet.screen.discovery#1" value="../../static/css/discovery/discovery-style.css"/>

                                <map:parameter name="javascript.static#1" value="loadJQuery.js"/>
                                <map:parameter name="javascript.static#2" value="static/js/discovery/search-controls.js"/>
                            </map:transform>

                            <!--adds the "no index" robots meta tag to the page-->
                            <map:transform type="RobotsNoIndexTransformer"/>
                            <map:serialize type="xml"/>
						</map:match>

                        <map:match pattern="handle/*/*/search-filter">
                            <map:transform type="SearchFacetFilter"/>

                            <!--adds the "no index" robots meta tag to the page-->
                            <map:transform type="RobotsNoIndexTransformer"/>
                            <map:serialize type="xml"/>
                        </map:match>

                        <map:match pattern="handle/*/*/recent-submissions">
                            <map:transform type="RecentSubmissionTransformer">
                                <map:parameter name="isHomePage" value="false"/>
                            </map:transform>
                            <map:serialize type="xml"/>
                        </map:match>

                        <map:match pattern="handle/*/*">
                            <map:match type="HandleTypeMatcher" pattern="collection">
                                <map:match type="ContainerHomePageSelector" pattern="discoveryRecentSubmissions">
                                    <map:transform type="SidebarFacetsTransformer"/>
                                    <map:transform type="RecentSubmissionTransformer">
                                        <map:parameter name="isHomePage" value="true"/>
                                    </map:transform>
                                    <map:serialize type="xml"/>
                                </map:match>
                            </map:match>
                        </map:match>
                    </map:match>
                </map:match>

                <map:match pattern="handle/*/*">
                    <map:match type="HandleAuthorizedMatcher" pattern="READ">
                        <map:match type="HandleTypeMatcher" pattern="community">
                            <map:transform type="SidebarFacetsTransformer"/>
                            <map:transform type="CommunitySearch"/>
                            <map:transform type="CommunityRecentSubmissions"/>
                            <map:serialize type="xml"/>
                        </map:match>
                        <map:match type="HandleTypeMatcher" pattern="collection">
                            <map:transform type="SidebarFacetsTransformer"/>
                            <map:transform type="CollectionSearch"/>
                            <map:transform type="CollectionRecentSubmissions"/>
                            <map:serialize type="xml"/>
                        </map:match>
                        <map:match type="HandleTypeMatcher" pattern="item">
                            <!--<map:transform type="SidebarFacetsTransformer"/>-->
                            <!--<map:transform type="ItemFacets"/>-->
                            <map:transform type="RelatedItems"/>
                            <map:serialize type="xml"/>
                        </map:match>
                    </map:match>
                </map:match>

            </map:match> <!-- End match handle/*/** -->

            <!-- Not a URL we care about, so just pass it on. -->
            <map:serialize type="xml"/>

        </map:pipeline>


    </map:pipelines>
</map:sitemap>
