]> source.dussan.org Git - archiva.git/commitdiff
Do what it takes to let it compile. (The I want to get out of the critical path approach)
authorJoakim Erdfelt <joakime@apache.org>
Tue, 24 Apr 2007 05:42:25 +0000 (05:42 +0000)
committerJoakim Erdfelt <joakime@apache.org>
Tue, 24 Apr 2007 05:42:25 +0000 (05:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@531751 13f79535-47bb-0310-9956-ffa450edef68

21 files changed:
archiva-base/archiva-converter/pom.xml
archiva-base/archiva-proxy/pom.xml
archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyArtifactExtensionMapping.java
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LegacyBidirectionalRepositoryLayout.java
archiva-web/archiva-webapp/pom.xml
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/AbstractConfiguredAction.java [deleted file]
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractConfigureRepositoryAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractDeleteRepositoryAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAppearanceAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureProxiedRepositoryAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteProxiedRepositoryAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteRepositoryAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteSyncedRepositoryAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/EditPomAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RunRepositoryTaskAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/component/CompanyInfoAction.java

index c2932ad294de745675b10b30a717c34ef189251d..2157a33da5f2fefab1869597f23f00f72838cae2 100644 (file)
@@ -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>
index 754fd2ea093af64ea2afefe179c430c1da9eed12..d966186d9f58128a63e9c62d742c8317a5b23b68 100644 (file)
@@ -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>
index a2521ef371d81d3e8d738fdad161afdfd17dda8a..1d1295df4addc97be2a141a817fc0e5b8640d86a 100644 (file)
@@ -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();
     }
index ee3cee1ca9676e2c79fcce21b46deaf39bf5805b..893ba8fef3c7df42ba679fe8fc2d32ce812166dd 100644 (file)
@@ -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() );
     }
index 84c3af024291a6554eca0b71c3e86f6fdb47500c..5139823fe393a581d21b35768d55a2b137034fee 100644 (file)
@@ -62,7 +62,14 @@ public class LegacyArtifactExtensionMapping
         }
         else
         {
-            return pathType;
+            if ( pathType.endsWith( "s" ) )
+            {
+                return pathType.substring( 0, pathType.length() - 1 );
+            }
+            else
+            {
+                return pathType;
+            }
         }
     }
 }
index 6bc332366f01761426c25031c85fc7cbffb613cd..f32b79ea522c28ddad119ba010e1392aee69280f 100644 (file)
@@ -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 + ">" );
             }
         }
 
index e90d183a974e16f4a127015cf863102a291cdf0e..20df8431c2b0947b1b2e6cb1c8104cfc282d3118 100644 (file)
   <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>
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 (file)
index c62bf45..0000000
+++ /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 );
-    }
-}
index 2b3c71124af3bcd3e93807be9548a5cf233db669..f181c17dd14b3fa8e2b2ff91a57e913d5f1e482e 100644 (file)
@@ -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()
     {
index b5f792092caa2e51b2f83dbfa1c95c710188b7e9..a904176bf721236fe091bc2fb6ddc3a30cd246b5 100644 (file)
@@ -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()
     {
index a2cdcffb457c61f50c20889a80244c18427e012c..ee9172c19f0aa66ed37f04f8637d31054c180f96 100644 (file)
@@ -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.";
         }
index 6a87b564459450304fb33060b9453ba4326812c1..6ec3c08f2adf67f1251df74882221e2d38a30f72 100644 (file)
@@ -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
 {
 //    /**
index dd712743a7449cd9e967094994c82c1ec78e28ae..57b46bd8cbc9aeaaa6aba3ab907e51c9e14fd5fc 100644 (file)
@@ -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();
+//    }
 }
index 25f681f0b6ca77804a5b8209d3c7cb11b9d3bcb1..9edd013e76d782e10b297141aede4aebb5eb2b64 100644 (file)
@@ -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;
+//    }
 }
index 506155410b4387a0c0ea71a241fdf90bf10ca15e..b374378df033134a6598945ec74894196ce23ada 100644 (file)
@@ -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();
+//    }
 }
index 082ee39488769a2c815b09bc3f316e6ef139d2fd..1da75506a8f9f9c93b355871221fc2098d0fa7a5 100644 (file)
@@ -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
+//    }
 }
index 904a1a590d37be12f138f6416e315cea5bb111f9..9f38320befd1ceed93d08f4c823d29769a72cf0b 100644 (file)
@@ -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() );
+//    }
 }
index fcf8dd4cc177817929d0e39455801c4187191e1e..42886668b0cca57fc0b72df259c4995857505c93 100644 (file)
@@ -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
+//    }
 }
index d8614f4e849c43d8f36a43054fe7c4d533709a57..33fbf8dea0c2fd4e6b2c011aa2aaacb3daa5b138 100644 (file)
@@ -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
 {
     /**
index 06daf24a9d61a9b018d2378ef6ab24243c148043..7028613fd7ce836466e985e70f3f40e41d301145 100644 (file)
@@ -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;
     }
index c65c60cce21956cd295543bfa84dbbee55818f11..01593bb95db0031678520d137d7f5cbd7eb5fcd4 100644 (file)
@@ -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;