Do what it takes to let it compile. (The I want to get out of the critical path approach)

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@531751 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Joakim Erdfelt 2007-04-24 05:42:25 +00:00
parent b4d57ec324
commit f34cf2e6c0
21 changed files with 283 additions and 337 deletions

View File

@ -32,6 +32,7 @@
<dependency> <dependency>
<groupId>org.apache.maven.archiva</groupId> <groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-consumer-api</artifactId> <artifactId>archiva-consumer-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven.archiva</groupId> <groupId>org.apache.maven.archiva</groupId>

View File

@ -21,6 +21,7 @@ package org.apache.maven.archiva.proxy;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.ConfigurationNames;
import org.apache.maven.archiva.configuration.NetworkProxyConfiguration; import org.apache.maven.archiva.configuration.NetworkProxyConfiguration;
import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
import org.apache.maven.archiva.configuration.RepositoryConfiguration; import org.apache.maven.archiva.configuration.RepositoryConfiguration;
@ -105,8 +106,6 @@ public class DefaultRepositoryProxyConnectors
private Map networkProxyMap = new HashMap(); private Map networkProxyMap = new HashMap();
private List propertyNameTriggers = new ArrayList();
public File fetchFromProxies( ArchivaRepository repository, ArtifactReference artifact ) public File fetchFromProxies( ArchivaRepository repository, ArtifactReference artifact )
throws ProxyException throws ProxyException
{ {
@ -629,7 +628,8 @@ public class DefaultRepositoryProxyConnectors
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
{ {
if ( propertyNameTriggers.contains( propertyName ) ) if ( ConfigurationNames.isNetworkProxy( propertyName ) || ConfigurationNames.isRepositories( propertyName )
|| ConfigurationNames.isProxyConnector( propertyName ) )
{ {
initConnectorsAndNetworkProxies(); initConnectorsAndNetworkProxies();
} }
@ -743,37 +743,6 @@ public class DefaultRepositoryProxyConnectors
public void initialize() public void initialize()
throws InitializationException throws InitializationException
{ {
propertyNameTriggers.add( "repositories" );
propertyNameTriggers.add( "repository" );
propertyNameTriggers.add( "id" );
propertyNameTriggers.add( "name" );
propertyNameTriggers.add( "url" );
propertyNameTriggers.add( "layout" );
propertyNameTriggers.add( "releases" );
propertyNameTriggers.add( "snapshots" );
propertyNameTriggers.add( "indexed" );
propertyNameTriggers.add( "proxyConnectors" );
propertyNameTriggers.add( "proxyConnector" );
propertyNameTriggers.add( "sourceRepoId" );
propertyNameTriggers.add( "targetRepoId" );
propertyNameTriggers.add( "proxyId" );
propertyNameTriggers.add( "snapshotsPolicy" );
propertyNameTriggers.add( "releasePolicy" );
propertyNameTriggers.add( "checksumPolicy" );
propertyNameTriggers.add( "whiteListPatterns" );
propertyNameTriggers.add( "whiteListPattern" );
propertyNameTriggers.add( "blackListPatterns" );
propertyNameTriggers.add( "blackListPattern" );
propertyNameTriggers.add( "networkProxies" );
propertyNameTriggers.add( "networkProxy" );
propertyNameTriggers.add( "protocol" );
propertyNameTriggers.add( "host" );
propertyNameTriggers.add( "port" );
propertyNameTriggers.add( "username" );
propertyNameTriggers.add( "password" );
archivaConfiguration.addChangeListener( this ); archivaConfiguration.addChangeListener( this );
initConnectorsAndNetworkProxies(); initConnectorsAndNetworkProxies();
} }

View File

@ -61,8 +61,15 @@ public class LegacyArtifactExtensionMapping
return "jar"; return "jar";
} }
else else
{
if ( pathType.endsWith( "s" ) )
{
return pathType.substring( 0, pathType.length() - 1 );
}
else
{ {
return pathType; return pathType;
} }
} }
} }
}

View File

@ -205,8 +205,8 @@ public class LegacyBidirectionalRepositoryLayout
if ( !prefs.type.equals( prefs.fileParts.extension ) ) if ( !prefs.type.equals( prefs.fileParts.extension ) )
{ {
throw new LayoutException( "Invalid artifact, mismatch on extension <" + prefs.fileParts.extension throw new LayoutException( "Invalid artifact, mismatch on extension <" + prefs.fileParts.extension
+ "> and expected layout specified type <" + prefs.type + "> and expected layout specified type <" + prefs.pathType + "> (mapped type: <" + prefs.type
+ "> (mapped from actual path provided type <" + prefs.pathType + ">)" ); + ">) on path <" + path + ">" );
} }
} }

View File

@ -30,6 +30,42 @@
<packaging>war</packaging> <packaging>war</packaging>
<name>Archiva Web :: Application</name> <name>Archiva Web :: Application</name>
<dependencies> <dependencies>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-report-manager</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-scheduled</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-indexer</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-proxy</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-database</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-repository-layer</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-security</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-applet</artifactId>
<!-- TODO: actually, just exclude from WAR plugin -->
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>servlet-api</artifactId>
@ -126,28 +162,6 @@
<groupId>org.codehaus.plexus</groupId> <groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId> <artifactId>plexus-container-default</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-proxy</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-database</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-repository-layer</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-security</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-applet</artifactId>
<!-- TODO: actually, just exclude from WAR plugin -->
<scope>provided</scope>
</dependency>
<!-- Plexus Security Dependencies --> <!-- Plexus Security Dependencies -->
<dependency> <dependency>
<groupId>org.codehaus.plexus.security</groupId> <groupId>org.codehaus.plexus.security</groupId>

View File

@ -1,47 +0,0 @@
package org.apache.maven.archiva.web.action;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.ConfiguredRepositoryFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.codehaus.plexus.xwork.action.PlexusActionSupport;
public abstract class AbstractConfiguredAction
extends PlexusActionSupport
{
/**
* @plexus.requirement
*/
private ConfiguredRepositoryFactory repositoryFactory;
/**
* @plexus.requirement
*/
private ArchivaConfiguration archivaConfiguration;
protected ArtifactRepository createLocalRepository()
{
Configuration configuration = archivaConfiguration.getConfiguration();
return repositoryFactory.createLocalRepository( configuration );
}
}

View File

@ -21,7 +21,7 @@ package org.apache.maven.archiva.web.action.admin;
import com.opensymphony.xwork.ModelDriven; import com.opensymphony.xwork.ModelDriven;
import com.opensymphony.xwork.Preparable; import com.opensymphony.xwork.Preparable;
import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration; //import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration;
import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.InvalidConfigurationException; import org.apache.maven.archiva.configuration.InvalidConfigurationException;
@ -60,7 +60,7 @@ public abstract class AbstractConfigureRepositoryAction
/** /**
* The repository. * The repository.
*/ */
private AbstractRepositoryConfiguration repository; // private AbstractRepositoryConfiguration repository;
/** /**
* The repository ID to lookup when editing a repository. * The repository ID to lookup when editing a repository.
@ -77,12 +77,12 @@ public abstract class AbstractConfigureRepositoryAction
{ {
// TODO: if this didn't come from the form, go to configure.action instead of going through with re-saving what was just loaded // TODO: if this didn't come from the form, go to configure.action instead of going through with re-saving what was just loaded
AbstractRepositoryConfiguration existingRepository = getRepository( repository.getId() ); // AbstractRepositoryConfiguration existingRepository = getRepository( repository.getId() );
if ( existingRepository != null ) // if ( existingRepository != null )
{ // {
addFieldError( "id", "A repository with that id already exists" ); // addFieldError( "id", "A repository with that id already exists" );
return INPUT; // return INPUT;
} // }
return saveConfiguration(); return saveConfiguration();
} }
@ -92,15 +92,15 @@ public abstract class AbstractConfigureRepositoryAction
{ {
// TODO: if this didn't come from the form, go to configure.action instead of going through with re-saving what was just loaded // TODO: if this didn't come from the form, go to configure.action instead of going through with re-saving what was just loaded
AbstractRepositoryConfiguration existingRepository = getRepository( repository.getId() ); // AbstractRepositoryConfiguration existingRepository = getRepository( repository.getId() );
removeRepository( existingRepository ); // removeRepository( existingRepository );
return saveConfiguration(); return saveConfiguration();
} }
protected abstract void removeRepository( AbstractRepositoryConfiguration existingRepository ); // protected abstract void removeRepository( AbstractRepositoryConfiguration existingRepository );
//
protected abstract AbstractRepositoryConfiguration getRepository( String id ); // protected abstract AbstractRepositoryConfiguration getRepository( String id );
private String saveConfiguration() private String saveConfiguration()
throws IOException, InvalidConfigurationException, RbacManagerException, RoleProfileException, RegistryException throws IOException, InvalidConfigurationException, RbacManagerException, RoleProfileException, RegistryException
@ -126,23 +126,24 @@ public abstract class AbstractConfigureRepositoryAction
public Object getModel() public Object getModel()
{ {
return repository; return new Object();
// return repository;
} }
protected abstract AbstractRepositoryConfiguration createRepository(); // protected abstract AbstractRepositoryConfiguration createRepository();
public void prepare() public void prepare()
{ {
configuration = archivaConfiguration.getConfiguration(); configuration = archivaConfiguration.getConfiguration();
if ( repository == null ) // if ( repository == null )
{ // {
repository = getRepository( repoId ); // repository = getRepository( repoId );
} // }
if ( repository == null ) // if ( repository == null )
{ // {
repository = createRepository(); // repository = createRepository();
} // }
} }
public String getRepoId() public String getRepoId()
@ -155,10 +156,10 @@ public abstract class AbstractConfigureRepositoryAction
this.repoId = repoId; this.repoId = repoId;
} }
protected AbstractRepositoryConfiguration getRepository() // protected AbstractRepositoryConfiguration getRepository()
{ // {
return repository; // return repository;
} // }
public Configuration getConfiguration() public Configuration getConfiguration()
{ {

View File

@ -19,7 +19,7 @@ package org.apache.maven.archiva.web.action.admin;
* under the License. * under the License.
*/ */
import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration; //import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration;
import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.InvalidConfigurationException; import org.apache.maven.archiva.configuration.InvalidConfigurationException;
@ -72,35 +72,35 @@ public abstract class AbstractDeleteRepositoryAction
{ {
Configuration configuration = archivaConfiguration.getConfiguration(); Configuration configuration = archivaConfiguration.getConfiguration();
AbstractRepositoryConfiguration existingRepository = getRepository( configuration ); // AbstractRepositoryConfiguration existingRepository = getRepository( configuration );
if ( existingRepository == null ) // if ( existingRepository == null )
{ // {
addActionError( "A repository with that id does not exist" ); // addActionError( "A repository with that id does not exist" );
return ERROR; // return ERROR;
} // }
//
// TODO: remove from index too! // // TODO: remove from index too!
//
removeRepository( configuration, existingRepository ); // removeRepository( configuration, existingRepository );
//
archivaConfiguration.save( configuration ); // archivaConfiguration.save( configuration );
//
if ( "delete-contents".equals( operation ) ) // if ( "delete-contents".equals( operation ) )
{ // {
removeContents( existingRepository ); // removeContents( existingRepository );
} // }
} }
return SUCCESS; return SUCCESS;
} }
protected abstract void removeContents( AbstractRepositoryConfiguration existingRepository ) // protected abstract void removeContents( AbstractRepositoryConfiguration existingRepository )
throws IOException; // throws IOException;
//
protected abstract AbstractRepositoryConfiguration getRepository( Configuration configuration ); // protected abstract AbstractRepositoryConfiguration getRepository( Configuration configuration );
//
protected abstract void removeRepository( Configuration configuration, // protected abstract void removeRepository( Configuration configuration,
AbstractRepositoryConfiguration existingRepository ); // AbstractRepositoryConfiguration existingRepository );
public String input() public String input()
{ {

View File

@ -28,7 +28,7 @@ import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.InvalidConfigurationException; import org.apache.maven.archiva.configuration.InvalidConfigurationException;
import org.apache.maven.archiva.indexer.RepositoryIndexException; import org.apache.maven.archiva.indexer.RepositoryIndexException;
import org.apache.maven.archiva.indexer.RepositoryIndexSearchException; import org.apache.maven.archiva.indexer.RepositoryIndexSearchException;
import org.apache.maven.archiva.repositories.ActiveManagedRepositories; //import org.apache.maven.archiva.repositories.ActiveManagedRepositories;
import org.apache.maven.archiva.security.ArchivaRoleConstants; import org.apache.maven.archiva.security.ArchivaRoleConstants;
import org.codehaus.plexus.registry.RegistryException; import org.codehaus.plexus.registry.RegistryException;
import org.codehaus.plexus.scheduler.CronExpressionValidator; import org.codehaus.plexus.scheduler.CronExpressionValidator;
@ -56,10 +56,10 @@ public class ConfigureAction
*/ */
private ArchivaConfiguration archivaConfiguration; private ArchivaConfiguration archivaConfiguration;
/** // /**
* @plexus.requirement // * @plexus.requirement
*/ // */
private ActiveManagedRepositories activeRepositories; // private ActiveManagedRepositories activeRepositories;
/** /**
* The configuration. * The configuration.
@ -101,19 +101,19 @@ public class ConfigureAction
{ {
// TODO: if this didn't come from the form, go to configure.action instead of going through with re-saving what was just loaded // TODO: if this didn't come from the form, go to configure.action instead of going through with re-saving what was just loaded
// TODO: if this is changed, do we move the index or recreate it? // TODO: if this is changed, do we move the index or recreate it?
configuration.setDataRefreshCronExpression( getCronExpression() ); // configuration.setDataRefreshCronExpression( getCronExpression() );
// Normalize the path // Normalize the path
File file = new File( configuration.getIndexPath() ); // File file = new File( configuration.getIndexPath() );
configuration.setIndexPath( file.getCanonicalPath() ); // configuration.setIndexPath( file.getCanonicalPath() );
if ( !file.exists() ) // if ( !file.exists() )
{ // {
file.mkdirs(); // file.mkdirs();
// TODO: error handling when this fails, or is not a directory! // // TODO: error handling when this fails, or is not a directory!
} // }
// Just double checking that our validation routines line up with what is expected in the configuration // Just double checking that our validation routines line up with what is expected in the configuration
assert configuration.isValid(); // assert configuration.isValid();
archivaConfiguration.save( configuration ); archivaConfiguration.save( configuration );
@ -126,7 +126,8 @@ public class ConfigureAction
public String input() public String input()
{ {
String[] cronEx = configuration.getDataRefreshCronExpression().split( " " ); // String[] cronEx = configuration.getDataRefreshCronExpression().split( " " );
String[] cronEx = new String[]{"0","0","*","*","*","*","*"};
int i = 0; int i = 0;
while ( i < cronEx.length ) while ( i < cronEx.length )
@ -158,11 +159,11 @@ public class ConfigureAction
i++; i++;
} }
if ( activeRepositories.getLastDataRefreshTime() != 0 ) // if ( activeRepositories.getLastDataRefreshTime() != 0 )
{ // {
lastIndexingTime = new Date( activeRepositories.getLastDataRefreshTime() ).toString(); // lastIndexingTime = new Date( activeRepositories.getLastDataRefreshTime() ).toString();
} // }
else // else
{ {
lastIndexingTime = "Never been run."; lastIndexingTime = "Never been run.";
} }

View File

@ -22,7 +22,7 @@ package org.apache.maven.archiva.web.action.admin;
import com.opensymphony.xwork.ModelDriven; import com.opensymphony.xwork.ModelDriven;
import com.opensymphony.xwork.Preparable; import com.opensymphony.xwork.Preparable;
import org.apache.maven.archiva.security.ArchivaRoleConstants; import org.apache.maven.archiva.security.ArchivaRoleConstants;
import org.apache.maven.archiva.web.action.AbstractConfiguredAction; //import org.apache.maven.archiva.web.action.AbstractConfiguredAction;
//import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
//import org.apache.maven.model.Model; //import org.apache.maven.model.Model;
//import org.apache.maven.project.ProjectBuildingException; //import org.apache.maven.project.ProjectBuildingException;
@ -34,6 +34,7 @@ import org.codehaus.plexus.security.rbac.Resource;
import org.codehaus.plexus.security.ui.web.interceptor.SecureAction; import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle; import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException; import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
import org.codehaus.plexus.xwork.action.PlexusActionSupport;
import java.io.IOException; import java.io.IOException;
@ -44,7 +45,7 @@ import java.io.IOException;
* role-hint="configureAppearance" * role-hint="configureAppearance"
*/ */
public class ConfigureAppearanceAction public class ConfigureAppearanceAction
extends AbstractConfiguredAction extends PlexusActionSupport
implements ModelDriven, SecureAction, Preparable implements ModelDriven, SecureAction, Preparable
{ {
// /** // /**

View File

@ -19,8 +19,8 @@ package org.apache.maven.archiva.web.action.admin;
* under the License. * under the License.
*/ */
import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration; //import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration;
import org.apache.maven.archiva.configuration.ProxiedRepositoryConfiguration; //import org.apache.maven.archiva.configuration.ProxiedRepositoryConfiguration;
import java.io.IOException; import java.io.IOException;
@ -32,26 +32,26 @@ import java.io.IOException;
public class ConfigureProxiedRepositoryAction public class ConfigureProxiedRepositoryAction
extends AbstractConfigureRepositoryAction extends AbstractConfigureRepositoryAction
{ {
protected void removeRepository( AbstractRepositoryConfiguration existingRepository ) // protected void removeRepository( AbstractRepositoryConfiguration existingRepository )
{ // {
configuration.removeProxiedRepository( (ProxiedRepositoryConfiguration) existingRepository ); // configuration.removeProxiedRepository( (ProxiedRepositoryConfiguration) existingRepository );
} // }
//
protected AbstractRepositoryConfiguration getRepository( String id ) // protected AbstractRepositoryConfiguration getRepository( String id )
{ // {
return configuration.getProxiedRepositoryById( id ); // return configuration.getProxiedRepositoryById( id );
} // }
protected void addRepository() protected void addRepository()
throws IOException throws IOException
{ {
ProxiedRepositoryConfiguration repository = (ProxiedRepositoryConfiguration) getRepository(); // ProxiedRepositoryConfiguration repository = (ProxiedRepositoryConfiguration) getRepository();
//
configuration.addProxiedRepository( repository ); // configuration.addProxiedRepository( repository );
} }
protected AbstractRepositoryConfiguration createRepository() // protected AbstractRepositoryConfiguration createRepository()
{ // {
return new ProxiedRepositoryConfiguration(); // return new ProxiedRepositoryConfiguration();
} // }
} }

View File

@ -19,7 +19,7 @@ package org.apache.maven.archiva.web.action.admin;
* under the License. * under the License.
*/ */
import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration; //import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration;
import org.apache.maven.archiva.configuration.RepositoryConfiguration; import org.apache.maven.archiva.configuration.RepositoryConfiguration;
import org.codehaus.plexus.rbac.profile.RoleProfileException; import org.codehaus.plexus.rbac.profile.RoleProfileException;
@ -34,42 +34,42 @@ import java.io.IOException;
public class ConfigureRepositoryAction public class ConfigureRepositoryAction
extends AbstractConfigureRepositoryAction extends AbstractConfigureRepositoryAction
{ {
protected void removeRepository( AbstractRepositoryConfiguration existingRepository ) // protected void removeRepository( AbstractRepositoryConfiguration existingRepository )
{ // {
configuration.removeRepository( (RepositoryConfiguration) existingRepository ); // configuration.removeRepository( (RepositoryConfiguration) existingRepository );
} // }
//
protected AbstractRepositoryConfiguration getRepository( String id ) // protected AbstractRepositoryConfiguration getRepository( String id )
{ // {
return configuration.getRepositoryById( id ); // return configuration.getRepositoryById( id );
} // }
protected void addRepository() protected void addRepository()
throws IOException, RoleProfileException throws IOException, RoleProfileException
{ {
RepositoryConfiguration repository = (RepositoryConfiguration) getRepository(); // RepositoryConfiguration repository = (RepositoryConfiguration) getRepository();
//
// Normalize the path // // Normalize the path
File file = new File( repository.getDirectory() ); // File file = new File( repository.getDirectory() );
repository.setDirectory( file.getCanonicalPath() ); // repository.setDirectory( file.getCanonicalPath() );
if ( !file.exists() ) // if ( !file.exists() )
{ // {
file.mkdirs(); // file.mkdirs();
// TODO: error handling when this fails, or is not a directory! // // TODO: error handling when this fails, or is not a directory!
// }
//
// configuration.addRepository( repository );
//
// // TODO: double check these are configured on start up
// roleProfileManager.getDynamicRole( "archiva-repository-manager", repository.getId() );
//
// roleProfileManager.getDynamicRole( "archiva-repository-observer", repository.getId() );
} }
configuration.addRepository( repository ); // protected AbstractRepositoryConfiguration createRepository()
// {
// TODO: double check these are configured on start up // RepositoryConfiguration repository = new RepositoryConfiguration();
roleProfileManager.getDynamicRole( "archiva-repository-manager", repository.getId() ); // repository.setIndexed( false );
// return repository;
roleProfileManager.getDynamicRole( "archiva-repository-observer", repository.getId() ); // }
}
protected AbstractRepositoryConfiguration createRepository()
{
RepositoryConfiguration repository = new RepositoryConfiguration();
repository.setIndexed( false );
return repository;
}
} }

View File

@ -19,8 +19,8 @@ package org.apache.maven.archiva.web.action.admin;
* under the License. * under the License.
*/ */
import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration; //import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration;
import org.apache.maven.archiva.configuration.SyncedRepositoryConfiguration; //import org.apache.maven.archiva.configuration.SyncedRepositoryConfiguration;
import java.io.IOException; import java.io.IOException;
@ -32,26 +32,26 @@ import java.io.IOException;
public class ConfigureSyncedRepositoryAction public class ConfigureSyncedRepositoryAction
extends AbstractConfigureRepositoryAction extends AbstractConfigureRepositoryAction
{ {
protected void removeRepository( AbstractRepositoryConfiguration existingRepository ) // protected void removeRepository( AbstractRepositoryConfiguration existingRepository )
{ // {
configuration.removeSyncedRepository( (SyncedRepositoryConfiguration) existingRepository ); // configuration.removeSyncedRepository( (SyncedRepositoryConfiguration) existingRepository );
} // }
//
protected AbstractRepositoryConfiguration getRepository( String id ) // protected AbstractRepositoryConfiguration getRepository( String id )
{ // {
return configuration.getSyncedRepositoryById( id ); // return configuration.getSyncedRepositoryById( id );
} // }
protected void addRepository() protected void addRepository()
throws IOException throws IOException
{ {
SyncedRepositoryConfiguration repository = (SyncedRepositoryConfiguration) getRepository(); // SyncedRepositoryConfiguration repository = (SyncedRepositoryConfiguration) getRepository();
//
configuration.addSyncedRepository( repository ); // configuration.addSyncedRepository( repository );
} }
protected AbstractRepositoryConfiguration createRepository() // protected AbstractRepositoryConfiguration createRepository()
{ // {
return new SyncedRepositoryConfiguration(); // return new SyncedRepositoryConfiguration();
} // }
} }

View File

@ -19,9 +19,9 @@ package org.apache.maven.archiva.web.action.admin;
* under the License. * under the License.
*/ */
import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration; //import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration;
import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.ProxiedRepositoryConfiguration; //import org.apache.maven.archiva.configuration.ProxiedRepositoryConfiguration;
import java.io.IOException; import java.io.IOException;
@ -33,19 +33,19 @@ import java.io.IOException;
public class DeleteProxiedRepositoryAction public class DeleteProxiedRepositoryAction
extends AbstractDeleteRepositoryAction extends AbstractDeleteRepositoryAction
{ {
protected AbstractRepositoryConfiguration getRepository( Configuration configuration ) // protected AbstractRepositoryConfiguration getRepository( Configuration configuration )
{ // {
return configuration.getProxiedRepositoryById( repoId ); // return configuration.getProxiedRepositoryById( repoId );
} // }
//
protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository ) // protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository )
{ // {
configuration.removeProxiedRepository( (ProxiedRepositoryConfiguration) existingRepository ); // configuration.removeProxiedRepository( (ProxiedRepositoryConfiguration) existingRepository );
} // }
//
protected void removeContents( AbstractRepositoryConfiguration existingRepository ) // protected void removeContents( AbstractRepositoryConfiguration existingRepository )
throws IOException // throws IOException
{ // {
// TODO! delete it // // TODO! delete it
} // }
} }

View File

@ -19,7 +19,7 @@ package org.apache.maven.archiva.web.action.admin;
* under the License. * under the License.
*/ */
import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration; //import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration;
import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.RepositoryConfiguration; import org.apache.maven.archiva.configuration.RepositoryConfiguration;
import org.codehaus.plexus.rbac.profile.RoleProfileException; import org.codehaus.plexus.rbac.profile.RoleProfileException;
@ -35,32 +35,32 @@ import java.io.IOException;
public class DeleteRepositoryAction public class DeleteRepositoryAction
extends AbstractDeleteRepositoryAction extends AbstractDeleteRepositoryAction
{ {
protected AbstractRepositoryConfiguration getRepository( Configuration configuration ) // protected AbstractRepositoryConfiguration getRepository( Configuration configuration )
{ // {
return configuration.getRepositoryById( repoId ); // return configuration.getRepositoryById( repoId );
} // }
//
protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository ) // protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository )
{ // {
configuration.removeRepository( (RepositoryConfiguration) existingRepository ); // configuration.removeRepository( (RepositoryConfiguration) existingRepository );
//
try // try
{ // {
removeRepositoryRoles( existingRepository ); // removeRepositoryRoles( existingRepository );
} // }
catch ( RoleProfileException e ) // catch ( RoleProfileException e )
{ // {
getLogger().error( "Error removing user roles associated with repository " + existingRepository.getId() ); // getLogger().error( "Error removing user roles associated with repository " + existingRepository.getId() );
} // }
} // }
//
protected void removeContents( AbstractRepositoryConfiguration existingRepository ) // protected void removeContents( AbstractRepositoryConfiguration existingRepository )
throws IOException // throws IOException
{ // {
RepositoryConfiguration repository = (RepositoryConfiguration) existingRepository; // RepositoryConfiguration repository = (RepositoryConfiguration) existingRepository;
getLogger().info( "Removing " + repository.getDirectory() ); // getLogger().info( "Removing " + repository.getDirectory() );
FileUtils.deleteDirectory( repository.getDirectory() ); // FileUtils.deleteDirectory( repository.getDirectory() );
} // }
/** /**
* Remove user roles associated with the repository * Remove user roles associated with the repository
@ -68,12 +68,12 @@ public class DeleteRepositoryAction
* @param existingRepository * @param existingRepository
* @throws RoleProfileException * @throws RoleProfileException
*/ */
private void removeRepositoryRoles( AbstractRepositoryConfiguration existingRepository ) // private void removeRepositoryRoles( AbstractRepositoryConfiguration existingRepository )
throws RoleProfileException // throws RoleProfileException
{ // {
roleProfileManager.deleteDynamicRole( "archiva-repository-manager", existingRepository.getId() ); // roleProfileManager.deleteDynamicRole( "archiva-repository-manager", existingRepository.getId() );
roleProfileManager.deleteDynamicRole( "archiva-repository-observer", existingRepository.getId() ); // roleProfileManager.deleteDynamicRole( "archiva-repository-observer", existingRepository.getId() );
//
getLogger().info( "removed user roles associated with repository " + existingRepository.getId() ); // getLogger().info( "removed user roles associated with repository " + existingRepository.getId() );
} // }
} }

View File

@ -19,9 +19,9 @@ package org.apache.maven.archiva.web.action.admin;
* under the License. * under the License.
*/ */
import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration; //import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration;
import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.SyncedRepositoryConfiguration; //import org.apache.maven.archiva.configuration.SyncedRepositoryConfiguration;
import java.io.IOException; import java.io.IOException;
@ -33,19 +33,19 @@ import java.io.IOException;
public class DeleteSyncedRepositoryAction public class DeleteSyncedRepositoryAction
extends AbstractDeleteRepositoryAction extends AbstractDeleteRepositoryAction
{ {
protected AbstractRepositoryConfiguration getRepository( Configuration configuration ) // protected AbstractRepositoryConfiguration getRepository( Configuration configuration )
{ // {
return configuration.getSyncedRepositoryById( repoId ); // return configuration.getSyncedRepositoryById( repoId );
} // }
//
protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository ) // protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository )
{ // {
configuration.removeSyncedRepository( (SyncedRepositoryConfiguration) existingRepository ); // configuration.removeSyncedRepository( (SyncedRepositoryConfiguration) existingRepository );
} // }
//
protected void removeContents( AbstractRepositoryConfiguration existingRepository ) // protected void removeContents( AbstractRepositoryConfiguration existingRepository )
throws IOException // throws IOException
{ // {
// TODO! remove the contents // // TODO! remove the contents
} // }
} }

View File

@ -22,7 +22,6 @@ package org.apache.maven.archiva.web.action.admin;
import com.opensymphony.xwork.ModelDriven; import com.opensymphony.xwork.ModelDriven;
import com.opensymphony.xwork.Preparable; import com.opensymphony.xwork.Preparable;
import org.apache.maven.archiva.security.ArchivaRoleConstants; import org.apache.maven.archiva.security.ArchivaRoleConstants;
import org.apache.maven.archiva.web.action.AbstractConfiguredAction;
//import org.apache.maven.artifact.installer.ArtifactInstallationException; //import org.apache.maven.artifact.installer.ArtifactInstallationException;
//import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; //import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
//import org.apache.maven.model.Model; //import org.apache.maven.model.Model;
@ -35,6 +34,7 @@ import org.codehaus.plexus.security.rbac.Resource;
import org.codehaus.plexus.security.ui.web.interceptor.SecureAction; import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle; import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException; import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
import org.codehaus.plexus.xwork.action.PlexusActionSupport;
import java.io.IOException; import java.io.IOException;
@ -45,7 +45,7 @@ import java.io.IOException;
* role-hint="editPom" * role-hint="editPom"
*/ */
public class EditPomAction public class EditPomAction
extends AbstractConfiguredAction extends PlexusActionSupport
implements ModelDriven, SecureAction, Preparable implements ModelDriven, SecureAction, Preparable
{ {
/** /**

View File

@ -19,13 +19,13 @@ package org.apache.maven.archiva.web.action.admin;
* under the License. * under the License.
*/ */
import org.apache.maven.archiva.scheduler.RepositoryTaskScheduler; //import org.apache.maven.archiva.scheduler.RepositoryTaskScheduler;
import org.apache.maven.archiva.security.ArchivaRoleConstants; import org.apache.maven.archiva.security.ArchivaRoleConstants;
import org.codehaus.plexus.security.rbac.Resource; import org.codehaus.plexus.security.rbac.Resource;
import org.codehaus.plexus.security.ui.web.interceptor.SecureAction; import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle; import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException; import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
import org.codehaus.plexus.taskqueue.execution.TaskExecutionException; //import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
import org.codehaus.plexus.xwork.action.PlexusActionSupport; import org.codehaus.plexus.xwork.action.PlexusActionSupport;
/** /**
@ -37,15 +37,14 @@ public class RunRepositoryTaskAction
extends PlexusActionSupport extends PlexusActionSupport
implements SecureAction implements SecureAction
{ {
/** // /**
* @plexus.requirement // * @plexus.requirement
*/ // */
private RepositoryTaskScheduler taskScheduler; // private RepositoryTaskScheduler taskScheduler;
public String runRefresh() public String runRefresh()
throws TaskExecutionException
{ {
taskScheduler.runDataRefresh(); // taskScheduler.runDataRefresh();
return SUCCESS; return SUCCESS;
} }

View File

@ -19,10 +19,10 @@ package org.apache.maven.archiva.web.action.component;
* under the License. * under the License.
*/ */
import org.apache.maven.archiva.web.action.AbstractConfiguredAction;
// TODO import org.apache.maven.model.Model; // TODO import org.apache.maven.model.Model;
// import org.apache.maven.shared.app.company.CompanyPomHandler; // import org.apache.maven.shared.app.company.CompanyPomHandler;
// import org.apache.maven.shared.app.configuration.MavenAppConfiguration; // import org.apache.maven.shared.app.configuration.MavenAppConfiguration;
import org.codehaus.plexus.xwork.action.PlexusActionSupport;
/** /**
* Stores the company information for displaying on the page. * Stores the company information for displaying on the page.
@ -30,7 +30,7 @@ import org.apache.maven.archiva.web.action.AbstractConfiguredAction;
* @TODO plexus.component role="com.opensymphony.xwork.Action" role-hint="companyInfo" * @TODO plexus.component role="com.opensymphony.xwork.Action" role-hint="companyInfo"
*/ */
public class CompanyInfoAction public class CompanyInfoAction
extends AbstractConfiguredAction extends PlexusActionSupport
{ {
private String companyLogo; private String companyLogo;