From: Joakim Erdfelt Date: Tue, 24 Apr 2007 05:42:25 +0000 (+0000) Subject: Do what it takes to let it compile. (The I want to get out of the critical path approach) X-Git-Tag: archiva-1.0-alpha-1~113^2~19 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f34cf2e6c06f52008d7b7c0ec1788563854a22dd;p=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 --- diff --git a/archiva-base/archiva-converter/pom.xml b/archiva-base/archiva-converter/pom.xml index c2932ad29..2157a33da 100644 --- a/archiva-base/archiva-converter/pom.xml +++ b/archiva-base/archiva-converter/pom.xml @@ -32,6 +32,7 @@ org.apache.maven.archiva archiva-consumer-api + 1.0-SNAPSHOT org.apache.maven.archiva diff --git a/archiva-base/archiva-proxy/pom.xml b/archiva-base/archiva-proxy/pom.xml index 754fd2ea0..d966186d9 100644 --- a/archiva-base/archiva-proxy/pom.xml +++ b/archiva-base/archiva-proxy/pom.xml @@ -61,7 +61,7 @@ org.codehaus.plexus plexus-container-default - + easymock easymock 1.2_Java1.3 diff --git a/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java b/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java index a2521ef37..1d1295df4 100644 --- a/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java +++ b/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java @@ -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(); } diff --git a/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java b/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java index ee3cee1ca..893ba8fef 100644 --- a/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java +++ b/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java @@ -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() ); } diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyArtifactExtensionMapping.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyArtifactExtensionMapping.java index 84c3af024..5139823fe 100644 --- a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyArtifactExtensionMapping.java +++ b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyArtifactExtensionMapping.java @@ -62,7 +62,14 @@ public class LegacyArtifactExtensionMapping } else { - return pathType; + if ( pathType.endsWith( "s" ) ) + { + return pathType.substring( 0, pathType.length() - 1 ); + } + else + { + return pathType; + } } } } diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LegacyBidirectionalRepositoryLayout.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LegacyBidirectionalRepositoryLayout.java index 6bc332366..f32b79ea5 100644 --- a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LegacyBidirectionalRepositoryLayout.java +++ b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LegacyBidirectionalRepositoryLayout.java @@ -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 + ">" ); } } diff --git a/archiva-web/archiva-webapp/pom.xml b/archiva-web/archiva-webapp/pom.xml index e90d183a9..20df8431c 100644 --- a/archiva-web/archiva-webapp/pom.xml +++ b/archiva-web/archiva-webapp/pom.xml @@ -30,6 +30,42 @@ war Archiva Web :: Application + + org.apache.maven.archiva + archiva-report-manager + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-scheduled + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-indexer + + + org.apache.maven.archiva + archiva-proxy + + + org.apache.maven.archiva + archiva-database + + + org.apache.maven.archiva + archiva-repository-layer + + + org.apache.maven.archiva + archiva-security + + + org.apache.maven.archiva + archiva-applet + + provided + javax.servlet servlet-api @@ -126,28 +162,6 @@ org.codehaus.plexus plexus-container-default - - org.apache.maven.archiva - archiva-proxy - - - org.apache.maven.archiva - archiva-database - - - org.apache.maven.archiva - archiva-repository-layer - - - org.apache.maven.archiva - archiva-security - - - org.apache.maven.archiva - archiva-applet - - provided - org.codehaus.plexus.security diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/AbstractConfiguredAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/AbstractConfiguredAction.java deleted file mode 100644 index c62bf45d3..000000000 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/AbstractConfiguredAction.java +++ /dev/null @@ -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 ); - } -} diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractConfigureRepositoryAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractConfigureRepositoryAction.java index 2b3c71124..f181c17dd 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractConfigureRepositoryAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractConfigureRepositoryAction.java @@ -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() { diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractDeleteRepositoryAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractDeleteRepositoryAction.java index b5f792092..a904176bf 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractDeleteRepositoryAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractDeleteRepositoryAction.java @@ -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() { diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java index a2cdcffb4..ee9172c19 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java @@ -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."; } diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAppearanceAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAppearanceAction.java index 6a87b5644..6ec3c08f2 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAppearanceAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAppearanceAction.java @@ -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 { // /** diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureProxiedRepositoryAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureProxiedRepositoryAction.java index dd712743a..57b46bd8c 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureProxiedRepositoryAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureProxiedRepositoryAction.java @@ -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(); +// } } diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction.java index 25f681f0b..9edd013e7 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction.java @@ -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; +// } } diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction.java index 506155410..b374378df 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction.java @@ -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(); +// } } diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteProxiedRepositoryAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteProxiedRepositoryAction.java index 082ee3948..1da75506a 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteProxiedRepositoryAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteProxiedRepositoryAction.java @@ -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 +// } } diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteRepositoryAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteRepositoryAction.java index 904a1a590..9f38320be 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteRepositoryAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteRepositoryAction.java @@ -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() ); +// } } diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteSyncedRepositoryAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteSyncedRepositoryAction.java index fcf8dd4cc..42886668b 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteSyncedRepositoryAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteSyncedRepositoryAction.java @@ -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 +// } } diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/EditPomAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/EditPomAction.java index d8614f4e8..33fbf8dea 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/EditPomAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/EditPomAction.java @@ -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 { /** diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java index 06daf24a9..7028613fd 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java @@ -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; } diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/component/CompanyInfoAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/component/CompanyInfoAction.java index c65c60cce..01593bb95 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/component/CompanyInfoAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/component/CompanyInfoAction.java @@ -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;