fix bean name

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1418311 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-12-07 13:54:13 +00:00
parent 32299d34e0
commit e43c57f742
4 changed files with 38 additions and 38 deletions

View File

@ -33,7 +33,7 @@ public class ArchivaRuntimeConfiguration
{
private String userManagerImpl = "jdo";
private ArchivaLdapConfiguration archivaLdapConfiguration;
private LdapConfiguration ldapConfiguration;
/**
* flag to know if redback configuration has been checked/migrated.
@ -57,14 +57,14 @@ public class ArchivaRuntimeConfiguration
this.userManagerImpl = userManagerImpl;
}
public ArchivaLdapConfiguration getArchivaLdapConfiguration()
public LdapConfiguration getLdapConfiguration()
{
return archivaLdapConfiguration;
return ldapConfiguration;
}
public void setArchivaLdapConfiguration( ArchivaLdapConfiguration archivaLdapConfiguration )
public void setLdapConfiguration( LdapConfiguration ldapConfiguration )
{
this.archivaLdapConfiguration = archivaLdapConfiguration;
this.ldapConfiguration = ldapConfiguration;
}
public boolean isMigratedFromRedbackConfiguration()
@ -96,7 +96,7 @@ public class ArchivaRuntimeConfiguration
{
return "ArchivaRuntimeConfiguration{" +
"userManagerImpl='" + userManagerImpl + '\'' +
", archivaLdapConfiguration=" + archivaLdapConfiguration +
", ldapConfiguration=" + ldapConfiguration +
", migratedFromRedbackConfiguration=" + migratedFromRedbackConfiguration +
", configurationProperties=" + configurationProperties +
'}';

View File

@ -26,8 +26,8 @@ import java.util.Map;
* @author Olivier Lamy
* @since 1.4-M4
*/
@XmlRootElement( name = "archivaLdapConfiguration" )
public class ArchivaLdapConfiguration
@XmlRootElement( name = "ldapConfiguration" )
public class LdapConfiguration
{
@ -81,7 +81,7 @@ public class ArchivaLdapConfiguration
*/
private Map<String, String> extraProperties = new HashMap<String, String>();
public ArchivaLdapConfiguration()
public LdapConfiguration()
{
// no op
}

View File

@ -20,10 +20,9 @@ package org.apache.archiva.admin.repository.runtime;
import net.sf.beanlib.provider.replicator.BeanReplicator;
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.ArchivaLdapConfiguration;
import org.apache.archiva.admin.model.beans.LdapConfiguration;
import org.apache.archiva.admin.model.beans.ArchivaRuntimeConfiguration;
import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin;
import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
import org.apache.archiva.configuration.ArchivaConfiguration;
import org.apache.archiva.configuration.Configuration;
import org.apache.archiva.configuration.IndeterminateConfigurationException;
@ -79,28 +78,28 @@ public class DefaultArchivaRuntimeConfigurationAdmin
// now ldap
ArchivaLdapConfiguration archivaLdapConfiguration =
archivaRuntimeConfiguration.getArchivaLdapConfiguration();
if ( archivaLdapConfiguration == null )
LdapConfiguration ldapConfiguration =
archivaRuntimeConfiguration.getLdapConfiguration();
if ( ldapConfiguration == null )
{
archivaLdapConfiguration = new ArchivaLdapConfiguration();
archivaRuntimeConfiguration.setArchivaLdapConfiguration( archivaLdapConfiguration );
ldapConfiguration = new LdapConfiguration();
archivaRuntimeConfiguration.setLdapConfiguration( ldapConfiguration );
}
archivaLdapConfiguration.setHostName(
ldapConfiguration.setHostName(
userConfiguration.getString( UserConfigurationKeys.LDAP_HOSTNAME, null ) );
archivaLdapConfiguration.setPort( userConfiguration.getInt( UserConfigurationKeys.LDAP_PORT, -1 ) );
archivaLdapConfiguration.setSsl(
ldapConfiguration.setPort( userConfiguration.getInt( UserConfigurationKeys.LDAP_PORT, -1 ) );
ldapConfiguration.setSsl(
userConfiguration.getBoolean( UserConfigurationKeys.LDAP_SSL, false ) );
archivaLdapConfiguration.setBaseDn(
ldapConfiguration.setBaseDn(
userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_BASEDN, null ) );
archivaLdapConfiguration.setContextFactory(
ldapConfiguration.setContextFactory(
userConfiguration.getString( UserConfigurationKeys.LDAP_CONTEX_FACTORY, null ) );
archivaLdapConfiguration.setBindDn(
ldapConfiguration.setBindDn(
userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_BINDDN, null ) );
archivaLdapConfiguration.setPassword(
ldapConfiguration.setPassword(
userConfiguration.getString( UserConfigurationKeys.LDAP_PASSWORD, null ) );
archivaLdapConfiguration.setAuthenticationMethod(
ldapConfiguration.setAuthenticationMethod(
userConfiguration.getString( UserConfigurationKeys.LDAP_AUTHENTICATION_METHOD, null ) );
archivaRuntimeConfiguration.setMigratedFromRedbackConfiguration( true );
@ -144,10 +143,10 @@ public class DefaultArchivaRuntimeConfigurationAdmin
{
ArchivaRuntimeConfiguration archivaRuntimeConfiguration = new BeanReplicator().replicateBean( runtimeConfiguration, ArchivaRuntimeConfiguration.class );
if (archivaRuntimeConfiguration.getArchivaLdapConfiguration() == null)
if (archivaRuntimeConfiguration.getLdapConfiguration() == null)
{
// prevent NPE
archivaRuntimeConfiguration.setArchivaLdapConfiguration( new ArchivaLdapConfiguration() );
archivaRuntimeConfiguration.setLdapConfiguration( new LdapConfiguration() );
}
return archivaRuntimeConfiguration;
@ -155,7 +154,8 @@ public class DefaultArchivaRuntimeConfigurationAdmin
private RedbackRuntimeConfiguration build( ArchivaRuntimeConfiguration archivaRuntimeConfiguration )
{
return new BeanReplicator().replicateBean( archivaRuntimeConfiguration, RedbackRuntimeConfiguration.class );
RedbackRuntimeConfiguration redbackRuntimeConfiguration = new BeanReplicator().replicateBean( archivaRuntimeConfiguration, RedbackRuntimeConfiguration.class );
return redbackRuntimeConfiguration;
}
// wrapper for UserConfiguration to intercept values (and store it not yet migrated
@ -199,19 +199,19 @@ public class DefaultArchivaRuntimeConfigurationAdmin
{
if ( UserConfigurationKeys.LDAP_HOSTNAME.equals( key ) )
{
return getArchivaRuntimeConfiguration().getArchivaLdapConfiguration().getHostName();
return getArchivaRuntimeConfiguration().getLdapConfiguration().getHostName();
}
if ( UserConfigurationKeys.LDAP_CONTEX_FACTORY.equals( key ) )
{
return getArchivaRuntimeConfiguration().getArchivaLdapConfiguration().getContextFactory();
return getArchivaRuntimeConfiguration().getLdapConfiguration().getContextFactory();
}
if ( UserConfigurationKeys.LDAP_PASSWORD.equals( key ) )
{
return getArchivaRuntimeConfiguration().getArchivaLdapConfiguration().getPassword();
return getArchivaRuntimeConfiguration().getLdapConfiguration().getPassword();
}
if ( UserConfigurationKeys.LDAP_AUTHENTICATION_METHOD.equals( key ) )
{
return getArchivaRuntimeConfiguration().getArchivaLdapConfiguration().getAuthenticationMethod();
return getArchivaRuntimeConfiguration().getLdapConfiguration().getAuthenticationMethod();
}
ArchivaRuntimeConfiguration conf = getArchivaRuntimeConfiguration();
@ -271,7 +271,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
{
if ( UserConfigurationKeys.LDAP_PORT.equals( key ) )
{
return getArchivaRuntimeConfiguration().getArchivaLdapConfiguration().getPort();
return getArchivaRuntimeConfiguration().getLdapConfiguration().getPort();
}
@ -327,7 +327,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
{
if ( UserConfigurationKeys.LDAP_SSL.equals( key ) )
{
return getArchivaRuntimeConfiguration().getArchivaLdapConfiguration().isSsl();
return getArchivaRuntimeConfiguration().getLdapConfiguration().isSsl();
}
ArchivaRuntimeConfiguration conf = getArchivaRuntimeConfiguration();
@ -378,11 +378,11 @@ public class DefaultArchivaRuntimeConfigurationAdmin
{
if ( UserConfigurationKeys.LDAP_BASEDN.equals( key ) )
{
return getArchivaRuntimeConfiguration().getArchivaLdapConfiguration().getBaseDn();
return getArchivaRuntimeConfiguration().getLdapConfiguration().getBaseDn();
}
if ( UserConfigurationKeys.LDAP_BINDDN.equals( key ) )
{
return getArchivaRuntimeConfiguration().getArchivaLdapConfiguration().getBindDn();
return getArchivaRuntimeConfiguration().getLdapConfiguration().getBindDn();
}
return userConfiguration.getConcatenatedList( key, defaultValue );
}

View File

@ -1167,11 +1167,11 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
configurationProperties=[];
}
return new ArchivaRuntimeConfiguration(data.userManagerImpl,mapArchivaLdapConfiguration(data.archivaLdapConfiguration),data.migratedFromRedbackConfiguration,
return new ArchivaRuntimeConfiguration(data.userManagerImpl,mapLdapConfiguration(data.ldapConfiguration),data.migratedFromRedbackConfiguration,
configurationProperties);
}
ArchivaLdapConfiguration=function(hostName,port,ssl,baseDn,contextFactory,bindDn,password,authenticationMethod,
LdapConfiguration=function(hostName,port,ssl,baseDn,contextFactory,bindDn,password,authenticationMethod,
extraProperties){
//private String hostName;
this.hostName=ko.observable(hostName);
@ -1201,7 +1201,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
this.extraProperties=ko.observableArray(extraProperties);
}
mapArchivaLdapConfiguration=function(data){
mapLdapConfiguration=function(data){
if(data){
var extraProperties = data.extraProperties == null ? []: $.each(data.extraProperties,function(item){
return new Entry(item.key, item.value);