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/07/20 05:10:40 UTC

svn commit: r423734 - 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/ maven-repository-core/src/main/java/or...

Author: brett
Date: Wed Jul 19 20:10:39 2006
New Revision: 423734

URL: http://svn.apache.org/viewvc?rev=423734&view=rev
Log:
starting to move the discoverer (indexer) over to the core

Added:
    maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationChangeException.java   (with props)
    maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/InvalidConfigurationException.java   (with props)
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/ConfiguredRepositoryFactory.java   (with props)
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java   (with props)
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/DefaultRepositoryTaskScheduler.java   (with props)
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/IndexerTask.java   (with props)
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTask.java   (with props)
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTaskJob.java
      - copied, changed from r421497, maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTaskScheduler.java   (with props)
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/TaskExecutionException.java   (with props)
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/RunIndexerAction.java   (with props)
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/include/
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/include/quickSearchForm.jspf   (with props)
Removed:
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/execution/DiscovererExecution.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
Modified:
    maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationChangeListener.java
    maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationStore.java
    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/pom.xml
    maven/repository-manager/trunk/maven-repository-webapp/pom.xml
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/GeneralSearchAction.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/PackageSearchAction.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/QuickSearchAction.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/utils/ConfigurationManager.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/plexus/plexus.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/quickSearch.jsp
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp

Added: maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationChangeException.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationChangeException.java?rev=423734&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationChangeException.java (added)
+++ maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationChangeException.java Wed Jul 19 20:10:39 2006
@@ -0,0 +1,31 @@
+package org.apache.maven.repository.configuration;
+
+/*
+ * 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.
+ */
+
+/**
+ * An error changing the configuration
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public class ConfigurationChangeException
+    extends Exception
+{
+    public ConfigurationChangeException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+}

Propchange: maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationChangeException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationChangeException.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationChangeListener.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationChangeListener.java?rev=423734&r1=423733&r2=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationChangeListener.java (original)
+++ maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationChangeListener.java Wed Jul 19 20:10:39 2006
@@ -28,6 +28,9 @@
      * Notify the object that there has been a configuration change.
      *
      * @param configuration the new configuration
+     * @throws InvalidConfigurationException if there is a problem with the new configuration
+     * @throws ConfigurationChangeException  if there is a problem changing the configuration, but the configuration is valid
      */
-    void notifyOfConfigurationChange( Configuration configuration );
+    void notifyOfConfigurationChange( Configuration configuration )
+        throws InvalidConfigurationException, ConfigurationChangeException;
 }

Modified: maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationStore.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationStore.java?rev=423734&r1=423733&r2=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationStore.java (original)
+++ maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/ConfigurationStore.java Wed Jul 19 20:10:39 2006
@@ -43,5 +43,12 @@
      * @param configuration the configuration to store
      */
     void storeConfiguration( Configuration configuration )
-        throws ConfigurationStoreException;
+        throws ConfigurationStoreException, InvalidConfigurationException, ConfigurationChangeException;
+
+    /**
+     * Add a configuration change listener.
+     *
+     * @param listener the listener
+     */
+    void addChangeListener( ConfigurationChangeListener listener );
 }

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=423734&r1=423733&r2=423734&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 Wed Jul 19 20:10:39 2006
@@ -106,7 +106,7 @@
     }
 
     public void storeConfiguration( Configuration configuration )
-        throws ConfigurationStoreException
+        throws ConfigurationStoreException, InvalidConfigurationException, ConfigurationChangeException
     {
         for ( Iterator i = listeners.iterator(); i.hasNext(); )
         {
@@ -132,5 +132,10 @@
         {
             IOUtil.close( fileWriter );
         }
+    }
+
+    public void addChangeListener( ConfigurationChangeListener listener )
+    {
+        listeners.add( listener );
     }
 }

Added: maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/InvalidConfigurationException.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/InvalidConfigurationException.java?rev=423734&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/InvalidConfigurationException.java (added)
+++ maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/InvalidConfigurationException.java Wed Jul 19 20:10:39 2006
@@ -0,0 +1,40 @@
+package org.apache.maven.repository.configuration;
+
+/*
+ * 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.
+ */
+
+/**
+ * An error in the configuration.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public class InvalidConfigurationException
+    extends Exception
+{
+    private final String name;
+
+    public InvalidConfigurationException( String name, String message, Throwable cause )
+    {
+        super( message, cause );
+
+        this.name = name;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+}

Propchange: maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/InvalidConfigurationException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-configuration/src/main/java/org/apache/maven/repository/configuration/InvalidConfigurationException.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

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=423734&r1=423733&r2=423734&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 Wed Jul 19 20:10:39 2006
@@ -55,11 +55,18 @@
           </description>
         </field>
         <field>
-          <name>discoveryCronExpression</name>
+          <name>indexerCronExpression</name>
           <version>1.0.0</version>
           <type>String</type>
-          <description>When to run the discovery mechanism.</description>
-          <defaultValue>0 0 8 * * ?</defaultValue>
+          <description>When to run the indexing mechanism. Default is every hour on the hour.</description>
+          <defaultValue>0 0 * * * ?</defaultValue>
+        </field>
+        <field>
+          <name>converterCronExpression</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <description>When to run the converter mechanism. Default is every 4 hours, on the half hour.</description>
+          <defaultValue>0 30 0/4 * * ?</defaultValue>
         </field>
         <field>
           <name>discoverSnapshots</name>

Modified: maven/repository-manager/trunk/maven-repository-core/pom.xml
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-core/pom.xml?rev=423734&r1=423733&r2=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-core/pom.xml (original)
+++ maven/repository-manager/trunk/maven-repository-core/pom.xml Wed Jul 19 20:10:39 2006
@@ -12,6 +12,10 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.maven.repository</groupId>
+      <artifactId>maven-repository-configuration</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.repository</groupId>
       <artifactId>maven-repository-converter</artifactId>
     </dependency>
     <dependency>
@@ -21,7 +25,12 @@
     <dependency>
       <groupId>org.apache.maven.repository</groupId>
       <artifactId>maven-repository-reports-standard</artifactId>
-    </dependency>    
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-quartz</artifactId>
+      <version>1.0-alpha-2</version>
+    </dependency>
     <!-- Testing -->
     <dependency>
       <groupId>junit</groupId>

Added: 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=423734&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/ConfiguredRepositoryFactory.java (added)
+++ maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/ConfiguredRepositoryFactory.java Wed Jul 19 20:10:39 2006
@@ -0,0 +1,36 @@
+package org.apache.maven.repository.configuration;
+
+/*
+ * 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 org.apache.maven.artifact.repository.ArtifactRepository;
+
+/**
+ * Create an artifact repository from the given configuration.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public interface ConfiguredRepositoryFactory
+{
+    String ROLE = ConfiguredRepositoryFactory.class.getName();
+
+    /**
+     * Create an artifact repository from the given configuration.
+     *
+     * @param configuration the configuration
+     */
+    ArtifactRepository createRepository( Configuration configuration );
+}

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/ConfiguredRepositoryFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/ConfiguredRepositoryFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 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=423734&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java (added)
+++ maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java Wed Jul 19 20:10:39 2006
@@ -0,0 +1,55 @@
+package org.apache.maven.repository.configuration;
+
+/*
+ * 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 org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
+import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * Create artifact repositories from a configuration.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @plexus.component role="org.apache.maven.repository.configuration.ConfiguredRepositoryFactory"
+ */
+public class DefaultConfiguredRepositoryFactory
+    implements ConfiguredRepositoryFactory
+{
+    /**
+     * @plexus.requirement role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout"
+     */
+    private Map repositoryLayouts;
+
+    /**
+     * @plexus.requirement
+     */
+    private ArtifactRepositoryFactory repoFactory;
+
+    public ArtifactRepository createRepository( Configuration configuration )
+    {
+        File repositoryDirectory = new File( configuration.getRepositoryDirectory() );
+        String repoDir = repositoryDirectory.toURI().toString();
+
+        ArtifactRepositoryLayout layout =
+            (ArtifactRepositoryLayout) repositoryLayouts.get( configuration.getRepositoryLayout() );
+        // TODO: real ID
+        return repoFactory.createArtifactRepository( "test", repoDir, layout, null, null );
+    }
+}

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/DefaultRepositoryTaskScheduler.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/DefaultRepositoryTaskScheduler.java?rev=423734&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/DefaultRepositoryTaskScheduler.java (added)
+++ maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/DefaultRepositoryTaskScheduler.java Wed Jul 19 20:10:39 2006
@@ -0,0 +1,164 @@
+package org.apache.maven.repository.scheduler;
+
+/*
+ * 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 org.apache.maven.repository.configuration.Configuration;
+import org.apache.maven.repository.configuration.ConfigurationChangeException;
+import org.apache.maven.repository.configuration.ConfigurationChangeListener;
+import org.apache.maven.repository.configuration.ConfigurationStore;
+import org.apache.maven.repository.configuration.ConfigurationStoreException;
+import org.apache.maven.repository.configuration.InvalidConfigurationException;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException;
+import org.codehaus.plexus.scheduler.AbstractJob;
+import org.codehaus.plexus.scheduler.Scheduler;
+import org.quartz.CronTrigger;
+import org.quartz.JobDataMap;
+import org.quartz.JobDetail;
+import org.quartz.SchedulerException;
+
+import java.text.ParseException;
+
+/**
+ * Default implementation of a scheduling component for the application.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @todo should we use plexus-taskqueue instead of or in addition to this?
+ * @plexus.component role="org.apache.maven.repository.scheduler.RepositoryTaskScheduler"
+ */
+public class DefaultRepositoryTaskScheduler
+    extends AbstractLogEnabled
+    implements RepositoryTaskScheduler, Startable, ConfigurationChangeListener
+{
+    /**
+     * @plexus.requirement
+     */
+    private Scheduler scheduler;
+
+    /**
+     * @plexus.requirement
+     */
+    private ConfigurationStore configurationStore;
+
+    private static final String DISCOVERER_GROUP = "DISCOVERER";
+
+    private static final String INDEXER_JOB = "indexerTask";
+
+    /**
+     * @plexus.requirement role-hint="indexer"
+     */
+    private RepositoryTask indexerTask;
+
+    public void start()
+        throws StartingException
+    {
+        Configuration configuration;
+        try
+        {
+            configuration = configurationStore.getConfigurationFromStore();
+            configurationStore.addChangeListener( this );
+        }
+        catch ( ConfigurationStoreException e )
+        {
+            throw new StartingException( "Unable to read configuration from the store", e );
+        }
+
+        try
+        {
+            scheduleJobs( configuration );
+        }
+        catch ( ParseException e )
+        {
+            throw new StartingException( "Invalid configuration: " + configuration.getIndexerCronExpression(), e );
+        }
+        catch ( SchedulerException e )
+        {
+            throw new StartingException( "Unable to start scheduler: " + e.getMessage(), e );
+        }
+    }
+
+    private void scheduleJobs( Configuration configuration )
+        throws ParseException, SchedulerException
+    {
+        JobDetail jobDetail = new JobDetail( INDEXER_JOB, DISCOVERER_GROUP, RepositoryTaskJob.class );
+        JobDataMap dataMap = new JobDataMap();
+        dataMap.put( AbstractJob.LOGGER, getLogger() );
+        dataMap.put( RepositoryTaskJob.TASK_KEY, indexerTask );
+        jobDetail.setJobDataMap( dataMap );
+
+        getLogger().info( "Scheduling indexer: " + configuration.getIndexerCronExpression() );
+        CronTrigger trigger =
+            new CronTrigger( INDEXER_JOB + "Trigger", DISCOVERER_GROUP, configuration.getIndexerCronExpression() );
+        scheduler.scheduleJob( jobDetail, trigger );
+
+        try
+        {
+            indexerTask.executeNowIfNeeded();
+        }
+        catch ( TaskExecutionException e )
+        {
+            getLogger().error( "Error executing task first time, continuing anyway: " + e.getMessage(), e );
+        }
+
+        // TODO: wire in the converter
+    }
+
+    public void stop()
+        throws StoppingException
+    {
+        try
+        {
+            scheduler.unscheduleJob( INDEXER_JOB, DISCOVERER_GROUP );
+        }
+        catch ( SchedulerException e )
+        {
+            throw new StoppingException( "Unable to unschedule tasks", e );
+        }
+    }
+
+    public void notifyOfConfigurationChange( Configuration configuration )
+        throws InvalidConfigurationException, ConfigurationChangeException
+    {
+        try
+        {
+            stop();
+
+            scheduleJobs( configuration );
+        }
+        catch ( StoppingException e )
+        {
+            throw new ConfigurationChangeException( "Unable to unschedule previous tasks", e );
+        }
+        catch ( ParseException e )
+        {
+            throw new InvalidConfigurationException( "discoveryCronExpression", "Invalid cron expression", e );
+        }
+        catch ( SchedulerException e )
+        {
+            throw new ConfigurationChangeException( "Unable to schedule new tasks", e );
+        }
+    }
+
+    public void runIndexer()
+        throws TaskExecutionException
+    {
+        indexerTask.execute();
+
+    }
+}

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/DefaultRepositoryTaskScheduler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/DefaultRepositoryTaskScheduler.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 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=423734&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/IndexerTask.java (added)
+++ maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/IndexerTask.java Wed Jul 19 20:10:39 2006
@@ -0,0 +1,210 @@
+package org.apache.maven.repository.scheduler;
+
+/*
+ * 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 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;
+import org.apache.maven.repository.configuration.ConfiguredRepositoryFactory;
+import org.apache.maven.repository.discovery.ArtifactDiscoverer;
+import org.apache.maven.repository.discovery.MetadataDiscoverer;
+import org.apache.maven.repository.indexing.ArtifactRepositoryIndex;
+import org.apache.maven.repository.indexing.MetadataRepositoryIndex;
+import org.apache.maven.repository.indexing.PomRepositoryIndex;
+import org.apache.maven.repository.indexing.RepositoryIndexException;
+import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Task for discovering changes in the repository.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @plexus.component role="org.apache.maven.repository.scheduler.RepositoryTask" role-hint="indexer"
+ */
+public class IndexerTask
+    extends AbstractLogEnabled
+    implements RepositoryTask
+{
+    /**
+     * Configuration store.
+     *
+     * @plexus.requirement
+     */
+    private ConfigurationStore configurationStore;
+
+    /**
+     * @plexus.requirement
+     */
+    private RepositoryIndexingFactory indexFactory;
+
+    /**
+     * @plexus.requirement
+     */
+    private ConfiguredRepositoryFactory repoFactory;
+
+    /**
+     * @plexus.requirement role="org.apache.maven.repository.discovery.ArtifactDiscoverer"
+     */
+    private Map artifactDiscoverers;
+
+    /**
+     * @plexus.requirement role="org.apache.maven.repository.discovery.MetadataDiscoverer"
+     */
+    private Map metadataDiscoverers;
+
+    public void execute()
+        throws TaskExecutionException
+    {
+        Configuration configuration;
+        try
+        {
+            configuration = configurationStore.getConfigurationFromStore();
+        }
+        catch ( ConfigurationStoreException e )
+        {
+            throw new TaskExecutionException( e.getMessage(), e );
+        }
+
+        File indexPath = new File( configuration.getIndexPath() );
+
+        execute( configuration, indexPath );
+    }
+
+    private void execute( Configuration configuration, File indexPath )
+        throws TaskExecutionException
+    {
+        getLogger().info( "Starting repository discovery process" );
+
+        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, blacklistedPatterns, includeSnapshots );
+            if ( !artifacts.isEmpty() )
+            {
+                getLogger().info( "Indexing " + artifacts.size() + " new artifacts" );
+                indexArtifact( artifacts, indexPath, defaultRepository );
+            }
+
+            List models = discoverer.discoverStandalonePoms( defaultRepository, blacklistedPatterns, includeSnapshots );
+            if ( !models.isEmpty() )
+            {
+                getLogger().info( "Indexing " + models.size() + " new POMs" );
+                indexPom( models, indexPath, defaultRepository );
+            }
+
+            MetadataDiscoverer metadataDiscoverer = (MetadataDiscoverer) metadataDiscoverers.get( layoutProperty );
+            List metadataList =
+                metadataDiscoverer.discoverMetadata( new File( defaultRepository.getBasedir() ), blacklistedPatterns );
+            if ( !metadataList.isEmpty() )
+            {
+                getLogger().info( "Indexing " + metadataList.size() + " new metadata files" );
+                indexMetadata( metadataList, indexPath, defaultRepository );
+            }
+        }
+        catch ( RepositoryIndexException e )
+        {
+            throw new TaskExecutionException( e.getMessage(), e );
+        }
+
+        getLogger().info( "Finished repository indexing process" );
+    }
+
+    public void executeNowIfNeeded()
+        throws TaskExecutionException
+    {
+        Configuration configuration;
+        try
+        {
+            configuration = configurationStore.getConfigurationFromStore();
+        }
+        catch ( ConfigurationStoreException e )
+        {
+            throw new TaskExecutionException( e.getMessage(), e );
+        }
+
+        File indexPath = new File( configuration.getIndexPath() );
+
+        try
+        {
+            ArtifactRepository repository = repoFactory.createRepository( configuration );
+            ArtifactRepositoryIndex artifactIndex = indexFactory.createArtifactRepositoryIndex( indexPath, repository );
+            if ( !artifactIndex.indexExists() )
+            {
+                execute( configuration, indexPath );
+            }
+        }
+        catch ( RepositoryIndexException e )
+        {
+            throw new TaskExecutionException( e.getMessage(), e );
+        }
+    }
+
+    /**
+     * Index the artifacts in the list
+     *
+     * @param artifacts  the artifacts to be indexed
+     * @param indexPath  the path to the index file
+     * @param repository the repository where the artifacts are located
+     */
+    protected void indexArtifact( List artifacts, File indexPath, ArtifactRepository repository )
+        throws RepositoryIndexException
+    {
+        ArtifactRepositoryIndex artifactIndex = indexFactory.createArtifactRepositoryIndex( indexPath, repository );
+        artifactIndex.indexArtifacts( artifacts );
+        artifactIndex.optimize();
+    }
+
+    /**
+     * Index the metadata in the list
+     *
+     * @param metadataList the metadata to be indexed
+     * @param indexPath    the path to the index file
+     */
+    protected void indexMetadata( List metadataList, File indexPath, ArtifactRepository repository )
+        throws RepositoryIndexException
+    {
+        MetadataRepositoryIndex metadataIndex = indexFactory.createMetadataRepositoryIndex( indexPath, repository );
+        metadataIndex.indexMetadata( metadataList );
+        metadataIndex.optimize();
+    }
+
+    /**
+     * Index the poms in the list
+     *
+     * @param models     list of poms that will be indexed
+     * @param indexPath  the path to the index
+     * @param repository the artifact repository where the poms were discovered
+     */
+    protected void indexPom( List models, File indexPath, ArtifactRepository repository )
+        throws RepositoryIndexException
+    {
+        PomRepositoryIndex pomIndex = indexFactory.createPomRepositoryIndex( indexPath, repository );
+        pomIndex.indexPoms( models );
+        pomIndex.optimize();
+    }
+}

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/IndexerTask.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/IndexerTask.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTask.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTask.java?rev=423734&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTask.java (added)
+++ maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTask.java Wed Jul 19 20:10:39 2006
@@ -0,0 +1,37 @@
+package org.apache.maven.repository.scheduler;
+
+/*
+ * 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.
+ */
+
+/**
+ * A repository task.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public interface RepositoryTask
+{
+    /**
+     * Execute the task.
+     */
+    void execute()
+        throws TaskExecutionException;
+
+    /**
+     * Execute the task now if needed because the target doesn't exist.
+     */
+    void executeNowIfNeeded()
+        throws TaskExecutionException;
+}

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTask.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTask.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Copied: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTaskJob.java (from r421497, maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java)
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTaskJob.java?p2=maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTaskJob.java&p1=maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java&r1=421497&r2=423734&rev=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java (original)
+++ maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTaskJob.java Wed Jul 19 20:10:39 2006
@@ -1,4 +1,4 @@
-package org.apache.maven.repository.manager.web.job;
+package org.apache.maven.repository.scheduler;
 
 /*
  * Copyright 2005-2006 The Apache Software Foundation.
@@ -16,26 +16,18 @@
  * limitations under the License.
  */
 
-import org.apache.maven.repository.indexing.RepositoryIndexException;
-import org.apache.maven.repository.manager.web.execution.DiscovererExecution;
 import org.codehaus.plexus.scheduler.AbstractJob;
 import org.quartz.JobDataMap;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 
-import java.net.MalformedURLException;
-
 /**
  * This class is the discoverer job that is executed by the scheduler.
- *
- * @plexus.component role="org.apache.maven.repository.manager.web.job.DiscovererJob"
  */
-public class DiscovererJob
+public class RepositoryTaskJob
     extends AbstractJob
 {
-    public static final String ROLE = DiscovererJob.class.getName();
-
-    public static final String MAP_DISCOVERER_EXECUTION = "EXECUTION";
+    static final String TASK_KEY = "EXECUTION";
 
     /**
      * Execute the discoverer and the indexer.
@@ -49,23 +41,16 @@
     {
         JobDataMap dataMap = context.getJobDetail().getJobDataMap();
         setJobDataMap( dataMap );
-        getLogger().info( "[DiscovererJob] Start execution of DiscovererJob.." );
 
+        RepositoryTask executor = (RepositoryTask) dataMap.get( TASK_KEY );
         try
         {
-            DiscovererExecution execution = (DiscovererExecution) dataMap.get( MAP_DISCOVERER_EXECUTION );
-            execution.executeDiscoverer();
+            executor.execute();
         }
-        catch ( RepositoryIndexException e )
+        catch ( TaskExecutionException e )
         {
-            getLogger().error( "Error indexing: " + e.getMessage(), e );
+            throw new JobExecutionException( e );
         }
-        catch ( MalformedURLException me )
-        {
-            getLogger().error( "Error indexing: " + me.getMessage(), me );
-        }
-
-        getLogger().info( "[DiscovererJob] DiscovererJob has finished executing." );
     }
 
 }

Added: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTaskScheduler.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTaskScheduler.java?rev=423734&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTaskScheduler.java (added)
+++ maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTaskScheduler.java Wed Jul 19 20:10:39 2006
@@ -0,0 +1,33 @@
+package org.apache.maven.repository.scheduler;
+
+/*
+ * 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.
+ */
+
+/**
+ * The component that takes care of scheduling in the application.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public interface RepositoryTaskScheduler
+{
+    /**
+     * The Plexus component role.
+     */
+    String ROLE = RepositoryTaskScheduler.class.getName();
+
+    void runIndexer()
+        throws TaskExecutionException;
+}

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTaskScheduler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/RepositoryTaskScheduler.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/TaskExecutionException.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/TaskExecutionException.java?rev=423734&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/TaskExecutionException.java (added)
+++ maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/TaskExecutionException.java Wed Jul 19 20:10:39 2006
@@ -0,0 +1,31 @@
+package org.apache.maven.repository.scheduler;
+
+/*
+ * 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.
+ */
+
+/**
+ * Exception occurring during task execution.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public class TaskExecutionException
+    extends Exception
+{
+    public TaskExecutionException( String message, Throwable t )
+    {
+        super( message, t );
+    }
+}

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/TaskExecutionException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/scheduler/TaskExecutionException.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/repository-manager/trunk/maven-repository-webapp/pom.xml
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/pom.xml?rev=423734&r1=423733&r2=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/pom.xml (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/pom.xml Wed Jul 19 20:10:39 2006
@@ -38,6 +38,16 @@
       <version>2.2.1</version>
     </dependency>
     <dependency>
+      <groupId>taglibs</groupId>
+      <artifactId>standard</artifactId>
+      <version>1.1.2</version>
+    </dependency>
+    <dependency>
+      <groupId>jstl</groupId>
+      <artifactId>jstl</artifactId>
+      <version>1.1.2</version>
+    </dependency>
+    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-xwork-integration-single</artifactId>
       <version>1.0-alpha-2-SNAPSHOT</version>

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java?rev=423734&r1=423733&r2=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java Wed Jul 19 20:10:39 2006
@@ -19,8 +19,7 @@
 import com.opensymphony.webwork.interceptor.ParameterAware;
 import com.opensymphony.xwork.ActionSupport;
 import org.apache.maven.repository.configuration.Configuration;
-import org.apache.maven.repository.manager.web.execution.DiscovererExecution;
-import org.apache.maven.repository.manager.web.job.DiscovererScheduler;
+import org.apache.maven.repository.configuration.ConfigurationStore;
 import org.apache.maven.repository.manager.web.utils.ConfigurationManager;
 
 import java.util.HashMap;
@@ -31,25 +30,17 @@
  * It invokes the DiscovererScheduler to set the DiscoverJob in the scheduler.
  *
  * @plexus.component role="com.opensymphony.xwork.Action" role-hint="baseAction"
+ * @todo don't like this as a base and as a forwarding action!
  */
 public class BaseAction
     extends ActionSupport
     implements ParameterAware
 {
-    /**
-     * @plexus.requirement
-     */
-    private DiscovererExecution execution;
-
-    /**
-     * @plexus.requirement
-     */
-    private DiscovererScheduler discovererScheduler;
 
     /**
      * @plexus.requirement
      */
-    private ConfigurationManager configManager;
+    private ConfigurationStore configurationStore;
 
     private Map parameters;
 
@@ -72,18 +63,17 @@
     {
         try
         {
-            Configuration config = configManager.getConfiguration();
+            Configuration config = configurationStore.getConfigurationFromStore();
             Map parameters = new HashMap();
             parameters.put( ConfigurationManager.INDEXPATH, config.getIndexPath() );
             parameters.put( ConfigurationManager.MIN_INDEXPATH, config.getMinimalIndexPath() );
             parameters.put( ConfigurationManager.DISCOVERY_BLACKLIST_PATTERNS, config.getDiscoveryBlackListPatterns() );
             parameters.put( ConfigurationManager.DISCOVER_SNAPSHOTS, Boolean.valueOf( config.isDiscoverSnapshots() ) );
-            parameters.put( ConfigurationManager.DISCOVERY_CRON_EXPRESSION, config.getDiscoveryCronExpression() );
+            parameters.put( ConfigurationManager.DISCOVERY_CRON_EXPRESSION, config.getIndexerCronExpression() );
             this.parameters = parameters;
 
             //Configuration configuration = new Configuration(); // TODO!
 //            execution.executeDiscovererIfIndexDoesNotExist( new File( config.getIndexPath() ) );
-            discovererScheduler.setSchedule( config.getDiscoveryCronExpression() );
         }
         catch ( Exception e )
         {

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/GeneralSearchAction.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/GeneralSearchAction.java?rev=423734&r1=423733&r2=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/GeneralSearchAction.java (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/GeneralSearchAction.java Wed Jul 19 20:10:39 2006
@@ -18,9 +18,8 @@
 
 import com.opensymphony.xwork.Action;
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.repository.configuration.Configuration;
+import org.apache.maven.repository.configuration.ConfiguredRepositoryFactory;
 import org.apache.maven.repository.indexing.ArtifactRepositoryIndex;
 import org.apache.maven.repository.indexing.RepositoryIndexException;
 import org.apache.maven.repository.indexing.RepositoryIndexSearchException;
@@ -30,7 +29,6 @@
 import java.io.File;
 import java.net.MalformedURLException;
 import java.util.List;
-import java.util.Map;
 
 /**
  * Searches for searchString in all indexed fields.
@@ -57,12 +55,7 @@
     /**
      * @plexus.requirement
      */
-    private ArtifactRepositoryFactory repositoryFactory;
-
-    /**
-     * @plexus.requirement role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout"
-     */
-    private Map repositoryLayouts;
+    private ConfiguredRepositoryFactory repositoryFactory;
 
     public String execute()
         throws MalformedURLException, RepositoryIndexException, RepositoryIndexSearchException
@@ -72,14 +65,7 @@
             Configuration configuration = new Configuration(); // TODO!
             File indexPath = new File( configuration.getIndexPath() );
 
-            // TODO: [!] repository should only have been instantiated once
-            File repositoryDirectory = new File( configuration.getRepositoryDirectory() );
-            String repoDir = repositoryDirectory.toURL().toString();
-
-            ArtifactRepositoryLayout layout =
-                (ArtifactRepositoryLayout) repositoryLayouts.get( configuration.getRepositoryLayout() );
-            ArtifactRepository repository =
-                repositoryFactory.createArtifactRepository( "test", repoDir, layout, null, null );
+            ArtifactRepository repository = repositoryFactory.createRepository( configuration );
 
             ArtifactRepositoryIndex index = factory.createArtifactRepositoryIndex( indexPath, repository );
 

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/PackageSearchAction.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/PackageSearchAction.java?rev=423734&r1=423733&r2=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/PackageSearchAction.java (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/PackageSearchAction.java Wed Jul 19 20:10:39 2006
@@ -18,9 +18,8 @@
 
 import com.opensymphony.xwork.Action;
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.repository.configuration.Configuration;
+import org.apache.maven.repository.configuration.ConfiguredRepositoryFactory;
 import org.apache.maven.repository.indexing.ArtifactRepositoryIndex;
 import org.apache.maven.repository.indexing.RepositoryIndex;
 import org.apache.maven.repository.indexing.RepositoryIndexException;
@@ -32,7 +31,6 @@
 import java.io.File;
 import java.net.MalformedURLException;
 import java.util.List;
-import java.util.Map;
 
 /**
  * Search by package name.
@@ -55,14 +53,9 @@
     private RepositoryIndexingFactory factory;
 
     /**
-     * @plexus.requirement role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout"
-     */
-    private Map repositoryLayouts;
-
-    /**
      * @plexus.requirement
      */
-    private ArtifactRepositoryFactory repositoryFactory;
+    private ConfiguredRepositoryFactory repositoryFactory;
 
     /**
      * @plexus.requirement
@@ -93,13 +86,7 @@
         Configuration configuration = new Configuration();
         File indexPath = new File( configuration.getIndexPath() );
 
-        File repositoryDirectory = new File( configuration.getRepositoryDirectory() );
-        String repoDir = repositoryDirectory.toURL().toString();
-
-        ArtifactRepositoryLayout layout =
-            (ArtifactRepositoryLayout) repositoryLayouts.get( configuration.getRepositoryLayout() );
-        ArtifactRepository repository =
-            repositoryFactory.createArtifactRepository( "repository", repoDir, layout, null, null );
+        ArtifactRepository repository = repositoryFactory.createRepository( configuration );
 
         ArtifactRepositoryIndex index = factory.createArtifactRepositoryIndex( indexPath, repository );
 

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/QuickSearchAction.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/QuickSearchAction.java?rev=423734&r1=423733&r2=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/QuickSearchAction.java (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/QuickSearchAction.java Wed Jul 19 20:10:39 2006
@@ -18,11 +18,10 @@
 
 import com.opensymphony.xwork.ActionSupport;
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.repository.configuration.Configuration;
 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.indexing.ArtifactRepositoryIndex;
 import org.apache.maven.repository.indexing.RepositoryIndexException;
 import org.apache.maven.repository.indexing.RepositoryIndexSearchException;
@@ -50,7 +49,7 @@
     /**
      * Search results.
      */
-    private List searchResult;
+    private List searchResults;
 
     /**
      * @plexus.requirement
@@ -65,7 +64,7 @@
     /**
      * @plexus.requirement
      */
-    private ArtifactRepositoryFactory repositoryFactory;
+    private ConfiguredRepositoryFactory repositoryFactory;
 
     /**
      * @plexus.requirement role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout"
@@ -88,7 +87,7 @@
         Configuration configuration = configurationStore.getConfigurationFromStore();
         File indexPath = new File( configuration.getIndexPath() );
 
-        ArtifactRepository repository = getDefaultRepository( configuration );
+        ArtifactRepository repository = repositoryFactory.createRepository( configuration );
 
         ArtifactRepositoryIndex index = factory.createArtifactRepositoryIndex( indexPath, repository );
 
@@ -98,23 +97,11 @@
             return ERROR;
         }
 
-        searchResult = searchLayer.searchGeneral( q, index );
+        searchResults = searchLayer.searchGeneral( q, index );
 
         return SUCCESS;
     }
 
-    private ArtifactRepository getDefaultRepository( Configuration configuration )
-        throws MalformedURLException
-    {
-        // TODO: [!] repository should only have been instantiated once
-        File repositoryDirectory = new File( configuration.getRepositoryDirectory() );
-        String repoDir = repositoryDirectory.toURI().toURL().toString();
-
-        ArtifactRepositoryLayout layout =
-            (ArtifactRepositoryLayout) repositoryLayouts.get( configuration.getRepositoryLayout() );
-        return repositoryFactory.createArtifactRepository( "test", repoDir, layout, null, null );
-    }
-
     public String doInput()
     {
         return INPUT;
@@ -130,9 +117,9 @@
         this.q = q;
     }
 
-    public List getSearchResult()
+    public List getSearchResults()
     {
-        return searchResult;
+        return searchResults;
     }
 
 }

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=423734&r1=423733&r2=423734&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 Wed Jul 19 20:10:39 2006
@@ -20,8 +20,10 @@
 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.indexing.RepositoryIndexException;
 import org.apache.maven.repository.indexing.RepositoryIndexSearchException;
 import org.codehaus.plexus.util.StringUtils;
@@ -49,7 +51,8 @@
     private Configuration configuration;
 
     public String execute()
-        throws IOException, RepositoryIndexException, RepositoryIndexSearchException, ConfigurationStoreException
+        throws IOException, RepositoryIndexException, RepositoryIndexSearchException, 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
 
@@ -98,7 +101,7 @@
     }
 
     public void prepare()
-        throws Exception
+        throws ConfigurationStoreException
     {
         configuration = configurationStore.getConfigurationFromStore();
     }

Added: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/RunIndexerAction.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/RunIndexerAction.java?rev=423734&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/RunIndexerAction.java (added)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/admin/RunIndexerAction.java Wed Jul 19 20:10:39 2006
@@ -0,0 +1,43 @@
+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.xwork.ActionSupport;
+import org.apache.maven.repository.scheduler.RepositoryTaskScheduler;
+import org.apache.maven.repository.scheduler.TaskExecutionException;
+
+/**
+ * Configures the application.
+ *
+ * @plexus.component role="com.opensymphony.xwork.Action" role-hint="runIndexerAction"
+ */
+public class RunIndexerAction
+    extends ActionSupport
+{
+    /**
+     * @plexus.requirement
+     */
+    private RepositoryTaskScheduler taskScheduler;
+
+    public String execute()
+        throws TaskExecutionException
+    {
+        taskScheduler.runIndexer();
+
+        return SUCCESS;
+    }
+}

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

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

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/utils/ConfigurationManager.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/utils/ConfigurationManager.java?rev=423734&r1=423733&r2=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/utils/ConfigurationManager.java (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/utils/ConfigurationManager.java Wed Jul 19 20:10:39 2006
@@ -90,7 +90,7 @@
 
             if ( name.equals( DISCOVERY_CRON_EXPRESSION ) )
             {
-                config.setDiscoveryCronExpression( value );
+                config.setIndexerCronExpression( value );
             }
             if ( name.equals( REPOSITORY_LAYOUT ) )
             {

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/plexus/plexus.xml
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/plexus/plexus.xml?rev=423734&r1=423733&r2=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/plexus/plexus.xml (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/plexus/plexus.xml Wed Jul 19 20:10:39 2006
@@ -91,4 +91,10 @@
       </lifecycle-handler>
     </lifecycle-handlers>
   </lifecycle-handler-manager>
+
+  <load-on-start>
+    <component>
+      <role>org.apache.maven.repository.scheduler.RepositoryTaskScheduler</role>
+    </component>
+  </load-on-start>
 </plexus>

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=423734&r1=423733&r2=423734&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 Wed Jul 19 20:10:39 2006
@@ -101,6 +101,10 @@
       <result name="input">/WEB-INF/jsp/admin/configure.jsp</result>
       <result>/WEB-INF/jsp/admin/configure.jsp</result>
     </action>
+
+    <action name="runIndexer" class="runIndexerAction">
+      <!-- TODO: back to page where this comes from! -->
+    </action>
   </package>
 </xwork>
 

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=423734&r1=423733&r2=423734&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 Wed Jul 19 20:10:39 2006
@@ -30,7 +30,7 @@
     <ww:actionmessage />
     <ww:form method="post" action="saveConfiguration" namespace="/admin" validate="true">
       <ww:textfield name="repositoryDirectory" label="Repository Directory" size="100" />
-      <ww:textfield name="discoveryCronExpression" label="Discovery Cron Expression" />
+      <ww:textfield name="indexerCronExpression" label="Indexing Cron Expression" />
       <ww:submit value="Save Configuration" />
     </ww:form>
   </div>

Added: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/include/quickSearchForm.jspf
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/include/quickSearchForm.jspf?rev=423734&view=auto
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/include/quickSearchForm.jspf (added)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/include/quickSearchForm.jspf Wed Jul 19 20:10:39 2006
@@ -0,0 +1,28 @@
+<%@ taglib prefix="ww" uri="/webwork" %>
+<%--
+  ~ 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.
+  --%>
+
+<div id="searchBox">
+  <ww:form method="post" action="quickSearch" validate="true">
+    <ww:textfield label="Search for" size="50" name="q" />
+    <ww:submit label="Go!" />
+  </ww:form>
+
+  <p>
+    Enter your search terms. A variety of data will be searched for your keywords.
+    <ww:actionerror />
+  </p>
+</div>
\ No newline at end of file

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

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

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp?rev=423734&r1=423733&r2=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp Wed Jul 19 20:10:39 2006
@@ -26,16 +26,7 @@
 <h1>Search</h1>
 
 <div id="contentArea">
-  <div id="searchBox">
-    <ww:form method="post" action="quickSearch" validate="true">
-      <ww:textfield label="Search for" size="50" name="q" />
-      <ww:submit label="Go!" />
-    </ww:form>
-    <p>
-      Enter your search terms. A variety of data will be searched for your keywords.
-      <ww:actionerror />
-    </p>
-  </div>
+  <%@ include file="/WEB-INF/jsp/include/quickSearchForm.jspf" %>
 </div>
 
 </body>

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp?rev=423734&r1=423733&r2=423734&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/results.jsp Wed Jul 19 20:10:39 2006
@@ -1,3 +1,5 @@
+<%@ taglib uri="/webwork" prefix="ww" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%--
   ~ Copyright 2005-2006 The Apache Software Foundation.
   ~
@@ -14,38 +16,55 @@
   ~ limitations under the License.
   --%>
 
-<%@ taglib uri="webwork" prefix="ww" %>
 <html>
 <head>
-  <title>Maven Repository Manager</title>
+  <title>Search Results</title>
+  <ww:head />
 </head>
 
 <body>
 
-<h1>Maven Repository Manager</h1>
-
-<%@ include file="form.jspf" %>
-
-<table border="1px" cellspacing="0">
-  <tr>
-    <th>Group ID</th>
-    <th>Artifact ID</th>
-    <th>Version</th>
-  </tr>
-  <ww:iterator value="searchResult">
-    <tr>
-      <td valign="top">
-        <ww:property value="Artifact.getGroupId()"/>
-      </td>
-      <td valign="top">
-        <ww:property value="Artifact.getArtifactId()"/>
-      </td>
-      <td valign="top">
-        <ww:property value="Artifact.getVersion()"/>
-      </td>
-    </tr>
-  </ww:iterator>
-</table>
+<h1>Search Results</h1>
 
+<div id="contentArea">
+  <div id="searchBox">
+    <%@ include file="/WEB-INF/jsp/include/quickSearchForm.jspf" %>
+
+    <div id="resultsBox">
+      <table class="bodyTable">
+        <tr class="a">
+          <th>Group</th>
+          <th>Artifact</th>
+          <th>Version</th>
+          <%-- TODO
+                    <th>Hits</th>
+                    <th></th>
+          --%>
+        </tr>
+        <ww:set name="searchResults" scope="request" value="searchResults" />
+        <c:forEach items="${searchResults}" var="result" varStatus="i">
+          <tr class="${i.index % 2 == 0 ? "b" : "a"}">
+            <td><c:out value="${result.artifact.groupId}" /></td>
+            <td><c:out value="${result.artifact.artifactId}" /></td>
+            <td><c:out value="${result.artifact.version}" /></td>
+              <%-- TODO: hits
+              <td>
+
+                <code>org.apache.maven</code>
+                (package)
+                <br/>
+                <code>org.apache.maven.model</code>
+                (package)
+              </td>
+              <td>
+                <a href="artifact.html">Details</a>
+              </td>
+              --%>
+          </tr>
+        </c:forEach>
+      </table>
+    </div>
+  </div>
+</div>
 </body>
 </html>