modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
| 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
| 111 +++++++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationsPortlet.java
| 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
| 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/RecentOperationsDataSource.java
| 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/resource/ProblemResourcesDataSource.java
| 11
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementProblemManagerBean.java
| 4
8 files changed, 111 insertions(+), 41 deletions(-)
New commits:
commit 1ae7fb4e0b0221b83d3173417a384c48dec5ef89
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 1 20:06:12 2011 -0400
Global Dash/Portlet work
- eliminate title from RecentAlertsPortlet. Was redundant with
window title and cost real estate.
- Fix issues with honoring max rows in ProblemResourcesPortlet and
OperationsPortlet
- Change default max-rows config for several portlets to speed up
default dash:
- max recent alerts to 5
- max recent ops to 5
- max scheduled ops to 5
- max problem resources to 20
- set sort for problem resources to alertCount,name (was just name)
- Changes to Default Dash for perf and monitoring focus
- Eliminate Discovery Queue from default dash. Relatively slow, not useful
for non-perm users, easily navigable to in Inventory
- Eliminate Recently imported from default dash. Not very useful and rarely
changing.
- Move Welcome to Left column. Did not need space and gives priority to
monitoring portlets. (When deleted it will put Inventory Summary at top
of Left Column)
- Move RHQ News Mashup to Left column to deprioritize and use less real estate
- resize a few portlets/row sizes for better presentation and space utilization
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
index 2746c41..0a64610 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertHistoryView.java
@@ -84,6 +84,10 @@ public class AlertHistoryView extends
TableSection<AlertDataSource> {
this(locatorId, SUBSYSTEM_VIEW_ID.getTitle(), entityContext, false);
}
+ public AlertHistoryView(String locatorId, String tableTitle, EntityContext
entityContext) {
+ this(locatorId, tableTitle, entityContext, false);
+ }
+
protected AlertHistoryView(String locatorId, String tableTitle, EntityContext
context, boolean hasWriteAccess) {
super(locatorId, tableTitle, new SortSpecifier[] { DEFAULT_SORT_SPECIFIER });
this.context = context;
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 f3d1c69..95780fd 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
@@ -61,13 +61,10 @@ import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.components.tab.NamedTab;
import org.rhq.enterprise.gui.coregui.client.components.tab.NamedTabSet;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
-import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.queue.AutodiscoveryPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.alerts.RecentAlertsPortlet;
-import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.imported.RecentlyAddedResourcesPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.operations.OperationsPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.problems.ProblemResourcesPortlet;
import
org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.InventorySummaryPortlet;
-import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.TagCloudPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util.MashupPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util.MessagePortlet;
import org.rhq.enterprise.gui.coregui.client.gwt.DashboardGWTServiceAsync;
@@ -294,6 +291,66 @@ public class DashboardsView extends LocatableVLayout implements
DashboardContain
return dashboardName;
}
+ /*
+ protected Dashboard getDefaultDashboard() {
+
+ Dashboard dashboard = new Dashboard();
+ dashboard.setName(MSG.common_title_default());
+ dashboard.setCategory(DashboardCategory.INVENTORY);
+ dashboard.setColumns(2);
+ // only leftmost column width is currently settable, the rest are equally
divided
+ dashboard.setColumnWidths("32%");
+ dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND,
"#F1F2F3"));
+
+ // Left Column
+ DashboardPortlet summary = new DashboardPortlet(InventorySummaryPortlet.NAME,
InventorySummaryPortlet.KEY, 210);
+ dashboard.addPortlet(summary, 0, 0);
+
+ DashboardPortlet discoveryQueue = new
DashboardPortlet(AutodiscoveryPortlet.NAME, AutodiscoveryPortlet.KEY, 230);
+ dashboard.addPortlet(discoveryQueue, 0, 1);
+
+ DashboardPortlet recentlyAdded = new
DashboardPortlet(RecentlyAddedResourcesPortlet.NAME,
+ RecentlyAddedResourcesPortlet.KEY, 230);
+ dashboard.addPortlet(recentlyAdded, 0, 2);
+
+ DashboardPortlet tagCloud = new DashboardPortlet(TagCloudPortlet.NAME,
TagCloudPortlet.KEY, 230);
+ dashboard.addPortlet(tagCloud, 0, 3);
+
+ // Right Column
+ DashboardPortlet welcome = new DashboardPortlet(MessagePortlet.NAME,
MessagePortlet.KEY, 210);
+ welcome.getConfiguration().put(
+ new PropertySimple("message",
MSG.view_dashboardsManager_message_title_details()));
+ dashboard.addPortlet(welcome, 1, 0);
+
+ DashboardPortlet recentAlerts = new
DashboardPortlet(RecentAlertsPortlet.NAME, RecentAlertsPortlet.KEY, 230);
+ dashboard.addPortlet(recentAlerts, 1, 1);
+
+ DashboardPortlet problemResources = new
DashboardPortlet(ProblemResourcesPortlet.NAME,
+ ProblemResourcesPortlet.KEY, 230);
+ //initialize config for the problemResources portlet.
+ problemResources.getConfiguration()
+ .put(
+ new
PropertySimple(ProblemResourcesPortlet.PROBLEM_RESOURCE_SHOW_MAX,
+ ProblemResourcesPortlet.defaultValue));
+ problemResources.getConfiguration()
+ .put(
+ new
PropertySimple(ProblemResourcesPortlet.PROBLEM_RESOURCE_SHOW_HRS,
+ ProblemResourcesPortlet.defaultValue));
+ dashboard.addPortlet(problemResources, 1, 2);
+
+ DashboardPortlet operations = new DashboardPortlet(OperationsPortlet.NAME,
OperationsPortlet.KEY, 420);
+ dashboard.addPortlet(operations, 1, 3);
+
+ DashboardPortlet news = new DashboardPortlet(MashupPortlet.NAME,
MashupPortlet.KEY, 350);
+ news.getConfiguration().put(
+ new PropertySimple("address",
"http://rhq-project.org/display/RHQ/RHQ+News?decorator=popup"));
+ dashboard.addPortlet(news, 1, 4);
+
+ return dashboard;
+
+ }
+ */
+
protected Dashboard getDefaultDashboard() {
Dashboard dashboard = new Dashboard();
@@ -305,30 +362,25 @@ public class DashboardsView extends LocatableVLayout implements
DashboardContain
dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND,
"#F1F2F3"));
// Left Column
- DashboardPortlet summary = new DashboardPortlet(InventorySummaryPortlet.NAME,
InventorySummaryPortlet.KEY, 210);
- dashboard.addPortlet(summary, 0, 0);
-
- DashboardPortlet discoveryQueue = new DashboardPortlet(AutodiscoveryPortlet.NAME,
AutodiscoveryPortlet.KEY, 230);
- dashboard.addPortlet(discoveryQueue, 0, 1);
+ DashboardPortlet welcome = new DashboardPortlet(MessagePortlet.NAME,
MessagePortlet.KEY, 250);
+ welcome.getConfiguration().put(
+ new PropertySimple("message",
MSG.view_dashboardsManager_message_title_details()));
+ dashboard.addPortlet(welcome, 0, 0);
- DashboardPortlet recentlyAdded = new
DashboardPortlet(RecentlyAddedResourcesPortlet.NAME,
- RecentlyAddedResourcesPortlet.KEY, 230);
- dashboard.addPortlet(recentlyAdded, 0, 2);
+ DashboardPortlet summary = new DashboardPortlet(InventorySummaryPortlet.NAME,
InventorySummaryPortlet.KEY, 250);
+ dashboard.addPortlet(summary, 0, 1);
- DashboardPortlet tagCloud = new DashboardPortlet(TagCloudPortlet.NAME,
TagCloudPortlet.KEY, 230);
- dashboard.addPortlet(tagCloud, 0, 3);
+ 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);
// Right Column
- DashboardPortlet welcome = new DashboardPortlet(MessagePortlet.NAME,
MessagePortlet.KEY, 210);
- welcome.getConfiguration().put(
- new PropertySimple("message",
MSG.view_dashboardsManager_message_title_details()));
- dashboard.addPortlet(welcome, 1, 0);
-
- DashboardPortlet recentAlerts = new DashboardPortlet(RecentAlertsPortlet.NAME,
RecentAlertsPortlet.KEY, 230);
- dashboard.addPortlet(recentAlerts, 1, 1);
+ DashboardPortlet recentAlerts = new DashboardPortlet(RecentAlertsPortlet.NAME,
RecentAlertsPortlet.KEY, 250);
+ dashboard.addPortlet(recentAlerts, 1, 0);
DashboardPortlet problemResources = new
DashboardPortlet(ProblemResourcesPortlet.NAME,
- ProblemResourcesPortlet.KEY, 230);
+ ProblemResourcesPortlet.KEY, 250);
//initialize config for the problemResources portlet.
problemResources.getConfiguration()
.put(
@@ -338,18 +390,17 @@ public class DashboardsView extends LocatableVLayout implements
DashboardContain
.put(
new PropertySimple(ProblemResourcesPortlet.PROBLEM_RESOURCE_SHOW_HRS,
ProblemResourcesPortlet.defaultValue));
- dashboard.addPortlet(problemResources, 1, 2);
+ dashboard.addPortlet(problemResources, 1, 1);
- DashboardPortlet operations = new DashboardPortlet(OperationsPortlet.NAME,
OperationsPortlet.KEY, 420);
- dashboard.addPortlet(operations, 1, 3);
-
- DashboardPortlet news = new DashboardPortlet(MashupPortlet.NAME,
MashupPortlet.KEY, 350);
- news.getConfiguration().put(
- new PropertySimple("address",
"http://rhq-project.org/display/RHQ/RHQ+News?decorator=popup"));
- dashboard.addPortlet(news, 1, 4);
+ DashboardPortlet operations = new DashboardPortlet(OperationsPortlet.NAME,
OperationsPortlet.KEY, 350);
+ //initialize config for the operations portlet.
+ operations.getConfiguration().put(
+ new PropertySimple(OperationsPortlet.OPERATIONS_RANGE_COMPLETED,
OperationsPortlet.defaultValue));
+ operations.getConfiguration().put(
+ new PropertySimple(OperationsPortlet.OPERATIONS_RANGE_SCHEDULED,
OperationsPortlet.defaultValue));
+ dashboard.addPortlet(operations, 1, 2);
return dashboard;
-
}
public void addNewDashboard() {
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
index 388094a..763ed79 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
@@ -62,7 +62,7 @@ public abstract class AbstractRecentAlertsPortlet extends
AlertHistoryView imple
private Timer refreshTimer;
public AbstractRecentAlertsPortlet(String locatorId, EntityContext entityContext) {
- super(locatorId, entityContext);
+ super(locatorId, null, entityContext);
setShowFilterForm(false); //disable filter form for portlet
setOverflow(Overflow.VISIBLE);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationsPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationsPortlet.java
index dad4578..0b02c38 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationsPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationsPortlet.java
@@ -98,7 +98,7 @@ public class OperationsPortlet extends LocatableVLayout implements
CustomSetting
private RecentOperationsDataSource dataSourceCompleted;
private ScheduledOperationsDataSource dataSourceScheduled;
public static String unlimited = MSG.common_label_unlimited();
- public static String defaultValue = unlimited;
+ public static String defaultValue = "5";
public static boolean defaultEnabled = true;
private Timer refreshTimer;
@@ -133,8 +133,7 @@ public class OperationsPortlet extends LocatableVLayout implements
CustomSetting
recentOperationsGrid.setHeaderSpans(new HeaderSpan(RECENT_OPERATIONS,
completedRows));
recentOperationsGrid.setHeaderSpanHeight(20);
recentOperationsGrid.setHeaderHeight(40);
- recentOperationsGrid.setResizeFieldsInRealTime(true);
- recentOperationsGrid.setCellHeight(50);
+ //recentOperationsGrid.setResizeFieldsInRealTime(true);
recentOperationsGrid.setWrapCells(true);
addMember(recentOperationsGrid);
@@ -154,8 +153,7 @@ public class OperationsPortlet extends LocatableVLayout implements
CustomSetting
scheduledOperationsGrid.setHeaderHeight(40);
scheduledOperationsGrid.setTitle(SCHEDULED_OPERATIONS);
- scheduledOperationsGrid.setResizeFieldsInRealTime(true);
- scheduledOperationsGrid.setCellHeight(50);
+ //scheduledOperationsGrid.setResizeFieldsInRealTime(true);
scheduledOperationsGrid.setWrapCells(true);
addMember(scheduledOperationsGrid);
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
index f91c4cf..7eac876 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
@@ -92,7 +92,7 @@ public class ProblemResourcesPortlet extends
Table<ProblemResourcesDataSource> i
//constants
public static final String unlimited = MSG.common_label_unlimited();
- public static final String defaultValue = unlimited;
+ public static final String defaultValue = "20";
private Timer refreshTimer;
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/RecentOperationsDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/RecentOperationsDataSource.java
index cf93986..1af0364 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/RecentOperationsDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/operation/RecentOperationsDataSource.java
@@ -219,7 +219,15 @@ public class RecentOperationsDataSource extends
RPCDataSource<ResourceOperationL
record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY_VALUE,
AncestryUtil.getAncestryValue(record));
}
response.setData(records);
- response.setTotalRows(result.getTotalSize()); // for paging to work we
have to specify size of full result set
+
+ // for paging to work we have to specify size of full result set, but if
a limit has been set,
+ // respect the limit
+ int resultSize = result.getTotalSize();
+ int limit = getOperationsRangeCompleted();
+ if (limit > 0 && limit < resultSize) {
+ resultSize = limit;
+ }
+ response.setTotalRows(resultSize);
processResponse(request.getRequestId(), response);
}
});
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/resource/ProblemResourcesDataSource.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/resource/ProblemResourcesDataSource.java
index ac4318a..3926fc5 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/resource/ProblemResourcesDataSource.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/resource/ProblemResourcesDataSource.java
@@ -131,7 +131,8 @@ public class ProblemResourcesDataSource extends
RPCDataSource<ProblemResourceCom
@Override
protected Criteria getFetchCriteria(DSRequest request) {
- // we don't use criterias for this datasource, just return null
+ // we don't use criteria fetch for this datasource, just return null
+
return null;
}
@@ -207,7 +208,13 @@ public class ProblemResourcesDataSource extends
RPCDataSource<ProblemResourceCom
record.setAttribute(AncestryUtil.RESOURCE_ANCESTRY_VALUE,
AncestryUtil.getAncestryValue(record));
}
response.setData(records);
- response.setTotalRows(result.getTotalSize()); // for paging to work we
have to specify size of full result set
+ // for paging to work we have to specify size of full result set, but if
a limit has been set,
+ // respect the limit
+ int resultSize = result.getTotalSize();
+ if (maximumProblemResourcesToDisplay > 0 &&
maximumProblemResourcesToDisplay < resultSize) {
+ resultSize = maximumProblemResourcesToDisplay;
+ }
+ response.setTotalRows(resultSize);
processResponse(request.getRequestId(), response);
}
});
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementProblemManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementProblemManagerBean.java
index 8d9bd4c..d398141 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementProblemManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementProblemManagerBean.java
@@ -34,6 +34,7 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.composite.ProblemResourceComposite;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
import org.rhq.core.server.PersistenceUtility;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
@@ -54,7 +55,8 @@ public class MeasurementProblemManagerBean implements
MeasurementProblemManagerL
@SuppressWarnings("unchecked")
public PageList<ProblemResourceComposite> findProblemResources(Subject subject,
long oldestDate, PageControl pc) {
- pc.initDefaultOrderingField("res.name");
+ pc.initDefaultOrderingField("COUNT(DISTINCT alert.id)",
PageOrdering.DESC);
+ pc.addDefaultOrderingField("res.name");
Query queryCount;
Query query;