]> source.dussan.org Git - archiva.git/commitdiff
-in the search results, display repository (with link) where artifact is located
authorMaria Odea B. Ching <oching@apache.org>
Thu, 10 Jul 2008 10:44:08 +0000 (10:44 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Thu, 10 Jul 2008 10:44:08 +0000 (10:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@675505 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResultHit.java
archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResults.java
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag

index 1d2f74437dc59761aa7e1c8e005380e3434c841d..2933fae8e23b56d7d8afc74c5cca85e51fbbda6e 100644 (file)
@@ -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;
+    }
 }
index 6e2f8fa806143368558b17229cca67ce77999c2e..6465814c39cde33f969bfa145b983ce175629954 100644 (file)
@@ -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.
             
index b2f984da33618e31f1f7983c9b1abea4b02ea9f5..3217ccd3f66b9449e5347344023dc552f3bf6801 100644 (file)
                   </h3>
                   <p>
                     <my:showArtifactLink groupId="${record.groupId}" artifactId="${record.artifactId}"
-                                         version="${record.version}" versions="${record.versions}"/>
+                                         version="${record.version}" versions="${record.versions}" repositoryId="${record.repositoryId}"/>
                   </p>
                 </c:when>
                 <c:otherwise>
index 65dde07454b5188a0dd2f8f6930020ccc271d16b..ba4558adc1383a1c498905af6aaed53f5fc6dc3d 100644 (file)
 <%@ attribute name="classifier" %>
 <%@ attribute name="scope" %>
 <%@ attribute name="versions" type="java.util.List" %>
+<%@ attribute name="repositoryId" %>
 
 <span class="artifact-link">
+  <a href="${pageContext.request.contextPath}/repository/${repositoryId}">${repositoryId}</a>
+  <strong> : </strong>
   <archiva:groupIdLink var="${groupId}" includeTop="false" />
   
-  <c:if test="${!empty(artifactId)}">
+  <c:if test="${!empty(artifactId)}">    
     <c:set var="url">
       <ww:url action="browseArtifact" namespace="/">
         <ww:param name="groupId" value="%{'${groupId}'}"/>
@@ -73,5 +76,5 @@
   </c:if>
   <c:if test="${!empty(classifier)}">
     | <strong>Classifier:</strong> ${classifier}
-  </c:if>
+  </c:if>  
 </span>