You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2008/06/23 20:05:50 UTC
svn commit: r670694 - in
/geronimo/server/trunk/plugins/console/console-base-portlets/src/main:
java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
webapp/WEB-INF/view/configmanager/normal.jsp
Author: gawor
Date: Mon Jun 23 11:05:49 2008
New Revision: 670694
URL: http://svn.apache.org/viewvc?rev=670694&view=rev
Log:
added a checkbox to show/hide parent and child components of modules in the console (GERONIMO-4152)
Modified:
geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/configmanager/normal.jsp
Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java?rev=670694&r1=670693&r2=670694&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java Mon Jun 23 11:05:49 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/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/configmanager/normal.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/configmanager/normal.jsp?rev=670694&r1=670693&r2=670694&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/configmanager/normal.jsp (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/webapp/WEB-INF/view/configmanager/normal.jsp Mon Jun 23 11:05:49 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();" /> Expert User (enable all actions on Geronimo Provided Components)
+<input type="checkbox" name="expertMode" onClick="toggleExpertMode();" /> Expert User (enable all actions on Geronimo Provided Components)
</form>
-<br />
+
+<form name="showDependenciesForm">
+<input type="checkbox" name="showDependenciesMode" onClick="toggleShowDependenciesMode();" /> Show parent and child components
+</form>
+
<table width="100%">
<tr class="DarkBackground">
<th align="left"> <fmt:message key="configmanager.normal.componentName" /></th>
<c:if test="${showWebInfo}"><th>URL</th></c:if>
<th> <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>