modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
| 26 ++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/UserSessionManager.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java
| 60 +++-------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
| 28 +++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/help/HelpView.java
| 20 ---
5 files changed, 69 insertions(+), 69 deletions(-)
New commits:
commit 85ccbd1698c68a5a7850a32fe364973a5ef704be
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Sep 1 16:55:06 2011 -0400
[BZ 735232] Message portlet should not be displayed on default dashboard in JON
(
https://bugzilla.redhat.com/show_bug.cgi?id=735232); fix layout issues in About
modal window; load ProductInfo once in CoreGUI init and cache it
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 2a52e4d..88801e0 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
@@ -33,6 +33,7 @@ import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Window.Location;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.util.KeyCallback;
@@ -41,10 +42,12 @@ import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.gui.coregui.client.admin.AdministrationView;
import org.rhq.enterprise.gui.coregui.client.alert.AlertHistoryView;
import org.rhq.enterprise.gui.coregui.client.bundle.BundleTopView;
import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardsView;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.help.HelpView;
import org.rhq.enterprise.gui.coregui.client.inventory.InventoryView;
import
org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupDetailView;
@@ -109,6 +112,7 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String>, Event.Na
private MenuBarView menuBarView;
private Footer footer;
private int rpcTimeout;
+ private ProductInfo productInfo;
public void onModuleLoad() {
String hostPageBaseURL = GWT.getHostPageBaseURL();
@@ -262,6 +266,28 @@ public class CoreGUI implements EntryPoint,
ValueChangeHandler<String>, Event.Na
return coreGUI;
}
+ public void init() {
+ if (productInfo == null) {
+ GWTServiceLookup.getSystemService().getProductInfo(new
AsyncCallback<ProductInfo>() {
+ public void onFailure(Throwable caught) {
+
CoreGUI.getErrorHandler().handleError(MSG.view_aboutBox_failedToLoad(), caught);
+ buildCoreUI();
+ }
+
+ public void onSuccess(ProductInfo result) {
+ productInfo = result;
+ buildCoreUI();
+ }
+ });
+ } else {
+ buildCoreUI();
+ }
+ }
+
+ public ProductInfo getProductInfo() {
+ return productInfo;
+ }
+
public void buildCoreUI() {
// If the core gui is already built (eg. from previous login) skip the build and
just refire event
if (rootCanvas == null) {
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 56c3658..7bdcb6e 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
@@ -84,7 +84,7 @@ public class UserSessionManager {
// We want the CoreGUI session timeout to rule them all. The rhq subject session is
refreshed on each SLSB
// call. But the HTTP session will die after 30 minutes. Keep it alive until logout
by pinging SessionAccessServlet
- // occasionaly, as specified by this interval (which must be less than the 30
minutes).
+ // occasionally, as specified by this interval (which must be less than the 30
minutes).
// Currently: 20 minutes
private static int SESSION_ACCESS_REFRESH = 20 * 60 * 1000;
@@ -454,7 +454,7 @@ public class UserSessionManager {
scheduleWebUserUpdate(loggedInSubject);
}
- CoreGUI.get().buildCoreUI();
+ CoreGUI.get().init();
}
public void onFailure(Throwable caught) {
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 6a614bb..b476f66 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
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010-2011 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -18,25 +18,18 @@
*/
package org.rhq.enterprise.gui.coregui.client.components;
-import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.Version;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.Overflow;
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.HTMLPane;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
-import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
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;
@@ -52,8 +45,6 @@ public class AboutModalWindow extends LocatableWindow {
private static final Messages MSG = CoreGUI.getMessages();
- private static ProductInfo PRODUCT_INFO;
-
/**
* <pre>
* ID Format: "simpleClassname_locatorId"
@@ -78,37 +69,19 @@ public class AboutModalWindow extends LocatableWindow {
@Override
protected void onInit() {
- super.onInit();
-
- if (PRODUCT_INFO == null) {
- GWTServiceLookup.getSystemService().getProductInfo(new
AsyncCallback<ProductInfo>() {
- public void onFailure(Throwable caught) {
-
CoreGUI.getErrorHandler().handleError(MSG.view_aboutBox_failedToLoad(), caught);
- }
-
- public void onSuccess(ProductInfo result) {
- PRODUCT_INFO = result;
- setTitle(MSG.view_aboutBox_title(PRODUCT_INFO.getFullName()));
+ ProductInfo productInfo = CoreGUI.get().getProductInfo();
- finishOnInit();
- }
- });
- } else {
- finishOnInit();
- }
- }
+ setTitle(MSG.view_aboutBox_title(productInfo.getFullName()));
- private void finishOnInit() {
LocatableVLayout contentPane = new
LocatableVLayout(extendLocatorId("Content"));
- contentPane.setPadding(13);
- contentPane.setMembersMargin(25);
-
- HTMLFlow htmlFlow = new HTMLFlow();
- String html = "<span class=\"DisplaySubhead\">\n" +
" <a href=\"" + PRODUCT_INFO.getUrl() + "\"
title=\""
- + PRODUCT_INFO.getFullName() + " " + PRODUCT_INFO.getUrl() +
"\" target=\"_blank\">"
- + PRODUCT_INFO.getFullName() + "</a>\n" +
"</span><br/>\n" + "<span
class=\"DisplayLabel\">"
- + MSG.view_aboutBox_version() + " " + PRODUCT_INFO.getVersion() +
"</span><br/>\n"
- + "<span class=\"DisplayLabel\">" +
MSG.view_aboutBox_buildNumber() + " " + PRODUCT_INFO.getBuildNumber()
+ contentPane.setPadding(10);
+
+ HTMLPane htmlPane = new HTMLPane();
+ String html = "<span class=\"DisplaySubhead\">\n" +
" <a href=\"" + productInfo.getUrl() + "\"
title=\""
+ + productInfo.getFullName() + " " + productInfo.getUrl() +
"\" target=\"_blank\">"
+ + productInfo.getFullName() + "</a>\n" +
"</span><br/>\n" + "<span
class=\"DisplayLabel\">"
+ + MSG.view_aboutBox_version() + " " + productInfo.getVersion() +
"</span><br/>\n"
+ + "<span class=\"DisplayLabel\">" +
MSG.view_aboutBox_buildNumber() + " " + productInfo.getBuildNumber()
+ "</span><p/>\n" + "<span
class=\"DisplayLabel\">GWT " + MSG.common_title_version() + ":
"
+ MSG.common_buildInfo_gwtVersion() + "</span><br/>\n"
+ "<span class=\"DisplayLabel\">SmartGWT "
+ MSG.common_title_version() + ": " + Version.getVersion() +
"</span><br/>\n"
@@ -116,17 +89,19 @@ public class AboutModalWindow extends LocatableWindow {
+ " <img height=\"55\" alt=\"" +
MSG.view_aboutBox_jbossByRedHat()
+ "\" src=\"/images/jboss_logo.png\">\n" +
"</a></p>\n" + "<div style=\"top-margin:
10px\">"
+ MSG.view_aboutBox_allRightsReserved() + "</div>\n";
- htmlFlow.setContents(html);
- contentPane.addMember(htmlFlow);
+ htmlPane.setContents(html);
+ htmlPane.setHeight(220);
+ contentPane.addMember(htmlPane);
LocatableHLayout buttonBar = new
LocatableHLayout(contentPane.extendLocatorId("ButtonBar"));
+ buttonBar.setHeight(30);
buttonBar.setAlign(Alignment.RIGHT);
LocatableIButton closeButton = new
LocatableIButton(buttonBar.extendLocatorId("Close"),
MSG.common_button_close());
closeButton.setShowRollOver(true);
closeButton.setShowDown(true);
- closeButton.setWidth("60");
+ closeButton.setWidth(60);
closeButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
hide();
@@ -143,4 +118,5 @@ public class AboutModalWindow extends LocatableWindow {
// Layout class.
addItem(contentPane);
}
+
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
index 7d0ec7a..424b256 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 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
@@ -45,6 +45,7 @@ import com.smartgwt.client.widgets.tab.events.TabSelectedEvent;
import com.smartgwt.client.widgets.tab.events.TabSelectedHandler;
import org.rhq.core.domain.authz.Permission;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.criteria.DashboardCriteria;
import org.rhq.core.domain.dashboard.Dashboard;
@@ -361,21 +362,32 @@ public class DashboardsView extends LocatableVLayout implements
DashboardContain
dashboard.setColumnWidths("32%");
dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND,
"#F1F2F3"));
+ ProductInfo productInfo = CoreGUI.get().getProductInfo();
+ boolean isRHQ = (productInfo != null) &&
"RHQ".equals(productInfo.getShortName());
+
// Left Column
- DashboardPortlet welcome = new DashboardPortlet(MessagePortlet.NAME,
MessagePortlet.KEY, 250);
- dashboard.addPortlet(welcome, 0, 0);
+ int columnIndex = 0;
+ int rowIndex = 0;
+
+ if (isRHQ) {
+ DashboardPortlet welcome = new DashboardPortlet(MessagePortlet.NAME,
MessagePortlet.KEY, 250);
+ dashboard.addPortlet(welcome, columnIndex, rowIndex++);
+ }
DashboardPortlet summary = new DashboardPortlet(InventorySummaryPortlet.NAME,
InventorySummaryPortlet.KEY, 250);
- dashboard.addPortlet(summary, 0, 1);
+ dashboard.addPortlet(summary, columnIndex, rowIndex++);
DashboardPortlet news = new DashboardPortlet(MashupPortlet.NAME,
MashupPortlet.KEY, 300);
news.getConfiguration().put(
new PropertySimple("address",
"http://rhq-project.org/display/RHQ/RHQ+News?decorator=popup"));
- dashboard.addPortlet(news, 0, 2);
+ dashboard.addPortlet(news, columnIndex, rowIndex++);
// Right Column
+ columnIndex = 1;
+ rowIndex = 0;
+
DashboardPortlet recentAlerts = new DashboardPortlet(RecentAlertsPortlet.NAME,
RecentAlertsPortlet.KEY, 250);
- dashboard.addPortlet(recentAlerts, 1, 0);
+ dashboard.addPortlet(recentAlerts, columnIndex, rowIndex++);
DashboardPortlet problemResources = new
DashboardPortlet(ProblemResourcesPortlet.NAME,
ProblemResourcesPortlet.KEY, 250);
@@ -388,11 +400,11 @@ public class DashboardsView extends LocatableVLayout implements
DashboardContain
.put(
new PropertySimple(ProblemResourcesPortlet.PROBLEM_RESOURCE_SHOW_HRS,
ProblemResourcesPortlet.defaultValue));
- dashboard.addPortlet(problemResources, 1, 1);
+ dashboard.addPortlet(problemResources, columnIndex, rowIndex++);
DashboardPortlet operations = new DashboardPortlet(OperationHistoryPortlet.NAME,
OperationHistoryPortlet.KEY,
200);
- dashboard.addPortlet(operations, 1, 2);
+ dashboard.addPortlet(operations, columnIndex, rowIndex++);
return dashboard;
}
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 22a0c13..8f4df4b 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
@@ -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
@@ -26,7 +26,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.MissingResourceException;
-import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Label;
@@ -41,7 +40,6 @@ import
org.rhq.enterprise.gui.coregui.client.components.view.NavigationItem;
import org.rhq.enterprise.gui.coregui.client.components.view.NavigationSection;
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.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/**
@@ -96,20 +94,8 @@ public class HelpView extends AbstractSectionedLeftNavigationView {
"[SKIN]/../actions/help.png", new ViewFactory() {
public Canvas createView() {
final AboutModalWindow aboutModalWindow = new
AboutModalWindow(extendLocatorId("AboutModalWindow"));
- if (PRODUCT_INFO == null) {
- GWTServiceLookup.getSystemService().getProductInfo(new
AsyncCallback<ProductInfo>() {
- public void onFailure(Throwable caught) {
-
CoreGUI.getErrorHandler().handleError(MSG.view_aboutBox_failedToLoad(), caught);
- }
-
- public void onSuccess(ProductInfo result) {
- PRODUCT_INFO = result;
-
aboutModalWindow.setTitle(MSG.view_aboutBox_title(PRODUCT_INFO.getFullName()));
- }
- });
- } else {
-
aboutModalWindow.setTitle(MSG.view_aboutBox_title(PRODUCT_INFO.getFullName()));
- }
+ ProductInfo productInfo = CoreGUI.get().getProductInfo();
+
aboutModalWindow.setTitle(MSG.view_aboutBox_title(productInfo.getFullName()));
aboutModalWindow.show();
return aboutModalWindow;
}