mirror of https://github.com/apache/archiva.git
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:
parent
b4d57ec324
commit
f34cf2e6c0
|
@ -32,6 +32,7 @@
|
|||
<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>
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<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>
|
||||
|
|
|
@ -21,6 +21,7 @@ package org.apache.maven.archiva.proxy;
|
|||
|
||||
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;
|
||||
|
@ -105,8 +106,6 @@ public class DefaultRepositoryProxyConnectors
|
|||
|
||||
private Map networkProxyMap = new HashMap();
|
||||
|
||||
private List propertyNameTriggers = new ArrayList();
|
||||
|
||||
public File fetchFromProxies( ArchivaRepository repository, ArtifactReference artifact )
|
||||
throws ProxyException
|
||||
{
|
||||
|
@ -165,7 +164,7 @@ public class DefaultRepositoryProxyConnectors
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public File fetchFromProxies( ArchivaRepository repository, VersionedReference metadata )
|
||||
throws ProxyException
|
||||
{
|
||||
|
@ -629,7 +628,8 @@ public class DefaultRepositoryProxyConnectors
|
|||
|
||||
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
|
||||
{
|
||||
if ( propertyNameTriggers.contains( propertyName ) )
|
||||
if ( ConfigurationNames.isNetworkProxy( propertyName ) || ConfigurationNames.isRepositories( propertyName )
|
||||
|| ConfigurationNames.isProxyConnector( propertyName ) )
|
||||
{
|
||||
initConnectorsAndNetworkProxies();
|
||||
}
|
||||
|
@ -743,37 +743,6 @@ public class DefaultRepositoryProxyConnectors
|
|||
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();
|
||||
}
|
||||
|
|
|
@ -43,21 +43,21 @@ public class ManagedLegacyTransferTest
|
|||
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() );
|
||||
}
|
||||
|
|
|
@ -62,7 +62,14 @@ public class LegacyArtifactExtensionMapping
|
|||
}
|
||||
else
|
||||
{
|
||||
return pathType;
|
||||
if ( pathType.endsWith( "s" ) )
|
||||
{
|
||||
return pathType.substring( 0, pathType.length() - 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
return pathType;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -205,8 +205,8 @@ public class LegacyBidirectionalRepositoryLayout
|
|||
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 + ">" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,42 @@
|
|||
<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>
|
||||
|
@ -126,28 +162,6 @@
|
|||
<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>
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
|
@ -21,7 +21,7 @@ package org.apache.maven.archiva.web.action.admin;
|
|||
|
||||
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;
|
||||
|
@ -60,7 +60,7 @@ public abstract class AbstractConfigureRepositoryAction
|
|||
/**
|
||||
* The repository.
|
||||
*/
|
||||
private AbstractRepositoryConfiguration repository;
|
||||
// private AbstractRepositoryConfiguration 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
|
||||
|
||||
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();
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
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
|
||||
|
@ -126,23 +126,24 @@ public abstract class AbstractConfigureRepositoryAction
|
|||
|
||||
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()
|
||||
|
@ -155,10 +156,10 @@ public abstract class AbstractConfigureRepositoryAction
|
|||
this.repoId = repoId;
|
||||
}
|
||||
|
||||
protected AbstractRepositoryConfiguration getRepository()
|
||||
{
|
||||
return repository;
|
||||
}
|
||||
// protected AbstractRepositoryConfiguration getRepository()
|
||||
// {
|
||||
// return repository;
|
||||
// }
|
||||
|
||||
public Configuration getConfiguration()
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.maven.archiva.web.action.admin;
|
|||
* 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;
|
||||
|
@ -72,35 +72,35 @@ public abstract class AbstractDeleteRepositoryAction
|
|||
{
|
||||
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()
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.maven.archiva.configuration.Configuration;
|
|||
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;
|
||||
|
@ -56,10 +56,10 @@ public class ConfigureAction
|
|||
*/
|
||||
private ArchivaConfiguration archivaConfiguration;
|
||||
|
||||
/**
|
||||
* @plexus.requirement
|
||||
*/
|
||||
private ActiveManagedRepositories activeRepositories;
|
||||
// /**
|
||||
// * @plexus.requirement
|
||||
// */
|
||||
// private ActiveManagedRepositories activeRepositories;
|
||||
|
||||
/**
|
||||
* 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 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 );
|
||||
|
||||
|
@ -126,7 +126,8 @@ public class ConfigureAction
|
|||
|
||||
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 )
|
||||
|
@ -158,11 +159,11 @@ public class ConfigureAction
|
|||
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.";
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.maven.archiva.web.action.admin;
|
|||
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;
|
||||
|
@ -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.SecureActionBundle;
|
||||
import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
|
||||
import org.codehaus.plexus.xwork.action.PlexusActionSupport;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -44,7 +45,7 @@ import java.io.IOException;
|
|||
* role-hint="configureAppearance"
|
||||
*/
|
||||
public class ConfigureAppearanceAction
|
||||
extends AbstractConfiguredAction
|
||||
extends PlexusActionSupport
|
||||
implements ModelDriven, SecureAction, Preparable
|
||||
{
|
||||
// /**
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.maven.archiva.web.action.admin;
|
|||
* 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;
|
||||
|
||||
|
@ -32,26 +32,26 @@ 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();
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.maven.archiva.web.action.admin;
|
|||
* 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;
|
||||
|
||||
|
@ -34,42 +34,42 @@ import java.io.IOException;
|
|||
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;
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.maven.archiva.web.action.admin;
|
|||
* 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;
|
||||
|
||||
|
@ -32,26 +32,26 @@ 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();
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -19,9 +19,9 @@ package org.apache.maven.archiva.web.action.admin;
|
|||
* 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;
|
||||
|
||||
|
@ -33,19 +33,19 @@ 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
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.maven.archiva.web.action.admin;
|
|||
* 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;
|
||||
|
@ -35,32 +35,32 @@ import java.io.IOException;
|
|||
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
|
||||
|
@ -68,12 +68,12 @@ public class DeleteRepositoryAction
|
|||
* @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() );
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -19,9 +19,9 @@ package org.apache.maven.archiva.web.action.admin;
|
|||
* 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;
|
||||
|
||||
|
@ -33,19 +33,19 @@ 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
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ package org.apache.maven.archiva.web.action.admin;
|
|||
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;
|
||||
|
@ -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.SecureActionBundle;
|
||||
import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
|
||||
import org.codehaus.plexus.xwork.action.PlexusActionSupport;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -45,7 +45,7 @@ import java.io.IOException;
|
|||
* role-hint="editPom"
|
||||
*/
|
||||
public class EditPomAction
|
||||
extends AbstractConfiguredAction
|
||||
extends PlexusActionSupport
|
||||
implements ModelDriven, SecureAction, Preparable
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -19,13 +19,13 @@ package org.apache.maven.archiva.web.action.admin;
|
|||
* 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;
|
||||
|
||||
/**
|
||||
|
@ -37,15 +37,14 @@ public class RunRepositoryTaskAction
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -19,10 +19,10 @@ package org.apache.maven.archiva.web.action.component;
|
|||
* 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.
|
||||
|
@ -30,7 +30,7 @@ import org.apache.maven.archiva.web.action.AbstractConfiguredAction;
|
|||
* @TODO plexus.component role="com.opensymphony.xwork.Action" role-hint="companyInfo"
|
||||
*/
|
||||
public class CompanyInfoAction
|
||||
extends AbstractConfiguredAction
|
||||
extends PlexusActionSupport
|
||||
{
|
||||
private String companyLogo;
|
||||
|
||||
|
|
Loading…
Reference in New Issue