]> source.dussan.org Git - archiva.git/commitdiff
rename class. it's always complicated to find the good name but the previous was...
authorOlivier Lamy <olamy@apache.org>
Fri, 17 Feb 2012 15:40:41 +0000 (15:40 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 17 Feb 2012 15:40:41 +0000 (15:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1245618 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseIdEntry.java [deleted file]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseResult.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseResultEntry.java [new file with mode: 0644]
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/css/archiva.css
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
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/topbar.html

diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseIdEntry.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/BrowseIdEntry.java
deleted file mode 100644 (file)
index 598a4fd..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.apache.archiva.rest.api.model;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * @author Olivier Lamy
- * @since 1.4-M3
- */
-@XmlRootElement( name = "browseIdEntry" )
-public class BrowseIdEntry
-    implements Comparable<BrowseIdEntry>
-{
-
-    private String name;
-
-    private boolean project;
-
-    public BrowseIdEntry()
-    {
-        // no op
-    }
-
-    public BrowseIdEntry( String name, boolean project )
-    {
-        this.name = name;
-        this.project = project;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName( String name )
-    {
-        this.name = name;
-    }
-
-    public boolean isProject()
-    {
-        return project;
-    }
-
-    public void setProject( boolean project )
-    {
-        this.project = project;
-    }
-
-    public int compareTo( BrowseIdEntry browseGroupIdEntry )
-    {
-        return this.name.compareTo( browseGroupIdEntry.name );
-    }
-}
index b7a9cdd5b910ad523a1ae2a85c84974119babb45..57dcd4943fc6098ff1d40204a12996491ec63ded 100644 (file)
@@ -29,25 +29,25 @@ import java.util.List;
 @XmlRootElement( name = "browseResult" )
 public class BrowseResult
 {
-    private List<BrowseIdEntry> browseIdEntries;
+    private List<BrowseResultEntry> browseResultEntries;
 
     public BrowseResult()
     {
         // no op
     }
 
-    public BrowseResult( List<BrowseIdEntry> browseIdEntries )
+    public BrowseResult( List<BrowseResultEntry> browseResultEntries )
     {
-        this.browseIdEntries = browseIdEntries;
+        this.browseResultEntries = browseResultEntries;
     }
 
-    public List<BrowseIdEntry> getBrowseIdEntries()
+    public List<BrowseResultEntry> getBrowseResultEntries()
     {
-        return browseIdEntries == null ? Collections.<BrowseIdEntry>emptyList() : browseIdEntries;
+        return browseResultEntries == null ? Collections.<BrowseResultEntry>emptyList() : browseResultEntries;
     }
 
-    public void setBrowseIdEntries( List<BrowseIdEntry> browseIdEntries )
+    public void setBrowseResultEntries( List<BrowseResultEntry> browseResultEntries )
     {
-        this.browseIdEntries = browseIdEntries;
+        this.browseResultEntries = browseResultEntries;
     }
 }
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
new file mode 100644 (file)
index 0000000..be7eae2
--- /dev/null
@@ -0,0 +1,71 @@
+package org.apache.archiva.rest.api.model;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M3
+ */
+@XmlRootElement( name = "browseResultEntry" )
+public class BrowseResultEntry
+    implements Comparable<BrowseResultEntry>
+{
+
+    private String name;
+
+    private boolean project;
+
+    public BrowseResultEntry()
+    {
+        // no op
+    }
+
+    public BrowseResultEntry( String name, boolean project )
+    {
+        this.name = name;
+        this.project = project;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+    public boolean isProject()
+    {
+        return project;
+    }
+
+    public void setProject( boolean project )
+    {
+        this.project = project;
+    }
+
+    public int compareTo( BrowseResultEntry browseGroupResultEntry )
+    {
+        return this.name.compareTo( browseGroupResultEntry.name );
+    }
+}
index 5545add340abcf945cd686a1ed2ed3a78fc4021f..b269a564e65e6b2b034cf9834ce05331fe090062 100644 (file)
@@ -21,7 +21,7 @@ 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.BrowseIdEntry;
+import org.apache.archiva.rest.api.model.BrowseResultEntry;
 import org.apache.archiva.rest.api.model.BrowseResult;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.BrowseService;
@@ -87,14 +87,14 @@ public class DefaultBrowseService
             repositorySession.close();
         }
 
-        List<BrowseIdEntry> browseGroupIdEntries = new ArrayList<BrowseIdEntry>( namespaces.size() );
+        List<BrowseResultEntry> browseGroupResultEntries = new ArrayList<BrowseResultEntry>( namespaces.size() );
         for ( String namespace : namespaces )
         {
-            browseGroupIdEntries.add( new BrowseIdEntry( namespace, false ) );
+            browseGroupResultEntries.add( new BrowseResultEntry( namespace, false ) );
         }
 
-        Collections.sort( browseGroupIdEntries );
-        return new BrowseResult( browseGroupIdEntries );
+        Collections.sort( browseGroupResultEntries );
+        return new BrowseResult( browseGroupResultEntries );
     }
 
     public BrowseResult browseGroupId( String groupId )
@@ -144,17 +144,17 @@ public class DefaultBrowseService
         {
             repositorySession.close();
         }
-        List<BrowseIdEntry> browseGroupIdEntries = new ArrayList<BrowseIdEntry>( namespaces.size() + projects.size() );
+        List<BrowseResultEntry> browseGroupResultEntries = new ArrayList<BrowseResultEntry>( namespaces.size() + projects.size() );
         for ( String namespace : namespaces )
         {
-            browseGroupIdEntries.add( new BrowseIdEntry( namespace, false ) );
+            browseGroupResultEntries.add( new BrowseResultEntry( namespace, false ) );
         }
         for ( String project : projects )
         {
-            browseGroupIdEntries.add( new BrowseIdEntry( project, true ) );
+            browseGroupResultEntries.add( new BrowseResultEntry( project, true ) );
         }
-        Collections.sort( browseGroupIdEntries );
-        return new BrowseResult( browseGroupIdEntries );
+        Collections.sort( browseGroupResultEntries );
+        return new BrowseResult( browseGroupResultEntries );
 
     }
 
index 209491362245a30faab54d309b06e6b29311d38f..6284e7a8b6c28c25fcbdbac320cedfea784c156c 100644 (file)
@@ -78,4 +78,8 @@
 
 .browse-list{
   list-style-image: url("../images/folder.png")
+}
+
+.force-upper-case{
+  text-transform: uppercase;
 }
\ No newline at end of file
index 38679168263961cc7fd29c14385fcc6883c81251..b77624b4c01d308636651d42958f502f7eb12c34 100644 (file)
@@ -18,8 +18,8 @@
  */
 $(function() {
 
-  BrowseViewModel=function(browseIdEntries,parentGroupdId){
-    this.browseIdEntries=browseIdEntries;
+  BrowseViewModel=function(browseResultEntries,parentGroupdId){
+    this.browseResultEntries=browseResultEntries;
     this.parentGroupdId=parentGroupdId;
     displayGroupId=function(groupId){
       displayGroupDetail(groupId,"..");
@@ -38,9 +38,9 @@ $(function() {
         type: "GET",
         dataType: 'json',
         success: function(data) {
-          var browseIdEntries = mapBrowseIdEntries(data);
-          $.log("size:"+browseIdEntries.length);
-          var browseViewModel = new BrowseViewModel(browseIdEntries);
+          var browseResultEntries = mapbrowseResultEntries(data);
+          $.log("size:"+browseResultEntries.length);
+          var browseViewModel = new BrowseViewModel(browseResultEntries);
 
           ko.applyBindings(browseViewModel,mainContent.get(0));
         }
@@ -59,8 +59,8 @@ $(function() {
           type: "GET",
           dataType: 'json',
           success: function(data) {
-            var browseIdEntries = mapBrowseIdEntries(data);
-            var browseViewModel = new BrowseViewModel(browseIdEntries,parentGroupdId);
+            var browseResultEntries = mapbrowseResultEntries(data);
+            var browseViewModel = new BrowseViewModel(browseResultEntries,parentGroupdId);
 
             ko.applyBindings(browseViewModel,mainContent.get(0));
           }
@@ -74,17 +74,17 @@ $(function() {
     $("#main-content" ).html("coming soon :-)");
   }
 
-  mapBrowseIdEntries=function(data){
-    if (data.browseResult && data.browseResult.browseIdEntries) {
-      return $.isArray(data.browseResult.browseIdEntries) ?
-         $.map(data.browseResult.browseIdEntries,function(item){
-           return new BrowseIdEntry(item.name, item.project);
-         }): [data.browseResult.browseIdEntries];
+  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];
     }
     return [];
   }
 
-  BrowseIdEntry=function(name,project){
+  BrowseResultEntry=function(name,project){
     this.name=name;
     this.project=project;
   }
index 119b2a49a4efbeb1b89d5af84762ec04780ce06f..b78c99244549666c5ff8a98d6f6f9f7e8b63073b 100644 (file)
   <div>
     <ul>
       <li class="browse-list"><a href="#" data-bind="click:function(){displayGroupId($root.parentGroupdId)}">..</a></li>
-      {{each(i,browseIdEntry) browseIdEntries}}
+      {{each(i,browseResultEntry) browseResultEntries}}
         <li class="browse-list">
-          <a href="#" data-bind="click:function(){displayGroupId(browseIdEntry.name)}">
-            &nbsp;${browseIdEntry.name}-project: ${browseIdEntry.project}
+          <a href="#" data-bind="click:function(){displayGroupId(browseResultEntry.name)}">
+            &nbsp;${browseResultEntry.name} (project: ${browseResultEntry.project})
           </a>
         </li>
       {{/each}}
index e70b514e8ee37f5a0b0d5739bd1f1a7a3cb9d3fc..f577e094761e1508ce4eac8904ef1e00b42411c7 100644 (file)
@@ -31,7 +31,7 @@
         </li>
         <li id="login-link" class="pull-right" style="display: none">
           <a href="#" onclick="loginBox();" id="login-link-a">
-            <span class="label label-success">${$.i18n.prop('login')}</span>
+            <span class="label label-success force-upper-case">${$.i18n.prop('login')}</span>
           </a>
         </li>
         <li id="change-password-link" class="pull-right" style="">
         </li>
         <li id="logout-link" class="pull-right" style="display: none">
           <a href="#" onclick="logout();" id="logout-link-a">
-            <span class="label label-important">${$.i18n.prop('logout')}</span>
+            <span class="label label-important force-upper-case">${$.i18n.prop('logout')}</span>
           </a>
         </li>
         <li id="register-link" class="pull-right" style="display: none">
           <a href="#" onclick="registerBox();" id="register-link-a">
-            <span class="label label-info">${$.i18n.prop('register')}</span>
+            <span class="label label-info force-upper-case">${$.i18n.prop('register')}</span>
           </a>
         </li>
         <li class="pull-right">