archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1412946 - in /archiva/trunk/archiva-modules/archiva-web: archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/ archiva-web-common/src/main/resources/META-INF/ archiva-webapp-js/src/main/webapp/WEB-INF/
Date Fri, 23 Nov 2012 16:32:47 GMT
Author: olamy
Date: Fri Nov 23 16:32:46 2012
New Revision: 1412946

URL: http://svn.apache.org/viewvc?rev=1412946&view=rev
Log:
 [MRM-1714] using LDAP can be configurable with the ui
add a new  userManager configured by archiva.

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java
    archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java?rev=1412946&r1=1412945&r2=1412946&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java
Fri Nov 23 16:32:46 2012
@@ -21,17 +21,20 @@ package org.apache.archiva.rest.services
 import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.ArchivaRuntimeConfiguration;
 import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin;
+import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.ArchivaRuntimeConfigurationService;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
 
 import javax.inject.Inject;
+import javax.inject.Named;
 
 /**
  * @author Olivier Lamy
  * @since 1.4-M4
  */
-@Service ( "archivaRuntimeConfigurationService#rest" )
+@Service ("archivaRuntimeConfigurationService#rest")
 public class DefaultArchivaRuntimeConfigurationService
     extends AbstractRestService
     implements ArchivaRuntimeConfigurationService
@@ -39,6 +42,10 @@ public class DefaultArchivaRuntimeConfig
     @Inject
     private ArchivaRuntimeConfigurationAdmin archivaRuntimeConfigurationAdmin;
 
+    @Inject
+    @Named ( value = "userManager#archiva" )
+    private UserManager userManager;
+
     public ArchivaRuntimeConfiguration getArchivaRuntimeConfigurationAdmin()
         throws ArchivaRestServiceException
     {
@@ -57,7 +64,18 @@ public class DefaultArchivaRuntimeConfig
     {
         try
         {
+            // has user manager impl changed ?
+            boolean userManagerChanged = !StringUtils.equals( archivaRuntimeConfiguration.getUserManagerImpl(),
+                                                             archivaRuntimeConfigurationAdmin.getArchivaRuntimeConfigurationAdmin().getUserManagerImpl()
);
             archivaRuntimeConfigurationAdmin.updateArchivaRuntimeConfiguration( archivaRuntimeConfiguration
);
+
+            if ( userManagerChanged )
+            {
+                log.info( "user manager impl changed to {} reload it",
+                          archivaRuntimeConfiguration.getUserManagerImpl() );
+                userManager.initialize();
+            }
+
             return Boolean.TRUE;
         }
         catch ( RepositoryAdminException e )

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml?rev=1412946&r1=1412945&r2=1412946&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml
Fri Nov 23 16:32:46 2012
@@ -34,7 +34,7 @@
        default-lazy-init="true">
 
   <context:annotation-config/>
-  <context:component-scan base-package="org.apache.archiva.web.spring, org.apache.archiva.web.startup,
org.apache.archiva.web.runtime, org.apache.archiva.web.api"/>
+  <context:component-scan base-package="org.apache.archiva.web.spring, org.apache.archiva.web.startup,
org.apache.archiva.web.runtime, org.apache.archiva.web.api,, org.apache.archiva.web.security"/>
 
   <util:properties id="archivaRuntimeProperties" location="classpath:application.properties"
/>
 

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml?rev=1412946&r1=1412945&r2=1412946&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml
Fri Nov 23 16:32:46 2012
@@ -136,7 +136,7 @@
     </property>
   </bean>
   
-
+  <alias name="userManager#archiva" alias="userManager#configurable"/>
     
     <!-- <component>
       <role>org.apache.archiva.webdav.util.MimeTypes</role>



Mime
View raw message