modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/plugin/InstalledPluginComponent.java
| 3
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/plugin/InstalledPluginUIBean.java
| 142 ----------
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation.xml
| 11
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-edit.xhtml
| 24 -
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-view.xhtml
| 28 -
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details.xhtml
| 46 ---
modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list.xhtml
| 2
7 files changed, 12 insertions(+), 244 deletions(-)
New commits:
commit 4fc48faeb13369a38ac1b602237672bd60038865
Author: Justin Harris <jharris(a)redhat.com>
Date: Mon Nov 30 17:30:10 2009 -0500
Pulling out old admin navigation rules.
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation.xml
index 37b3bad..93932df 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation.xml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation.xml
@@ -28,17 +28,6 @@
</navigation-case>
</navigation-rule>
-
- <navigation-rule>
-
<from-view-id>/rhq/admin/plugin/plugin-details-edit.xhtml</from-view-id>
-
- <navigation-case>
- <from-outcome>successServerPlugin</from-outcome>
-
<to-view-id>/rhq/admin/plugin/plugin-details-view.xhtml?plugin=#{plugin.name}&deployment=#{plugin.deployment}&pluginType=#{serverPlugin.type}</to-view-id>
- <redirect/>
- </navigation-case>
-
- </navigation-rule>
<navigation-rule>
<navigation-case>
commit 591b1f7c41600eeed97f5e307fb426fc1904cc69
Author: Justin Harris <jharris(a)redhat.com>
Date: Mon Nov 30 16:22:06 2009 -0500
Cleaning out editing of server plugins on details page.
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/plugin/InstalledPluginComponent.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/plugin/InstalledPluginComponent.java
index a1400ac..43e9e41 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/plugin/InstalledPluginComponent.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/plugin/InstalledPluginComponent.java
@@ -18,7 +18,6 @@
*/
package org.rhq.enterprise.gui.admin.plugin;
-import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.web.RequestParameter;
@@ -71,7 +70,7 @@ public class InstalledPluginComponent {
this.pluginType = pluginType;
}
- @Factory(value = "plugin", autoCreate = true, scope = ScopeType.PAGE)
+ @Factory(value = "plugin", autoCreate = true)
public AbstractPlugin lookupPlugin() {
if (this.deployment == PluginDeploymentType.AGENT) {
return LookupUtil.getResourceMetadataManager().getPlugin(this.name);
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/plugin/InstalledPluginUIBean.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/plugin/InstalledPluginUIBean.java
deleted file mode 100644
index 9351385..0000000
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/plugin/InstalledPluginUIBean.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.gui.admin.plugin;
-
-import javax.faces.application.FacesMessage;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-
-import org.rhq.core.clientapi.agent.metadata.ConfigurationMetadataParser;
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.authz.Permission;
-import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
-import org.rhq.core.domain.plugin.AbstractPlugin;
-import org.rhq.core.domain.plugin.PluginDeploymentType;
-import org.rhq.core.domain.plugin.PluginKey;
-import org.rhq.core.domain.plugin.ServerPlugin;
-import org.rhq.core.gui.util.FacesContextUtility;
-import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility;
-import org.rhq.enterprise.server.authz.PermissionException;
-import org.rhq.enterprise.server.plugin.ServerPluginsLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
-import
org.rhq.enterprise.server.xmlschema.generated.serverplugin.ServerPluginDescriptorType;
-
-/**
- * @author Greg Hinkle
- * @author John Mazzitelli
- */
-(a)Scope(ScopeType.PAGE)
-@Name("InstalledPluginUIBean")
-public class InstalledPluginUIBean {
-
- private static final String OUTCOME_SUCCESS_SERVER_PLUGIN =
"successServerPlugin";
- public static final String MANAGED_BEAN_NAME =
InstalledPluginUIBean.class.getSimpleName();
- private final Log log = LogFactory.getLog(InstalledPluginUIBean.class);
- @In
- private AbstractPlugin plugin;
- private ConfigurationDefinition pluginConfigurationDefinition;
- private ConfigurationDefinition scheduledJobsDefinition;
-
- public AbstractPlugin getPlugin() {
- return plugin;
- }
-
- public void setPlugin(AbstractPlugin plugin) {
- this.plugin = plugin;
- }
-
- public ServerPlugin getServerPlugin() {
- return (ServerPlugin) this.plugin;
- }
-
- public void setServerPlugin(ServerPlugin plugin) {
- this.plugin = plugin;
- }
-
- public ConfigurationDefinition getPluginConfigurationDefinition() {
- return this.pluginConfigurationDefinition;
- }
-
- public ConfigurationDefinition getScheduledJobsDefinition() {
- return this.scheduledJobsDefinition;
- }
-
- public boolean isEditable() {
- return this.pluginConfigurationDefinition != null || this.scheduledJobsDefinition
!= null;
- }
-
- public String updatePlugin() {
- // note we assume we are editing a server plugin - we don't support editing
agent plugins yet
- try {
- ServerPluginsLocal serverPlugins = LookupUtil.getServerPlugins();
- Subject subject = EnterpriseFacesContextUtility.getSubject();
- serverPlugins.updateServerPluginExceptContent(subject, getServerPlugin());
- FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO,
"Configuration settings saved.");
-
- return OUTCOME_SUCCESS_SERVER_PLUGIN;
- } catch (Exception e) {
- log.error("Error updating the plugin configurations.", e);
- FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR,
- "There was an error changing the configuration settings.", e);
-
- return null;
- }
- }
-
- @Create
- public void lookupConfigDefinitions() {
- hasPermission();
- String pluginName = this.plugin.getName();
-
- if (this.plugin.getDeployment() == PluginDeploymentType.SERVER) {
- try {
- ServerPluginsLocal serverPluginsBean = LookupUtil.getServerPlugins();
- PluginKey pluginKey = new PluginKey((ServerPlugin) plugin);
- ServerPluginDescriptorType descriptor =
serverPluginsBean.getServerPluginDescriptor(pluginKey);
- this.pluginConfigurationDefinition =
ConfigurationMetadataParser.parse("pc:" + pluginName, descriptor
- .getPluginConfiguration());
- this.scheduledJobsDefinition =
ConfigurationMetadataParser.parse("jobs:" + pluginName, descriptor
- .getScheduledJobs());
- } catch (Exception e) {
- String err = "Cannot determine what the plugin configuration or
scheduled jobs configuration looks like";
- log.error(err + " - Cause: " + e);
- FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, err, e);
- return;
- }
- }
- }
-
- /**
- * Throws a permission exception if the user is not allowed to access this
functionality.
- */
- private void hasPermission() {
- Subject subject = EnterpriseFacesContextUtility.getSubject();
- if (!LookupUtil.getAuthorizationManager().hasGlobalPermission(subject,
Permission.MANAGE_SETTINGS)) {
- throw new PermissionException("User [" + subject.getName()
- + "] does not have the proper permissions to view or manage
plugins");
- }
- }
-}
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-edit.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-edit.xhtml
deleted file mode 100644
index d88afe7..0000000
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-edit.xhtml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:c="http://java.sun.com/jstl/core"
-
xmlns:onc="http://jboss.org/on/component"
-
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-
-<ui:composition template="/rhq/admin/plugin/plugin-details.xhtml">
- <ui:param name="editMode" value="true"/>
-
- <ui:define name="post-config">
- <rich:panel rendered="#{InstalledPluginUIBean.editable}">
- <h:commandButton value="SAVE" type="submit"
action="#{InstalledPluginUIBean.updatePlugin}"
- alt="Click to Save Changes"
styleClass="buttonmed" />
- <h:commandButton value="RESET" type="reset"
immediate="true"
- title="Click to Reset Fields"
styleClass="buttonmed"/>
- </rich:panel>
- </ui:define>
-</ui:composition>
-
-</html>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-view.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-view.xhtml
deleted file mode 100644
index 92d36f3..0000000
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-view.xhtml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:c="http://java.sun.com/jstl/core"
-
xmlns:onc="http://jboss.org/on/component"
-
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-
-<ui:composition template="/rhq/admin/plugin/plugin-details.xhtml">
- <ui:param name="editMode" value="false"/>
-
- <ui:define name="pre-config">
- <h:panelGrid columns="1" styleClass="buttons-table"
columnClasses="button-cell"
- rendered="#{InstalledPluginUIBean.editable}">
- <h:outputLink value="/rhq/admin/plugin/plugin-details-edit.xhtml"
- styleClass="buttonmed">
- <f:param name="plugin"
value="#{installedPlugin.name}"/>
- <f:param name="deployment"
value="#{installedPlugin.deployment}"/>
- <f:param name="pluginType"
value="#{installedPlugin.pluginType}"/>
- <h:outputText value="EDIT"/>
- </h:outputLink>
- </h:panelGrid>
- </ui:define>
- </ui:composition>
-
-</html>
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details.xhtml
index 5e32efa..aba7769 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details.xhtml
@@ -9,7 +9,7 @@
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
<ui:composition template="/rhq/layout/main.xhtml">
- <ui:param name="pageTitle"
value="#{InstalledPluginUIBean.plugin.name}"/>
+ <ui:param name="pageTitle" value="#{plugin.name}"/>
<ui:define name="breadcrumbs">
<h:outputLink value="plugin-list.xhtml" >
@@ -17,7 +17,7 @@
</h:outputLink>
>
<h:outputLink value="#" >
- <h:outputText
value="#{InstalledPluginUIBean.plugin.displayName}"/>
+ <h:outputText value="#{plugin.displayName}"/>
</h:outputLink>
</ui:define>
@@ -39,28 +39,28 @@
<rich:panel>
<f:facet name="header">
- <h:outputText value="Plugin:
#{InstalledPluginUIBean.plugin.displayName}
(#{InstalledPluginUIBean.plugin.name})"/>
+ <h:outputText value="Plugin: #{plugin.displayName}
(#{plugin.name})"/>
</f:facet>
<h:panelGrid styleClass="BlockContent" columns="4"
width="100%">
<h:outputLabel styleClass="BlockLabel"
value="Version:"/>
- <h:outputText styleClass="BlockContent"
value="#{InstalledPluginUIBean.plugin.version}"/>
+ <h:outputText styleClass="BlockContent"
value="#{plugin.version}"/>
<h:outputLabel styleClass="BlockLabel"
value="Enabled:"/>
- <h:outputText
value="#{InstalledPluginUIBean.plugin.enabled}"/>
+ <h:outputText value="#{plugin.enabled}"/>
<h:outputLabel styleClass="BlockLabel"
value="Type:"/>
- <h:outputText
value="#{InstalledPluginUIBean.plugin.deployment}"/>
+ <h:outputText value="#{plugin.deployment}"/>
<h:outputLabel styleClass="BlockLabel"
value="MD5:"/>
- <h:outputText
value="#{InstalledPluginUIBean.plugin.md5}"/>
+ <h:outputText value="#{plugin.md5}"/>
<h:outputLabel styleClass="BlockLabel"
value="Description:"/>
- <h:outputText
value="#{InstalledPluginUIBean.plugin.description}"/>
+ <h:outputText value="#{plugin.description}"/>
<h:outputLabel styleClass="BlockLabel"
value="Path:"/>
- <h:outputText
value="#{InstalledPluginUIBean.plugin.path}"/>
+ <h:outputText value="#{plugin.path}"/>
</h:panelGrid>
@@ -69,38 +69,12 @@
<h:outputText value="Plugin Help"/>
</f:facet>
- <h:outputText escape="false"
value="<pre> #{InstalledPluginUIBean.plugin.help}
</pre>"/>
+ <h:outputText escape="false"
value="<pre> #{plugin.help} </pre>"/>
</rich:panel>
-
- <ui:insert name="pre-config" />
-
- <rich:panel
rendered="#{InstalledPluginUIBean.pluginConfigurationDefinition != null}">
- <f:facet name="header">
- <h:outputText value="Plugin Configuration"/>
- </f:facet>
- <onc:config
-
configurationDefinition="#{InstalledPluginUIBean.pluginConfigurationDefinition}"
-
configuration="#{InstalledPluginUIBean.plugin.pluginConfiguration}"
- readOnly="#{not editMode}" />
- </rich:panel>
-
- <rich:panel
rendered="#{InstalledPluginUIBean.scheduledJobsDefinition != null}">
- <f:facet name="header">
- <h:outputText value="Scheduled Jobs"/>
- </f:facet>
- <onc:config
-
configurationDefinition="#{InstalledPluginUIBean.scheduledJobsDefinition}"
-
configuration="#{InstalledPluginUIBean.plugin.scheduledJobsConfiguration}"
- readOnly="#{not editMode}" />
- </rich:panel>
-
- <ui:insert name="post-config" />
</rich:panel>
-
</h:form>
-
</ui:define>
</ui:composition>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list.xhtml
index ba128c1..0b020b3 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list.xhtml
@@ -160,7 +160,7 @@
<h:outputText styleClass="headerText"
value="Name"/>
</f:facet>
- <h:outputLink
value="/rhq/admin/plugin/plugin-details-view.xhtml">
+ <h:outputLink
value="/rhq/admin/plugin/plugin-details.xhtml">
<f:param name="plugin"
value="#{serverPlugin.name}"/>
<f:param name="deployment" value="SERVER"/>
<f:param name="pluginType"
value="#{serverPlugin.type}"/>