[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java | 26 ++++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java | 38 +++++++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestConfigurationView.java | 9 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestGroupConfigurationView.java | 9 +-
4 files changed, 58 insertions(+), 24 deletions(-)
New commits:
commit 1863896db8bd017e29a385cbb06fcbeb9402262a
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Oct 20 11:06:08 2010 -0400
core group config code for top-level simples and static maps of simples is done; still to do: set-all-values-to controls and support for dynamic/open maps of simples
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
index df61aaa..28d5960 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
@@ -1326,17 +1326,11 @@ public class ConfigurationEditor extends LocatableVLayout {
// Only update the underlying property when the input is changed if it's a top-level simple or a simple within a
// top-level map.
- PropertyDefinitionMap parentPropertyMapDefinition =
- propertyDefinitionSimple.getParentPropertyMapDefinition();
- if (propertyDefinitionSimple.getConfigurationDefinition() != null ||
- (parentPropertyMapDefinition != null && parentPropertyMapDefinition.getConfigurationDefinition() != null)) {
+ if (updatePropertyValueOnChange(propertyDefinitionSimple, propertySimple)) {
valueItem.addChangedHandler(new ChangedHandler() {
- public void onChanged(ChangedEvent changedEvent) {
- propertySimple.setErrorMessage(null);
+ public void onChanged(ChangedEvent changedEvent) {
+ updatePropertySimpleValue(changedEvent.getValue(), propertySimple, propertyDefinitionSimple);
boolean isValid = changedEvent.getItem().validate();
- if (isValid) {
- propertySimple.setValue(changedEvent.getValue());
- }
firePropertyChangedEvent(propertySimple, propertyDefinitionSimple, isValid);
}
});
@@ -1345,6 +1339,20 @@ public class ConfigurationEditor extends LocatableVLayout {
return valueItem;
}
+ protected boolean updatePropertyValueOnChange(PropertyDefinitionSimple propertyDefinitionSimple,
+ PropertySimple propertySimple) {
+ PropertyDefinitionMap parentPropertyMapDefinition =
+ propertyDefinitionSimple.getParentPropertyMapDefinition();
+ return propertyDefinitionSimple.getConfigurationDefinition() != null ||
+ (parentPropertyMapDefinition != null && parentPropertyMapDefinition.getConfigurationDefinition() != null);
+ }
+
+ protected void updatePropertySimpleValue(Object value, PropertySimple propertySimple,
+ PropertyDefinitionSimple propertyDefinitionSimple) {
+ propertySimple.setErrorMessage(null);
+ propertySimple.setValue(value);
+ }
+
protected static Property getTopLevelProperty(Property property) {
Property currentProperty = property;
while (currentProperty.getConfiguration() == null) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java
index c3ba6cb..e198fc0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java
@@ -159,7 +159,7 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
for (GroupMemberConfiguration memberConfiguration : memberConfigurations) {
Configuration configuration = memberConfiguration.getConfiguration();
PropertySimple memberPropertySimple =
- getPropertySimple(configuration, propertyDefinitionSimple, propertySimple, null);
+ getPropertySimple(configuration, propertyDefinitionSimple, null);
memberPropertySimple.setValue(value);
}
}
@@ -218,7 +218,7 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
memberItem.setDefaultValue(memberName);
items.add(memberItem);
Configuration configuration = memberConfiguration.getConfiguration();
- PropertySimple memberPropertySimple = getPropertySimple(configuration, propertyDefinitionSimple, aggregatePropertySimple, index);
+ PropertySimple memberPropertySimple = getPropertySimple(configuration, propertyDefinitionSimple, index);
memberProperties.put(memberName, memberPropertySimple);
FormItem valueItem = buildSimpleField(propertyDefinitionSimple, memberPropertySimple);
valueItem.setAttribute("rhq:property", memberPropertySimple);
@@ -317,13 +317,36 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
popup.show();
}
+ @Override
+ protected boolean updatePropertyValueOnChange(PropertyDefinitionSimple propertyDefinitionSimple,
+ PropertySimple propertySimple) {
+ return isAggregateProperty(propertySimple) && super.updatePropertyValueOnChange(propertyDefinitionSimple, propertySimple); // TODO: Implement this method.
+ }
+
+ @Override
+ protected void updatePropertySimpleValue(Object value, PropertySimple propertySimple,
+ PropertyDefinitionSimple propertyDefinitionSimple) {
+ // Update the aggregate property
+ super.updatePropertySimpleValue(value, propertySimple, propertyDefinitionSimple);
+ propertySimple.setOverride(true);
+
+ // Update all the member properties.
+ for (GroupMemberConfiguration memberConfiguration : this.memberConfigurations) {
+ Configuration configuration = memberConfiguration.getConfiguration();
+ PropertySimple memberPropertySimple =
+ getPropertySimple(configuration, propertyDefinitionSimple, null);
+ memberPropertySimple.setErrorMessage(null);
+ memberPropertySimple.setValue(value);
+ }
+ }
+
private PropertySimple getPropertySimple(Configuration configuration,
PropertyDefinitionSimple propertyDefinitionSimple,
- PropertySimple aggregatePropertySimple, Integer index) {
+ Integer index) {
LinkedList<PropertyDefinition> propertyDefinitionHierarchy = new LinkedList<PropertyDefinition>();
PropertyDefinition currentPropertyDefinition = propertyDefinitionSimple;
- do {
- propertyDefinitionHierarchy.addFirst(currentPropertyDefinition);
+ propertyDefinitionHierarchy.add(currentPropertyDefinition);
+ do {
if (currentPropertyDefinition.getParentPropertyMapDefinition() != null) {
currentPropertyDefinition = currentPropertyDefinition.getParentPropertyMapDefinition();
} else if (currentPropertyDefinition.getParentPropertyListDefinition() != null) {
@@ -331,6 +354,7 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
} else if (currentPropertyDefinition.getConfigurationDefinition() == null) {
throw new IllegalStateException(currentPropertyDefinition + " has no parent.");
}
+ propertyDefinitionHierarchy.addFirst(currentPropertyDefinition);
}
while (currentPropertyDefinition.getConfigurationDefinition() == null);
@@ -348,10 +372,6 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
}
PropertySimple propertySimple = (PropertySimple)property;
- if (isHomogeneous(aggregatePropertySimple)) {
- // If the aggregate property has its override bit set, make sure the member property has the same value.
- propertySimple.setStringValue(aggregatePropertySimple.getStringValue());
- }
return propertySimple;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestConfigurationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestConfigurationView.java
index 2fd5dfa..9d94650 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestConfigurationView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestConfigurationView.java
@@ -20,6 +20,7 @@
package org.rhq.enterprise.gui.coregui.client.test;
import java.util.EnumSet;
+import java.util.Set;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.events.ClickEvent;
@@ -91,15 +92,17 @@ public class TestConfigurationView
MessageCenter messageCenter = CoreGUI.getMessageCenter();
Message message;
if (event.isValidationStateChanged()) {
- if (event.getInvalidPropertyNames().isEmpty()) {
+ Set<String> invalidPropertyNames = event.getInvalidPropertyNames();
+ if (invalidPropertyNames.isEmpty()) {
this.saveButton.enable();
message = new Message("All properties now have valid values, so the configuration can now be saved.",
- Message.Severity.Info, EnumSet.of(Message.Option.Transient));
+ Message.Severity.Info, EnumSet.of(Message.Option.Transient, Message.Option.Sticky));
}
else {
this.saveButton.disable();
message = new Message(
- "One or more properties have invalid values. The values must be corrected before the configuration can be saved.",
+ "The following properties have invalid values: " + invalidPropertyNames
+ + " - the values must be corrected before the configuration can be saved.",
Message.Severity.Error, EnumSet.of(Message.Option.Transient, Message.Option.Sticky));
}
messageCenter.notify(message);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestGroupConfigurationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestGroupConfigurationView.java
index 7d71c02..f54bb01 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestGroupConfigurationView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestGroupConfigurationView.java
@@ -22,6 +22,7 @@ package org.rhq.enterprise.gui.coregui.client.test;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
+import java.util.Set;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.events.ClickEvent;
@@ -100,15 +101,17 @@ public class TestGroupConfigurationView
MessageCenter messageCenter = CoreGUI.getMessageCenter();
Message message;
if (event.isValidationStateChanged()) {
- if (event.getInvalidPropertyNames().isEmpty()) {
+ Set<String> invalidPropertyNames = event.getInvalidPropertyNames();
+ if (invalidPropertyNames.isEmpty()) {
this.saveButton.enable();
message = new Message("All properties now have valid values, so the configuration can now be saved.",
- Message.Severity.Info, EnumSet.of(Message.Option.Transient));
+ Message.Severity.Info, EnumSet.of(Message.Option.Transient, Message.Option.Sticky));
}
else {
this.saveButton.disable();
message = new Message(
- "One or more properties have invalid values. The values must be corrected before the configuration can be saved.",
+ "The following properties have invalid values: " + invalidPropertyNames
+ + " - the values must be corrected before the configuration can be saved.",
Message.Severity.Error, EnumSet.of(Message.Option.Transient, Message.Option.Sticky));
}
messageCenter.notify(message);
13 years, 8 months
[rhq] Branch 'delete-agent-plugin' - modules/core modules/enterprise
by John Sanda
modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationDefinition.java | 4
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceTypeCriteria.java | 9 +
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java | 76 ++++++----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java | 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java | 6
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java | 2
7 files changed, 70 insertions(+), 33 deletions(-)
New commits:
commit eded9dd4d1657e25f2f661801ecbc2c11b12214d
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Oct 19 21:32:19 2010 -0400
Updating resource type queries to filter on the deleted flag
Since the deleted flag is new, all existing queries need to be updated
to filter on deleted = false.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationDefinition.java
index 6adee0f..59deef4 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationDefinition.java
@@ -65,9 +65,9 @@ import org.jetbrains.annotations.Nullable;
@NamedQuery(name = ConfigurationDefinition.QUERY_FIND_DEPLOYMENT_BY_PACKAGE_TYPE_ID, query = "SELECT cd FROM PackageType pt JOIN pt.deploymentConfigurationDefinition cd "
+ "WHERE pt.id = :packageTypeId"),
@NamedQuery(name = ConfigurationDefinition.QUERY_FIND_RESOURCE_BY_RESOURCE_TYPE_ID, query = "SELECT cd FROM ResourceType rt JOIN rt.resourceConfigurationDefinition cd "
- + "WHERE rt.id = :resourceTypeId"),
+ + "WHERE rt.id = :resourceTypeId AND rt.deleted = false"),
@NamedQuery(name = ConfigurationDefinition.QUERY_FIND_PLUGIN_BY_RESOURCE_TYPE_ID, query = "SELECT cd FROM ResourceType rt JOIN rt.pluginConfigurationDefinition cd "
- + "WHERE rt.id = :resourceTypeId") })
+ + "WHERE rt.id = :resourceTypeId AND rt.deleted = false") })
@SequenceGenerator(name = "SEQ", sequenceName = "RHQ_CONFIG_DEF_ID_SEQ")
@Table(name = "RHQ_CONFIG_DEF")
@XmlSeeAlso( { PropertyDefinitionSimple.class, PropertyDefinitionList.class, PropertyDefinitionMap.class })
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceTypeCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceTypeCriteria.java
index f7435f3..7d88f6b 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceTypeCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceTypeCriteria.java
@@ -55,7 +55,10 @@ public class ResourceTypeCriteria extends Criteria {
private CreateDeletePolicy filterCreateDeletePolicy;
private Boolean filterSupportsManualAdd;
private String filterPluginName; // needs overrides
- private Integer filterBundleTypeId; // needs overrides
+ private Integer filterBundleTypeId; // needs overrides
+ // by default, we don't want to fetch resource types that
+ // are marked deleted
+ private Boolean filterDeleted = false;
private boolean fetchSubCategory;
private boolean fetchChildResourceTypes;
@@ -138,6 +141,10 @@ public class ResourceTypeCriteria extends Criteria {
this.filterBundleTypeId = filterBundleTypeId;
}
+ public void addFilterDeleted(boolean deleted) {
+ this.filterDeleted = deleted;
+ }
+
public void fetchSubCategory(boolean fetchSubCategory) {
this.fetchSubCategory = fetchSubCategory;
}
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
index add1a53..a2ac4e9 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
@@ -79,19 +79,22 @@ import org.rhq.core.domain.util.Summary;
@Table(name = ResourceType.TABLE_NAME)
@SequenceGenerator(name = "SEQ", sequenceName = "RHQ_RESOURCE_TYPE_ID_SEQ")
@NamedQueries( {
- @NamedQuery(name = ResourceType.QUERY_FIND_BY_PLUGIN, query = "SELECT rt FROM ResourceType AS rt WHERE rt.plugin = :plugin"),
+ @NamedQuery(name = ResourceType.QUERY_FIND_BY_PLUGIN, query = "SELECT rt FROM ResourceType AS rt " +
+ "WHERE rt.plugin = :plugin AND rt.deleted = false"),
@NamedQuery(name = ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN, // TODO: QUERY: names are case-sensitive
- query = "SELECT rt FROM ResourceType AS rt WHERE LOWER(rt.name) = LOWER(:name) AND rt.plugin = :plugin"),
- @NamedQuery(name = ResourceType.QUERY_FIND_ALL, query = "SELECT rt FROM ResourceType AS rt"),
+ query = "SELECT rt FROM ResourceType AS rt WHERE LOWER(rt.name) = LOWER(:name) AND rt.plugin = :plugin " +
+ "AND rt.deleted = false"),
+ @NamedQuery(name = ResourceType.QUERY_FIND_ALL, query = "SELECT rt FROM ResourceType AS rt where rt.deleted = false"),
@NamedQuery(name = ResourceType.QUERY_FIND_BY_PARENT_AND_NAME, // TODO: QUERY: Not looking up by the full key, get rid of this query
- query = "SELECT rt FROM ResourceType AS rt WHERE :parent MEMBER OF rt.parentResourceTypes AND rt.name = :name"),
+ query = "SELECT rt FROM ResourceType AS rt WHERE :parent MEMBER OF rt.parentResourceTypes AND rt.name = :name " +
+ "AND rt.deleted = false"),
/* authz'ed queries for ResourceTypeManagerBean */
@NamedQuery(name = ResourceType.QUERY_FIND_CHILDREN, query = "SELECT rt.childResourceTypes "
- + "FROM ResourceType rt WHERE rt.id = :resourceTypeId "),
+ + "FROM ResourceType rt WHERE rt.id = :resourceTypeId AND rt.deleted = false"),
@NamedQuery(name = ResourceType.FIND_CHILDREN_BY_PARENT, query = "SELECT DISTINCT rt FROM ResourceType AS rt "
+ "JOIN FETCH rt.parentResourceTypes AS pa " + // also fetch parents, as we need them later
- "WHERE pa IN (:resourceType)"),
+ "WHERE rt.deleted = false and pa IN (:resourceType)"),
@NamedQuery(name = ResourceType.FIND_ALL_TEMPLATE_COUNT_COMPOSITES, query = "" //
+ "SELECT new org.rhq.core.domain.resource.composite.ResourceTypeTemplateCountComposite" //
+ "(" //
@@ -101,13 +104,14 @@ import org.rhq.core.domain.util.Summary;
+ " (SELECT COUNT(ad) FROM AlertDefinition AS ad WHERE ad.resourceType = rt AND ad.deleted = FALSE AND ad.enabled = TRUE), "//
+ " (SELECT COUNT(ad) FROM AlertDefinition AS ad WHERE ad.resourceType = rt AND ad.deleted = FALSE AND ad.enabled = FALSE) "//
+ ")" //
- + "FROM ResourceType AS rt"),
+ + "FROM ResourceType AS rt WHERE rt.deleted = false"),
@NamedQuery(name = ResourceType.QUERY_FIND_BY_CATEGORY, query = "SELECT rt FROM ResourceType AS rt "
- + "WHERE rt.category = :category"),
+ + "WHERE rt.category = :category and rt.deleted = false"),
@NamedQuery(name = ResourceType.QUERY_FIND_UTILIZED_BY_CATEGORY, query = "SELECT DISTINCT res.resourceType "
+ "FROM Resource res, IN (res.implicitGroups) g, IN (g.roles) r, IN (r.subjects) s " //
+ "WHERE s = :subject " //
+ "AND res.resourceType.category = :category "
+ + "AND res.resourceType.deleted = false "
+ "AND (UPPER(res.name) LIKE :nameFilter ESCAPE :escapeChar OR :nameFilter is null) "
+ "AND (res.resourceType.plugin = :pluginName OR :pluginName is null) "
+ "AND (:inventoryStatus = res.inventoryStatus OR :inventoryStatus is null) "
@@ -116,6 +120,7 @@ import org.rhq.core.domain.util.Summary;
+ "FROM Resource res " //
+ "WHERE res.resourceType.category = :category "
+ "AND (UPPER(res.name) LIKE :nameFilter ESCAPE :escapeChar OR :nameFilter is null) "
+ + "AND res.resourceType.deleted = false "
+ "AND (res.resourceType.plugin = :pluginName OR :pluginName is null) "
+ "AND (:inventoryStatus = res.inventoryStatus OR :inventoryStatus is null) "
+ "ORDER BY res.resourceType.name "),
@@ -124,10 +129,12 @@ import org.rhq.core.domain.util.Summary;
+ "WHERE s = :subject "
+ "AND res.parentResource = :parentResource "
+ "AND res.resourceType.category = :category "
+ + "AND res.resourceType.deleted = false "
+ "AND (:inventoryStatus = res.inventoryStatus OR :inventoryStatus is null) "),
@NamedQuery(name = ResourceType.QUERY_FIND_UTILIZED_CHILDREN_BY_CATEGORY_admin, query = "SELECT DISTINCT res.resourceType "
+ "FROM Resource res "
+ "WHERE res.parentResource = :parentResource "
+ + "AND res.resourceType.deleted = false "
+ "AND res.resourceType.category = :category "
+ "AND (:inventoryStatus = res.inventoryStatus OR :inventoryStatus is null) "),
@NamedQuery(name = ResourceType.QUERY_FIND_BY_RESOURCE_GROUP, query = "" //
@@ -136,26 +143,27 @@ import org.rhq.core.domain.util.Summary;
+ " JOIN rg.resourceType rt" //
+ " JOIN rg.roles r JOIN r.subjects s " //
+ " WHERE s = :subject " //
+ + " AND rt.deleted = false "
+ " AND ( rt.plugin = :pluginName OR :pluginName is null ) "),
@NamedQuery(name = ResourceType.QUERY_FIND_BY_RESOURCE_GROUP_admin, query = "" //
+ "SELECT DISTINCT rt " //
+ " FROM ResourceGroup rg " //
+ " JOIN rg.resourceType rt" //
- + " WHERE ( rt.plugin = :pluginName OR :pluginName is null ) "),
+ + " WHERE rt.deleted = false AND ( rt.plugin = :pluginName OR :pluginName is null ) "),
@NamedQuery(name = ResourceType.QUERY_GET_EXPLICIT_RESOURCE_TYPE_COUNTS_BY_GROUP, query = "SELECT type.id, type.name, COUNT(type.id) "
+ "FROM ResourceGroup rg JOIN rg.explicitResources res JOIN res.resourceType type "
- + "WHERE rg.id = :groupId "
+ + "WHERE rg.id = :groupId AND res.resourceType.deleted = false "
+ "GROUP BY type.id, type.name "),
@NamedQuery(name = ResourceType.QUERY_GET_IMPLICIT_RESOURCE_TYPE_COUNTS_BY_GROUP, query = "SELECT type.id, type.name, COUNT(type.id) "
+ "FROM ResourceGroup rg JOIN rg.implicitResources res JOIN res.resourceType type "
- + "WHERE rg.id = :groupId "
+ + "WHERE rg.id = :groupId AND res.resourceType.deleted = false "
+ "GROUP BY type.id, type.name "),
@NamedQuery(name = ResourceType.QUERY_FIND_BY_SUBCATEGORY, query = "SELECT rt " + "FROM ResourceType rt "
- + "WHERE rt.subCategory = :subCategory"),
+ + "WHERE rt.subCategory = :subCategory AND rt.deleted = false"),
@NamedQuery(name = ResourceType.QUERY_FIND_BY_ID_WITH_ALL_OPERATIONS, query = "SELECT DISTINCT rt "
+ "FROM ResourceType rt " + "LEFT JOIN FETCH rt.operationDefinitions def "
+ "LEFT JOIN FETCH def.parametersConfigurationDefinition "
- + "LEFT JOIN FETCH def.resultsConfigurationDefinition " + "WHERE rt.id = :id"),
+ + "LEFT JOIN FETCH def.resultsConfigurationDefinition " + "WHERE rt.id = :id AND rt.deleted = false"),
@NamedQuery(name = ResourceType.QUERY_FIND_RESOURCE_FACETS, query = "" //
+ "SELECT new org.rhq.core.domain.resource.composite.ResourceFacets " //
+ " ( " //
@@ -170,21 +178,26 @@ import org.rhq.core.domain.util.Summary;
+ " (SELECT COUNT(propDef) FROM rt.pluginConfigurationDefinition pluginConfig JOIN pluginConfig.propertyDefinitions propDef WHERE propDef.name = 'snapshotLogEnabled')" // support
+ " ) " //
+ " FROM ResourceType rt " //
- + " WHERE ( rt.id = :resourceTypeId OR :resourceTypeId IS NULL )"),
+ + " WHERE rt.deleted = false AND ( rt.id = :resourceTypeId OR :resourceTypeId IS NULL )"),
@NamedQuery(name = ResourceType.QUERY_FIND_DUPLICATE_TYPE_NAMES, query = "" //
+ " SELECT rt.name " //
- + " FROM ResourceType rt " //
- + "GROUP BY rt.name " //
+ + " FROM ResourceType rt " //
+ + " WHERE rt.deleted = false "
+ + " GROUP BY rt.name " //
+ " HAVING COUNT(rt.name) > 1"), //
@NamedQuery(name = ResourceType.QUERY_DYNAMIC_CONFIG_WITH_PLUGIN, query = "" //
- + "SELECT rt.plugin || ' - ' || rt.name, rt.plugin || '-' || rt.name FROM ResourceType rt") //
+ + "SELECT rt.plugin || ' - ' || rt.name, rt.plugin || '-' || rt.name FROM ResourceType rt WHERE rt.deleted = false") //
})
@NamedNativeQueries( {
// TODO: Add authz conditions to the below query.
@NamedNativeQuery(name = ResourceType.QUERY_FIND_CHILDREN_BY_CATEGORY, query = "" //
- + "(SELECT crt.id, crt.name, crt.category, crt.creation_data_type, crt.create_delete_policy, crt.singleton, crt.supports_manual_add, crt.description, crt.plugin, crt.ctime, crt.mtime, crt.subcategory_id, crt.plugin_config_def_id, crt.res_config_def_id "
+ + "(SELECT crt.id, crt.name, crt.category, crt.creation_data_type, crt.create_delete_policy, crt.singleton, "
+ + "crt.supports_manual_add, crt.description, crt.plugin, crt.ctime, crt.mtime, crt.subcategory_id, "
+ + "crt.plugin_config_def_id, crt.res_config_def_id, crt.deleted "
+ "FROM RHQ_resource_type crt, RHQ_resource res, RHQ_resource_type rt, RHQ_resource_type_parents rtp "
+ "WHERE res.id = ? "
+ + "AND crt.deleted = false "
+ + "AND rt.deleted = false "
+ "AND res.resource_type_id = rt.id "
+ "AND rt.id = rtp.parent_resource_type_id "
+ "AND rtp.resource_type_id = crt.id "
@@ -192,20 +205,29 @@ import org.rhq.core.domain.util.Summary;
+
// "ORDER BY crt.name " +
"UNION "
- + "SELECT DISTINCT crt2.id, crt2.name, crt2.category, crt2.creation_data_type, crt2.create_delete_policy, crt2.singleton, crt2.supports_manual_add, crt2.description, crt2.plugin, crt2.ctime, crt2.mtime, crt2.subcategory_id, crt2.plugin_config_def_id, crt2.res_config_def_id "
- + "FROM RHQ_resource_type crt2 " + "WHERE 1 = "
+ + "SELECT DISTINCT crt2.id, crt2.name, crt2.category, crt2.creation_data_type, crt2.create_delete_policy, "
+ + "crt2.singleton, crt2.supports_manual_add, crt2.description, crt2.plugin, crt2.ctime, "
+ + "crt2.mtime, crt2.subcategory_id, crt2.plugin_config_def_id, crt2.res_config_def_id, crt2.deleted "
+ + "FROM RHQ_resource_type crt2 " + "WHERE crt2.deleted = false AND 1 = "
+ "(SELECT COUNT(res2.id) "
+ "FROM RHQ_resource res2, RHQ_resource_type rt2 "
+ "WHERE res2.id = ? "
+ + "AND rt2.deleted = false "
+ "AND res2.resource_type_id = rt2.id " + "AND rt2.category = 'PLATFORM') "
+ "AND 0 = "
+ "(SELECT COUNT(rtp2.resource_type_id) "
+ "FROM RHQ_resource_type_parents rtp2 "
- + "WHERE rtp2.resource_type_id = crt2.id) " + "AND crt2.category = ? " + " ) ORDER BY name", resultSetMapping = ResourceType.MAPPING_FIND_CHILDREN_BY_CATEGORY),
+ + "WHERE rtp2.resource_type_id = crt2.id) "
+ + "AND crt2.deleted = false "
+ + "AND crt2.category = ? " + " ) ORDER BY name", resultSetMapping = ResourceType.MAPPING_FIND_CHILDREN_BY_CATEGORY),
@NamedNativeQuery(name = ResourceType.QUERY_FIND_CHILDREN_BY_CATEGORY_admin, query = "" //
- + "(SELECT crt.id, crt.name, crt.category, crt.creation_data_type, crt.create_delete_policy, crt.singleton, crt.supports_manual_add, crt.description, crt.plugin, crt.ctime, crt.mtime, crt.subcategory_id, crt.plugin_config_def_id, crt.res_config_def_id "
+ + "(SELECT crt.id, crt.name, crt.category, crt.creation_data_type, crt.create_delete_policy, crt.singleton, "
+ + "crt.supports_manual_add, crt.description, crt.plugin, crt.ctime, crt.mtime, crt.subcategory_id, "
+ + "crt.plugin_config_def_id, crt.res_config_def_id, crt.deleted "
+ "FROM RHQ_resource_type crt, RHQ_resource res, RHQ_resource_type rt, RHQ_resource_type_parents rtp "
+ "WHERE res.id = ? "
+ + "AND crt.deleted = false "
+ + "AND rt.deleted = false "
+ "AND res.resource_type_id = rt.id "
+ "AND rt.id = rtp.parent_resource_type_id "
+ "AND rtp.resource_type_id = crt.id "
@@ -213,16 +235,20 @@ import org.rhq.core.domain.util.Summary;
+
// "ORDER BY crt.name " +
"UNION "
- + "(SELECT DISTINCT crt2.id, crt2.name, crt2.category, crt2.creation_data_type, crt2.create_delete_policy, crt2.singleton, crt2.supports_manual_add, crt2.description, crt2.plugin, crt2.ctime, crt2.mtime, crt2.subcategory_id, crt2.plugin_config_def_id, crt2.res_config_def_id "
- + "FROM RHQ_resource_type crt2 " + "WHERE 1 = "
+ + "(SELECT DISTINCT crt2.id, crt2.name, crt2.category, crt2.creation_data_type, crt2.create_delete_policy, "
+ + "crt2.singleton, crt2.supports_manual_add, crt2.description, crt2.plugin, crt2.ctime, "
+ + "crt2.mtime, crt2.subcategory_id, crt2.plugin_config_def_id, crt2.res_config_def_id, "
+ + "crt2.deleted "
+ + "FROM RHQ_resource_type crt2 " + "WHERE crt2.deleted = false AND 1 = "
+ "(SELECT COUNT(res2.id) "
+ "FROM RHQ_resource res2, RHQ_resource_type rt2 "
+ "WHERE res2.id = ? "
+ + "AND rt2.deleted = false "
+ "AND res2.resource_type_id = rt2.id " + "AND rt2.category = 'PLATFORM') "
+ "AND 0 = "
+ "(SELECT COUNT(rtp2.resource_type_id) "
+ "FROM RHQ_resource_type_parents rtp2 "
- + "WHERE rtp2.resource_type_id = crt2.id) " + "AND crt2.category = ? " +
+ + "WHERE rtp2.resource_type_id = crt2.id) " + "AND crt2.category = ? AND crt2.deleted = false" +
// "ORDER BY crt2.name" +
")) ORDER BY name", resultSetMapping = ResourceType.MAPPING_FIND_CHILDREN_BY_CATEGORY) //
})
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
index ce31d79..ba27137 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java
@@ -62,7 +62,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ "SELECT DISTINCT type.name " //
+ " FROM ResourceType type, ResourceGroup rg " //
+ " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory
- + " AND rg.visible = true " //
+ + " AND rg.visible = true AND rg.resourceType.deleted = false" //
+ conditionallyAddJPQLString("type.name", filter) //
+ conditionallyAddJPQLString("rg.groupCategory", tab) //
+ conditionallyAddAuthzFragment(getAuthzFragment()) //
@@ -73,7 +73,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant {
+ "SELECT DISTINCT type.plugin " //
+ " FROM ResourceType type, ResourceGroup rg " //
+ " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory
- + " AND rg.visible = true " //
+ + " AND rg.visible = true AND rg.resourceType.deleted = false" //
+ conditionallyAddJPQLString("type.plugin", filter) //
+ conditionallyAddJPQLString("rg.groupCategory", tab) //
+ conditionallyAddAuthzFragment(getAuthzFragment()) //
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
index f315405..35c7d17 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java
@@ -66,6 +66,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceType type, Resource res, PropertyDefinitionSimple simpleDefinition " //"
+ " JOIN type.pluginConfigurationDefinition.propertyDefinitions definition " //
+ " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory
+ + " AND res.resourceType.deleted = false"
+ " AND simpleDefinition = definition " // only suggest names for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types
+ conditionallyAddJPQLString("definition.name", filter) //
@@ -79,6 +80,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
+ " FROM ResourceType type, Resource res, PropertyDefinitionSimple simpleDefinition " //"
+ " JOIN type.resourceConfigurationDefinition.propertyDefinitions definition " //
+ " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory
+ + " AND res.resourceType.deleted = false"
+ " AND simpleDefinition = definition " // only suggest names for simple properties
+ " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types
+ conditionallyAddJPQLString("definition.name", filter) //
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java
index b8ea6ea..731a74d 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java
@@ -47,9 +47,11 @@ public class ResourceGroupTestBean implements ResourceGroupTestBeanLocal {
@SuppressWarnings("unchecked")
public void setupCompatibleGroups() {
- List<ResourceType> types = entityManager.createQuery("SELECT rt FROM ResourceType rt").getResultList();
+ List<ResourceType> types = entityManager
+ .createQuery("SELECT rt FROM ResourceType rt WHERE rt.deleted = false")
+ .getResultList();
for (ResourceType type : types) {
- Query query = entityManager.createQuery("SELECT res FROM Resource res WHERE res.resourceType = :type");
+ Query query = entityManager.createQuery("SELECT res FROM Resource res WHERE res.resourceType = :type AND res.resourceType.deleted = false");
query.setParameter("type", type);
List<Resource> resources = query.getResultList();
ResourceGroup compatGroup = new ResourceGroup("Compat Group - " + getNextCompat(), type);
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java
index ab55bac..f44b9b3 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/BundleManagerBeanTest.java
@@ -245,7 +245,7 @@ public class BundleManagerBeanTest extends UpdateSubsytemTestBase {
}
// remove ResourceTypes which cascade remove BundleTypes
- q = em.createQuery("SELECT rt FROM ResourceType rt WHERE rt.name LIKE '" + TEST_PREFIX + "%'");
+ q = em.createQuery("SELECT rt FROM ResourceType rt WHERE rt.deleted = false and rt.name LIKE '" + TEST_PREFIX + "%'");
doomed = q.getResultList();
for (Object removeMe : doomed) {
em.remove(em.getReference(ResourceType.class, ((ResourceType) removeMe).getId()));
13 years, 8 months
[rhq] modules/enterprise
by ips
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/components/configuration/ConfigurationEditor.java | 209 +++++-----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java | 119 +++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupCompositeDataSource.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestConfigurationFactory.java | 52 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestGroupConfigurationView.java | 139 ++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java | 5
modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css | 4
11 files changed, 384 insertions(+), 157 deletions(-)
New commits:
commit 927bc83226129c29feab114910c9d226bd2e5ddf
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Oct 19 18:55:33 2010 -0400
more work on group config component; add test view for group config (#TestGroupConfig); misc datasource fixes
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 6db7fc8..3888cdc 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
@@ -48,6 +48,7 @@ import org.rhq.enterprise.gui.coregui.client.menu.MenuBarView;
import org.rhq.enterprise.gui.coregui.client.report.ReportTopView;
import org.rhq.enterprise.gui.coregui.client.report.tag.TaggedView;
import org.rhq.enterprise.gui.coregui.client.test.TestConfigurationView;
+import org.rhq.enterprise.gui.coregui.client.test.TestGroupConfigurationView;
import org.rhq.enterprise.gui.coregui.client.util.ErrorHandler;
import org.rhq.enterprise.gui.coregui.client.util.WidgetUtility;
import org.rhq.enterprise.gui.coregui.client.util.message.MessageBar;
@@ -217,6 +218,8 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
canvas = new ReportTopView("Report");
} else if (breadcrumbName.equals(TestConfigurationView.VIEW_ID)) {
canvas = new TestConfigurationView("TestConfig");
+ } else if (breadcrumbName.equals(TestGroupConfigurationView.VIEW_ID)) {
+ canvas = new TestGroupConfigurationView("TestGroupConfig");
} else {
canvas = null;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
index 2cbebe4..df61aaa 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
@@ -128,7 +128,6 @@ import org.rhq.core.domain.configuration.definition.constraint.IntegerRangeConst
import org.rhq.core.domain.configuration.definition.constraint.RegexConstraint;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
-import org.rhq.enterprise.gui.coregui.client.RefreshableView;
import org.rhq.enterprise.gui.coregui.client.components.table.PropertyGrid;
import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -558,20 +557,8 @@ public class ConfigurationEditor extends LocatableVLayout {
Property property,
boolean oddRow,
List<FormItem> fields, final boolean firePropertyChangedEvents) {
- List<FormItem> fieldsForThisProperty = new ArrayList<FormItem>();
+ List<FormItem> fieldsForThisProperty;
- StaticTextItem nameItem = new StaticTextItem();
- nameItem.setStartRow(true);
- String title = "<b>"
- + (propertyDefinition.getDisplayName() != null ? propertyDefinition.getDisplayName() : propertyDefinition
- .getName()) + "</b>";
- nameItem.setValue(title);
- nameItem.setShowTitle(false);
-
- fieldsForThisProperty.add(nameItem);
- fields.add(nameItem);
-
- final FormItem valueItem;
if (propertyDefinition instanceof PropertyDefinitionSimple) {
final PropertyDefinitionSimple propertyDefinitionSimple = (PropertyDefinitionSimple)propertyDefinition;
PropertySimple propertySimple = (PropertySimple)property;
@@ -580,34 +567,8 @@ public class ConfigurationEditor extends LocatableVLayout {
propertySimple = new PropertySimple(propertyDefinitionSimple.getName(), null);
}
- final PropertySimple finalPropertySimple = propertySimple;
- valueItem = buildSimpleField(propertyDefinitionSimple, propertySimple);
- valueItem.addChangedHandler(new ChangedHandler() {
- public void onChanged(ChangedEvent changedEvent) {
- finalPropertySimple.setErrorMessage(null);
- boolean isValid = changedEvent.getItem().validate();
- if (isValid) {
- finalPropertySimple.setValue(changedEvent.getValue());
- }
- if (firePropertyChangedEvents) {
- firePropertyChangedEvent(finalPropertySimple, propertyDefinitionSimple, isValid);
- }
- }
- });
-
- FormItem unsetItem = buildUnsetItem(propertyDefinitionSimple, propertySimple, valueItem);
- fieldsForThisProperty.add(unsetItem);
- fields.add(unsetItem);
-
- fieldsForThisProperty.add(valueItem);
- fields.add(valueItem);
-
- StaticTextItem descriptionItem = new StaticTextItem();
- descriptionItem.setValue(propertyDefinition.getDescription());
- descriptionItem.setShowTitle(false);
- descriptionItem.setEndRow(true);
- fieldsForThisProperty.add(descriptionItem);
- fields.add(descriptionItem);
+ fieldsForThisProperty = buildFieldsForPropertySimple(propertyDefinition, propertyDefinitionSimple,
+ propertySimple);
} else if (propertyDefinition instanceof PropertyDefinitionList) {
PropertyDefinitionList propertyDefinitionList = (PropertyDefinitionList)propertyDefinition;
PropertyDefinition memberDefinition = propertyDefinitionList.getMemberDefinition();
@@ -615,41 +576,9 @@ public class ConfigurationEditor extends LocatableVLayout {
if (propertyList == null) {
propertyList = new PropertyList(propertyDefinitionList.getName());
}
- if (memberDefinition instanceof PropertyDefinitionMap) {
- // List of Maps is a specially supported case with summary fields as columns in a table
- // Note: This field spans 3 columns.
- PropertyDefinitionMap memberDefinitionMap = (PropertyDefinitionMap)memberDefinition;
- CanvasItem listOfMapsItem = buildListOfMapsField(locatorId,
- memberDefinitionMap,
- propertyList, oddRow);
- fieldsForThisProperty.add(listOfMapsItem);
- fields.add(listOfMapsItem);
- } else if (memberDefinition instanceof PropertyDefinitionSimple) {
- SpacerItem unsetItem = new SpacerItem();
- fieldsForThisProperty.add(unsetItem);
- fields.add(unsetItem);
-
- CanvasItem listOfSimplesItem = buildListOfSimplesField(locatorId, propertyDefinitionList, propertyList,
- oddRow);
- fieldsForThisProperty.add(listOfSimplesItem);
- fields.add(listOfSimplesItem);
-
- StaticTextItem descriptionItem = new StaticTextItem();
- descriptionItem.setValue(propertyDefinition.getDescription());
- descriptionItem.setShowTitle(false);
- descriptionItem.setEndRow(true);
- fieldsForThisProperty.add(descriptionItem);
- fields.add(descriptionItem);
- } else {
- Log.error("List " + propertyList + " has unsupported member type: " + memberDefinition);
- Canvas canvas = new Canvas();
- // TODO: Add label with error message to canvas.
- CanvasItem canvasItem = buildComplexPropertyField(canvas);
- canvasItem.setColSpan(3);
- canvasItem.setEndRow(true);
- fieldsForThisProperty.add(canvasItem);
- fields.add(canvasItem);
- }
+ fieldsForThisProperty = buildFieldsForPropertyList(locatorId, propertyDefinition, oddRow,
+ propertyDefinitionList,
+ memberDefinition, propertyList);
} else if (propertyDefinition instanceof PropertyDefinitionMap) {
PropertyDefinitionMap propertyDefinitionMap = (PropertyDefinitionMap)propertyDefinition;
PropertyMap propertyMap = (PropertyMap)property;
@@ -657,18 +586,113 @@ public class ConfigurationEditor extends LocatableVLayout {
propertyMap = new PropertyMap(propertyDefinitionMap.getName());
}
- // Note: This field spans 3 columns.
- FormItem mapField =
- buildMapField(locatorId, propertyDefinitionMap, propertyMap);
- fields.add(mapField);
+ fieldsForThisProperty = buildFieldsForPropertyMap(locatorId, propertyDefinitionMap, propertyMap);
+ } else {
+ throw new IllegalStateException("Property definition null or of unknown type: " + propertyDefinition);
}
- // Set row background color.
+ // Add the fields for this property to the master fields list and set the row background color.
for (FormItem field : fieldsForThisProperty) {
+ fields.add(field);
field.setCellStyle(oddRow ? "OddRow" : "EvenRow");
}
}
+ protected List<FormItem> buildFieldsForPropertySimple(PropertyDefinition propertyDefinition,
+ PropertyDefinitionSimple propertyDefinitionSimple,
+ PropertySimple propertySimple) {
+ List<FormItem> fields = new ArrayList<FormItem>();
+
+ StaticTextItem nameItem = buildNameItem(propertyDefinition);
+ fields.add(nameItem);
+
+ FormItem valueItem;
+ valueItem = buildSimpleField(propertyDefinitionSimple, propertySimple);
+
+ FormItem unsetItem = buildUnsetItem(propertyDefinitionSimple, propertySimple, valueItem);
+ fields.add(unsetItem);
+
+ fields.add(valueItem);
+
+ StaticTextItem descriptionItem = buildDescriptionField(propertyDefinition);
+ fields.add(descriptionItem);
+
+ return fields;
+ }
+
+ protected List<FormItem> buildFieldsForPropertyList(String locatorId, PropertyDefinition propertyDefinition, boolean oddRow,
+ PropertyDefinitionList propertyDefinitionList,
+ PropertyDefinition memberDefinition, PropertyList propertyList) {
+ List<FormItem> fields = new ArrayList<FormItem>();
+
+ StaticTextItem nameItem = buildNameItem(propertyDefinition);
+ fields.add(nameItem);
+
+ if (memberDefinition instanceof PropertyDefinitionMap) {
+ // List of Maps is a specially supported case with summary fields as columns in a table
+ // Note: This field spans 3 columns.
+ PropertyDefinitionMap memberDefinitionMap = (PropertyDefinitionMap)memberDefinition;
+ CanvasItem listOfMapsItem = buildListOfMapsField(locatorId,
+ memberDefinitionMap,
+ propertyList, oddRow);
+ fields.add(listOfMapsItem);
+ } else if (memberDefinition instanceof PropertyDefinitionSimple) {
+ SpacerItem unsetItem = new SpacerItem();
+ fields.add(unsetItem);
+
+ CanvasItem listOfSimplesItem = buildListOfSimplesField(locatorId, propertyDefinitionList, propertyList,
+ oddRow);
+ fields.add(listOfSimplesItem);
+
+ StaticTextItem descriptionItem = buildDescriptionField(propertyDefinition);
+ fields.add(descriptionItem);
+ } else {
+ Log.error("List " + propertyList + " has unsupported member type: " + memberDefinition);
+ Canvas canvas = new Canvas();
+ // TODO: Add label with error message to canvas.
+ CanvasItem canvasItem = buildComplexPropertyField(canvas);
+ canvasItem.setColSpan(3);
+ canvasItem.setEndRow(true);
+ fields.add(canvasItem);
+ }
+
+ return fields;
+ }
+
+ protected List<FormItem> buildFieldsForPropertyMap(String locatorId,
+ PropertyDefinitionMap propertyDefinitionMap, PropertyMap propertyMap) {
+ List<FormItem> fields = new ArrayList<FormItem>();
+
+ StaticTextItem nameItem = buildNameItem(propertyDefinitionMap);
+ fields.add(nameItem);
+
+ // Note: This field spans 3 columns.
+ FormItem mapField =
+ buildMapField(locatorId, propertyDefinitionMap, propertyMap);
+ fields.add(mapField);
+
+ return fields;
+ }
+
+ private StaticTextItem buildNameItem(PropertyDefinition propertyDefinition) {
+ StaticTextItem nameItem = new StaticTextItem();
+ nameItem.setStartRow(true);
+ String title = "<b>"
+ + (propertyDefinition.getDisplayName() != null ? propertyDefinition.getDisplayName() : propertyDefinition
+ .getName()) + "</b>";
+ nameItem.setValue(title);
+ nameItem.setShowTitle(false);
+ return nameItem;
+ }
+
+ private StaticTextItem buildDescriptionField(PropertyDefinition propertyDefinition) {
+ StaticTextItem descriptionItem = new StaticTextItem();
+ descriptionItem.setValue(propertyDefinition.getDescription());
+ descriptionItem.setShowTitle(false);
+ descriptionItem.setEndRow(true);
+ return descriptionItem;
+ }
+
private void firePropertyChangedEvent(Property property,
PropertyDefinition propertyDefinition,
boolean isValid) {
@@ -1300,6 +1324,24 @@ public class ConfigurationEditor extends LocatableVLayout {
valueItem.setShowTitle(false);
valueItem.setWidth(220);
+ // Only update the underlying property when the input is changed if it's a top-level simple or a simple within a
+ // top-level map.
+ PropertyDefinitionMap parentPropertyMapDefinition =
+ propertyDefinitionSimple.getParentPropertyMapDefinition();
+ if (propertyDefinitionSimple.getConfigurationDefinition() != null ||
+ (parentPropertyMapDefinition != null && parentPropertyMapDefinition.getConfigurationDefinition() != null)) {
+ valueItem.addChangedHandler(new ChangedHandler() {
+ public void onChanged(ChangedEvent changedEvent) {
+ propertySimple.setErrorMessage(null);
+ boolean isValid = changedEvent.getItem().validate();
+ if (isValid) {
+ propertySimple.setValue(changedEvent.getValue());
+ }
+ firePropertyChangedEvent(propertySimple, propertyDefinitionSimple, isValid);
+ }
+ });
+ }
+
return valueItem;
}
@@ -1334,11 +1376,10 @@ public class ConfigurationEditor extends LocatableVLayout {
unsetItem.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent changeEvent) {
Boolean isUnset = (Boolean) changeEvent.getValue();
+ valueItem.setDisabled(isUnset);
if (isUnset) {
setValue(valueItem, null);
- valueItem.setDisabled(true);
} else {
- valueItem.setDisabled(false);
valueItem.focusInItem();
}
valueItem.redraw();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java
index de29950..c3ba6cb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/GroupConfigurationEditor.java
@@ -49,7 +49,6 @@ import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
-import org.rhq.enterprise.gui.coregui.client.RefreshableView;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
@@ -60,6 +59,7 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
*/
public class GroupConfigurationEditor extends ConfigurationEditor {
private List<GroupMemberConfiguration> memberConfigurations;
+ private Map<String, FormItem> valueItemNameToStaticItemMap = new HashMap<String, FormItem>();
private Map<String, FormItem> valueItemNameToUnsetItemMap = new HashMap<String, FormItem>();
public GroupConfigurationEditor(String locatorId, ConfigurationDefinition configurationDefinition,
@@ -80,6 +80,34 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
}
@Override
+ protected List<FormItem> buildFieldsForPropertySimple(PropertyDefinition propertyDefinition,
+ PropertyDefinitionSimple propertyDefinitionSimple,
+ PropertySimple propertySimple) {
+ List<FormItem> fields = super.buildFieldsForPropertySimple(propertyDefinition, propertyDefinitionSimple,
+ propertySimple);
+
+ if (isAggregateProperty(propertySimple)) {
+ // Create the "MEMBER VALUES DIFFER" label that is displayed when member values are heterogeneous.
+ final StaticTextItem staticItem = new StaticTextItem();
+ staticItem.setValue("MEMBER VALUES DIFFER");
+ staticItem.setTextBoxStyle("InlineNote");
+ staticItem.setShowTitle(false);
+ staticItem.setTooltip("Member values differ - click icon to edit them.");
+ Boolean isHomogeneous = isHomogeneous(propertySimple);
+ staticItem.setVisible(!isHomogeneous);
+
+ FormItem valueItem = fields.get(2);
+ FormItemIcon icon = buildEditMemberValuesIcon(propertyDefinitionSimple, propertySimple, valueItem);
+ staticItem.setIcons(icon);
+
+ this.valueItemNameToStaticItemMap.put(valueItem.getName(), staticItem);
+ fields.add(3, staticItem);
+ }
+
+ return fields;
+ }
+
+ @Override
protected FormItem buildSimpleField(final PropertyDefinitionSimple propertyDefinitionSimple,
final PropertySimple propertySimple) {
final FormItem item = super.buildSimpleField(propertyDefinitionSimple, propertySimple);
@@ -87,40 +115,55 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
boolean isAggregate = isAggregateProperty(propertySimple);
if (isAggregate) {
// Add the icon that user can click to edit the member values.
- FormItemIcon icon = new FormItemIcon();
- icon.setSrc("[SKIN]/actions/edit.png");
- icon.setName("Edit Member Values");
- icon.setNeverDisable(true);
- icon.addFormItemClickHandler(new FormItemClickHandler() {
- public void onFormItemClick(FormItemIconClickEvent event) {
- // TODO: Pass the actual index, rather than null, if the prop is inside a list.
- displayMemberValuesEditor(extendLocatorId("MemberValuesEditor"), propertyDefinitionSimple,
- propertySimple, null, item);
- }
- });
- // TODO: Figure out a way to add a tooltip to the icon.
- item.setIcons(icon);
+ FormItemIcon icon = buildEditMemberValuesIcon(propertyDefinitionSimple, propertySimple, item);
- if (!isHomogeneous(propertySimple)) {
- updateHeterogeneousValueItem(item);
- }
+ item.setIcons(icon);
item.addChangedHandler(new ChangedHandler() {
public void onChanged(ChangedEvent changedEvent) {
Object value = changedEvent.getValue();
- for (GroupMemberConfiguration memberConfiguration : memberConfigurations) {
- Configuration configuration = memberConfiguration.getConfiguration();
- PropertySimple memberPropertySimple =
- getPropertySimple(configuration, propertyDefinitionSimple, propertySimple, null);
- memberPropertySimple.setValue(value);
- }
+ updateMemberProperties(propertyDefinitionSimple, propertySimple, value);
}
});
+
+ Boolean isHomogeneous = isHomogeneous(propertySimple);
+ item.setVisible(isHomogeneous);
}
return item;
}
+ private FormItemIcon buildEditMemberValuesIcon(final PropertyDefinitionSimple propertyDefinitionSimple,
+ final PropertySimple propertySimple, final FormItem dynamicItem) {
+ FormItemIcon icon = new FormItemIcon();
+
+ icon.setSrc("[SKIN]/actions/edit.png");
+ icon.setName("Edit Member Values");
+ icon.setNeverDisable(true);
+ icon.addFormItemClickHandler(new FormItemClickHandler() {
+ public void onFormItemClick(FormItemIconClickEvent event) {
+ // TODO: Pass the actual index, rather than null, if the prop is inside a list.
+ displayMemberValuesEditor(extendLocatorId("MemberValuesEditor"), propertyDefinitionSimple,
+ propertySimple, null, dynamicItem);
+ }
+ });
+
+ // TODO: Figure out a way to add a tooltip to the icon.
+
+ return icon;
+ }
+
+ private void updateMemberProperties(PropertyDefinitionSimple propertyDefinitionSimple,
+ PropertySimple propertySimple, Object value
+ ) {
+ for (GroupMemberConfiguration memberConfiguration : memberConfigurations) {
+ Configuration configuration = memberConfiguration.getConfiguration();
+ PropertySimple memberPropertySimple =
+ getPropertySimple(configuration, propertyDefinitionSimple, propertySimple, null);
+ memberPropertySimple.setValue(value);
+ }
+ }
+
@Override
protected FormItem buildUnsetItem(final PropertyDefinitionSimple propertyDefinitionSimple, final PropertySimple propertySimple,
final FormItem valueItem) {
@@ -136,8 +179,7 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
private void displayMemberValuesEditor(String locatorId, final PropertyDefinitionSimple propertyDefinitionSimple,
final PropertySimple aggregatePropertySimple,
- Integer index, final FormItem aggregateValueItem
- ) {
+ Integer index, final FormItem aggregateValueItem) {
LocatableVLayout layout = new LocatableVLayout(locatorId);
layout.setHeight100();
@@ -215,31 +257,36 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
memberPropertySimple.setErrorMessage(null);
}
+ FormItem aggregateStaticItem = valueItemNameToStaticItemMap.get(aggregateValueItem.getName());
+
FormItem aggregateUnsetItem = valueItemNameToUnsetItemMap.get(aggregateValueItem.getName());
aggregateUnsetItem.setDisabled(!valuesHomogeneous);
+
if (valuesHomogeneous) {
// Update the value of the aggregate property and set its override flag to true.
aggregatePropertySimple.setValue(firstValue);
aggregatePropertySimple.setOverride(true);
+ aggregateUnsetItem.setValue(firstValue == null);
+
// Set the aggregate value item's value to the homogeneous value, enable it, and make sure it has
// validators set.
- aggregateValueItem.setDisabled(false);
setValue(aggregateValueItem, firstValue);
- aggregateValueItem.setTooltip(null);
- aggregateValueItem.setValidateOnChange(true);
- aggregateValueItem.setValidateOnExit(true);
+ aggregateValueItem.show();
+ aggregateValueItem.setDisabled(false);
+
+ aggregateStaticItem.hide();
- aggregateUnsetItem.setValue(firstValue == null);
} else {
aggregatePropertySimple.setValue(null);
aggregatePropertySimple.setOverride(false);
- updateHeterogeneousValueItem(aggregateValueItem);
+ aggregateValueItem.hide();
- aggregateUnsetItem.setValue((String)null);
+ aggregateStaticItem.show();
}
+ form.markForRedraw();
popup.destroy();
}
});
@@ -270,14 +317,6 @@ public class GroupConfigurationEditor extends ConfigurationEditor {
popup.show();
}
- private void updateHeterogeneousValueItem(FormItem item) {
- item.setDisabled(true);
- item.setValidateOnChange(false);
- item.setValidateOnExit(false);
- item.setValue("MEMBER VALUES DIFFER");
- item.setTooltip("Member values differ - click icon to edit them.");
- }
-
private PropertySimple getPropertySimple(Configuration configuration,
PropertyDefinitionSimple propertyDefinitionSimple,
PropertySimple aggregatePropertySimple, Integer index) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupCompositeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupCompositeDataSource.java
index 6fd1d01..2b5097f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupCompositeDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupCompositeDataSource.java
@@ -157,7 +157,7 @@ public class ResourceGroupCompositeDataSource extends RPCDataSource<ResourceGrou
record.setAttribute("id", from.getResourceGroup().getId());
record.setAttribute("name", from.getResourceGroup().getName());
record.setAttribute("description", from.getResourceGroup().getDescription());
- record.setAttribute("category", from.getResourceGroup().getGroupCategory().toString());
+ record.setAttribute("category", from.getResourceGroup().getGroupCategory());
record.setAttribute("explicitUp", String.valueOf(from.getExplicitUp()));
record.setAttribute("explicitDown", String.valueOf(from.getExplicitDown()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
index 190baf7..e0778bb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
@@ -152,7 +152,7 @@ public class ResourceGroupsDataSource extends RPCDataSource<ResourceGroup> {
record.setAttribute("id", from.getId());
record.setAttribute("name", from.getName());
record.setAttribute("description", from.getDescription());
- record.setAttribute("category", from.getGroupCategory().toString());
+ record.setAttribute("category", from.getGroupCategory());
if (from.getResourceType() != null) {
record.setAttribute("resourceType", from.getResourceType());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
index 59b55e9..be80e8e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java
@@ -40,12 +40,12 @@ public enum ResourceDataSourceField {
AVAILABILITY("currentAvailability", "Availability");
/**
- * Corresponds to a property name of Resource
+ * Corresponds to a property name of Resource (e.g. resourceType.name).
*/
private String propertyName;
/**
- * The display name for the field or property
+ * The table header for the field or property (e.g. Type).
*/
private String title;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
index 2b3a4c2..7759f53 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java
@@ -163,7 +163,7 @@ public class ResourceDatasource extends RPCDataSource<Resource> {
record.setAttribute(DESCRIPTION.propertyName(), from.getDescription());
record.setAttribute(TYPE.propertyName(), from.getResourceType().getId());
record.setAttribute(PLUGIN.propertyName(), from.getResourceType().getPlugin());
- record.setAttribute(CATEGORY.propertyName(), from.getResourceType().getCategory().getDisplayName());
+ record.setAttribute(CATEGORY.propertyName(), from.getResourceType().getCategory());
record.setAttribute("icon", from.getResourceType().getCategory().getDisplayName() + "_"
+ (from.getCurrentAvailability().getAvailabilityType() == AvailabilityType.UP ? "up" : "down") + "_16.png");
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestConfigurationFactory.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestConfigurationFactory.java
index 396f07a..89d7d53 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestConfigurationFactory.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestConfigurationFactory.java
@@ -45,48 +45,48 @@ import org.rhq.core.domain.configuration.definition.PropertySimpleType;
*/
public abstract class TestConfigurationFactory {
public static ConfigurationDefinition createConfigurationDefinition() {
- ConfigurationDefinition configurationDefinition = new ConfigurationDefinition("TestConfig", "a test config");
+ ConfigurationDefinition configDef = new ConfigurationDefinition("TestConfig", "a test config");
ConfigurationTemplate defaultTemplate = new ConfigurationTemplate(ConfigurationTemplate.DEFAULT_TEMPLATE_NAME, "default template");
- configurationDefinition.putTemplate(defaultTemplate);
+ configDef.putTemplate(defaultTemplate);
Configuration defaultConfiguration = new Configuration();
defaultTemplate.setConfiguration(defaultConfiguration);
Map<String, PropertyDefinition> propertyDefinitions = new HashMap<String, PropertyDefinition>();
- configurationDefinition.setPropertyDefinitions(propertyDefinitions);
+ configDef.setPropertyDefinitions(propertyDefinitions);
int orderIndex = 0;
PropertyDefinitionSimple simplePropDef;
simplePropDef = createStringPropDef1();
- addPropertyDefinition(propertyDefinitions, simplePropDef, orderIndex++);
+ addPropertyDefinition(configDef, simplePropDef, orderIndex++);
simplePropDef = createStringPropDef2();
- addPropertyDefinition(propertyDefinitions, simplePropDef, orderIndex++);
+ addPropertyDefinition(configDef, simplePropDef, orderIndex++);
simplePropDef = new PropertyDefinitionSimple("LongString", "a Long String simple prop", false,
PropertySimpleType.LONG_STRING);
simplePropDef.setDisplayName(simplePropDef.getName());
- addPropertyDefinition(propertyDefinitions, simplePropDef, orderIndex++);
+ addPropertyDefinition(configDef, simplePropDef, orderIndex++);
simplePropDef = new PropertyDefinitionSimple("Password", "a Password simple prop", false,
PropertySimpleType.PASSWORD);
simplePropDef.setDisplayName(simplePropDef.getName());
- addPropertyDefinition(propertyDefinitions, simplePropDef, orderIndex++);
+ addPropertyDefinition(configDef, simplePropDef, orderIndex++);
simplePropDef = new PropertyDefinitionSimple("Boolean", "a required Boolean simple prop", true,
PropertySimpleType.BOOLEAN);
simplePropDef.setDisplayName(simplePropDef.getName());
- addPropertyDefinition(propertyDefinitions, simplePropDef, orderIndex++);
+ addPropertyDefinition(configDef, simplePropDef, orderIndex++);
simplePropDef.setRequired(true);
simplePropDef = createIntegerPropDef();
- addPropertyDefinition(propertyDefinitions, simplePropDef, orderIndex++);
+ addPropertyDefinition(configDef, simplePropDef, orderIndex++);
simplePropDef = new PropertyDefinitionSimple("Float", "a Float simple prop", false, PropertySimpleType.FLOAT);
simplePropDef.setDisplayName(simplePropDef.getName());
- addPropertyDefinition(propertyDefinitions, simplePropDef, orderIndex++);
+ addPropertyDefinition(configDef, simplePropDef, orderIndex++);
simplePropDef = new PropertyDefinitionSimple("StringEnum1",
"a String enum prop with <=5 items - should be rendered as radio buttons", false,
@@ -98,7 +98,7 @@ public abstract class TestConfigurationFactory {
propDefEnums.add(new PropertyDefinitionEnumeration("NJ", "NJ"));
propDefEnums.add(new PropertyDefinitionEnumeration("PA", "PA"));
simplePropDef.setEnumeratedValues(propDefEnums, false);
- addPropertyDefinition(propertyDefinitions, simplePropDef, orderIndex++);
+ addPropertyDefinition(configDef, simplePropDef, orderIndex++);
simplePropDef = new PropertyDefinitionSimple("StringEnum2",
"a String enum prop with >5 items - should be rendered as a popup menu", false, PropertySimpleType.STRING);
@@ -112,31 +112,31 @@ public abstract class TestConfigurationFactory {
propDefEnums.add(new PropertyDefinitionEnumeration("blue", "blue"));
propDefEnums.add(new PropertyDefinitionEnumeration("purple", "purple"));
simplePropDef.setEnumeratedValues(propDefEnums, false);
- addPropertyDefinition(propertyDefinitions, simplePropDef, orderIndex++);
+ addPropertyDefinition(configDef, simplePropDef, orderIndex++);
PropertyDefinitionMap mapPropDef = new PropertyDefinitionMap("MapOfSimples", "a map of simples", false);
mapPropDef.put(createStringPropDef1());
mapPropDef.put(createStringPropDef2());
mapPropDef.put(createIntegerPropDef());
mapPropDef.setDisplayName(mapPropDef.getName());
- addPropertyDefinition(propertyDefinitions, mapPropDef, orderIndex++);
+ addPropertyDefinition(configDef, mapPropDef, orderIndex++);
PropertyDefinitionMap openMapPropDef = new PropertyDefinitionMap("OpenMapOfSimples", "an open map of simples",
false);
openMapPropDef.setDisplayName(openMapPropDef.getName());
- addPropertyDefinition(propertyDefinitions, openMapPropDef, orderIndex++);
+ addPropertyDefinition(configDef, openMapPropDef, orderIndex++);
PropertyDefinitionMap readOnlyOpenMapPropDef = new PropertyDefinitionMap("ReadOnlyOpenMapOfSimples",
"a read-only open map of simples", false);
readOnlyOpenMapPropDef.setDisplayName(readOnlyOpenMapPropDef.getName());
readOnlyOpenMapPropDef.setReadOnly(true);
- addPropertyDefinition(propertyDefinitions, readOnlyOpenMapPropDef, orderIndex++);
+ addPropertyDefinition(configDef, readOnlyOpenMapPropDef, orderIndex++);
PropertyDefinitionList listOfSimplesPropDef = new PropertyDefinitionList("ListOfSimples",
"a list of Integer simples", true, new PropertyDefinitionSimple("integer", "an integer", false,
PropertySimpleType.INTEGER));
listOfSimplesPropDef.setDisplayName(listOfSimplesPropDef.getName());
- addPropertyDefinition(propertyDefinitions, listOfSimplesPropDef, orderIndex++);
+ addPropertyDefinition(configDef, listOfSimplesPropDef, orderIndex++);
PropertyDefinitionMap mapInListPropDef =
new PropertyDefinitionMap("MapOfSimplesInList", "a map of simples in a list", false);
@@ -148,7 +148,7 @@ public abstract class TestConfigurationFactory {
PropertyDefinitionList listPropDef = new PropertyDefinitionList("ListOfMaps", "a list of maps", true,
mapInListPropDef);
listPropDef.setDisplayName(listPropDef.getName());
- addPropertyDefinition(propertyDefinitions, listPropDef, orderIndex++);
+ addPropertyDefinition(configDef, listPropDef, orderIndex++);
PropertyDefinitionMap mapInReadOnlyListPropDef =
new PropertyDefinitionMap("MapOfSimplesInReadOnlyList", "a map of simples in a list", false);
@@ -161,7 +161,7 @@ public abstract class TestConfigurationFactory {
"a read-only list of maps", true, mapInReadOnlyListPropDef);
readOnlyListPropDef.setDisplayName(readOnlyListPropDef.getName());
readOnlyListPropDef.setReadOnly(true);
- addPropertyDefinition(propertyDefinitions, readOnlyListPropDef, orderIndex++);
+ addPropertyDefinition(configDef, readOnlyListPropDef, orderIndex++);
PropertyGroupDefinition propertyGroupDefinition = new PropertyGroupDefinition("myGroup");
propertyGroupDefinition.setDisplayName(propertyGroupDefinition.getName());
@@ -171,14 +171,14 @@ public abstract class TestConfigurationFactory {
PropertySimpleType.STRING);
myString.setDisplayName(myString.getName());
myString.setSummary(true);
- addPropertyDefinition(propertyDefinitions, myString, orderIndex++);
+ addPropertyDefinition(configDef, myString, orderIndex++);
myString.setPropertyGroupDefinition(propertyGroupDefinition);
PropertyDefinitionSimple myString2 = new PropertyDefinitionSimple("myString2", "my other little string", true,
PropertySimpleType.STRING);
myString2.setDisplayName(myString2.getName());
myString2.setSummary(true);
- addPropertyDefinition(propertyDefinitions, myString2, orderIndex++);
+ addPropertyDefinition(configDef, myString2, orderIndex++);
myString2.setPropertyGroupDefinition(propertyGroupDefinition);
PropertyGroupDefinition propertyGroupDefinition2 = new PropertyGroupDefinition("myGroup2");
@@ -189,7 +189,7 @@ public abstract class TestConfigurationFactory {
PropertySimpleType.STRING);
myString3.setDisplayName((myString3.getName()));
myString3.setSummary(true);
- addPropertyDefinition(propertyDefinitions, myString3, orderIndex++);
+ addPropertyDefinition(configDef, myString3, orderIndex++);
myString3.setPropertyGroupDefinition(propertyGroupDefinition2);
PropertyDefinitionSimple enumExample = new PropertyDefinitionSimple("myEnum",
@@ -201,16 +201,16 @@ public abstract class TestConfigurationFactory {
myEnums.add(new PropertyDefinitionEnumeration("Camden", "Camden"));
myEnums.add(new PropertyDefinitionEnumeration("Gloucester", "Gloucester"));
enumExample.setEnumeratedValues(myEnums, false);
- addPropertyDefinition(propertyDefinitions, enumExample, orderIndex++);
+ addPropertyDefinition(configDef, enumExample, orderIndex++);
enumExample.setPropertyGroupDefinition(propertyGroupDefinition2);
- return configurationDefinition;
+ return configDef;
}
- private static void addPropertyDefinition(Map<String, PropertyDefinition> propertyDefinitions,
- PropertyDefinition propDef, int orderIndex) {
+ private static void addPropertyDefinition(ConfigurationDefinition configDef,
+ PropertyDefinition propDef, int orderIndex) {
propDef.setOrder(orderIndex);
- propertyDefinitions.put(propDef.getName(), propDef);
+ configDef.put(propDef);
}
public static Configuration createConfiguration() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestGroupConfigurationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestGroupConfigurationView.java
new file mode 100644
index 0000000..7d71c02
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestGroupConfigurationView.java
@@ -0,0 +1,139 @@
+/*
+ * RHQ Management Platform
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * 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.coregui.client.test;
+
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.List;
+
+import com.smartgwt.client.types.Overflow;
+import com.smartgwt.client.widgets.events.ClickEvent;
+import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.layout.LayoutSpacer;
+import com.smartgwt.client.widgets.toolbar.ToolStrip;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor;
+import org.rhq.enterprise.gui.coregui.client.components.configuration.GroupConfigurationEditor;
+import org.rhq.enterprise.gui.coregui.client.components.configuration.GroupMemberConfiguration;
+import org.rhq.enterprise.gui.coregui.client.components.configuration.PropertyValueChangeEvent;
+import org.rhq.enterprise.gui.coregui.client.components.configuration.PropertyValueChangeListener;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import org.rhq.enterprise.gui.coregui.client.util.message.MessageCenter;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+
+/**
+ * @author Ian Springer
+ */
+public class TestGroupConfigurationView
+ extends LocatableVLayout implements PropertyValueChangeListener {
+ public static final String VIEW_ID = "TestGroupConfig";
+
+ private static final int GROUP_SIZE = 2;
+
+ private ConfigurationEditor editor;
+ private LocatableIButton saveButton;
+ private ConfigurationDefinition configurationDefinition;
+ private List<GroupMemberConfiguration> memberConfigurations;
+
+ public TestGroupConfigurationView(String locatorId) {
+ super(locatorId);
+ }
+
+ @Override
+ protected void onDraw() {
+ super.onDraw();
+
+ setWidth100();
+ setHeight100();
+
+ ToolStrip toolStrip = new ToolStrip();
+ toolStrip.setWidth100();
+
+ toolStrip.addMember(new LayoutSpacer());
+
+ this.saveButton = new LocatableIButton(this.extendLocatorId("Save"), "Save");
+ this.saveButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent clickEvent) {
+ save();
+ }
+ });
+ this.saveButton.disable();
+ toolStrip.addMember(this.saveButton);
+
+ addMember(toolStrip);
+
+ this.configurationDefinition = TestConfigurationFactory.createConfigurationDefinition();
+ this.memberConfigurations = new ArrayList<GroupMemberConfiguration>(GROUP_SIZE);
+ for (int i = 0; i < GROUP_SIZE; i++) {
+ Configuration configuration = TestConfigurationFactory.createConfiguration();
+ GroupMemberConfiguration memberConfiguration = new GroupMemberConfiguration(i, "Member #" + i,
+ configuration);
+ this.memberConfigurations.add(memberConfiguration);
+ }
+
+ reloadConfiguration();
+ }
+
+ @Override
+ public void propertyValueChanged(PropertyValueChangeEvent event) {
+ MessageCenter messageCenter = CoreGUI.getMessageCenter();
+ Message message;
+ if (event.isValidationStateChanged()) {
+ if (event.getInvalidPropertyNames().isEmpty()) {
+ this.saveButton.enable();
+ message = new Message("All properties now have valid values, so the configuration can now be saved.",
+ Message.Severity.Info, EnumSet.of(Message.Option.Transient));
+ }
+ else {
+ this.saveButton.disable();
+ message = new Message(
+ "One or more properties have invalid values. The values must be corrected before the configuration can be saved.",
+ Message.Severity.Error, EnumSet.of(Message.Option.Transient, Message.Option.Sticky));
+ }
+ messageCenter.notify(message);
+ } else {
+ this.saveButton.enable();
+ }
+ }
+
+ private void reloadConfiguration() {
+ this.saveButton.disable();
+ if (editor != null) {
+ editor.destroy();
+ removeMember(editor);
+ }
+
+ editor = new GroupConfigurationEditor(extendLocatorId("Editor"), this.configurationDefinition,
+ this.memberConfigurations);
+ editor.setOverflow(Overflow.AUTO);
+ editor.addPropertyValueChangeListener(this);
+ addMember(editor);
+ }
+
+ private void save() {
+ CoreGUI.getMessageCenter().notify(
+ new Message("Member configurations updated.", "Member configurations updated."));
+ reloadConfiguration();
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
index 3314eeb..ce0ce25 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
@@ -24,6 +24,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
+import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.JavaScriptObject;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.DSRequest;
@@ -328,7 +329,7 @@ public abstract class RPCDataSource<T> extends DataSource {
@SuppressWarnings("unchecked")
public static <S> S getFilter(DSRequest request, String paramName, Class<S> type) {
- com.allen_sauer.gwt.log.client.Log.debug("Fetching " + paramName + " (" + type + ")");
+ Log.debug("Fetching " + paramName + " (" + type + ")");
Criteria criteria = request.getCriteria();
Map<String, Object> criteriaMap = criteria.getValues();
@@ -350,7 +351,7 @@ public abstract class RPCDataSource<T> extends DataSource {
}
}
- com.allen_sauer.gwt.log.client.Log.debug("Result = " + result);
+ Log.debug("Result = " + result);
return result;
}
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
index 54cc3a9..d60a616 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css
@@ -386,6 +386,10 @@ a:hover {
border-color: #EE1111; /* slightly darker medium red */
}
+.InlineNote {
+ color: #511;
+}
+
.log-panel {
z-index: 9999999 !important;
}
13 years, 8 months
[rhq] modules/enterprise
by Joseph Marques
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java | 15 ++++++----
1 file changed, 9 insertions(+), 6 deletions(-)
New commits:
commit 3cdfaed39fe6197cc4a825ba1c9adcb9c3f1892d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Oct 19 16:47:59 2010 -0400
use the correct cased name of the GroupCategory for filtering groups in the inventory borwser
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
index a1683dc..fcef030 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
@@ -39,6 +39,7 @@ import com.smartgwt.client.widgets.tree.TreeNode;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.core.domain.resource.group.GroupCategory;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ViewId;
@@ -138,7 +139,7 @@ public class InventoryView extends LocatableHLayout implements BookmarkableView
treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
public void onSelectionChanged(SelectionEvent selectionEvent) {
if (selectionEvent.getState()) {
- TreeNode node = (TreeNode)selectionEvent.getRecord();
+ TreeNode node = (TreeNode) selectionEvent.getRecord();
String pageName = node.getName();
String viewPath = InventoryView.VIEW_ID + "/" + sectionName + "/" + pageName;
String currentViewPath = History.getToken();
@@ -170,7 +171,8 @@ public class InventoryView extends LocatableHLayout implements BookmarkableView
final TreeNode onlyServices = new EnhancedTreeNode(PAGE_SERVICES);
onlyServices.setIcon("types/Service_up_16.png");
- final TreeNode inventory = new EnhancedTreeNode(SUBSECTION_RESOURCE_INVENTORY, onlyPlatforms, onlyServers, onlyServices);
+ final TreeNode inventory = new EnhancedTreeNode(SUBSECTION_RESOURCE_INVENTORY, onlyPlatforms, onlyServers,
+ onlyServices);
final TreeNode downServers = new EnhancedTreeNode(PAGE_DOWN);
downServers.setIcon("types/Server_down_16.png");
@@ -209,7 +211,8 @@ public class InventoryView extends LocatableHLayout implements BookmarkableView
TreeGrid treeGrid = new LocatableTreeGrid(GROUPS_SECTION_VIEW_ID);
treeGrid.setShowHeader(false);
Tree tree = new Tree();
- TreeNode rootNode = new EnhancedTreeNode(GROUPS_SECTION_VIEW_ID, groupGroupDefinitions, inventory, savedSearches);
+ TreeNode rootNode = new EnhancedTreeNode(GROUPS_SECTION_VIEW_ID, groupGroupDefinitions, inventory,
+ savedSearches);
tree.setRoot(rootNode);
treeGrid.setData(tree);
@@ -263,10 +266,10 @@ public class InventoryView extends LocatableHLayout implements BookmarkableView
} else if (GROUPS_SECTION_VIEW_ID.equals(sectionName)) {
if (PAGE_COMPATIBLE_GROUPS.equals(pageName)) {
content = new ResourceGroupListView(extendLocatorId("Compatible"), new Criteria("category",
- "compatible"), PAGE_COMPATIBLE_GROUPS, "types/Cluster_up_24.png");
+ GroupCategory.COMPATIBLE.name()), PAGE_COMPATIBLE_GROUPS, "types/Cluster_up_24.png");
} else if (PAGE_MIXED_GROUPS.equals(pageName)) {
- content = new ResourceGroupListView(extendLocatorId("Mixed"), new Criteria("category", "mixed"),
- PAGE_MIXED_GROUPS, "types/Group_up_24.png");
+ content = new ResourceGroupListView(extendLocatorId("Mixed"), new Criteria("category",
+ GroupCategory.MIXED.name()), PAGE_MIXED_GROUPS, "types/Group_up_24.png");
} else if (PAGE_GROUP_DEFINITIONS.equals(pageName)) {
content = new GroupDefinitionListView(extendLocatorId("Definitions"), "types/GroupDefinition_16.png");
} else if (PAGE_PROBLEM_GROUPS.equals(pageName)) {
13 years, 8 months
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit fec18e5250c61671c12ac0ec80bf617c06c489f1
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Oct 19 15:46:56 2010 -0400
use locatable
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java
index 5cf3937..47a97c9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDetailsView.java
@@ -34,7 +34,6 @@ import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.tab.Tab;
import com.smartgwt.client.widgets.tab.TabSet;
@@ -47,23 +46,26 @@ import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
* @author Joseph Marques
+ * @author Ian Springer
*/
-public class AlertDetailsView extends VLayout implements BookmarkableView {
+public class AlertDetailsView extends LocatableVLayout implements BookmarkableView {
private int alertId;
private ViewId viewId;
- private static AlertDetailsView INSTANCE = new AlertDetailsView();
+ private static AlertDetailsView INSTANCE = new AlertDetailsView("alertDetailsView");
public static AlertDetailsView getInstance() {
return INSTANCE;
}
- private AlertDetailsView() {
+ private AlertDetailsView(String locatorId) {
// access through the static singleton only
+ super(locatorId);
}
private void show(int alertId) {
13 years, 8 months
[rhq] .classpath
by mazz
.classpath | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 29d5db075f19213dc2536e1ba19ba7769a23de44
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Oct 19 15:25:44 2010 -0400
adding new dependencies to eclipse classpath so we can build again in eclipse
diff --git a/.classpath b/.classpath
index 7d1cd22..ecbd0c8 100644
--- a/.classpath
+++ b/.classpath
@@ -143,6 +143,7 @@
<classpathentry kind="src" path="modules/helpers/rtfilter/src/main/java"/>
<classpathentry kind="src" path="modules/helpers/pluginAnnotations/src/main/java"/>
<classpathentry kind="src" path="modules/helpers/pluginGen/src/main/java"/>
+ <classpathentry kind="src" path="modules/helpers/perftest-support/src/main/java"/>
<classpathentry kind="src" path="etc/samples/skeleton-plugin/src/main/java"/>
<classpathentry kind="src" path="etc/samples/custom-serverplugin/src/main/java"/>
<classpathentry kind="src" path="etc/samples/simplereport-serverplugin/src/main/java"/>
@@ -171,7 +172,7 @@
<classpathentry exported="true" kind="var" path="M2_REPO/struts/struts/1.2.9/struts-1.2.9.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/javax/servlet/jsp-api/2.0/jsp-api-2.0.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/commons-validator/commons-validator/1.1.4/commons-validator-1.1.4.jar"/>
- <classpathentry exported="true" kind="var" path="M2_REPO/org/testng/testng/5.9/testng-5.9-jdk15.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/org/testng/testng/5.13.1/testng-5.13.1.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/snmp4j/snmp4j/1.8.2/snmp4j-1.8.2.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/tomcat/tomcat-jk/4.1.31/tomcat-jk-4.1.31.jar"/>
@@ -256,5 +257,8 @@
<classpathentry exported="true" kind="var" path="M2_REPO/ca/nanometrics/gflot/1.0.0/gflot-1.0.0.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/com/jcraft/jsch/0.1.29/jsch-0.1.29.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/org/dbunit/dbunit/2.4.8/dbunit-2.4.8.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/org/apache/poi/poi/3.6/poi-3.6.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/bsh/bsh/1.3.0/bsh-1.3.0.jar"/>
<classpathentry kind="output" path="eclipse-classes"/>
</classpath>
13 years, 8 months
[rhq] Branch 'delete-agent-plugin' - modules/core
by John Sanda
modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml | 2 +-
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 501e5d1c1bc27399c5c46a9778829bd927925ed5
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Oct 19 14:05:56 2010 -0400
making deleted column not nullable
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
index 1644849..a181d83 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
@@ -17,7 +17,7 @@
<column name="PLUGIN" type="VARCHAR2" size="100"/>
<column name="CTIME" type="LONG"/>
<column name="MTIME" type="LONG"/>
- <column name="DELETED" type="BOOLEAN" default="FALSE"/>
+ <column name="DELETED" type="BOOLEAN" default="FALSE" required="TRUE"/>
<column name="SUBCATEGORY_ID" type="INTEGER"/>
<!--
TODO add support to DB setup for tables with circular dependencies and then add back this RI
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 4b4c6a0..69d7e3c 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3263,6 +3263,7 @@
SET DELETED = false
</statement>
</schema-directSQL>
+ <schema-alterColumn table="RHQ_RESOURCE_TYPE" column="DELETED" nullable="FALSE" />
</schemaSpec>
</dbupgrade>
</target>
13 years, 8 months
[rhq] 2 commits - modules/core
by John Sanda
modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml | 2 +-
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
New commits:
commit f167d3614e58cc62e02de088b1d3dcaae7a3a19a
Merge: 0f62ed4... 501e5d1...
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Oct 19 14:07:04 2010 -0400
Merge branch 'delete-agent-plugin'
commit 501e5d1c1bc27399c5c46a9778829bd927925ed5
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Oct 19 14:05:56 2010 -0400
making deleted column not nullable
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
index 1644849..a181d83 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
@@ -17,7 +17,7 @@
<column name="PLUGIN" type="VARCHAR2" size="100"/>
<column name="CTIME" type="LONG"/>
<column name="MTIME" type="LONG"/>
- <column name="DELETED" type="BOOLEAN" default="FALSE"/>
+ <column name="DELETED" type="BOOLEAN" default="FALSE" required="TRUE"/>
<column name="SUBCATEGORY_ID" type="INTEGER"/>
<!--
TODO add support to DB setup for tables with circular dependencies and then add back this RI
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 4b4c6a0..69d7e3c 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3263,6 +3263,7 @@
SET DELETED = false
</statement>
</schema-directSQL>
+ <schema-alterColumn table="RHQ_RESOURCE_TYPE" column="DELETED" nullable="FALSE" />
</schemaSpec>
</dbupgrade>
</target>
13 years, 8 months
[rhq] 5 commits - modules/core
by John Sanda
modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/measurement/MeasurementAgentService.java | 6 +----
modules/core/dbutils/pom.xml | 2 -
modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml | 1
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 10 +++++++++
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java | 11 ++++++++++
5 files changed, 25 insertions(+), 5 deletions(-)
New commits:
commit 0f62ed4950ae6f39a9905ba614ad2bba8ea3c44b
Merge: e60ff62... 81d68da...
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Oct 19 13:16:52 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit e60ff628d63a550a7ef0362cd4859c7b6d78b4c4
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Oct 19 13:04:46 2010 -0400
Adding deleted flag to ResourceType
This commit also included the dbsetup/dbupgrade changes. The deleted
flag will be set to indicate that a ResourceType will be deleted.
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 379c31f..8f393cc 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -22,7 +22,7 @@
<properties>
<scm.module.path>modules/core/dbutils/</scm.module.path>
- <db.schema.version>2.100</db.schema.version>
+ <db.schema.version>2.101</db.schema.version>
</properties>
<dependencies>
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
index 48f9f2a..1644849 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
@@ -17,6 +17,7 @@
<column name="PLUGIN" type="VARCHAR2" size="100"/>
<column name="CTIME" type="LONG"/>
<column name="MTIME" type="LONG"/>
+ <column name="DELETED" type="BOOLEAN" default="FALSE"/>
<column name="SUBCATEGORY_ID" type="INTEGER"/>
<!--
TODO add support to DB setup for tables with circular dependencies and then add back this RI
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index b462cfa..4b4c6a0 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3254,6 +3254,16 @@
<!-- location was only exposed in the struts-based UI, so it hasn't been seen in years anyway -->
<schema-deleteColumn table="RHQ_RESOURCE_GROUP" column="LOCATION" />
</schemaSpec>
+
+ <schemaSpec version="2.101">
+ <schema-addColumn table="RHQ_RESOURCE_TYPE" column="DELETED" columnType="BOOLEAN"/>
+ <schema-directSQL>
+ <statement desc="Set deleted flag for existing resources types to false">
+ UPDATE RHQ_RESOURCE_TYPE
+ SET DELETED = false
+ </statement>
+ </schema-directSQL>
+ </schemaSpec>
</dbupgrade>
</target>
</project>
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
index 19cdd11..add1a53 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
@@ -307,6 +307,9 @@ public class ResourceType implements Serializable, Comparable<ResourceType> {
@Column(name = "MTIME")
private Long mtime;
+ @Column(name = "DELETED")
+ private boolean deleted;
+
@ManyToMany(mappedBy = "parentResourceTypes", cascade = { CascadeType.REFRESH })
@OrderBy
//@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
@@ -534,6 +537,14 @@ public class ResourceType implements Serializable, Comparable<ResourceType> {
return this.mtime;
}
+ public boolean isDeleted() {
+ return deleted;
+ }
+
+ public void setDeleted(boolean deleted) {
+ this.deleted = deleted;
+ }
+
@PreUpdate
void onUpdate() {
this.mtime = System.currentTimeMillis();
commit 1b5f9f9975a41f056db0c77639bd5563148b56d7
Merge: fba8b55... 06382be...
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Oct 19 11:09:16 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit fba8b55540b9624ef53d3d6f14ffe2cd333deeba
Merge: 9690d71... a6d0d0b...
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Oct 18 10:26:51 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 9690d71a55f959b95ab6859b39d641ec0d3f4a4b
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Oct 12 17:48:48 2010 -0400
Updating javadocs
diff --git a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/measurement/MeasurementAgentService.java b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/measurement/MeasurementAgentService.java
index 786e60f..dba93fc 100644
--- a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/measurement/MeasurementAgentService.java
+++ b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/measurement/MeasurementAgentService.java
@@ -70,10 +70,8 @@ public interface MeasurementAgentService {
* <p>Measurement data collected via this call will have its non-persistent "name" field set the name of the
* measurement, but will not have scheduleIds set.</p>
*
- * @param resourceId id of resource to collect from
- * @param dataType the data type of the of the metrics to be collected - either
- * {@link DataType#MEASUREMENT} or {@link DataType#TRAIT}
- * @param measurementNames the names of the numeric metrics or traits to be collected
+ * @param resourceId id of resource to collect from
+ * @param requests Each request specifies a metric to be collected along with its corresponding data type
* @return the set of collected measurements with their data values collected
*/
Set<MeasurementData> getRealTimeMeasurementValue(int resourceId, List<MeasurementDataRequest> requests);
13 years, 8 months
[rhq] Branch 'delete-agent-plugin' - modules/core
by John Sanda
modules/core/dbutils/pom.xml | 2 -
modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml | 1
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 10 +++++++++
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java | 11 ++++++++++
4 files changed, 23 insertions(+), 1 deletion(-)
New commits:
commit e60ff628d63a550a7ef0362cd4859c7b6d78b4c4
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Oct 19 13:04:46 2010 -0400
Adding deleted flag to ResourceType
This commit also included the dbsetup/dbupgrade changes. The deleted
flag will be set to indicate that a ResourceType will be deleted.
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 379c31f..8f393cc 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -22,7 +22,7 @@
<properties>
<scm.module.path>modules/core/dbutils/</scm.module.path>
- <db.schema.version>2.100</db.schema.version>
+ <db.schema.version>2.101</db.schema.version>
</properties>
<dependencies>
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
index 48f9f2a..1644849 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml
@@ -17,6 +17,7 @@
<column name="PLUGIN" type="VARCHAR2" size="100"/>
<column name="CTIME" type="LONG"/>
<column name="MTIME" type="LONG"/>
+ <column name="DELETED" type="BOOLEAN" default="FALSE"/>
<column name="SUBCATEGORY_ID" type="INTEGER"/>
<!--
TODO add support to DB setup for tables with circular dependencies and then add back this RI
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index b462cfa..4b4c6a0 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3254,6 +3254,16 @@
<!-- location was only exposed in the struts-based UI, so it hasn't been seen in years anyway -->
<schema-deleteColumn table="RHQ_RESOURCE_GROUP" column="LOCATION" />
</schemaSpec>
+
+ <schemaSpec version="2.101">
+ <schema-addColumn table="RHQ_RESOURCE_TYPE" column="DELETED" columnType="BOOLEAN"/>
+ <schema-directSQL>
+ <statement desc="Set deleted flag for existing resources types to false">
+ UPDATE RHQ_RESOURCE_TYPE
+ SET DELETED = false
+ </statement>
+ </schema-directSQL>
+ </schemaSpec>
</dbupgrade>
</target>
</project>
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
index 19cdd11..add1a53 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
@@ -307,6 +307,9 @@ public class ResourceType implements Serializable, Comparable<ResourceType> {
@Column(name = "MTIME")
private Long mtime;
+ @Column(name = "DELETED")
+ private boolean deleted;
+
@ManyToMany(mappedBy = "parentResourceTypes", cascade = { CascadeType.REFRESH })
@OrderBy
//@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
@@ -534,6 +537,14 @@ public class ResourceType implements Serializable, Comparable<ResourceType> {
return this.mtime;
}
+ public boolean isDeleted() {
+ return deleted;
+ }
+
+ public void setDeleted(boolean deleted) {
+ this.deleted = deleted;
+ }
+
@PreUpdate
void onUpdate() {
this.mtime = System.currentTimeMillis();
13 years, 8 months