DATALDAP-1 - Create namespace handler and XML schema.
Spring Data LDAP now uses its own Namespace: http://www.springframework.org/schema/data/ldap. Using XML configuration for Spring LDAP and Spring Data LDAP requires both namespaces to be declared. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ldap="http://www.springframework.org/schema/ldap" xmlns:data-ldap="http://www.springframework.org/schema/data/ldap" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd http://www.springframework.org/schema/data/ldap http://www.springframework.org/schema/data/ldap/spring-ldap.xsd"> <ldap:context-source password="apassword" url="ldap://localhost:389" username="uid=admin"/> <ldap:ldap-template/> <data-ldap:repositories base-package="org.springframework.data.ldap.config"/> </beans>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
package org.springframework.data.ldap.config;
|
||||
|
||||
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
|
||||
import org.springframework.data.ldap.repository.config.LdapRepositoryConfigurationExtension;
|
||||
import org.springframework.data.repository.config.RepositoryBeanDefinitionParser;
|
||||
|
||||
/**
|
||||
* {@link org.springframework.beans.factory.xml.NamespaceHandler} for LDAP configuration.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public class LdapNamespaceHandler extends NamespaceHandlerSupport {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.xml.NamespaceHandler#init()
|
||||
*/
|
||||
public void init() {
|
||||
|
||||
registerBeanDefinitionParser("repositories",
|
||||
new RepositoryBeanDefinitionParser(new LdapRepositoryConfigurationExtension()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user