[rhq] Branch 'release-3.0.0' - modules/plugins
by fdrabek
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java | 85 ++++------
1 file changed, 41 insertions(+), 44 deletions(-)
New commits:
commit 6e6182e76428025d6232d4a46ae917dd89b24aec
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Sat Aug 7 00:12:21 2010 -0400
[BZ-610859] Fix issue in AS5 plugin discovery component that initializes
the log event source with the wrong name. When adding a second log
event source it introduces the name mismatch.
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Committer: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
index bfd1174..2a403fa 100644
--- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
+++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java
@@ -32,18 +32,20 @@ import java.net.URL;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import java.util.Set;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.maven.artifact.versioning.ComparableVersion;
-import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import org.jboss.on.common.jbossas.JBossASDiscoveryUtils;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertyList;
@@ -53,20 +55,18 @@ import org.rhq.core.pluginapi.event.log.LogFileEventResourceComponentHelper;
import org.rhq.core.pluginapi.inventory.ClassLoaderFacet;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ManualAddFacet;
import org.rhq.core.pluginapi.inventory.ProcessScanResult;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-import org.rhq.core.pluginapi.inventory.ManualAddFacet;
import org.rhq.core.pluginapi.util.FileUtils;
import org.rhq.core.system.ProcessInfo;
import org.rhq.plugins.jbossas5.helper.JBossInstallationInfo;
import org.rhq.plugins.jbossas5.helper.JBossInstanceInfo;
-import org.rhq.plugins.jbossas5.helper.JBossProperties;
import org.rhq.plugins.jbossas5.helper.JBossProductType;
+import org.rhq.plugins.jbossas5.helper.JBossProperties;
import org.rhq.plugins.jbossas5.util.JnpConfig;
-import org.jboss.on.common.jbossas.JBossASDiscoveryUtils;
-
/**
* A Resource discovery component for JBoss AS Server Resources, which include the following:
*
@@ -79,7 +79,7 @@ import org.jboss.on.common.jbossas.JBossASDiscoveryUtils;
* @author Mark Spritzler
*/
public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryComponent, ClassLoaderFacet,
- ManualAddFacet {
+ ManualAddFacet {
private static final String CHANGE_ME = "***CHANGE_ME***";
private static final String JBOSS_SERVICE_XML = "conf" + File.separator + "jboss-service.xml";
private static final String JBOSS_NAMING_SERVICE_XML = "deploy" + File.separator + "naming-service.xml";
@@ -98,15 +98,9 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
private static final List<String> CLIENT_JARS = Arrays.asList(
// NOTE: The jbossall-client.jar aggregates a whole bunch of other jars from the client dir via its
// MANIFEST.MF Class-Path.
- "client/jbossall-client.jar",
- "client/trove.jar",
- "client/javassist.jar",
- "common/lib/jboss-security-aspects.jar",
- "lib/jboss-managed.jar",
- "lib/jboss-metatype.jar",
- "lib/jboss-dependency.jar",
- "lib/jboss-reflect.jar"
- );
+ "client/jbossall-client.jar", "client/trove.jar", "client/javassist.jar",
+ "common/lib/jboss-security-aspects.jar", "lib/jboss-managed.jar", "lib/jboss-metatype.jar",
+ "lib/jboss-dependency.jar");
private static final List<String> AS6_CLIENT_JARS = new ArrayList<String>(CLIENT_JARS);
static {
@@ -133,8 +127,7 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
}
public DiscoveredResourceDetails discoverResource(Configuration pluginConfig,
- ResourceDiscoveryContext discoveryContext)
- throws InvalidPluginConfigurationException {
+ ResourceDiscoveryContext discoveryContext) throws InvalidPluginConfigurationException {
// Set default values on any props that are not set.
//setPluginConfigurationDefaults(pluginConfiguration);
@@ -153,10 +146,11 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
}
@SuppressWarnings("unchecked")
- public List<URL> getAdditionalClasspathUrls(ResourceDiscoveryContext context, DiscoveredResourceDetails details)
- throws Exception {
+ public List<URL> getAdditionalClasspathUrls(ResourceDiscoveryContext context, DiscoveredResourceDetails details)
+ throws Exception {
Configuration pluginConfig = details.getPluginConfiguration();
- String homeDir = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR).getStringValue();
+ String homeDir = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR)
+ .getStringValue();
List<URL> clientJars = new ArrayList<URL>();
@@ -237,8 +231,8 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
jnpURL));
pluginConfiguration.put(new PropertySimple(ApplicationServerPluginConfigurationProperties.HOME_DIR,
installHome.getAbsolutePath()));
- pluginConfiguration.put(new PropertySimple(
- ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR, configDir));
+ pluginConfiguration.put(new PropertySimple(ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR,
+ configDir));
// Set the optional props...
pluginConfiguration.put(new PropertySimple(ApplicationServerPluginConfigurationProperties.SERVER_NAME,
@@ -248,19 +242,17 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
JBossASDiscoveryUtils.UserInfo userInfo = JBossASDiscoveryUtils.getJmxInvokerUserInfo(configDir);
if (userInfo != null) {
- pluginConfiguration.put(
- new PropertySimple(ApplicationServerPluginConfigurationProperties.PRINCIPAL,
- userInfo.getUsername()));
- pluginConfiguration.put(
- new PropertySimple(ApplicationServerPluginConfigurationProperties.CREDENTIALS,
- userInfo.getPassword()));
+ pluginConfiguration.put(new PropertySimple(ApplicationServerPluginConfigurationProperties.PRINCIPAL,
+ userInfo.getUsername()));
+ pluginConfiguration.put(new PropertySimple(ApplicationServerPluginConfigurationProperties.CREDENTIALS,
+ userInfo.getPassword()));
}
String javaHome = processInfo.getEnvironmentVariable(JAVA_HOME_ENV_VAR);
if (javaHome == null && log.isDebugEnabled()) {
log.warn("Unable to determine the JAVA_HOME environment variable for the JBoss AS process - "
+ " the Agent is probably running as a user that does not have access to the AS process's "
- + " environment.");
+ + " environment.");
}
pluginConfiguration.put(new PropertySimple(ApplicationServerPluginConfigurationProperties.JAVA_HOME,
javaHome));
@@ -282,15 +274,17 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
try {
return new InProcessJBossASDiscovery().discoverInProcessJBossAS(discoveryContext);
} catch (Throwable t) {
- log.debug("In-process JBoss AS discovery failed - we are probably not running embedded within JBoss AS.", t);
+ log
+ .debug("In-process JBoss AS discovery failed - we are probably not running embedded within JBoss AS.",
+ t);
return null;
}
}
private DiscoveredResourceDetails createResourceDetails(ResourceDiscoveryContext discoveryContext,
Configuration pluginConfig, @Nullable ProcessInfo processInfo, JBossInstallationInfo installInfo) {
- String serverHomeDir = pluginConfig.getSimple(
- ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR).getStringValue();
+ String serverHomeDir = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR)
+ .getStringValue();
File absoluteConfigPath = resolvePathRelativeToHomeDir(pluginConfig, serverHomeDir);
// Canonicalize the config path, so it's consistent no matter how it's entered.
@@ -299,8 +293,8 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
// JON: fix for JBNADM-2634 - do not resolve symlinks (ips, 12/18/07)
String key = FileUtils.getCanonicalPath(absoluteConfigPath.getPath());
- String bindAddress = pluginConfig.getSimple(
- ApplicationServerPluginConfigurationProperties.BIND_ADDRESS).getStringValue();
+ String bindAddress = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.BIND_ADDRESS)
+ .getStringValue();
String namingUrl = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.NAMING_URL)
.getStringValue();
@@ -317,7 +311,7 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
String description = installInfo.getProductType().DESCRIPTION;
File deployDir = new File(absoluteConfigPath, "deploy");
-
+
File rhqInstallerWar = new File(deployDir, "rhq-installer.war");
File rhqInstallerWarUndeployed = new File(deployDir, "rhq-installer.war.rej");
boolean isRhqServer = rhqInstallerWar.exists() || rhqInstallerWarUndeployed.exists();
@@ -326,13 +320,15 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
// We know this is an RHQ Server. Let's add an event source for its server log file, but disable it by default.
configureEventSourceForServerLogFile(pluginConfig);
}
- String name = formatServerName(bindAddress, namingPort, discoveryContext.getSystemInformation().getHostname(), absoluteConfigPath.getName(), isRhqServer);
+ String name = formatServerName(bindAddress, namingPort, discoveryContext.getSystemInformation().getHostname(),
+ absoluteConfigPath.getName(), isRhqServer);
return new DiscoveredResourceDetails(discoveryContext.getResourceType(), key, name, installInfo.getVersion(),
description, pluginConfig, processInfo);
}
- public String formatServerName(String bindingAddress, String jnpPort, String hostname, String configurationName, boolean isRhq) {
+ public String formatServerName(String bindingAddress, String jnpPort, String hostname, String configurationName,
+ boolean isRhq) {
if (isRhq) {
return hostname + " RHQ Server";
@@ -360,12 +356,12 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
return hostnameToUse + " " + configurationName;
}
}
-
+
private void configureEventSourceForServerLogFile(Configuration pluginConfig) {
File rhqLogFile = resolvePathRelativeToHomeDir(pluginConfig, "../logs/rhq-server-log4j.log");
if (rhqLogFile.exists() && !rhqLogFile.isDirectory()) {
try {
- PropertyMap serverLogEventSource = new PropertyMap("serverLog");
+ PropertyMap serverLogEventSource = new PropertyMap("logEventSource");
serverLogEventSource.put(new PropertySimple(
LogFileEventResourceComponentHelper.LogEventSourcePropertyNames.LOG_FILE_PATH, rhqLogFile
.getCanonicalPath()));
@@ -427,7 +423,7 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
File logDir = new File(configDir, "log");
File serverLogFile = new File(logDir, "server.log");
if (serverLogFile.exists() && !serverLogFile.isDirectory()) {
- PropertyMap serverLogEventSource = new PropertyMap("serverLog");
+ PropertyMap serverLogEventSource = new PropertyMap("logEventSource");
serverLogEventSource.put(new PropertySimple(
LogFileEventResourceComponentHelper.LogEventSourcePropertyNames.LOG_FILE_PATH, serverLogFile));
serverLogEventSource.put(new PropertySimple(
@@ -446,7 +442,7 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
boolean supported = (version.compareTo(minimumVersion) >= 0);
if (!supported) {
log.debug(productType + " version " + version + " is not supported by this plugin (minimum " + productType
- + " version is " + minimumVersion + ") - skipping...");
+ + " version is " + minimumVersion + ") - skipping...");
}
return supported;
}
@@ -455,7 +451,8 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
private static File resolvePathRelativeToHomeDir(Configuration pluginConfig, @NotNull String path) {
File configDir = new File(path);
if (!configDir.isAbsolute()) {
- String homeDir = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR).getStringValue();
+ String homeDir = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR)
+ .getStringValue();
configDir = new File(homeDir, path);
}
return configDir;
13 years, 5 months
[rhq] Branch 'release-3.0.0' - 2 commits - modules/enterprise
by fdrabek
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit d9cc78cea27e410c1dce4a8e9d023da4ac528246
Merge: 76f3d0d... ae99b5b...
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Wed Nov 24 23:50:23 2010 +0100
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 76f3d0dcaa6cad7c2491b86f2fd537a98ba56eaf
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Wed Nov 24 23:49:43 2010 +0100
BZ-642641 fix issue in collecting metrics after metric template update.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
index bebf8a4..5c83563 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
@@ -303,13 +303,13 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage
return;
}
- @RequiredPermissions( { @RequiredPermission(Permission.MANAGE_INVENTORY),
+ @RequiredPermissions({ @RequiredPermission(Permission.MANAGE_INVENTORY),
@RequiredPermission(Permission.MANAGE_SETTINGS) })
public void disableAllDefaultCollections(Subject subject) {
entityManager.createNamedQuery(MeasurementDefinition.DISABLE_ALL).executeUpdate();
}
- @RequiredPermissions( { @RequiredPermission(Permission.MANAGE_INVENTORY),
+ @RequiredPermissions({ @RequiredPermission(Permission.MANAGE_INVENTORY),
@RequiredPermission(Permission.MANAGE_SETTINGS) })
public void disableAllSchedules(Subject subject) {
entityManager.createNamedQuery(MeasurementSchedule.DISABLE_ALL).executeUpdate();
@@ -430,7 +430,7 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage
// Return only the data necessary to construct minimal objects ourselves. Using JPQL
// is ok, it just lets Hibernate do the heavy lifting for query generation.
queryString = "" //
- + "SELECT ms.id, ms.resource.id, ms.definition.name, ms.definition.dataType, ms.definition.numericType" //
+ + "SELECT ms.id, ms.resource.id, ms.definition.name, ms.definition.dataType, ms.definition.rawNumericType" //
+ " FROM MeasurementSchedule ms" //
+ " WHERE ms.definition.id IN ( :definitionIds )";
Query query = entityManager.createQuery(queryString);
13 years, 5 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java | 11 +++++-----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java | 9 ++++++--
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 3 ++
3 files changed, 16 insertions(+), 7 deletions(-)
New commits:
commit 9bde193a96ba2ee92f23f25970a05baf12dd64ff
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Nov 24 17:25:31 2010 -0500
Fixed issue with the Inventory->Membership subtab for AutoGroups.
Basically, that subtab (and future button) should not be visible for
AutoGroups. A user should not be able to alter AG membership.
Also added some missing I18N props for messages sent to the ErrorHandler.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
index 8fa66f3..9fdd4cc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
@@ -279,10 +279,11 @@ public class ResourceGroupDetailView extends AbstractTwoLevelTabSetView<Resource
updateSubTab(this.inventoryTab, this.inventoryConnHistory, new HistoryGroupPluginConfigurationView(
this.inventoryConnHistory.extendLocatorId("View"), this.groupComposite), facets
.contains(ResourceTypeFacet.PLUGIN_CONFIGURATION), true);
- enabled = globalPermissions.contains(Permission.MANAGE_INVENTORY);
+ visible = !isAutoGroup();
+ enabled = visible && globalPermissions.contains(Permission.MANAGE_INVENTORY);
canvas = (enabled) ? new ResourceGroupMembershipView(this.inventoryMembership.extendLocatorId("View"), groupId)
: null;
- updateSubTab(this.inventoryTab, this.inventoryMembership, canvas, true, enabled);
+ updateSubTab(this.inventoryTab, this.inventoryMembership, canvas, visible, enabled);
if (updateTab(this.operationsTab, groupCategory == GroupCategory.COMPATIBLE
&& facets.contains(ResourceTypeFacet.OPERATION), true)) {
@@ -347,14 +348,14 @@ public class ResourceGroupDetailView extends AbstractTwoLevelTabSetView<Resource
GWTServiceLookup.getResourceGroupService().findResourceGroupCompositesByCriteria(criteria,
new AsyncCallback<PageList<ResourceGroupComposite>>() {
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(
- "Failed to load group composite for group with id " + groupId, caught);
+ CoreGUI.getErrorHandler().handleError(MSG.view_group_detail_failLoadComp(String.valueOf(groupId)),
+ caught);
}
public void onSuccess(PageList<ResourceGroupComposite> result) {
if (result.isEmpty()) {
CoreGUI.getErrorHandler().handleError(
- "Failed to load group composite for group with id " + groupId);
+ MSG.view_group_detail_failLoadComp(String.valueOf(groupId)));
} else {
groupComposite = result.get(0);
loadResourceType(groupComposite, viewPath);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java
index 333fce6..a623c4b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java
@@ -69,7 +69,9 @@ public class ResourceGroupTitleBar extends LocatableVLayout {
public ResourceGroupTitleBar(String locatorId, boolean isAutoGroup) {
super(locatorId);
+
this.isAutoGroup = isAutoGroup;
+
setWidth100();
setHeight(30);
setPadding(5);
@@ -113,7 +115,8 @@ public class ResourceGroupTitleBar extends LocatableVLayout {
public void onSuccess(PageList<ResourceGroupComposite> result) {
if (result == null || result.size() != 1) {
CoreGUI.getErrorHandler().handleError(
- "Failed to get general info on group [" + group.getName() + "]");
+ MSG.view_titleBar_group_failInfo(group.getName(), String
+ .valueOf(ResourceGroupTitleBar.this.group.getId())));
return;
}
generalProperties = new GeneralProperties(extendLocatorId("genProps"), result.get(0));
@@ -139,7 +142,9 @@ public class ResourceGroupTitleBar extends LocatableVLayout {
@Override
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError("Cannot load group properties info", caught);
+ CoreGUI.getErrorHandler().handleError(
+ MSG.view_titleBar_group_failInfo(group.getName(), String
+ .valueOf(ResourceGroupTitleBar.this.group.getId())), caught);
}
});
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index 4a18c52..65a5886 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -1226,6 +1226,7 @@ view_titleBar_common_removedFav=You have removed [{0}] as one of your favorites~
view_titleBar_common_addedFav=You have added [{0}] as a favorite~
view_titleBar_common_removedFavFailure=Failed to remove [{0}] as one of your favorites~
view_titleBar_common_addedFavFailure=Failed to add [{0}] as a favorite~
+view_titleBar_group_failInfo = Failed to get general info on group [{0}] with ID [{1}]~
view_dynagroup_expressionSet=Expression Set~
view_dynagroup_recalculationInterval=Recalculation Interval~
view_dynagroup_lastCalculationTime=Last Calculation Time~
@@ -1254,6 +1255,8 @@ view_dynagroup_loadDefinitionMissing=There is no group definition with the ID of
view_dynagroup_permUnknown=Could not determine if you have the proper permissions - access is denied~
view_dynagroup_permDenied=You do not have permission to view group definitions~
view_dynagroup_definitions=DynaGroup Definitions~
+view_group_detail_failLoad = Failed to load group for group with ID [{0}]~
+view_group_detail_failLoadComp = Failed to load group composite for group with ID [{0}]~
view_group_membership_saveFailure=Failed to update membership of group [{0}]~
view_group_membership_saveSuccessful=You have updated the membership of group [{0}]~
view_group_resConfig_edit_saveTooltip=Update the configurations of all group members~
13 years, 5 months
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java | 149 +++++++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java | 46 ---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertDataSource.java | 48 ---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertView.java | 31 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java | 5
5 files changed, 150 insertions(+), 129 deletions(-)
New commits:
commit 64ca778dd2c1f00130de10d72504dd1a30bc5083
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Nov 24 17:23:30 2010 -0500
get subsystem alerts to show
get alert history view to be more purdy
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
index 801c06f..7c20be5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
@@ -18,6 +18,8 @@
*/
package org.rhq.enterprise.gui.coregui.client.alert;
+import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import java.util.Set;
@@ -29,10 +31,14 @@ import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.Record;
-import com.smartgwt.client.data.fields.DataSourceDateField;
-import com.smartgwt.client.data.fields.DataSourceIntegerField;
import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.rpc.RPCResponse;
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.AutoFitWidthApproach;
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.HoverCustomizer;
+import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.alert.Alert;
@@ -44,6 +50,8 @@ import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.criteria.AlertCriteria;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
+import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
import org.rhq.enterprise.gui.coregui.client.gwt.AlertGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.MeasurementConverterClient;
@@ -52,12 +60,17 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
/**
* @author Ian Springer
* @author Joseph Marques
+ * @author John Mazzitelli
*/
public class AlertDataSource extends RPCDataSource<Alert> {
private AlertGWTServiceAsync alertService = GWTServiceLookup.getAlertService();
private EntityContext entityContext;
+ private static final String PRIORITY_ICON_HIGH = "/images/icons/Flag_red_16.png";
+ private static final String PRIORITY_ICON_MEDIUM = "/images/icons/Flag_yellow_16.png";
+ private static final String PRIORITY_ICON_LOW = "/images/icons/Flag_blue_16.png";
+
public AlertDataSource() {
this(EntityContext.forSubsystemView());
}
@@ -66,47 +79,95 @@ public class AlertDataSource extends RPCDataSource<Alert> {
super();
this.entityContext = context;
- // TODO: when these fields are added, AlertHistoryView breaks -- why?
-
- //List<DataSourceField> fields = addDataSourceFields();
- //addFields(fields);
+ addDataSourceFields();
}
@Override
protected List<DataSourceField> addDataSourceFields() {
+ // for some reason, the client seems to crash if you don't specify any data source fields
+ // even though we know we defined override ListGridFields for all columns. Define at least one field here.
List<DataSourceField> fields = super.addDataSourceFields();
+ fields.add(new DataSourceTextField("name", MSG.common_title_name()));
+ return fields;
+ }
- DataSourceDateField ctimeField = new DataSourceDateField(AlertCriteria.SORT_FIELD_CTIME, MSG
- .view_alerts_field_created_time());
- addField(ctimeField);
-
- DataSourceIntegerField ackTimeField = new DataSourceIntegerField("acknowledgeTime", MSG
- .view_alerts_field_ack_time());
- addField(ackTimeField);
-
- DataSourceTextField ackSubjectField = new DataSourceTextField("acknowledgingSubject", MSG
- .view_alerts_field_ack_subject());
- addField(ackSubjectField);
-
- DataSourceTextField nameField = new DataSourceTextField(AlertCriteria.SORT_FIELD_NAME, MSG
- .view_alerts_field_name());
- addField(nameField);
-
- DataSourceTextField conditionTextField = new DataSourceTextField("conditionText", MSG
- .view_alerts_field_condition_text());
- addField(conditionTextField);
-
- DataSourceTextField conditionValueField = new DataSourceTextField("conditionValue", MSG
- .view_alerts_field_condition_value());
- addField(conditionValueField);
-
- DataSourceTextField resourceNameField = new DataSourceTextField("resourceName", MSG
- .view_alerts_field_resource());
- addField(resourceNameField);
+ /**
+ * The view that contains the list grid which will display this datasource's data will call this
+ * method to get the field information which is used to control the display of the data.
+ *
+ * @return list grid fields used to display the datasource data
+ */
+ public ArrayList<ListGridField> getListGridFields() {
+ ArrayList<ListGridField> fields = new ArrayList<ListGridField>(6);
- DataSourceTextField priorityField = new DataSourceTextField(AlertCriteria.SORT_FIELD_PRIORITY, MSG
- .view_alerts_field_priority(), 15);
- addField(priorityField);
+ ListGridField ctimeField = new ListGridField(AlertCriteria.SORT_FIELD_CTIME, MSG
+ .view_alerts_field_created_time());
+ ctimeField.setAutoFitWidth(true);
+ ctimeField.setAutoFitWidthApproach(AutoFitWidthApproach.TITLE);
+ ctimeField.setCellFormatter(new TimestampCellFormatter());
+ fields.add(ctimeField);
+
+ ListGridField nameField = new ListGridField("name", MSG.view_alerts_field_name());
+ nameField.setWidth("30%");
+ fields.add(nameField);
+
+ ListGridField conditionField = new ListGridField("conditionText", MSG.view_alerts_field_condition_text());
+ conditionField.setWidth("*");
+ fields.add(conditionField);
+
+ ListGridField priorityField = new ListGridField("priority", MSG.view_alerts_field_priority());
+ priorityField.setType(ListGridFieldType.IMAGE);
+ priorityField.setAutoFitWidth(true);
+ priorityField.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
+ priorityField.setAlign(Alignment.CENTER);
+ priorityField.setShowHover(true);
+ priorityField.setHoverCustomizer(new HoverCustomizer() {
+ @Override
+ public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
+ String prio = record.getAttribute("priority");
+ if (PRIORITY_ICON_HIGH.equals(prio)) {
+ return MSG.common_alert_high();
+ } else if (PRIORITY_ICON_MEDIUM.equals(prio)) {
+ return MSG.common_alert_medium();
+ } else if (PRIORITY_ICON_LOW.equals(prio)) {
+ return MSG.common_alert_low();
+ } else {
+ return ""; // will never get here
+ }
+ }
+ });
+ fields.add(priorityField);
+
+ ListGridField statusField = new ListGridField("status", MSG.common_title_status());
+ priorityField.setAutoFitWidth(true);
+ priorityField.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
+ statusField.setCellFormatter(new CellFormatter() {
+ public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
+ String ackTime = listGridRecord.getAttribute("acknowledgeTime");
+ String ackSubject = listGridRecord.getAttribute("acknowledgingSubject");
+ if (ackSubject == null) {
+ return MSG.view_alerts_field_ack_status_empty();
+ } else {
+ String formattedTime = TimestampCellFormatter.DATE_TIME_FORMAT.format(new Date(Long
+ .parseLong(ackTime)));
+ return MSG.view_alerts_field_ack_status_filled(ackSubject, formattedTime);
+ }
+ }
+ });
+ fields.add(statusField);
+
+ if (this.entityContext.type != EntityContext.Type.Resource) {
+ // TODO need to disambiguate this
+ ListGridField resourceNameField = new ListGridField("resourceName", MSG.view_alerts_field_resource());
+ resourceNameField.setWidth("30%");
+ resourceNameField.setCellFormatter(new CellFormatter() {
+ public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
+ Integer resourceId = listGridRecord.getAttributeAsInt("resourceId");
+ return "<a href=\"" + LinkManager.getResourceLink(resourceId) + "\">" + o + "</a>";
+ }
+ });
+ fields.add(resourceNameField);
+ }
return fields;
}
@@ -149,6 +210,7 @@ public class AlertDataSource extends RPCDataSource<Alert> {
criteria.addFilterPriorities(getArrayFilter(request, "severities", AlertPriority.class));
criteria.addFilterEntityContext(entityContext);
+ criteria.fetchConditionLogs(true);
return criteria;
}
@@ -173,7 +235,20 @@ public class AlertDataSource extends RPCDataSource<Alert> {
record.setAttribute("resourceId", from.getAlertDefinition().getResource().getId());
record.setAttribute("resourceName", from.getAlertDefinition().getResource().getName());
record.setAttribute("name", from.getAlertDefinition().getName());
- record.setAttribute("priority", from.getAlertDefinition().getPriority().name());
+ switch (from.getAlertDefinition().getPriority()) {
+ case HIGH: {
+ record.setAttribute("priority", PRIORITY_ICON_HIGH);
+ break;
+ }
+ case MEDIUM: {
+ record.setAttribute("priority", PRIORITY_ICON_MEDIUM);
+ break;
+ }
+ case LOW: {
+ record.setAttribute("priority", PRIORITY_ICON_LOW);
+ break;
+ }
+ }
Set<AlertConditionLog> conditionLogs = from.getConditionLogs();
String conditionText;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
index ebd85d8..afa4cdc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
@@ -20,7 +20,6 @@
package org.rhq.enterprise.gui.coregui.client.alert;
import java.util.Arrays;
-import java.util.Date;
import java.util.LinkedHashMap;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -29,7 +28,6 @@ import com.smartgwt.client.types.MultipleAppearance;
import com.smartgwt.client.types.SortDirection;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.form.fields.SelectItem;
-import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
@@ -37,11 +35,9 @@ import org.rhq.core.domain.alert.AlertPriority;
import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.criteria.AlertCriteria;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
import org.rhq.enterprise.gui.coregui.client.components.table.TableSection;
-import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
@@ -57,9 +53,10 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
* @author Joseph Marques
* @author Ian Springer
* @author Heiko W. Rupp
+ * @author John Mazzitelli
*/
public class AlertHistoryView extends TableSection {
- // TODO: Create a subclass for the subsystem view.
+
public static final ViewName SUBSYSTEM_VIEW_ID = new ViewName("RecentAlerts", MSG.common_title_recent_alerts());
private static SortSpecifier DEFAULT_SORT_SPECIFIER = new SortSpecifier(AlertCriteria.SORT_FIELD_CTIME,
@@ -103,45 +100,8 @@ public class AlertHistoryView extends TableSection {
@Override
protected void configureTable() {
- ListGridField ctimeField = new ListGridField("ctime", MSG.view_alerts_field_created_time(), 100);
- ctimeField.setCellFormatter(new TimestampCellFormatter());
-
- ListGridField nameField = new ListGridField("name", MSG.view_alerts_field_name(), 100);
- ListGridField conditionTextField = new ListGridField("conditionText", MSG.view_alerts_field_condition_text());
- ListGridField priorityField = new ListGridField("priority", MSG.view_alerts_field_priority(), 50);
-
- ListGridField statusField = new ListGridField("status", MSG.common_title_status(), 175);
- statusField.setCellFormatter(new CellFormatter() {
- public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
- String ackTime = listGridRecord.getAttribute("acknowledgeTime");
- String ackSubject = listGridRecord.getAttribute("acknowledgingSubject");
- if (ackSubject == null) {
- return MSG.view_alerts_field_ack_status_empty();
- } else {
- String formattedTime = TimestampCellFormatter.DATE_TIME_FORMAT.format(new Date(Long
- .parseLong(ackTime)));
- return MSG.view_alerts_field_ack_status_filled(ackSubject, formattedTime);
- }
- }
- });
-
- ListGridField resourceNameField = new ListGridField("resourceName", MSG.view_alerts_field_resource(), 125);
- resourceNameField.setCellFormatter(new CellFormatter() {
- public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
- Integer resourceId = listGridRecord.getAttributeAsInt("resourceId");
- return "<a href=\"" + LinkManager.getResourceLink(resourceId) + "\">" + o + "</a>";
- }
- });
-
- if (context.type == EntityContext.Type.Resource) {
- getListGrid().setFields(ctimeField, nameField, conditionTextField, priorityField, statusField);
- } else {
- getListGrid().setFields(ctimeField, nameField, conditionTextField, priorityField, statusField,
- resourceNameField);
- }
-
+ getListGrid().setFields(((AlertDataSource) getDataSource()).getListGridFields().toArray(new ListGridField[0]));
setupTableInteractions();
-
}
private void setupTableInteractions() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertDataSource.java
deleted file mode 100644
index 867f0ed..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertDataSource.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2010 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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.enterprise.gui.coregui.client.alert;
-
-import com.smartgwt.client.data.DataSourceField;
-import com.smartgwt.client.data.fields.DataSourceIntegerField;
-
-import org.rhq.core.domain.criteria.AlertCriteria;
-
-/**
- * @author Ian Springer
- */
-public class SubsystemResourceAlertDataSource extends AlertDataSource {
- @Override
- protected void onInit() {
- super.onInit();
-
- DataSourceField[] fields = getFields();
- DataSourceField[] updatedFields = new DataSourceField[fields.length + 1];
-
- // TODO: Replace 'Resource Id' column with 'Resource Name' and 'Resource Lineage' columns.
- DataSourceField resourceIdField = new DataSourceIntegerField(AlertCriteria.SORT_FIELD_RESOURCE_ID, MSG
- .common_title_resource_id());
- updatedFields[0] = resourceIdField;
-
- System.arraycopy(fields, 0, updatedFields, 1, fields.length);
- }
-}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertView.java
new file mode 100644
index 0000000..98ccda9
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/SubsystemResourceAlertView.java
@@ -0,0 +1,31 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2010 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.alert;
+
+import org.rhq.core.domain.common.EntityContext;
+
+public class SubsystemResourceAlertView extends AlertHistoryView {
+ public SubsystemResourceAlertView(String locatorId, boolean hasWriteAccess) {
+ super(locatorId, MSG.common_title_recent_alerts(), EntityContext.forSubsystemView(), hasWriteAccess);
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
index 1783a71..eab6d06 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
@@ -32,6 +32,7 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.enterprise.gui.coregui.client.admin.AdministrationView;
import org.rhq.enterprise.gui.coregui.client.admin.templates.ResourceTypeTreeView;
import org.rhq.enterprise.gui.coregui.client.alert.AlertHistoryView;
+import org.rhq.enterprise.gui.coregui.client.alert.SubsystemResourceAlertView;
import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.components.TitleBar;
import org.rhq.enterprise.gui.coregui.client.components.view.AbstractSectionedLeftNavigationView;
@@ -123,7 +124,9 @@ public class ReportTopView extends AbstractSectionedLeftNavigationView {
NavigationItem recentAlertsItem = new NavigationItem(AlertHistoryView.SUBSYSTEM_VIEW_ID,
"subsystems/alert/Alert_LOW_16.png", new ViewFactory() {
public Canvas createView() {
- return new AlertHistoryView(extendLocatorId(AlertHistoryView.SUBSYSTEM_VIEW_ID.getName()));
+ // TODO: how do we know if the user is able to ack the alerts? right now, I hardcode false to not allow it
+ return new SubsystemResourceAlertView(
+ extendLocatorId(AlertHistoryView.SUBSYSTEM_VIEW_ID.getName()), false);
}
});
13 years, 5 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java | 8 ++++++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java | 9 ++++++++-
2 files changed, 14 insertions(+), 3 deletions(-)
New commits:
commit 81107aa666cf2cefad89fa58aff81085ef064ac0
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Nov 24 16:46:43 2010 -0500
Fixed regression in Group TitleBar code when dealing with AutoGroups.
When criteria fetching an autoroups (private) backing group you need to
add additional criteria.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
index b41be2b..8fa66f3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
@@ -137,7 +137,7 @@ public class ResourceGroupDetailView extends AbstractTwoLevelTabSetView<Resource
@Override
protected ResourceGroupTitleBar createTitleBar() {
- return new ResourceGroupTitleBar(getLocatorId());
+ return new ResourceGroupTitleBar(getLocatorId(), isAutoGroup());
}
protected List<TwoLevelTab> createTabs() {
@@ -339,7 +339,7 @@ public class ResourceGroupDetailView extends AbstractTwoLevelTabSetView<Resource
criteria.addFilterId(groupId);
// for autogroups we need to add more criteria
- if (AUTO_GROUP_VIEW_PATH.equals(getBaseViewPath())) {
+ if (isAutoGroup()) {
criteria.addFilterVisible(null);
criteria.addFilterPrivate(true);
}
@@ -363,6 +363,10 @@ public class ResourceGroupDetailView extends AbstractTwoLevelTabSetView<Resource
});
}
+ private boolean isAutoGroup() {
+ return AUTO_GROUP_VIEW_PATH.equals(getBaseViewPath());
+ }
+
private void loadResourceType(final ResourceGroupComposite groupComposite, final ViewPath viewPath) {
final ResourceGroup group = this.groupComposite.getResourceGroup();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java
index bdf3fda..333fce6 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java
@@ -57,6 +57,7 @@ public class ResourceGroupTitleBar extends LocatableVLayout {
private ResourceGroup group;
private ResourceGroupComposite groupComposite;
+ boolean isAutoGroup;
private Img expandCollapseArrow;
private Img badge;
@@ -66,8 +67,9 @@ public class ResourceGroupTitleBar extends LocatableVLayout {
private boolean favorite;
private GeneralProperties generalProperties;
- public ResourceGroupTitleBar(String locatorId) {
+ public ResourceGroupTitleBar(String locatorId, boolean isAutoGroup) {
super(locatorId);
+ this.isAutoGroup = isAutoGroup;
setWidth100();
setHeight(30);
setPadding(5);
@@ -100,6 +102,11 @@ public class ResourceGroupTitleBar extends LocatableVLayout {
expandCollapseArrow.setLayoutAlign(VerticalAlignment.BOTTOM);
ResourceGroupCriteria criteria = new ResourceGroupCriteria();
criteria.addFilterId(this.group.getId());
+ // for autogroups we need to add more criteria
+ if (isAutoGroup) {
+ criteria.addFilterVisible(null);
+ criteria.addFilterPrivate(true);
+ }
GWTServiceLookup.getResourceGroupService().findResourceGroupCompositesByCriteria(criteria,
new AsyncCallback<PageList<ResourceGroupComposite>>() {
@Override
13 years, 5 months
[rhq] 2 commits - modules/core modules/enterprise
by Joseph Marques
modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertPriority.java | 2
modules/core/domain/src/main/java/org/rhq/core/domain/auth/Principal.java | 4
modules/core/domain/src/main/java/org/rhq/core/domain/auth/Subject.java | 5
modules/core/domain/src/main/java/org/rhq/core/domain/util/Recordizable.java | 28 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/core/rebind/RecordBuilderGenerator.java | 164 ----------
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml | 6
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/EmailManagerBean.java | 7
7 files changed, 8 insertions(+), 208 deletions(-)
New commits:
commit 9264d30249387f2419e5f6090670c938a3333764
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Nov 24 16:45:56 2010 -0500
remove exclamation points prefixing alert priority in emails
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertPriority.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertPriority.java
index ec9f880..f6424c0 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertPriority.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertPriority.java
@@ -26,7 +26,7 @@ package org.rhq.core.domain.alert;
* @author Joseph Marques
*/
public enum AlertPriority {
- LOW("! - Low"), MEDIUM("!! - Medium"), HIGH("!!! - High");
+ LOW("Low"), MEDIUM("Medium"), HIGH("High");
private String displayName;
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/EmailManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/EmailManagerBean.java
index 7fb3fa6..a3909a1 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/EmailManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/EmailManagerBean.java
@@ -106,7 +106,7 @@ public class EmailManagerBean implements EmailManagerLocal {
mimeMessage.setSubject(messageSubject);
mimeMessage.setContent(messageBody, "text/plain");
} catch (MessagingException e) {
- e.printStackTrace(); // TODO: Customise this generated block
+ e.printStackTrace(); // TODO: Customise this generated block
return toAddresses;
}
@@ -120,7 +120,8 @@ public class EmailManagerBean implements EmailManagerLocal {
InternetAddress recipient = new InternetAddress(toAddress);
Transport.send(mimeMessage, new InternetAddress[] { recipient });
} catch (Exception e) {
- LOG.error("Failed to send email [" + messageSubject + "] to recipient [" + toAddress + "]: " + e.getMessage());
+ LOG.error("Failed to send email [" + messageSubject + "] to recipient [" + toAddress + "]: "
+ + e.getMessage());
badAdresses.add(toAddress);
// Remember the first error - in case its due to a session initialization problem,
@@ -155,7 +156,7 @@ public class EmailManagerBean implements EmailManagerLocal {
template = template.replaceAll(TEMPLATE_TOKEN_ALERT_NAME, cleanse(alertName, "?Unknown Alert?"));
//if the priority enum for alerts changes in the future, we'll be safe
- template = template.replaceAll(TEMPLATE_TOKEN_PRIORITY, cleanse(priority, "!! - Medium"));
+ template = template.replaceAll(TEMPLATE_TOKEN_PRIORITY, cleanse(priority, "Medium"));
// better to be paranoid and on the safe side than risk it just to save one line of code
template = template.replaceAll(TEMPLATE_TOKEN_TIMESTAMP, cleanse(timestamp, new Date().toString()));
commit 2cd7285a7b6de25399310fcaa5699105c1cd6cd0
Author: Joseph Marques <joseph(a)redhat.com>
Date: Wed Nov 24 13:45:54 2010 -0500
will be favoring composite and/or flyweight objects in the future
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/auth/Principal.java b/modules/core/domain/src/main/java/org/rhq/core/domain/auth/Principal.java
index e49db95..fa3a923 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/auth/Principal.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/auth/Principal.java
@@ -22,8 +22,6 @@
*/
package org.rhq.core.domain.auth;
-import org.rhq.core.domain.util.Recordizable;
-
import java.io.Serializable;
import javax.persistence.Column;
@@ -45,7 +43,7 @@ import javax.persistence.Table;
@NamedQuery(name = Principal.QUERY_FIND_ALL_USERS, query = "SELECT m FROM Principal AS m") })
@SequenceGenerator(name = "RHQ_PRINCIPAL_ID_SEQ", sequenceName = "RHQ_PRINCIPAL_ID_SEQ", allocationSize = 10)
@Table(name = "RHQ_PRINCIPAL")
-public class Principal implements Serializable, Recordizable {
+public class Principal implements Serializable {
public static final String QUERY_FIND_BY_USERNAME = "Principal.findByUsername";
public static final String QUERY_FIND_ALL_USERS = "Principal.findAllUsers";
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/auth/Subject.java b/modules/core/domain/src/main/java/org/rhq/core/domain/auth/Subject.java
index 25bab8b..6358954 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/auth/Subject.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/auth/Subject.java
@@ -51,13 +51,12 @@ import org.jetbrains.annotations.NotNull;
import org.rhq.core.domain.authz.Role;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.resource.group.ResourceGroup;
-import org.rhq.core.domain.util.Recordizable;
/**
* @author Greg Hinkle
*/
@Entity
-@NamedQueries({
+@NamedQueries( {
@NamedQuery(name = Subject.QUERY_FIND_BY_IDS, query = "" //
+ "SELECT s " //
+ " FROM Subject s " //
@@ -201,7 +200,7 @@ import org.rhq.core.domain.util.Recordizable;
@SequenceGenerator(name = "RHQ_SUBJECT_ID_SEQ", sequenceName = "RHQ_SUBJECT_ID_SEQ")
@Table(name = "RHQ_SUBJECT")
/*@Cache(usage= CacheConcurrencyStrategy.TRANSACTIONAL)*/
-public class Subject implements Serializable, Recordizable {
+public class Subject implements Serializable {
public static final String QUERY_FIND_ALL = "Subject.findAll";
public static final String QUERY_FIND_BY_IDS = "Subject.findByIds";
public static final String QUERY_FIND_BY_NAME = "Subject.findByName";
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/util/Recordizable.java b/modules/core/domain/src/main/java/org/rhq/core/domain/util/Recordizable.java
deleted file mode 100644
index 262d131..0000000
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/util/Recordizable.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 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.core.domain.util;
-
-/**
- * A marker interface for generating Record builders
- *
- * @author Greg Hinkle
- */
-public interface Recordizable {
-
-}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/rebind/RecordBuilderGenerator.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/rebind/RecordBuilderGenerator.java
deleted file mode 100644
index 940b7de..0000000
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/core/rebind/RecordBuilderGenerator.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2010 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.core.rebind;
-
-import java.io.PrintWriter;
-
-import javax.persistence.Entity;
-
-import com.google.gwt.core.ext.Generator;
-import com.google.gwt.core.ext.GeneratorContext;
-import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.core.ext.typeinfo.JClassType;
-import com.google.gwt.core.ext.typeinfo.JField;
-import com.google.gwt.core.ext.typeinfo.NotFoundException;
-import com.google.gwt.core.ext.typeinfo.TypeOracle;
-import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
-import com.google.gwt.user.rebind.SourceWriter;
-
-/**
- * This is the start to a rebinder for our domain entities to allow for the
- * easy generation of Smart's Record objects.
- *
- * TODO: Get this working.
- * TODO: This should ideally be moved to a separate Maven module (e.g. rhq-gwt-tools.jar),
- * since it's not part of coregui.war, but rather, a tool used to help compile it.
- *
- * @author Greg Hinkle
- */
-public class RecordBuilderGenerator extends Generator {
-
- protected TreeLogger logger;
- private String packageName;
- private String qualifiedStubClassName;
- private JClassType requestedClass;
- private String simpleStubClassName;
- private SourceWriter sourceWriter;
- private TypeOracle typeOracle;
-
- /**
- * Create a new type that satisfies the rebind request.
- */
- @Override
- public String generate(TreeLogger logger, GeneratorContext context, String typeName)
- throws UnableToCompleteException {
-
- System.out.println("classType " + typeName);
-
- if (!init(logger, context, typeName)) {
- return null;
- }
-
- writeSource();
- sourceWriter.commit(logger);
-
- return qualifiedStubClassName;
- }
-
- protected JClassType getRequestedClass() {
- return requestedClass;
- }
-
- protected SourceWriter getSourceWriter() {
- return sourceWriter;
- }
-
- protected TypeOracle getTypeOracle() {
- return typeOracle;
- }
-
- protected void writeSource() throws UnableToCompleteException {
-
- JField[] fields = requestedClass.getFields();
-
- writeBuildRecordMethod(fields, sourceWriter);
- }
-
- /**
- * Gets the name of the native stub class.
- */
- private String getSimpleStubClassName(JClassType baseClass) {
- return "__" + baseClass.getSimpleSourceName() + "_RecordBuilder";
- }
-
- private SourceWriter getSourceWriter(TreeLogger logger, GeneratorContext ctx, String packageName, String className,
- String superclassName) {
-
- PrintWriter printWriter = ctx.tryCreate(logger, packageName, className);
- if (printWriter == null) {
- return null;
- }
-
- ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(packageName, className);
-
- composerFactory.setSuperclass(superclassName);
-
- return composerFactory.createSourceWriter(ctx, printWriter);
- }
-
- private boolean init(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException {
- this.logger = logger;
- typeOracle = context.getTypeOracle();
- assert typeOracle != null;
-
- try {
- requestedClass = typeOracle.getType(typeName);
- } catch (NotFoundException e) {
- logger.log(TreeLogger.ERROR, "Could not find type '" + typeName
- + "'; please see the log, as this usually indicates a previous error ", e);
- throw new UnableToCompleteException();
- }
-
- if (requestedClass.getAnnotation(Entity.class) == null) {
- System.out.println("Not an entity: " + typeName);
- return false;
- }
-
- System.out.println("$$$$$$$$Making a record builder for: " + typeName);
-
- // Get the stub class name, and see if its source file exists.
- //
- simpleStubClassName = getSimpleStubClassName(requestedClass);
- packageName = requestedClass.getPackage().getName();
- qualifiedStubClassName = packageName + "." + simpleStubClassName;
-
- sourceWriter = getSourceWriter(logger, context, packageName, simpleStubClassName, requestedClass
- .getQualifiedSourceName());
-
- return sourceWriter != null;
- }
-
- private void writeBuildRecordMethod(JField[] fields, SourceWriter sw) {
- sw.println();
- sw.println("protected final com.smartgwt.client.data.Record buildRecord("
- + requestedClass.getQualifiedSourceName() + " entity) throws Throwable {");
- sw.indent();
-
- sw.println("com.smartgwt.client.data.Record record = new com.smartgwt.client.data.Record();");
-
- for (JField field : fields) {
- sw.println("record.setAttribute(\"" + field.getName() + "\", " + field.getName() + ");");
- }
- sw.println("return record;");
- sw.outdent();
- sw.println("}");
- }
-
-}
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index 9579f03..3ef0391 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -49,12 +49,6 @@
-->
<set-property name="log_DivLogger" value="DISABLED" />
- <!--
- <generate-with class="org.rhq.core.rebind.RecordBuilderGenerator">
- <when-type-assignable class="org.rhq.core.domain.util.Recordizable"/>
- </generate-with>
- -->
-
<replace-with class="org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFormImpl">
<when-type-is class="org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFormImpl"/>
</replace-with>
13 years, 5 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java | 14 +++++-----
1 file changed, 7 insertions(+), 7 deletions(-)
New commits:
commit 0b1afce88ec845c2893501e4d268268c26f11182
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Nov 24 16:14:19 2010 -0500
Fix the Help NavigationSection icon rendering. For some reason for a
TreeNode icon path [SKIN] is looking under ../Enterprise/images/ListGrid as
opposed to just ../Enterprise/images. So, for now at least, fix the
path by looking under the parent dir. I won't be surprised if this
behavior changes in a future smartgwt version.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
index 9b306e2..6c696db 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
@@ -77,7 +77,7 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
private NavigationSection buildDocSection() {
NavigationItem aboutItem = new NavigationItem(new ViewName("AboutBox", MSG.view_help_docAbout()),
- "[SKIN]/actions/help.png", new ViewFactory() {
+ "[SKIN]/../actions/help.png", new ViewFactory() {
public Canvas createView() {
AboutModalWindow aboutModalWindow = new AboutModalWindow();
aboutModalWindow.show();
@@ -86,14 +86,14 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
});
NavigationItem docItem = new NavigationItem(new ViewName("TOC", MSG.view_help_docToc()),
- "[SKIN]/headerIcons/document.png", new ViewFactory() {
+ "[SKIN]/../headerIcons/document.png", new ViewFactory() {
public Canvas createView() {
return new FullHTMLPane(extendLocatorId("TOC"), "http://www.rhq-project.org/display/JOPR2/Home");
}
});
NavigationItem faqItem = new NavigationItem(new ViewName("FAQ", MSG.view_help_docFaq()),
- "[SKIN]/headerIcons/document.png", new ViewFactory() {
+ "[SKIN]/../headerIcons/document.png", new ViewFactory() {
public Canvas createView() {
return new FullHTMLPane(extendLocatorId("FAQ"), "http://www.rhq-project.org/display/JOPR2/FAQ");
}
@@ -105,7 +105,7 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
private NavigationSection buildTutorialSection() {
NavigationItem searchItem = new NavigationItem(new ViewName("TutorialSearch", MSG.view_help_tutorialSearch()),
- "[SKIN]/actions/help.png", new ViewFactory() {
+ "[SKIN]/../actions/help.png", new ViewFactory() {
public Canvas createView() {
return new FullHTMLPane(extendLocatorId("TutorialSearch"),
"http://www.rhq-project.org/display/JOPR2/Search");
@@ -113,7 +113,7 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
});
NavigationItem dynaGroupItem = new NavigationItem(new ViewName("TutorialDynaGroup", MSG
- .view_help_tutorialDynaGroup()), "[SKIN]/actions/help.png", new ViewFactory() {
+ .view_help_tutorialDynaGroup()), "[SKIN]/../actions/help.png", new ViewFactory() {
public Canvas createView() {
return new FullHTMLPane(
extendLocatorId("TutorialDynaGroup"),
@@ -122,7 +122,7 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
});
NavigationItem demoAllItem = new NavigationItem(new ViewName("DemoAll", MSG.view_help_tutorialDemoAll()),
- "[SKIN]/actions/help.png", new ViewFactory() {
+ "[SKIN]/../headerIcons/document.png", new ViewFactory() {
public Canvas createView() {
return new FullHTMLPane(extendLocatorId("DemoAll"),
"http://www.rhq-project.org/display/JOPR2/Demos");
@@ -130,7 +130,7 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
});
NavigationItem demoBundleItem = new NavigationItem(new ViewName("DemoBundle", MSG
- .view_help_tutorialDemoBundle()), "[SKIN]/actions/help.png", new ViewFactory() {
+ .view_help_tutorialDemoBundle()), "[SKIN]/../headerIcons/document.png", new ViewFactory() {
public Canvas createView() {
return new FullHTMLPane(extendLocatorId("DemoBundle"),
"http://mazz.fedorapeople.org/demos/provisioning_beta/prov-beta.htm");
13 years, 5 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 3 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java | 19 ----------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java | 16 +++++++-
3 files changed, 17 insertions(+), 21 deletions(-)
New commits:
commit 5371ea38e16142e129d59dcf0631a909a3c910e2
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Nov 24 15:28:48 2010 -0500
Ensure that the username is correct in the menu bar when the session
changes. The timer solution previously used in Footer is replaceed with
a request from CoreGUI to redraw the menu bar, and the menu bar overrides
markForRedraw to update the session info as needed.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index 1fb3d29..f039fda 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -169,6 +169,9 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
}
if (History.getToken().equals("") || History.getToken().equals("LogOut")) {
+ // request a redraw of the MenuBarItem to ensure the correct sessio info is displayed
+ rootCanvas.getMember(0).markForRedraw();
+
// go to default view if user doesn't specify a history token
History.newItem(getDefaultView());
} else {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
index 96b2e17..e6da3f3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java
@@ -58,7 +58,6 @@ public class Footer extends LocatableToolStrip {
protected void onDraw() {
super.onDraw();
- //final UserSessionState userSessionState = new UserSessionState("UserSessionState");
final MessageCenterView messageCenter = new MessageCenterView(extendLocatorId(MessageCenterView.LOCATOR_ID));
final FavoritesButton favoritesButton = new FavoritesButton(extendLocatorId("Favorites"));
final AlertsMessage alertsMessage = new AlertsMessage(extendLocatorId("Alerts"));
@@ -73,7 +72,6 @@ public class Footer extends LocatableToolStrip {
addMember(favoritesButton);
- //userSessionState.schedule(15000);
alertsMessage.schedule(60000);
}
@@ -114,23 +112,6 @@ public class Footer extends LocatableToolStrip {
}
}
- // public static class UserSessionState extends RefreshableLabel {
- // public UserSessionState(String locatorId) {
- // super(locatorId);
- // setWrap(false);
- // setMargin(5);
- // setValign(VerticalAlignment.CENTER);
- // }
- //
- // public void refreshLoggedIn() {
- // setContents(MSG.view_core_loggedInAs(UserSessionManager.getSessionSubject().getName()));
- // }
- //
- // public void refreshLoggedOut() {
- // setContents(MSG.view_core_loggedOut());
- // }
- // }
-
public static class AlertsMessage extends RefreshableLabel {
public AlertsMessage(String locatorId) {
super(locatorId);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
index a87fcc4..8a090dd 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
@@ -54,6 +54,7 @@ public class MenuBarView extends LocatableVLayout {
BundleTopView.VIEW_ID, AdministrationView.VIEW_ID, HelpView.VIEW_ID };
private String currentlySelectedSection = DashboardsView.VIEW_ID.getName();
+ private LocatableLabel userLabel;
public MenuBarView(String locatorId) {
super(locatorId);
@@ -78,6 +79,18 @@ public class MenuBarView extends LocatableVLayout {
markForRedraw();
}
+ // When redrawing, ensire the correct session infor is displayed
+ @Override
+ public void markForRedraw() {
+ String currentDisplayName = userLabel.getContents();
+ String currentUsername = UserSessionManager.getSessionSubject().getName();
+ if (!currentUsername.equals(currentDisplayName)) {
+ userLabel.setContents(currentUsername);
+ }
+
+ super.markForRedraw();
+ }
+
private Canvas getLogoSection() {
final AboutModalWindow aboutModalWindow = new AboutModalWindow();
Img logo = new Img("header/rhq_logo_28px.png", 80, 28);
@@ -140,8 +153,7 @@ public class MenuBarView extends LocatableVLayout {
layout.setMargin(10);
layout.setAlign(Alignment.RIGHT);
- LocatableLabel userLabel = new LocatableLabel(this.extendLocatorId("User"), UserSessionManager
- .getSessionSubject().getName());
+ userLabel = new LocatableLabel(this.extendLocatorId("User"), UserSessionManager.getSessionSubject().getName());
userLabel.setAutoWidth();
LocatableLabel lineLabel = new LocatableLabel(this.extendLocatorId("Line"), " | ");
13 years, 5 months
[rhq] 2 commits - modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java | 21 ++++++++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java | 6 +-
2 files changed, 21 insertions(+), 6 deletions(-)
New commits:
commit 78e22d2060257e14c9f22bafef1a04744424ab20
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Nov 24 14:23:04 2010 -0500
use icons and i18n names for the priority filter select menu - its all purdy now
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
index bd103a9..ebd85d8 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
@@ -21,11 +21,14 @@ package org.rhq.enterprise.gui.coregui.client.alert;
import java.util.Arrays;
import java.util.Date;
+import java.util.LinkedHashMap;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.SortSpecifier;
+import com.smartgwt.client.types.MultipleAppearance;
import com.smartgwt.client.types.SortDirection;
import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
@@ -35,7 +38,6 @@ import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.criteria.AlertCriteria;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
-import org.rhq.enterprise.gui.coregui.client.components.form.EnumSelectItem;
import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
import org.rhq.enterprise.gui.coregui.client.components.table.TableSection;
@@ -80,8 +82,21 @@ public class AlertHistoryView extends TableSection {
@Override
protected void configureTableFilters() {
- final EnumSelectItem priorityFilter = new EnumSelectItem("severities", MSG.view_alerts_table_filter_priority(),
- AlertPriority.class);
+ SelectItem priorityFilter = new SelectItem("severities", MSG.view_alerts_table_filter_priority());
+ priorityFilter.setMultiple(true);
+ priorityFilter.setMultipleAppearance(MultipleAppearance.PICKLIST);
+
+ LinkedHashMap<String, String> priorities = new LinkedHashMap<String, String>(3);
+ priorities.put(AlertPriority.HIGH.name(), MSG.common_alert_high());
+ priorities.put(AlertPriority.MEDIUM.name(), MSG.common_alert_medium());
+ priorities.put(AlertPriority.LOW.name(), MSG.common_alert_low());
+ LinkedHashMap<String, String> priorityIcons = new LinkedHashMap<String, String>(3);
+ priorityIcons.put(AlertPriority.HIGH.name(), "/images/icons/Flag_red_16.png");
+ priorityIcons.put(AlertPriority.MEDIUM.name(), "/images/icons/Flag_yellow_16.png");
+ priorityIcons.put(AlertPriority.LOW.name(), "/images/icons/Flag_blue_16.png");
+ priorityFilter.setValueMap(priorities);
+ priorityFilter.setValueIcons(priorityIcons);
+ priorityFilter.setValues(AlertPriority.HIGH.name(), AlertPriority.MEDIUM.name(), AlertPriority.LOW.name());
setFilterFormItems(priorityFilter);
}
commit c2cbcfef8fac401218879693577b8ea9ce1171b1
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Nov 24 14:22:28 2010 -0500
use the i18n terms, not the enum name value
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java
index 8795043..ca4c3ce 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java
@@ -216,9 +216,9 @@ public class GeneralPropertiesAlertDefinitionForm extends LocatableDynamicForm i
prioritySelection = new SelectItem("priority", MSG.view_alerts_field_priority());
LinkedHashMap<String, String> priorities = new LinkedHashMap<String, String>(3);
- priorities.put(AlertPriority.HIGH.name(), AlertPriority.HIGH.name());
- priorities.put(AlertPriority.MEDIUM.name(), AlertPriority.MEDIUM.name());
- priorities.put(AlertPriority.LOW.name(), AlertPriority.LOW.name());
+ priorities.put(AlertPriority.HIGH.name(), MSG.common_alert_high());
+ priorities.put(AlertPriority.MEDIUM.name(), MSG.common_alert_medium());
+ priorities.put(AlertPriority.LOW.name(), MSG.common_alert_low());
LinkedHashMap<String, String> priorityIcons = new LinkedHashMap<String, String>(3);
priorityIcons.put(AlertPriority.HIGH.name(), "/images/icons/Flag_red_16.png");
priorityIcons.put(AlertPriority.MEDIUM.name(), "/images/icons/Flag_yellow_16.png");
13 years, 5 months
[rhq] 3 commits - modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java | 83 +++++++++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java | 27 +++
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 6
5 files changed, 114 insertions(+), 7 deletions(-)
New commits:
commit 67bdf6e52f3fc71ed22400ae58519a759cf78886
Merge: 06e438b... 8a2e19e...
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Nov 24 13:22:07 2010 -0500
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq.git
commit 06e438b0b91e5a18a3f5928a9fade7073f4695ee
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Nov 24 13:21:42 2010 -0500
provide better looking alert def list views.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
index f960bc7..aa59e54 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java
@@ -18,6 +18,7 @@
*/
package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -28,7 +29,13 @@ import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.data.fields.DataSourceImageField;
import com.smartgwt.client.data.fields.DataSourceTextField;
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.AutoFitWidthApproach;
+import com.smartgwt.client.types.DateDisplayFormat;
import com.smartgwt.client.types.FieldType;
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.widgets.grid.HoverCustomizer;
+import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.alert.AlertDefinition;
@@ -51,7 +58,7 @@ public abstract class AbstractAlertDefinitionsDataSource extends RPCDataSource<A
protected static final String FIELD_MTIME = "mtime";
protected static final String FIELD_ENABLED = "enabled";
protected static final String FIELD_DELETED = "deleted";
- protected static final String FIELD_PRIORITY = "priority"; // not the actual object; a string for the UI
+ protected static final String FIELD_PRIORITY = "priority"; // an image URL
protected static final String FIELD_OBJECT = "_object"; // the actual AlertDefinition object
public AbstractAlertDefinitionsDataSource() {
@@ -60,6 +67,71 @@ public abstract class AbstractAlertDefinitionsDataSource extends RPCDataSource<A
addFields(fields);
}
+ /**
+ * The view that contains the list grid which will display this datasource's data will call this
+ * method to get the field information which is used to control the display of the data.
+ *
+ * @return list grid fields used to display the datasource data
+ */
+ public ArrayList<ListGridField> getListGridFields() {
+ ArrayList<ListGridField> fields = new ArrayList<ListGridField>(6);
+
+ ListGridField nameField = new ListGridField(FIELD_NAME, MSG.view_alerts_field_name());
+ nameField.setWidth("25%");
+ fields.add(nameField);
+
+ ListGridField descriptionField = new ListGridField(FIELD_DESCRIPTION, MSG.common_title_description());
+ descriptionField.setWidth("30%");
+ fields.add(descriptionField);
+
+ ListGridField ctimeField = new ListGridField(FIELD_CTIME, MSG.view_alerts_field_created_time());
+ ctimeField.setType(ListGridFieldType.DATE);
+ ctimeField.setDateFormatter(DateDisplayFormat.TOLOCALESTRING);
+ ctimeField.setWidth("15%");
+ fields.add(ctimeField);
+
+ ListGridField mtimeField = new ListGridField(FIELD_MTIME, MSG.view_alerts_field_modified_time());
+ mtimeField.setType(ListGridFieldType.DATE);
+ mtimeField.setDateFormatter(DateDisplayFormat.TOLOCALESTRING);
+ mtimeField.setWidth("15%");
+ fields.add(mtimeField);
+
+ ListGridField enabledField = new ListGridField(FIELD_ENABLED, MSG.view_alerts_field_enabled());
+ enabledField.setType(ListGridFieldType.IMAGE);
+ enabledField.setAlign(Alignment.CENTER);
+ enabledField.setAutoFitWidth(true);
+ enabledField.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
+ fields.add(enabledField);
+
+ ListGridField priorityField = new ListGridField(FIELD_PRIORITY, MSG.view_alerts_field_priority());
+ priorityField.setType(ListGridFieldType.IMAGE);
+ priorityField.setAutoFitWidth(true);
+ priorityField.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
+ priorityField.setAlign(Alignment.CENTER);
+ priorityField.setShowHover(true);
+ priorityField.setHoverCustomizer(new HoverCustomizer() {
+ @Override
+ public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
+ AlertDefinition alertDef = (AlertDefinition) record.getAttributeAsObject(FIELD_OBJECT);
+ switch (alertDef.getPriority()) {
+ case HIGH: {
+ return MSG.common_alert_high();
+ }
+ case MEDIUM: {
+ return MSG.common_alert_medium();
+ }
+ case LOW: {
+ return MSG.common_alert_low();
+ }
+ }
+ return ""; // will never get here
+ }
+ });
+ fields.add(priorityField);
+
+ return fields;
+ }
+
@Override
public AlertDefinition copyValues(Record from) {
AlertDefinition alertDef = (AlertDefinition) from.getAttributeAsObject(FIELD_OBJECT);
@@ -74,7 +146,11 @@ public abstract class AbstractAlertDefinitionsDataSource extends RPCDataSource<A
record.setAttribute(FIELD_DESCRIPTION, from.getDescription());
record.setAttribute(FIELD_CTIME, new Date(from.getCtime()));
record.setAttribute(FIELD_MTIME, new Date(from.getMtime()));
- record.setAttribute(FIELD_ENABLED, from.getEnabled());
+ if (from.getEnabled()) {
+ record.setAttribute(FIELD_ENABLED, "/images/icons/availability_green_16.png");
+ } else {
+ record.setAttribute(FIELD_ENABLED, "/images/icons/availability_red_16.png");
+ }
record.setAttribute(FIELD_DELETED, from.getDeleted());
switch (from.getPriority()) {
case HIGH: {
@@ -117,8 +193,7 @@ public abstract class AbstractAlertDefinitionsDataSource extends RPCDataSource<A
mtimeField.setType(FieldType.DATETIME);
fields.add(mtimeField);
- DataSourceTextField enabledField = new DataSourceTextField(FIELD_ENABLED, MSG.view_alerts_field_enabled());
- enabledField.setType(FieldType.BOOLEAN);
+ DataSourceImageField enabledField = new DataSourceImageField(FIELD_ENABLED, MSG.view_alerts_field_enabled());
fields.add(enabledField);
DataSourceImageField priorityField = new DataSourceImageField(FIELD_PRIORITY, MSG.view_alerts_field_priority());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java
index 491bff5..811c4d8 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java
@@ -22,6 +22,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.alert.AlertDampening;
@@ -56,6 +57,7 @@ public abstract class AbstractAlertDefinitionsView extends TableSection<Abstract
AbstractAlertDefinitionsDataSource ds = getAlertDefinitionDataSource();
setDataSource(ds);
listGrid.setDataSource(ds);
+ listGrid.setFields(ds.getListGridFields().toArray(new ListGridField[0]));
Criteria criteria = getCriteria();
listGrid.setCriteria(criteria);
@@ -98,7 +100,6 @@ public abstract class AbstractAlertDefinitionsView extends TableSection<Abstract
}
});
-
}
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java
index 14f587d..2068a23 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java
@@ -23,6 +23,7 @@
package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -31,6 +32,10 @@ import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.fields.DataSourceLinkField;
import com.smartgwt.client.data.fields.DataSourceTextField;
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.AutoFitWidthApproach;
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.alert.AlertDefinition;
@@ -55,6 +60,26 @@ public class ResourceAlertDefinitionsDataSource extends AbstractAlertDefinitions
}
@Override
+ public ArrayList<ListGridField> getListGridFields() {
+ ArrayList<ListGridField> fields = super.getListGridFields();
+
+ // add two more columns
+ ListGridField parentIdField = new ListGridField(FIELD_PARENT, MSG.view_alerts_field_parent());
+ parentIdField.setType(ListGridFieldType.LINK);
+ parentIdField.setAutoFitWidth(true);
+ parentIdField.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
+ fields.add(parentIdField);
+
+ ListGridField readOnlyField = new ListGridField(FIELD_READONLY, MSG.view_alerts_field_protected());
+ readOnlyField.setAutoFitWidth(true);
+ readOnlyField.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
+ readOnlyField.setAlign(Alignment.CENTER);
+ fields.add(readOnlyField);
+
+ return fields;
+ }
+
+ @Override
public ListGridRecord copyValues(AlertDefinition from) {
ListGridRecord record = super.copyValues(from);
@@ -76,7 +101,7 @@ public class ResourceAlertDefinitionsDataSource extends AbstractAlertDefinitions
+ "/Alerts/Definitions/" + groupAlertDefinition.getId());
record.setLinkText(MSG.view_alert_definition_for_group());
}
- record.setAttribute(FIELD_READONLY, readOnly);
+ record.setAttribute(FIELD_READONLY, (readOnly) ? MSG.common_val_yes() : MSG.common_val_no());
}
return record;
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index a99b4ed..90c6014 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -179,6 +179,12 @@ common_val_never = Never~
common_val_na = N/A~
common_val_none = None~
+# Common Alert Priorities
+#------------------------
+common_alert_high=HIGH
+common_alert_medium=MEDIUM
+common_alert_low=LOW
+
# Common Calendar
#--------------
common_calendar_january_short=jan~
commit 07648b0b03b1fd9d345c13ec8b11fced0c502eeb
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Nov 24 12:37:19 2010 -0500
typo - should be using minutes label
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
index d896479..3527da5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java
@@ -578,7 +578,7 @@ public class DampeningAlertDefinitionForm extends LocatableDynamicForm implement
private String getTimeUnitsTitle(AlertDampening.TimeUnits units) {
switch (units) {
case MINUTES: {
- return MSG.common_label_month();
+ return MSG.common_label_minutes();
}
case HOURS: {
return MSG.common_label_hours();
13 years, 5 months