summaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-02-18 00:18:30 +0000
committerOlivier Lamy <olamy@apache.org>2012-02-18 00:18:30 +0000
commitb07b0de488e1209f98e6f94ed54e29e1e51b6155 (patch)
tree86eab9aa66016fa7bec5a66904131e371ca04366 /archiva-modules
parent7ae0da9bae1ecf2ea9b4067f90a14e96510361e7 (diff)
downloadarchiva-b07b0de488e1209f98e6f94ed54e29e1e51b6155.tar.gz
archiva-b07b0de488e1209f98e6f94ed54e29e1e51b6155.zip
no display full groupId in browsing
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1245816 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java7
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js12
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html2
3 files changed, 12 insertions, 9 deletions
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<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 );
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}}
<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}}