geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r513395 - in /geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console: classloaderview/ClassLoaderViewPortlet.java jndiview/JNDIViewPortlet.java util/StringTree.java
Date Thu, 01 Mar 2007 16:20:43 GMT
Author: pmcmahan
Date: Thu Mar  1 08:20:42 2007
New Revision: 513395

URL: http://svn.apache.org/viewvc?view=rev&rev=513395
Log:
GERONIMO-2854 alphabetical sort based on classloader names in the admin console's classloader
viewer.
Thanks to Rakesh Midha for the patch

Modified:
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/StringTree.java

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java?view=diff&rev=513395&r1=513394&r2=513395
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java
Thu Mar  1 08:20:42 2007
@@ -21,6 +21,7 @@
 import java.util.Iterator;
 import java.util.Hashtable;
 import java.util.List;
+import java.util.Collections;
 
 import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.StringTree;
@@ -125,7 +126,8 @@
                 updateTree((ClassLoader) iter.next(), parentNodes);
             else
                 inverseTree((ClassLoader) iter.next(), parentNodes);
-        }            
+        }
+        Collections.sort(parentNodes);
         return parentNodes;
     }
 

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java?view=diff&rev=513395&r1=513394&r2=513395
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java
Thu Mar  1 08:20:42 2007
@@ -256,18 +256,18 @@
                         jspNode = new StringTree("JSP");
                         servletsNode.addChild(jspNode);
                     }
-                    jspNode.addChild(servlet.substring(4));
+                    jspNode.addChild(new StringTree(servlet.substring(4)));
                 } else if (!servlet.equals("jsp")) {
                     if (servletsNode == null) {
                         servletsNode = new StringTree("Servlets");
                         webModule.addChild(servletsNode);
                     }
-                    servletsNode.addChild(servlet);
+                    servletsNode.addChild(new StringTree(servlet));
                 }
             }
             Iterator contexts = map.keySet().iterator();
             while (contexts.hasNext())
-                webModule.addChild("java:comp/" + contexts.next());
+                webModule.addChild(new StringTree("java:comp/" + contexts.next()));
         }
     }
 
@@ -287,12 +287,12 @@
                     || gb.getNameProperty("J2EEApplication").equals("null")) {
                 StringTree treeEnt = (StringTree) entApp
                         .get("ResourceAdapterModule");
-                treeEnt.addChild(resourceModule);
+                treeEnt.addChild(new StringTree(resourceModule));
             } else {
                 StringTree treeEnt = (StringTree) entApp.get(gb
                         .getNameProperty("J2EEApplication"));
                 treeEnt = treeEnt.findNode("ResourceAdapterModule");
-                treeEnt.addChild(resourceModule);
+                treeEnt.addChild(new StringTree(resourceModule));
             }
         }
     }
@@ -312,12 +312,12 @@
             if (gb.getNameProperty("J2EEApplication") == null
                     || gb.getNameProperty("J2EEApplication").equals("null")) {
                 StringTree treeEnt = (StringTree) entApp.get("AppClientModule");
-                treeEnt.addChild(appClienteModule);
+                treeEnt.addChild(new StringTree(appClienteModule));
             } else {
                 StringTree treeEnt = (StringTree) entApp.get(gb
                         .getNameProperty("J2EEApplication"));
                 treeEnt = treeEnt.findNode("AppClientModule");
-                treeEnt.addChild(appClienteModule);
+                treeEnt.addChild(new StringTree(appClienteModule));
             }
         }
     }
@@ -333,7 +333,7 @@
                     buildContext(node, (Context) obj, nodeCurr + "/"
                             + pair.getName());
                 } else {
-                    node.addChild(new String(nodeCurr + "/" + pair.getName()));
+                    node.addChild(new StringTree(nodeCurr + "/" + pair.getName()));
                 }
             }
         } catch (Exception e) {
@@ -355,7 +355,7 @@
             if (obj instanceof Context) {
                 buildGlobal(tree, (Context) obj, parent + pair.getName());
             } else {
-                tree.addChild(parent + pair.getName());
+                tree.addChild(new StringTree(parent + pair.getName()));
             }
         }
     }

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/StringTree.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/StringTree.java?view=diff&rev=513395&r1=513394&r2=513395
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/StringTree.java
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/StringTree.java
Thu Mar  1 08:20:42 2007
@@ -19,8 +19,9 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Hashtable;
+import java.util.Collections;
 
-public class StringTree {
+public class StringTree implements Comparable{
     public String name = null;
     public ArrayList childs = new ArrayList();    
     public StringTree(String nm, ArrayList elements){
@@ -98,6 +99,7 @@
         else
         {
             stb.append("',children:[");
+            Collections.sort(childs);
             for(int i=0;i<childs.size();i++){
                 Object obj = childs.get(i);
                 if(i !=0 )stb.append(",");
@@ -115,5 +117,10 @@
             stb.append("]}");
         }
         return stb.toString();
+    }
+    public int compareTo(Object obj){
+        if(name == null)
+            return -1;
+        return name.compareTo(((StringTree)obj).getName());
     }
 }



Mime
View raw message