You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2006/08/04 10:39:06 UTC

svn commit: r428659 - in /maven/repository-manager/trunk: maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ maven-repository-configuration/src/main/mdo/ maven-repository-core/src/main/java/org/apache/maven/reposito...

Author: brett
Date: Fri Aug  4 01:39:03 2006
New Revision: 428659

URL: http://svn.apache.org/viewvc?rev=428659&view=rev
Log:
[MRM-138] add multiple repositories and new configuration pages

Added:
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction.java   (with props)
    maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction-validation.xml   (with props)
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp   (with props)
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp   (with props)
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/include/
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf   (with props)
Modified:
    maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/DefaultConfigurationStore.java
    maven/repository-manager/trunk/maven-repository-configuration/src/main/mdo/configuration.mdo
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/ConfiguredRepositoryFactory.java
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/IndexerTask.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryArtifactIndexFactory.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/lucene/LuceneRepositoryArtifactIndexFactory.java
    maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneMinimalArtifactIndexSearchTest.java
    maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneMinimalArtifactIndexTest.java
    maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneStandardArtifactIndexSearchTest.java
    maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneStandardArtifactIndexTest.java
    maven/repository-manager/trunk/maven-repository-reports-standard/src/main/java/org/apache/maven/repository/reporting/DuplicateArtifactFileReportProcessor.java
    maven/repository-manager/trunk/maven-repository-reports-standard/src/test/java/org/apache/maven/repository/reporting/DuplicateArtifactFileReportProcessorTest.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BrowseAction.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/SearchAction.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/ConfigureAction.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/interceptor/ConfigurationInterceptor.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/org/apache/maven/repository/manager/web/action/admin/ConfigureAction-validation.xml
    maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/configure.jsp
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/index.jsp
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/css/site.css

Modified: maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/DefaultConfigurationStore.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/DefaultConfigurationStore.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/DefaultConfigurationStore.java (original)
+++ maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/DefaultConfigurationStore.java Fri Aug  4 01:39:03 2006
@@ -87,7 +87,7 @@
             getLogger().info( "Reading configuration from " + file );
             try
             {
-                configuration = reader.read( fileReader );
+                configuration = reader.read( fileReader, false );
             }
             catch ( IOException e )
             {

Modified: maven/repository-manager/trunk/maven-repository-configuration/src/main/mdo/configuration.mdo
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-configuration/src/main/mdo/configuration.mdo?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-configuration/src/main/mdo/configuration.mdo (original)
+++ maven/repository-manager/trunk/maven-repository-configuration/src/main/mdo/configuration.mdo Fri Aug  4 01:39:03 2006
@@ -17,24 +17,12 @@
       <version>1.0.0</version>
       <fields>
         <field>
-          <name>repositoryDirectory</name>
+          <name>repositories</name>
           <version>1.0.0</version>
-          <type>String</type>
-          <required>true</required>
-          <description>
-            The location of the repository to monitor.
-          </description>
-        </field>
-        <field>
-          <name>repositoryLayout</name>
-          <version>1.0.0</version>
-          <type>String</type>
-          <required>true</required>
-          <description>
-            The layout of the repository. Valid values are "default" and "legacy".
-          </description>
-          <!-- TODO: should be able to detect this from the repository (perhaps by metadata at the root) -->
-          <defaultValue>default</defaultValue>
+          <association>
+            <type>RepositoryConfiguration</type>
+            <multiplicity>*</multiplicity>
+          </association>
         </field>
         <field>
           <name>indexPath</name>
@@ -69,14 +57,114 @@
           <defaultValue>0 30 0/4 * * ?</defaultValue>
         </field>
         <field>
-          <name>discoverSnapshots</name>
+          <name>globalBlackListPatterns</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <description>Blacklisted patterns in the discovery process</description>
+        </field>
+      </fields>
+      <codeSegments>
+        <codeSegment>
+          <version>1.0.0</version>
+          <code><![CDATA[
+    public boolean isValid()
+    {
+        boolean valid = true;
+
+        if ( indexPath == null )
+        {
+            valid = false;
+        }
+        else if ( getRepositories().isEmpty() )
+        {
+            valid = false;
+        }
+        else
+        {
+            for ( java.util.Iterator i = repositories.iterator(); i.hasNext() && valid; )
+            {
+                RepositoryConfiguration repository = (RepositoryConfiguration) i.next();
+
+                valid = repository.isValid();
+            }
+        }
+        return valid;
+    }
+
+    public RepositoryConfiguration getRepositoryById( String id )
+    {
+        for ( java.util.Iterator i = getRepositories().iterator(); i.hasNext(); )
+        {
+            RepositoryConfiguration repository = (RepositoryConfiguration) i.next();
+            if ( repository.getId().equals( id ) )
+            {
+                return repository;
+            }
+        }
+        return null;
+    }
+          ]]></code>
+        </codeSegment>
+      </codeSegments>
+    </class>
+    <class>
+      <name>RepositoryConfiguration</name>
+      <version>1.0.0</version>
+      <fields>
+        <field>
+          <name>id</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+            The repository identifier.
+          </description>
+        </field>
+        <field>
+          <name>name</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+            The descriptive name of the repository.
+          </description>
+        </field>
+        <field>
+          <name>directory</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+            The location of the repository to monitor.
+          </description>
+        </field>
+        <field>
+          <name>layout</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+            The layout of the repository. Valid values are "default" and "legacy".
+          </description>
+          <!-- TODO: should be able to detect this from the repository (perhaps by metadata at the root) -->
+          <defaultValue>default</defaultValue>
+        </field>
+        <field>
+          <name>includeSnapshots</name>
           <version>1.0.0</version>
           <type>boolean</type>
           <description>Whether to include snapshot versions in the discovery process</description>
           <defaultValue>false</defaultValue>
         </field>
         <field>
-          <name>discoveryBlackListPatterns</name>
+          <name>indexed</name>
+          <version>1.0.0</version>
+          <type>boolean</type>
+          <description>Whether to index the artifacts in this repository.</description>
+          <defaultValue>true</defaultValue>
+        </field>
+        <field>
+          <name>blackListPatterns</name>
           <version>1.0.0</version>
           <type>String</type>
           <description>Blacklisted patterns in the discovery process</description>
@@ -86,9 +174,21 @@
         <codeSegment>
           <version>1.0.0</version>
           <code><![CDATA[
+    public RepositoryConfiguration()
+    {
+        this.indexed = false; // for webwork
+    }
+
     public boolean isValid()
     {
-        return indexPath != null & repositoryDirectory != null;
+        boolean valid = true;
+
+        if ( directory == null )
+        {
+            valid = false;
+        }
+
+        return valid;
     }
           ]]></code>
         </codeSegment>

Modified: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/ConfiguredRepositoryFactory.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/ConfiguredRepositoryFactory.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/ConfiguredRepositoryFactory.java (original)
+++ maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/ConfiguredRepositoryFactory.java Fri Aug  4 01:39:03 2006
@@ -18,6 +18,8 @@
 
 import org.apache.maven.artifact.repository.ArtifactRepository;
 
+import java.util.List;
+
 /**
  * Create an artifact repository from the given configuration.
  *
@@ -31,6 +33,15 @@
      * Create an artifact repository from the given configuration.
      *
      * @param configuration the configuration
+     * @return the artifact repository
+     */
+    ArtifactRepository createRepository( RepositoryConfiguration configuration );
+
+    /**
+     * Create artifact repositories from the given configuration.
+     *
+     * @param configuration the configuration containing the repositories
+     * @return the artifact repositories
      */
-    ArtifactRepository createRepository( Configuration configuration );
+    List createRepositories( Configuration configuration );
 }

Modified: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java (original)
+++ maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java Fri Aug  4 01:39:03 2006
@@ -21,6 +21,9 @@
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -42,14 +45,25 @@
      */
     private ArtifactRepositoryFactory repoFactory;
 
-    public ArtifactRepository createRepository( Configuration configuration )
+    public ArtifactRepository createRepository( RepositoryConfiguration configuration )
     {
-        File repositoryDirectory = new File( configuration.getRepositoryDirectory() );
+        File repositoryDirectory = new File( configuration.getDirectory() );
         String repoDir = repositoryDirectory.toURI().toString();
 
-        ArtifactRepositoryLayout layout =
-            (ArtifactRepositoryLayout) repositoryLayouts.get( configuration.getRepositoryLayout() );
-        // TODO: real ID
+        ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) repositoryLayouts.get( configuration.getLayout() );
+        // TODO! real ID
         return repoFactory.createArtifactRepository( "test", repoDir, layout, null, null );
+    }
+
+    public List createRepositories( Configuration configuration )
+    {
+        List repositories = new ArrayList( configuration.getRepositories().size() );
+
+        for ( Iterator i = configuration.getRepositories().iterator(); i.hasNext(); )
+        {
+            repositories.add( createRepository( (RepositoryConfiguration) i.next() ) );
+        }
+
+        return repositories;
     }
 }

Modified: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/IndexerTask.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/IndexerTask.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/IndexerTask.java (original)
+++ maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/IndexerTask.java Fri Aug  4 01:39:03 2006
@@ -22,6 +22,7 @@
 import org.apache.maven.repository.configuration.ConfigurationStore;
 import org.apache.maven.repository.configuration.ConfigurationStoreException;
 import org.apache.maven.repository.configuration.ConfiguredRepositoryFactory;
+import org.apache.maven.repository.configuration.RepositoryConfiguration;
 import org.apache.maven.repository.discovery.ArtifactDiscoverer;
 import org.apache.maven.repository.discovery.DiscovererException;
 import org.apache.maven.repository.indexing.RepositoryArtifactIndex;
@@ -99,19 +100,28 @@
 
         try
         {
-            String blacklistedPatterns = configuration.getDiscoveryBlackListPatterns();
-            boolean includeSnapshots = configuration.isDiscoverSnapshots();
-
-            ArtifactRepository defaultRepository = repoFactory.createRepository( configuration );
-
-            String layoutProperty = configuration.getRepositoryLayout();
-            ArtifactDiscoverer discoverer = (ArtifactDiscoverer) artifactDiscoverers.get( layoutProperty );
-            List artifacts =
-                discoverer.discoverArtifacts( defaultRepository, "indexer", blacklistedPatterns, includeSnapshots );
-            if ( !artifacts.isEmpty() )
+            for ( Iterator i = configuration.getRepositories().iterator(); i.hasNext(); )
             {
-                getLogger().info( "Indexing " + artifacts.size() + " new artifacts" );
-                indexArtifact( artifacts, indexPath, defaultRepository );
+                RepositoryConfiguration repositoryConfiguration = (RepositoryConfiguration) i.next();
+
+                if ( repositoryConfiguration.isIndexed() )
+                {
+                    // TODO! include global ones
+                    String blacklistedPatterns = repositoryConfiguration.getBlackListPatterns();
+                    boolean includeSnapshots = repositoryConfiguration.isIncludeSnapshots();
+
+                    ArtifactRepository repository = repoFactory.createRepository( repositoryConfiguration );
+
+                    String layoutProperty = repositoryConfiguration.getLayout();
+                    ArtifactDiscoverer discoverer = (ArtifactDiscoverer) artifactDiscoverers.get( layoutProperty );
+                    List artifacts =
+                        discoverer.discoverArtifacts( repository, "indexer", blacklistedPatterns, includeSnapshots );
+                    if ( !artifacts.isEmpty() )
+                    {
+                        getLogger().info( "Indexing " + artifacts.size() + " new artifacts" );
+                        indexArtifact( artifacts, indexPath );
+                    }
+                }
             }
         }
         catch ( RepositoryIndexException e )
@@ -144,8 +154,7 @@
 
         try
         {
-            ArtifactRepository repository = repoFactory.createRepository( configuration );
-            RepositoryArtifactIndex artifactIndex = indexFactory.createStandardIndex( indexPath, repository );
+            RepositoryArtifactIndex artifactIndex = indexFactory.createStandardIndex( indexPath );
             if ( !artifactIndex.exists() )
             {
                 execute( configuration, indexPath );
@@ -157,10 +166,10 @@
         }
     }
 
-    private void indexArtifact( List artifacts, File indexPath, ArtifactRepository repository )
+    private void indexArtifact( List artifacts, File indexPath )
         throws RepositoryIndexException
     {
-        RepositoryArtifactIndex artifactIndex = indexFactory.createStandardIndex( indexPath, repository );
+        RepositoryArtifactIndex artifactIndex = indexFactory.createStandardIndex( indexPath );
         List records = new ArrayList();
         for ( Iterator i = artifacts.iterator(); i.hasNext(); )
         {

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryArtifactIndexFactory.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryArtifactIndexFactory.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryArtifactIndexFactory.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryArtifactIndexFactory.java Fri Aug  4 01:39:03 2006
@@ -16,8 +16,6 @@
  * limitations under the License.
  */
 
-import org.apache.maven.artifact.repository.ArtifactRepository;
-
 import java.io.File;
 
 /**
@@ -35,18 +33,16 @@
     /**
      * Method to create an instance of the standard index.
      *
-     * @param indexPath  the path where the index will be created/updated
-     * @param repository the repository where the indexed artifacts are located
+     * @param indexPath the path where the index will be created/updated
      * @return the index instance
      */
-    RepositoryArtifactIndex createStandardIndex( File indexPath, ArtifactRepository repository );
+    RepositoryArtifactIndex createStandardIndex( File indexPath );
 
     /**
      * Method to create an instance of the minimal index.
      *
-     * @param indexPath  the path where the index will be created/updated
-     * @param repository the repository where the indexed artifacts are located
+     * @param indexPath the path where the index will be created/updated
      * @return the index instance
      */
-    RepositoryArtifactIndex createMinimalIndex( File indexPath, ArtifactRepository repository );
+    RepositoryArtifactIndex createMinimalIndex( File indexPath );
 }

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/lucene/LuceneRepositoryArtifactIndexFactory.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/lucene/LuceneRepositoryArtifactIndexFactory.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/lucene/LuceneRepositoryArtifactIndexFactory.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/lucene/LuceneRepositoryArtifactIndexFactory.java Fri Aug  4 01:39:03 2006
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.repository.indexing.RepositoryArtifactIndex;
 import org.apache.maven.repository.indexing.RepositoryArtifactIndexFactory;
 
@@ -31,12 +30,12 @@
 public class LuceneRepositoryArtifactIndexFactory
     implements RepositoryArtifactIndexFactory
 {
-    public RepositoryArtifactIndex createStandardIndex( File indexPath, ArtifactRepository repository )
+    public RepositoryArtifactIndex createStandardIndex( File indexPath )
     {
         return new LuceneRepositoryArtifactIndex( indexPath, new LuceneStandardIndexRecordConverter() );
     }
 
-    public RepositoryArtifactIndex createMinimalIndex( File indexPath, ArtifactRepository repository )
+    public RepositoryArtifactIndex createMinimalIndex( File indexPath )
     {
         return new LuceneRepositoryArtifactIndex( indexPath, new LuceneMinimalIndexRecordConverter() );
     }

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneMinimalArtifactIndexSearchTest.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneMinimalArtifactIndexSearchTest.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneMinimalArtifactIndexSearchTest.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneMinimalArtifactIndexSearchTest.java Fri Aug  4 01:39:03 2006
@@ -84,7 +84,7 @@
 
         FileUtils.deleteDirectory( indexLocation );
 
-        index = factory.createMinimalIndex( indexLocation, repository );
+        index = factory.createMinimalIndex( indexLocation );
 
         records.put( "test-jar", recordFactory.createRecord( createArtifact( "test-jar" ) ) );
         records.put( "test-jar-jdk14",

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneMinimalArtifactIndexTest.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneMinimalArtifactIndexTest.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneMinimalArtifactIndexTest.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneMinimalArtifactIndexTest.java Fri Aug  4 01:39:03 2006
@@ -89,7 +89,7 @@
 
         FileUtils.deleteDirectory( indexLocation );
 
-        index = factory.createMinimalIndex( indexLocation, repository );
+        index = factory.createMinimalIndex( indexLocation );
     }
 
     public void testIndexExists()

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneStandardArtifactIndexSearchTest.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneStandardArtifactIndexSearchTest.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneStandardArtifactIndexSearchTest.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneStandardArtifactIndexSearchTest.java Fri Aug  4 01:39:03 2006
@@ -87,7 +87,7 @@
 
         FileUtils.deleteDirectory( indexLocation );
 
-        index = factory.createStandardIndex( indexLocation, repository );
+        index = factory.createStandardIndex( indexLocation );
 
         records.put( "test-jar", recordFactory.createRecord( createArtifact( "test-jar" ) ) );
         records.put( "test-jar-jdk14",

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneStandardArtifactIndexTest.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneStandardArtifactIndexTest.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneStandardArtifactIndexTest.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/lucene/LuceneStandardArtifactIndexTest.java Fri Aug  4 01:39:03 2006
@@ -89,7 +89,7 @@
 
         FileUtils.deleteDirectory( indexLocation );
 
-        index = factory.createStandardIndex( indexLocation, repository );
+        index = factory.createStandardIndex( indexLocation );
     }
 
     public void testIndexExists()

Modified: maven/repository-manager/trunk/maven-repository-reports-standard/src/main/java/org/apache/maven/repository/reporting/DuplicateArtifactFileReportProcessor.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-reports-standard/src/main/java/org/apache/maven/repository/reporting/DuplicateArtifactFileReportProcessor.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-reports-standard/src/main/java/org/apache/maven/repository/reporting/DuplicateArtifactFileReportProcessor.java (original)
+++ maven/repository-manager/trunk/maven-repository-reports-standard/src/main/java/org/apache/maven/repository/reporting/DuplicateArtifactFileReportProcessor.java Fri Aug  4 01:39:03 2006
@@ -64,7 +64,7 @@
     {
         if ( artifact.getFile() != null )
         {
-            RepositoryArtifactIndex index = indexFactory.createStandardIndex( new File( indexDirectory ), repository );
+            RepositoryArtifactIndex index = indexFactory.createStandardIndex( new File( indexDirectory ) );
 
             String checksum;
             try

Modified: maven/repository-manager/trunk/maven-repository-reports-standard/src/test/java/org/apache/maven/repository/reporting/DuplicateArtifactFileReportProcessorTest.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-reports-standard/src/test/java/org/apache/maven/repository/reporting/DuplicateArtifactFileReportProcessorTest.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-reports-standard/src/test/java/org/apache/maven/repository/reporting/DuplicateArtifactFileReportProcessorTest.java (original)
+++ maven/repository-manager/trunk/maven-repository-reports-standard/src/test/java/org/apache/maven/repository/reporting/DuplicateArtifactFileReportProcessorTest.java Fri Aug  4 01:39:03 2006
@@ -61,7 +61,7 @@
         RepositoryArtifactIndexFactory factory =
             (RepositoryArtifactIndexFactory) lookup( RepositoryArtifactIndexFactory.ROLE, "lucene" );
 
-        RepositoryArtifactIndex index = factory.createStandardIndex( indexDirectory, repository );
+        RepositoryArtifactIndex index = factory.createStandardIndex( indexDirectory );
 
         RepositoryIndexRecordFactory recordFactory =
             (RepositoryIndexRecordFactory) lookup( RepositoryIndexRecordFactory.ROLE, "standard" );

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BrowseAction.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BrowseAction.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BrowseAction.java (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BrowseAction.java Fri Aug  4 01:39:03 2006
@@ -22,7 +22,6 @@
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.MatchAllDocsQuery;
 import org.apache.lucene.search.TermQuery;
-import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.repository.configuration.Configuration;
 import org.apache.maven.repository.configuration.ConfigurationStore;
 import org.apache.maven.repository.configuration.ConfigurationStoreException;
@@ -273,9 +272,7 @@
         Configuration configuration = configurationStore.getConfigurationFromStore();
         File indexPath = new File( configuration.getIndexPath() );
 
-        ArtifactRepository repository = repositoryFactory.createRepository( configuration );
-
-        return factory.createStandardIndex( indexPath, repository );
+        return factory.createStandardIndex( indexPath );
     }
 
     public List getGroups()

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/SearchAction.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/SearchAction.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/SearchAction.java (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/SearchAction.java Fri Aug  4 01:39:03 2006
@@ -22,7 +22,6 @@
 import org.apache.lucene.queryParser.MultiFieldQueryParser;
 import org.apache.lucene.queryParser.ParseException;
 import org.apache.lucene.search.TermQuery;
-import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.repository.configuration.Configuration;
 import org.apache.maven.repository.configuration.ConfigurationStore;
 import org.apache.maven.repository.configuration.ConfigurationStoreException;
@@ -147,9 +146,7 @@
         Configuration configuration = configurationStore.getConfigurationFromStore();
         File indexPath = new File( configuration.getIndexPath() );
 
-        ArtifactRepository repository = repositoryFactory.createRepository( configuration );
-
-        return factory.createStandardIndex( indexPath, repository );
+        return factory.createStandardIndex( indexPath );
     }
 
     public String doInput()

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java Fri Aug  4 01:39:03 2006
@@ -19,7 +19,6 @@
 import com.opensymphony.xwork.ActionSupport;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.model.Model;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectBuilder;
@@ -31,9 +30,8 @@
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
-import java.io.File;
 import java.io.IOException;
-import java.util.Collections;
+import java.util.List;
 
 /**
  * Browse the repository.
@@ -74,9 +72,6 @@
     public String execute()
         throws ConfigurationStoreException, IOException, XmlPullParserException, ProjectBuildingException
     {
-        Configuration configuration = configurationStore.getConfigurationFromStore();
-        ArtifactRepository repository = repositoryFactory.createRepository( configuration );
-
         if ( StringUtils.isEmpty( groupId ) )
         {
             // TODO: i18n
@@ -98,18 +93,12 @@
             return ERROR;
         }
 
-        Artifact artifact = artifactFactory.createProjectArtifact( groupId, artifactId, version );
-        // TODO: is this going to be problematic because repository is remote format, but being used as local?
-        // TODO: should it try to use the repo manager as a remote repo, proxying out?
-        // TODO: maybe we can decouple the assembly parts of the project builder from the repository handling
-        MavenProject project = projectBuilder.buildFromRepository( artifact, Collections.EMPTY_LIST, repository );
+        Configuration configuration = configurationStore.getConfigurationFromStore();
+        List repositories = repositoryFactory.createRepositories( configuration );
 
-        if ( !new File( repository.getBasedir(), repository.pathOf( artifact ) ).exists() )
-        {
-            // TODO: i18n
-            addActionError( "The given artifact was not found in the repository" );
-            return ERROR;
-        }
+        Artifact artifact = artifactFactory.createProjectArtifact( groupId, artifactId, version );
+        // TODO: maybe we can decouple the assembly parts of the project builder from the repository handling to get rid of the temp repo
+        MavenProject project = projectBuilder.buildFromRepository( artifact, repositories, null );
 
         model = project.getModel();
 

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/ConfigureAction.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/ConfigureAction.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/ConfigureAction.java (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/ConfigureAction.java Fri Aug  4 01:39:03 2006
@@ -26,7 +26,6 @@
 import org.apache.maven.repository.configuration.InvalidConfigurationException;
 import org.apache.maven.repository.indexing.RepositoryIndexException;
 import org.apache.maven.repository.indexing.RepositoryIndexSearchException;
-import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
 import java.io.IOException;
@@ -55,33 +54,17 @@
         InvalidConfigurationException, ConfigurationChangeException
     {
         // 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?
 
         // Normalize the path
-        File file = new File( configuration.getRepositoryDirectory() );
-        configuration.setRepositoryDirectory( file.getCanonicalPath() );
+        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
         }
 
-        // TODO: these defaults belong in the model. They shouldn't be stored here, as you want them to re-default
-        // should the repository change even if these didn't
-
-        // TODO: if these are changed, do we move the index or recreate it?
-
-        // TODO: these should be on an advanced configuration form, not the standard one
-        if ( StringUtils.isEmpty( configuration.getIndexPath() ) )
-        {
-            configuration.setIndexPath(
-                new File( configuration.getRepositoryDirectory(), ".index" ).getAbsolutePath() );
-        }
-        if ( StringUtils.isEmpty( configuration.getMinimalIndexPath() ) )
-        {
-            configuration.setMinimalIndexPath(
-                new File( configuration.getRepositoryDirectory(), ".index-minimal" ).getAbsolutePath() );
-        }
-
         // Just double checking that our validation routines line up with what is expected in the configuration
         assert configuration.isValid();
 
@@ -94,7 +77,7 @@
         return SUCCESS;
     }
 
-    public String doInput()
+    public String input()
     {
         return INPUT;
     }

Added: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction.java?rev=428659&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction.java (added)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction.java Fri Aug  4 01:39:03 2006
@@ -0,0 +1,163 @@
+package org.apache.maven.repository.manager.web.action.admin;
+
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed 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 com.opensymphony.webwork.interceptor.ParameterAware;
+import com.opensymphony.xwork.ActionSupport;
+import com.opensymphony.xwork.ModelDriven;
+import com.opensymphony.xwork.Preparable;
+import org.apache.maven.repository.configuration.Configuration;
+import org.apache.maven.repository.configuration.ConfigurationChangeException;
+import org.apache.maven.repository.configuration.ConfigurationStore;
+import org.apache.maven.repository.configuration.ConfigurationStoreException;
+import org.apache.maven.repository.configuration.InvalidConfigurationException;
+import org.apache.maven.repository.configuration.RepositoryConfiguration;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Configures the application repositories.
+ *
+ * @plexus.component role="com.opensymphony.xwork.Action" role-hint="configureRepositoryAction"
+ */
+public class ConfigureRepositoryAction
+    extends ActionSupport
+    implements ModelDriven, Preparable, ParameterAware
+{
+    /**
+     * @plexus.requirement
+     */
+    private ConfigurationStore configurationStore;
+
+    /**
+     * The repository.
+     */
+    private RepositoryConfiguration repository;
+
+    /**
+     * The repository ID to lookup when editing a repository.
+     */
+    private String repoId;
+
+    /**
+     * The previously read configuration.
+     */
+    private Configuration configuration;
+
+    public String add()
+        throws IOException, ConfigurationStoreException, InvalidConfigurationException, ConfigurationChangeException
+    {
+        // TODO: if this didn't come from the form, go to configure.action instead of going through with re-saving what was just loaded
+
+        RepositoryConfiguration existingRepository = configuration.getRepositoryById( repository.getId() );
+        if ( existingRepository != null )
+        {
+            addFieldError( "id", "A repository with that id already exists" );
+            return INPUT;
+        }
+
+        return addRepository();
+    }
+
+    public String edit()
+        throws IOException, ConfigurationStoreException, InvalidConfigurationException, ConfigurationChangeException
+    {
+        // TODO: if this didn't come from the form, go to configure.action instead of going through with re-saving what was just loaded
+
+        RepositoryConfiguration existingRepository = configuration.getRepositoryById( repository.getId() );
+        configuration.removeRepository( existingRepository );
+
+        return addRepository();
+    }
+
+    private String addRepository()
+        throws IOException, ConfigurationStoreException, InvalidConfigurationException, ConfigurationChangeException
+    {
+        normalizeRepository();
+
+        // Just double checking that our validation routines line up with what is expected in the configuration
+        assert repository.isValid();
+
+        configuration.addRepository( repository );
+
+        configurationStore.storeConfiguration( configuration );
+
+        // TODO: do we need to check if indexing is needed?
+
+        addActionMessage( "Successfully saved configuration" );
+
+        return SUCCESS;
+    }
+
+    private void normalizeRepository()
+        throws IOException
+    {
+        // 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
+        }
+    }
+
+    public String input()
+    {
+        return INPUT;
+    }
+
+    public Object getModel()
+    {
+        if ( repository == null )
+        {
+            repository = configuration.getRepositoryById( repoId );
+        }
+        if ( repository == null )
+        {
+            repository = new RepositoryConfiguration();
+        }
+        return repository;
+    }
+
+    public void prepare()
+        throws ConfigurationStoreException
+    {
+        configuration = configurationStore.getConfigurationFromStore();
+    }
+
+    public String getRepoId()
+    {
+        return repoId;
+    }
+
+    public void setRepoId( String repoId )
+    {
+        this.repoId = repoId;
+    }
+
+    public void setParameters( Map map )
+    {
+        // TODO! can I replace with repository.id or something?
+        if ( map.containsKey( "repoId" ) )
+        {
+            repoId = ( (String[]) map.get( "repoId" ) )[0];
+        }
+    }
+}

Propchange: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/interceptor/ConfigurationInterceptor.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/interceptor/ConfigurationInterceptor.java?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/interceptor/ConfigurationInterceptor.java (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/interceptor/ConfigurationInterceptor.java Fri Aug  4 01:39:03 2006
@@ -43,7 +43,14 @@
 
         if ( !configuration.isValid() )
         {
-            return "config-needed";
+            if ( configuration.getRepositories().isEmpty() )
+            {
+                return "config-repository-needed";
+            }
+            else
+            {
+                return "config-needed";
+            }
         }
         else
         {

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/org/apache/maven/repository/manager/web/action/admin/ConfigureAction-validation.xml
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/org/apache/maven/repository/manager/web/action/admin/ConfigureAction-validation.xml?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/org/apache/maven/repository/manager/web/action/admin/ConfigureAction-validation.xml (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/org/apache/maven/repository/manager/web/action/admin/ConfigureAction-validation.xml Fri Aug  4 01:39:03 2006
@@ -18,9 +18,9 @@
     "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
 
 <validators>
-  <field name="repositoryDirectory">
+  <field name="indexPath">
     <field-validator type="requiredstring">
-      <message>You must enter the repository directory.</message>
+      <message>You must enter the index directory.</message>
     </field-validator>
   </field>
 </validators>

Added: maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction-validation.xml
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction-validation.xml?rev=428659&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction-validation.xml (added)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction-validation.xml Fri Aug  4 01:39:03 2006
@@ -0,0 +1,38 @@
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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.
+  -->
+
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+    "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+
+<validators>
+  <!-- TODO: constrain more -->
+  <field name="id">
+    <field-validator type="requiredstring">
+      <message>You must enter the repository identifier.</message>
+    </field-validator>
+  </field>
+  <field name="name">
+    <field-validator type="requiredstring">
+      <message>You must enter the repository name.</message>
+    </field-validator>
+  </field>
+  <field name="directory">
+    <field-validator type="requiredstring">
+      <message>You must enter the repository directory.</message>
+    </field-validator>
+  </field>
+  <!-- TODO: validate layout -->
+</validators>
\ No newline at end of file

Propchange: maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction-validation.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/org/apache/maven/repository/manager/web/action/admin/ConfigureRepositoryAction-validation.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml Fri Aug  4 01:39:03 2006
@@ -23,8 +23,7 @@
   <!-- Include webwork defaults (from WebWork JAR). -->
   <include file="webwork-default.xml"/>
 
-  <!-- Configuration for the default package. -->
-  <package name="default" extends="webwork-default" namespace="/">
+  <package name="base" extends="webwork-default">
     <interceptors>
       <interceptor name="configuration" class="configurationInterceptor"/>
       <interceptor-stack name="configuredStack">
@@ -38,9 +37,32 @@
 
     <global-results>
       <!-- TODO: might want an extra message on the configure page when this first happens -->
-      <result name="config-needed" type="redirect">/admin/configure.action</result>
+      <!-- TODO: can we send them back to the original location afterwards? -->
+      <result name="config-needed" type="redirect-action">
+        <param name="namespace">/admin</param>
+        <param name="actionName">configure</param>
+      </result>
+      <result name="config-repository-needed" type="redirect-action">
+        <param name="namespace">/admin</param>
+        <!-- TODO should use param name=method, but WW 2.2.2 doesn't recognise it -->
+        <param name="actionName">addRepository!input</param>
+      </result>
       <result name="error">/WEB-INF/jsp/generalError.jsp</result>
     </global-results>
+  </package>
+
+  <!-- Configuration for the default package. -->
+  <package name="default" extends="base" namespace="/">
+    <interceptors>
+      <interceptor name="configuration" class="configurationInterceptor"/>
+      <interceptor-stack name="configuredStack">
+        <interceptor-ref name="defaultStack"/>
+        <interceptor-ref name="configuration"/>
+      </interceptor-stack>
+    </interceptors>
+
+    <!-- Default interceptor stack. -->
+    <default-interceptor-ref name="configuredStack"/>
 
     <action name="index" class="searchAction" method="input">
       <result name="input">/WEB-INF/jsp/quickSearch.jsp</result>
@@ -64,7 +86,6 @@
       <result name="error">/WEB-INF/jsp/findArtifact.jsp</result>
       <result name="noResults">/WEB-INF/jsp/noResults.jsp</result>
       <!-- TODO! -->
-      <!-- TODO! use redirect-action instead -->
       <result name="artifact" type="redirect">
         /browse/${searchResults[0].groupId}/${searchResults[0].artifactId}/${searchResults[0].version}
       </result>
@@ -100,24 +121,35 @@
   </package>
 
   <!-- Configuration for the admin package. -->
-  <package name="admin" namespace="/admin" extends="webwork-default">
-    <default-interceptor-ref name="defaultStack"/>
-
+  <package name="admin" namespace="/admin" extends="base">
     <action name="index" class="configureAction" method="input">
       <result name="input">/WEB-INF/jsp/admin/index.jsp</result>
     </action>
 
+    <action name="addRepository" class="configureRepositoryAction" method="add">
+      <result name="input">/WEB-INF/jsp/admin/addRepository.jsp</result>
+      <result type="redirect-action">index</result>
+      <interceptor-ref name="defaultStack"/>
+    </action>
+
+    <action name="editRepository" class="configureRepositoryAction" method="edit">
+      <result name="input">/WEB-INF/jsp/admin/editRepository.jsp</result>
+      <result type="redirect-action">index</result>
+    </action>
+
     <action name="configure" class="configureAction" method="input">
       <result name="input">/WEB-INF/jsp/admin/configure.jsp</result>
+      <interceptor-ref name="defaultStack"/>
     </action>
 
     <action name="saveConfiguration" class="configureAction">
       <result name="input">/WEB-INF/jsp/admin/configure.jsp</result>
       <result>/WEB-INF/jsp/admin/index.jsp</result>
+      <interceptor-ref name="defaultStack"/>
     </action>
 
     <action name="runIndexer" class="runIndexerAction">
-      <result type="redirect">/admin/index.action</result>
+      <result type="redirect-action">index</result>
     </action>
   </package>
 </xwork>

Added: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp?rev=428659&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp (added)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp Fri Aug  4 01:39:03 2006
@@ -0,0 +1,43 @@
+<%--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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.
+  --%>
+
+<%@ taglib prefix="ww" uri="/webwork" %>
+
+<html>
+<head>
+  <title>Configuration</title>
+  <ww:head />
+</head>
+
+<body>
+
+<h1>Configuration</h1>
+
+<div id="contentArea">
+
+  <h2>Add Managed Repository</h2>
+
+  <ww:actionmessage />
+  <ww:form method="post" action="addRepository" namespace="/admin" validate="true">
+    <ww:textfield name="id" label="Identifier" size="10" />
+    <%@ include file="/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf" %>
+    <ww:checkbox name="indexed" fieldValue="true" value="true" label="Indexed" />
+    <ww:submit value="Add Repository" />
+  </ww:form>
+</div>
+
+</body>
+</html>
\ No newline at end of file

Propchange: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/configure.jsp
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/configure.jsp?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/configure.jsp (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/configure.jsp Fri Aug  4 01:39:03 2006
@@ -27,14 +27,12 @@
 <h1>Configuration</h1>
 
 <div id="contentArea">
-  <div id="searchBox">
-    <ww:actionmessage />
-    <ww:form method="post" action="saveConfiguration" namespace="/admin" validate="true">
-      <ww:textfield name="repositoryDirectory" label="Repository Directory" size="100" />
-      <ww:textfield name="indexerCronExpression" label="Indexing Cron Expression" />
-      <ww:submit value="Save Configuration" />
-    </ww:form>
-  </div>
+  <ww:actionmessage />
+  <ww:form method="post" action="saveConfiguration" namespace="/admin" validate="true">
+    <ww:textfield name="indexPath" label="Index Directory" size="100" />
+    <ww:textfield name="indexerCronExpression" label="Indexing Schedule" />
+    <ww:submit value="Save Configuration" />
+  </ww:form>
 </div>
 
 </body>

Added: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp?rev=428659&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp (added)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp Fri Aug  4 01:39:03 2006
@@ -0,0 +1,43 @@
+<%--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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.
+  --%>
+
+<%@ taglib prefix="ww" uri="/webwork" %>
+
+<html>
+<head>
+  <title>Configuration</title>
+  <ww:head />
+</head>
+
+<body>
+
+<h1>Configuration</h1>
+
+<div id="contentArea">
+
+  <h2>Edit Managed Repository</h2>
+
+  <ww:actionmessage />
+  <ww:form method="post" action="editRepository" namespace="/admin" validate="true">
+    <ww:hidden name="id" />
+    <%@ include file="/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf" %>
+    <ww:checkbox name="indexed" fieldValue="true" label="Indexed" />
+    <ww:submit value="Change Repository" />
+  </ww:form>
+</div>
+
+</body>
+</html>
\ No newline at end of file

Propchange: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf?rev=428659&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf (added)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf Fri Aug  4 01:39:03 2006
@@ -0,0 +1,23 @@
+<%--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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.
+  --%>
+<%@ taglib prefix="ww" uri="/webwork" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<ww:textfield name="name" label="Name" size="50" />
+<ww:textfield name="directory" label="Directory" size="100" />
+<c:set var="list">\#{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}</c:set>
+<ww:select list="${list}" name="layout" label="Type" />
+<ww:checkbox name="includeSnapshots" fieldValue="true" label="Snapshots Included" />

Propchange: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/index.jsp
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/index.jsp?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/index.jsp (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/admin/index.jsp Fri Aug  4 01:39:03 2006
@@ -15,6 +15,7 @@
   --%>
 
 <%@ taglib prefix="ww" uri="/webwork" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 
 <html>
 <head>
@@ -28,11 +29,12 @@
 
 <div id="contentArea">
   <h2>Configuration</h2>
+
   <table>
     <tr>
-      <th>Repository Directory</th>
+      <th>Index Directory</th>
       <td>
-        <ww:property value="repositoryDirectory" />
+        <ww:property value="indexPath" />
       </td>
       <td></td>
     </tr>
@@ -45,12 +47,82 @@
       <%-- TODO: a "delete index and run now" operation should be here too (really clean, remove deletions that didn't get picked up) --%>
       <td><a href="<ww:url action="runIndexer" />">Run Now</a></td>
     </tr>
-    <tr>
-      <td><a href="<ww:url action="configure" />">Edit Configuration</a></td>
-      <td></td>
-      <td></td>
-    </tr>
   </table>
+
+  <p>
+    <a href="<ww:url action="configure" />">Edit Configuration</a>
+  </p>
+
+  <h2>Managed Repositories</h2>
+
+  <ww:set name="repositories" value="repositories" />
+  <c:if test="${empty(repositories)}">
+    <strong>There are no managed repositories configured yet.</strong>
+  </c:if>
+  <c:forEach items="${repositories}" var="repository" varStatus="i">
+    <div>
+      <div style="float: right">
+          <%-- TODO! replace with icons --%>
+        <a href="<ww:url action="editRepository" method="input"><ww:param name="repoId" value="%{'${repository.id}'}" /></ww:url>">Edit
+          Repository</a> | <a href="#">Delete Repository</a>
+          <%-- TODO! serious confirmation, implement, prompt whether to delete contents too, remember index --%>
+      </div>
+      <h3>${repository.name}</h3>
+      <table>
+        <tr>
+          <th>Identifier</th>
+          <td>
+              <%-- TODO! must be unique among managed repos --%>
+            <code>${repository.id}</code>
+          </td>
+        </tr>
+        <tr>
+          <th>Directory</th>
+          <td>${repository.directory}</td>
+        </tr>
+        <tr>
+          <th>Type</th>
+          <!-- TODO: can probably just use layout appended to a key prefix in i18n to simplify this -->
+          <td>
+            <c:choose>
+              <c:when test="${repository.layout == 'default'}">
+                Maven 2.x Repository
+              </c:when>
+              <c:otherwise>
+                Maven 1.x Repository
+              </c:otherwise>
+            </c:choose>
+          </td>
+        </tr>
+        <tr>
+          <th>Snapshots Included</th>
+          <td>
+            <c:if test="${!repository.includeSnapshots}">
+              <span class="statusFailed">NO</span>
+            </c:if>
+            <c:if test="${repository.includeSnapshots}">
+              <span class="statusOk">YES</span>
+            </c:if>
+          </td>
+        </tr>
+        <tr>
+          <th>Indexed</th>
+          <td>
+            <c:if test="${!repository.indexed}">
+              <span class="statusFailed">NO</span>
+            </c:if>
+            <c:if test="${repository.indexed}">
+              <span class="statusOk">YES</span>
+            </c:if>
+          </td>
+        </tr>
+      </table>
+    </div>
+  </c:forEach>
+
+  <p>
+    <a href="<ww:url action="addRepository" method="input" />">Add Repository</a>
+  </p>
 </div>
 
 </body>

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp Fri Aug  4 01:39:03 2006
@@ -108,7 +108,10 @@
         <my:currentWWUrl action="index" namespace="/admin">Administration</my:currentWWUrl>
         <ul>
           <li class="none">
-            <my:currentWWUrl action="configure" namespace="/admin">Configuration</my:currentWWUrl>
+            <my:currentWWUrl action="proxied" namespace="/admin">Proxied Repositories</my:currentWWUrl>
+          </li>
+          <li class="none">
+            <my:currentWWUrl action="synced" namespace="/admin">Synced Repositories</my:currentWWUrl>
           </li>
         </ul>
       </li>

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/css/site.css
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/css/site.css?rev=428659&r1=428658&r2=428659&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/css/site.css (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/css/site.css Fri Aug  4 01:39:03 2006
@@ -82,6 +82,12 @@
     padding: 0.5em 1em 0.5em 1em;
 }
 
+.statusWarn {
+    color: orange;
+    font-weight: bold;
+}
+*/
+
 .statusOk {
     color: green;
     font-weight: bold;
@@ -92,12 +98,6 @@
     font-weight: bold;
 }
 
-.statusWarn {
-    color: orange;
-    font-weight: bold;
-}
-*/
-
 /* WebWork validation failures */
 .errorMessage {
     color: red;
@@ -107,9 +107,7 @@
 .actionMessage {
     font-weight: bold;
 }
-}
-    font-weight: bold;
-}
+
 sWarn {
     color: orange;
     font-weight: bold;
@@ -122,5 +120,8 @@
 }
 
 .actionMessage {
+    font-weight: bold;
+}
+
     font-weight: bold;
 }