modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
| 49 ++++++----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java
| 11 +-
2 files changed, 38 insertions(+), 22 deletions(-)
New commits:
commit e81f607e26a3d8d260b2bc465e7fa771b0bd34ca
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Oct 21 16:15:15 2010 -0400
Group Fixes
- Avoid NPE and save time by not constructing Group Alert Def subtab for
Mixed Group.
- Fix issue now preventing the user from navigating away from
Group->Inventory->Membership
- Fix Inventory compat and mixed group tree options to actually return the
desired group category
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
index 0295877..bcef904 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
@@ -45,6 +45,7 @@ import
org.rhq.enterprise.gui.coregui.client.alert.definitions.GroupAlertDefinit
import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane;
import org.rhq.enterprise.gui.coregui.client.components.tab.SubTab;
import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab;
+import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.detail.AbstractTwoLevelTabSetView;
import
org.rhq.enterprise.gui.coregui.client.inventory.common.event.EventCompositeHistoryView;
@@ -107,16 +108,28 @@ public class ResourceGroupDetailView extends
AbstractTwoLevelTabSetView<Resource
@Override
public Integer getSelectedItemId() {
+ return this.groupId;
+ }
+
+ @Override
+ public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) {
// if moving from membership subtab then re-load the detail view as the
membership and
// group type may have changed.
- if (this.inventoryTab.getTitle().equals(currentTab)
+ if ((null != this.groupId) &&
this.inventoryTab.getTitle().equals(currentTab)
&& this.inventoryMembership.getTitle().equals(currentSubTab)) {
+
+ String tabPath = "/" + tabSelectedEvent.getId() + "/" +
tabSelectedEvent.getSubTabId();
+ String path = this.getBaseViewPath() + "/" + getSelectedItemId() +
tabPath;
+
this.currentTab = null;
this.currentSubTab = null;
this.groupId = null;
- }
- return this.groupId;
+ CoreGUI.goToView(path);
+
+ } else {
+ super.onTabSelected(tabSelectedEvent);
+ }
}
@Override
@@ -202,8 +215,8 @@ public class ResourceGroupDetailView extends
AbstractTwoLevelTabSetView<Resource
// summaryTab.updateSubTab("Overview", new
DashboardView(resource));
// summaryTab.updateSubTab("Timeline", timelinePane);
// Summary tab is always visible and enabled.
- updateSubTab(this.summaryTab, this.summaryOverview,
- new OverviewView(this.summaryTab.extendLocatorId("OverviewView"),
this.groupComposite), true, true);
+ updateSubTab(this.summaryTab, this.summaryOverview, new
OverviewView(this.summaryTab
+ .extendLocatorId("OverviewView"), this.groupComposite), true,
true);
if (updateTab(this.monitoringTab, groupCategory == GroupCategory.COMPATIBLE,
true)) {
visible = hasMetricsOfType(this.groupComposite, DataType.MEASUREMENT);
@@ -225,8 +238,8 @@ public class ResourceGroupDetailView extends
AbstractTwoLevelTabSetView<Resource
}
// Inventory tab is always visible and enabled.
- updateSubTab(this.inventoryTab, this.inventoryMembers,
-
ResourceSearchView.getMembersOf(this.inventoryTab.extendLocatorId("MembersView"),
groupId), true, true);
+ updateSubTab(this.inventoryTab, this.inventoryMembers,
ResourceSearchView.getMembersOf(this.inventoryTab
+ .extendLocatorId("MembersView"), groupId), true, true);
// TODO: Uncomment this once the group config component is done.
//updateSubTab(this.inventoryTab, this.inventoryConn,
// new GroupPluginConfigurationEditView(this.group.getId(),
this.group.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin),
@@ -236,8 +249,8 @@ public class ResourceGroupDetailView extends
AbstractTwoLevelTabSetView<Resource
groupId) : null;
updateSubTab(this.inventoryTab, this.inventoryMembership, canvas, true,
enabled);
- if (updateTab(this.operationsTab,
- groupCategory == GroupCategory.COMPATIBLE &&
facets.contains(ResourceTypeFacet.OPERATION), true)) {
+ if (updateTab(this.operationsTab, groupCategory == GroupCategory.COMPATIBLE
+ && facets.contains(ResourceTypeFacet.OPERATION), true)) {
updateSubTab(this.operationsTab, this.opHistory, new FullHTMLPane(
"/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=" + groupId),
true, true);
updateSubTab(this.operationsTab, this.opSched, new FullHTMLPane(
@@ -249,9 +262,10 @@ public class ResourceGroupDetailView extends
AbstractTwoLevelTabSetView<Resource
// alert history is always available
updateSubTab(this.alertsTab, this.alertHistory,
GroupAlertHistoryView.get(groupComposite), true, true);
// but alert definitions can only be created on compatible groups
- updateSubTab(this.alertsTab, this.alertDef,
- new
GroupAlertDefinitionsView(alertsTab.extendLocatorId("AlertDefView"),
this.groupComposite),
- groupCategory == GroupCategory.COMPATIBLE, true);
+ visible = (groupCategory == GroupCategory.COMPATIBLE);
+ canvas = (visible) ? new
GroupAlertDefinitionsView(alertsTab.extendLocatorId("AlertDefView"),
+ this.groupComposite) : null;
+ updateSubTab(this.alertsTab, this.alertDef, canvas, visible, true);
}
visible = groupCategory == GroupCategory.COMPATIBLE &&
facets.contains(ResourceTypeFacet.CONFIGURATION);
@@ -263,13 +277,12 @@ public class ResourceGroupDetailView extends
AbstractTwoLevelTabSetView<Resource
updateSubTab(this.configurationTab, this.configHistory, new FullHTMLPane(
"/rhq/group/configuration/history-plain.xhtml?groupId=" +
groupId), true, true);
}
-
- visible = groupCategory == GroupCategory.MIXED || // allow mixed groups to show
events from supporting resources
- (groupCategory == GroupCategory.COMPATIBLE &&
facets.contains(ResourceTypeFacet.EVENT));
+ // allow mixed groups to show events from supporting resources
+ visible = groupCategory == GroupCategory.MIXED
+ || (groupCategory == GroupCategory.COMPATIBLE &&
facets.contains(ResourceTypeFacet.EVENT));
if (updateTab(this.eventsTab, visible, true)) {
- updateSubTab(this.eventsTab, this.eventHistory,
-
EventCompositeHistoryView.get(this.eventsTab.extendLocatorId("CompositeHistView"),
groupComposite),
- true, true);
+ updateSubTab(this.eventsTab, this.eventHistory,
EventCompositeHistoryView.get(this.eventsTab
+ .extendLocatorId("CompositeHistView"), groupComposite), true,
true);
}
this.show();
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 dee71d2..d913229 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
@@ -46,6 +46,7 @@ import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.components.tree.EnhancedTreeNode;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import
org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupDataSourceField;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.groups.definitions.GroupDefinitionListView;
import
org.rhq.enterprise.gui.coregui.client.inventory.resource.discovery.ResourceAutodiscoveryView;
@@ -265,11 +266,13 @@ 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",
- GroupCategory.COMPATIBLE.name()), "Compatible Groups",
"types/Cluster_up_24.png");
+ content = new
ResourceGroupListView(extendLocatorId("Compatible"), new Criteria(
+ ResourceGroupDataSourceField.CATEGORY.propertyName(),
GroupCategory.COMPATIBLE.name()),
+ "Compatible Groups", "types/Cluster_up_24.png");
} else if (PAGE_MIXED_GROUPS.equals(pageName)) {
- content = new ResourceGroupListView(extendLocatorId("Mixed"),
new Criteria("category",
- GroupCategory.MIXED.name()), "Mixed Groups",
"types/Group_up_24.png");
+ content = new ResourceGroupListView(extendLocatorId("Mixed"),
new Criteria(
+ ResourceGroupDataSourceField.CATEGORY.propertyName(),
GroupCategory.MIXED.name()), "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)) {