]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1573] start work on browse screen
authorOlivier Lamy <olamy@apache.org>
Thu, 16 Feb 2012 21:27:08 +0000 (21:27 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 16 Feb 2012 21:27:08 +0000 (21:27 +0000)
navigate on groupIds.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1245185 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseGroupIdResult.java
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js

index 309daf37c9d0ca0a6f2fd4be693db8a85f498feb..bafad96c6c29a45cc8dea3749d2f11e92b91e10e 100644 (file)
@@ -38,7 +38,7 @@ public class BrowseGroupIdResult
 
     public BrowseGroupIdResult( List<BrowseGroupIdEntry> browseGroupIdEntries )
     {
-        // no op
+        this.browseGroupIdEntries = browseGroupIdEntries;
     }
 
     public List<BrowseGroupIdEntry> getBrowseGroupIdEntries()
index 4a7744369c2719097502909cc2ae0ffe2af6ccad..5466f8feff82f113747c1a6aef1e4efbe49ad238 100644 (file)
@@ -27,10 +27,12 @@ $(function() {
           type: "GET",
           dataType: 'json',
           success: function(data) {
-            var groupdIds = $.map(data.groupIdList.groupIds,function(item){
-              return item;
-            });
-            $.log("size:"+groupdIds.length);
+            var browseGroupIdEntryies = $.isArray(data.browseGroupIdResult.browseGroupIdEntries) ?
+                $.map(data.browseGroupIdResult.browseGroupIdEntries,function(item){
+                  $.log("name:"+item.name);
+                  return new BrowseGroupIdEntry(item.name, item.project);
+                }): [data.browseGroupIdResult.browseGroupIdEntries];
+            $.log("size:"+browseGroupIdEntryies.length);
             //var browseTopViewModel = new BrowseTopViewModel(groupdIds);
 
             //ko.applyBindings(browseTopViewModel,mainContent.find("#browse_result" ).get(0));
@@ -61,4 +63,9 @@ $(function() {
   displaySearch=function(){
     $("#main-content" ).html("coming soon :-)");
   }
+
+  BrowseGroupIdEntry=function(name,project){
+    this.name=name;
+    this.project=project;
+  }
 });
\ No newline at end of file