]> source.dussan.org Git - archiva.git/commitdiff
PR: MRM-98
authorEdwin L. Punzalan <epunzalan@apache.org>
Fri, 3 Mar 2006 02:41:52 +0000 (02:41 +0000)
committerEdwin L. Punzalan <epunzalan@apache.org>
Fri, 3 Mar 2006 02:41:52 +0000 (02:41 +0000)
Submitted by: John Tolentino

Applied to use the plexus configuration for index and repository path

git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@382623 13f79535-47bb-0310-9956-ffa450edef68

maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/PackageSearchAction.java
maven-repository-webapp/src/main/webapp/WEB-INF/jsp/generalresults.jsp

index 458272b0a09ddbd56a7283f3c22eb089bd58f305..73175382cf00506c524f52cb6e1a691c8f423667 100644 (file)
@@ -19,14 +19,14 @@ package org.apache.maven.repository.manager.web.action;
 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.indexing.ArtifactRepositoryIndex;
 import org.apache.maven.repository.indexing.DefaultRepositoryIndexSearcher;
 import org.apache.maven.repository.indexing.RepositoryIndexException;
 import org.apache.maven.repository.indexing.RepositoryIndexSearchException;
 import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
+import org.apache.maven.repository.indexing.RepositoryIndex;
 import org.apache.maven.repository.indexing.query.SinglePhraseQuery;
-import org.codehaus.plexus.scheduler.Scheduler;
+import org.apache.maven.repository.manager.web.job.Configuration;
 
 import java.io.File;
 import java.net.MalformedURLException;
@@ -45,11 +45,6 @@ public class PackageSearchAction
 
     private String md5;
 
-    /**
-     * @plexus.requirement
-     */
-    private Scheduler scheduler;
-
     /**
      * @plexus.requirement
      */
@@ -61,9 +56,9 @@ public class PackageSearchAction
     private ArtifactRepositoryFactory repositoryFactory;
 
     /**
-     * @plexus.requirement role-hint="legacy"
+     * @plexus.requirement
      */
-    private ArtifactRepositoryLayout layout;
+    private Configuration configuration;
 
     private List artifacts;
 
@@ -75,7 +70,7 @@ public class PackageSearchAction
         if ( packageName != null && packageName.length() != 0 )
         {
             searchTerm = packageName;
-            key = "packages";
+            key = RepositoryIndex.FLD_PACKAGES;
         }
         else if ( md5 != null && md5.length() != 0 )
         {
@@ -88,11 +83,14 @@ public class PackageSearchAction
         }
 
         // TODO: better config
-        String indexPath = "C:/0John/java/projects/repository-manager/maven-repository-indexer/target/index";
+        String indexPath = configuration.getIndexDirectory();
 
         // TODO: reduce the amount of lookup?
-        ArtifactRepository repository = repositoryFactory.createArtifactRepository( "repository", new File(
-            indexPath ).toURL().toString(), layout, null, null );
+        File repositoryDirectory = new File( configuration.getRepositoryDirectory() );
+        String repoDir = repositoryDirectory.toURL().toString();
+
+        ArtifactRepository repository =
+            repositoryFactory.createArtifactRepository( "repository", repoDir, configuration.getLayout(), null, null );
 
         ArtifactRepositoryIndex index = factory.createArtifactRepositoryIndex( indexPath, repository );
 
index bd9b1246b4af6a987024a49aaa37dda93e51d747..921a5e7c29a720cf3ce4e2d930c16b87176924da 100644 (file)
@@ -50,7 +50,7 @@
             <tr>\r
               <td valign="top" width="15%" align="right"><ww:property value="Key"/></td>\r
               <td valign="top">\r
-                <ww:iterator value="Value" id="test" status="">\r
+                <ww:iterator value="Value">\r
                   <ww:property/>\r
                 </ww:iterator>\r
                 <br/>\r