diff options
author | Olivier Lamy <olamy@apache.org> | 2014-01-15 23:32:28 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-01-15 23:32:28 +0000 |
commit | 41eefa4f67c30ba0c39ca312a8a77ad60cc36a55 (patch) | |
tree | daa78d84f96da3d65bc2ef97e733654fdc7b8416 /archiva-modules/archiva-web/archiva-rest | |
parent | 12efd7f35b3f025d998acbd7c10618a5053d6967 (diff) | |
download | archiva-41eefa4f67c30ba0c39ca312a8a77ad60cc36a55.tar.gz archiva-41eefa4f67c30ba0c39ca312a8a77ad60cc36a55.zip |
fixing browsing with typeahead
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1558609 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-rest')
2 files changed, 48 insertions, 5 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseResultEntry.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseResultEntry.java index 9ee7a1f1d..4b7816dce 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseResultEntry.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseResultEntry.java @@ -34,6 +34,16 @@ public class BrowseResultEntry private boolean project; + /** + * @since 2.0.0 + */ + private String groupId; + + /** + * @since 2.0.0 + */ + private String artifactId; + public BrowseResultEntry() { // no op @@ -70,13 +80,46 @@ public class BrowseResultEntry return this.name.compareTo( browseGroupResultEntry.name ); } + public String getGroupId() + { + return groupId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public BrowseResultEntry groupId( String groupId ) + { + this.groupId = groupId; + return this; + } + + public String getArtifactId() + { + return artifactId; + } + + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } + + public BrowseResultEntry artifactId( String artifactId ) + { + this.artifactId = artifactId; + return this; + } + @Override public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append( "BrowseResultEntry" ); - sb.append( "{name='" ).append( name ).append( '\'' ); + final StringBuilder sb = new StringBuilder( "BrowseResultEntry{" ); + sb.append( "name='" ).append( name ).append( '\'' ); sb.append( ", project=" ).append( project ); + sb.append( ", groupId='" ).append( groupId ).append( '\'' ); + sb.append( ", artifactId='" ).append( artifactId ).append( '\'' ); sb.append( '}' ); return sb.toString(); } 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 7055fdea3..316531396 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 @@ -195,11 +195,11 @@ public class DefaultBrowseService new ArrayList<BrowseResultEntry>( namespaces.size() + projects.size() ); for ( String namespace : namespaces ) { - browseGroupResultEntries.add( new BrowseResultEntry( namespace, false ) ); + browseGroupResultEntries.add( new BrowseResultEntry( namespace, false ).groupId( namespace ) ); } for ( String project : projects ) { - browseGroupResultEntries.add( new BrowseResultEntry( groupId + '.' + project, true ) ); + browseGroupResultEntries.add( new BrowseResultEntry( groupId + '.' + project, true ).groupId( groupId ).artifactId( project ) ); } Collections.sort( browseGroupResultEntries ); return new BrowseResult( browseGroupResultEntries ); |