geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r551601 - in /geronimo/server/trunk/applications/console/geronimo-console-standard/src/main: java/org/apache/geronimo/console/classloaderview/ClassLoaderViewPortlet.java webapp/WEB-INF/view/classloaderview/view.jsp
Date Thu, 28 Jun 2007 15:47:10 GMT
Author: pmcmahan
Date: Thu Jun 28 08:47:09 2007
New Revision: 551601

URL: http://svn.apache.org/viewvc?view=rev&rev=551601
Log:
GERONIMO-3262 fix Invert Tree button in admin console's classloader viewer.  Patch submitted
by Viet Nguyen.

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/webapp/WEB-INF/view/classloaderview/view.jsp

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=551601&r1=551600&r2=551601
==============================================================================
--- 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 Jun 28 08:47:09 2007
@@ -50,10 +50,19 @@
     private PortletRequestDispatcher maximizedView;
 
     private PortletRequestDispatcher helpView;
+    
+    private boolean inverse;
 
     public void processAction(ActionRequest actionRequest,
             ActionResponse actionResponse) throws PortletException, IOException {
+    	// set selectedNode
         actionRequest.getPortletSession().setAttribute("selectedNode", actionRequest.getParameter("snNode"));
+        // toggle between inverse and non-inverse each time the form is processed
+        inverse = actionRequest.getParameter("inverse").equalsIgnoreCase("true")? true :
false;
+        // toggle
+        inverse = (!inverse);
+        // store inverse variable for the jsp
+        actionRequest.getPortletSession().setAttribute("invert", inverse );
     }
 
     protected void doView(RenderRequest renderRequest,
@@ -62,6 +71,8 @@
             return;
         }
         renderRequest.getPortletSession().setAttribute("classloaderTree", this);
+        renderRequest.setAttribute("inverse", inverse);
+        renderRequest.getPortletSession().setAttribute("inverse", inverse);
 
         if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
             normalView.include(renderRequest, renderResponse);
@@ -83,7 +94,7 @@
                 MAXIMIZEDVIEW_JSP);
         helpView = portletConfig.getPortletContext().getRequestDispatcher(
                 HELPVIEW_JSP);
-
+        inverse = false;
     }
 
     public void destroy() {

Modified: 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=diff&rev=551601&r1=551600&r2=551601
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/view.jsp
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/classloaderview/view.jsp
Thu Jun 28 08:47:09 2007
@@ -21,17 +21,13 @@
 <portlet:defineObjects />
 
 <%
-    boolean inverse = false;
-    if(renderRequest.getPortletSession().getAttribute("inverse") != null){
-        inverse = ((Boolean)renderRequest.getPortletSession().getAttribute("inverse")).booleanValue();
       
-    }
-    renderRequest.getPortletSession().setAttribute("inverse",new Boolean(!inverse));
-    String selectedNode = (String)renderRequest.getPortletSession().getAttribute("selectedNode");
-    if(selectedNode != null){
-        renderRequest.getPortletSession().removeAttribute("selectedNode");
-    }
-
-
+	// retrieve and set attributes
+	boolean inverse = ((Boolean)renderRequest.getPortletSession().getAttribute("inverse")).booleanValue();
+	
+	String selectedNode = (String)renderRequest.getPortletSession().getAttribute("selectedNode");
+	if(selectedNode != null){
+	    renderRequest.getPortletSession().removeAttribute("selectedNode");
+	}
     ClassLoaderViewPortlet cp = (ClassLoaderViewPortlet) renderRequest.getPortletSession().getAttribute("classloaderTree");
     renderRequest.getPortletSession().removeAttribute("classloaderTree");
     String childs = cp.getJSONTrees(inverse);
@@ -79,8 +75,6 @@
     
         });
 
-
-
 var lastFound = '';
 var doCheck = false;
 
@@ -160,7 +154,7 @@
                 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);
-        }        
+        }
 }
 
 function select(node)
@@ -256,13 +250,14 @@
         findInSelected(lastSearchOn);
         document.body.style.cursor = '';
 }
-function getAction(){
+function getAction() {
     var nodes= dojo.widget.manager.getWidgetById('selector').selectedNodes[0];
-    if(nodes != undefined){
-        if(nodes.title == 'Classes' || nodes.title == 'Interfaces')
+    if(nodes != undefined) {
+        if(nodes.title == 'Classes' || nodes.title == 'Interfaces') {
             document.clform.snNode.value = nodes.parent.title;
-        else
+        } else {
             document.clform.snNode.value = nodes.title;
+        }
     }
     document.clform.action = '<portlet:actionURL><portlet:param name="action" value="invert"/></portlet:actionURL>'
     return true;
@@ -277,6 +272,7 @@
 %>
 <form name="clform" onSubmit="return getAction()">
 <input type="hidden" name="snNode" value=""/>
+<input type="hidden" name="inverse" value="${inverse}"/>
 <TABLE cellpadding="1" cellspacing="1" border="1">
  <tr>
   <td><b>Search Text:</b> <input type="text" name="searchText" id="searchText"



Mime
View raw message