geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccard...@apache.org
Subject svn commit: r495833 [1/2] - in /geronimo/server/trunk: applications/console/geronimo-console-framework/src/main/webapp/ applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/ applications/console/geronimo-console-standard/src/mai...
Date Sat, 13 Jan 2007 03:52:37 GMT
Author: ccardona
Date: Fri Jan 12 19:52:36 2007
New Revision: 495833

URL: http://svn.apache.org/viewvc?view=rev&rev=495833
Log:
GERONIMO-2689 : New View for JNDI name in all the contexts
GERONIMO-2690 : New view for all the classloaders and classes loaded in it
GERONIMO-2691 : New view for the hierarchical modules and linked dependencies

Thanks Rakesh!

Added:
    geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/TreeDocIcon.css
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/classloaderview/
    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/dependencyview/
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewPortlet.java
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jndiview/
    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
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/help.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/view.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/dependencyview/
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/dependencyview/help.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/dependencyview/view.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jndiview/
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jndiview/help.jsp
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jndiview/view.jsp
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/ClassLoaderRegistry.java
Modified:
    geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/pageregistry.xml
    geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/portletentityregistry.xml
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/portlet.xml
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/web.xml
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationClassLoader.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java

Added: geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/TreeDocIcon.css
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/TreeDocIcon.css?view=auto&rev=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/TreeDocIcon.css (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/TreeDocIcon.css Fri Jan 12 19:52:36 2007
@@ -0,0 +1,25 @@
+/*======================================================================
+*   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 url("../dojo/src/widget/templates/TreeDocIcon.css");
+
+.TreeExpandOpen .TreeIconFolder {
+    background-image: url('./images/ico_filetree_16x16.gif');
+}
+
+.TreeExpandClosed .TreeIconFolder {
+    background-image: url('./images/ico_filetree_16x16.gif');
+}

Modified: geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/pageregistry.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/pageregistry.xml?view=diff&rev=495833&r1=495832&r2=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/pageregistry.xml (original)
+++ geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/pageregistry.xml Fri Jan 12 19:52:36 2007
@@ -597,32 +597,84 @@
                 </fragment>
             </fragment>
     </fragment>
-    
-    <fragment name="JMXViewer" type="page">
+
+    <fragment name="DebugViews" type="page">
         <navigation>
-            <title>JMX Viewer</title>
-            <description>ico_filetree_16x16.gif JMX explorer</description> 
+            <title>Debug Views</title>
+            <description>ico_folder_16x16.gif Different debug viewers for the server</description>
         </navigation>
     
-        <fragment name="row1" type="row">
-            <fragment name="col1" type="column">
-                <fragment name="p1" type="portlet">
-                    <property name="portlet" value="5.72"/>
+        <fragment name="JMXViewer" type="page">
+            <navigation>
+                <title>JMX Viewer</title>
+                <description>ico_filetree_16x16.gif JMX explorer</description> 
+            </navigation>
+        
+            <fragment name="row1" type="row">
+                <fragment name="col1" type="column">
+                    <fragment name="p1" type="portlet">
+                        <property name="portlet" value="5.72"/>
+                    </fragment>
                 </fragment>
             </fragment>
         </fragment>
-    </fragment>
-
-    <fragment name="LDAPViewer" type="page">
-        <navigation>
-            <title>LDAP Viewer</title>
-            <description>ico_filetree_16x16.gif View contents of an LDAP server</description> 
-        </navigation>
     
-        <fragment name="row1" type="row">
-            <fragment name="col1" type="column">
-                <fragment name="p1" type="portlet">
-                    <property name="portlet" value="5.71"/>
+        <fragment name="LDAPViewer" type="page">
+            <navigation>
+                <title>LDAP Viewer</title>
+                <description>ico_filetree_16x16.gif View contents of an LDAP server</description> 
+            </navigation>
+        
+            <fragment name="row1" type="row">
+                <fragment name="col1" type="column">
+                    <fragment name="p1" type="portlet">
+                        <property name="portlet" value="5.71"/>
+                    </fragment>
+                </fragment>
+            </fragment>
+        </fragment>
+    
+        <fragment name="ClassLoaderViewer" type="page">
+            <navigation>
+                <title>ClassLoader Viewer</title>
+                <description>ico_filetree_16x16.gif View tree of ClassLoader loaded and its classes</description> 
+            </navigation>
+    
+            <fragment name="row1" type="row">
+                <fragment name="col1" type="column">
+                    <fragment name="p1" type="portlet">
+                        <property name="portlet" value="5.73"/>
+                    </fragment>
+                </fragment>
+            </fragment>
+        </fragment>
+    
+        <fragment name="JNDIViewer" type="page">
+            <navigation>
+                <title>JNDI Viewer</title>
+                <description>ico_filetree_16x16.gif View tree of JNDI naming registered for each application</description>
+            </navigation>
+    
+            <fragment name="row1" type="row">
+                <fragment name="col1" type="column">
+                    <fragment name="p1" type="portlet">
+                        <property name="portlet" value="5.74"/>
+                    </fragment>
+                </fragment>
+            </fragment>
+        </fragment>
+    
+        <fragment name="DependencyViewer" type="page">
+            <navigation>
+                <title>Dependency Viewer</title>
+                <description>ico_filetree_16x16.gif View tree of Dependencies for each modules</description> 
+            </navigation>
+    
+            <fragment name="row1" type="row">
+                <fragment name="col1" type="column">
+                    <fragment name="p1" type="portlet">
+                        <property name="portlet" value="5.75"/>
+                    </fragment>
                 </fragment>
             </fragment>
         </fragment>

Modified: geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/portletentityregistry.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/portletentityregistry.xml?view=diff&rev=495833&r1=495832&r2=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/portletentityregistry.xml (original)
+++ geronimo/server/trunk/applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/portletentityregistry.xml Fri Jan 12 19:52:36 2007
@@ -155,6 +155,15 @@
         <portlet id="72">
             <definition-id>console-standard.JMXViewer</definition-id>
         </portlet>
+        <portlet id="73">
+            <definition-id>console-standard.ClassLoaderViewer</definition-id>
+        </portlet>
+        <portlet id="74">
+            <definition-id>console-standard.JNDIViewer</definition-id>
+        </portlet>
+        <portlet id="75">
+            <definition-id>console-standard.DependencyViewer</definition-id>
+        </portlet>
         <!-- Leave some free numbers for the portlets that are in HEAD but not 1.1 yet -->
         <portlet id="80">
             <definition-id>console-standard.ThreadPool</definition-id>

Added: 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=auto&rev=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java Fri Jan 12 19:52:36 2007
@@ -0,0 +1,202 @@
+/**
+ *  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.
+ */
+package org.apache.geronimo.console.classloaderview;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.apache.geronimo.console.BasePortlet;
+import org.apache.geronimo.console.util.StringTree;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+import org.apache.geronimo.kernel.util.ClassLoaderRegistry;
+
+public class ClassLoaderViewPortlet extends BasePortlet {
+
+    private static final String NORMALVIEW_JSP = "/WEB-INF/view/classloaderview/view.jsp";
+
+    private static final String MAXIMIZEDVIEW_JSP = "/WEB-INF/view/classloaderview/view.jsp";
+
+    private static final String HELPVIEW_JSP = "/WEB-INF/view/classloaderview/help.jsp";
+
+    private PortletRequestDispatcher normalView;
+
+    private PortletRequestDispatcher maximizedView;
+
+    private PortletRequestDispatcher helpView;
+
+    public void processAction(ActionRequest actionRequest,
+            ActionResponse actionResponse) throws PortletException, IOException {
+    }
+
+    protected void doView(RenderRequest renderRequest,
+            RenderResponse renderResponse) throws IOException, PortletException {
+        if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
+            return;
+        }
+        renderRequest.getPortletSession().setAttribute("classloaderTree", this);
+
+        if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
+            normalView.include(renderRequest, renderResponse);
+        } else {
+            maximizedView.include(renderRequest, renderResponse);
+        }
+    }
+
+    protected void doHelp(RenderRequest renderRequest,
+            RenderResponse renderResponse) throws PortletException, IOException {
+        helpView.include(renderRequest, renderResponse);
+    }
+
+    public void init(PortletConfig portletConfig) throws PortletException {
+        super.init(portletConfig);
+        normalView = portletConfig.getPortletContext().getRequestDispatcher(
+                NORMALVIEW_JSP);
+        maximizedView = portletConfig.getPortletContext().getRequestDispatcher(
+                MAXIMIZEDVIEW_JSP);
+        helpView = portletConfig.getPortletContext().getRequestDispatcher(
+                HELPVIEW_JSP);
+
+    }
+
+    public void destroy() {
+        normalView = null;
+        maximizedView = null;
+        helpView = null;
+        super.destroy();
+    }
+
+    public String getJSONTrees() {
+        List list = getTrees();
+        if (list == null)
+            return "[]";
+
+        StringBuffer stb = new StringBuffer();
+        stb.append("[");
+        for (int i = 0; i < list.size(); i++) {
+            StringTree node = (StringTree) list.get(i);
+            if (i != 0)
+                stb.append(",");
+            stb.append(node.toJSONObject("" + i));
+        }
+        stb.append("]");
+        list = null;
+        return stb.toString();
+    }
+
+    public ArrayList getTrees() {
+        ArrayList parentNodes = new ArrayList();
+        List list = ClassLoaderRegistry.getList();
+        Iterator iter = list.iterator();
+        while (iter.hasNext()) {
+            updateTree((ClassLoader) iter.next(), parentNodes);
+        }
+        return parentNodes;
+    }
+
+    public StringTree updateTree(ClassLoader classloader, ArrayList parentNodes) {
+
+        Iterator iter = parentNodes.iterator();
+        StringTree node = null;
+        while (iter.hasNext()) {
+            StringTree currNode = (StringTree) iter.next();
+            node = currNode.findNode(classloader.toString());
+            if (node != null)
+                return node;
+        }
+
+        if (node == null) {
+            node = new StringTree(classloader.toString());
+            node = addClasses(node, classloader);
+
+            if (classloader instanceof org.apache.geronimo.kernel.config.MultiParentClassLoader) {
+                org.apache.geronimo.kernel.config.MultiParentClassLoader mpclassloader = (org.apache.geronimo.kernel.config.MultiParentClassLoader) classloader;
+                ClassLoader[] parents = mpclassloader.getParents();
+                if (parents == null)
+                    parentNodes.add(node);
+                else if (parents.length == 0)
+                    parentNodes.add(node);
+                else {
+                    for (int i = 0; i < parents.length; i++) {
+                        StringTree parentNode = updateTree(parents[i],
+                                parentNodes);
+                        parentNode.addChild(node);
+                    }
+                }
+            } else if (classloader.getParent() != null) {
+                StringTree parentNode = updateTree(classloader.getParent(),
+                        parentNodes);
+                parentNode.addChild(node);
+            } else
+                parentNodes.add(node);
+        }
+        return node;
+    }
+
+    private StringTree addClasses(StringTree node, ClassLoader loader) {
+        try {
+            java.lang.reflect.Field CLASSES_VECTOR_FIELD = ClassLoader.class
+                    .getDeclaredField("classes");
+
+            if (CLASSES_VECTOR_FIELD.getType() != java.util.Vector.class) {
+                return node;
+            }
+            CLASSES_VECTOR_FIELD.setAccessible(true);
+
+            final java.util.Vector classes = (java.util.Vector) CLASSES_VECTOR_FIELD
+                    .get(loader);
+            if (classes == null)
+                return node;
+
+            final Class[] result;
+
+            synchronized (classes) {
+                result = new Class[classes.size()];
+                classes.toArray(result);
+            }
+
+            CLASSES_VECTOR_FIELD.setAccessible(false);
+
+            StringTree classNames = new StringTree("Classes");
+            StringTree interfaceNames = new StringTree("Interfaces");
+            node.addChild(classNames);
+            node.addChild(interfaceNames);
+
+            for (int i = 0; i < result.length; i++) {
+                if (result[i].isInterface())
+                    interfaceNames.addChild(result[i].toString());
+                else
+                    classNames.addChild(result[i].toString());
+            }
+
+            return node;
+        } catch (Exception e) {
+            return node;
+        }
+    }
+
+}

Added: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewPortlet.java?view=auto&rev=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewPortlet.java (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewPortlet.java Fri Jan 12 19:52:36 2007
@@ -0,0 +1,326 @@
+/**
+ *  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.
+ */
+package org.apache.geronimo.console.dependencyview;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+
+import org.apache.geronimo.console.BasePortlet;
+import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.console.util.StringTree;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.repository.Artifact;
+
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+import org.apache.geronimo.kernel.DependencyManager;
+import org.apache.geronimo.kernel.config.ConfigurationInfo;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.repository.ListableRepository;
+import org.apache.geronimo.kernel.util.ClassLoaderRegistry;
+import org.apache.geronimo.kernel.repository.ListableRepository;
+
+public class DependencyViewPortlet extends BasePortlet {
+
+    private static final String NORMALVIEW_JSP = "/WEB-INF/view/dependencyview/view.jsp";
+
+    private static final String MAXIMIZEDVIEW_JSP = "/WEB-INF/view/dependencyview/view.jsp";
+
+    private static final String HELPVIEW_JSP = "/WEB-INF/view/dependencyview/help.jsp";
+
+    private PortletRequestDispatcher normalView;
+
+    private PortletRequestDispatcher maximizedView;
+
+    private PortletRequestDispatcher helpView;
+
+    public void processAction(ActionRequest actionRequest,
+            ActionResponse actionResponse) throws PortletException, IOException {
+    }
+
+    protected void doView(RenderRequest renderRequest,
+            RenderResponse renderResponse) throws IOException, PortletException {
+        if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
+            return;
+        }
+
+        renderRequest.getPortletSession().setAttribute("dependencyTree",
+                getJSONTrees(renderRequest));
+
+        if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
+            normalView.include(renderRequest, renderResponse);
+        } else {
+            maximizedView.include(renderRequest, renderResponse);
+        }
+    }
+
+    protected void doHelp(RenderRequest renderRequest,
+            RenderResponse renderResponse) throws PortletException, IOException {
+        helpView.include(renderRequest, renderResponse);
+    }
+
+    public void init(PortletConfig portletConfig) throws PortletException {
+        super.init(portletConfig);
+        normalView = portletConfig.getPortletContext().getRequestDispatcher(
+                NORMALVIEW_JSP);
+        maximizedView = portletConfig.getPortletContext().getRequestDispatcher(
+                MAXIMIZEDVIEW_JSP);
+        helpView = portletConfig.getPortletContext().getRequestDispatcher(
+                HELPVIEW_JSP);
+
+    }
+
+    public void destroy() {
+        normalView = null;
+        maximizedView = null;
+        helpView = null;
+        super.destroy();
+    }
+
+    private static ArrayList parentNodes = new ArrayList();
+
+    public static String getJSONTrees(RenderRequest renderRequest) {
+        List list = getTrees(renderRequest);
+        if (list == null)
+            return "[]";
+
+        StringBuffer stb = new StringBuffer();
+        stb.append("[");
+        for (int i = 0; i < list.size(); i++) {
+            StringTree node = (StringTree) list.get(i);
+            if (i != 0)
+                stb.append(",");
+            stb.append(node.toJSONObject("" + i));
+        }
+        stb.append("]");
+        return stb.toString();
+    }
+
+    public static void addDependencies(StringTree curr, Configuration conf) {
+        if (curr == null || conf == null)
+            return;
+        StringTree dep = new StringTree("dependencies");
+        curr.addChild(dep);
+        for (Iterator iterator = conf.getDependencies().iterator(); iterator
+                .hasNext();) {
+            dep.addChild(iterator.next().toString());
+        }
+        for (Iterator iterator = conf.getServiceParents().iterator(); iterator
+                .hasNext();) {
+            Configuration config = (Configuration) iterator.next();
+            dep.addChild(config.getId().toString());
+        }
+    }
+
+    public static ArrayList getTrees(RenderRequest request) {
+
+        ArrayList arryList = new ArrayList();
+        StringTree treeEAR = new StringTree("Enterprise Applications");
+        arryList.add(treeEAR);
+
+        StringTree treeEJB = new StringTree("EJBModule");
+        arryList.add(treeEJB);
+
+        StringTree treeWeb = new StringTree("WebModule");
+        arryList.add(treeWeb);
+
+        StringTree treeRAR = new StringTree("ResourceAdapterModule");
+        arryList.add(treeRAR);
+
+        StringTree treeCLI = new StringTree("AppClientModule");
+        arryList.add(treeCLI);
+
+        StringTree treeSys = new StringTree("System Module");
+        arryList.add(treeSys);
+
+        org.apache.geronimo.kernel.Kernel kernel = org.apache.geronimo.kernel.KernelRegistry
+                .getSingleKernel();
+
+        ConfigurationManager configManager = ConfigurationUtil
+                .getConfigurationManager(kernel);
+
+        List infos = configManager.listConfigurations();
+        for (Iterator infoIterator = infos.iterator(); infoIterator.hasNext();) {
+            ConfigurationInfo info = (ConfigurationInfo) infoIterator.next();
+            Configuration conf = configManager.getConfiguration(info
+                    .getConfigID());
+            if (conf != null) {
+                StringTree curr = new StringTree(info.getConfigID().toString());
+                ;
+                switch (info.getType().getValue()) {
+                case 0:// EAR
+                {
+                    treeEAR.addChild(curr);
+                    break;
+                }
+                case 1:// EJB
+                {
+                    treeEJB.addChild(curr);
+                    break;
+                }
+                case 2:// CAR
+                {
+                    treeCLI.addChild(curr);
+                    break;
+                }
+
+                case 3:// RAR
+                {
+                    treeRAR.addChild(curr);
+                    break;
+                }
+                case 4:// WAR
+                {
+                    treeWeb.addChild(curr);
+                    break;
+                }
+                case 5:// SERVICE
+                {
+                    treeSys.addChild(curr);
+                    break;
+                }
+                }
+
+                addDependencies(curr, conf);
+
+                if (info.getType().getValue() == ConfigurationModuleType.EAR
+                        .getValue()) {
+                    StringTree nodeEJB = new StringTree("EJBModule");
+                    curr.addChild(nodeEJB);
+
+                    StringTree nodeWeb = new StringTree("WebModule");
+                    curr.addChild(nodeWeb);
+
+                    StringTree nodeRAR = new StringTree("ResourceAdapterModule");
+                    curr.addChild(nodeRAR);
+
+                    StringTree nodeCLI = new StringTree("AppClientModule");
+                    curr.addChild(nodeCLI);
+
+                    Map query = new HashMap();
+                    query.put("j2eeType", "EJBModule");
+                    query.put("J2EEApplication", info.getConfigID().toString());
+                    Set setEnt = kernel
+                            .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
+                                    null, query));
+                    Iterator iterator = setEnt.iterator();
+                    while (iterator.hasNext()) {
+                        AbstractName gb = (AbstractName) iterator.next();
+                        StringTree subCurr = new StringTree(info.getConfigID()
+                                .getGroupId()
+                                + "/"
+                                + info.getConfigID().getArtifactId()
+                                + "_"
+                                + gb.getNameProperty("name")
+                                + "/"
+                                + info.getConfigID().getVersion()
+                                + "/"
+                                + info.getConfigID().getType());
+                        nodeEJB.addChild(subCurr);
+                        addDependencies(subCurr, configManager
+                                .getConfiguration(gb.getArtifact()));
+                    }
+
+                    Map query1 = new HashMap();
+                    query1.put("j2eeType", "ResourceAdapterModule");
+                    query1
+                            .put("J2EEApplication", info.getConfigID()
+                                    .toString());
+                    Set setEnt1 = kernel
+                            .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
+                                    null, query1));
+
+                    Iterator iterator1 = setEnt1.iterator();
+                    while (iterator1.hasNext()) {
+                        AbstractName gb = (AbstractName) iterator1.next();
+                        StringTree subCurr = new StringTree(info.getConfigID()
+                                .getGroupId()
+                                + "/"
+                                + info.getConfigID().getArtifactId()
+                                + "_"
+                                + gb.getNameProperty("name")
+                                + "/"
+                                + info.getConfigID().getVersion()
+                                + "/"
+                                + info.getConfigID().getType());
+                        nodeRAR.addChild(subCurr);
+                        addDependencies(subCurr, configManager
+                                .getConfiguration(gb.getArtifact()));
+                    }
+
+                    for (int i = 0; i < conf.getChildren().size(); i++) {
+                        Configuration config = ((Configuration) conf
+                                .getChildren().get(i));
+                        StringTree subCurr = new StringTree(config
+                                .getAbstractName().toString());
+                        nodeWeb.addChild(subCurr);
+                        addDependencies(subCurr, config);
+                    }
+
+                    for (Iterator iter = conf.getOwnedConfigurations()
+                            .iterator(); iter.hasNext();) {
+                        Artifact name = (Artifact) iter.next();
+                        StringTree subCurr = new StringTree(name.toString());
+                        nodeCLI.addChild(subCurr);
+                        addDependencies(subCurr, configManager
+                                .getConfiguration(name));
+                    }
+
+                }
+
+            }
+
+        }
+
+        StringTree treeRepo = new StringTree("Repository");
+        arryList.add(treeRepo);
+
+        ListableRepository[] repos = PortletManager.getCurrentServer(request)
+                .getRepositories();
+        for (int i = 0; i < repos.length; i++) {
+            ListableRepository repo = repos[i];
+            final SortedSet artifacts = repo.list();
+            for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
+                String fileName = iterator.next().toString();
+                treeRepo.addChild(fileName);
+            }
+
+        }
+
+        return arryList;
+
+    }
+
+}

Added: 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=auto&rev=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/jndiview/JNDIViewPortlet.java Fri Jan 12 19:52:36 2007
@@ -0,0 +1,431 @@
+/**
+ *  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.
+ */
+package org.apache.geronimo.console.jndiview;
+
+// import org.apache.geronimo.kernel.config.*;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.gbean.AbstractName;
+import javax.naming.Context;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+import java.util.Collections;
+
+import org.apache.geronimo.console.BasePortlet;
+import org.apache.geronimo.console.util.StringTree;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+public class JNDIViewPortlet extends BasePortlet {
+
+    private static final String NORMALVIEW_JSP = "/WEB-INF/view/jndiview/view.jsp";
+
+    private static final String MAXIMIZEDVIEW_JSP = "/WEB-INF/view/jndiview/view.jsp";
+
+    private static final String HELPVIEW_JSP = "/WEB-INF/view/jndiview/help.jsp";
+
+    private PortletRequestDispatcher normalView;
+
+    private PortletRequestDispatcher maximizedView;
+
+    private PortletRequestDispatcher helpView;
+
+    public void processAction(ActionRequest actionRequest,
+            ActionResponse actionResponse) throws PortletException, IOException {
+    }
+
+    protected void doView(RenderRequest renderRequest,
+            RenderResponse renderResponse) throws IOException, PortletException {
+        if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
+            return;
+        }
+
+        try {
+            renderRequest.getPortletSession().setAttribute("jndiTree",
+                    getJSONTrees());
+        } catch (Exception ex) {
+            throw new PortletException(ex);
+        }
+        if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
+            normalView.include(renderRequest, renderResponse);
+        } else {
+            maximizedView.include(renderRequest, renderResponse);
+        }
+    }
+
+    protected void doHelp(RenderRequest renderRequest,
+            RenderResponse renderResponse) throws PortletException, IOException {
+        helpView.include(renderRequest, renderResponse);
+    }
+
+    public void init(PortletConfig portletConfig) throws PortletException {
+        super.init(portletConfig);
+        normalView = portletConfig.getPortletContext().getRequestDispatcher(
+                NORMALVIEW_JSP);
+        maximizedView = portletConfig.getPortletContext().getRequestDispatcher(
+                MAXIMIZEDVIEW_JSP);
+        helpView = portletConfig.getPortletContext().getRequestDispatcher(
+                HELPVIEW_JSP);
+
+    }
+
+    public void destroy() {
+        normalView = null;
+        maximizedView = null;
+        helpView = null;
+        super.destroy();
+    }
+
+    public String getJSONTrees() throws Exception {
+        List list = getContextTree();
+        if (list == null)
+            return "[]";
+
+        StringBuffer stb = new StringBuffer();
+        stb.append("[");
+        for (int i = 0; i < list.size(); i++) {
+            StringTree node = (StringTree) list.get(i);
+            if (i != 0)
+                stb.append(",");
+            stb.append(node.toJSONObject("" + i));
+        }
+        stb.append("]");
+        return stb.toString();
+    }
+
+    private void buildEJBModule(Kernel kernel, List arryList, Hashtable entApp)
+            throws Exception {
+        Map query = new HashMap();
+        query.put("j2eeType", "EJBModule");
+        Set setEnt = kernel
+                .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
+                        null, query));
+        Iterator iterator = setEnt.iterator();
+
+        while (iterator.hasNext()) {
+            AbstractName gb = (AbstractName) iterator.next();
+            StringTree ejbModule = new StringTree(gb.getNameProperty("name"));
+
+            if (gb.getNameProperty("J2EEApplication") == null
+                    || gb.getNameProperty("J2EEApplication").equals("null")) {
+                StringTree treeEnt = (StringTree) entApp.get("EJBModule");
+                treeEnt.addChild(ejbModule);
+            } else {
+                StringTree treeEnt = (StringTree) entApp.get(gb
+                        .getNameProperty("J2EEApplication"));
+                treeEnt = treeEnt.findNode("EJBModule");
+                treeEnt.addChild(ejbModule);
+            }
+            Map queryEnt = new HashMap();
+            StringTree entityBean = new StringTree("EntityBeans");
+            ejbModule.addChild(entityBean);
+            queryEnt.put("j2eeType", "EntityBean");
+            queryEnt.put("EJBModule", gb.getNameProperty("name"));
+            queryEnt.put("J2EEApplication", gb
+                    .getNameProperty("J2EEApplication"));
+            Set setEntBean = kernel
+                    .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
+                            null, queryEnt));
+
+            Iterator iterEntBean = setEntBean.iterator();
+
+            while (iterEntBean.hasNext()) {
+                AbstractName gbEntBean = (AbstractName) iterEntBean.next();
+                StringTree beanNode = new StringTree(gbEntBean
+                        .getNameProperty("name"));
+                entityBean.addChild(beanNode);
+                Context jndi = (Context) kernel.getAttribute(gbEntBean,
+                        "componentContext");
+                buildContext(beanNode, jndi, "java:comp");
+            }
+
+            queryEnt = new HashMap();
+            StringTree sessionBean = new StringTree("SessionBeans");
+            ejbModule.addChild(sessionBean);
+            queryEnt.put("j2eeType", "StatelessSessionBean");
+            queryEnt.put("EJBModule", gb.getNameProperty("name"));
+            queryEnt.put("J2EEApplication", gb
+                    .getNameProperty("J2EEApplication"));
+            Set setSessionBean = kernel
+                    .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
+                            null, queryEnt));
+
+            Iterator iterSessionBean = setSessionBean.iterator();
+
+            while (iterSessionBean.hasNext()) {
+                AbstractName gbSessionBean = (AbstractName) iterSessionBean
+                        .next();
+                StringTree beanNode = new StringTree(gbSessionBean
+                        .getNameProperty("name"));
+                sessionBean.addChild(beanNode);
+                Context jndi = (Context) kernel.getAttribute(gbSessionBean,
+                        "componentContext");
+                buildContext(beanNode, jndi, "java:comp");
+            }
+
+            queryEnt = new HashMap();
+            queryEnt.put("j2eeType", "StatefullSessionBean");
+            queryEnt.put("EJBModule", gb.getNameProperty("name"));
+            queryEnt.put("J2EEApplication", gb
+                    .getNameProperty("J2EEApplication"));
+            setSessionBean = kernel
+                    .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
+                            null, queryEnt));
+
+            iterSessionBean = setSessionBean.iterator();
+
+            while (iterSessionBean.hasNext()) {
+                AbstractName gbSessionBean = (AbstractName) iterSessionBean
+                        .next();
+                StringTree beanNode = new StringTree(gbSessionBean
+                        .getNameProperty("name"));
+                sessionBean.addChild(beanNode);
+                Context jndi = (Context) kernel.getAttribute(gbSessionBean,
+                        "componentContext");
+                buildContext(beanNode, jndi, "java:comp");
+            }
+        }
+    }
+
+    private void buildWebModule(Kernel kernel, List arryList, Hashtable entApp)
+            throws Exception {
+        Map query = new HashMap();
+        query.put("j2eeType", "WebModule");
+        Set setEnt = kernel
+                .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
+                        null, query));
+        Iterator iterator = setEnt.iterator();
+
+        while (iterator.hasNext()) {
+
+            AbstractName gb = (AbstractName) iterator.next();
+            StringTree webModule = new StringTree(gb.getNameProperty("name"));
+
+            if (gb.getNameProperty("J2EEApplication") == null
+                    || gb.getNameProperty("J2EEApplication").equals("null")) {
+                StringTree treeEnt = (StringTree) entApp.get("WebModule");
+                treeEnt.addChild(webModule);
+            } else {
+                StringTree treeEnt = (StringTree) entApp.get(gb
+                        .getNameProperty("J2EEApplication"));
+                treeEnt = treeEnt.findNode("WebModule");
+                treeEnt.addChild(webModule);
+            }
+
+            Map map = (Map) kernel.getAttribute(gb, "componentContext");
+            String[] servlets = (String[]) kernel.getAttribute(gb, "servlets");
+
+            StringTree servletsNode = null;
+            StringTree jspNode = null;
+
+            for (int i = 0; i < servlets.length; i++) {
+                String servlet = servlets[i];
+                servlet = servlet.substring(servlet.indexOf("name=") + 5);
+                if (servlet.indexOf(",") != -1)
+                    servlet = servlet.substring(0, servlet.indexOf(","));
+                if (!servlet.equals("jsp") && servlet.startsWith("jsp.")) {
+                    if (servletsNode == null) {
+                        servletsNode = new StringTree("Servlets");
+                        webModule.addChild(servletsNode);
+                    }
+                    if (jspNode == null) {
+                        jspNode = new StringTree("JSP");
+                        servletsNode.addChild(jspNode);
+                    }
+                    jspNode.addChild(servlet.substring(4));
+                } else if (!servlet.equals("jsp")) {
+                    if (servletsNode == null) {
+                        servletsNode = new StringTree("Servlets");
+                        webModule.addChild(servletsNode);
+                    }
+                    servletsNode.addChild(servlet);
+                }
+            }
+            Iterator contexts = map.keySet().iterator();
+            while (contexts.hasNext())
+                webModule.addChild("java:comp/" + contexts.next());
+        }
+    }
+
+    private void buildResourceModule(Kernel kernel, List arryList,
+            Hashtable entApp) throws Exception {
+        Map query = new HashMap();
+        query.put("j2eeType", "ResourceAdapterModule");
+        Set setEnt = kernel
+                .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
+                        null, query));
+        Iterator iterator = setEnt.iterator();
+
+        while (iterator.hasNext()) {
+            AbstractName gb = (AbstractName) iterator.next();
+            String resourceModule = gb.getNameProperty("name");
+            if (gb.getNameProperty("J2EEApplication") == null
+                    || gb.getNameProperty("J2EEApplication").equals("null")) {
+                StringTree treeEnt = (StringTree) entApp
+                        .get("ResourceAdapterModule");
+                treeEnt.addChild(resourceModule);
+            } else {
+                StringTree treeEnt = (StringTree) entApp.get(gb
+                        .getNameProperty("J2EEApplication"));
+                treeEnt = treeEnt.findNode("ResourceAdapterModule");
+                treeEnt.addChild(resourceModule);
+            }
+        }
+    }
+
+    private void buildAppClientModule(Kernel kernel, List arryList,
+            Hashtable entApp) throws Exception {
+        Map query = new HashMap();
+        query.put("j2eeType", "AppClientModule");
+        Set setEnt = kernel
+                .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
+                        null, query));
+        Iterator iterator = setEnt.iterator();
+
+        while (iterator.hasNext()) {
+            AbstractName gb = (AbstractName) iterator.next();
+            String appClienteModule = gb.getNameProperty("name");
+            if (gb.getNameProperty("J2EEApplication") == null
+                    || gb.getNameProperty("J2EEApplication").equals("null")) {
+                StringTree treeEnt = (StringTree) entApp.get("AppClientModule");
+                treeEnt.addChild(appClienteModule);
+            } else {
+                StringTree treeEnt = (StringTree) entApp.get(gb
+                        .getNameProperty("J2EEApplication"));
+                treeEnt = treeEnt.findNode("AppClientModule");
+                treeEnt.addChild(appClienteModule);
+            }
+        }
+    }
+
+    public void buildContext(StringTree node, Context ctx, String nodeCurr) {
+        try {
+            javax.naming.NamingEnumeration enumName = ctx.list("");
+            while (enumName.hasMoreElements()) {
+                javax.naming.NameClassPair pair = (javax.naming.NameClassPair) enumName
+                        .next();
+                Object obj = ctx.lookup(pair.getName());
+                if (obj instanceof Context) {
+                    buildContext(node, (Context) obj, nodeCurr + "/"
+                            + pair.getName());
+                } else {
+                    node.addChild(new String(nodeCurr + "/" + pair.getName()));
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void buildGlobal(StringTree tree, Context context, String parent)
+            throws Exception {
+        if (parent == null)
+            parent = "";
+        if (!parent.equals(""))
+            parent = parent + "/";
+        javax.naming.NamingEnumeration enum1 = context.list("");
+        while (enum1.hasMoreElements()) {
+            javax.naming.NameClassPair pair = (javax.naming.NameClassPair) enum1
+                    .next();
+            Object obj = context.lookup(pair.getName());
+            if (obj instanceof Context) {
+                buildGlobal(tree, (Context) obj, parent + pair.getName());
+            } else {
+                tree.addChild(parent + pair.getName());
+            }
+        }
+    }
+
+    public List getContextTree() throws Exception {
+        List arryList = new ArrayList();
+        Hashtable entApp = new Hashtable();
+
+        StringTree treeGlobal = new StringTree("Global Context");
+        arryList.add(treeGlobal);
+        buildGlobal(treeGlobal,
+                org.apache.xbean.naming.global.GlobalContextManager
+                        .getGlobalContext(), "");
+
+        StringTree tree = new StringTree("Enterprise Applications");
+        arryList.add(tree);
+
+        StringTree treeMod = new StringTree("EJBModule");
+        entApp.put("EJBModule", treeMod);
+        arryList.add(treeMod);
+
+        treeMod = new StringTree("WebModule");
+        entApp.put("WebModule", treeMod);
+        arryList.add(treeMod);
+
+        treeMod = new StringTree("ResourceAdapterModule");
+        entApp.put("ResourceAdapterModule", treeMod);
+        arryList.add(treeMod);
+
+        treeMod = new StringTree("AppClientModule");
+        entApp.put("AppClientModule", treeMod);
+        arryList.add(treeMod);
+
+        org.apache.geronimo.kernel.Kernel kernel = org.apache.geronimo.kernel.KernelRegistry
+                .getSingleKernel();
+
+        Set setEnt = kernel
+                .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
+                        null,
+                        Collections.EMPTY_MAP,
+                        org.apache.geronimo.j2ee.management.impl.J2EEApplicationImpl.class
+                                .getName()));
+        Iterator iterator = setEnt.iterator();
+        while (iterator.hasNext()) {
+            org.apache.geronimo.gbean.AbstractName gb = (org.apache.geronimo.gbean.AbstractName) iterator
+                    .next();
+            StringTree curr = new StringTree(gb.getNameProperty("name"));
+            tree.addChild(curr);
+            entApp.put(gb.getNameProperty("name"), curr);
+
+            StringTree temp = new StringTree("EJBModule");
+            curr.addChild(temp);
+
+            temp = new StringTree("WebModule");
+            curr.addChild(temp);
+
+            temp = new StringTree("ResourceAdapterModule");
+            curr.addChild(temp);
+
+            temp = new StringTree("AppClientModule");
+            curr.addChild(temp);
+        }
+
+        buildEJBModule(kernel, arryList, entApp);
+        buildWebModule(kernel, arryList, entApp);
+        buildResourceModule(kernel, arryList, entApp);
+        buildAppClientModule(kernel, arryList, entApp);
+        return arryList;
+    }
+}
\ No newline at end of file

Added: 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=auto&rev=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/StringTree.java (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/StringTree.java Fri Jan 12 19:52:36 2007
@@ -0,0 +1,132 @@
+/**
+ *  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.
+ */
+package org.apache.geronimo.console.util;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+public class StringTree {
+    public String name = null;
+    public ArrayList childs = new ArrayList();    
+    public StringTree(String nm, ArrayList elements){
+        name = nm;
+        childs = elements;
+    }
+    public StringTree(String nm){
+        name = nm;        
+    }
+    public String getName(){
+        return name;
+    }
+    public void setName(String nm){
+        name = nm;;
+    }
+    public ArrayList getChilds(){
+        return childs;
+    }
+    public void setChilds(ArrayList elements){
+        childs = elements;
+    }
+    public void addChild(Object obj){
+        childs.add(obj);
+    }
+    public StringTree findNode(String id){
+        if(id == null)return null;
+        if(name != null && name.equals(id))
+            return this;
+        Iterator iter = childs.iterator();
+        while(iter.hasNext()){
+            Object obj = iter.next();
+            if(obj instanceof StringTree){
+                StringTree tree = ((StringTree)obj).findNode(id);
+                if(tree != null)return tree;
+            }                
+        }
+        return null;
+    }
+           
+    public String toJSONObject(String prependId){
+        StringBuffer stb = new StringBuffer();
+        stb.append("{title:'");
+        if(name != null)
+            stb.append(name);
+        stb.append("',widgetId:'");
+        stb.append(prependId);
+        if(childs == null || childs.size() == 0){
+            stb.append("',children:[]}");
+        }
+        else
+        {
+            stb.append("',children:[");
+            for(int i=0;i<childs.size();i++){
+                Object obj = childs.get(i);
+                if(i !=0 )stb.append(",");
+                if(obj instanceof StringTree)
+                    stb.append(((StringTree)obj).toJSONObject(prependId+"."+i)); 
+                else
+                {
+                    stb.append("{title:'");
+                    stb.append((String)obj);
+                    stb.append("',widgetId:'");
+                    stb.append(prependId+"."+i);
+                    stb.append("'}");
+                }
+            }
+            stb.append("]}");
+        }
+        return stb.toString();
+    }
+    public static String classIcon = "../images/ico_C.gif";
+    public static String interfaceIcon = "../images/ico_I.gif";
+    public static String folderIcon = "../images/ico_folder_16x16.gif";
+    public static String clIcon = "../images/ico_filetree_16x16.gif";
+    public String toHTMLNode(int depth)
+    {
+        //if(depth > 2)return "";
+        StringBuffer stb = new StringBuffer();
+        
+        if(childs == null || childs.size() == 0){
+            stb.append("<div dojoType='TreeNode' title='"+name+"'></div>");
+        }
+        else
+        {
+            if(name.equals("Classes") || name.equals("Interfaces"))
+                stb.append("<div dojoType='TreeNode' title='"+name+"' childIconSrc='"+folderIcon+"'>");
+            else
+                stb.append("<div dojoType='TreeNode' title='"+name+"' childIconSrc='"+clIcon+"'>");
+            Iterator iter = childs.iterator();
+            while(iter.hasNext()){
+                Object obj = iter.next();
+                if(obj instanceof StringTree)
+                    stb.append(((StringTree)obj).toHTMLNode(depth+1));
+                else
+                {/*
+                    String curr = (String)obj;
+                    if(curr.startsWith("class"))
+                        stb.append("<div dojoType='TreeNode' title='"+curr.substring(6)+"' childIconSrc='"+classIcon+"'></div>");
+                    else if(curr.startsWith("interface"))
+                        stb.append("<div dojoType='TreeNode' title='"+curr.substring(10)+"' childIconSrc='"+interfaceIcon+"'></div>");
+                    else
+                        stb.append("<div dojoType='TreeNode' title='"+curr+"'></div>");
+                        */
+                }                
+            }
+            stb.append("</div>");            
+        }
+        return stb.toString();
+    }
+}

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/portlet.xml?view=diff&rev=495833&r1=495832&r2=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/portlet.xml (original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/portlet.xml Fri Jan 12 19:52:36 2007
@@ -1165,5 +1165,76 @@
         </portlet-info>
     </portlet>
 
+    <portlet>
+        <description>Portlet for viewing Classloader tree</description>
+        <portlet-name>ClassLoaderViewer</portlet-name>
+        <display-name>ClassLoader Viewer Portlet</display-name>
+                       
+        <portlet-class>org.apache.geronimo.console.classloaderview.ClassLoaderViewPortlet</portlet-class>
+
+        <expiration-cache>-1</expiration-cache>
+
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+            <portlet-mode>HELP</portlet-mode>
+        </supports>
+
+        <supported-locale>en</supported-locale>
+
+        <portlet-info>
+            <title>ClassLoader Viewer</title>
+            <short-title>ClassLoader Viewer</short-title>
+            <keywords>ClassLoader Viewer</keywords>
+        </portlet-info>
+    </portlet>
+
+    <portlet>
+        <description>Portlet for viewing JNDI tree</description>
+        <portlet-name>JNDIViewer</portlet-name>
+        <display-name>JNDI Viewer Portlet</display-name>
+                       
+        <portlet-class>org.apache.geronimo.console.jndiview.JNDIViewPortlet</portlet-class>
+
+        <expiration-cache>-1</expiration-cache>
+
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+            <portlet-mode>HELP</portlet-mode>
+        </supports>
+
+        <supported-locale>en</supported-locale>
+
+        <portlet-info>
+            <title>JNDI Viewer</title>
+            <short-title>JNDI Viewer</short-title>
+            <keywords>JNDI Viewer</keywords>
+        </portlet-info>
+    </portlet>
+
+    <portlet>
+        <description>Portlet for viewing Dependency tree</description>
+        <portlet-name>DependencyViewer</portlet-name>
+        <display-name>Dependency Viewer Portlet</display-name>
+                       
+        <portlet-class>org.apache.geronimo.console.dependencyview.DependencyViewPortlet</portlet-class>
+
+        <expiration-cache>-1</expiration-cache>
+
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+            <portlet-mode>HELP</portlet-mode>
+        </supports>
+
+        <supported-locale>en</supported-locale>
+
+        <portlet-info>
+            <title>Dependency Viewer</title>
+            <short-title>Dependency Viewer</short-title>
+            <keywords>Dependency Viewer</keywords>
+        </portlet-info>
+    </portlet>
     <!-- End of console portlets -->
 </portlet-app>

Added: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/help.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/help.jsp?view=auto&rev=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/help.jsp (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/help.jsp Fri Jan 12 19:52:36 2007
@@ -0,0 +1,20 @@
+<%--
+   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.
+--%>
+
+<p><font face="Verdana" size="+1"><center><b>This is the help for the Geronimo Administration Classloader VIEW page.</b></center></font></p>
+
+<P>This view can be used to all the classloader involved in server and the classes it loads.</P>

Added: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/view.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/view.jsp?view=auto&rev=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/view.jsp (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/view.jsp Fri Jan 12 19:52:36 2007
@@ -0,0 +1,192 @@
+<%--
+   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.
+--%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ page import="org.apache.geronimo.console.util.PortletManager,
+                 javax.portlet.RenderRequest, org.apache.geronimo.console.classloaderview.ClassLoaderViewPortlet"%>
+<portlet:defineObjects/>
+
+<%
+	
+
+	ClassLoaderViewPortlet cp = (ClassLoaderViewPortlet)renderRequest.getPortletSession().getAttribute("classloaderTree");	
+	renderRequest.getPortletSession().removeAttribute("classloaderTree");
+	String childs = cp.getJSONTrees();
+%>
+
+<script>
+	dojo.require("dojo.widget.*");
+	dojo.require("dojo.widget.TreeV3");
+	dojo.require("dojo.widget.TreeNodeV3");
+	dojo.require("dojo.widget.TreeBasicControllerV3");
+	dojo.require("dojo.widget.TreeSelectorV3");
+	dojo.require("dojo.widget.TreeEmphasizeOnSelect");
+	dojo.require("dojo.widget.TreeToggleOnSelect");
+	
+	dojo.hostenv.writeIncludes();
+
+    dojo.addOnLoad(function(){
+
+		var tree = dojo.widget.manager.getWidgetById('tree');
+
+		var treeNodes = <%= childs %>;		
+
+		tree.setChildren(treeNodes);
+
+	});
+
+
+
+var lastFound = '';
+var doCheck = false;;
+function check(curr,last)
+{
+	var cr=curr.split(".");
+	var ls=last.split(".");
+	for(var i =0;i<cr.length;i++)
+		if(parseInt(cr[i]) < parseInt(ls[i]))
+			return false;
+	return true;
+}
+function findNext(children, str)
+{
+	for(var child = 0;child < children.length;child++)
+	{
+		if(doCheck)
+		{
+			if(!check(children[child].widgetId,lastFound))
+				continue;
+			else
+				if(children[child].widgetId == lastFound)doCheck = false;
+		}
+		if(children[child].title.indexOf(str) != -1 && children[child].widgetId != lastFound && !doCheck)
+			return children[child].widgetId;
+		if(children[child].children){
+			var ret=findNext(children[child].children,str);
+			if(ret)
+				return ret;
+		}
+	}	
+	return ;
+}
+
+function select(node)
+{
+	var nodes = node.split(".");
+	var curr ="";
+	for(nod in nodes)
+	{
+		if(curr == "")curr=curr+nodes[nod];
+		else curr=curr+"."+nodes[nod];
+		if(dojo.widget.byId(curr).state != "LOADED" && dojo.widget.byId(curr).children.length != 0)
+			dojo.widget.byId(curr).setChildren(dojo.widget.byId(curr).children);
+		dojo.widget.byId('controller').expandToLevel(dojo.widget.byId(curr),1);
+	}
+	dojo.widget.byId('selector').select(dojo.widget.byId(node));
+}
+
+function findInSelected(selectedNodes)
+{
+	var search = document.getElementById("searchText").value;
+	if(search == "")
+	{
+		debug.innerHTML = "<br/>Failure in search: No text to search";
+		alert('Failure in search: No text to search');
+		return;
+	}
+	var v= findNext(selectedNodes,search);
+	if(v)
+	{
+		dojo.widget.byId('selector').deselectAll();
+		select(v);
+		document.getElementById("findNext").disabled=false;
+		lastFound =  v;
+		doCheck = true;
+	}
+	else{
+		debug.innerHTML = "<br/>Failure in search: No more matching result found";
+		alert('Failure in search: No more matching result found');
+		lastFound =  '';
+		doCheck = false;
+	}
+}
+function textChange(){
+	document.getElementById("findNext").disabled=true;
+	lastFound = '';
+	doCheck = false;
+}
+
+var lastSearchOn = '';
+function search(){
+	debug.innerHTML = "";
+	document.body.style.cursor = "wait";
+	lastFound = '';
+	doCheck = false;
+	lastSearchOn = [];
+	var nodes;
+	if(document.getElementById("inSelected").checked){
+		nodes = dojo.widget.byId('selector').selectedNodes;
+		if(nodes == '')
+		{
+			debug.innerHTML = "<br/>Failure in search: No node selected to search.";
+			alert('Failure in search: No node selected to search');
+		}
+		else{
+			for(obj in nodes)
+				lastSearchOn.push(nodes[obj]);	
+			findInSelected(nodes);
+		}
+	}
+	else{ 
+		nodes = dojo.widget.byId('tree').children;
+		lastSearchOn = dojo.widget.byId('tree').children;
+		findInSelected(nodes);
+	}
+	document.body.style.cursor = '';
+}
+function searchContinue(){
+	debug.innerHTML = "";
+	document.body.style.cursor = "wait";
+	findInSelected(lastSearchOn);
+	document.body.style.cursor = '';
+}
+
+</script>
+
+	<% 
+		String consoleFrameworkContext = PortletManager.getConsoleFrameworkServletPath(request);
+	    String iconCSS = consoleFrameworkContext + "/../TreeDocIcon.css";
+	%>
+
+<TABLE cellpadding="1" cellspacing="1" border="1">
+<tr><td>
+<b>Search Text:</b> <input type="text" id="searchText" onChange="javascript:textChange()"/>
+<input type="button" value="Find" onClick="javascript:search()"/>
+<input type="button" id="findNext" value="Find Next" onClick="javascript:searchContinue()" disabled=true />
+Search only selected:<input type="checkbox" id="inSelected" onChange="javascript:textChange()"/>
+</td></tr>
+</table>
+<br/>
+
+<div dojoType="TreeBasicControllerV3" widgetId="controller"></div>	
+<div dojoType="TreeSelectorV3" widgetId="selector"></div>	
+<div dojoType="TreeEmphasizeOnSelect" selector="selector"></div>
+<div dojoType="TreeToggleOnSelect" selector="selector" controller="controller"></div>
+<div dojoType="TreeDocIconExtension"  widgetId="iconcontroller" templateCssPath="<%= iconCSS %>"></div>
+<div dojoType="TreeV3" listeners="controller;selector;iconcontroller" widgetId='tree' allowedMulti='false'></div>
+
+<div id="debug"></div>

Added: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/dependencyview/help.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/dependencyview/help.jsp?view=auto&rev=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/dependencyview/help.jsp (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/dependencyview/help.jsp Fri Jan 12 19:52:36 2007
@@ -0,0 +1,20 @@
+<%--
+   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.
+--%>
+
+<p><font face="Verdana" size="+1"><center><b>This is the help for the Geronimo Administration Dependency VIEW page.</b></center></font></p>
+
+<P>This view can be used to all the modules and its dependencies.</P>

Added: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/dependencyview/view.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/dependencyview/view.jsp?view=auto&rev=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/dependencyview/view.jsp (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/dependencyview/view.jsp Fri Jan 12 19:52:36 2007
@@ -0,0 +1,209 @@
+<%--
+   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.
+--%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ page import="org.apache.geronimo.console.util.PortletManager,
+                 javax.portlet.RenderRequest"%>
+<portlet:defineObjects/>
+
+<%
+	String childs = (String)renderRequest.getPortletSession().getAttribute("dependencyTree");	
+	renderRequest.getPortletSession().removeAttribute("dependencyTree");
+%>
+
+<script>
+	dojo.require("dojo.widget.*");
+	dojo.require("dojo.widget.TreeV3");
+	dojo.require("dojo.widget.TreeNodeV3");
+	dojo.require("dojo.widget.TreeBasicControllerV3");
+	dojo.require("dojo.widget.TreeSelectorV3");
+	dojo.require("dojo.widget.TreeEmphasizeOnSelect");
+	dojo.require("dojo.widget.TreeToggleOnSelect");
+	
+	dojo.hostenv.writeIncludes();
+
+    dojo.addOnLoad(function(){
+
+		var tree = dojo.widget.manager.getWidgetById('tree');
+
+		dojo.event.topic.subscribe("nodeSelected",
+			 function(message) { 
+				if(message.node.parent.title == "dependencies"){
+					for(var i=0;i<tree.children.length;i++){
+						var node = findOnlyInSelected(tree.children[i],message.node.title);
+						if(node)
+						{
+							select(node);
+							break;
+						}
+					}
+				}
+			 }
+		);
+		
+		
+
+		var treeNodes = <%= childs %>;		
+
+		tree.setChildren(treeNodes);
+
+	});
+function findOnlyInSelected(selectedNodes, search)
+{
+	var children = selectedNodes.children;
+	for(var child = 0;child < children.length;child++)
+	{
+		if(children[child].title == search)
+			return children[child].widgetId;
+	}	
+	return ;
+}
+
+
+var lastFound = '';
+var doCheck = false;;
+function check(curr,last)
+{
+	var cr=curr.split(".");
+	var ls=last.split(".");
+	for(var i =0;i<cr.length;i++)
+		if(parseInt(cr[i]) < parseInt(ls[i]))
+			return false;
+	return true;
+}
+function findNext(children, str)
+{
+	for(var child = 0;child < children.length;child++)
+	{
+		if(doCheck)
+		{
+			if(!check(children[child].widgetId,lastFound))
+				continue;
+			else
+				if(children[child].widgetId == lastFound)doCheck = false;
+		}
+		if(children[child].title.indexOf(str) != -1 && children[child].widgetId != lastFound && !doCheck)
+			return children[child].widgetId;
+		if(children[child].children){
+			var ret=findNext(children[child].children,str);
+			if(ret)
+				return ret;
+		}
+	}	
+	return ;
+}
+
+function select(node)
+{
+	var nodes = node.split(".");
+	var curr ="";
+	for(nod in nodes)
+	{
+		if(curr == "")curr=curr+nodes[nod];
+		else curr=curr+"."+nodes[nod];
+		if(dojo.widget.byId(curr).state != "LOADED" && dojo.widget.byId(curr).children.length != 0)
+			dojo.widget.byId(curr).setChildren(dojo.widget.byId(curr).children);
+		dojo.widget.byId('controller').expandToLevel(dojo.widget.byId(curr),1);			
+	}
+	dojo.widget.byId('selector').select(dojo.widget.byId(node));
+}
+
+
+function findInSelected(selectedNodes)
+{
+	var search = document.getElementById("searchText").value;
+	if(search == "")
+	{
+		alert('No Text to search');
+		return;
+	}
+	var v= findNext(selectedNodes,search);
+	if(v)
+	{
+		dojo.widget.byId('selector').deselectAll();
+		select(v);
+		document.getElementById("findNext").disabled=false;
+		lastFound =  v;
+		doCheck = true;
+	}
+	else{
+		alert('Nothing found');
+		lastFound =  '';
+		doCheck = false;
+	}
+}
+function textChange(){
+	document.getElementById("findNext").disabled=true;
+	lastFound = '';
+	doCheck = false;
+}
+
+var lastSearchOn = '';
+function search(){
+	document.body.style.cursor = "wait";
+	lastFound = '';
+	doCheck = false;
+	lastSearchOn = [];
+	var nodes;
+	if(document.getElementById("inSelected").checked){
+		nodes = dojo.widget.byId('selector').selectedNodes;
+		if(nodes == '')
+		{
+			alert('No Node selected to search');
+		}
+		else{
+			for(obj in nodes)
+				lastSearchOn.push(nodes[obj]);	
+			findInSelected(nodes);
+		}
+	}
+	else{ 
+		nodes = dojo.widget.byId('tree').children;
+		lastSearchOn = dojo.widget.byId('tree').children;
+		findInSelected(nodes);
+	}
+	document.body.style.cursor = '';
+}
+function searchContinue(){
+	document.body.style.cursor = "wait";
+	findInSelected(lastSearchOn);
+	document.body.style.cursor = '';
+}
+
+</script>
+
+	<% 
+		String consoleFrameworkContext = PortletManager.getConsoleFrameworkServletPath(request);
+	    String iconCSS = consoleFrameworkContext + "/../TreeDocIcon.css";
+	%>
+<TABLE cellpadding="1" cellspacing="1" border="1">
+<tr><td>
+<b>Search Text:</b> <input type="text" id="searchText" onChange="javascript:textChange()"/>
+<input type="button" value="Find" onClick="javascript:search()"/>
+<input type="button" id="findNext" value="Find Next" onClick="javascript:searchContinue()" disabled=true />
+Search only selected:<input type="checkbox" id="inSelected" onChange="javascript:textChange()"/>
+</td></tr>
+</table>
+<br/>
+
+<div dojoType="TreeBasicControllerV3" widgetId="controller"></div>	
+<div dojoType="TreeSelectorV3" widgetId="selector" eventNames="select:nodeSelected"></div>	
+<div dojoType="TreeEmphasizeOnSelect" selector="selector"></div>
+<div dojoType="TreeToggleOnSelect" selector="selector" controller="controller"></div>
+<div dojoType="TreeDocIconExtension"  widgetId="iconcontroller" templateCssPath="<%= iconCSS %>"></div>
+<div dojoType="TreeV3" listeners="controller;selector;iconcontroller" widgetId='tree' allowedMulti='false'></div>
+

Added: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jndiview/help.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jndiview/help.jsp?view=auto&rev=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jndiview/help.jsp (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jndiview/help.jsp Fri Jan 12 19:52:36 2007
@@ -0,0 +1,20 @@
+<%--
+   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.
+--%>
+
+<p><font face="Verdana" size="+1"><center><b>This is the help for the Geronimo Administration JNDI VIEW page.</b></center></font></p>
+
+<P>This view can be used to view JNDI context for various modules.</P>

Added: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jndiview/view.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jndiview/view.jsp?view=auto&rev=495833
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jndiview/view.jsp (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/jndiview/view.jsp Fri Jan 12 19:52:36 2007
@@ -0,0 +1,183 @@
+<%--
+   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.
+--%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ page import="org.apache.geronimo.console.util.PortletManager,
+                 javax.portlet.RenderRequest"%>
+<portlet:defineObjects/>
+
+<%
+	String childs = (String)renderRequest.getPortletSession().getAttribute("jndiTree");	
+	renderRequest.getPortletSession().removeAttribute("jndiTree");
+%>
+
+<script>
+	dojo.require("dojo.widget.*");
+	dojo.require("dojo.widget.TreeV3");
+	dojo.require("dojo.widget.TreeNodeV3");
+	dojo.require("dojo.widget.TreeBasicControllerV3");
+	dojo.require("dojo.widget.TreeSelectorV3");
+	dojo.require("dojo.widget.TreeEmphasizeOnSelect");
+	dojo.require("dojo.widget.TreeToggleOnSelect");
+	
+	dojo.hostenv.writeIncludes();
+
+    dojo.addOnLoad(function(){
+
+		var tree = dojo.widget.manager.getWidgetById('tree');
+
+		var treeNodes = <%= childs %>;		
+
+		tree.setChildren(treeNodes);
+
+	});
+
+
+
+var lastFound = '';
+var doCheck = false;;
+function check(curr,last)
+{
+	var cr=curr.split(".");
+	var ls=last.split(".");
+	for(var i =0;i<cr.length;i++)
+		if(parseInt(cr[i]) < parseInt(ls[i]))
+			return false;
+	return true;
+}
+function findNext(children, str)
+{
+	for(var child = 0;child < children.length;child++)
+	{
+		if(doCheck)
+		{
+			if(!check(children[child].widgetId,lastFound))
+				continue;
+			else
+				if(children[child].widgetId == lastFound)doCheck = false;
+		}
+		if(children[child].title.indexOf(str) != -1 && children[child].widgetId != lastFound && !doCheck)
+			return children[child].widgetId;
+		if(children[child].children){
+			var ret=findNext(children[child].children,str);
+			if(ret)
+				return ret;
+		}
+	}	
+	return ;
+}
+
+function select(node)
+{
+	var nodes = node.split(".");
+	var curr ="";
+	for(nod in nodes)
+	{
+		if(curr == "")curr=curr+nodes[nod];
+		else curr=curr+"."+nodes[nod];
+		if(dojo.widget.byId(curr).state != "LOADED" && dojo.widget.byId(curr).children.length != 0)
+			dojo.widget.byId(curr).setChildren(dojo.widget.byId(curr).children);
+		dojo.widget.byId('controller').expandToLevel(dojo.widget.byId(curr),1);
+	}
+	dojo.widget.byId('selector').select(dojo.widget.byId(node));
+}
+
+function findInSelected(selectedNodes)
+{
+	var search = document.getElementById("searchText").value;
+	if(search == "")
+	{
+		alert('No Text to search');
+		return;
+	}
+	var v= findNext(selectedNodes,search);
+	if(v)
+	{
+		dojo.widget.byId('selector').deselectAll();
+		select(v);
+		document.getElementById("findNext").disabled=false;
+		lastFound =  v;
+		doCheck = true;
+	}
+	else{
+		alert('Nothing found');
+		lastFound =  '';
+		doCheck = false;
+	}
+}
+function textChange(){
+	document.getElementById("findNext").disabled=true;
+	lastFound = '';
+	doCheck = false;
+}
+
+var lastSearchOn = '';
+function search(){
+	document.body.style.cursor = "wait";
+	lastFound = '';
+	doCheck = false;
+	lastSearchOn = [];
+	var nodes;
+	if(document.getElementById("inSelected").checked){
+		nodes = dojo.widget.byId('selector').selectedNodes;
+		if(nodes == '')
+		{
+			alert('No Node selected to search');
+		}
+		else{
+			for(obj in nodes)
+				lastSearchOn.push(nodes[obj]);	
+			findInSelected(nodes);
+		}
+	}
+	else{ 
+		nodes = dojo.widget.byId('tree').children;
+		lastSearchOn = dojo.widget.byId('tree').children;
+		findInSelected(nodes);
+	}
+	document.body.style.cursor = '';
+}
+function searchContinue(){
+	document.body.style.cursor = "wait";
+	findInSelected(lastSearchOn);
+	document.body.style.cursor = '';
+}
+
+</script>
+
+	<% 
+		String consoleFrameworkContext = PortletManager.getConsoleFrameworkServletPath(request);
+	    String iconCSS = consoleFrameworkContext + "/../TreeDocIcon.css";
+	%>
+<TABLE cellpadding="1" cellspacing="1" border="1">
+<tr><td>
+<b>Search Text:</b> <input type="text" id="searchText" onChange="javascript:textChange()"/>
+<input type="button" value="Find" onClick="javascript:search()"/>
+<input type="button" id="findNext" value="Find Next" onClick="javascript:searchContinue()" disabled=true />
+Search only selected:<input type="checkbox" id="inSelected" onChange="javascript:textChange()"/>
+</td></tr>
+</table>
+<br/>
+
+
+<div dojoType="TreeBasicControllerV3" widgetId="controller"></div>	
+<div dojoType="TreeSelectorV3" widgetId="selector"></div>	
+<div dojoType="TreeEmphasizeOnSelect" selector="selector"></div>
+<div dojoType="TreeToggleOnSelect" selector="selector" controller="controller"></div>
+<div dojoType="TreeDocIconExtension"  widgetId="iconcontroller" templateCssPath="<%= iconCSS %>"></div>
+<div dojoType="TreeV3" listeners="controller;selector;iconcontroller" widgetId='tree' allowedMulti='false'></div>
+



Mime
View raw message