<?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/

-->
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
    xmlns:configurator="http://cocoon.apache.org/schema/configurator"
    xmlns:avalon="http://cocoon.apache.org/schema/avalon" xmlns:servlet="http://cocoon.apache.org/schema/servlet"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
                           http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd
                           http://cocoon.apache.org/schema/avalon http://cocoon.apache.org/schema/avalon/cocoon-avalon-1.0.xsd
                           http://cocoon.apache.org/schema/servlet http://cocoon.apache.org/schema/servlet/cocoon-servlet-1.0.xsd">

    <!-- Activate Cocoon Spring Configurator -->
    <configurator:settings />

    <!-- NOTE: Cocoon's Log4j configurations are handled by DSpace's default log4j config file -->

    <!-- Activate Avalon Bridge -->
    <avalon:bridge />

    <bean id="dspace.org.myApplication" class="org.apache.cocoon.sitemap.SitemapServlet">
        <servlet:context mount-path="" context-path="" />
    </bean>


   <!-- Acquires the DSpace Utility Class with initialized Service Manager -->
    <bean id="dspace" class="org.dspace.utils.DSpace"/>
    
    <!-- Acquires reference to EventService --> 
    <bean id="dspace.eventService" factory-bean="dspace" factory-method="getEventService"/>

    <!-- Inject the Default LoggerUsageEventListener into the EventService  -->
    <bean class="org.dspace.usage.LoggerUsageEventListener">
        <property name="eventService" >
            <ref bean="dspace.eventService"/>
        </property>
    </bean>

    <!-- Inject the SolrLoggerUsageEventListener into the EventService  -->
    <bean class="org.dspace.statistics.SolrLoggerUsageEventListener">
        <property name="eventService" >
            <ref bean="dspace.eventService"/>
        </property>
    </bean>

    <!-- Google Analytics recording  -->
    <bean class="org.dspace.google.GoogleRecorderEventListener">
        <property name="eventService" >
            <ref bean="dspace.eventService"/>
        </property>
    </bean>

    <!-- Elastic Search -->
    <!--<bean class="org.dspace.statistics.ElasticSearchLoggerEventListener">
        <property name="eventService">
            <ref bean="dspace.eventService" />
        </property>
    </bean>-->

    <!-- TabFileUsageEventListener -->
    <!-- Uncomment to enable TabFileUsageEventListener
    <bean class="org.dspace.usage.TabFileUsageEventListener">
        <property name="eventService" >
            <ref bean="dspace.eventService"/>
        </property>
    </bean>
    -->

    <!-- 
    Uncomment to enable PassiveUsageEventListener
    <bean class="org.dspace.app.statistics.PassiveUsageEventListener">
        <property name="eventService" >
            <ref bean="dspace.eventService"/>
        </property>
    </bean>
     -->
     
</beans>
