[rhq] modules/enterprise
by Simeon Pinder
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit ce01d4eec5e57d844d81339524ba044c5c213bd4
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Thu Apr 7 22:23:15 2011 -0400
trim queries from GroupOperationsPortlet.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
index 2ef5bd8..949371f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
@@ -329,7 +329,11 @@ public class GroupOperationsPortlet extends LocatableVLayout implements CustomSe
@Override
public void redraw() {
super.redraw();
- loadData();
+ if (!isRefreshing()) {
+ if (groupOperations != null) {
+ groupOperations.refresh();
+ }
+ }
}
protected void setCurrentlyRefreshing(boolean currentlyRefreshing) {
13 years, 2 months
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java | 34 +++++++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java | 3
3 files changed, 29 insertions(+), 11 deletions(-)
New commits:
commit 9967221cab0b7aafe7361e2f4d24f2b725a79ac0
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 7 17:30:05 2011 -0400
make About box locatable; fix issue where in Help section where once the About box was closed, clicking on the About left menu item would not redisplay the About box
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
index 7912863..5687c75 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
@@ -25,6 +25,7 @@ import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.Button;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
@@ -35,6 +36,10 @@ import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
/**
* The "About RHQ" modal window.
@@ -42,12 +47,22 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
* @author Ian Springer
* @author Joseph Marques
*/
-public class AboutModalWindow extends Window {
+public class AboutModalWindow extends LocatableWindow {
+
private static final Messages MSG = CoreGUI.getMessages();
private static ProductInfo PRODUCT_INFO;
- public AboutModalWindow() {
+ /**
+ * <pre>
+ * ID Format: "simpleClassname_locatorId"
+ * </pre>
+ *
+ * @param locatorId not null or empty.
+ */
+ public AboutModalWindow(String locatorId) {
+ super(locatorId);
+
setWidth(300);
setHeight(300);
setOverflow(Overflow.VISIBLE);
@@ -83,7 +98,7 @@ public class AboutModalWindow extends Window {
}
private void finishOnInit() {
- VLayout contentPane = new VLayout();
+ LocatableVLayout contentPane = new LocatableVLayout(extendLocatorId("Content"));
contentPane.setPadding(15);
contentPane.setMembersMargin(25);
@@ -103,15 +118,16 @@ public class AboutModalWindow extends Window {
htmlFlow.setContents(html);
contentPane.addMember(htmlFlow);
- HLayout bottomPanel = new HLayout();
- bottomPanel.setAlign(VerticalAlignment.BOTTOM);
- contentPane.addMember(bottomPanel);
+ LocatableHLayout buttonBar = new LocatableHLayout(contentPane.extendLocatorId("ButtonBar"));
+ buttonBar.setAlign(VerticalAlignment.BOTTOM);
+ contentPane.addMember(buttonBar);
Canvas spacer = new Canvas();
spacer.setWidth("*");
- bottomPanel.addMember(spacer);
+ buttonBar.addMember(spacer);
- Button closeButton = new Button(MSG.common_button_close());
+ LocatableIButton closeButton = new LocatableIButton(buttonBar.extendLocatorId("Close"),
+ MSG.common_button_close());
closeButton.setShowRollOver(true);
closeButton.setShowDown(true);
closeButton.setWidth("60");
@@ -120,7 +136,7 @@ public class AboutModalWindow extends Window {
hide();
}
});
- bottomPanel.addMember(closeButton);
+ buttonBar.addMember(closeButton);
// NOTE: Since this is a subclass of Window, we MUST use addItem(), rather than addMember() from the
// Layout class.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
index 1488e5d..22a0c13 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
@@ -95,7 +95,7 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
NavigationItem aboutItem = new NavigationItem(new ViewName("AboutBox", MSG.view_help_section_product_about()),
"[SKIN]/../actions/help.png", new ViewFactory() {
public Canvas createView() {
- final AboutModalWindow aboutModalWindow = new AboutModalWindow();
+ final AboutModalWindow aboutModalWindow = new AboutModalWindow(extendLocatorId("AboutModalWindow"));
if (PRODUCT_INFO == null) {
GWTServiceLookup.getSystemService().getProductInfo(new AsyncCallback<ProductInfo>() {
public void onFailure(Throwable caught) {
@@ -114,6 +114,7 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
return aboutModalWindow;
}
});
+ aboutItem.setRefreshRequired(true);
return new NavigationSection(SECTION_PRODUCT_VIEW_ID, aboutItem);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
index 2c9e761..70b0285 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
@@ -93,7 +93,7 @@ public class MenuBarView extends LocatableVLayout {
}
private Canvas getLogoSection() {
- final AboutModalWindow aboutModalWindow = new AboutModalWindow();
+ final AboutModalWindow aboutModalWindow = new AboutModalWindow(extendLocatorId("AboutModalWindow"));
Img logo = new Img("header/rhq_logo_28px.png", 80, 28);
logo.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
@@ -171,4 +171,5 @@ public class MenuBarView extends LocatableVLayout {
return layout;
}
+
}
13 years, 2 months
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/PermissionsLoader.java | 42 ++++------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java | 2
2 files changed, 20 insertions(+), 24 deletions(-)
New commits:
commit ebbc3638f902a4ae012d5b7db57041f1db5b7a8e
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 7 16:56:22 2011 -0400
return implicit, not explicit, resource and grou perms in PermissionsLoader
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/PermissionsLoader.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/PermissionsLoader.java
index 6160158..6d1114c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/PermissionsLoader.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/PermissionsLoader.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -20,7 +20,6 @@
* if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
package org.rhq.enterprise.gui.coregui.client;
import java.util.EnumSet;
@@ -46,7 +45,8 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
*/
public class PermissionsLoader {
- private static Messages MSG = CoreGUI.getMessages();
+ private static final Messages MSG = CoreGUI.getMessages();
+
private Throwable lastError;
/**
@@ -59,31 +59,28 @@ public class PermissionsLoader {
}
public void loadExplicitGlobalPermissions(final PermissionsLoadedListener callback) {
- GWTServiceLookup.getAuthorizationService().getExplicitGlobalPermissions(new AsyncCallback<Set<Permission>>() {
-
- @Override
- public void onSuccess(Set<Permission> result) {
- callback.onPermissionsLoaded(result);
- }
-
- @Override
- public void onFailure(Throwable caught) {
- processFailure(MSG.util_userPerm_loadFailGlobal(), caught);
- callback.onPermissionsLoaded(null); // indicate an error by passing in null
- }
+ GWTServiceLookup.getAuthorizationService().getExplicitGlobalPermissions(
+ new AsyncCallback<Set<Permission>>() {
+
+ public void onSuccess(Set<Permission> result) {
+ callback.onPermissionsLoaded(result);
+ }
+
+ public void onFailure(Throwable caught) {
+ processFailure(MSG.util_userPerm_loadFailGlobal(), caught);
+ callback.onPermissionsLoaded(null); // indicate an error by passing in null
+ }
});
}
- public void loadExplicitGroupPermissions(final int groupId, final PermissionsLoadedListener callback) {
- GWTServiceLookup.getAuthorizationService().getExplicitGroupPermissions(groupId,
+ public void loadGroupPermissions(final int groupId, final PermissionsLoadedListener callback) {
+ GWTServiceLookup.getAuthorizationService().getImplicitGroupPermissions(groupId,
new AsyncCallback<Set<Permission>>() {
- @Override
public void onSuccess(Set<Permission> result) {
callback.onPermissionsLoaded(result);
}
- @Override
public void onFailure(Throwable caught) {
processFailure(MSG.util_userPerm_loadFailGroup(String.valueOf(groupId)), caught);
callback.onPermissionsLoaded(null); // indicate an error by passing in null
@@ -91,16 +88,14 @@ public class PermissionsLoader {
});
}
- public void loadExplicitResourcePermissions(final int resourceId, final PermissionsLoadedListener callback) {
- GWTServiceLookup.getAuthorizationService().getExplicitResourcePermissions(resourceId,
+ public void loadResourcePermissions(final int resourceId, final PermissionsLoadedListener callback) {
+ GWTServiceLookup.getAuthorizationService().getImplicitResourcePermissions(resourceId,
new AsyncCallback<Set<Permission>>() {
- @Override
public void onSuccess(Set<Permission> result) {
callback.onPermissionsLoaded(result);
}
- @Override
public void onFailure(Throwable caught) {
processFailure(MSG.util_userPerm_loadFailResource(String.valueOf(resourceId)), caught);
callback.onPermissionsLoaded(null); // indicate an error by passing in null
@@ -114,4 +109,5 @@ public class PermissionsLoader {
Severity severity = Message.Severity.Error;
CoreGUI.getMessageCenter().notify(new Message(msg, caught, severity, options));
}
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java
index beeede4..b914680 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java
@@ -55,7 +55,7 @@ public class TestAsyncView extends LocatableVLayout implements AsyncOperationCal
this.resourcePermsAsyncOperation = new AsyncOperation() {
public void execute(final AsyncOperationCallback callback, Object... params) {
- new PermissionsLoader().loadExplicitResourcePermissions(10001, new PermissionsLoadedListener() {
+ new PermissionsLoader().loadResourcePermissions(10001, new PermissionsLoadedListener() {
public void onPermissionsLoaded(Set<Permission> permissions) {
resourcePerms = permissions;
Timer timer = new Timer() {
13 years, 2 months
[rhq] modules/enterprise
by Simeon Pinder
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java | 5 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java | 7 +--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java | 3 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java | 7 +--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java | 8 +--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java | 7 +--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceBundleDeploymentsPortlet.java | 21 ---------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java | 15 ------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceEventsPortlet.java | 23 ----------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java | 23 ----------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java | 23 ----------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java | 23 ----------
12 files changed, 30 insertions(+), 135 deletions(-)
New commits:
commit e403d9febb53979b0e564550016915d988253aab
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Thu Apr 7 08:57:34 2011 -0400
i)Cleanup of Group/Resource* portlets.
ii)Removed several redundant queries from Res/Grp portlets. Still redundant query in Group/Res Operations portlet.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java
index 6ef8a59..7c4a68b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupBundleDeploymentsPortlet.java
@@ -100,7 +100,6 @@ public class GroupBundleDeploymentsPortlet extends LocatableVLayout implements C
@Override
protected void onInit() {
- super.onInit();
initializeUi();
loadData();
}
@@ -282,7 +281,9 @@ public class GroupBundleDeploymentsPortlet extends LocatableVLayout implements C
@Override
public void redraw() {
super.redraw();
- loadData();
+ if (!isRefreshing()) {
+ loadData();
+ }
}
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
index 256f9c1..5b909a9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
@@ -293,7 +293,6 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
@Override
protected void onInit() {
- super.onInit();
//disable the refresh timer for this run
currentlyLoading = true;
initializeUi();
@@ -312,10 +311,12 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
@Override
public void redraw() {
super.redraw();
- loadData();
+ if (!isRefreshing()) {
+ loadData();
+ }
}
- private void loadData() {
+ protected void loadData() {
//populate composite data
//locate resourceGroupRef
ResourceGroupCriteria criteria = new ResourceGroupCriteria();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
index b4761e9..d054102 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupEventsPortlet.java
@@ -102,7 +102,6 @@ public class GroupEventsPortlet extends LocatableVLayout implements CustomSettin
@Override
protected void onInit() {
- super.onInit();
//disable the refresh timer for this run
currentlyLoading = true;
initializeUi();
@@ -190,7 +189,7 @@ public class GroupEventsPortlet extends LocatableVLayout implements CustomSettin
/** Fetches recent events and updates the DynamicForm instance with the latest
* event information over last 24hrs.
*/
- private void getRecentEventUpdates() {
+ protected void getRecentEventUpdates() {
final int groupId = this.groupId;
long end = System.currentTimeMillis();
long start = end - (24 * 60 * 60 * 1000);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
index d6dbf19..a1d0d1b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
@@ -120,7 +120,6 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
@Override
protected void onInit() {
- super.onInit();
setRefreshing(true);
initializeUi();
loadData();
@@ -208,7 +207,7 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
* ii) link to recent metric graph for more details and iii) last metric value formatted to show significant
* digits.
*/
- private void getRecentMetrics() {
+ protected void getRecentMetrics() {
//display container
final VLayout column = new VLayout();
column.setHeight(10);//pack
@@ -482,7 +481,9 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
@Override
public void redraw() {
super.redraw();
- loadData();
+ if (!isRefreshing()) {
+ loadData();
+ }
}
private boolean isAutoGroup() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
index b06c9a4..d19a301 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
@@ -95,7 +95,6 @@ public class GroupOobsPortlet extends LocatableVLayout implements CustomSettings
@Override
protected void onInit() {
- super.onInit();
initializeUi();
loadData();
}
@@ -183,7 +182,7 @@ public class GroupOobsPortlet extends LocatableVLayout implements CustomSettings
/** Fetches OOB measurements and updates the DynamicForm instance with the latest N
* oob change details.
*/
- private void getRecentOobs() {
+ protected void getRecentOobs() {
final int groupId = this.groupId;
int resultCount = 5;//default to
@@ -266,7 +265,8 @@ public class GroupOobsPortlet extends LocatableVLayout implements CustomSettings
public void redraw() {
super.redraw();
//spinder 4/3/11: although screen does not flash autorefresh is being called on time. Too fast for user to notice.
- loadData();
+ if (!isRefreshing()) {
+ loadData();
+ }
}
-
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java
index da5a0ee..36258fb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupPkgHistoryPortlet.java
@@ -98,7 +98,6 @@ public class GroupPkgHistoryPortlet extends LocatableVLayout implements CustomSe
@Override
protected void onInit() {
- super.onInit();
initializeUi();
loadData();
}
@@ -185,7 +184,7 @@ public class GroupPkgHistoryPortlet extends LocatableVLayout implements CustomSe
/** Fetches recent package history information and updates the DynamicForm instance with details.
*/
- private void getRecentPkgHistory() {
+ protected void getRecentPkgHistory() {
final int groupId = this.groupId;
InstalledPackageHistoryCriteria criteria = new InstalledPackageHistoryCriteria();
@@ -279,7 +278,9 @@ public class GroupPkgHistoryPortlet extends LocatableVLayout implements CustomSe
@Override
public void redraw() {
super.redraw();
- loadData();
+ if (!isRefreshing()) {
+ loadData();
+ }
}
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceBundleDeploymentsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceBundleDeploymentsPortlet.java
index 3cb8256..763b8fc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceBundleDeploymentsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceBundleDeploymentsPortlet.java
@@ -64,21 +64,6 @@ public class ResourceBundleDeploymentsPortlet extends GroupBundleDeploymentsPort
this.resourceId = currentResourceIdentifier;
}
- @Override
- protected void onInit() {
- super.onInit();
- initializeUi();
- loadData();
- }
-
- /**Defines layout for the portlet page.
- */
- protected void initializeUi() {
- setPadding(5);
- setMembersMargin(5);
- addMember(recentBundleDeployContent);
- }
-
public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
@@ -87,13 +72,9 @@ public class ResourceBundleDeploymentsPortlet extends GroupBundleDeploymentsPort
}
}
- protected void loadData() {
- currentlyLoading = true;
- getRecentBundleDeployments();
- }
-
/** Fetches recent bundle deployment information and updates the DynamicForm instance with details.
*/
+ @Override
protected void getRecentBundleDeployments() {
final int resourceId = this.resourceId;
ResourceBundleDeploymentCriteria criteria = new ResourceBundleDeploymentCriteria();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
index bd5c4ac..4ab8396 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
@@ -76,13 +76,6 @@ public class ResourceConfigurationUpdatesPortlet extends GroupConfigurationUpdat
baseViewPath = elements[0];
}
- @Override
- protected void onInit() {
- super.onInit();
- initializeUi();
- loadData();
- }
-
public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
@@ -104,12 +97,7 @@ public class ResourceConfigurationUpdatesPortlet extends GroupConfigurationUpdat
}
@Override
- public void redraw() {
- super.redraw();
- loadData();
- }
-
- private void loadData() {
+ protected void loadData() {
//populate composite data
//locate resourceRef
ResourceCriteria criteria = new ResourceCriteria();
@@ -216,7 +204,6 @@ public class ResourceConfigurationUpdatesPortlet extends GroupConfigurationUpdat
protected void executeFetch(final DSRequest request, final DSResponse response,
final ResourceConfigurationUpdateCriteria criteria) {
ConfigurationGWTServiceAsync configurationService = GWTServiceLookup.getConfigurationService();
-
configurationService.findResourceConfigurationUpdatesByCriteria(criteria,
new AsyncCallback<PageList<ResourceConfigurationUpdate>>() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceEventsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceEventsPortlet.java
index a2a2bda..f382ea7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceEventsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceEventsPortlet.java
@@ -64,21 +64,6 @@ public class ResourceEventsPortlet extends GroupEventsPortlet {
this.resourceId = Integer.valueOf(elements[1]);
}
- @Override
- protected void onInit() {
- super.onInit();
- initializeUi();
- loadData();
- }
-
- /**Defines layout for the portlet page.
- */
- protected void initializeUi() {
- setPadding(5);
- setMembersMargin(5);
- addMember(recentEventsContent);
- }
-
public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
@@ -87,15 +72,11 @@ public class ResourceEventsPortlet extends GroupEventsPortlet {
}
}
- protected void loadData() {
- currentlyLoading = true;
- getRecentEventUpdates();
- }
-
/** Fetches recent events and updates the DynamicForm instance with the latest
* event information over last 24hrs.
*/
- private void getRecentEventUpdates() {
+ @Override
+ protected void getRecentEventUpdates() {
final int resourceId = this.resourceId;
long end = System.currentTimeMillis();
long start = end - (24 * 60 * 60 * 1000);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
index a77796f..735fba8 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
@@ -79,21 +79,6 @@ public class ResourceMetricsPortlet extends GroupMetricsPortlet {
baseViewPath = elements[0];
}
- @Override
- protected void onInit() {
- super.onInit();
- initializeUi();
- loadData();
- }
-
- /**Defines layout for the portlet page.
- */
- protected void initializeUi() {
- setPadding(5);
- setMembersMargin(5);
- addMember(recentMeasurementsContent);
- }
-
public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
@@ -102,16 +87,12 @@ public class ResourceMetricsPortlet extends GroupMetricsPortlet {
}
}
- protected void loadData() {
- currentlyLoading = true;
- getRecentMetrics();
- }
-
/** Fetches recent metric information and updates the DynamicForm instance with i)sparkline information,
* ii) link to recent metric graph for more details and iii) last metric value formatted to show significant
* digits.
*/
- private void getRecentMetrics() {
+ @Override
+ protected void getRecentMetrics() {
//display container
final VLayout column = new VLayout();
column.setHeight(10);//pack
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java
index b0e9d37..a1d0301 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOobsPortlet.java
@@ -59,21 +59,6 @@ public class ResourceOobsPortlet extends GroupOobsPortlet {
this.resourceId = Integer.valueOf(elements[1]);
}
- @Override
- protected void onInit() {
- super.onInit();
- initializeUi();
- loadData();
- }
-
- /**Defines layout for the portlet page.
- */
- protected void initializeUi() {
- setPadding(5);
- setMembersMargin(5);
- addMember(recentOobContent);
- }
-
public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
@@ -82,15 +67,11 @@ public class ResourceOobsPortlet extends GroupOobsPortlet {
}
}
- protected void loadData() {
- currentlyLoading = true;
- getRecentOobs();
- }
-
/** Fetches OOB measurements and updates the DynamicForm instance with the latest N
* oob change details.
*/
- private void getRecentOobs() {
+ @Override
+ protected void getRecentOobs() {
final int resourceId = this.resourceId;
int resultCount = 5;//default to
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java
index 41ce660..3ead00a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourcePkgHistoryPortlet.java
@@ -63,21 +63,6 @@ public class ResourcePkgHistoryPortlet extends GroupPkgHistoryPortlet {
this.resourceId = currentResourceIdentifier;
}
- @Override
- protected void onInit() {
- super.onInit();
- initializeUi();
- loadData();
- }
-
- /**Defines layout for the portlet page.
- */
- protected void initializeUi() {
- setPadding(5);
- setMembersMargin(5);
- addMember(recentPkgHistoryContent);
- }
-
public static final class Factory implements PortletViewFactory {
public static PortletViewFactory INSTANCE = new Factory();
@@ -86,14 +71,10 @@ public class ResourcePkgHistoryPortlet extends GroupPkgHistoryPortlet {
}
}
- protected void loadData() {
- currentlyLoading = true;
- getRecentPkgHistory();
- }
-
/** Fetches recent package history information and updates the DynamicForm instance with details.
*/
- private void getRecentPkgHistory() {
+ @Override
+ protected void getRecentPkgHistory() {
final int resourceId = this.resourceId;
InstalledPackageHistoryCriteria criteria = new InstalledPackageHistoryCriteria();
13 years, 2 months
[rhq] Branch 'release-3.0.1' - modules/plugins
by John Sanda
modules/plugins/apache/src/main/java/org/rhq/plugins/www/util/WWWUtils.java | 13 ++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
New commits:
commit d28d9bbfbb7866af455d85c972728542976e484f
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Apr 7 16:27:02 2011 -0400
[BZ 690430,690412] Adding additional logging for SSL exceptions
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/www/util/WWWUtils.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/www/util/WWWUtils.java
index c1ff6eb..2b226be 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/www/util/WWWUtils.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/www/util/WWWUtils.java
@@ -28,9 +28,11 @@ import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
+import javax.xml.ws.handler.LogicalHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -41,8 +43,6 @@ import org.apache.commons.logging.LogFactory;
*/
public abstract class WWWUtils {
- private static final Log log = LogFactory.getLog(WWWUtils.class);
-
/**
* Sends a HEAD request to the passed url and returns if the server was reachable
* @param httpURL a http or https URL to check
@@ -50,6 +50,7 @@ public abstract class WWWUtils {
*/
public static boolean isAvailable(URL httpURL, boolean disableCertValidation) {
+ String failMsg = "URL [" + httpURL + "] returned unavailable";
try {
HttpURLConnection connection = (HttpURLConnection) httpURL.openConnection();
connection.setRequestMethod("HEAD");
@@ -62,7 +63,13 @@ public abstract class WWWUtils {
connection.connect();
// get the respone code to actually trigger sending the Request.
connection.getResponseCode();
+ } catch (SSLException e) {
+ Log log = LogFactory.getLog(WWWUtils.class);
+ log.warn(failMsg + " due to: " + e.getLocalizedMessage(), e);
+ return false;
} catch (IOException e) {
+ Log log = LogFactory.getLog(WWWUtils.class);
+ log.debug(failMsg + " due to: " + e.getLocalizedMessage(), e);
return false;
}
@@ -118,8 +125,10 @@ public abstract class WWWUtils {
}
});
} catch (NoSuchAlgorithmException e) {
+ Log log = LogFactory.getLog(WWWUtils.class);
log.warn("Failed to disable certificate validation.", e);
} catch (KeyManagementException e) {
+ Log log = LogFactory.getLog(WWWUtils.class);
log.warn("Failed to disable certificate validation.", e);
}
}
13 years, 2 months
[rhq] 2 commits - modules/plugins
by John Sanda
modules/plugins/apache/src/main/java/org/rhq/plugins/www/util/WWWUtils.java | 13 ++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
New commits:
commit 6b40d5292eec2feecf0f0d65dec3599e8d913511
Merge: 4dce488 8152dac
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Apr 7 16:29:01 2011 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 4dce488060dcf08592daad2571560b16ba20241c
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Apr 7 16:27:02 2011 -0400
[BZ 690430,690412] Adding additional logging for SSL exceptions
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/www/util/WWWUtils.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/www/util/WWWUtils.java
index c1ff6eb..2b226be 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/www/util/WWWUtils.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/www/util/WWWUtils.java
@@ -28,9 +28,11 @@ import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
+import javax.xml.ws.handler.LogicalHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -41,8 +43,6 @@ import org.apache.commons.logging.LogFactory;
*/
public abstract class WWWUtils {
- private static final Log log = LogFactory.getLog(WWWUtils.class);
-
/**
* Sends a HEAD request to the passed url and returns if the server was reachable
* @param httpURL a http or https URL to check
@@ -50,6 +50,7 @@ public abstract class WWWUtils {
*/
public static boolean isAvailable(URL httpURL, boolean disableCertValidation) {
+ String failMsg = "URL [" + httpURL + "] returned unavailable";
try {
HttpURLConnection connection = (HttpURLConnection) httpURL.openConnection();
connection.setRequestMethod("HEAD");
@@ -62,7 +63,13 @@ public abstract class WWWUtils {
connection.connect();
// get the respone code to actually trigger sending the Request.
connection.getResponseCode();
+ } catch (SSLException e) {
+ Log log = LogFactory.getLog(WWWUtils.class);
+ log.warn(failMsg + " due to: " + e.getLocalizedMessage(), e);
+ return false;
} catch (IOException e) {
+ Log log = LogFactory.getLog(WWWUtils.class);
+ log.debug(failMsg + " due to: " + e.getLocalizedMessage(), e);
return false;
}
@@ -118,8 +125,10 @@ public abstract class WWWUtils {
}
});
} catch (NoSuchAlgorithmException e) {
+ Log log = LogFactory.getLog(WWWUtils.class);
log.warn("Failed to disable certificate validation.", e);
} catch (KeyManagementException e) {
+ Log log = LogFactory.getLog(WWWUtils.class);
log.warn("Failed to disable certificate validation.", e);
}
}
13 years, 2 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java | 24 ++++++----
1 file changed, 15 insertions(+), 9 deletions(-)
New commits:
commit 8152dacaa244f1776b0d24707aca5627e4e5e19b
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Apr 7 15:43:41 2011 -0400
Fix an issue with direct autogroup navigation [BZ 694628]
- eliminate an incorrect tree node selection.
- also, prevent an unnecessary resource node navigation when navigating
directly to an autogroup node.
This fix should also speed up some tree renderings.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
index 4658996..5a5a7d1 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
@@ -629,13 +629,16 @@ public class ResourceTreeView extends LocatableVLayout {
} else {
// This is for cases where we have to load the tree fresh including down to the currently visible node
- loadTree(selectedResourceId, null);
+ loadTree(selectedResourceId, true, null);
}
}
- private void loadTree(final int selectedResourceId, final AsyncCallback<Void> callback) {
- selectedNodeId = ResourceTreeNode.idOf(selectedResourceId);
+ private void loadTree(final int selectedResourceId, final boolean updateSelection,
+ final AsyncCallback<Void> callback) {
+ if (updateSelection) {
+ selectedNodeId = ResourceTreeNode.idOf(selectedResourceId);
+ }
final ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService();
@@ -679,7 +682,10 @@ public class ResourceTreeView extends LocatableVLayout {
public void execute(DSResponse response, Object rawData, DSRequest request) {
Log.info("Done fetching data for tree.");
- updateSelection();
+
+ if (updateSelection) {
+ updateSelection();
+ }
if (null != callback) {
callback.onSuccess(null);
@@ -687,8 +693,6 @@ public class ResourceTreeView extends LocatableVLayout {
}
});
- updateSelection();
-
} else {
ResourceTypeRepository.Cache.getInstance().loadResourceTypes(lineage,
EnumSet.of(ResourceTypeRepository.MetadataType.subCategory),
@@ -699,7 +703,7 @@ public class ResourceTreeView extends LocatableVLayout {
.linkNodes(ResourceTreeDatasource.buildNodes(lineage, lockedData));
TreeNode selectedNode = treeGrid.getTree().findById(selectedNodeId);
- if (selectedNode != null) {
+ if (selectedNode != null && updateSelection) {
updateSelection();
} else {
@@ -741,8 +745,10 @@ public class ResourceTreeView extends LocatableVLayout {
public void onSuccess(PageList<ResourceGroup> result) {
final ResourceGroup backingGroup = result.get(0);
- // load the tree up to the autogroup's parent resource
- loadTree(backingGroup.getAutoGroupParentResource().getId(), new AsyncCallback<Void>() {
+ // load the tree up to the autogroup's parent resource. Don't select the resource node
+ // to avoid an unnecessary navigation to the resource, we just need the tree in place so
+ // we can navigate to the autogroup node.
+ loadTree(backingGroup.getAutoGroupParentResource().getId(), false, new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_tree_common_loadFailed_children(), caught);
13 years, 2 months
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java | 114 +++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/AbstractCompoundAsyncOperation.java | 120 ++++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/AsyncOperation.java | 31 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/AsyncOperationCallback.java | 34 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/CompoundAsyncOperationException.java | 47 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/ParallelCompoundAsyncOperation.java | 40 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/SerialCompoundAsyncOperation.java | 73 ++++++
8 files changed, 469 insertions(+), 1 deletion(-)
New commits:
commit d30dd30a3be0c48fa622423a718b92077e1be904
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 7 15:13:50 2011 -0400
a new async execution framework providing a simple API for parallel or serial execution of a set of async ops + a new test view that demonstrates its usage
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java
index 11e4f9e..054974a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java
@@ -32,6 +32,7 @@ import org.rhq.enterprise.gui.coregui.client.components.view.ViewFactory;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceSelector;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeTreeView;
+import org.rhq.enterprise.gui.coregui.client.test.async.TestAsyncView;
import org.rhq.enterprise.gui.coregui.client.test.configuration.TestConfigurationView;
import org.rhq.enterprise.gui.coregui.client.test.configuration.TestGroupConfigurationView;
import org.rhq.enterprise.gui.coregui.client.test.configuration.TestReadOnlyConfigurationView;
@@ -68,6 +69,7 @@ public class TestTopView extends AbstractSectionedLeftNavigationView {
private static final ViewName MISC_SECTION_VIEW_ID = new ViewName("Misc");
private static final ViewName PAGE_PLURALIZATION_TEST = new ViewName("PluralizationTest");
private static final ViewName PAGE_REMOTE_SERVICE_STATISTICS = new ViewName("RemoteServiceStatistics");
+ private static final ViewName PAGE_ASYNC = new ViewName("Async");
public TestTopView() {
// This is a top level view, so our locator id can simply be our view id.
@@ -174,7 +176,14 @@ public class TestTopView extends AbstractSectionedLeftNavigationView {
}
});
- return new NavigationSection(MISC_SECTION_VIEW_ID, pluralizationItem, remoteServiceStatisticsItem);
+ NavigationItem asyncItem = new NavigationItem(PAGE_ASYNC, null,
+ new ViewFactory() {
+ public Canvas createView() {
+ return new TestAsyncView(extendLocatorId(PAGE_ASYNC.getName()));
+ }
+ });
+
+ return new NavigationSection(MISC_SECTION_VIEW_ID, pluralizationItem, remoteServiceStatisticsItem, asyncItem);
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java
new file mode 100644
index 0000000..beeede4
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java
@@ -0,0 +1,114 @@
+package org.rhq.enterprise.gui.coregui.client.test.async;
+
+import com.google.gwt.user.client.Timer;
+import com.smartgwt.client.widgets.IButton;
+import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.layout.HLayout;
+import org.rhq.core.domain.authz.Permission;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.PermissionsLoadedListener;
+import org.rhq.enterprise.gui.coregui.client.PermissionsLoader;
+import org.rhq.enterprise.gui.coregui.client.util.async.AsyncOperation;
+import org.rhq.enterprise.gui.coregui.client.util.async.AsyncOperationCallback;
+import org.rhq.enterprise.gui.coregui.client.util.async.ParallelCompoundAsyncOperation;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author Ian Springer
+ */
+public class TestAsyncView extends LocatableVLayout implements AsyncOperationCallback<Map<AsyncOperation, Object>> {
+
+ private AsyncOperation globalPermsAsyncOperation;
+ private AsyncOperation resourcePermsAsyncOperation;
+ private Set<Permission> globalPerms;
+ private Set<Permission> resourcePerms;
+ private Label label;
+ private HLayout buttonBar;
+ private IButton button1;
+ private IButton button2;
+
+ public TestAsyncView(String locatorId) {
+ super(locatorId);
+ setMargin(10);
+
+ final ParallelCompoundAsyncOperation compoundAsyncOperation = new ParallelCompoundAsyncOperation();
+
+ this.globalPermsAsyncOperation = new AsyncOperation() {
+ public void execute(final AsyncOperationCallback callback, Object... params) {
+ new PermissionsLoader().loadExplicitGlobalPermissions(new PermissionsLoadedListener() {
+ public void onPermissionsLoaded(Set<Permission> permissions) {
+ globalPerms = permissions;
+ Timer timer = new Timer() {
+ public void run() {
+ callback.onSuccess(globalPermsAsyncOperation, globalPerms);
+ }
+ };
+ timer.schedule(1000);
+ }
+ });
+ }
+ };
+ compoundAsyncOperation.addOperation(this.globalPermsAsyncOperation);
+
+ this.resourcePermsAsyncOperation = new AsyncOperation() {
+ public void execute(final AsyncOperationCallback callback, Object... params) {
+ new PermissionsLoader().loadExplicitResourcePermissions(10001, new PermissionsLoadedListener() {
+ public void onPermissionsLoaded(Set<Permission> permissions) {
+ resourcePerms = permissions;
+ Timer timer = new Timer() {
+ public void run() {
+ callback.onSuccess(resourcePermsAsyncOperation, resourcePerms);
+ }
+ };
+ timer.schedule(2000);
+ }
+ });
+ }
+ };
+ compoundAsyncOperation.addOperation(this.resourcePermsAsyncOperation);
+
+ compoundAsyncOperation.execute(this);
+
+ this.label = new Label("Loading...");
+ addMember(this.label);
+
+ this.buttonBar = new HLayout();
+ this.buttonBar.setMargin(15);
+ this.buttonBar.setMembersMargin(5);
+ this.buttonBar.setVisible(false);
+
+ this.button1 = new IButton("Do Action requiring MANAGE_SECURITY");
+ this.button1.setWidth(220);
+ this.button1.setDisabled(true);
+ this.buttonBar.addMember(this.button1);
+
+ this.button2 = new IButton("Do Action requiring CONFIGURE_WRITE on platform Resource");
+ this.button2.setWidth(320);
+ this.button2.setDisabled(true);
+ this.buttonBar.addMember(this.button2);
+
+ addMember(this.buttonBar);
+ }
+
+ public void onSuccess(AsyncOperation operation, Map<AsyncOperation, Object> result) {
+ this.label.hide();
+
+ if (this.globalPerms.contains(Permission.MANAGE_SECURITY)) {
+ this.button1.enable();
+ }
+
+ if (this.resourcePerms.contains(Permission.CONFIGURE_WRITE)) {
+ this.button2.enable();
+ }
+
+ this.buttonBar.show();
+ }
+
+ public void onFailure(AsyncOperation operation, Throwable caught) {
+ CoreGUI.getErrorHandler().handleError("Async init failed.", caught);
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/AbstractCompoundAsyncOperation.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/AbstractCompoundAsyncOperation.java
new file mode 100644
index 0000000..45f0645
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/AbstractCompoundAsyncOperation.java
@@ -0,0 +1,120 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.util.async;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Ian Springer
+ */
+public abstract class AbstractCompoundAsyncOperation implements AsyncOperation,
+ AsyncOperationCallback {
+
+ private List<AsyncOperation> operations = new ArrayList<AsyncOperation>();
+ private Map<AsyncOperation, Object[]> params = new LinkedHashMap<AsyncOperation, Object[]>();
+ private AsyncOperationCallback<Map<AsyncOperation, Object>> callback;
+ private Map<AsyncOperation, Object> successResults = new LinkedHashMap<AsyncOperation, Object>();
+ private Map<AsyncOperation, Throwable> failureThrowables = new LinkedHashMap<AsyncOperation, Throwable>();
+
+ public void addOperation(AsyncOperation operation) {
+ if (this.callback != null) {
+ throw new IllegalStateException("Child operations cannot be added once the compound operation has been executed.");
+ }
+ this.operations.add(operation);
+ }
+
+ @Override
+ public void execute(AsyncOperationCallback callback, Object... params) {
+ if (this.callback != null) {
+ throw new IllegalStateException("This executor can only be executed once and has already been executed.");
+ }
+ this.callback = callback;
+
+ List<AsyncOperation> operations1 = this.operations;
+ for (int i = 0, operations1Size = operations1.size(); i < operations1Size; i++) {
+ AsyncOperation operation = operations1.get(i);
+ Object[] paramArray;
+ if (i < this.params.size()) {
+ Object param = params[i];
+ paramArray = (param.getClass().isArray()) ? (Object[]) param : new Object[] { param };
+ } else {
+ // no params
+ paramArray = new Object[0];
+ }
+ this.params.put(operation, paramArray);
+ }
+ }
+
+ @Override
+ public void onFailure(AsyncOperation operation, Throwable caught) {
+ //noinspection ThrowableResultOfMethodCallIgnored
+ this.failureThrowables.put(operation, caught);
+ processCompletedOperation();
+ }
+
+ @Override
+ public void onSuccess(AsyncOperation operation, Object result) {
+ this.successResults.put(operation, result);
+ processCompletedOperation();
+ }
+
+ public List<AsyncOperation> getOperations() {
+ return operations;
+ }
+
+ public AsyncOperationCallback<Map<AsyncOperation, Object>> getCallback() {
+ return callback;
+ }
+
+ public Map<AsyncOperation, Object> getSuccessResults() {
+ return successResults;
+ }
+
+ public Map<AsyncOperation, Throwable> getFailureThrowables() {
+ return failureThrowables;
+ }
+
+ public Object[] getParameters(AsyncOperation operation) {
+ return this.params.get(operation);
+ }
+
+ protected boolean isComplete() {
+ int completedOperationsCount = this.successResults.size() + this.failureThrowables.size();
+ return (completedOperationsCount == this.operations.size());
+ }
+
+ protected boolean processCompletedOperation() {
+ if (isComplete()) {
+ if (this.failureThrowables.isEmpty()) {
+ this.callback.onSuccess(this, this.successResults);
+ } else {
+ CompoundAsyncOperationException exception = new CompoundAsyncOperationException(this.successResults,
+ this.failureThrowables);
+ this.callback.onFailure(this, exception);
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/AsyncOperation.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/AsyncOperation.java
new file mode 100644
index 0000000..5db7748
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/AsyncOperation.java
@@ -0,0 +1,31 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.util.async;
+
+/**
+ * An operation that is executed asynchronously and is responsible for calling either onSuccess() or onFailure() on
+ * the specified callback upon completion.
+ *
+ * @author Ian Springer
+ */
+public interface AsyncOperation {
+
+ void execute(AsyncOperationCallback callback, Object... params);
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/AsyncOperationCallback.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/AsyncOperationCallback.java
new file mode 100644
index 0000000..62432a3
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/AsyncOperationCallback.java
@@ -0,0 +1,34 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.util.async;
+
+/**
+ * A callback that one or more {@link AsyncOperation async operation}s should call upon completion.
+ *
+ * @param <T> the type of results the callback supports
+ *
+ * @author Ian Springer
+ */
+public interface AsyncOperationCallback<T> {
+
+ void onFailure(AsyncOperation operation, Throwable caught);
+
+ void onSuccess(AsyncOperation operation, T result);
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/CompoundAsyncOperationException.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/CompoundAsyncOperationException.java
new file mode 100644
index 0000000..ef7dfd3
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/CompoundAsyncOperationException.java
@@ -0,0 +1,47 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.util.async;
+
+import java.util.Map;
+
+/**
+ *
+ * @author Ian Springer
+ */
+public class CompoundAsyncOperationException extends Exception {
+
+ private Map<AsyncOperation,Object> successResults;
+ private Map<AsyncOperation,Throwable> failureThrowables;
+
+ public CompoundAsyncOperationException(Map<AsyncOperation, Object> successResults,
+ Map<AsyncOperation, Throwable> failureThrowables) {
+ super("One or more child operations failed.");
+ this.successResults = successResults;
+ this.failureThrowables = failureThrowables;
+ }
+
+ public Map<AsyncOperation, Object> getSuccessResults() {
+ return successResults;
+ }
+
+ public Map<AsyncOperation, Throwable> getFailureThrowables() {
+ return failureThrowables;
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/ParallelCompoundAsyncOperation.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/ParallelCompoundAsyncOperation.java
new file mode 100644
index 0000000..b06ff2e
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/ParallelCompoundAsyncOperation.java
@@ -0,0 +1,40 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.util.async;
+
+/**
+ * A compound {@link AsyncOperation async operation}, which executes a set of child async operations in parallel. Its
+ * {@link #execute(AsyncOperationCallback, Object...)} method invokes its callback once all child operations have
+ * completed (i.e. invoked their own callbacks).
+ *
+ * @author Ian Springer
+ */
+public class ParallelCompoundAsyncOperation extends AbstractCompoundAsyncOperation {
+
+ @Override
+ public void execute(AsyncOperationCallback callback, Object... params) {
+ super.execute(callback, params);
+
+ for (AsyncOperation operation : getOperations()) {
+ Object[] paramArray = getParameters(operation);
+ operation.execute(this, paramArray);
+ }
+ }
+
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/SerialCompoundAsyncOperation.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/SerialCompoundAsyncOperation.java
new file mode 100644
index 0000000..c83b7da
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/async/SerialCompoundAsyncOperation.java
@@ -0,0 +1,73 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.util.async;
+
+/**
+ * A compound {@link AsyncOperation async operation}, which executes a set of child async operations serially. Its
+ * {@link #execute(AsyncOperationCallback, Object...)} method invokes its callback either when all child operations have
+ * completed (i.e. invoked their own callbacks), or when a child operation fails and abortOnFailure is set to true.
+ *
+ * @author Ian Springer
+ */
+public class SerialCompoundAsyncOperation extends AbstractCompoundAsyncOperation {
+
+ private boolean abortOnFailure;
+ private int executionIndex= -1;
+
+ public void setAbortOnFailure(boolean abortOnFailure) {
+ this.abortOnFailure = abortOnFailure;
+ }
+
+ @Override
+ public void execute(AsyncOperationCallback callback, Object... params) {
+ super.execute(callback, params);
+
+ if (getOperations().isEmpty()) {
+ processCompletedOperation();
+ } else {
+ // Execute the first child operation. processCompletedOperation() will kick off the rest of the child
+ // operations.
+ executeNextOperation();
+ }
+ }
+
+ @Override
+ protected boolean isComplete() {
+ return (super.isComplete() || (this.abortOnFailure && !getFailureThrowables().isEmpty()));
+ }
+
+ @Override
+ protected boolean processCompletedOperation() {
+ boolean isLastCompletedOperation = super.processCompletedOperation();
+ if (!isLastCompletedOperation) {
+ if (this.executionIndex < (getOperations().size() - 1)) {
+ // Execute the next operation.
+ executeNextOperation();
+ }
+ }
+ return (isLastCompletedOperation);
+ }
+
+ private void executeNextOperation() {
+ AsyncOperation operation = getOperations().get(++this.executionIndex);
+ Object[] paramArray = getParameters(operation);
+ operation.execute(this, paramArray);
+ }
+
+}
13 years, 2 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 588f87ff0a29d28cfeff205cbf6f0a172371a689
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Apr 7 13:33:16 2011 -0400
Remove unnecessary fetch of resource type children in the
resource tree build. This speeds up the slowest individual call in
tree construction, the fetch of types, when types have not previously
been fetched (typically the first tree build, when the selected
resource is deep in a tree).
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
index f1f349b..4658996 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
@@ -690,10 +690,8 @@ public class ResourceTreeView extends LocatableVLayout {
updateSelection();
} else {
- ResourceTypeRepository.Cache.getInstance().loadResourceTypes(
- lineage,
- EnumSet.of(ResourceTypeRepository.MetadataType.children,
- ResourceTypeRepository.MetadataType.subCategory),
+ ResourceTypeRepository.Cache.getInstance().loadResourceTypes(lineage,
+ EnumSet.of(ResourceTypeRepository.MetadataType.subCategory),
new ResourceTypeRepository.ResourceTypeLoadedCallback() {
public void onResourceTypeLoaded(List<Resource> result) {
13 years, 2 months
[rhq] 3 commits - modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 2 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java | 3 ---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java | 3 +--
3 files changed, 3 insertions(+), 5 deletions(-)
New commits:
commit 06b68f9718bdddea1c4c81f513b4d995dc10bbff
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 7 11:48:38 2011 -0400
BZ 694537, 693886 - do not double load
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
index 4e47c0a..07ec01f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
@@ -359,9 +359,6 @@ public class UserSessionManager {
return;
}
});
-
- //indicate success to 'login' Callback
- callback.onSuccess(validSessionSubject);
}
});
}//end of server side session check;
commit b417e7916a48cd7ac72c34283bb07145e1ae2d72
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 7 11:48:12 2011 -0400
no need for the tree load to pull in operation data
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
index 455f414..f1f349b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java
@@ -692,8 +692,7 @@ public class ResourceTreeView extends LocatableVLayout {
} else {
ResourceTypeRepository.Cache.getInstance().loadResourceTypes(
lineage,
- EnumSet.of(ResourceTypeRepository.MetadataType.operations,
- ResourceTypeRepository.MetadataType.children,
+ EnumSet.of(ResourceTypeRepository.MetadataType.children,
ResourceTypeRepository.MetadataType.subCategory),
new ResourceTypeRepository.ResourceTypeLoadedCallback() {
commit 4e5866feb065eb74b57482e4bbe316bc153df6d2
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 7 11:47:39 2011 -0400
public opinion says remove this question box before exit
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 3fe259e..f276417 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
@@ -158,11 +158,13 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
}
});
+ /* after having this enabled for a while, the majority opinion is that this is more annoying than helpful
Window.addWindowClosingHandler(new Window.ClosingHandler() {
public void onWindowClosing(Window.ClosingEvent event) {
event.setMessage("Are you sure you want to leave RHQ?");
}
});
+ */
messageCenter = new MessageCenter();
13 years, 2 months