<?xml version="1.0" encoding="ISO-8859-1"?>
<!--

    Copyright (C) 2009 eXo Platform SAS.
    
    This is free software; you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation; either version 2.1 of
    the License, or (at your option) any later version.
    
    This software is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    Lesser General Public License for more details.
    
    You should have received a copy of the GNU Lesser General Public
    License along with this software; if not, write to the Free
    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
    02110-1301 USA, or see the FSF site: http://www.fsf.org.

-->

<configuration
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
   xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
	<component>
  	<key>org.exoplatform.services.ldap.LDAPService</key>
		<type>org.exoplatform.services.ldap.impl.LDAPServiceImpl</type>
    <init-params>
      <object-param>
        <name>ldap.config</name>
        <description>Default ldap config</description>
        <object type="org.exoplatform.services.ldap.impl.LDAPConnectionConfig">         
	  		 <!-- for multiple ldap servers, use comma seperated list of host:port (Ex. ldap://127.0.0.1:389,10.0.0.1:389) -->
	  		 <!-- whether or not to enable ssl, if ssl is used ensure that the javax.net.ssl.keyStore & java.net.ssl.keyStorePassword properties are set -->
	  		 <!-- exo portal default installed javax.net.ssl.trustStore with file is java.home/lib/security/cacerts-->
	  		 <!-- ldap service will check protocol, if protocol is ldaps, ssl is enable (Ex. for enable ssl: ldaps://10.0.0.3:636 ;for disable ssl: ldap://10.0.0.3:389 ) -->
	  		 <!-- when enable ssl, ensure server name is *.directory and port (Ex. active.directory) -->	  		 
	       <field  name="providerURL"><string>ldaps://10.0.0.3:636</string></field>
 	       <field  name="rootdn"><string>CN=Administrator,CN=Users, DC=exoplatform,DC=org</string></field>
	       <field  name="password"><string>site</string></field>
 		
	       <field  name="version"><string>3</string></field>
	        
  	     <field  name="minConnection"><int>5</int></field>
  	      
    	   <field  name="maxConnection"><int>10</int></field>    	
    	    
    	   <field  name="referralMode"><string>ignore</string></field>     	   
    	       
    	   <field  name="serverName"><string>active.directory</string></field>
    	       	  
      	</object>
      </object-param>
    </init-params>
  </component>
    
  <component>
    <key>org.exoplatform.services.organization.OrganizationService</key>
    <type>org.exoplatform.services.organization.ldap.OrganizationServiceImpl</type>
    <component-plugins>
	    <component-plugin>
	      <name>init.service.listener</name>
	      <set-method>addListenerPlugin</set-method>
	      <type>org.exoplatform.services.organization.ldap.OrganizationLdapInitializer</type>
	      <description>this listener populate organization ldap service create default dn</description>      
	    </component-plugin>  
    </component-plugins> 
    <init-params>           
      <object-param>
        <name>ldap.attribute.mapping</name>
        <description>ldap attribute mapping</description>
        <object type="org.exoplatform.services.organization.ldap.LDAPAttributeMapping">                
          <field  name="userLDAPClasses"><string>top,person,organizationalPerson,user</string></field>
          <field  name="profileLDAPClasses"><string>top,organizationalPerson</string></field>
          <field  name="groupLDAPClasses"><string>top,organizationalUnit</string></field>
          <field  name="membershipTypeLDAPClasses"><string>top,group</string></field>
          <field  name="membershipLDAPClasses"><string>top,group</string></field>
          
          <field  name="baseURL"><string>dc=exoplatform,dc=org</string></field>
          <field  name="groupsURL"><string>ou=groups,ou=portal,dc=exoplatform,dc=org</string></field>
          <field  name="membershipTypeURL"><string>ou=memberships,ou=portal,dc=exoplatform,dc=org</string></field>
          <field  name="userURL"><string>ou=users,ou=portal,dc=exoplatform,dc=org</string></field>
          <field  name="profileURL"><string>ou=profiles,ou=portal,dc=exoplatform,dc=org</string></field>
          
          <field  name="userUsernameAttr"><string>sAMAccountName</string></field>
          <field  name="userPassword"><string>unicodePwd</string></field> 
          <!--unicodePwd-->
          <field  name="userFirstNameAttr"><string>givenName</string></field>
          <field  name="userLastNameAttr"><string>sn</string></field>
          <field  name="userDisplayNameAttr"><string>displayName</string></field>
          <field  name="userMailAttr"><string>mail</string></field>
          <field  name="userObjectClassFilter"><string>objectClass=user</string></field>
          
          <field  name="membershipTypeMemberValue"><string>member</string></field>
          <field  name="membershipTypeRoleNameAttr"><string>cn</string></field>
          <field  name="membershipTypeNameAttr"><string>cn</string></field>
          <field  name="membershipTypeObjectClassFilter"><string>objectClass=group</string></field>
          <field  name="membershiptypeObjectClass"><string>group</string></field>
          
          <field  name="groupObjectClass"><string>organizationalUnit</string></field>
          <field  name="groupObjectClassFilter"><string>objectClass=organizationalUnit</string></field>
          
          <field  name="membershipObjectClass"><string>group</string></field>
          <field  name="membershipObjectClassFilter"><string>objectClass=group</string></field>

          <field  name="ldapCreatedTimeStampAttr"><string>createdTimeStamp</string></field>
          <field  name="ldapModifiedTimeStampAttr"><string>modifiedTimeStamp</string></field>
          <field  name="ldapDescriptionAttr"><string>description</string></field>
        </object>
      </object-param>        
    </init-params>     
  </component>  
  
  <!--external-component-plugins>
    <target-component>org.exoplatform.services.database.HibernateService</target-component>
    <component-plugin> 
      <name>add.hibernate.mapping</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
      <init-params>
        <values-param>
          <name>hibernate.mapping</name>          
          <value>org/exoplatform/services/organization/impl/UserProfileData.hbm.xml</value>
        </values-param>
      </init-params>
    </component-plugin>
   </external-component-plugins-->
   
   <import>classpath:/conf/portal/organization-configuration.xml</import>   
</configuration>
