]> source.dussan.org Git - archiva.git/commitdiff
add baseGroupDn in archiva configuration
authorOlivier Lamy <olamy@apache.org>
Mon, 11 Feb 2013 17:13:06 +0000 (17:13 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 11 Feb 2013 17:13:06 +0000 (17:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1444880 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/LdapConfiguration.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSystemStatusService.java

index 31c57cd65b2a7dfadce449422c0b6ced90abe6e9..49a858bc212ced7522b2ad6496a19ffcd81ba011 100644 (file)
           <version>1.4.0+</version>
           <type>String</type>
         </field>
+        <field>
+          <name>baseGroupsDn</name>
+          <description>The LDAP base dn for groups (if empty baseDn is used).</description>
+          <version>1.4.0+</version>
+          <type>String</type>
+        </field>
         <field>
           <name>contextFactory</name>
           <description>contextFactory to use.</description>
index f41c7dfb9224d9bf0c81be954080a71a69e50777..eba93395d96c26e5af64f23b331bfba64e12b787 100644 (file)
@@ -65,6 +65,11 @@ public class LdapConfiguration
      */
     private String bindDn;
 
+    /**
+     * The LDAP base dn for groups (if empty baseDn is used).
+     */
+    private String baseGroupsDn;
+
     /**
      * The LDAP password.
      */
@@ -216,4 +221,14 @@ public class LdapConfiguration
             }
         }
     }
+
+    public String getBaseGroupsDn()
+    {
+        return baseGroupsDn;
+    }
+
+    public void setBaseGroupsDn( String baseGroupsDn )
+    {
+        this.baseGroupsDn = baseGroupsDn;
+    }
 }
index 36116b0dd52db74f6e4359456c2c649c5df3f975..ebb117e064c506d1e5596df5c4c339a2d4f72103 100644 (file)
@@ -49,7 +49,7 @@ import java.util.Set;
  * @author Olivier Lamy
  * @since 1.4-M4
  */
-@Service( "userConfiguration#archiva" )
+@Service("userConfiguration#archiva")
 public class DefaultRedbackRuntimeConfigurationAdmin
     implements RedbackRuntimeConfigurationAdmin, UserConfiguration
 {
@@ -60,11 +60,11 @@ public class DefaultRedbackRuntimeConfigurationAdmin
     private ArchivaConfiguration archivaConfiguration;
 
     @Inject
-    @Named( value = "userConfiguration#redback" )
+    @Named(value = "userConfiguration#redback")
     UserConfiguration userConfiguration;
 
     @Inject
-    @Named( value = "cache#users" )
+    @Named(value = "cache#users")
     private Cache usersCache;
 
     @PostConstruct
@@ -118,6 +118,11 @@ public class DefaultRedbackRuntimeConfigurationAdmin
                 ldapConfiguration.setSsl( userConfiguration.getBoolean( UserConfigurationKeys.LDAP_SSL, false ) );
                 ldapConfiguration.setBaseDn(
                     userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_BASEDN, null ) );
+
+                ldapConfiguration.setBaseGroupsDn(
+                    userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_GROUPS_BASEDN,
+                                                           ldapConfiguration.getBaseDn() ) );
+
                 ldapConfiguration.setContextFactory(
                     userConfiguration.getString( UserConfigurationKeys.LDAP_CONTEX_FACTORY, null ) );
                 ldapConfiguration.setBindDn(
@@ -520,6 +525,10 @@ public class DefaultRedbackRuntimeConfigurationAdmin
         {
             return getRedbackRuntimeConfiguration().getLdapConfiguration().getBindDn();
         }
+        if ( UserConfigurationKeys.LDAP_GROUPS_BASEDN.equals( key ) )
+        {
+            return getRedbackRuntimeConfiguration().getLdapConfiguration().getBaseGroupsDn();
+        }
         return userConfiguration.getConcatenatedList( key, defaultValue );
     }
 
index 80bf050d3450930550f5f1b9898b57683cb6e1e2..6c7558e676f0474600e8704a4d503d2b54d7ac92 100644 (file)
@@ -35,6 +35,7 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.stereotype.Service;
 
 import javax.inject.Inject;
+import javax.inject.Named;
 import javax.ws.rs.core.Response;
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
@@ -63,6 +64,9 @@ public class DefaultSystemStatusService
 
     private RepositoryScanner scanner;
 
+    // display spring scheduled
+    //@Inject @Named (value="springScheduler");
+
 
     @Inject
     public DefaultSystemStatusService( ApplicationContext applicationContext, RepositoryScanner scanner )