<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
  "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
  <bean id="environment" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
    <property name="properties">
    	<props>
    		<prop key="asn.1.berlib.provider">org.apache.ldap.common.berlib.asn1.SnickersProvider</prop>
    		<prop key="java.naming.security.authentication">simple</prop>
    		<prop key="java.naming.security.principal">uid=admin,ou=system</prop>
    		<prop key="java.naming.security.credentials">secret</prop>
    		<!--
    		<prop key="java.naming.ldap.attributes.binary"></prop>
    		-->
    	</props>
    </property>
  </bean>
  
  <bean id="configuration" class="org.apache.ldap.server.configuration.MutableServerStartupConfiguration">
    <property name="workingDirectory"><value>var/data</value></property>
    <property name="allowAnonymousAccess"><value>true</value></property>
    <property name="ldapPort"><value>20391</value></property>
    <property name="authenticatorConfigurations">
      <set>
        <ref bean="simpleAuthenticatorConfiguration"/>
      </set>
    </property>
    <property name="contextPartitionConfigurations">
      <set>
        <ref bean="dummyPartitionConfiguration"/>
      </set>
    </property>
    <property name="bootstrapSchemas">
      <set>
        <bean class="org.apache.ldap.server.schema.bootstrap.AutofsSchema"/>
        <bean class="org.apache.ldap.server.schema.bootstrap.CorbaSchema"/>
        <bean class="org.apache.ldap.server.schema.bootstrap.CoreSchema"/>
		<!-- Caused problem due to JXplorer contributing pilotObject which referenced different attr names -->
        <bean class="org.apache.ldap.server.schema.bootstrap.CosineSchema"/>
        <bean class="org.apache.ldap.server.schema.bootstrap.ApacheSchema"/>
        <bean class="org.apache.ldap.server.schema.bootstrap.InetorgpersonSchema"/>
        <bean class="org.apache.ldap.server.schema.bootstrap.JavaSchema"/>
        <bean class="org.apache.ldap.server.schema.bootstrap.Krb5kdcSchema"/>
        <bean class="org.apache.ldap.server.schema.bootstrap.NisSchema"/>
        <bean class="org.apache.ldap.server.schema.bootstrap.SystemSchema"/>
      </set>
    </property>
    
    <property name="interceptorConfigurations">
      <list>
        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
          <property name="name"><value>normalizationService</value></property>
          <property name="interceptor">
            <bean class="org.apache.ldap.server.normalization.NormalizationService" />
          </property>
        </bean>
        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
          <property name="name"><value>authenticationService</value></property>
          <property name="interceptor">
            <bean class="org.apache.ldap.server.authn.AuthenticationService" />
          </property>
        </bean>
        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
          <property name="name"><value>authorizationService</value></property>
          <property name="interceptor">
            <bean class="org.apache.ldap.server.authz.AuthorizationService" />
          </property>
        </bean>
        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
          <property name="name"><value>exceptionService</value></property>
          <property name="interceptor">
            <bean class="org.apache.ldap.server.exception.ExceptionService" />
          </property>
        </bean>
        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
          <property name="name"><value>schemaService</value></property>
          <property name="interceptor">
            <bean class="org.apache.ldap.server.schema.SchemaService" />
          </property>
        </bean>
        <bean class="org.apache.ldap.server.configuration.MutableInterceptorConfiguration">
          <property name="name"><value>operationalAttributeService</value></property>
          <property name="interceptor">
            <bean class="org.apache.ldap.server.operational.OperationalAttributeService" />
          </property>
        </bean>
      </list>
    </property>
  </bean>

<!--  <bean id="penrose" class="org.safehaus.penrose.Penrose">-->
<!--    <property name="rootDn"><value>uid=admin,ou=system</value></property>-->
<!--    <property name="rootPassword"><value>secret</value></property>-->
<!--  </bean>-->

  <bean id="simpleAuthenticatorConfiguration" class="org.apache.ldap.server.configuration.MutableAuthenticatorConfiguration">
    <property name="name"><value>simple</value></property>
    <property name="authenticator">
      <bean class="org.apache.ldap.server.authn.SimpleAuthenticator">
      </bean>
    </property>
  </bean>

  <bean id="dummyPartitionConfiguration" class="org.apache.ldap.server.configuration.MutableContextPartitionConfiguration">
    <property name="name"><value>dummy</value></property>
      <property name="suffix"><value>dc=dummy</value></property>
    <property name="contextPartition">
      <bean class="dummy.test.DummyProxyPartition">
      </bean>
    </property>
    <property name="indexedAttributes">
      <set>
        <value>objectClass</value>
        <value>ou</value>
        <value>uid</value>
      </set>
    </property>
    <property name="contextEntry">
      <value>
        objectClass: top
        objectClass: domain
        objectClass: extensibleObject
        dc: dummy
      </value>
    </property>
  </bean>

  <bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
    <property name="customEditors">
      <map>
        <entry key="javax.naming.directory.Attributes">
          <bean class="org.apache.ldap.server.configuration.AttributesPropertyEditor"/>
        </entry>
      </map>
   </property>
  </bean>
</beans>