]> source.dussan.org Git - archiva.git/commitdiff
PR: MRM-99
authorEdwin L. Punzalan <epunzalan@apache.org>
Fri, 3 Mar 2006 03:23:32 +0000 (03:23 +0000)
committerEdwin L. Punzalan <epunzalan@apache.org>
Fri, 3 Mar 2006 03:23:32 +0000 (03:23 +0000)
Submitted by: Maria Odea Ching

Applied patch to use RepositoryIndexSearchLayer for searching in packages

git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@382635 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/results.jsp

index 73175382cf00506c524f52cb6e1a691c8f423667..a5e916085e4093ada5c960ea37e33ecf3d17252b 100644 (file)
@@ -24,9 +24,10 @@ 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.RepositoryIndexSearchLayer;
 import org.apache.maven.repository.indexing.query.SinglePhraseQuery;
 import org.apache.maven.repository.manager.web.job.Configuration;
+import org.apache.maven.repository.indexing.RepositoryIndex;
 
 import java.io.File;
 import java.net.MalformedURLException;
@@ -45,6 +46,8 @@ public class PackageSearchAction
 
     private String md5;
 
+    private List searchResult;
+
     /**
      * @plexus.requirement
      */
@@ -60,8 +63,6 @@ public class PackageSearchAction
      */
     private Configuration configuration;
 
-    private List artifacts;
-
     public String execute()
         throws MalformedURLException, RepositoryIndexException, RepositoryIndexSearchException
     {
@@ -94,9 +95,9 @@ public class PackageSearchAction
 
         ArtifactRepositoryIndex index = factory.createArtifactRepositoryIndex( indexPath, repository );
 
-        DefaultRepositoryIndexSearcher searcher = factory.createDefaultRepositoryIndexSearcher( index );
+        RepositoryIndexSearchLayer searchLayer = factory.createRepositoryIndexSearchLayer( index );
 
-        artifacts = searcher.search( new SinglePhraseQuery( key, searchTerm ) );
+        searchResult = searchLayer.searchAdvanced( new SinglePhraseQuery( key, searchTerm ) );
 
         return SUCCESS;
     }
@@ -111,8 +112,8 @@ public class PackageSearchAction
         this.md5 = md5;
     }
 
-    public List getArtifacts()
+    public List getSearchResult()
     {
-        return artifacts;
+        return searchResult;
     }
 }
index bf9fb65e6406f3573aaacc393db759cdb7cbb551..4be180a5eae011ecc6494d223bf4967825a73538 100644 (file)
 
 <%@ include file="form.jspf" %>
 
-<table>
+<table border="1px" cellspacing="0">
   <tr>
     <th>Group ID</th>
     <th>Artifact ID</th>
     <th>Version</th>
   </tr>
-  <ww:iterator value="artifacts">
+  <ww:iterator value="searchResult">
     <tr>
-      <td><ww:property value="groupId"/></td>
-      <td><ww:property value="artifactId"/></td>
-      <td><ww:property value="version"/></td>
+      <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>