modules/core/dbutils/pom.xml
| 2
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
| 29 +++++++++-
modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionList.java
| 17 ++++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
| 24 +++++---
4 files changed, 59 insertions(+), 13 deletions(-)
New commits:
commit 93f6c9a1ede148ab63194041e27d93d44287de75
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Sep 27 16:23:51 2012 -0500
[BZ 861127 - Upgrade issue with respect to min/max property attributes] - Needed to
upgrade existing nulls to 0 for new min/max columns.
(cherry picked from commit 8b08fce535742c6bd7f24d3ab0d8c7d626fe7923)
(cherry picked from commit a751296dc9409ddb9c5e98191c1659f12d763f6d)
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index e3de4f2..107d490 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -17,7 +17,7 @@
<description>Database schema setup, upgrade and other
utilities</description>
<properties>
- <db.schema.version>2.123</db.schema.version>
+ <db.schema.version>2.124</db.schema.version>
<rhq.ds.type-mapping>${rhq.test.ds.type-mapping}</rhq.ds.type-mapping>
<rhq.ds.server-name>${rhq.test.ds.server-name}</rhq.ds.server-name>
<rhq.ds.db-name>${rhq.test.ds.db-name}</rhq.ds.db-name>
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 1443b80..ad4b851 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -4013,7 +4013,7 @@
<schema-directSQL>
<statement desc="Updating DOWN Alert Conditions to new
format">
UPDATE RHQ_ALERT_CONDITION
- SET NAME = 'AVAIL_GOES_DOWN', OPTION_STATUS = NULL
+ SET NAME = 'AVAIL_GOES_DOWN', OPTION_STATUS = NULL
WHERE TYPE = 'AVAILABILITY'
AND NAME IS NULL
AND OPTION_STATUS = 'DOWN'
@@ -4033,6 +4033,33 @@
<schemaSpec version="2.123">
<schema-addColumn table="RHQ_CONFIG_PROP_DEF"
column="MIN_ENTRIES" columnType="INTEGER"/>
<schema-addColumn table="RHQ_CONFIG_PROP_DEF"
column="MAX_ENTRIES" columnType="INTEGER"/>
+ <schema-directSQL>
+ <statement desc="Update the NULL to 0 for
MIN_ENTRIES">
+ UPDATE RHQ_CONFIG_PROP_DEF
+ SET MIN_ENTRIES = 0
+ WHERE MIN_ENTRIES IS NULL
+ </statement>
+ <statement desc="Update the NULL to 0 for
MAX_ENTRIES">
+ UPDATE RHQ_CONFIG_PROP_DEF
+ SET MAX_ENTRIES = 0
+ WHERE MAX_ENTRIES IS NULL
+ </statement>
+ </schema-directSQL>
+ </schemaSpec>
+
+ <schemaSpec version="2.124">
+ <schema-directSQL>
+ <statement desc="Update the NULL to 0 for
MIN_ENTRIES">
+ UPDATE RHQ_CONFIG_PROP_DEF
+ SET MIN_ENTRIES = 0
+ WHERE MIN_ENTRIES IS NULL
+ </statement>
+ <statement desc="Update the NULL to 0 for
MAX_ENTRIES">
+ UPDATE RHQ_CONFIG_PROP_DEF
+ SET MAX_ENTRIES = 0
+ WHERE MAX_ENTRIES IS NULL
+ </statement>
+ </schema-directSQL>
</schemaSpec>
</dbupgrade>
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionList.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionList.java
index adf1f34..dfca8ee 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionList.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionList.java
@@ -86,15 +86,24 @@ public class PropertyDefinitionList extends PropertyDefinition {
return max;
}
- public void setMax(int max) {
- this.max = max;
+ public void setMax(Integer max){
+ if(null == max){
+ this.max = 0;
+ }else {
+ this.max = max;
+ }
}
public int getMin() {
return min;
}
- public void setMin(int min) {
- this.min = min;
+ public void setMin(Integer min){
+ if(null == min){
+ this.min = 0;
+ }else {
+ this.min = min;
+ }
}
+
}
commit aac307bbd11be1929bf0db5418e920e26a309e07
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Sep 27 16:21:31 2012 -0500
[Bug 814305 - Dealing with singletons in inventory]
Fix an issue with the previous fix to handle the case where the parent
did not actually have to worry about singleton children. Also, defer
calling super's onInit until the subclass is done with it's work.
(cherry picked from commit 949ff96d973e2592762204713235cc359d2b63b6)
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
index 265778b..36e0939 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceCompositeSearchView.java
@@ -86,7 +86,6 @@ public class ResourceCompositeSearchView extends ResourceSearchView {
@Override
protected void onInit() {
- super.onInit();
// To properly filter Create Child and Import menus we need existing singleton
child resources. If the
// user has create permission and the parent type has singleton child types and
creatable or importable child
@@ -99,7 +98,19 @@ public class ResourceCompositeSearchView extends ResourceSearchView {
importableChildTypes = getImportableChildTypes(parentType);
hasCreatableTypes = !creatableChildTypes.isEmpty();
hasImportableTypes = !importableChildTypes.isEmpty();
- refreshSingletons(parentResource, null);
+ refreshSingletons(parentResource, new
AsyncCallback<PageList<Resource>>() {
+
+ public void onFailure(Throwable caught) {
+ ResourceCompositeSearchView.super.onInit();
+ initialized = true;
+ }
+
+ public void onSuccess(PageList<Resource> result) {
+ ResourceCompositeSearchView.super.onInit();
+ initialized = true;
+ }
+
+ });
}
@@ -117,7 +128,6 @@ public class ResourceCompositeSearchView extends ResourceSearchView {
@Override
public void onSuccess(PageList<Resource> result) {
singletonChildren = result;
- initialized = true;
if (callback != null) {
callback.onSuccess(result);
}
@@ -126,14 +136,15 @@ public class ResourceCompositeSearchView extends ResourceSearchView
{
@Override
public void onFailure(Throwable caught) {
Log.error("Failed to load child resources for [" +
parentResource + "]", caught);
- initialized = true;
if (callback != null) {
callback.onFailure(caught);
}
}
});
} else {
- initialized = true;
+ if (callback != null) {
+ callback.onSuccess(new PageList<Resource>());
+ }
}
}
@@ -143,7 +154,7 @@ public class ResourceCompositeSearchView extends ResourceSearchView {
}
// suppress unchecked warnings because the superclass has different generic types for
the datasource
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
@Override
protected RPCDataSource getDataSourceInstance() {
return ResourceCompositeDataSource.getInstance();
@@ -213,7 +224,6 @@ public class ResourceCompositeSearchView extends ResourceSearchView {
private void addImportAndCreateButtons(boolean override) {
final Resource parentResource = parentResourceComposite.getResource();
- ResourceType parentType = parentResource.getResourceType();
// Create Child Menu and Manual Import Menu
if (canCreate && (hasCreatableTypes || hasImportableTypes)) {
Show replies by date