]> source.dussan.org Git - archiva.git/commitdiff
no display full groupId in browsing
authorOlivier Lamy <olamy@apache.org>
Sat, 18 Feb 2012 00:18:30 +0000 (00:18 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 18 Feb 2012 00:18:30 +0000 (00:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1245816 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html

index b269a564e65e6b2b034cf9834ce05331fe090062..9b1a16a49e4c17624d1e32690282e9b041be36fc 100644 (file)
@@ -21,8 +21,8 @@ package org.apache.archiva.rest.services;
 import org.apache.archiva.metadata.repository.MetadataResolutionException;
 import org.apache.archiva.metadata.repository.MetadataResolver;
 import org.apache.archiva.metadata.repository.RepositorySession;
-import org.apache.archiva.rest.api.model.BrowseResultEntry;
 import org.apache.archiva.rest.api.model.BrowseResult;
+import org.apache.archiva.rest.api.model.BrowseResultEntry;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.BrowseService;
 import org.apache.commons.collections.CollectionUtils;
@@ -144,14 +144,15 @@ public class DefaultBrowseService
         {
             repositorySession.close();
         }
-        List<BrowseResultEntry> browseGroupResultEntries = new ArrayList<BrowseResultEntry>( namespaces.size() + projects.size() );
+        List<BrowseResultEntry> browseGroupResultEntries =
+            new ArrayList<BrowseResultEntry>( namespaces.size() + projects.size() );
         for ( String namespace : namespaces )
         {
             browseGroupResultEntries.add( new BrowseResultEntry( namespace, false ) );
         }
         for ( String project : projects )
         {
-            browseGroupResultEntries.add( new BrowseResultEntry( project, true ) );
+            browseGroupResultEntries.add( new BrowseResultEntry( groupId + '.' + project, true ) );
         }
         Collections.sort( browseGroupResultEntries );
         return new BrowseResult( browseGroupResultEntries );
index d27f338e432652fcfb3ad88340278e1cc39468a3..5a39f6876ed669fd5c87ed6d35560d4bbfb6f26e 100644 (file)
@@ -54,7 +54,12 @@ $(function() {
       return breadCrumbEntries;
     }
 
-
+    displayEntry=function(value){
+      if (self.groupId){
+        return value.substr(self.groupId.length+1,value.length-self.groupId.length);
+      }
+      return value;
+    }
   }
 
 
@@ -119,16 +124,13 @@ $(function() {
     displayGroupDetail(groupId,parentBrowseViewModel,null)
   }
 
-  function BrowseResultEntry(a, b){
-
-  }
 
   mapbrowseResultEntries=function(data){
     if (data.browseResult && data.browseResult.browseResultEntries) {
       return $.isArray(data.browseResult.browseResultEntries) ?
          $.map(data.browseResult.browseResultEntries,function(item){
            return new BrowseResultEntry(item.name, item.project);
-         }): [data.browseResult.browseResultEntries];
+         } ).sort(): [data.browseResult.browseResultEntries];
     }
     return [];
   }
index 079bb5e35d2e2fc60914e3ac9a23774f26acf31b..42f326204d3a3219fb1b45360752b385de47e418 100644 (file)
@@ -49,7 +49,7 @@
       {{each(i,browseResultEntry) browseResultEntries}}
         <li class="browse-list" data-bind="click:function(){displayGroupId(browseResultEntry.name)}">
           <a href="#">
-            &nbsp;${browseResultEntry.name} (project: ${browseResultEntry.project})
+            &nbsp;${displayEntry(browseResultEntry.name)} (project: ${browseResultEntry.project})
           </a>
         </li>
       {{/each}}