modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
| 30
modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceInstallCount.java
| 19
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
| 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java
| 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReport.java
| 301 ++++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReportResourceSearchView.java
| 191 ++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
| 40 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReport.java
| 21
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReportResourceSearchView.java
| 134 ----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
| 29
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
| 3
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
| 12
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
| 9
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
| 15
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
| 9
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Pinned_active.png
|binary
modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Pinned_inactive.png
|binary
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
| 29
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
| 2
19 files changed, 621 insertions(+), 237 deletions(-)
New commits:
commit d545b1925aa9712236ee636a6f4d66e7a88d5846
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Nov 18 17:16:55 2011 -0500
Integrated new drift pinned icons into code.
- Note, kept unpinned as is (grey, left pointing) but put new active
pinned (green, downpointing) icon in place. There is a new inactive
pinned icon (similar if not same to previous greyed, downpointing), but
it's not incorporated into any views as of now.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
index 1b8b978..3d95849 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java
@@ -99,7 +99,14 @@ public class ImageManager {
* Returns a generic pinned icon.
*/
public static String getPinnedIcon() {
- return "[SKIN]/headerIcons/pin_down.png";
+ return "subsystems/drift/Pinned_active.png";
+ }
+
+ /**
+ * Returns a generic pinned icon.
+ */
+ public static String getPinnedInactiveIcon() {
+ return "subsystems/drift/Pinned_inactive.png";
}
public static String getDriftIcon() {
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Pinned_active.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Pinned_active.png
new file mode 100644
index 0000000..3c98f46
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Pinned_active.png
differ
diff --git
a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Pinned_inactive.png
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Pinned_inactive.png
new file mode 100644
index 0000000..f3e3ffa
Binary files /dev/null and
b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/drift/Pinned_inactive.png
differ
commit d8a00d8623e694df6bdd2926d0cfc523029d1bd5
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Nov 18 17:13:36 2011 -0500
Create new Drift Compliance Report
Similar to the Inventory Summary report with two differences:
1. Constrained to types that provide drift monitoring
2. Adds compliance columns
- Restored Inventory Summary Report to its former self, removing the
compliance stuff that had been added. This makes it more focused and
faster.
- Added separate SLSB support for the new report.
- Fixed a problem in the compliance queries that generated the wrong
resource count.
- Fixed sorting issue for compliance column in report's resource view
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
index c2dbe74..dd5da1b 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java
@@ -740,31 +740,31 @@ import org.rhq.core.domain.util.Summary;
+ "GROUP BY r.resourceType.name, r.resourceType.plugin,
r.resourceType.category, r.resourceType.id " //
+ "ORDER BY r.resourceType.category, r.resourceType.plugin,
r.resourceType.name "),
- // @NamedQuery(name = Resource.QUERY_RESOURCE_VERSION_REPORT, query = ""
//
- // + "SELECT new
org.rhq.core.domain.resource.composite.ResourceInstallCount( " //
- // + "r.resourceType.name, r.resourceType.plugin,
r.resourceType.category, r.resourceType.id, count(r), r.version) " //
- // + "FROM Resource r " //
- // + "WHERE r.inventoryStatus = 'COMMITTED' " //
- // + "GROUP BY r.resourceType.name, r.resourceType.plugin,
r.resourceType.category, r.resourceType.id, r.version " //
- // + "ORDER BY r.resourceType.category, r.resourceType.plugin,
r.resourceType.name, r.version "),
+ @NamedQuery(name = Resource.QUERY_RESOURCE_VERSION_REPORT, query = "" //
+ + "SELECT new org.rhq.core.domain.resource.composite.ResourceInstallCount(
" //
+ + "r.resourceType.name, r.resourceType.plugin, r.resourceType.category,
r.resourceType.id, count(r), r.version) " //
+ + "FROM Resource r " //
+ + "WHERE r.inventoryStatus = 'COMMITTED' " //
+ + "GROUP BY r.resourceType.name, r.resourceType.plugin,
r.resourceType.category, r.resourceType.id, r.version " //
+ + "ORDER BY r.resourceType.category, r.resourceType.plugin,
r.resourceType.name, r.version "),
@NamedQuery(name = Resource.QUERY_RESOURCE_VERSION_AND_DRIFT_IN_COMPLIANCE, query =
""
+ "SELECT new
org.rhq.core.domain.resource.composite.ResourceInstallCount("
- + "r.resourceType.name, r.resourceType.plugin, r.resourceType.category,
r.resourceType.id, count(r), "
+ + "r.resourceType.name, r.resourceType.plugin, r.resourceType.category,
r.resourceType.id, count(distinct r), "
+ "r.version, size(templates), 0) "
- + "FROM Resource r JOIN r.resourceType type LEFT JOIN
type.driftDefinitionTemplates templates "
- + "WHERE r.inventoryStatus = 'COMMITTED' AND 0 = (" + "
SELECT COUNT(defs) "
- + " FROM r.driftDefinitions defs " + " WHERE NOT
defs.complianceStatus = 0) "
+ + "FROM Resource r JOIN r.resourceType type JOIN
type.driftDefinitionTemplates templates "
+ + "WHERE r.inventoryStatus = 'COMMITTED' AND " //
+ + " 0 = ( SELECT COUNT(defs) FROM r.driftDefinitions defs WHERE NOT
defs.complianceStatus = 0) "
+ "GROUP BY r.resourceType.name, r.resourceType.plugin,
r.resourceType.category, r.resourceType.id, r.version "
+ "ORDER BY r.resourceType.category, r.resourceType.plugin,
r.resourceType.name, r.version "),
@NamedQuery(name = Resource.QUERY_RESOURCE_VERSION_AND_DRIFT_OUT_OF_COMPLIANCE, query
= ""
+ "SELECT new
org.rhq.core.domain.resource.composite.ResourceInstallCount("
- + "r.resourceType.name, r.resourceType.plugin, r.resourceType.category,
r.resourceType.id, count(r), "
+ + "r.resourceType.name, r.resourceType.plugin, r.resourceType.category,
r.resourceType.id, count(distinct r), "
+ "r.version, size(templates), 1) "
- + "FROM Resource r JOIN r.resourceType type LEFT JOIN
type.driftDefinitionTemplates templates "
- + "WHERE r.inventoryStatus = 'COMMITTED' AND 0 < (" + "
SELECT COUNT(defs) "
- + " FROM r.driftDefinitions defs " + " WHERE
defs.complianceStatus <> 0) "
+ + "FROM Resource r JOIN r.resourceType type JOIN
type.driftDefinitionTemplates templates "
+ + "WHERE r.inventoryStatus = 'COMMITTED' AND " //
+ + " 0 < ( SELECT COUNT(defs) FROM r.driftDefinitions defs WHERE
defs.complianceStatus <> 0) "
+ "GROUP BY r.resourceType.name, r.resourceType.plugin,
r.resourceType.category, r.resourceType.id, r.version "
+ "ORDER BY r.resourceType.category, r.resourceType.plugin,
r.resourceType.name, r.version ") })
@SequenceGenerator(name = "RHQ_RESOURCE_SEQ", sequenceName =
"RHQ_RESOURCE_ID_SEQ")
diff --git
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceInstallCount.java
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceInstallCount.java
index 030dcc6..877686f 100644
---
a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceInstallCount.java
+++
b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceInstallCount.java
@@ -41,6 +41,15 @@ public class ResourceInstallCount implements Serializable {
public ResourceInstallCount() {
}
+ public ResourceInstallCount(String typeName, String typePlugin, ResourceCategory
category, int typeId, long count) {
+ this(typeName, typePlugin, category, typeId, count, null, -1, -1);
+ }
+
+ public ResourceInstallCount(String typeName, String typePlugin, ResourceCategory
category, int typeId, long count,
+ String version) {
+ this(typeName, typePlugin, category, typeId, count, version, -1, -1);
+ }
+
public ResourceInstallCount(String typeName, String typePlugin, ResourceCategory
category, int typeId, long count,
String version, int numDriftTemplates, int inCompliance) {
this.count = count;
@@ -53,16 +62,6 @@ public class ResourceInstallCount implements Serializable {
this.inCompliance = inCompliance == 0;
}
-
- public ResourceInstallCount(String typeName, String typePlugin, ResourceCategory
category, int typeId, long count) {
- this.count = count;
- this.typeName = typeName;
- this.typePlugin = typePlugin;
- this.category = category;
- this.typeId = typeId;
- }
-
-
public long getCount() {
return count;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java
index f44cf8e..5842483 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java
@@ -71,6 +71,10 @@ public interface ResourceGWTService extends RemoteService {
PageList<ProblemResourceComposite> findProblemResources(long ctime, int
maxItems) throws RuntimeException;
+ List<ResourceInstallCount> findResourceComplianceCounts() throws
RuntimeException;
+
+ List<ResourceInstallCount> findResourceInstallCounts(boolean groupByVersions)
throws RuntimeException;
+
Resource getPlatformForResource(int resourceId) throws RuntimeException;
Map<Resource, List<Resource>>
getQueuedPlatformsAndServers(HashSet<InventoryStatus> statuses, PageControl pc)
@@ -94,5 +98,4 @@ public interface ResourceGWTService extends RemoteService {
List<Integer> uninventoryResources(int[] resourceIds) throws RuntimeException;
- List<ResourceInstallCount> findResourceInstallCounts(boolean groupByVersions)
throws RuntimeException;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReport.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReport.java
new file mode 100644
index 0000000..51e9282
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReport.java
@@ -0,0 +1,301 @@
+/*
+ * 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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * 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.report;
+
+import java.util.HashMap;
+import java.util.List;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.data.Record;
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.widgets.events.DoubleClickEvent;
+import com.smartgwt.client.widgets.events.DoubleClickHandler;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.HoverCustomizer;
+import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.core.domain.resource.composite.ResourceInstallCount;
+import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.ImageManager;
+import org.rhq.enterprise.gui.coregui.client.ViewPath;
+import org.rhq.enterprise.gui.coregui.client.components.table.Table;
+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.gwt.ResourceGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+
+/**
+ * A tweaked version of the InventorySummary report that narrows the relevant types to
those that support Drift
+ * monitoring, and shows the compliance state of each type.
+ *
+ * @author Jay Shaughnessy
+ */
+public class DriftComplianceReport extends LocatableVLayout implements BookmarkableView
{
+
+ public static final ViewName VIEW_ID = new ViewName("DriftCompliance",
MSG.view_reports_driftCompliance());
+
+ private ResourceSearchView resourceList;
+
+ public DriftComplianceReport(String locatorId) {
+ super(locatorId);
+
+ setHeight100();
+ setWidth100();
+ }
+
+ @Override
+ public void renderView(ViewPath viewPath) {
+ if (!viewPath.isEnd()) {
+ int resourceTypeId = Integer.parseInt(viewPath.getCurrent().getPath());
+ viewPath.next();
+ Criteria criteria;
+ if (!viewPath.isEnd()) {
+ String resourceVersion = viewPath.getCurrent().getPath();
+ criteria = createResourceSearchViewCriteria(resourceTypeId,
resourceVersion);
+ } else {
+ criteria = createResourceSearchViewCriteria(resourceTypeId);
+ }
+ showResourceList(criteria);
+ } else {
+ hideResourceList();
+ }
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+
+ addMember(new DriftComplianceReportTable(extendLocatorId("table")));
+ }
+
+ protected Criteria createResourceSearchViewCriteria(int resourceTypeId) {
+ Criteria criteria = new Criteria();
+ criteria.addCriteria(ResourceDataSourceField.TYPE.propertyName(),
resourceTypeId);
+ return criteria;
+ }
+
+ protected Criteria createResourceSearchViewCriteria(int resourceTypeId, String
resourceVersion) {
+ Criteria criteria = new Criteria();
+ criteria.addCriteria(ResourceDataSourceField.TYPE.propertyName(),
resourceTypeId);
+ criteria.addCriteria("version", resourceVersion);
+ return criteria;
+ }
+
+ private void showResourceList(Criteria criteria) {
+ hideResourceList();
+ resourceList = new
DriftComplianceReportResourceSearchView(extendLocatorId("resourceList"),
criteria);
+ addMember(resourceList);
+ markForRedraw();
+ }
+
+ private void hideResourceList() {
+ if (resourceList != null) {
+ removeMember(resourceList);
+ resourceList.destroy();
+ resourceList = null;
+ }
+ markForRedraw();
+ }
+
+ class DriftComplianceReportTable extends
Table<DriftComplianceReportTable.DataSource> {
+
+ public DriftComplianceReportTable(String locatorId) {
+ super(locatorId, VIEW_ID.getTitle());
+ setDataSource(new DataSource());
+ }
+
+ @Override
+ protected void configureTable() {
+ ListGridField fieldTypeName = new ListGridField(DataSource.Field.TYPENAME,
MSG.common_title_resource_type());
+ ListGridField fieldPlugin = new ListGridField(DataSource.Field.TYPEPLUGIN,
MSG.common_title_plugin());
+ ListGridField fieldCategory = new ListGridField(DataSource.Field.CATEGORY,
MSG.common_title_category());
+ ListGridField fieldVersion = new ListGridField(DataSource.Field.VERSION,
MSG.common_title_version());
+ ListGridField fieldCount = new ListGridField(DataSource.Field.COUNT,
MSG.common_title_count());
+
+ ListGridField fieldInCompliance = new
ListGridField(DataSource.Field.IN_COMPLIANCE, MSG
+ .common_title_in_compliance());
+ HashMap<String, String> complianceIcons = new HashMap<String,
String>();
+ complianceIcons.put("true",
ImageManager.getAvailabilityIcon(true));
+ complianceIcons.put("false",
ImageManager.getAvailabilityIcon(false));
+ fieldInCompliance.setValueIcons(complianceIcons);
+ fieldInCompliance.setType(ListGridFieldType.ICON);
+ fieldInCompliance.setCanSortClientOnly(true);
+
+ fieldTypeName.setWidth("35%");
+ fieldPlugin.setWidth("10%");
+ fieldCategory.setWidth(70);
+ fieldVersion.setWidth("*");
+ fieldCount.setWidth(60);
+ fieldInCompliance.setWidth(100);
+
+ // TODO (ips, 11/11/11): The groupBy functionality is very buggy in SmartGWT
2.4. Once they fix it
+ // uncomment these lines to allow grouping by the
plugin or category fields.
+ /*getListGrid().setCanGroupBy(true);
+ fieldTypeName.setCanGroupBy(false);
+ fieldVersion.setCanGroupBy(false);
+ fieldCount.setCanGroupBy(false);
+ fieldInCompliance.setCanGroupBy(false);*/
+
+ fieldTypeName.setCellFormatter(new CellFormatter() {
+ @Override
+ public String format(Object value, ListGridRecord record, int rowNum, int
colNum) {
+ String url = getResourceTypeTableUrl(record);
+ if (url == null) {
+ return value.toString();
+ }
+
+ return "<a href=\"" + url + "\">"
+ value.toString() + "</a>";
+ }
+ });
+
+ fieldCategory.setType(ListGridFieldType.ICON);
+ fieldCategory.setShowValueIconOnly(true);
+ HashMap<String, String> categoryIcons = new HashMap<String,
String>(3);
+ categoryIcons
+ .put(ResourceCategory.PLATFORM.name(),
ImageManager.getResourceIcon(ResourceCategory.PLATFORM));
+ categoryIcons.put(ResourceCategory.SERVER.name(),
ImageManager.getResourceIcon(ResourceCategory.SERVER));
+ categoryIcons.put(ResourceCategory.SERVICE.name(),
ImageManager.getResourceIcon(ResourceCategory.SERVICE));
+ fieldCategory.setValueIcons(categoryIcons);
+ fieldCategory.setShowHover(true);
+ fieldCategory.setHoverCustomizer(new HoverCustomizer() {
+ @Override
+ public String hoverHTML(Object value, ListGridRecord record, int rowNum,
int colNum) {
+ String cat = record.getAttribute(DataSource.Field.CATEGORY);
+ if (ResourceCategory.PLATFORM.name().equals(cat)) {
+ return MSG.common_title_platform();
+ } else if (ResourceCategory.SERVER.name().equals(cat)) {
+ return MSG.common_title_server();
+ } else if (ResourceCategory.SERVICE.name().equals(cat)) {
+ return MSG.common_title_service();
+ }
+ return "";
+ }
+ });
+
+ setListGridDoubleClickHandler(new DoubleClickHandler() {
+ @Override
+ public void onDoubleClick(DoubleClickEvent event) {
+ ListGrid lg = (ListGrid) event.getSource();
+ ListGridRecord selected = lg.getSelectedRecord();
+ String url = getResourceTypeTableUrl(selected);
+ if (url != null) {
+ CoreGUI.goToView(url);
+ }
+ }
+ });
+
+ setListGridFields(fieldTypeName, fieldPlugin, fieldCategory, fieldVersion,
fieldCount, fieldInCompliance);
+ }
+
+ private String getResourceTypeTableUrl(ListGridRecord selected) {
+ String url = null;
+ if (selected != null) {
+ int resourceTypeId =
selected.getAttributeAsInt(DataSource.Field.TYPEID);
+ String version = selected.getAttribute(DataSource.Field.VERSION);
+ if (version == null) {
+ url = "#Reports/Inventory/DriftCompliance/" +
resourceTypeId;
+ } else {
+ url = "#Reports/Inventory/DriftCompliance/" +
resourceTypeId + "/" + version;
+ }
+ }
+ return url;
+ }
+
+ class DataSource extends RPCDataSource<ResourceInstallCount,
org.rhq.core.domain.criteria.Criteria> {
+
+ public class Field {
+ public static final String COUNT = "count"; // long that we
convert to int
+ public static final String TYPENAME = "typeName"; // String
+ public static final String TYPEPLUGIN = "typePlugin"; //
String
+ public static final String CATEGORY = "category"; //
ResourceCategory
+ public static final String TYPEID = "typeId"; // int
+ public static final String VERSION = "version"; // String
+ public static final String OBJECT = "object";
+ public static final String IN_COMPLIANCE = "inCompliance";
+ }
+
+ @Override
+ public ResourceInstallCount copyValues(Record from) {
+ return (ResourceInstallCount)
from.getAttributeAsObject(DataSource.Field.OBJECT);
+ }
+
+ @Override
+ public ListGridRecord copyValues(ResourceInstallCount from) {
+ ListGridRecord record = new ListGridRecord();
+
+ record.setAttribute(Field.COUNT,
Long.valueOf(from.getCount()).intValue()); // we'll never have over Integer.MAX_VALUE,
overflow not a worry
+ record.setAttribute(Field.TYPENAME, from.getTypeName());
+ record.setAttribute(Field.TYPEPLUGIN, from.getTypePlugin());
+ record.setAttribute(Field.CATEGORY, from.getCategory().name());
+ record.setAttribute(Field.TYPEID, from.getTypeId());
+ record.setAttribute(Field.VERSION, from.getVersion());
+ record.setAttribute(Field.OBJECT, from);
+
+ if (from.getNumDriftTemplates() > 0) {
+ record.setAttribute(Field.IN_COMPLIANCE,
Boolean.toString(from.isInCompliance()));
+ }
+
+ return record;
+ }
+
+ @Override
+ protected org.rhq.core.domain.criteria.Criteria getFetchCriteria(DSRequest
request) {
+ // we don't use criterias for this datasource, just return null
+ return null;
+ }
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse
response,
+ final org.rhq.core.domain.criteria.Criteria unused) {
+ ResourceGWTServiceAsync resourceService =
GWTServiceLookup.getResourceService();
+
+ resourceService.findResourceComplianceCounts(new
AsyncCallback<List<ResourceInstallCount>>() {
+
+ @Override
+ public void onSuccess(List<ResourceInstallCount> result) {
+ response.setData(buildRecords(result));
+ response.setTotalRows(result.size());
+ processResponse(request.getRequestId(), response);
+ }
+
+ @Override
+ public void onFailure(Throwable caught) {
+
CoreGUI.getErrorHandler().handleError(MSG.view_reports_inventorySummary_failFetch(),
caught);
+ response.setStatus(DSResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+ });
+ }
+ }
+ }
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReportResourceSearchView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReportResourceSearchView.java
new file mode 100644
index 0000000..e076aae
--- /dev/null
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/DriftComplianceReportResourceSearchView.java
@@ -0,0 +1,191 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-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, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * 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 and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * 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.report;
+
+import static
org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME;
+
+import java.util.EnumSet;
+import java.util.List;
+
+import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.widgets.events.DoubleClickEvent;
+import com.smartgwt.client.widgets.events.DoubleClickHandler;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.criteria.ResourceCriteria;
+import org.rhq.core.domain.drift.DriftComplianceStatus;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.util.PageControl;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.ImageManager;
+import org.rhq.enterprise.gui.coregui.client.LinkManager;
+import org.rhq.enterprise.gui.coregui.client.components.table.IconField;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceDetailView;
+import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import org.rhq.enterprise.gui.coregui.client.util.StringUtility;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
+
+/**
+ * Extends the ResourceSearchView with drift compliance information.
+ *
+ * @author Jay Shaughnessy
+ * @author John Sanda
+ */
+public class DriftComplianceReportResourceSearchView extends ResourceSearchView {
+
+ private final int resourceTypeId;
+
+ public DriftComplianceReportResourceSearchView(String locatorId, Criteria criteria)
{
+ super(locatorId, criteria);
+
+ setInitialCriteriaFixed(true);
+
+ this.resourceTypeId =
criteria.getAttributeAsInt(ResourceDataSourceField.TYPE.propertyName());
+ };
+
+ // suppress unchecked warnings because the superclass has different generic types for
the datasource
+ @SuppressWarnings("unchecked")
+ @Override
+ protected RPCDataSource getDataSourceInstance() {
+ return new DataSource();
+ }
+
+ @Override
+ protected List<ListGridField> createFields() {
+
+ List<ListGridField> fields = super.createFields();
+
+ // replace the cell formatter on the name field to go directly to drift tab
+ ListGridField nameField = null;
+ for (ListGridField field : fields) {
+ if (NAME.propertyName().equals(field.getName())) {
+ nameField = field;
+ break;
+ }
+ }
+ nameField.setCellFormatter(new CellFormatter() {
+ public String format(Object value, ListGridRecord record, int rowNum, int
colNum) {
+ String url =
LinkManager.getResourceTabLink(record.getAttributeAsInt("id"),
+ ResourceDetailView.Tab.DRIFT, null);
+ String name = StringUtility.escapeHtml(value.toString());
+ return SeleniumUtility.getLocatableHref(url, name, null);
+ }
+ });
+
+ IconField inComplianceField = new IconField(DataSource.ATTR_IN_COMPLIANCE,
MSG.common_title_in_compliance(), 95);
+ inComplianceField.setCanSortClientOnly(true);
+ fields.add(inComplianceField);
+
+ return fields;
+ }
+
+ @Override
+ protected void configureTable() {
+ super.configureTable();
+
+ // replace the doubleClickHandler to go directly to drift tab
+ setListGridDoubleClickHandler(new DoubleClickHandler() {
+ public void onDoubleClick(DoubleClickEvent event) {
+ ListGrid listGrid = (ListGrid) event.getSource();
+ ListGridRecord[] selectedRows = listGrid.getSelection();
+ if (selectedRows != null && selectedRows.length == 1) {
+ String selectedId = selectedRows[0].getAttribute("id");
+
CoreGUI.goToView(LinkManager.getResourceTabLink(Integer.valueOf(selectedId),
+ ResourceDetailView.Tab.DRIFT, null));
+ }
+ }
+ });
+
+ }
+
+ private class DataSource extends ResourceDatasource {
+
+ private static final String ATTR_IN_COMPLIANCE = "inCompliance";
+
+ private ResourceType resourceType;
+
+ @Override
+ public void executeFetch(final DSRequest request, final DSResponse response,
final ResourceCriteria criteria) {
+
+ if (null == resourceType) {
+
+
ResourceTypeRepository.Cache.getInstance().getResourceTypes(resourceTypeId,
+
EnumSet.of(ResourceTypeRepository.MetadataType.driftDefinitionTemplates),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+
+ public void onTypesLoaded(ResourceType type) {
+ resourceType = type;
+ DataSource.super.executeFetch(request, response, criteria);
+ }
+ });
+
+ } else {
+ super.executeFetch(request, response, criteria);
+ }
+ }
+
+ @Override
+ protected ResourceCriteria getFetchCriteria(DSRequest request) {
+ ResourceCriteria criteria = super.getFetchCriteria(request);
+ criteria.fetchDriftDefinitions(true);
+
+ // filter out unsortable fields (i.e. fields sorted client-side only)
+ PageControl pageControl = getPageControl(request);
+ pageControl.removeOrderingField(ATTR_IN_COMPLIANCE);
+ criteria.setPageControl(pageControl);
+
+ return criteria;
+ }
+
+ @Override
+ public ListGridRecord copyValues(Resource from) {
+ ListGridRecord record = super.copyValues(from);
+
+ if (!resourceType.getDriftDefinitionTemplates().isEmpty()) {
+ record.setAttribute(ATTR_IN_COMPLIANCE,
ImageManager.getAvailabilityIcon(!isOutOfCompliance(from)));
+ }
+ return record;
+ }
+
+ private boolean isOutOfCompliance(Resource resource) {
+ for (DriftDefinition def : resource.getDriftDefinitions()) {
+ if (def.getComplianceStatus() != DriftComplianceStatus.IN_COMPLIANCE) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
index 06da7a5..73c88ec 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java
@@ -112,20 +112,20 @@ public class ReportTopView extends
AbstractSectionedLeftNavigationView {
}
});
- NavigationItem recentConfigurationChangesItem = new
NavigationItem(ResourceConfigurationHistoryListView.VIEW_ID,
- "subsystems/configure/Configure_16.png", new ViewFactory() {
+ NavigationItem recentConfigurationChangesItem = new NavigationItem(
+ ResourceConfigurationHistoryListView.VIEW_ID,
"subsystems/configure/Configure_16.png", new ViewFactory() {
public Canvas createView() {
- return new
ResourceConfigurationHistoryListView(extendLocatorId(ResourceConfigurationHistoryListView.VIEW_ID.getName()),
- getGlobalPermissions().contains(Permission.MANAGE_INVENTORY));
+ return new ResourceConfigurationHistoryListView(
+
extendLocatorId(ResourceConfigurationHistoryListView.VIEW_ID.getName()),
getGlobalPermissions()
+ .contains(Permission.MANAGE_INVENTORY));
}
});
NavigationItem recentOperationsItem = new
NavigationItem(OperationHistoryView.SUBSYSTEM_VIEW_ID,
"subsystems/control/Operation_16.png", new ViewFactory() {
public Canvas createView() {
- return new SubsystemOperationHistoryListView(
-
extendLocatorId(OperationHistoryView.SUBSYSTEM_VIEW_ID.getName()), getGlobalPermissions()
- .contains(Permission.MANAGE_INVENTORY));
+ return new
SubsystemOperationHistoryListView(extendLocatorId(OperationHistoryView.SUBSYSTEM_VIEW_ID
+ .getName()),
getGlobalPermissions().contains(Permission.MANAGE_INVENTORY));
}
});
@@ -138,8 +138,8 @@ public class ReportTopView extends AbstractSectionedLeftNavigationView
{
}
});
- NavigationItem alertDefinitionsItem = new NavigationItem(new
ViewName("AlertDefinitions",
- MSG.view_reports_alertDefinitions()),
"subsystems/alert/Alerts_16.png", new ViewFactory() {
+ NavigationItem alertDefinitionsItem = new NavigationItem(new
ViewName("AlertDefinitions", MSG
+ .view_reports_alertDefinitions()),
"subsystems/alert/Alerts_16.png", new ViewFactory() {
public Canvas createView() {
return new
AlertDefinitionReportView(extendLocatorId(AlertDefinitionReportView.VIEW_ID.getName()));
}
@@ -174,14 +174,22 @@ public class ReportTopView extends
AbstractSectionedLeftNavigationView {
}
}, getGlobalPermissions().contains(Permission.MANAGE_INVENTORY));
- NavigationItem platformSystemInfoItem = new
NavigationItem(PlatformSummaryPortlet.VIEW_ID,
- ImageManager.getResourceIcon(ResourceCategory.PLATFORM), new ViewFactory() {
- public Canvas createView() {
- return new
PlatformSummaryPortlet(extendLocatorId(PlatformSummaryPortlet.VIEW_ID.getName()));
- }
- });
+ NavigationItem platformSystemInfoItem = new
NavigationItem(PlatformSummaryPortlet.VIEW_ID, ImageManager
+ .getResourceIcon(ResourceCategory.PLATFORM), new ViewFactory() {
+ public Canvas createView() {
+ return new
PlatformSummaryPortlet(extendLocatorId(PlatformSummaryPortlet.VIEW_ID.getName()));
+ }
+ });
+
+ NavigationItem driftComplianceItem = new
NavigationItem(DriftComplianceReport.VIEW_ID, ImageManager
+ .getDriftIcon(), new ViewFactory() {
+ public Canvas createView() {
+ return new
DriftComplianceReport(extendLocatorId(DriftComplianceReport.VIEW_ID.getName()));
+ }
+ }, getGlobalPermissions().contains(Permission.MANAGE_INVENTORY));
- return new NavigationSection(SECTION_INVENTORY_VIEW_ID, inventorySummaryItem,
platformSystemInfoItem);
+ return new NavigationSection(SECTION_INVENTORY_VIEW_ID, inventorySummaryItem,
platformSystemInfoItem,
+ driftComplianceItem);
}
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReport.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReport.java
index 818ab5a..72b5b6b 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReport.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReport.java
@@ -112,7 +112,7 @@ public class ResourceInstallReport extends LocatableVLayout implements
Bookmarka
private void showResourceList(Criteria criteria) {
hideResourceList();
- resourceList = new
ResourceInstallReportResourceSearchView(extendLocatorId("resourceList"),
criteria);
+ resourceList = new ResourceSearchView(extendLocatorId("resourceList"),
criteria);
addMember(resourceList);
markForRedraw();
}
@@ -141,28 +141,18 @@ public class ResourceInstallReport extends LocatableVLayout
implements Bookmarka
ListGridField fieldVersion = new ListGridField(DataSource.Field.VERSION,
MSG.common_title_version());
ListGridField fieldCount = new ListGridField(DataSource.Field.COUNT,
MSG.common_title_count());
- ListGridField fieldInCompliance = new
ListGridField(DataSource.Field.IN_COMPLIANCE, MSG
- .common_title_in_compliance());
- HashMap<String, String> complianceIcons = new HashMap<String,
String>();
- complianceIcons.put("true",
ImageManager.getAvailabilityIcon(true));
- complianceIcons.put("false",
ImageManager.getAvailabilityIcon(false));
- fieldInCompliance.setValueIcons(complianceIcons);
- fieldInCompliance.setType(ListGridFieldType.ICON);
-
fieldTypeName.setWidth("35%");
fieldPlugin.setWidth("10%");
fieldCategory.setWidth(70);
fieldVersion.setWidth("*");
fieldCount.setWidth(60);
- fieldInCompliance.setWidth(100);
// TODO (ips, 11/11/11): The groupBy functionality is very buggy in SmartGWT
2.4. Once they fix it
// uncomment these lines to allow grouping by the
plugin or category fields.
/*getListGrid().setCanGroupBy(true);
fieldTypeName.setCanGroupBy(false);
fieldVersion.setCanGroupBy(false);
- fieldCount.setCanGroupBy(false);
- fieldInCompliance.setCanGroupBy(false);*/
+ fieldCount.setCanGroupBy(false); */
fieldTypeName.setCellFormatter(new CellFormatter() {
@Override
@@ -212,7 +202,7 @@ public class ResourceInstallReport extends LocatableVLayout implements
Bookmarka
}
});
- setListGridFields(fieldTypeName, fieldPlugin, fieldCategory, fieldVersion,
fieldCount, fieldInCompliance);
+ setListGridFields(fieldTypeName, fieldPlugin, fieldCategory, fieldVersion,
fieldCount);
}
private String getResourceTypeTableUrl(ListGridRecord selected) {
@@ -239,7 +229,6 @@ public class ResourceInstallReport extends LocatableVLayout implements
Bookmarka
public static final String TYPEID = "typeId"; // int
public static final String VERSION = "version"; // String
public static final String OBJECT = "object";
- public static final String IN_COMPLIANCE = "inCompliance";
}
@Override
@@ -259,10 +248,6 @@ public class ResourceInstallReport extends LocatableVLayout
implements Bookmarka
record.setAttribute(Field.VERSION, from.getVersion());
record.setAttribute(Field.OBJECT, from);
- if (from.getNumDriftTemplates() > 0) {
- record.setAttribute(Field.IN_COMPLIANCE,
Boolean.toString(from.isInCompliance()));
- }
-
return record;
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReportResourceSearchView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReportResourceSearchView.java
deleted file mode 100644
index 59c7ed2..0000000
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ResourceInstallReportResourceSearchView.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * 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 and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * 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.report;
-
-import java.util.EnumSet;
-import java.util.List;
-
-import com.smartgwt.client.data.Criteria;
-import com.smartgwt.client.data.DSRequest;
-import com.smartgwt.client.data.DSResponse;
-import com.smartgwt.client.widgets.grid.ListGridField;
-import com.smartgwt.client.widgets.grid.ListGridRecord;
-
-import org.rhq.core.domain.criteria.ResourceCriteria;
-import org.rhq.core.domain.drift.DriftComplianceStatus;
-import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.enterprise.gui.coregui.client.ImageManager;
-import org.rhq.enterprise.gui.coregui.client.components.table.IconField;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
-import
org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
-
-/**
- * @author Jay Shaughnessy
- * @author John Sanda
- */
-public class ResourceInstallReportResourceSearchView extends ResourceSearchView {
-
- private final int resourceTypeId;
-
- public ResourceInstallReportResourceSearchView(String locatorId, Criteria criteria)
{
- super(locatorId, criteria);
-
- setInitialCriteriaFixed(true);
-
- this.resourceTypeId =
criteria.getAttributeAsInt(ResourceDataSourceField.TYPE.propertyName());
- };
-
- // suppress unchecked warnings because the superclass has different generic types for
the datasource
- @SuppressWarnings("unchecked")
- @Override
- protected RPCDataSource getDataSourceInstance() {
- return new DataSource();
- }
-
- @Override
- protected List<ListGridField> createFields() {
-
- List<ListGridField> fields = super.createFields();
-
- IconField inComplianceField = new IconField(DataSource.ATTR_IN_COMPLIANCE,
MSG.common_title_in_compliance(), 95);
- fields.add(inComplianceField);
-
- return fields;
- }
-
- private class DataSource extends ResourceDatasource {
-
- private static final String ATTR_IN_COMPLIANCE = "inCompliance";
-
- private ResourceType resourceType;
-
- @Override
- public void executeFetch(final DSRequest request, final DSResponse response,
final ResourceCriteria criteria) {
-
- if (null == resourceType) {
-
-
ResourceTypeRepository.Cache.getInstance().getResourceTypes(resourceTypeId,
-
EnumSet.of(ResourceTypeRepository.MetadataType.driftDefinitionTemplates),
- new ResourceTypeRepository.TypeLoadedCallback() {
-
- public void onTypesLoaded(ResourceType type) {
- resourceType = type;
- DataSource.super.executeFetch(request, response, criteria);
- }
- });
-
- } else {
- super.executeFetch(request, response, criteria);
- }
- }
-
- @Override
- protected ResourceCriteria getFetchCriteria(DSRequest request) {
- ResourceCriteria criteria = super.getFetchCriteria(request);
- criteria.fetchDriftDefinitions(true);
- return criteria;
- }
-
- @Override
- public ListGridRecord copyValues(Resource from) {
- ListGridRecord record = super.copyValues(from);
-
- if (!resourceType.getDriftDefinitionTemplates().isEmpty()) {
- record.setAttribute(ATTR_IN_COMPLIANCE,
ImageManager.getAvailabilityIcon(!isOutOfCompliance(from)));
- }
- return record;
- }
-
- private boolean isOutOfCompliance(Resource resource) {
- for (DriftDefinition def : resource.getDriftDefinitions()) {
- if (def.getComplianceStatus() != DriftComplianceStatus.IN_COMPLIANCE) {
- return true;
- }
- }
- return false;
- }
- }
-
-}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
index 89e217e..d124879 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java
@@ -151,6 +151,25 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl
implements Re
}
}
+ public List<ResourceInstallCount> findResourceComplianceCounts() throws
RuntimeException {
+ try {
+ List<ResourceInstallCount> result =
resourceManager.findResourceComplianceCounts(getSessionSubject());
+ return SerialUtility.prepare(result,
"ResourceService.findResourceComplianceCounts");
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
+ }
+
+ public List<ResourceInstallCount> findResourceInstallCounts(boolean
groupByVersions) throws RuntimeException {
+ try {
+ List<ResourceInstallCount> result =
resourceManager.findResourceInstallCounts(getSessionSubject(),
+ groupByVersions);
+ return SerialUtility.prepare(result,
"ResourceService.findResourceInstallCounts");
+ } catch (Throwable t) {
+ throw getExceptionToThrowToClient(t);
+ }
+ }
+
/** Locate ProblemResourcesComposites and generate the disambiguation reports for
them.
* Criteria passed in not currently used.
*/
@@ -367,14 +386,4 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl
implements Re
throw getExceptionToThrowToClient(t);
}
}
-
- public List<ResourceInstallCount> findResourceInstallCounts(boolean
groupByVersions) throws RuntimeException {
- try {
- List<ResourceInstallCount> result =
resourceManager.findResourceInstallCounts(getSessionSubject(),
- groupByVersions);
- return SerialUtility.prepare(result,
"ResourceService.findResourceInstallCounts");
- } catch (Throwable t) {
- throw getExceptionToThrowToClient(t);
- }
- }
}
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index ad245ed..5a5f154 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -625,8 +625,8 @@ view_admin_systemSettings_TraitPurge_desc = How old measurement trait
data must
view_admin_systemSettings_TraitPurge_name = Delete Measurement Traits Older Than
view_admin_systemSettings_cannotLoadServerDetails = Cannot load server details
view_admin_systemSettings_cannotLoadSettings = Cannot obtain the current system settings
-view_admin_systemSettings_dumpedToLog = System info was successfully written to server
log file
view_admin_systemSettings_dumpToLogFailed = Writing of system info to server log file
failed
+view_admin_systemSettings_dumpedToLog = System info was successfully written to server
log file
view_admin_systemSettings_fixBeforeSaving = Please fix the invalid values before saving
view_admin_systemSettings_group_baseline = Automatic Baseline Configuration Properties
view_admin_systemSettings_group_dataMgr = Data Manager Configuration Properties
@@ -1674,6 +1674,7 @@ view_reportsTop_title = Reports
view_reports_alertDefinitions = Alert Definitions
view_reports_alertDefinitions_parentHover = Click to go to the parent alert definition
view_reports_alertDefinitions_resTypeLoadError = Cannot get the template resource type -
unable to view the alert template.
+view_reports_driftCompliance = Drift Compliance
view_reports_inventorySummary_failFetch = Failed to get inventory summary
view_reports_platforms = Platform Utilization
view_reports_subsystems = Subsystems
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index d0f4a19..c5d56d5 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -24,7 +24,7 @@ common_button_create_child = Kind-Ressource erzeugen
common_button_delete = Löschen
common_button_delete_all = Alle Löschen
common_button_disable = Deaktivieren
-## common_button_dump_sysInfo_to_log = System information ins Logfile schreiben
+##common_button_dump_sysInfo_to_log = System information ins Logfile schreiben
common_button_edit = Bearbeiten
common_button_enable = Aktivieren
common_button_execute = Ausführen
@@ -527,10 +527,10 @@ view_admin_systemSettings_AlertPurge_name = Lösche Alarme, die älter
sind als
view_admin_systemSettings_AvailabilityPurge_name = Lösche Verfügbarkeitsdaten, die älter
sind als
##view_admin_systemSettings_DriftFilePurge_desc = How old unused and orphaned drift files
must be before being purged from backend storage. This is specified in days.
view_admin_systemSettings_DriftFilePurge_name = Lösche ungenutzte Drift-Dateine, die
älter sind als
-view_admin_systemSettings_dumpedToLog = System informationen wurden erfolgreich in die
Server-Log-Datei geschrieben
-view_admin_systemSettings_dumpToLogFailed = Schreiben der Systeminformation in die
Server-Log-Datei ist fehlgeschlagen
view_admin_systemSettings_LDAPBindPW_name = Passwort
view_admin_systemSettings_TraitPurge_name = Lösche Trait-Daten, die älter sind als
+view_admin_systemSettings_dumpToLogFailed = Schreiben der Systeminformation in die
Server-Log-Datei ist fehlgeschlagen
+view_admin_systemSettings_dumpedToLog = System informationen wurden erfolgreich in die
Server-Log-Datei geschrieben
##view_admin_systemSettings_group_drift = Drift Server Configuration Settings
view_admin_systemSettings_saveFailure = Das Speichern der Systemeinstellungen ist
fehlgeschlagen
view_admin_systemSettings_savedSettings = Sie haben die Systemeinstellungen erfolgreich
gespeichert
@@ -1041,7 +1041,7 @@ view_dashboards_title = Dashboard
##view_drift_category_fileRemoved = File Removed
##view_drift_confirm_deleteAllDefs = Delete all drift detection definitions?
##view_drift_confirm_deleteDefs = Delete the selected drift detection definition(s)?
-view_drift_confirm_deleteTemplate = Warning! Deleting this template will also cause all
attached drift definitions to be deleted as well. Those attached definitions along with
all of their snapshots will be permanently removed from the system. Detached definitions
will not be removed. Are you sure you want to continue?
+##view_drift_confirm_deleteTemplate = Warning! Deleting this template will also cause all
attached drift definitions to be deleted as well. Those attached definitions along with
all of their snapshots will be permanently removed from the system. Detached definitions
will not be removed. Are you sure you want to continue?
##view_drift_failure_deleteDefs = Failed to delete some or all drift detection
definitions.
##view_drift_failure_deleteTemplates = Failed to delete some or all of the drift
templates
##view_drift_failure_detectNow = Failed to submit drift detection run request
@@ -1455,6 +1455,10 @@ view_remoteAgentInstall_stopAgent = Agent anhalten
view_reportsTop_description = Dieser Abschnitt bietet Zugang zu applikationsweiten
Berichten
view_reportsTop_title = Berichte
view_reports_alertDefinitions = Alarmierungskriterien
+##view_reports_alertDefinitions_parentHover = Click to go to the parent alert definition
+##view_reports_alertDefinitions_resTypeLoadError = Cannot get the template resource type
- unable to view the alert template.
+##view_reports_driftCompliance = Drift Compliance
+##view_reports_inventorySummary_failFetch = Failed to get inventory summary
view_reports_platforms = Cpu- und Speicherauslastung
view_reports_subsystems = Subsysteme
##view_resourceResourceGroupList_error_fetchFailure = Failed to fetch Resource''s
groups.
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index 26cf259..d673c42 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -24,7 +24,7 @@ common_button_create_child = 子を作成
common_button_delete = 削除
common_button_delete_all = すべてを削除
common_button_disable = 無効
-## common_button_dump_sysInfo_to_log = Dump system info to log file
+##common_button_dump_sysInfo_to_log = Dump system info to log file
common_button_edit = 編集
common_button_enable = 有効
##common_button_execute = Execute
@@ -624,8 +624,8 @@ view_admin_systemSettings_TraitPurge_desc = データベースから除去され
view_admin_systemSettings_TraitPurge_name = 次より古い測定トレイトの削除
view_admin_systemSettings_cannotLoadServerDetails = サーバー詳細をロードできません
view_admin_systemSettings_cannotLoadSettings = 現在のシステム設定を取得できません
-## view_admin_systemSettings_dumpedToLog = System info was successfully written to server
log file
-## view_admin_systemSettings_dumpToLogFailed = Writing of system info to server log file
failed
+##view_admin_systemSettings_dumpToLogFailed = Writing of system info to server log file
failed
+##view_admin_systemSettings_dumpedToLog = System info was successfully written to server
log file
view_admin_systemSettings_fixBeforeSaving = 保存前に無効な値を修正してください
view_admin_systemSettings_group_baseline = 自動ベースライン構成プロパティ
view_admin_systemSettings_group_dataMgr = データマネージャー構成プロパティ
@@ -1183,7 +1183,7 @@ view_dashboards_title = ダッシュボード
##view_drift_category_fileRemoved = File Removed
##view_drift_confirm_deleteAllDefs = Delete all drift detection definitions?
##view_drift_confirm_deleteDefs = Delete the selected drift detection definition(s)?
-view_drift_confirm_deleteTemplate = Warning! Deleting this template will also cause all
attached drift definitions to be deleted as well. Those attached definitions along with
all of their snapshots will be permanently removed from the system. Detached definitions
will not be removed. Are you sure you want to continue?
+##view_drift_confirm_deleteTemplate = Warning! Deleting this template will also cause all
attached drift definitions to be deleted as well. Those attached definitions along with
all of their snapshots will be permanently removed from the system. Detached definitions
will not be removed. Are you sure you want to continue?
##view_drift_failure_deleteDefs = Failed to delete some or all drift detection
definitions.
##view_drift_failure_deleteTemplates = Failed to delete some or all of the drift
templates
##view_drift_failure_detectNow = Failed to submit drift detection run request
@@ -1662,6 +1662,7 @@ view_reportsTop_title = レポート
view_reports_alertDefinitions = アラート定義
view_reports_alertDefinitions_parentHover = クリックすると親のアラート定義へ行きます
view_reports_alertDefinitions_resTypeLoadError = テンプレートリソースタイプを取得できません -
アラートテンプレートの閲覧ができません
+##view_reports_driftCompliance = Drift Compliance
view_reports_inventorySummary_failFetch = インベントリサマリーの取得に失敗しました
view_reports_platforms = プラットフォーム利用率
view_reports_subsystems = サブシステム
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
index 0a79c3d..56e46b1 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
@@ -22,7 +22,7 @@ common_button_create_child = Criar filho
common_button_delete = Excluir
common_button_delete_all = Excluir Todos
common_button_disable = Desabilitar
-## common_button_dump_sysInfo_to_log = Dump system info to log file
+##common_button_dump_sysInfo_to_log = Dump system info to log file
common_button_edit = Editar
common_button_enable = Habilitar
##common_button_execute = Execute
@@ -593,8 +593,6 @@ view_admin_systemSettings_BaselineDataSet_name = Baseline Dataset
view_admin_systemSettings_BaselineFrequency_desc = The frequency which the
auto-calculation of baselines will be performed. If 0, baseline auto-calculation is
disabled. This is specified in days.
view_admin_systemSettings_BaselineFrequency_name = Baseline Calculation Frequency
view_admin_systemSettings_DataMaintenance_desc = How often database maintenance is
performed (for example, vacuuming if using Postgres). This is specified in hours.
-## view_admin_systemSettings_dumpedToLog = System info was successfully written to server
log file
-## view_admin_systemSettings_dumpToLogFailed = Writing of system info to server log file
failed
view_admin_systemSettings_DataMaintenance_name = Database Maintenance Period
view_admin_systemSettings_DataReindex_desc = If enabled, certain database tables will be
re-indexed periodically.
view_admin_systemSettings_DataReindex_name = Reindex Data Tables Nightly
@@ -634,6 +632,8 @@ view_admin_systemSettings_TraitPurge_desc = How old measurement trait
data must
view_admin_systemSettings_TraitPurge_name = Delete Measurement Traits Older Than
view_admin_systemSettings_cannotLoadServerDetails = Cannot load server details
view_admin_systemSettings_cannotLoadSettings = Cannot obtain the current system settings
+##view_admin_systemSettings_dumpToLogFailed = Writing of system info to server log file
failed
+##view_admin_systemSettings_dumpedToLog = System info was successfully written to server
log file
view_admin_systemSettings_fixBeforeSaving = Please fix the invalid values before saving
view_admin_systemSettings_group_baseline = Automatic Baseline Configuration Properties
view_admin_systemSettings_group_dataMgr = Data Manager Configuration Properties
@@ -1212,7 +1212,7 @@ view_drift_category_fileChanged = Arquivo alterado
##view_drift_category_fileRemoved = Arquivo removido
##view_drift_confirm_deleteAllDefs = Delete all drift detection definitions?
##view_drift_confirm_deleteDefs = Delete the selected drift detection definition(s)?
-view_drift_confirm_deleteTemplate = Warning! Deleting this template will also cause all
attached drift definitions to be deleted as well. Those attached definitions along with
all of their snapshots will be permanently removed from the system. Detached definitions
will not be removed. Are you sure you want to continue?
+##view_drift_confirm_deleteTemplate = Warning! Deleting this template will also cause all
attached drift definitions to be deleted as well. Those attached definitions along with
all of their snapshots will be permanently removed from the system. Detached definitions
will not be removed. Are you sure you want to continue?
##view_drift_failure_deleteDefs = Failed to delete some or all drift detection
definitions.
##view_drift_failure_deleteTemplates = Failed to delete some or all of the drift
templates
view_drift_failure_detectNow = Falha ao submeter a requisi��o de detec��o do drift
@@ -1778,9 +1778,10 @@ view_remoteAgentInstall_updateStatus = Status da
Atualiza\u00E7\u00E3o
view_reportsTop_description = This section provides access to global reports.
view_reportsTop_title = Relat\u00F3rios
view_reports_alertDefinitions = Defini\u00E7\u00E3o de Alertas
-view_reports_alertDefinitions_parentHover = Click to go to the parent alert definition
-view_reports_alertDefinitions_resTypeLoadError = Cannot get the template resource type -
unable to view the alert template.
-view_reports_inventorySummary_failFetch = Failed to get inventory summary
+##view_reports_alertDefinitions_parentHover = Click to go to the parent alert definition
+##view_reports_alertDefinitions_resTypeLoadError = Cannot get the template resource type
- unable to view the alert template.
+##view_reports_driftCompliance = Drift Compliance
+##view_reports_inventorySummary_failFetch = Failed to get inventory summary
view_reports_platforms = Utiliza\u00E7\u00E3o de Mem\u00F3ria e CPU
view_reports_subsystems = Subsistemas
view_resourceResourceGroupList_error_fetchFailure = Failed to fetch Resource''s
groups.
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
index 9937a45..670769e 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
@@ -22,7 +22,7 @@ common_button_create_child = Create Child
common_button_delete = \u5220\u9664
common_button_delete_all = \u5220\u9664\u6240\u6709
common_button_disable = \u7981\u7528
-## common_button_dump_sysInfo_to_log = Dump system info to log file
+##common_button_dump_sysInfo_to_log = Dump system info to log file
common_button_edit = \u7f16\u8f91
common_button_enable = \u542f\u7528
##common_button_execute = Execute
@@ -622,8 +622,8 @@ view_admin_systemSettings_TraitPurge_desc = How old measurement trait
data must
view_admin_systemSettings_TraitPurge_name = Delete Measurement Traits Older Than
view_admin_systemSettings_cannotLoadServerDetails =
\u65e0\u6cd5\u52a0\u8f7d\u670d\u52a1\u5668\u8be6\u60c5
view_admin_systemSettings_cannotLoadSettings =
\u65e0\u6cd5\u83b7\u5f97\u5f53\u524d\u7cfb\u7edf\u914d\u7f6e
-## view_admin_systemSettings_dumpedToLog = System info was successfully written to server
log file
-## view_admin_systemSettings_dumpToLogFailed = Writing of system info to server log file
failed
+##view_admin_systemSettings_dumpToLogFailed = Writing of system info to server log file
failed
+##view_admin_systemSettings_dumpedToLog = System info was successfully written to server
log file
view_admin_systemSettings_fixBeforeSaving =
\u4fdd\u5b58\u524d\u8bf7\u4fee\u590d\u9519\u8bef
view_admin_systemSettings_group_baseline = \u81ea\u52a8Baseline\u914d\u7f6e\u5c5e\u6027
view_admin_systemSettings_group_dataMgr =
\u6570\u636e\u7ba1\u7406\u5668\u57fa\u672c\u5c5e\u6027
@@ -1192,7 +1192,7 @@ view_dashboards_title = \u7edf\u8ba1\u8868\u76d8
##view_drift_category_fileRemoved = File Removed
##view_drift_confirm_deleteAllDefs = Delete all drift detection definitions?
##view_drift_confirm_deleteDefs = Delete the selected drift detection definition(s)?
-view_drift_confirm_deleteTemplate = Warning! Deleting this template will also cause all
attached drift definitions to be deleted as well. Those attached definitions along with
all of their snapshots will be permanently removed from the system. Detached definitions
will not be removed. Are you sure you want to continue?
+##view_drift_confirm_deleteTemplate = Warning! Deleting this template will also cause all
attached drift definitions to be deleted as well. Those attached definitions along with
all of their snapshots will be permanently removed from the system. Detached definitions
will not be removed. Are you sure you want to continue?
##view_drift_failure_deleteDefs = Failed to delete some or all drift detection
definitions.
##view_drift_failure_deleteTemplates = Failed to delete some or all of the drift
templates
##view_drift_failure_detectNow = Failed to submit drift detection run request
@@ -1672,6 +1672,7 @@ view_reportsTop_title = \u62a5\u8868
view_reports_alertDefinitions = \u544a\u8b66\u5b9a\u4e49
view_reports_alertDefinitions_parentHover =
\u70b9\u51fb\u5230\u7236\u7ea7\u544a\u8b66\u83dc\u5355
view_reports_alertDefinitions_resTypeLoadError =
\u65e0\u6cd5\u83b7\u53d6\u8d44\u6e90\u6a21\u677f\u7c7b\u578b -
\u65e0\u6cd5\u67e5\u770b\u544a\u8b66\u6a21\u677f.
+##view_reports_driftCompliance = Drift Compliance
view_reports_inventorySummary_failFetch =
\u83b7\u53d6\u7edf\u8ba1\u6e05\u5355\u5931\u8d25
view_reports_platforms = \u5e73\u53f0\u4f7f\u7528\u7387\u62a5\u8868
view_reports_subsystems = \u5b50\u7cfb\u7edf\u62a5\u8868
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
index c2ac7db..f2d05c5 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
@@ -2047,8 +2047,8 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
ResourceError error = entityManager.find(ResourceError.class, resourceErrorId);
if (error != null) {
- if (!authorizationManager.hasResourcePermission(user,
Permission.MODIFY_RESOURCE,
- error.getResource().getId())) {
+ if (!authorizationManager.hasResourcePermission(user,
Permission.MODIFY_RESOURCE, error.getResource()
+ .getId())) {
throw new PermissionException("Cannot delete Resource error ["
+ resourceErrorId + "]. User [" + user
+ "] does not have permission to modify Resource [" +
error.getResource().getName() + "].");
}
@@ -2373,20 +2373,25 @@ public class ResourceManagerBean implements ResourceManagerLocal,
ResourceManage
@SuppressWarnings("unchecked")
@RequiredPermission(Permission.MANAGE_INVENTORY)
public List<ResourceInstallCount> findResourceInstallCounts(Subject subject,
boolean groupByVersions) {
+ String queryName = groupByVersions ? Resource.QUERY_RESOURCE_VERSION_REPORT :
Resource.QUERY_RESOURCE_REPORT;
+ Query query = entityManager.createNamedQuery(queryName);
+ List<ResourceInstallCount> results = query.getResultList();
+
+ return results;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ @RequiredPermission(Permission.MANAGE_INVENTORY)
+ public List<ResourceInstallCount> findResourceComplianceCounts(Subject subject)
{
Query query = null;
List<ResourceInstallCount> results = null;
- if (!groupByVersions) {
- query = entityManager.createNamedQuery(Resource.QUERY_RESOURCE_REPORT);
- results = query.getResultList();
- } else {
- //query =
entityManager.createNamedQuery(Resource.QUERY_RESOURCE_VERSION_REPORT);
- query =
entityManager.createNamedQuery(Resource.QUERY_RESOURCE_VERSION_AND_DRIFT_IN_COMPLIANCE);
- results = query.getResultList();
+ query =
entityManager.createNamedQuery(Resource.QUERY_RESOURCE_VERSION_AND_DRIFT_IN_COMPLIANCE);
+ results = query.getResultList();
- query =
entityManager.createNamedQuery(Resource.QUERY_RESOURCE_VERSION_AND_DRIFT_OUT_OF_COMPLIANCE);
- results.addAll(query.getResultList());
- }
+ query =
entityManager.createNamedQuery(Resource.QUERY_RESOURCE_VERSION_AND_DRIFT_OUT_OF_COMPLIANCE);
+ results.addAll(query.getResultList());
return results;
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
index 1d1ec69..7f71cbe 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java
@@ -484,6 +484,8 @@ public interface ResourceManagerLocal {
*/
List<Integer> uninventoryResources(Subject subject, int[] resourceIds);
+ List<ResourceInstallCount> findResourceComplianceCounts(Subject subject);
+
List<ResourceInstallCount> findResourceInstallCounts(Subject subject, boolean
groupByVersions);
PageList<ResourceComposite> findResourceCompositesByCriteria(Subject subject,
ResourceCriteria criteria);