From: Olivier Lamy Date: Sat, 18 Feb 2012 00:18:30 +0000 (+0000) Subject: no display full groupId in browsing X-Git-Tag: archiva-1.4-M3~1250 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b07b0de488e1209f98e6f94ed54e29e1e51b6155;p=archiva.git no display full groupId in browsing git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1245816 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java index b269a564e..9b1a16a49 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java @@ -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 browseGroupResultEntries = new ArrayList( namespaces.size() + projects.size() ); + List browseGroupResultEntries = + new ArrayList( 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 ); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js index d27f338e4..5a39f6876 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js @@ -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 []; } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html index 079bb5e35..42f326204 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html @@ -49,7 +49,7 @@ {{each(i,browseResultEntry) browseResultEntries}}
  • -  ${browseResultEntry.name} (project: ${browseResultEntry.project}) +  ${displayEntry(browseResultEntry.name)} (project: ${browseResultEntry.project})
  • {{/each}}