geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r671577 - in /geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main: java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java webapp/WEB-INF/view/configmanager/normal.jsp
Date Wed, 25 Jun 2008 15:12:00 GMT
Author: gawor
Date: Wed Jun 25 08:12:00 2008
New Revision: 671577

URL: http://svn.apache.org/viewvc?rev=671577&view=rev
Log:
added a checkbox to show/hide parent and child components of modules in the console (GERONIMO-4152)

Modified:
    geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
    geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/configmanager/normal.jsp

Modified: geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java?rev=671577&r1=671576&r2=671577&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
(original)
+++ geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
Wed Jun 25 08:12:00 2008
@@ -69,6 +69,8 @@
 
     private static final String CONFIG_INIT_PARAM = "config-type";
 
+    private static final String SHOW_DEPENDENCIES_COOKIE = "org.apache.geronimo.configmanager.showDependencies";
+    
     private Kernel kernel;
 
     private PortletRequestDispatcher normalView;
@@ -201,7 +203,10 @@
         if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
             return;
         }
-
+              
+        String cookies = renderRequest.getProperty("cookie");
+        boolean showDependencies = (cookies != null && cookies.indexOf(SHOW_DEPENDENCIES_COOKIE
+ "=true") > 0);
+        
         List<ModuleDetails> moduleDetails = new ArrayList<ModuleDetails>();
         ConfigurationManager configManager = ConfigurationUtil.getConfigurationManager(kernel);
         List<ConfigurationInfo> infos = configManager.listConfigurations();
@@ -221,7 +226,9 @@
                             details.getContextPaths().add(webModule.getContextPath());
                         }
 
-                        addDependencies(details, configObjName);
+                        if (showDependencies) {
+                            addDependencies(details, configObjName);
+                        }
                         if (loaded) {
                             unloadModule(configManager, configObjName);
                         }
@@ -244,7 +251,9 @@
                                 if (webModule != null) {
                                     childDetails.getContextPaths().add(webModule.getContextPath());
                                 }
-                                addDependencies(childDetails, configObjName);
+                                if (showDependencies) {
+                                    addDependencies(childDetails, configObjName);
+                                }
                                 moduleDetails.add(childDetails);
                             }
                         }
@@ -278,7 +287,9 @@
                         }
                     }
 
-                    addDependencies(details, configObjName);
+                    if (showDependencies) {
+                        addDependencies(details, configObjName);
+                    }
                     if (loaded) {
                         unloadModule(configManager, configObjName);
                     }
@@ -292,6 +303,7 @@
         Collections.sort(moduleDetails);
         renderRequest.setAttribute("configurations", moduleDetails);
         renderRequest.setAttribute("showWebInfo", Boolean.valueOf(showWebInfo()));
+        renderRequest.setAttribute("showDependencies", Boolean.valueOf(showDependencies));
         if (moduleDetails.size() == 0) {
             renderRequest.setAttribute("messageInstalled", "No modules found of this type<br
/><br />");
         } else {

Modified: geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/configmanager/normal.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/configmanager/normal.jsp?rev=671577&r1=671576&r2=671577&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/configmanager/normal.jsp
(original)
+++ geronimo/server/branches/2.1/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/configmanager/normal.jsp
Wed Jun 25 08:12:00 2008
@@ -22,6 +22,7 @@
 
 <script>
 var EXPERT_COOKIE = "org.apache.geronimo.configmanager.expertmode";
+var SHOW_DEPENDENCIES_COOKIE = "org.apache.geronimo.configmanager.showDependencies";
 
 // Check to see if a component is "safe" to stop within a running server.
 // Service components with names that begin with "org.apache.geronimo.configs/", for example,
@@ -190,28 +191,48 @@
 function init() {
     if (getCookie(EXPERT_COOKIE) == 'true') {
         document.checkExpert.expertMode.checked = true;
-    }
-    else {
+    } else {
         document.checkExpert.expertMode.checked = false;
     }
     toggleExpertMode();
+    
+    if (getCookie(SHOW_DEPENDENCIES_COOKIE) == 'true') {
+        document.showDependenciesForm.showDependenciesMode.checked = true;
+    } else {
+        document.showDependenciesForm.showDependenciesMode.checked = false;
+    }
 }
+
+function toggleShowDependenciesMode() {
+    if (document.showDependenciesForm.showDependenciesMode.checked) {
+        document.cookie=SHOW_DEPENDENCIES_COOKIE+"=true";
+    } else {
+        document.cookie=SHOW_DEPENDENCIES_COOKIE+"=false";
+    }
+    window.location.reload();
+}
+
 </script>
 
 
-<br />
 <form name="checkExpert">
-<input type="checkbox" name="expertMode" onClick="toggleExpertMode();" />&nbsp;Expert
User (enable all actions on Geronimo Provided Components)   
+<input type="checkbox" name="expertMode" onClick="toggleExpertMode();" />&nbsp;Expert
User (enable all actions on Geronimo Provided Components)  
 </form>
-<br />
+
+<form name="showDependenciesForm">
+<input type="checkbox" name="showDependenciesMode" onClick="toggleShowDependenciesMode();"
/>&nbsp;Show parent and child components
+</form>
+
 <table width="100%">
     <tr class="DarkBackground">
         <th align="left">&nbsp;<fmt:message key="configmanager.normal.componentName"
/></th>
         <c:if test="${showWebInfo}"><th>URL</th></c:if>
         <th>&nbsp;<fmt:message key="consolebase.common.state"/></th>
         <th align="center" colspan="3"> <fmt:message key="consolebase.common.commands"/></th>
-        <th align="left"><fmt:message key="configmanager.normal.parentComponents"
/></th>
-        <th align="left"><fmt:message key="configmanager.normal.childComponents"
/></th>
+        <c:if test="${showDependencies}">
+           <th align="left"><fmt:message key="configmanager.normal.parentComponents"
/></th>
+           <th align="left"><fmt:message key="configmanager.normal.childComponents"
/></th>
+        </c:if>
     </tr>
   <c:set var="backgroundClass" value='MediumBackground'/>
   <c:forEach var="moduleDetails" items="${configurations}">
@@ -291,19 +312,21 @@
             </c:if>
         </td>
 
-        <!-- Parents -->
-        <td class="${backgroundClass}">
-            <c:forEach var="parent" items="${moduleDetails.parents}">
-                ${parent} <br>
-            </c:forEach>
-        </td>
-
-        <!-- Children -->
-        <td class="${backgroundClass}">
-        <c:forEach var="child" items="${moduleDetails.children}">
-            ${child} <br>
-        </c:forEach>
-        </td>
+        <c:if test="${showDependencies}">
+           <!-- Parents -->
+           <td class="${backgroundClass}">
+               <c:forEach var="parent" items="${moduleDetails.parents}">
+                  ${parent} <br>
+               </c:forEach>
+           </td>
+
+           <!-- Children -->
+           <td class="${backgroundClass}">
+               <c:forEach var="child" items="${moduleDetails.children}">
+                  ${child} <br>
+               </c:forEach>
+           </td>
+        </c:if>
     </tr>
   </c:forEach>
 </table>



Mime
View raw message