88 lines
4.2 KiB
XML
88 lines
4.2 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
~ Copyright 2005-2013 the original author or authors.
|
|
~
|
|
~ Licensed 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.
|
|
-->
|
|
|
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xmlns:context="http://www.springframework.org/schema/context"
|
|
xmlns:ldap="http://www.springframework.org/schema/ldap"
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd">
|
|
|
|
<context:property-placeholder location="classpath:/ldap.properties" system-properties-mode="OVERRIDE" />
|
|
<context:annotation-config />
|
|
|
|
<ldap:context-source id="contextSource"
|
|
password="${sample.ldap.password}"
|
|
url="${sample.ldap.url}"
|
|
username="${sample.ldap.userDn}"
|
|
base="${sample.ldap.base}" />
|
|
|
|
<ldap:ldap-template id="ldapTemplate" context-source-ref="contextSource"/>
|
|
|
|
<!--
|
|
This will scan the org.springframework.ldap.samples.useradmin.domain package for interfaces
|
|
extending CrudRepository (in our case, LdapRepository), automatically creating repository
|
|
beans based on these interfaces.
|
|
-->
|
|
<ldap:repositories base-package="org.springframework.ldap.samples.useradmin.domain" />
|
|
|
|
<!--
|
|
This one will never be referenced directly, but the ldap:repositories tag will make sure
|
|
it will be 'wired in', because the GroupRepo interface extends from an interface that GroupRepoImpl
|
|
imlements.
|
|
-->
|
|
<bean class="org.springframework.ldap.samples.useradmin.domain.impl.GroupRepoImpl" />
|
|
|
|
<bean class="org.springframework.ldap.samples.useradmin.domain.impl.DepartmentRepoImpl" />
|
|
|
|
<bean class="org.springframework.ldap.samples.useradmin.service.UserService">
|
|
<property name="directoryType" value="${sample.ldap.directory.type}" />
|
|
</bean>
|
|
|
|
<!-- Required to make sure BaseLdapName is populated in UserService -->
|
|
<bean class="org.springframework.ldap.core.support.BaseLdapPathBeanPostProcessor" />
|
|
|
|
<beans profile="default">
|
|
<!-- Populates the LDAP server with initial data -->
|
|
<bean class="org.springframework.ldap.test.LdifPopulator" depends-on="embeddedLdapServer">
|
|
<property name="contextSource" ref="contextSource" />
|
|
<property name="resource" value="classpath:/setup_data.ldif" />
|
|
<property name="base" value="${sample.ldap.base}" />
|
|
<property name="clean" value="${sample.ldap.clean}" />
|
|
</bean>
|
|
|
|
<!--
|
|
This is for test and demo purposes only - EmbeddedLdapServerFactoryBean launches an in-process
|
|
LDAP server.
|
|
-->
|
|
<bean id="embeddedLdapServer" class="org.springframework.ldap.test.EmbeddedLdapServerFactoryBean">
|
|
<property name="partitionName" value="example"/>
|
|
<property name="partitionSuffix" value="${sample.ldap.base}" />
|
|
<property name="port" value="18880" />
|
|
</bean>
|
|
</beans>
|
|
|
|
<beans profile="no-apacheds">
|
|
<!-- Populates the LDAP server with initial data -->
|
|
<bean class="org.springframework.ldap.test.LdifPopulator">
|
|
<property name="contextSource" ref="contextSource" />
|
|
<property name="resource" value="classpath:/setup_data.ldif" />
|
|
<property name="base" value="${sample.ldap.base}" />
|
|
<property name="clean" value="${sample.ldap.clean}" />
|
|
</bean>
|
|
</beans>
|
|
</beans>
|