From f8cfdfa4475c1b22f2734511a4f446a48c55f506 Mon Sep 17 00:00:00 2001 From: "Maria Odea B. Ching" Date: Thu, 10 Jul 2008 10:44:08 +0000 Subject: [PATCH] -in the search results, display repository (with link) where artifact is located git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@675505 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/indexer/search/SearchResultHit.java | 12 ++++++++++++ .../maven/archiva/indexer/search/SearchResults.java | 1 + .../src/main/webapp/WEB-INF/jsp/results.jsp | 2 +- .../main/webapp/WEB-INF/tags/showArtifactLink.tag | 7 +++++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResultHit.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResultHit.java index 1d2f74437..2933fae8e 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResultHit.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResultHit.java @@ -46,6 +46,8 @@ public class SearchResultHit private String artifactId; private String version = ""; + + private String repositoryId = ""; // Advanced hit, if artifact, all versions of artifact private List artifacts = new ArrayList(); @@ -138,4 +140,14 @@ public class SearchResultHit { return versions; } + + public String getRepositoryId() + { + return repositoryId; + } + + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } } diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResults.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResults.java index 6e2f8fa80..6465814c3 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResults.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResults.java @@ -126,6 +126,7 @@ public class SearchResults // Only need to worry about this hit if it is truely new. hit = new SearchResultHit(); + hit.setRepositoryId( filecontent.getRepositoryId() ); hit.setUrl( filecontent.getRepositoryId() + "/" + filecontent.getFilename() ); hit.setContext( null ); // TODO: handle context + highlight later. diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp index b2f984da3..3217ccd3f 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp @@ -124,7 +124,7 @@

+ version="${record.version}" versions="${record.versions}" repositoryId="${record.repositoryId}"/>

diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag index 65dde0745..ba4558adc 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag @@ -27,11 +27,14 @@ <%@ attribute name="classifier" %> <%@ attribute name="scope" %> <%@ attribute name="versions" type="java.util.List" %> +<%@ attribute name="repositoryId" %> + ${repositoryId} + : - + @@ -73,5 +76,5 @@ | Classifier: ${classifier} - +