modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
| 7 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
| 46 ----------
2 files changed, 3 insertions(+), 50 deletions(-)
New commits:
commit 81960e013533ee848aacc7716bf4bc254df93b2d
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Dec 1 12:17:43 2011 -0500
[Bug 759167 - Client side exception generated when viewing empty compatible group]
This turns out to be something of a happy accident. The offending code
made an assumption that the group would not be empty. But looking more
closely it seems to me that the entire code block is unnecessary. Moreover,
it added a round trip to the DB when displaying the group level dashboard.
It was trying to determine whether to render the bundle deployment
portlet. From what I can see, this can be determined already by looking
at the type's facets. And in fact the code was already in place. So,
- removing unnecessary db round-trip code (was even being done for mixed groups)
- keeping the existing facet-based code, which seems to do the right thing
- fixing a secondary problem that displayed the bundle deployment portlet for mixed
groups.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
index ec71b3f..a50cea5 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
@@ -246,8 +246,8 @@ public class DashboardView extends LocatableVLayout {
} else {
// TODO: i18n
Message message = new Message("There is already a dashboard
named '" + trimmedName
- + "'. Please specify a name that is not already in
use.", Message.Severity.Error,
- EnumSet.of(Message.Option.Transient));
+ + "'. Please specify a name that is not already in
use.", Message.Severity.Error, EnumSet
+ .of(Message.Option.Transient));
CoreGUI.getMessageCenter().notify(message);
nameItem.setValue(storedDashboard.getName());
}
@@ -299,8 +299,6 @@ public class DashboardView extends LocatableVLayout {
}
});
-
-
// build the menu of valid portlets for this context, sorted by portlet name
final Menu addPortletMenu = new
LocatableMenu(editForm.extendLocatorId("PortletMenu"));
LinkedHashMap<String, String> valueMap;
@@ -512,6 +510,7 @@ public class DashboardView extends LocatableVLayout {
groupMenuMap.remove(GroupOobsPortlet.KEY);
groupMenuMap.remove(GroupPkgHistoryPortlet.KEY);
groupMenuMap.remove(GroupConfigurationUpdatesPortlet.KEY);
+ groupMenuMap.remove(GroupBundleDeploymentsPortlet.KEY);
} else {
// for compatible may still need to do some pruning.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
index 09abe9d..991098e 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
@@ -18,11 +18,9 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.summary;
-import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.util.BooleanCallback;
import com.smartgwt.client.util.SC;
@@ -36,16 +34,11 @@ import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.criteria.DashboardCriteria;
-import org.rhq.core.domain.criteria.ResourceGroupCriteria;
import org.rhq.core.domain.dashboard.Dashboard;
import org.rhq.core.domain.dashboard.DashboardCategory;
import org.rhq.core.domain.dashboard.DashboardPortlet;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceCategory;
-import org.rhq.core.domain.resource.group.GroupCategory;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
-import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.InitializableView;
@@ -55,7 +48,6 @@ import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardContainer;
import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardView;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupAlertsPortlet;
-import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupBundleDeploymentsPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupConfigurationUpdatesPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupMetricsPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupOperationsPortlet;
@@ -212,44 +204,6 @@ public class ActivityView extends LocatableVLayout implements
DashboardContainer
//figure out which portlets to display and how
Map<String, String> groupKeyNameMap =
DashboardView.processPortletNameMapForGroup(groupComposite);
- //initiate asynch call to execute and then update the dashboard with bundle
deployment portlet if necessary
- ResourceGroupCriteria criteria = new ResourceGroupCriteria();
- criteria.addFilterId(group.getId());
- criteria.fetchExplicitResources(true);
- criteria.setPageControl(new PageControl(0, 1));
-
GWTServiceLookup.getResourceGroupService().findResourceGroupsByCriteria(criteria,
- new AsyncCallback<PageList<ResourceGroup>>() {
- @Override
- public void onSuccess(PageList<ResourceGroup> results) {
- if (!results.isEmpty()) {
- ResourceGroup grp = results.get(0);
- Set<Resource> explicitMembers =
grp.getExplicitResources();
- Resource[] currentResources = new
Resource[explicitMembers.size()];
- explicitMembers.toArray(currentResources);
- Map<String, String> portletToAdd = new HashMap<String,
String>();
- //membership dynamically determined if all platforms then will be
compatible.
- if (group.getGroupCategory().equals(GroupCategory.COMPATIBLE)) {
- if
(currentResources[0].getResourceType().getCategory().equals(ResourceCategory.PLATFORM)) {
- //this portlet allowed to add bundle portlet monitoring
- portletToAdd.put(GroupBundleDeploymentsPortlet.KEY,
GroupBundleDeploymentsPortlet.NAME);
- }
- if (!portletToAdd.isEmpty()) {
- //update dashboard with that portlet and reload
- updateDashboardWithPortlets(portletToAdd, dashboard,
100);
- //request reload of dashboard widget
- setDashboard(dashboard);
- markForRedraw();
- }
- }
- }
- }
-
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving information for group [" +
group.getId() + "]:" + caught.getMessage());
- }
- });
-
//reset positioning parameters
colLeft = 0;
colRight = 1;
Show replies by date