<dependency>
<groupId>org.apache.maven.archiva</groupId>
<artifactId>archiva-consumer-api</artifactId>
+ <version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.archiva</groupId>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</dependency>
- <dependency>
+ <dependency>
<groupId>easymock</groupId>
<artifactId>easymock</artifactId>
<version>1.2_Java1.3</version>
import org.apache.commons.io.FileUtils;
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.ProxyConnectorConfiguration;
import org.apache.maven.archiva.configuration.RepositoryConfiguration;
private Map networkProxyMap = new HashMap();
- private List propertyNameTriggers = new ArrayList();
-
public File fetchFromProxies( ArchivaRepository repository, ArtifactReference artifact )
throws ProxyException
{
return null;
}
-
+
public File fetchFromProxies( ArchivaRepository repository, VersionedReference metadata )
throws ProxyException
{
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
{
- if ( propertyNameTriggers.contains( propertyName ) )
+ if ( ConfigurationNames.isNetworkProxy( propertyName ) || ConfigurationNames.isRepositories( propertyName )
+ || ConfigurationNames.isProxyConnector( propertyName ) )
{
initConnectorsAndNetworkProxies();
}
public void initialize()
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 );
initConnectorsAndNetworkProxies();
}
String path = "org.apache.maven.test/jars/get-default-layout-1.0.jar";
File expectedFile = new File( managedLegacyDir, path );
ArtifactReference artifact = createArtifactReference( "legacy", path );
-
+
expectedFile.delete();
assertFalse( expectedFile.exists() );
-
+
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
-
+
File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact );
-
+
File proxied2File = new File( REPOPATH_PROXIED1,
"org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar" );
assertFileEquals( expectedFile, downloadedFile, proxied2File );
assertNoTempFiles( expectedFile );
-
+
// TODO: timestamp preservation requires support for that in wagon
// assertEquals( "Check file timestamp", proxiedFile.lastModified(), file.lastModified() );
}
}
else
{
- return pathType;
+ if ( pathType.endsWith( "s" ) )
+ {
+ return pathType.substring( 0, pathType.length() - 1 );
+ }
+ else
+ {
+ return pathType;
+ }
}
}
}
if ( !prefs.type.equals( prefs.fileParts.extension ) )
{
throw new LayoutException( "Invalid artifact, mismatch on extension <" + prefs.fileParts.extension
- + "> and expected layout specified type <" + prefs.type
- + "> (mapped from actual path provided type <" + prefs.pathType + ">)" );
+ + "> and expected layout specified type <" + prefs.pathType + "> (mapped type: <" + prefs.type
+ + ">) on path <" + path + ">" );
}
}
<packaging>war</packaging>
<name>Archiva Web :: Application</name>
<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>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</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>
<!-- Plexus Security Dependencies -->
<dependency>
<groupId>org.codehaus.plexus.security</groupId>
+++ /dev/null
-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 );
- }
-}
import com.opensymphony.xwork.ModelDriven;
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.Configuration;
import org.apache.maven.archiva.configuration.InvalidConfigurationException;
/**
* The repository.
*/
- private AbstractRepositoryConfiguration repository;
+// private AbstractRepositoryConfiguration repository;
/**
* The repository ID to lookup when editing a repository.
{
// 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() );
- if ( existingRepository != null )
- {
- addFieldError( "id", "A repository with that id already exists" );
- return INPUT;
- }
+// AbstractRepositoryConfiguration existingRepository = getRepository( repository.getId() );
+// if ( existingRepository != null )
+// {
+// addFieldError( "id", "A repository with that id already exists" );
+// return INPUT;
+// }
return saveConfiguration();
}
{
// 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() );
- removeRepository( existingRepository );
+// AbstractRepositoryConfiguration existingRepository = getRepository( repository.getId() );
+// removeRepository( existingRepository );
return saveConfiguration();
}
- protected abstract void removeRepository( AbstractRepositoryConfiguration existingRepository );
-
- protected abstract AbstractRepositoryConfiguration getRepository( String id );
+// protected abstract void removeRepository( AbstractRepositoryConfiguration existingRepository );
+//
+// protected abstract AbstractRepositoryConfiguration getRepository( String id );
private String saveConfiguration()
throws IOException, InvalidConfigurationException, RbacManagerException, RoleProfileException, RegistryException
public Object getModel()
{
- return repository;
+ return new Object();
+// return repository;
}
- protected abstract AbstractRepositoryConfiguration createRepository();
+// protected abstract AbstractRepositoryConfiguration createRepository();
public void prepare()
{
configuration = archivaConfiguration.getConfiguration();
- if ( repository == null )
- {
- repository = getRepository( repoId );
- }
- if ( repository == null )
- {
- repository = createRepository();
- }
+// if ( repository == null )
+// {
+// repository = getRepository( repoId );
+// }
+// if ( repository == null )
+// {
+// repository = createRepository();
+// }
}
public String getRepoId()
this.repoId = repoId;
}
- protected AbstractRepositoryConfiguration getRepository()
- {
- return repository;
- }
+// protected AbstractRepositoryConfiguration getRepository()
+// {
+// return repository;
+// }
public Configuration getConfiguration()
{
* 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.Configuration;
import org.apache.maven.archiva.configuration.InvalidConfigurationException;
{
Configuration configuration = archivaConfiguration.getConfiguration();
- AbstractRepositoryConfiguration existingRepository = getRepository( configuration );
- if ( existingRepository == null )
- {
- addActionError( "A repository with that id does not exist" );
- return ERROR;
- }
-
- // TODO: remove from index too!
-
- removeRepository( configuration, existingRepository );
-
- archivaConfiguration.save( configuration );
-
- if ( "delete-contents".equals( operation ) )
- {
- removeContents( existingRepository );
- }
+// AbstractRepositoryConfiguration existingRepository = getRepository( configuration );
+// if ( existingRepository == null )
+// {
+// addActionError( "A repository with that id does not exist" );
+// return ERROR;
+// }
+//
+// // TODO: remove from index too!
+//
+// removeRepository( configuration, existingRepository );
+//
+// archivaConfiguration.save( configuration );
+//
+// if ( "delete-contents".equals( operation ) )
+// {
+// removeContents( existingRepository );
+// }
}
return SUCCESS;
}
- protected abstract void removeContents( AbstractRepositoryConfiguration existingRepository )
- throws IOException;
-
- protected abstract AbstractRepositoryConfiguration getRepository( Configuration configuration );
-
- protected abstract void removeRepository( Configuration configuration,
- AbstractRepositoryConfiguration existingRepository );
+// protected abstract void removeContents( AbstractRepositoryConfiguration existingRepository )
+// throws IOException;
+//
+// protected abstract AbstractRepositoryConfiguration getRepository( Configuration configuration );
+//
+// protected abstract void removeRepository( Configuration configuration,
+// AbstractRepositoryConfiguration existingRepository );
public String input()
{
import org.apache.maven.archiva.configuration.InvalidConfigurationException;
import org.apache.maven.archiva.indexer.RepositoryIndexException;
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.codehaus.plexus.registry.RegistryException;
import org.codehaus.plexus.scheduler.CronExpressionValidator;
*/
private ArchivaConfiguration archivaConfiguration;
- /**
- * @plexus.requirement
- */
- private ActiveManagedRepositories activeRepositories;
+// /**
+// * @plexus.requirement
+// */
+// private ActiveManagedRepositories activeRepositories;
/**
* The configuration.
{
// 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?
- configuration.setDataRefreshCronExpression( getCronExpression() );
+// configuration.setDataRefreshCronExpression( getCronExpression() );
// Normalize the path
- File file = new File( configuration.getIndexPath() );
- configuration.setIndexPath( file.getCanonicalPath() );
- if ( !file.exists() )
- {
- file.mkdirs();
- // TODO: error handling when this fails, or is not a directory!
- }
+// File file = new File( configuration.getIndexPath() );
+// configuration.setIndexPath( file.getCanonicalPath() );
+// if ( !file.exists() )
+// {
+// file.mkdirs();
+// // 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
- assert configuration.isValid();
+// assert configuration.isValid();
archivaConfiguration.save( configuration );
public String input()
{
- String[] cronEx = configuration.getDataRefreshCronExpression().split( " " );
+// String[] cronEx = configuration.getDataRefreshCronExpression().split( " " );
+ String[] cronEx = new String[]{"0","0","*","*","*","*","*"};
int i = 0;
while ( i < cronEx.length )
i++;
}
- if ( activeRepositories.getLastDataRefreshTime() != 0 )
- {
- lastIndexingTime = new Date( activeRepositories.getLastDataRefreshTime() ).toString();
- }
- else
+// if ( activeRepositories.getLastDataRefreshTime() != 0 )
+// {
+// lastIndexingTime = new Date( activeRepositories.getLastDataRefreshTime() ).toString();
+// }
+// else
{
lastIndexingTime = "Never been run.";
}
import com.opensymphony.xwork.ModelDriven;
import com.opensymphony.xwork.Preparable;
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.model.Model;
//import org.apache.maven.project.ProjectBuildingException;
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.SecureActionException;
+import org.codehaus.plexus.xwork.action.PlexusActionSupport;
import java.io.IOException;
* role-hint="configureAppearance"
*/
public class ConfigureAppearanceAction
- extends AbstractConfiguredAction
+ extends PlexusActionSupport
implements ModelDriven, SecureAction, Preparable
{
// /**
* under the License.
*/
-import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration;
-import org.apache.maven.archiva.configuration.ProxiedRepositoryConfiguration;
+//import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration;
+//import org.apache.maven.archiva.configuration.ProxiedRepositoryConfiguration;
import java.io.IOException;
public class ConfigureProxiedRepositoryAction
extends AbstractConfigureRepositoryAction
{
- protected void removeRepository( AbstractRepositoryConfiguration existingRepository )
- {
- configuration.removeProxiedRepository( (ProxiedRepositoryConfiguration) existingRepository );
- }
-
- protected AbstractRepositoryConfiguration getRepository( String id )
- {
- return configuration.getProxiedRepositoryById( id );
- }
+// protected void removeRepository( AbstractRepositoryConfiguration existingRepository )
+// {
+// configuration.removeProxiedRepository( (ProxiedRepositoryConfiguration) existingRepository );
+// }
+//
+// protected AbstractRepositoryConfiguration getRepository( String id )
+// {
+// return configuration.getProxiedRepositoryById( id );
+// }
protected void addRepository()
throws IOException
{
- ProxiedRepositoryConfiguration repository = (ProxiedRepositoryConfiguration) getRepository();
-
- configuration.addProxiedRepository( repository );
+// ProxiedRepositoryConfiguration repository = (ProxiedRepositoryConfiguration) getRepository();
+//
+// configuration.addProxiedRepository( repository );
}
- protected AbstractRepositoryConfiguration createRepository()
- {
- return new ProxiedRepositoryConfiguration();
- }
+// protected AbstractRepositoryConfiguration createRepository()
+// {
+// return new ProxiedRepositoryConfiguration();
+// }
}
* 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.codehaus.plexus.rbac.profile.RoleProfileException;
public class ConfigureRepositoryAction
extends AbstractConfigureRepositoryAction
{
- protected void removeRepository( AbstractRepositoryConfiguration existingRepository )
- {
- configuration.removeRepository( (RepositoryConfiguration) existingRepository );
- }
-
- protected AbstractRepositoryConfiguration getRepository( String id )
- {
- return configuration.getRepositoryById( id );
- }
+// protected void removeRepository( AbstractRepositoryConfiguration existingRepository )
+// {
+// configuration.removeRepository( (RepositoryConfiguration) existingRepository );
+// }
+//
+// protected AbstractRepositoryConfiguration getRepository( String id )
+// {
+// return configuration.getRepositoryById( id );
+// }
protected void addRepository()
throws IOException, RoleProfileException
{
- RepositoryConfiguration repository = (RepositoryConfiguration) getRepository();
-
- // Normalize the path
- File file = new File( repository.getDirectory() );
- repository.setDirectory( file.getCanonicalPath() );
- if ( !file.exists() )
- {
- file.mkdirs();
- // 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() );
+// RepositoryConfiguration repository = (RepositoryConfiguration) getRepository();
+//
+// // Normalize the path
+// File file = new File( repository.getDirectory() );
+// repository.setDirectory( file.getCanonicalPath() );
+// if ( !file.exists() )
+// {
+// file.mkdirs();
+// // 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() );
}
- protected AbstractRepositoryConfiguration createRepository()
- {
- RepositoryConfiguration repository = new RepositoryConfiguration();
- repository.setIndexed( false );
- return repository;
- }
+// protected AbstractRepositoryConfiguration createRepository()
+// {
+// RepositoryConfiguration repository = new RepositoryConfiguration();
+// repository.setIndexed( false );
+// return repository;
+// }
}
* under the License.
*/
-import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration;
-import org.apache.maven.archiva.configuration.SyncedRepositoryConfiguration;
+//import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration;
+//import org.apache.maven.archiva.configuration.SyncedRepositoryConfiguration;
import java.io.IOException;
public class ConfigureSyncedRepositoryAction
extends AbstractConfigureRepositoryAction
{
- protected void removeRepository( AbstractRepositoryConfiguration existingRepository )
- {
- configuration.removeSyncedRepository( (SyncedRepositoryConfiguration) existingRepository );
- }
-
- protected AbstractRepositoryConfiguration getRepository( String id )
- {
- return configuration.getSyncedRepositoryById( id );
- }
+// protected void removeRepository( AbstractRepositoryConfiguration existingRepository )
+// {
+// configuration.removeSyncedRepository( (SyncedRepositoryConfiguration) existingRepository );
+// }
+//
+// protected AbstractRepositoryConfiguration getRepository( String id )
+// {
+// return configuration.getSyncedRepositoryById( id );
+// }
protected void addRepository()
throws IOException
{
- SyncedRepositoryConfiguration repository = (SyncedRepositoryConfiguration) getRepository();
-
- configuration.addSyncedRepository( repository );
+// SyncedRepositoryConfiguration repository = (SyncedRepositoryConfiguration) getRepository();
+//
+// configuration.addSyncedRepository( repository );
}
- protected AbstractRepositoryConfiguration createRepository()
- {
- return new SyncedRepositoryConfiguration();
- }
+// protected AbstractRepositoryConfiguration createRepository()
+// {
+// return new SyncedRepositoryConfiguration();
+// }
}
* 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.ProxiedRepositoryConfiguration;
+//import org.apache.maven.archiva.configuration.ProxiedRepositoryConfiguration;
import java.io.IOException;
public class DeleteProxiedRepositoryAction
extends AbstractDeleteRepositoryAction
{
- protected AbstractRepositoryConfiguration getRepository( Configuration configuration )
- {
- return configuration.getProxiedRepositoryById( repoId );
- }
-
- protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository )
- {
- configuration.removeProxiedRepository( (ProxiedRepositoryConfiguration) existingRepository );
- }
-
- protected void removeContents( AbstractRepositoryConfiguration existingRepository )
- throws IOException
- {
- // TODO! delete it
- }
+// protected AbstractRepositoryConfiguration getRepository( Configuration configuration )
+// {
+// return configuration.getProxiedRepositoryById( repoId );
+// }
+//
+// protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository )
+// {
+// configuration.removeProxiedRepository( (ProxiedRepositoryConfiguration) existingRepository );
+// }
+//
+// protected void removeContents( AbstractRepositoryConfiguration existingRepository )
+// throws IOException
+// {
+// // TODO! delete it
+// }
}
* 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.RepositoryConfiguration;
import org.codehaus.plexus.rbac.profile.RoleProfileException;
public class DeleteRepositoryAction
extends AbstractDeleteRepositoryAction
{
- protected AbstractRepositoryConfiguration getRepository( Configuration configuration )
- {
- return configuration.getRepositoryById( repoId );
- }
-
- protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository )
- {
- configuration.removeRepository( (RepositoryConfiguration) existingRepository );
-
- try
- {
- removeRepositoryRoles( existingRepository );
- }
- catch ( RoleProfileException e )
- {
- getLogger().error( "Error removing user roles associated with repository " + existingRepository.getId() );
- }
- }
-
- protected void removeContents( AbstractRepositoryConfiguration existingRepository )
- throws IOException
- {
- RepositoryConfiguration repository = (RepositoryConfiguration) existingRepository;
- getLogger().info( "Removing " + repository.getDirectory() );
- FileUtils.deleteDirectory( repository.getDirectory() );
- }
+// protected AbstractRepositoryConfiguration getRepository( Configuration configuration )
+// {
+// return configuration.getRepositoryById( repoId );
+// }
+//
+// protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository )
+// {
+// configuration.removeRepository( (RepositoryConfiguration) existingRepository );
+//
+// try
+// {
+// removeRepositoryRoles( existingRepository );
+// }
+// catch ( RoleProfileException e )
+// {
+// getLogger().error( "Error removing user roles associated with repository " + existingRepository.getId() );
+// }
+// }
+//
+// protected void removeContents( AbstractRepositoryConfiguration existingRepository )
+// throws IOException
+// {
+// RepositoryConfiguration repository = (RepositoryConfiguration) existingRepository;
+// getLogger().info( "Removing " + repository.getDirectory() );
+// FileUtils.deleteDirectory( repository.getDirectory() );
+// }
/**
* Remove user roles associated with the repository
* @param existingRepository
* @throws RoleProfileException
*/
- private void removeRepositoryRoles( AbstractRepositoryConfiguration existingRepository )
- throws RoleProfileException
- {
- roleProfileManager.deleteDynamicRole( "archiva-repository-manager", existingRepository.getId() );
- roleProfileManager.deleteDynamicRole( "archiva-repository-observer", existingRepository.getId() );
-
- getLogger().info( "removed user roles associated with repository " + existingRepository.getId() );
- }
+// private void removeRepositoryRoles( AbstractRepositoryConfiguration existingRepository )
+// throws RoleProfileException
+// {
+// roleProfileManager.deleteDynamicRole( "archiva-repository-manager", existingRepository.getId() );
+// roleProfileManager.deleteDynamicRole( "archiva-repository-observer", existingRepository.getId() );
+//
+// getLogger().info( "removed user roles associated with repository " + existingRepository.getId() );
+// }
}
* 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.SyncedRepositoryConfiguration;
+//import org.apache.maven.archiva.configuration.SyncedRepositoryConfiguration;
import java.io.IOException;
public class DeleteSyncedRepositoryAction
extends AbstractDeleteRepositoryAction
{
- protected AbstractRepositoryConfiguration getRepository( Configuration configuration )
- {
- return configuration.getSyncedRepositoryById( repoId );
- }
-
- protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository )
- {
- configuration.removeSyncedRepository( (SyncedRepositoryConfiguration) existingRepository );
- }
-
- protected void removeContents( AbstractRepositoryConfiguration existingRepository )
- throws IOException
- {
- // TODO! remove the contents
- }
+// protected AbstractRepositoryConfiguration getRepository( Configuration configuration )
+// {
+// return configuration.getSyncedRepositoryById( repoId );
+// }
+//
+// protected void removeRepository( Configuration configuration, AbstractRepositoryConfiguration existingRepository )
+// {
+// configuration.removeSyncedRepository( (SyncedRepositoryConfiguration) existingRepository );
+// }
+//
+// protected void removeContents( AbstractRepositoryConfiguration existingRepository )
+// throws IOException
+// {
+// // TODO! remove the contents
+// }
}
import com.opensymphony.xwork.ModelDriven;
import com.opensymphony.xwork.Preparable;
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.metadata.ArtifactMetadataRetrievalException;
//import org.apache.maven.model.Model;
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.SecureActionException;
+import org.codehaus.plexus.xwork.action.PlexusActionSupport;
import java.io.IOException;
* role-hint="editPom"
*/
public class EditPomAction
- extends AbstractConfiguredAction
+ extends PlexusActionSupport
implements ModelDriven, SecureAction, Preparable
{
/**
* 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.codehaus.plexus.security.rbac.Resource;
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.SecureActionException;
-import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
+//import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
import org.codehaus.plexus.xwork.action.PlexusActionSupport;
/**
extends PlexusActionSupport
implements SecureAction
{
- /**
- * @plexus.requirement
- */
- private RepositoryTaskScheduler taskScheduler;
+// /**
+// * @plexus.requirement
+// */
+// private RepositoryTaskScheduler taskScheduler;
public String runRefresh()
- throws TaskExecutionException
{
- taskScheduler.runDataRefresh();
+// taskScheduler.runDataRefresh();
return SUCCESS;
}
* under the License.
*/
-import org.apache.maven.archiva.web.action.AbstractConfiguredAction;
// TODO import org.apache.maven.model.Model;
// import org.apache.maven.shared.app.company.CompanyPomHandler;
// import org.apache.maven.shared.app.configuration.MavenAppConfiguration;
+import org.codehaus.plexus.xwork.action.PlexusActionSupport;
/**
* Stores the company information for displaying on the page.
* @TODO plexus.component role="com.opensymphony.xwork.Action" role-hint="companyInfo"
*/
public class CompanyInfoAction
- extends AbstractConfiguredAction
+ extends PlexusActionSupport
{
private String companyLogo;