[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java | 2
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/WebUserPreferences.java | 49 +++++++---
2 files changed, 40 insertions(+), 11 deletions(-)
New commits:
commit 4228e9661ede4596981453f225117ab403e8be66
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Apr 5 17:06:19 2011 -0400
fix exception caused by different format for recentResources user pref between portal-war and coregui (https://bugzilla.redhat.com/show_bug.cgi?id=693411)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java
index 3e34ceb..9006bec 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java
@@ -308,6 +308,8 @@ public class UserPreferences {
}
return result;
} catch (Exception e) {
+ // value was probably in be the old comma-delimited format used by portal-war -
+ // throw it away and return an empty list
return new ArrayList<Integer>();
}
}
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/WebUserPreferences.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/WebUserPreferences.java
index e2414a7..5d317b0 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/WebUserPreferences.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/WebUserPreferences.java
@@ -1,5 +1,6 @@
package org.rhq.enterprise.gui.legacy;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -769,7 +770,7 @@ public class WebUserPreferences extends SubjectPreferencesBase {
return; // nothing is stored in session for the special NONE view
}
- List pageControlProperties = new ArrayList();
+ List<Serializable> pageControlProperties = new ArrayList<Serializable>();
pageControlProperties.add(pageControl.getPageSize());
pageControlProperties.add(pageControl.getPageNumber());
@@ -797,16 +798,37 @@ public class WebUserPreferences extends SubjectPreferencesBase {
visits.remove(10);
}
- setPreference(PREF_RECENT_RESOURCES, visits, ",");
+ setPreference(PREF_RECENT_RESOURCES, visits, PREF_LIST_DELIM);
}
public List<ResourceVisit> getRecentResourceVisits() {
- List<String> stringList = getPreferenceAsList(PREF_RECENT_RESOURCES, ",");
List<ResourceVisit> visits = new ArrayList<ResourceVisit>();
- for (String string : stringList) {
- String[] data = string.split("\\|");
- if (data.length == 3)
- visits.add(new ResourceVisit(Integer.parseInt(data[0]), data[2], ResourceVisit.Kind.valueOf(data[1])));
+ try {
+ // first try the new coregui format
+ List<Integer> resourceIds = getPreferenceAsIntegerList(PREF_RECENT_RESOURCES, "|");
+ for (Integer resourceId : resourceIds) {
+ ResourceVisit visit = new ResourceVisit(resourceId, "", ResourceVisit.Kind.resource);
+ visits.add(visit);
+ }
+ } catch (RuntimeException e) {
+ // if an exception occurs, try the legacy portal-war format
+ List<String> stringList = getPreferenceAsList(PREF_RECENT_RESOURCES, PREF_LIST_DELIM);
+ for (String string : stringList) {
+ String[] data = string.split(PREF_ITEM_DELIM_REGEX);
+ if (data.length != 3) {
+ throw new RuntimeException("Failed to parse resource visit item: " + string);
+ }
+ ResourceVisit.Kind kind = ResourceVisit.Kind.valueOf(data[1]);
+ // throw away recent groups, since the new coregui format only supports resources
+ if (kind == ResourceVisit.Kind.resource || kind == ResourceVisit.Kind.PLATFORM
+ || kind == ResourceVisit.Kind.SERVER || kind == ResourceVisit.Kind.SERVICE) {
+ int resourceId = Integer.parseInt(data[0]);
+ ResourceVisit visit = new ResourceVisit(resourceId, "", ResourceVisit.Kind.resource);
+ visits.add(visit);
+ }
+ }
+ // overwrite the pref value with the new coregui format
+ setPreference(PREF_RECENT_RESOURCES, visits, "|");
}
return visits;
}
@@ -814,9 +836,14 @@ public class WebUserPreferences extends SubjectPreferencesBase {
public static class ResourceVisit {
public enum Kind {
@Deprecated
- resource("Resource"), @Deprecated
- group("Group"), PLATFORM("Platform"), SERVER("Server"), SERVICE("Service"), COMPATIBLE_GROUP("Cluster"), MIXED_GROUP(
- "Group");
+ resource("Resource"),
+ @Deprecated
+ group("Group"),
+ PLATFORM("Platform"),
+ SERVER("Server"),
+ SERVICE("Service"),
+ COMPATIBLE_GROUP("Cluster"),
+ MIXED_GROUP("Group");
private String displayName;
@@ -881,7 +908,7 @@ public class WebUserPreferences extends SubjectPreferencesBase {
@Override
public String toString() {
- return id + "|" + kind.name() + "|" + name;
+ return String.valueOf(id);
}
}
13 years, 1 month
[rhq] Branch 'as7plugin' - 2 commits - modules/plugins
by Heiko W. Rupp
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java | 19 +
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainComponent.java | 23 +
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java | 6
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/json/Operation.java | 22 -
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 116 +++++++++-
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java | 7
6 files changed, 159 insertions(+), 34 deletions(-)
New commits:
commit 3b22a190f79b18c80c485f6f5b86c0a7f0b179e2
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Apr 5 21:45:49 2011 +0200
Make sure the input stream is closed. Otherwise we are keeping too many connections open and AS will choke on us.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 97788ae..0c6d516 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -173,6 +173,8 @@ public class ASConnection {
*/
public JsonNode execute(Operation operation) {
+ InputStream inputStream = null;
+ BufferedReader br=null;
try {
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
@@ -188,23 +190,22 @@ public class ASConnection {
out.flush();
out.close();
- InputStream inputStream;
if (conn.getResponseCode()==HttpURLConnection.HTTP_OK) {
inputStream = conn.getInputStream();
- BufferedReader in = new BufferedReader(new InputStreamReader(
+ br = new BufferedReader(new InputStreamReader(
inputStream));
String line;
builder = new StringBuilder();
- while ((line = in.readLine()) != null) {
+ while ((line = br.readLine()) != null) {
builder.append(line);
}
- in.close();
+ br.close();
}
else {
InputStream errorStream = conn.getErrorStream();
if (errorStream!=null) {
- BufferedReader br = new BufferedReader(new InputStreamReader(errorStream));
+ br = new BufferedReader(new InputStreamReader(errorStream));
String line;
builder = new StringBuilder();
while ((line = br.readLine()) != null) {
@@ -213,6 +214,9 @@ public class ASConnection {
br.close();
}
}
+ if (br!=null)
+ br.close();
+
String outcome;
JsonNode operationResult=null;
if (builder!=null) {
commit 5f9a6b6cbe98d47ef75deac36e7a81b5cc73b427
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Sat Apr 2 09:24:27 2011 +0200
Allow creation and removal of Messaging destinations.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index bd0b458..97788ae 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -150,6 +150,9 @@ public class ASConnection {
JsonNode reasonNode = in.findValue("failure-description");
if (reasonNode==null)
reasonNode = in.findValue("domain-failure-description");// TODO JBAS-9182
+ if (reasonNode==null)
+ reasonNode = in.findValue("host-failure-descriptions"); // TODO JBAS-9182
+
String reason = reasonNode.getTextValue();
log.info(reason);
return true;
@@ -260,6 +263,8 @@ public class ASConnection {
JsonNode node = jsonNode.findValue("failure-description");
if (node==null)
node = jsonNode.findValue("domain-failure-description"); // TODO JBAS-9182
+ if (node==null)
+ node = jsonNode.findValue("host-failure-descriptions"); // TODO JBAS-9182
return node.getValueAsText();
}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainComponent.java
index b53dd74..a06a296 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/DomainComponent.java
@@ -78,16 +78,16 @@ public class DomainComponent extends BaseComponent implements OperationFacet{
String op = name.substring(colonPos+1);
Operation operation=null;
+ List<PROPERTY_VALUE> address = new ArrayList<PROPERTY_VALUE>();
+
if (what.equals("server-group")) {
String groupName = parameters.getSimpleValue("name",null);
String profile = parameters.getSimpleValue("profile","default");
- List<PROPERTY_VALUE> address = new ArrayList<PROPERTY_VALUE>(1);
address.add(new PROPERTY_VALUE("server-group",groupName));
operation = new Operation(op,address,"profile",profile);
} else if (what.equals("server")) {
- List<PROPERTY_VALUE> address = new ArrayList<PROPERTY_VALUE>();
if (context.getResourceType().getName().equals("JBossAS-Managed")) {
String host = conf.getSimpleValue("domainHost","local");
@@ -99,17 +99,24 @@ public class DomainComponent extends BaseComponent implements OperationFacet{
address.addAll(pathToAddress(getPath()));
String serverName = parameters.getSimpleValue("name",null);
address.add(new PROPERTY_VALUE("server-config",serverName));
- Map<String,String> props = new HashMap<String, String>();
+ Map<String,Object> props = new HashMap<String, Object>();
String serverGroup = parameters.getSimpleValue("group",null);
- props.put("name",serverName);
props.put("group",serverGroup);
-// boolean autoStart = parameters.getSimple("auto-start").getBooleanValue();
-// props.put("auto-start",String.valueOf(autoStart));
- // TODO put more properties in
+ if (op.equals("add")) {
+ props.put("name",serverName);
+ boolean autoStart = parameters.getSimple("auto-start").getBooleanValue();
+ props.put("auto-start",autoStart);
+ // TODO put more properties in
+ }
operation = new Operation(op,address,props);
}
-
+ } else if (what.equals("destination")) {
+ address.addAll(pathToAddress(getPath()));
+ String newName = parameters.getSimpleValue("name","");
+ String type = parameters.getSimpleValue("type","Queue").toLowerCase();
+ address.add(new PROPERTY_VALUE(type,newName));
+ operation = new Operation(op,address);
}
OperationResult operationResult = new OperationResult();
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java
index b577407..1c498d1 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java
@@ -95,6 +95,12 @@ public class SubsystemDiscovery implements ResourceDiscoveryComponent<BaseCompon
Map<String,Subsystem> subsystemMap = mapper.readValue(subNode,new TypeReference<Map<String,Subsystem>>() {});
+ if (subsystemMap==null) {
+ log.warn("SubsystemMap was null for path [" + path + "] and subPath ["+ subPath + "] and subNode [" + subNode + "]");
+ return Collections.emptySet();
+ }
+
+
for (Map.Entry<String,Subsystem> entry: subsystemMap.entrySet()) {
String key = entry.getKey();
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/json/Operation.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/json/Operation.java
index 92abbae..e538c94 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/json/Operation.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/json/Operation.java
@@ -38,28 +38,28 @@ public class Operation {
private String operation;
@JsonProperty
private List<PROPERTY_VALUE> address = Collections.emptyList();
- private Map<String,String> additionalProperties;
+ private Map<String,Object> additionalProperties;
public Operation(String operation, List<PROPERTY_VALUE> address, NameValuePair payload) {
this.operation = operation;
this.address = address;
- additionalProperties = new HashMap<String,String>(2);
+ additionalProperties = new HashMap<String,Object>(2);
additionalProperties.put("name",payload.name);
additionalProperties.put("value",payload.value);
}
- public Operation(String operation, List<PROPERTY_VALUE> address, Map<String,String> payload) {
+ public Operation(String operation, List<PROPERTY_VALUE> address, Map<String,Object> payload) {
this.operation = operation;
this.address = address;
this.additionalProperties = payload;
}
- public Operation(String operation, List<PROPERTY_VALUE> address, String key, String value) {
+ public Operation(String operation, List<PROPERTY_VALUE> address, String key, Object value) {
this.operation = operation;
this.address = address;
- additionalProperties = new HashMap<String,String>(1);
+ additionalProperties = new HashMap<String,Object>(1);
additionalProperties.put(key,value);
}
@@ -78,30 +78,30 @@ public class Operation {
@JsonAnySetter
public void addAdditionalProperty(String key, String value) {
if (additionalProperties == null)
- additionalProperties = new HashMap<String, String>();
+ additionalProperties = new HashMap<String, Object>();
additionalProperties.put(key,value);
}
- public void setAdditionalProperties(Map<String, String> additionalProperties) {
+ public void setAdditionalProperties(Map<String, Object> additionalProperties) {
this.additionalProperties = additionalProperties;
}
@JsonAnyGetter
- public Map<String,String> getAdditionalProperties() {
+ public Map<String,Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonIgnore
public String getName() {
- return getProperty("name");
+ return (String) getProperty("name");
}
@JsonIgnore
public String getValue() {
- return getProperty("value");
+ return (String) getProperty("value");
}
- private String getProperty(String key) {
+ private Object getProperty(String key) {
if (additionalProperties.containsKey(key))
return additionalProperties.get(key);
else
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index e77a2ca..02b4bf8 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -132,7 +132,7 @@
<server name="ServerGroup"
description="Server groups on this domain"
discovery="SubsystemDiscovery"
- class="BaseComponent">
+ class="ServerGroupComponent">
<plugin-configuration>
<c:simple-property name="path" default="/server-group/*" readOnly="true"/>
</plugin-configuration>
@@ -156,7 +156,7 @@
<parameters>
<c:simple-property name="name" description="Name of this new server" required="true"/>
<c:simple-property name="group" displayName="Server Group" description="Server group to put this sever in" default="" required="false"/>
- <c:simple-property name="auto-start" displayName="Autostart" description="Should this server start at boot?" type="boolean" default="false" required="false"/>
+ <c:simple-property name="auto-start" displayName="Autostart" description="Should this server start at boot?" type="boolean" default="false" required="true"/>
</parameters>
<results>
<c:simple-property name="result" description="Outcome of the create server operation"/>
@@ -228,9 +228,21 @@
<process-scan name="ManagedAS" query="process|basename|match=^java.*,arg|org.jboss.as.server|match=.*"/>
- <operation name="server:start" description="Start this server instance." displayName="Start"/>
- <operation name="server:stop" description="Stop this server instance." displayName="Stop"/>
- <operation name="server:restart" description="Restart this server instance." displayName="Restart"/>
+ <operation name="server:start" description="Start this server instance." displayName="Start">
+ <results>
+ <c:simple-property name="operationResult"/>
+ </results>
+ </operation>
+ <operation name="server:stop" description="Stop this server instance." displayName="Stop">
+ <results>
+ <c:simple-property name="operationResult"/>
+ </results>
+ </operation>
+ <operation name="server:restart" description="Restart this server instance." displayName="Restart">
+ <results>
+ <c:simple-property name="operationResult"/>
+ </results>
+ </operation>
@@ -256,7 +268,7 @@
<server name="Messaging"
discovery="SubsystemDiscovery"
- class="BaseComponent"
+ class="DomainComponent"
singleton="true"
>
<runs-inside>
@@ -268,6 +280,29 @@
<c:simple-property name="path" readOnly="true" default="/subsystem/messaging"/>
</plugin-configuration>
+ <operation name="destination:add" displayName="Add destination" description="Add a Queue or Topic">
+ <parameters>
+ <c:simple-property name="name" description="Name of the Destination" required="true"/>
+ <c:simple-property name="type" description="Type of Destination to create" default="Queue">
+ <c:property-options>
+ <c:option value="Queue"/>
+ <c:option value="Topic"/>
+ </c:property-options>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"/>
+ </results>
+ </operation>
+ <operation name="destination:remove" displayName="Remove Destination" description="Remove a destination">
+ <parameters>
+ <c:simple-property name="name" description="Name of the Destination" required="true"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"/>
+ </results>
+ </operation>
+
<resource-configuration>
<c:simple-property name="journal-min-files" />
<c:simple-property name="journal-type" />
@@ -281,10 +316,23 @@
<plugin-configuration>
<c:simple-property name="path" readOnly="true" default="/acceptor"/>
</plugin-configuration>
-
-
</service>
-
+ <service name="MessagingConnector"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ >
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="/connector"/>
+ </plugin-configuration>
+ </service>
+ <service name="Queue"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ >
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="/queue/"/>
+ </plugin-configuration>
+ </service>
</server>
<server name="JBossWeb"
@@ -344,6 +392,56 @@
</server>
+ <server name="Datasources"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ singleton="true"
+ >
+
+ <runs-inside>
+ <parent-resource-type name="Profile" plugin="jboss-as-7"/>
+ <parent-resource-type name="JBossAS7-Standalone" plugin="jboss-as-7"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="/subsystem/datasources"/>
+ </plugin-configuration>
+
+ <service name="DataSource"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ singleton="true"
+ >
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="/data-source/*"/>
+ </plugin-configuration>
+ </service>
+
+ <service name="XADataSource"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ singleton="true"
+ >
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="/xa-data-source/*"/>
+ </plugin-configuration>
+ </service>
+
+ <service name="JdbcDriver"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ singleton="true"
+ >
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="/jdbc-driver/*"/>
+ </plugin-configuration>
+ </service>
+
+ </server>
+
<service name="NetworkInterface"
discovery="InterfaceDiscovery"
class="BaseComponent"
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java
index 929a87c..5ba843f 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java
@@ -79,8 +79,9 @@ public class OperationJsonTest {
PROPERTY_VALUE part = new PROPERTY_VALUE("/server-group","newOne");
address.add(part);
- Map<String,String> props = new HashMap<String, String>();
+ Map<String,Object> props = new HashMap<String, Object>();
props.put("profile","default");
+ props.put("someBool",true);
Operation operation = new Operation("add",address,props);
@@ -94,6 +95,10 @@ public class OperationJsonTest {
Operation op = mapper.readValue(result,Operation.class);
assert op.getOperation().equals(operation.getOperation()) : "Operation is " + op.getOperation();
+ assert op.getAdditionalProperties().containsKey("someBool") : "Key someBool not found ";
+ Object someBool = op.getAdditionalProperties().get("someBool");
+ assert Boolean.valueOf((String) someBool) : "someBool was not true";
+
}
}
13 years, 1 month
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionListView.java | 7 ++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java | 20 +++++-----
2 files changed, 15 insertions(+), 12 deletions(-)
New commits:
commit 3447a66c09dfdec0ea2bdcc45798bd1caf6f41ac
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Apr 5 15:06:43 2011 -0400
escape HTML in names and descriptions on groupdef list and details views (https://bugzilla.redhat.com/show_bug.cgi?id=691547)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionListView.java
index 9106e60..f5f7ba0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/GroupDefinitionListView.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
@@ -36,6 +36,7 @@ import org.rhq.enterprise.gui.coregui.client.PermissionsLoadedListener;
import org.rhq.enterprise.gui.coregui.client.PermissionsLoader;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
+import org.rhq.enterprise.gui.coregui.client.components.table.EscapedHtmlCellFormatter;
import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
import org.rhq.enterprise.gui.coregui.client.components.table.TableSection;
import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
@@ -56,8 +57,8 @@ public class GroupDefinitionListView extends TableSection<GroupDefinitionDataSou
super(locatorId, TITLE);
setHeaderIcon(headerIcon);
-
setDataSource(GroupDefinitionDataSource.getInstance());
+ setEscapeHtmlInDetailsLinkColumn(true);
}
@Override
@@ -67,7 +68,9 @@ public class GroupDefinitionListView extends TableSection<GroupDefinitionDataSou
idField.setWidth(50);
ListGridField nameField = new ListGridField("name", MSG.common_title_name(), 150);
+ nameField.setCellFormatter(new EscapedHtmlCellFormatter());
ListGridField descriptionField = new ListGridField("description", MSG.common_title_description());
+ descriptionField.setCellFormatter(new EscapedHtmlCellFormatter());
ListGridField expressionField = new ListGridField("expression", MSG.view_dynagroup_expressionSet(), 250);
expressionField.setCellFormatter(new CellFormatter() {
public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
index a302455..10daf03 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/definitions/SingleGroupDefinitionView.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
@@ -73,10 +73,12 @@ import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.PermissionsLoadedListener;
import org.rhq.enterprise.gui.coregui.client.PermissionsLoader;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
+import org.rhq.enterprise.gui.coregui.client.components.table.EscapedHtmlCellFormatter;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.definitions.GroupDefinitionExpressionBuilder.AddExpressionHandler;
+import org.rhq.enterprise.gui.coregui.client.util.StringUtility;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
@@ -139,11 +141,8 @@ public class SingleGroupDefinitionView extends LocatableVLayout implements Bookm
form.setDataSource(GroupDefinitionDataSource.getInstance());
form.setHiliteRequiredFields(true);
form.setRequiredTitleSuffix(" <span style=\"color: red;\">* </span>:");
- if (groupDefinition.getId() == 0) {
- form.setSaveOperationType(DSOperationType.ADD);
- } else {
- form.setSaveOperationType(DSOperationType.UPDATE);
- }
+ DSOperationType saveOperationType = (groupDefinition.getId() == 0) ? DSOperationType.ADD : DSOperationType.UPDATE;
+ form.setSaveOperationType(saveOperationType);
final DynaGroupChildrenView dynaGroupChildrenView = new DynaGroupChildrenView(extendLocatorId("DynaGroups"),
groupDefinitionId);
@@ -201,7 +200,7 @@ public class SingleGroupDefinitionView extends LocatableVLayout implements Bookm
} else {
Record newRecord = results[0];
GroupDefinition newGroupDefinition = GroupDefinitionDataSource.getInstance().copyValues(
- (ListGridRecord) newRecord);
+ newRecord);
if (recalc) {
recalculate(dynaGroupChildrenView, newGroupDefinition.getId());
}
@@ -257,12 +256,13 @@ public class SingleGroupDefinitionView extends LocatableVLayout implements Bookm
public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
String linkName = record.getAttributeAsString(NAME.propertyName());
String linkUrl = LinkManager.getResourceGroupLink(record.getAttributeAsInt("id"));
- return "<a href=\"" + linkUrl + "\">" + linkName + "</a>";
+ return "<a href=\"" + linkUrl + "\">" + StringUtility.escapeHtml(linkName) + "</a>";
}
});
ListGridField descriptionField = new ListGridField(DESCRIPTION.propertyName(), DESCRIPTION.title());
descriptionField.setWidth("300");
+ descriptionField.setCellFormatter(new EscapedHtmlCellFormatter());
ListGridField typeNameField = new ListGridField(TYPE.propertyName(), TYPE.title());
typeNameField.setWidth("100");
@@ -350,12 +350,12 @@ public class SingleGroupDefinitionView extends LocatableVLayout implements Bookm
templateSelectorTitleSpacer.setColSpan(1);
templateSelectorTitleSpacer.setEndRow(false);
- templateSelector = new SelectItem("templateSelector");
+ // TODO: i18n title
+ templateSelector = new SelectItem("templateSelector", "Saved Expression");
templateStrings = getTemplates();
templateSelector.setValueMap(templateStrings.keySet().toArray(new String[templateStrings.size()]));
templateSelector.setAllowEmptyValue(true);
templateSelector.setWidth(300);
- templateSelector.setShowTitle(false);
templateSelector.setColSpan(1);
templateSelector.setEndRow(true);
templateSelector.setStartRow(false);
13 years, 1 month
[rhq] modules/enterprise
by ips
modules/enterprise/remoting/cli/pom.xml | 1 +
modules/enterprise/remoting/cli/src/main/scripts/rhq-client.build.xml | 1 +
2 files changed, 2 insertions(+)
New commits:
commit 1a711ed042d252270dcf81ebfbb0001f4bf45225
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Apr 5 13:00:37 2011 -0400
add hibernate-annotations.jar to the CLI's lib dir, so users can compile custom RHQ remote clients using CLI/lib/*.jar as the compile classpath (https://bugzilla.redhat.com/show_bug.cgi?id=683136)
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index 1c5207c..370f509 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -126,6 +126,7 @@
<property name="opencsv.version" value="${opencsv.version}" />
<property name="concurrent.version" value="${concurrent.version}" />
<property name="getopt.version" value="${getopt.version}" />
+ <property name="hibernate-annotations.version" value="${hibernate-annotations.version}" />
<property name="i18nlog.version" value="${i18nlog.version}" />
<property name="jboss-common.version" value="${jboss-common.version}" />
<property name="jboss.version" value="${jboss.version}" />
diff --git a/modules/enterprise/remoting/cli/src/main/scripts/rhq-client.build.xml b/modules/enterprise/remoting/cli/src/main/scripts/rhq-client.build.xml
index f54a691..baf99e5 100644
--- a/modules/enterprise/remoting/cli/src/main/scripts/rhq-client.build.xml
+++ b/modules/enterprise/remoting/cli/src/main/scripts/rhq-client.build.xml
@@ -65,6 +65,7 @@
<copy file="${settings.localRepository}/net/sf/opencsv/opencsv/${opencsv.version}/opencsv-${opencsv.version}.jar" tofile="${lib.home}/opencsv-${opencsv.version}.jar" verbose="true" />
<copy file="${settings.localRepository}/org/testng/testng/${testng.version}/testng-${testng.version}.jar" tofile="${lib.home}/testng-${testng.version}.jar" verbose="true" />
<copy file="${settings.localRepository}/org/rhq/rhq-script-bindings/${project.version}/rhq-script-bindings-${project.version}.jar" tofile="${lib.home}/rhq-script-bindings-${project.version}.jar" verbose="true" />
+ <copy file="${settings.localRepository}/hibernate-annotations/hibernate-annotations/${hibernate-annotations.version}/hibernate-annotations-${hibernate-annotations.version}.jar" todir="${lib.home}" verbose="true" />
</target>
</project>
13 years, 1 month
[rhq] 4 commits - modules/enterprise
by Simeon Pinder
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java | 53 +++++-----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java | 14 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java | 12 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java | 6 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOperationsPortlet.java | 6 +
7 files changed, 72 insertions(+), 27 deletions(-)
New commits:
commit 08da74a83a3122f2df503fe87532dcf660515e9f
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Mon Apr 4 17:24:38 2011 -0400
update default message for resource ops portlet.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOperationsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOperationsPortlet.java
index a0ef80ffba..9ca8f5c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOperationsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceOperationsPortlet.java
@@ -253,6 +253,12 @@ class ResourceOperationsCriteriaHistoryListView extends
protected String getBasePath() {
return "Resource/" + resourceComposite.getResource().getId() + "/Operations/History";
}
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+ getListGrid().setEmptyMessage(MSG.view_portlet_results_empty());
+ }
}
/** Provide implementation of ResourceOperationHistoryDataSource that dynamically
commit 9c5652e29fda9c0bbf5ed880616ecd3620b9ed26
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Mon Apr 4 16:36:06 2011 -0400
i)several refresh issues
ii)BZ:636733: platform util portlet always scrolling.
iii)BZ:636723: Platform util not refreshing.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
index 7c0f8d3..256f9c1 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
@@ -404,7 +404,6 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
public GroupConfigurationHistoryCriteriaTable(String locatorId, ResourceGroupComposite groupComposite) {
super(locatorId, groupComposite);
- getListGrid().setEmptyMessage(MSG.view_portlet_results_empty());
}
@Override
@@ -416,6 +415,13 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
}
}
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+ getListGrid().setEmptyMessage(MSG.view_portlet_results_empty());
+ }
+
}
class GroupConfigurationUdpatesCriteriaDataSource extends GroupResourceConfigurationDataSource {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java
index a0171c2..6f38d63 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java
@@ -25,6 +25,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.types.Autofit;
+import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.Img;
@@ -79,7 +80,6 @@ public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet
public PlatformSummaryPortlet(String locatorId) {
super(locatorId);
-
setWidth100();
setHeight100();
@@ -89,7 +89,8 @@ public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet
setShowRecordComponentsByCell(true);
setUseAllDataSourceFields(true);
- setAutoFitData(Autofit.HORIZONTAL);
+ setAutoFitData(Autofit.VERTICAL);
+ setOverflow(Overflow.AUTO);
setDataSource(new PlatformMetricDataSource(this));
setInitialCriteria(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.PLATFORM
@@ -387,4 +388,13 @@ public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet
return new PlatformSummaryPortlet(locatorId);
}
}
+
+ /** Custom refresh operation as we are not directly extending Table
+ */
+ @Override
+ public void redraw() {
+ super.redraw();
+ invalidateCache();
+ markForRedraw();
+ }
}
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 1ffacf6..4519b95 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
@@ -68,9 +68,6 @@ public abstract class AbstractRecentAlertsPortlet extends AlertHistoryView imple
setOverflow(Overflow.VISIBLE);
setShowFooterRefresh(false); //disable footer refresh button as redundant for portlets
setShowHeader(false);//disable header for portlets
- if (getListGrid() != null) {
- getListGrid().setEmptyMessage(MSG.view_portlet_results_empty());
- }
}
public Timer getRefreshTimer() {
@@ -396,4 +393,10 @@ public abstract class AbstractRecentAlertsPortlet extends AlertHistoryView imple
return criteria;
}
}
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+ getListGrid().setEmptyMessage(MSG.view_portlet_results_empty());
+ }
}
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 7eac876..e739098 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
@@ -353,6 +353,11 @@ public class ProblemResourcesPortlet extends Table<ProblemResourcesDataSource> i
return false;
}
+ @Override
+ public void redraw() {
+ super.refresh();
+ markForRedraw();
+ }
}
/**Construct table widget Label to display timerange settings used with latest datasource query.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
index a4a6e67..bd5c4ac 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
@@ -195,6 +195,12 @@ public class ResourceConfigurationUpdatesPortlet extends GroupConfigurationUpdat
protected String getBasePath() {
return "Resource/" + resourceComposite.getResource().getId() + "/Configuration/History";
}
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+ getListGrid().setEmptyMessage(MSG.view_portlet_results_empty());
+ }
}
class ConfigurationUdpatesCriteriaDataSource extends ConfigurationHistoryDataSource {
commit 3f6374cf07943d7403752d4a5367d7b0ce0e59ac
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Mon Apr 4 15:03:35 2011 -0400
adding npe check.
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 af95e7a..1ffacf6 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
@@ -68,7 +68,9 @@ public abstract class AbstractRecentAlertsPortlet extends AlertHistoryView imple
setOverflow(Overflow.VISIBLE);
setShowFooterRefresh(false); //disable footer refresh button as redundant for portlets
setShowHeader(false);//disable header for portlets
- getListGrid().setEmptyMessage(MSG.view_portlet_results_empty());
+ if (getListGrid() != null) {
+ getListGrid().setEmptyMessage(MSG.view_portlet_results_empty());
+ }
}
public Timer getRefreshTimer() {
commit 2009d4df168098b31cc6e833392a5ed8cd40c133
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Mon Apr 4 12:53:44 2011 -0400
i)modify table empty/populated messages for portlets to indicate matching results.
ii)enable auto-refresh for Alert* portlets.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
index f002795..7c0f8d3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
@@ -112,7 +112,7 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
protected boolean portletConfigInitialized = false;
protected boolean currentlyLoading = false;
protected String baseViewPath = "";
- private HistoryGroupResourceConfigurationTable groupHistoryTable;
+ private GroupConfigurationHistoryCriteriaTable groupHistoryTable;
protected static HashMap<String, String> updatedMapping = new HashMap<String, String>();
static {
@@ -300,16 +300,6 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
loadData();
}
- // @Override
- // protected void refreshTableInfo() {
- // super.refreshTableInfo();
- // if (getTableInfo() != null) {
- // int count = getListGrid().getSelection().length;
- // getTableInfo().setContents(
- // MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
- // }
- // }
-
@Override
public boolean isRefreshing() {
return this.currentlyLoading;
@@ -370,29 +360,18 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
filterResourceGroupIds.add(groupId);
criteria.addFilterResourceGroupIds(filterResourceGroupIds);
- groupHistoryTable = new HistoryGroupResourceConfigurationTable(extendLocatorId("Table"),
+ groupHistoryTable = new GroupConfigurationHistoryCriteriaTable(extendLocatorId("Table"),
groupComposite);
- // groupHistoryTable.setDataSource(new GroupConfigurationUdpatesCriteriaDataSource(portletConfig,
- // groupId));
- // groupHistoryTable.setShowHeader(false);
- // groupHistoryTable.setShowFooterRefresh(false);
} else {
- //TODO: spinder fix for empties
- // Criteria criteria = new Criteria();
ResourceGroup emptyGroup = new ResourceGroup("");
emptyGroup.setId(-1);
Long zero = new Long(0);
groupComposite = new ResourceGroupComposite(zero, zero, zero, zero, emptyGroup);
- // groupOperations = new GroupOperationsCriteriaHistoryListView(locatorId,
- // new GroupOperationsCriteriaDataSource(portletConfig), null, criteria, groupComposite);
- groupHistoryTable = new HistoryGroupResourceConfigurationTable(extendLocatorId("Table"),
+ groupHistoryTable = new GroupConfigurationHistoryCriteriaTable(extendLocatorId("Table"),
groupComposite);
- // groupHistoryTable.setDataSource(new GroupConfigurationUdpatesCriteriaDataSource(portletConfig,
- // groupId));
- // groupHistoryTable.setShowHeader(false);
- // groupHistoryTable.setShowFooterRefresh(false);
}
+ //update table for portlet display.
groupHistoryTable.setDataSource(new GroupConfigurationUdpatesCriteriaDataSource(portletConfig,
groupId));
groupHistoryTable.setShowHeader(false);
@@ -421,6 +400,24 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
return baseViewPath;
}
+ class GroupConfigurationHistoryCriteriaTable extends HistoryGroupResourceConfigurationTable {
+
+ public GroupConfigurationHistoryCriteriaTable(String locatorId, ResourceGroupComposite groupComposite) {
+ super(locatorId, groupComposite);
+ getListGrid().setEmptyMessage(MSG.view_portlet_results_empty());
+ }
+
+ @Override
+ protected void refreshTableInfo() {
+ super.refreshTableInfo();
+ if (getTableInfo() != null) {
+ int count = getListGrid().getSelection().length;
+ getTableInfo().setContents(
+ MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
+ }
+ }
+ }
+
class GroupConfigurationUdpatesCriteriaDataSource extends GroupResourceConfigurationDataSource {
public GroupConfigurationUdpatesCriteriaDataSource(Configuration portletConfig, int groupId) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
index 008c34b..b06c9a4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOobsPortlet.java
@@ -240,6 +240,7 @@ public class GroupOobsPortlet extends LocatableVLayout implements CustomSettings
recentOobContent.addChild(column);
recentOobContent.markForRedraw();
currentlyLoading = false;
+ markForRedraw();
}
});
}
@@ -247,6 +248,7 @@ public class GroupOobsPortlet extends LocatableVLayout implements CustomSettings
public void startRefreshCycle() {
refreshTimer = AutoRefreshPortletUtil.startRefreshCycle(this, this, refreshTimer);
recentOobContent.markForRedraw();
+ markForRedraw();
}
@Override
@@ -263,6 +265,7 @@ public class GroupOobsPortlet extends LocatableVLayout implements CustomSettings
@Override
public void redraw() {
super.redraw();
+ //spinder 4/3/11: although screen does not flash autorefresh is being called on time. Too fast for user to notice.
loadData();
}
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 188b2a1..af95e7a 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
@@ -68,6 +68,7 @@ public abstract class AbstractRecentAlertsPortlet extends AlertHistoryView imple
setOverflow(Overflow.VISIBLE);
setShowFooterRefresh(false); //disable footer refresh button as redundant for portlets
setShowHeader(false);//disable header for portlets
+ getListGrid().setEmptyMessage(MSG.view_portlet_results_empty());
}
public Timer getRefreshTimer() {
@@ -273,6 +274,12 @@ public abstract class AbstractRecentAlertsPortlet extends AlertHistoryView imple
super.onDestroy();
}
+ @Override
+ public void redraw() {
+ super.refresh();
+ markForRedraw();
+ }
+
static public class AlertsPortletDataSource extends AlertDataSource {
private Configuration configuration;
13 years, 1 month
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java | 8 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java | 45 +++++-----
2 files changed, 28 insertions(+), 25 deletions(-)
New commits:
commit 877170b93dacaa5e71b83709fdea29e10f70fe57
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Apr 4 16:51:02 2011 -0400
Work on issues revolving around direct navigation to either a resource/group
subtab list view, or detail for that view.
- rake sure to always invoke a bookmarkable view's renderView method in
order to get basePath set correctly, which is required for list entry link creation.
- remove restriction that the subTabLayout be drawn prior to adding a
member canvas. It may not be fully drawn in the direct navigation use case.
- make it more clear when we should handle tab selection events and when we
ignore them.
Maybe *this* time I finally got it right...
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
index 1d684ff..1dbc33d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java
@@ -210,7 +210,7 @@ public class SubTabLayout extends LocatableVLayout {
}
if (foundTab) {
- refresh();
+ setCurrentlySelected();
}
return foundTab;
@@ -248,7 +248,7 @@ public class SubTabLayout extends LocatableVLayout {
return false;
}
this.currentlySelected = subTab.getLocatorId();
- refresh();
+ setCurrentlySelected();
return true;
}
}
@@ -293,8 +293,8 @@ public class SubTabLayout extends LocatableVLayout {
}
}
- private void refresh() {
- if (isDrawn() && null != this.currentlySelected) {
+ private void setCurrentlySelected() {
+ if (null != this.currentlySelected) {
Button button = this.subTabs.get(this.currentlySelected).getButton();
button.select();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java
index cac30b2..c6867ac 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/AbstractTwoLevelTabSetView.java
@@ -228,7 +228,8 @@ public abstract class AbstractTwoLevelTabSetView<T, U extends Layout> extends Lo
TwoLevelTab tab = (tabName != null) ? this.tabSet.getTabByName(tabName) : null;
SubTab subtab = null;
- // if the requested tab is not available for the tabset then select the defaults (firing a new event)
+ // if the requested tab is not available for the tabset then select the default tab/subtab. Fire
+ // an event in order to navigate to the new path
if (tab == null || tab.getDisabled()) {
this.tabSet.setIgnoreSelectEvents(false);
subtab = selectDefaultTabAndSubTab();
@@ -239,39 +240,36 @@ public abstract class AbstractTwoLevelTabSetView<T, U extends Layout> extends Lo
subtab = (subtabName != null) ? tab.getSubTabByName(subtabName) : tab.getDefaultSubTab();
// due to our attempt to perform sticky tabbing we may request an invalid subtab when
- // switching resources. If the requested subtab is not available the select the default subtab for the tab
+ // switching resources. If the requested subtab is not available the select the default subtab
+ // for the tab. Fire an event in order to navigate to the new path.
if (subtab == null || tab.getLayout().isSubTabDisabled(subtab)) {
- subtab = tab.getLayout().getDefaultSubTab();
+ this.tabSet.setIgnoreSelectEvents(false);
+ subtab = selectDefaultSubTab(tab);
+ return;
}
- // select the subTab (this does not fire an event, just sets the subtab)
- tab.getLayout().selectSubTab(subtab);
-
- // the target tab/subtab is now determined. if the currently selected tab is not the target tab then
- // select it now.
- if (!tab.equals(this.tabSet.getSelectedTab())) {
-
- // Fire a tab selection event only if we're at the end of the path. If not then it is assumed that
- // the subtab view is a BookmarkableView and the navigation will continue in that way, below.
- if (viewPath.isEnd()) {
- this.tabSet.setIgnoreSelectEvents(false);
- this.tabSet.selectTab(tab);
- return;
- }
+ // the requested tab/subtab are valid, continue with this path
- this.tabSet.selectTab(tab);
- }
+ // select the tab and subTab (no event fired, we're already dealing with the correct path)
+ this.tabSet.selectTab(tab);
+ // this call adds the subtab canvas as a member of the subtablayout
+ tab.getLayout().selectSubTab(subtab);
- // if the desired tab/subtab are already selected, now we can render the subtab canvas
+ // get the target canvas
Canvas subView = subtab.getCanvas();
+ // if this is a bookmarkable view then further rendering is deferred to its renderView method. This
+ // will set the basePath as well as handle any remaining view items (e.g. id of a selected item in
+ // a subtab that contains a Master-Details view). Otherwise, make sure we perform any required
+ // refresh.
if (subView instanceof BookmarkableView) {
- // Handle any remaining view items (e.g. id of a selected item in a subtab that contains a Master-Details view).
((BookmarkableView) subView).renderView(viewPath);
+
} else if (subView instanceof RefreshableView && subView.isDrawn()) {
// Refresh the data on the subtab, so it's not stale.
Log.debug("Refreshing data for [" + subView.getClass().getName() + "]...");
((RefreshableView) subView).refresh();
+
}
// ensure the tabset is enabled (disabled in onTabSelected), and redraw
@@ -291,6 +289,11 @@ public abstract class AbstractTwoLevelTabSetView<T, U extends Layout> extends Lo
throw new IllegalStateException("No default tab is defined.");
}
+ return selectDefaultSubTab(tab);
+ }
+
+ private SubTab selectDefaultSubTab(TwoLevelTab tab) {
+
SubTab subTab = tab.getDefaultSubTab();
if (subTab == null || tab.getLayout().isSubTabDisabled(subTab)) {
CoreGUI.getErrorHandler().handleError(MSG.view_tabs_invalidSubTab(subTab.getName()));
13 years, 1 month
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java | 5 ++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java | 2 ++
2 files changed, 4 insertions(+), 3 deletions(-)
New commits:
commit 6773ca8922f29b95bf5b286f2f8a8330493d169e
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Apr 4 14:48:13 2011 -0400
fix bug in checkboxes for implied-read resource perms in permissions editor (https://bugzilla.redhat.com/show_bug.cgi?id=683852)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
index 447659b..506850a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
@@ -20,7 +20,6 @@ package org.rhq.enterprise.gui.coregui.client.admin.roles;
import java.util.ArrayList;
import java.util.EnumSet;
-import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Set;
@@ -73,7 +72,8 @@ public class PermissionsEditor extends LocatableVStack {
this.roleEditView = roleEditView;
this.isReadOnly = isReadOnly;
- this.selectedPermissions = new HashSet<Permission>();
+ // Default permission set
+ this.selectedPermissions = EnumSet.of(Permission.VIEW_RESOURCE);
setWidth("95%");
setHeight100();
@@ -337,7 +337,6 @@ public class PermissionsEditor extends LocatableVStack {
Permission permission = Permission.valueOf(permissionName);
if (permission == Permission.VIEW_RESOURCE) {
event.getItem().setValue(true);
- event.getItem().disable();
String permissionDisplayName = record.getAttribute("displayName");
Message message = new Message(
MSG.view_adminRoles_permissions_readAccessImplied(permissionDisplayName),
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java
index 3af67b6..fd2a086 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java
@@ -251,6 +251,8 @@ public class RolesDataSource extends RPCDataSource<Role, RoleCriteria> {
public static Set<Permission> toPermissionSet(Record[] permissionRecords) {
Set<Permission> permissions = new HashSet<Permission>();
+ // VIEW_RESOURCE is implied, so make sure it's always in the returned Set.
+ permissions.add(Permission.VIEW_RESOURCE);
for (Record permissionRecord : permissionRecords) {
String permissionName = permissionRecord.getAttribute("name");
Permission permission = Permission.valueOf(permissionName);
13 years, 1 month
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java | 17 ++++++----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java | 3 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java | 7 ++++
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 3 +
4 files changed, 22 insertions(+), 8 deletions(-)
New commits:
commit 25cfc0c27b8a0224dd628acde62722e92915e707
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Mon Apr 4 12:17:46 2011 -0400
on new op schedule page, select mode=calendar and run=now by default and change title of Save button to "Schedule"; fix bug where read-only prop values were displayed as " "
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
index 69a3c52..b7f1adf 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
@@ -120,6 +120,7 @@ import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
+import org.rhq.enterprise.gui.coregui.client.util.StringUtility;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout;
@@ -1261,10 +1262,7 @@ public class ConfigurationEditor extends LocatableVLayout {
// TODO (ips, 03/25/11): We eventually want to use StaticTextItems for read-only PASSWORD props too, but we have
// to wait until we implement masking/unmasking of PASSWORD props at the SLSB layer first.
if (propertyIsReadOnly && propertyDefinitionSimple.getType() != PropertySimpleType.PASSWORD) {
- StaticTextItem staticItem = new StaticTextItem();
- // Property values are user-editable, so escape HTML to prevent an XSS attack.
- staticItem.setOutputAsHTML(true);
- valueItem = staticItem;
+ valueItem = new StaticTextItem();
} else {
List<PropertyDefinitionEnumeration> enumeratedValues = propertyDefinitionSimple.getEnumeratedValues();
if (enumeratedValues != null && !enumeratedValues.isEmpty()) {
@@ -1336,13 +1334,20 @@ public class ConfigurationEditor extends LocatableVLayout {
}
}
- // for more robust and repeatable item locators (not positional) assign a name and title
+ // For more robust and repeatable item locators (not positional), assign a name and a title.
valueItem.setName(propertySimple.getName());
valueItem.setTitle("none");
valueItem.setShowTitle(false);
+
+ String value = propertySimple.getStringValue();
+ if (valueItem instanceof StaticTextItem) {
+ // Property values are user-editable, so escape HTML when displayed as static text, to prevent XSS attacks.
+ value = StringUtility.escapeHtml(value);
+ }
// TODO (ips): I don't think we want to use setDefaultValue(), as it will cause the input to be reset to the
// value if the user clears it.
- valueItem.setDefaultValue(propertySimple.getStringValue());
+ valueItem.setDefaultValue(value);
+
valueItem.setRequired(propertyDefinitionSimple.isRequired());
valueItem.setWidth(220);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java
index 13ebe7d..47f9014 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/trigger/JobTriggerEditor.java
@@ -190,12 +190,12 @@ public class JobTriggerEditor extends LocatableVLayout {
modeItem.setValueMap(modeValueMap);
modeItem.setVertical(false);
modeItem.setShowTitle(true);
+ modeItem.setValue("calendar");
this.modeForm.setFields(modeItem);
addMember(this.modeForm);
this.calendarModeLayout = new LocatableVLayout(extendLocatorId("CalendarModeLayout"));
- this.calendarModeLayout.setVisible(false);
this.calendarTypeForm = new EnhancedDynamicForm(extendLocatorId("CalendarTypeForm"), this.isReadOnly);
@@ -209,6 +209,7 @@ public class JobTriggerEditor extends LocatableVLayout {
calendarTypeValueMap.put("laterAndRepeat", MSG.widget_jobTriggerEditor_value_laterAndRepeat());
calendarTypeItem.setValueMap(calendarTypeValueMap);
calendarTypeItem.setVertical(false);
+ calendarTypeItem.setValue("now");
this.calendarTypeForm.setFields(calendarTypeItem);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
index 387c4d5..118cec2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/operation/schedule/AbstractOperationScheduleDetailsView.java
@@ -218,6 +218,13 @@ public abstract class AbstractOperationScheduleDetailsView extends AbstractRecor
}
@Override
+ protected ButtonBar buildButtonBar() {
+ ButtonBar buttonBar = super.buildButtonBar();
+ buttonBar.getSaveButton().setTitle(MSG.common_button_schedule());
+ return buttonBar;
+ }
+
+ @Override
protected String getTitleFieldName() {
return ResourceOperationScheduleDataSource.Field.OPERATION_DISPLAY_NAME;
}
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 0e5dadc..4a9cfa4 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
@@ -13,7 +13,7 @@ common_buildInfo_gwtVersion = ${gwt.version}
# Button Labels
#--------------
-common_button_ack = Acknowlege
+common_button_ack = Acknowledge
common_button_ack_all = Acknowledge All
common_button_add = Add
common_button_advanced = Advanced...
@@ -37,6 +37,7 @@ common_button_purgeAll = Purge All
common_button_refresh = Refresh
common_button_reset = Reset
common_button_save = Save
+common_button_schedule = Schedule
common_button_search = Search
common_button_set = Set
common_button_showDetails = Show Details...
13 years, 1 month
[rhq] 8 commits - modules/core modules/enterprise
by Simeon Pinder
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java | 16
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ImageManager.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/PortletConfigurationEditorComponent.java | 93 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java | 551 ++++++++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java | 324 +++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java | 20
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java | 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java | 97 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationTable.java | 100 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java | 14
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView.java | 7
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 17
17 files changed, 1180 insertions(+), 123 deletions(-)
New commits:
commit a89e5f870173e6c9df210a97cb39ed12d2fa64f6
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Mon Apr 4 08:17:06 2011 -0400
remove config-updates portlet unless compatible grp.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
index 650c9a3..f087202 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
@@ -527,6 +527,7 @@ public class DashboardView extends LocatableVLayout {
groupKeyNameMap.remove(GroupMetricsPortlet.KEY);
groupKeyNameMap.remove(GroupOobsPortlet.KEY);
groupKeyNameMap.remove(GroupPkgHistoryPortlet.KEY);
+ groupKeyNameMap.remove(GroupConfigurationUpdatesPortlet.KEY);
} else {
//for compatible may still need to do some pruning.
if (!facets.isEmpty()) {
commit 687c8c170ac700896242e59e2e5d7acc5d301335
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sun Apr 3 15:03:34 2011 -0400
remove old activityView2 tabs.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
index 86a7c1c..8e8eca7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java
@@ -64,7 +64,6 @@ import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.operation.history.GroupOperationHistoryListView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.operation.schedule.GroupOperationScheduleListView;
import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.summary.ActivityView;
-import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.summary.ActivityView3;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
/**
@@ -91,7 +90,6 @@ public class ResourceGroupDetailView extends AbstractTwoLevelTabSetView<Resource
// subtabs
private SubTab summaryActivity;
- private SubTab summaryActivity2;
private SubTab summaryTimeline;
private SubTab monitorGraphs;
private SubTab monitorTables;
@@ -155,13 +153,9 @@ public class ResourceGroupDetailView extends AbstractTwoLevelTabSetView<Resource
.view_tabs_common_summary()), ImageManager.getResourceIcon(ResourceCategory.SERVICE, Boolean.TRUE));
summaryActivity = new SubTab(summaryTab.extendLocatorId("Activity"), new ViewName("Activity", MSG
.view_tabs_common_activity()), null);
- summaryActivity2 = new SubTab(summaryTab.extendLocatorId("Activity2"), new ViewName("Activity2", MSG
- .view_tabs_common_activity()
- + "2"), null);
summaryTimeline = new SubTab(summaryTab.extendLocatorId("Timeline"), new ViewName("Timeline", MSG
.view_tabs_common_timeline()), null);
- // summaryTab.registerSubTabs(summaryActivity, summaryTimeline);
- summaryTab.registerSubTabs(summaryActivity, summaryActivity2, summaryTimeline);
+ summaryTab.registerSubTabs(summaryActivity, summaryTimeline);
tabs.add(summaryTab);
inventoryTab = new TwoLevelTab(getTabSet().extendLocatorId("Inventory"), new ViewName("Inventory", MSG
@@ -260,12 +254,6 @@ public class ResourceGroupDetailView extends AbstractTwoLevelTabSetView<Resource
return new ActivityView(summaryActivity.extendLocatorId("View"), groupComposite);
}
});
- updateSubTab(this.summaryTab, this.summaryActivity2, true, true, new ViewFactory() {
- @Override
- public Canvas createView() {
- return new ActivityView3(summaryActivity2.extendLocatorId("View2"), groupComposite);
- }
- });
// TODO (ips): Add Timeline subtab?
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
index 91f617d..8ddb631 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java
@@ -68,7 +68,6 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitorin
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.history.ResourceOperationHistoryListView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.schedule.ResourceOperationScheduleListView;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.ActivityView;
-import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.ActivityView3;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
@@ -113,7 +112,6 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo
private TwoLevelTab contentTab;
private SubTab summaryActivity;
- private SubTab summaryActivity2;
private SubTab summaryTimeline;
private SubTab monitorGraphs;
private SubTab monitorTables;
@@ -153,12 +151,9 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo
.view_tabs_common_summary()), ImageManager.getResourceIcon(ResourceCategory.SERVICE, Boolean.TRUE));
summaryActivity = new SubTab(summaryTab.extendLocatorId("Activity"), new ViewName("Activity", MSG
.view_tabs_common_activity()), null);
- summaryActivity2 = new SubTab(summaryTab.extendLocatorId("Activity2"), new ViewName("Activity2", MSG
- .view_tabs_common_activity()
- + "2"), null);
summaryTimeline = new SubTab(summaryTab.extendLocatorId("Timeline"), new ViewName("Timeline", MSG
.view_tabs_common_timeline()), null);
- summaryTab.registerSubTabs(summaryActivity, summaryActivity2, summaryTimeline);
+ summaryTab.registerSubTabs(summaryActivity, summaryTimeline);
tabs.add(summaryTab);
inventoryTab = new TwoLevelTab(getTabSet().extendLocatorId("Inventory"), new ViewName("Inventory", MSG
@@ -285,13 +280,6 @@ public class ResourceDetailView extends AbstractTwoLevelTabSetView<ResourceCompo
}
});
- updateSubTab(this.summaryTab, this.summaryActivity2, true, true, new ViewFactory() {
- @Override
- public Canvas createView() {
- return new ActivityView3(summaryActivity2.extendLocatorId("View"), resourceComposite);
- }
- });
-
updateSubTab(this.summaryTab, this.summaryTimeline, true, true, new ViewFactory() {
@Override
public Canvas createView() {
commit 076c5fd6ad952765cab9e92b815c2fddfd723e9b
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sun Apr 3 14:59:22 2011 -0400
update portlet table view message to better reflect criteria filtering.
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 93fd686..188b2a1 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
@@ -247,6 +247,16 @@ public abstract class AbstractRecentAlertsPortlet extends AlertHistoryView imple
super.setupTableInteractions(hasWriteAccess);
}
+ @Override
+ protected void refreshTableInfo() {
+ super.refreshTableInfo();
+ if (getTableInfo() != null) {
+ int count = getListGrid().getSelection().length;
+ getTableInfo().setContents(
+ MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
+ }
+ }
+
public void startRefreshCycle() {
refreshTimer = AutoRefreshPortletUtil.startRefreshCycle(this, this, refreshTimer);
}
commit 39f958f9bb1723096d99f54a9834fbe3c103ecc1
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sun Apr 3 13:42:45 2011 -0400
modify default portlet arangements to include config updates where necessary.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
index ba91415..650c9a3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
@@ -67,11 +67,13 @@ import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
import org.rhq.enterprise.gui.coregui.client.components.form.ColorButtonItem;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupBundleDeploymentsPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupConfigurationUpdatesPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupMetricsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupOobsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupOperationsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupPkgHistoryPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceBundleDeploymentsPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceConfigurationUpdatesPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceEventsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceMetricsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceOperationsPortlet;
@@ -495,6 +497,10 @@ public class DashboardView extends LocatableVLayout {
if (!facets.contains(ResourceTypeFacet.EVENT)) {
resourceKeyNameMap.remove(ResourceEventsPortlet.KEY);
}
+ //Configuration related portlets
+ if (!facets.contains(ResourceTypeFacet.CONFIGURATION)) {
+ resourceKeyNameMap.remove(ResourceConfigurationUpdatesPortlet.KEY);
+ }
}
//Bundle related portlet
if (!resource.getResourceType().getCategory().equals(ResourceCategory.PLATFORM)) {
@@ -537,6 +543,10 @@ public class DashboardView extends LocatableVLayout {
if (!facets.contains(ResourceTypeFacet.CONTENT)) {
groupKeyNameMap.remove(GroupPkgHistoryPortlet.KEY);
}
+ //CONFIGURATION related portlets(CONFIGURATION)
+ if (!facets.contains(ResourceTypeFacet.CONFIGURATION)) {
+ groupKeyNameMap.remove(GroupConfigurationUpdatesPortlet.KEY);
+ }
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
index dc74fb6..c6b36b0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
@@ -56,6 +56,7 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardView;
import org.rhq.enterprise.gui.coregui.client.dashboard.PortletFactory;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupAlertsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupBundleDeploymentsPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupConfigurationUpdatesPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupMetricsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupOperationsPortlet;
import org.rhq.enterprise.gui.coregui.client.gwt.DashboardGWTServiceAsync;
@@ -269,6 +270,12 @@ public class ActivityView extends LocatableVLayout implements DashboardContainer
dashboard.addPortlet(ops, colRight, rowRight++);
groupKeyNameMap.remove(GroupOperationsPortlet.KEY);
}
+ if (groupKeyNameMap.containsKey(GroupConfigurationUpdatesPortlet.KEY)) {//operations if available
+ DashboardPortlet ops = new DashboardPortlet(GroupConfigurationUpdatesPortlet.NAME,
+ GroupConfigurationUpdatesPortlet.KEY, 220);
+ dashboard.addPortlet(ops, colRight, rowRight++);
+ groupKeyNameMap.remove(GroupConfigurationUpdatesPortlet.KEY);
+ }
//Fill out left column(typically smaller portlets) then alternate cols with remaining
displayLeft = false;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView.java
index 4cec210..ca227e2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/ActivityView.java
@@ -30,6 +30,7 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardContainer;
import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardView;
import org.rhq.enterprise.gui.coregui.client.dashboard.PortletFactory;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceAlertsPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceConfigurationUpdatesPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceMetricsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceOperationsPortlet;
import org.rhq.enterprise.gui.coregui.client.gwt.DashboardGWTServiceAsync;
@@ -199,6 +200,12 @@ public class ActivityView extends LocatableVLayout implements DashboardContainer
dashboard.addPortlet(ops, colRight, rowRight++);
resKeyNameMap.remove(ResourceOperationsPortlet.KEY);
}
+ if (resKeyNameMap.containsKey(ResourceConfigurationUpdatesPortlet.KEY)) {//configuration if available
+ DashboardPortlet ops = new DashboardPortlet(ResourceConfigurationUpdatesPortlet.NAME,
+ ResourceConfigurationUpdatesPortlet.KEY, 220);
+ dashboard.addPortlet(ops, colRight, rowRight++);
+ resKeyNameMap.remove(ResourceConfigurationUpdatesPortlet.KEY);
+ }
//Fill out left column(typically smaller portlets) then alternate cols with remaining
boolean displayLeft = false;
commit ede97db6398b087d3624b4736e24e531a685e85f
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sun Apr 3 13:21:38 2011 -0400
add resource configuration updates portlet.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
index 1bd51de..2ccb582 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
@@ -49,6 +49,7 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.operation
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.problems.ProblemResourcesPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceAlertsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceBundleDeploymentsPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceConfigurationUpdatesPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceEventsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceMetricsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource.ResourceOobsPortlet;
@@ -151,6 +152,8 @@ public class PortletFactory {
ResourcePkgHistoryPortlet.Factory.INSTANCE);
registeredResourcePortletFactoryMap.put(ResourceBundleDeploymentsPortlet.KEY,
ResourceBundleDeploymentsPortlet.Factory.INSTANCE);
+ registeredResourcePortletFactoryMap.put(ResourceConfigurationUpdatesPortlet.KEY,
+ ResourceConfigurationUpdatesPortlet.Factory.INSTANCE);
//register resource portlet names
registeredResourcePortletNameMap = new HashMap<String, String>(registeredResourcePortletFactoryMap.size());
@@ -162,6 +165,8 @@ public class PortletFactory {
registeredResourcePortletNameMap.put(ResourceAlertsPortlet.KEY, ResourceAlertsPortlet.NAME);
registeredResourcePortletNameMap.put(ResourceBundleDeploymentsPortlet.KEY,
ResourceBundleDeploymentsPortlet.NAME);
+ registeredResourcePortletNameMap.put(ResourceConfigurationUpdatesPortlet.KEY,
+ ResourceConfigurationUpdatesPortlet.NAME);
//############## Portlet icon mappings ############################################
//register portlet names
@@ -181,6 +186,7 @@ public class PortletFactory {
registeredPortletIconMap.put(GroupBundleDeploymentsPortlet.KEY, ImageManager.getBundleIcon());
registeredPortletIconMap.put(ResourceBundleDeploymentsPortlet.KEY, ImageManager.getBundleIcon());
registeredPortletIconMap.put(GroupConfigurationUpdatesPortlet.KEY, ImageManager.getConfigureIcon());
+ registeredPortletIconMap.put(ResourceConfigurationUpdatesPortlet.KEY, ImageManager.getConfigureIcon());
}
public static Portlet buildPortlet(String locatorId, PortletWindow portletWindow, DashboardPortlet storedPortlet) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
index 083c43b..f002795 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
@@ -124,11 +124,14 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
//figure out which page we're loading
String currentPage = History.getToken();
String[] elements = currentPage.split("/");
- int currentGroupId = AbstractActivityView.groupIdLookup(currentPage);
- this.groupId = currentGroupId;
+ this.groupId = groupId;
baseViewPath = elements[0];
}
+ public GroupConfigurationUpdatesPortlet(String locatorId) {
+ super(locatorId);
+ }
+
/**Defines layout for the portlet page.
*/
protected void initializeUi() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
new file mode 100644
index 0000000..a4a6e67
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/resource/ResourceConfigurationUpdatesPortlet.java
@@ -0,0 +1,324 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2010 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.resource;
+
+import java.util.ArrayList;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.ResourceConfigurationUpdate;
+import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria;
+import org.rhq.core.domain.criteria.ResourceCriteria;
+import org.rhq.core.domain.resource.composite.ResourceComposite;
+import org.rhq.core.domain.util.PageControl;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.dashboard.Portlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupConfigurationUpdatesPortlet;
+import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryDataSource;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryView;
+import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
+
+/**This portlet allows the end user to customize the Package History display
+ *
+ * @author Simeon Pinder
+ */
+public class ResourceConfigurationUpdatesPortlet extends GroupConfigurationUpdatesPortlet {
+
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "ResourceConfigurationUpdates";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_resource_config_updates();
+
+ private int resourceId = -1;
+ private ResourceComposite resourceComposite;
+
+ private ResourceConfigurationHistoryCriteriaView resourceHistoryTable;
+
+ public ResourceConfigurationUpdatesPortlet(String locatorId, int resourceId) {
+ super(locatorId);
+ this.resourceId = resourceId;
+ //figure out which page we're loading
+ String currentPage = History.getToken();
+ String[] elements = currentPage.split("/");
+ baseViewPath = elements[0];
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+ initializeUi();
+ loadData();
+ }
+
+ public static final class Factory implements PortletViewFactory {
+ public static PortletViewFactory INSTANCE = new Factory();
+
+ /* (non-Javadoc)
+ * TODO: This factory ASSUMES the user is currently navigated to a group detail view, and generates a portlet
+ * for that group. It will fail in other scenarios. This mechanism should be improved such that the
+ * factory method can take an EntityContext explicitly indicating, in this case, the group.
+ * @see org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory#getInstance(java.lang.String)
+ */
+ public final Portlet getInstance(String locatorId) {
+ //figure out which page we're loading
+ String currentPage = History.getToken();
+ String[] elements = currentPage.split("/");
+ int currentResourceIdentifier = Integer.valueOf(elements[1]);
+ int resourceId = currentResourceIdentifier;
+
+ return new ResourceConfigurationUpdatesPortlet(locatorId, resourceId);
+ }
+ }
+
+ @Override
+ public void redraw() {
+ super.redraw();
+ loadData();
+ }
+
+ private void loadData() {
+ //populate composite data
+ //locate resourceRef
+ ResourceCriteria criteria = new ResourceCriteria();
+ criteria.addFilterId(this.resourceId);
+ criteria.fetchResourceConfigurationUpdates(false);
+ criteria.fetchOperationHistories(false);
+
+ //locate the resource
+ GWTServiceLookup.getResourceService().findResourceCompositesByCriteria(criteria,
+ new AsyncCallback<PageList<ResourceComposite>>() {
+ @Override
+ public void onFailure(Throwable caught) {
+ Log.debug("Error retrieving resource composite for resource [" + resourceId + "]:"
+ + caught.getMessage());
+ currentlyLoading = false;
+ }
+
+ @Override
+ public void onSuccess(PageList<ResourceComposite> results) {
+ if (!results.isEmpty()) {
+ resourceComposite = results.get(0);
+ //instantiate view
+
+ PageControl lastFive = new PageControl(0, 5);
+ ResourceConfigurationUpdateCriteria criteria = new ResourceConfigurationUpdateCriteria();
+ criteria.setPageControl(lastFive);
+ //TODO: spinder: move this up into the pageControl.
+ criteria.addSortStatus(PageOrdering.DESC);
+ criteria.addFilterResourceIds(resourceId);
+
+ resourceHistoryTable = new ResourceConfigurationHistoryCriteriaView(extendLocatorId("Table"),
+ resourceComposite.getResourcePermission().isConfigureWrite(), resourceId);
+ } else {
+ resourceHistoryTable = new ResourceConfigurationHistoryCriteriaView(extendLocatorId("Table"),
+ resourceComposite.getResourcePermission().isConfigureWrite(), -1);
+ }
+ resourceHistoryTable.setDataSource(new ConfigurationUdpatesCriteriaDataSource(portletConfig));
+ resourceHistoryTable.setShowHeader(false);
+ resourceHistoryTable.setShowFooterRefresh(false);
+
+ //cleanup
+ for (Canvas child : recentConfigurationContent.getChildren()) {
+ child.destroy();
+ }
+ recentConfigurationContent.addChild(resourceHistoryTable);
+ recentConfigurationContent.markForRedraw();
+ currentlyLoading = false;
+ }
+ });
+ }
+
+ class ResourceConfigurationHistoryCriteriaView extends ConfigurationHistoryView {
+
+ public ResourceConfigurationHistoryCriteriaView(String locatorId, boolean hasWritePerm, int resourceId) {
+ super(locatorId, hasWritePerm, resourceId);
+ }
+
+ @Override
+ protected void refreshTableInfo() {
+ super.refreshTableInfo();
+ if (getTableInfo() != null) {
+ int count = getListGrid().getSelection().length;
+ getTableInfo().setContents(
+ MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
+ }
+ }
+
+ /**
+ * Override if you don't want the detailsLinkColumn to have the default link wrapper.
+ * @return the desired CellFormatter.
+ */
+ protected CellFormatter getDetailsLinkColumnCellFormatter() {
+ return new CellFormatter() {
+ public String format(Object value, ListGridRecord record, int i, int i1) {
+ Integer recordId = getId(record);
+ String detailsUrl = "#" + getBasePath() + "/" + recordId;
+ return SeleniumUtility.getLocatableHref(detailsUrl, value.toString(), null);
+ }
+ };
+ }
+
+ @Override
+ protected String getBasePath() {
+ return "Resource/" + resourceComposite.getResource().getId() + "/Configuration/History";
+ }
+ }
+
+ class ConfigurationUdpatesCriteriaDataSource extends ConfigurationHistoryDataSource {
+
+ public ConfigurationUdpatesCriteriaDataSource(Configuration portletConfig) {
+ super();
+ this.portletConfig = portletConfig;
+ }
+
+ private Configuration portletConfig;
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response,
+ final ResourceConfigurationUpdateCriteria criteria) {
+ ConfigurationGWTServiceAsync configurationService = GWTServiceLookup.getConfigurationService();
+
+ configurationService.findResourceConfigurationUpdatesByCriteria(criteria,
+ new AsyncCallback<PageList<ResourceConfigurationUpdate>>() {
+
+ @Override
+ public void onSuccess(PageList<ResourceConfigurationUpdate> result) {
+ response.setData(buildRecords(result));
+ //adjust for portlets that restrict result size
+ response.setTotalRows(result.size());
+ processResponse(request.getRequestId(), response);
+ }
+
+ @Override
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_group_resConfig_table_failFetch(), caught);
+ response.setStatus(DSResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+ });
+ }
+
+ @Override
+ protected ResourceConfigurationUpdateCriteria getFetchCriteria(final DSRequest request) {
+ //initialize criteria
+ ResourceConfigurationUpdateCriteria criteria = new ResourceConfigurationUpdateCriteria();
+ criteria.addFilterResourceIds(resourceId);
+
+ //initialize to only five for quick queries.
+ PageControl pageControl = new PageControl(0, 5);//default to displaying five
+ //customize query with latest configuration selections
+
+ //retrieve previous settings from portlet config
+ if (portletConfig != null) {
+ // //result sort order
+ // PropertySimple property = portletConfig.getSimple(Constant.RESULT_SORT_ORDER);
+ // if (property != null) {
+ // String currentSetting = property.getStringValue();
+ // if (currentSetting.trim().isEmpty() || currentSetting.equalsIgnoreCase(PageOrdering.DESC.name())) {
+ // criteria.addSortStatus(PageOrdering.DESC);
+ // } else {
+ // criteria.addSortStatus(PageOrdering.ASC);
+ // }
+ // }
+ //result timeframe if enabled
+ PropertySimple property = portletConfig.getSimple(Constant.METRIC_RANGE_ENABLE);
+ if (Boolean.valueOf(property.getBooleanValue())) {//then proceed setting
+
+ boolean isAdvanced = false;
+ //detect type of widget[Simple|Advanced]
+ property = portletConfig.getSimple(Constant.METRIC_RANGE_BEGIN_END_FLAG);
+ if (property != null) {
+ isAdvanced = property.getBooleanValue();
+ }
+ if (isAdvanced) {
+ //Advanced time settings
+ property = portletConfig.getSimple(Constant.METRIC_RANGE);
+ if (property != null) {
+ String currentSetting = property.getStringValue();
+ String[] range = currentSetting.split(",");
+ criteria.addFilterStartTime(Long.valueOf(range[0]));
+ criteria.addFilterEndTime(Long.valueOf(range[1]));
+ }
+ } else {
+ //Simple time settings
+ property = portletConfig.getSimple(Constant.METRIC_RANGE_LASTN);
+ if (property != null) {
+ int lastN = property.getIntegerValue();
+ property = portletConfig.getSimple(Constant.METRIC_RANGE_UNIT);
+ int lastUnits = property.getIntegerValue();
+ ArrayList<Long> beginEnd = MeasurementUtility.calculateTimeFrame(lastN, Integer
+ .valueOf(lastUnits));
+ criteria.addFilterStartTime(Long.valueOf(beginEnd.get(0)));
+ criteria.addFilterEndTime(Long.valueOf(beginEnd.get(1)));
+ }
+ }
+ }
+
+ //result count
+ property = portletConfig.getSimple(Constant.RESULT_COUNT);
+ if (property != null) {
+ String currentSetting = property.getStringValue();
+ if (currentSetting.trim().isEmpty() || currentSetting.equalsIgnoreCase("5")) {
+ pageControl.setPageSize(5);
+ } else {
+ pageControl = new PageControl(0, Integer.valueOf(currentSetting));
+ }
+ }
+ criteria.setPageControl(pageControl);
+
+ //detect operation status filter
+ property = portletConfig.getSimple(Constant.CONFIG_UPDATE_STATUS);
+ if (property != null) {
+ String currentSetting = property.getStringValue();
+ String[] parsedValues = currentSetting.trim().split(",");
+ if (currentSetting.trim().isEmpty()
+ || parsedValues.length == ConfigurationUpdateStatus.values().length) {
+ //all operation stati assumed
+ } else {
+ ConfigurationUpdateStatus[] updateStatus = new ConfigurationUpdateStatus[parsedValues.length];
+ int indx = 0;
+ for (String priority : parsedValues) {
+ ConfigurationUpdateStatus s = ConfigurationUpdateStatus.valueOf(priority);
+ updateStatus[indx++] = s;
+ }
+ criteria.addFilterStatuses(updateStatus);
+ }
+ }
+ }
+ return criteria;
+ }
+ }
+}
\ No newline at end of file
commit 815e140add7fc76d04157ee5349e560360ee3f68
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Apr 1 11:50:12 2011 -0400
fix invalid ConfigUpdate criteria values when querying on created/ctime.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java
index d01b28a..14ebac6 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java
@@ -38,7 +38,8 @@ import org.rhq.core.domain.util.PageOrdering;
public abstract class AbstractConfigurationUpdateCriteria extends Criteria {
private static final long serialVersionUID = 1L;
- public static final String SORT_FIELD_CTIME = "ctime";
+ public static final String SORT_FIELD_CTIME = "createdTime";
+
public static final String SORT_FIELD_STATUS = "status";
private Integer filterId;
@@ -54,8 +55,8 @@ public abstract class AbstractConfigurationUpdateCriteria extends Criteria {
public AbstractConfigurationUpdateCriteria() {
- filterOverrides.put("startTime", "ctime >= ?");
- filterOverrides.put("endTime", "ctime <= ?");
+ filterOverrides.put("startTime", "createdTime >= ?");
+ filterOverrides.put("endTime", "createdTime <= ?");
filterOverrides.put("statuses", "status IN ( ? )");
sortOverrides.put(SORT_FIELD_STATUS, "status");
commit b986579932d81b59f805c23e20c9038a0075da93
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Apr 1 09:06:38 2011 -0400
Adding missing ConfigUpdates portlet:
i)updating ConfigUpdateCriteria to support ConfigUpdateStatus[] as well
ii)ImageManager changes
iii)missing i18n messages
iv)ConfigUpdateStatus widget for shared portlets.
v)moved HistoryGroupResourceConfigurationTable.Datasource to top level class for better sharing.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java
index bd454d5..d01b28a 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AbstractConfigurationUpdateCriteria.java
@@ -22,11 +22,14 @@
*/
package org.rhq.core.domain.criteria;
+import java.util.List;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.util.CriteriaUtils;
import org.rhq.core.domain.util.PageOrdering;
@XmlRootElement
@@ -42,6 +45,7 @@ public abstract class AbstractConfigurationUpdateCriteria extends Criteria {
private Long filterStartTime; // requires overrides
private Long filterEndTime; // requires overrides
private ConfigurationUpdateStatus filterStatus;
+ private List<ConfigurationUpdateStatus> filterStatuses; // requires overrides
private boolean fetchConfiguration;
@@ -52,6 +56,7 @@ public abstract class AbstractConfigurationUpdateCriteria extends Criteria {
filterOverrides.put("startTime", "ctime >= ?");
filterOverrides.put("endTime", "ctime <= ?");
+ filterOverrides.put("statuses", "status IN ( ? )");
sortOverrides.put(SORT_FIELD_STATUS, "status");
}
@@ -72,6 +77,10 @@ public abstract class AbstractConfigurationUpdateCriteria extends Criteria {
this.filterStatus = status;
}
+ public void addFilterStatuses(ConfigurationUpdateStatus... configUpdateStatus) {
+ this.filterStatuses = CriteriaUtils.getListIgnoringNulls(configUpdateStatus);
+ }
+
public void fetchConfiguration(boolean configuration) {
this.fetchConfiguration = configuration;
}
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 58346f0..8be3976 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
@@ -485,4 +485,12 @@ public class ImageManager {
public static String getBundleIcon() {
return "subsystems/content/Content_16.png";
}
+
+ public static String getConfigureLargeIcon() {
+ return "subsystems/configure/Configure_24.png";
+ }
+
+ public static String getConfigureIcon() {
+ return "subsystems/configure/Configure_16.png";
+ }
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
index 520a948..1bd51de 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
@@ -32,6 +32,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupAlertsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupBundleDeploymentsPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupConfigurationUpdatesPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupEventsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupMetricsPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups.GroupOobsPortlet;
@@ -123,6 +124,8 @@ public class PortletFactory {
registeredGroupPortletFactoryMap.put(GroupPkgHistoryPortlet.KEY, GroupPkgHistoryPortlet.Factory.INSTANCE);
registeredGroupPortletFactoryMap.put(GroupBundleDeploymentsPortlet.KEY,
GroupBundleDeploymentsPortlet.Factory.INSTANCE);
+ registeredGroupPortletFactoryMap.put(GroupConfigurationUpdatesPortlet.KEY,
+ GroupConfigurationUpdatesPortlet.Factory.INSTANCE);
//register group portlet names
registeredGroupPortletNameMap = new HashMap<String, String>(registeredGroupPortletFactoryMap.size());
@@ -133,6 +136,7 @@ public class PortletFactory {
registeredGroupPortletNameMap.put(GroupOperationsPortlet.KEY, GroupOperationsPortlet.NAME);
registeredGroupPortletNameMap.put(GroupPkgHistoryPortlet.KEY, GroupPkgHistoryPortlet.NAME);
registeredGroupPortletNameMap.put(GroupBundleDeploymentsPortlet.KEY, GroupBundleDeploymentsPortlet.NAME);
+ registeredGroupPortletNameMap.put(GroupConfigurationUpdatesPortlet.KEY, GroupConfigurationUpdatesPortlet.NAME);
//############## Resource Activity Dashboard ############################################
//defines mapping for Group Activity Dashboard
@@ -176,6 +180,7 @@ public class PortletFactory {
registeredPortletIconMap.put(ResourcePkgHistoryPortlet.KEY, ImageManager.getActivityPackageIcon());
registeredPortletIconMap.put(GroupBundleDeploymentsPortlet.KEY, ImageManager.getBundleIcon());
registeredPortletIconMap.put(ResourceBundleDeploymentsPortlet.KEY, ImageManager.getBundleIcon());
+ registeredPortletIconMap.put(GroupConfigurationUpdatesPortlet.KEY, ImageManager.getConfigureIcon());
}
public static Portlet buildPortlet(String locatorId, PortletWindow portletWindow, DashboardPortlet storedPortlet) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/PortletConfigurationEditorComponent.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/PortletConfigurationEditorComponent.java
index cea94a9..b7488da 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/PortletConfigurationEditorComponent.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/PortletConfigurationEditorComponent.java
@@ -27,6 +27,7 @@ import com.smartgwt.client.widgets.form.fields.SelectItem;
import org.rhq.core.domain.alert.AlertPriority;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.operation.OperationRequestStatus;
import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
@@ -68,6 +69,8 @@ public class PortletConfigurationEditorComponent {
String CUSTOM_REFRESH = "CUSTOM_REFRESH";
String OPERATION_STATUS = "OPERATION_STATUS";
String OPERATION_STATUS_DEFAULT = "";//empty
+ String CONFIG_UPDATE_STATUS = "CONFIG_UPDATE_STATUS";
+ String CONFIG_UPDATE_STATUS_DEFAULT = "";
}
//configuration map initialization
@@ -90,6 +93,8 @@ public class PortletConfigurationEditorComponent {
CONFIG_PROPERTY_INITIALIZATION.put(Constant.METRIC_RANGE_UNIT, Constant.METRIC_RANGE_UNIT_DEFAULT);
//operation status, if empty initialize to "" i.e. all stati
CONFIG_PROPERTY_INITIALIZATION.put(Constant.OPERATION_STATUS, Constant.OPERATION_STATUS_DEFAULT);
+ //config update status, if empty initialize to "" i.e. all stati
+ CONFIG_PROPERTY_INITIALIZATION.put(Constant.CONFIG_UPDATE_STATUS, Constant.CONFIG_UPDATE_STATUS_DEFAULT);
}
/* Single select combobox for number of items to display on the dashboard
@@ -99,9 +104,9 @@ public class PortletConfigurationEditorComponent {
public static SelectItem getResultCountEditor(Configuration portletConfig) {
final SelectItem maximumResultsComboBox = new SelectItem(Constant.RESULT_COUNT);
- maximumResultsComboBox.setTitle("Results Count");
+ maximumResultsComboBox.setTitle(MSG.common_title_results_count());
maximumResultsComboBox.setWrapTitle(false);
- maximumResultsComboBox.setTooltip("<nobr><b> " + "Displays N results with alerts" + "</b></nobr>");
+ maximumResultsComboBox.setTooltip("<nobr><b> " + MSG.common_title_results_count_tooltip() + "</b></nobr>");
//spinder 9/3/10: the following is required workaround to disable editability of combobox.
maximumResultsComboBox.setType("selection");
//set width of dropdown display region
@@ -176,9 +181,9 @@ public class PortletConfigurationEditorComponent {
* @return Populated selectItem instance.
*/
public static SelectItem getResulSortOrderEditor(Configuration portletConfig) {
- SelectItem sortPrioritySelection = new SelectItem(Constant.RESULT_SORT_PRIORITY, "Sort Order");
+ SelectItem sortPrioritySelection = new SelectItem(Constant.RESULT_SORT_PRIORITY, MSG.common_title_sort_order());
sortPrioritySelection.setWrapTitle(false);
- sortPrioritySelection.setTooltip("Sets sort order for results.");
+ sortPrioritySelection.setTooltip(MSG.common_title_sort_order_tooltip());
LinkedHashMap<String, String> priorities = new LinkedHashMap<String, String>(2);
priorities.put(PageOrdering.ASC.name(), "Ascending");
priorities.put(PageOrdering.DESC.name(), "Descending");
@@ -213,7 +218,7 @@ public class PortletConfigurationEditorComponent {
}
public static SelectItem getOperationStatusEditor(Configuration portletConfig) {
- SelectItem priorityFilter = new SelectItem(Constant.OPERATION_STATUS, "Operation Status");
+ SelectItem priorityFilter = new SelectItem(Constant.OPERATION_STATUS, MSG.common_title_operation_status());
priorityFilter.setWrapTitle(false);
priorityFilter.setWidth(325);
priorityFilter.setMultiple(true);
@@ -286,4 +291,82 @@ public class PortletConfigurationEditorComponent {
return priorityFilter;
}
+ public static SelectItem getConfigurationUpdateStatusEditor(Configuration portletConfig) {
+ SelectItem priorityFilter = new SelectItem(Constant.CONFIG_UPDATE_STATUS, MSG
+ .common_title_config_update_status());
+ priorityFilter.setWrapTitle(false);
+ priorityFilter.setWidth(335);
+ priorityFilter.setMultiple(true);
+ priorityFilter.setMultipleAppearance(MultipleAppearance.PICKLIST);
+
+ LinkedHashMap<String, String> stati = new LinkedHashMap<String, String>(4);
+ stati.put(ConfigurationUpdateStatus.SUCCESS.name(), MSG.common_status_success());
+ stati.put(ConfigurationUpdateStatus.INPROGRESS.name(), MSG.common_status_inprogress());
+ stati.put(ConfigurationUpdateStatus.NOCHANGE.name(), MSG.common_status_nochange());
+ stati.put(ConfigurationUpdateStatus.FAILURE.name(), MSG.common_status_failed());
+
+ LinkedHashMap<String, String> statusIcons = new LinkedHashMap<String, String>(3);
+ statusIcons.put(ConfigurationUpdateStatus.SUCCESS.name(), ImageManager
+ .getResourceConfigurationIcon(ConfigurationUpdateStatus.SUCCESS));
+ statusIcons.put(ConfigurationUpdateStatus.INPROGRESS.name(), ImageManager
+ .getResourceConfigurationIcon(ConfigurationUpdateStatus.INPROGRESS));
+ statusIcons.put(ConfigurationUpdateStatus.NOCHANGE.name(), ImageManager
+ .getResourceConfigurationIcon(ConfigurationUpdateStatus.NOCHANGE));
+ statusIcons.put(ConfigurationUpdateStatus.FAILURE.name(), ImageManager
+ .getResourceConfigurationIcon(ConfigurationUpdateStatus.FAILURE));
+ priorityFilter.setValueMap(stati);
+ priorityFilter.setValueIcons(statusIcons);
+ //reload current settings if they exist, otherwise enable all.
+ String currentValue = portletConfig.getSimple(Constant.CONFIG_UPDATE_STATUS).getStringValue();
+ if (currentValue.isEmpty() || currentValue.split(",").length == ConfigurationUpdateStatus.values().length) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.SUCCESS.name(), ConfigurationUpdateStatus.INPROGRESS
+ .name(), ConfigurationUpdateStatus.NOCHANGE.name(), ConfigurationUpdateStatus.FAILURE.name());
+ } else {
+ //spinder:3/4/11 doing this nonsense due to some weird smartgwt issue with SelectItem in VLayout.
+ if (currentValue.equalsIgnoreCase(ConfigurationUpdateStatus.SUCCESS.name())) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.SUCCESS.name());
+ } else if (currentValue.equalsIgnoreCase("SUCCESS,INPROGRESS,NOCHANGE,FAILURE")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.SUCCESS.name(), ConfigurationUpdateStatus.INPROGRESS
+ .name(), ConfigurationUpdateStatus.NOCHANGE.name(), ConfigurationUpdateStatus.FAILURE.name());
+ } else if (currentValue.equalsIgnoreCase("SUCCESS,INPROGRESS,NOCHANGE")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.SUCCESS.name(), ConfigurationUpdateStatus.INPROGRESS
+ .name(), ConfigurationUpdateStatus.NOCHANGE.name());
+ } else if (currentValue.equalsIgnoreCase("SUCCESS,INPROGRESS,FAILURE")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.SUCCESS.name(), ConfigurationUpdateStatus.INPROGRESS
+ .name(), ConfigurationUpdateStatus.FAILURE.name());
+ } else if (currentValue.equalsIgnoreCase("SUCCESS,INPROGRESS")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.SUCCESS.name(), ConfigurationUpdateStatus.INPROGRESS
+ .name());
+ } else if (currentValue.equalsIgnoreCase("SUCCESS,NOCHANGE,FAILURE")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.SUCCESS.name(), ConfigurationUpdateStatus.NOCHANGE
+ .name(), ConfigurationUpdateStatus.FAILURE.name());
+ } else if (currentValue.equalsIgnoreCase("SUCCESS,NOCHANGE")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.SUCCESS.name(), ConfigurationUpdateStatus.NOCHANGE
+ .name());
+ } else if (currentValue.equalsIgnoreCase("SUCCESS,FAILURE")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.SUCCESS.name(), ConfigurationUpdateStatus.FAILURE
+ .name());
+ } else if (currentValue.equalsIgnoreCase("INPROGRESS")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.INPROGRESS.name());
+ } else if (currentValue.equalsIgnoreCase("INPROGRESS,NOCHANGE,FAILURE")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.INPROGRESS.name(),
+ ConfigurationUpdateStatus.NOCHANGE.name(), ConfigurationUpdateStatus.FAILURE.name());
+ } else if (currentValue.equalsIgnoreCase("INPROGRESS,NOCHANGE")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.INPROGRESS.name(),
+ ConfigurationUpdateStatus.NOCHANGE.name());
+ } else if (currentValue.equalsIgnoreCase("INPROGRESS,FAILURE")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.INPROGRESS.name(), ConfigurationUpdateStatus.FAILURE
+ .name());
+ } else if (currentValue.equalsIgnoreCase("NOCHANGE")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.NOCHANGE.name());
+ } else if (currentValue.equalsIgnoreCase("NOCHANGE,FAILURE")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.NOCHANGE.name(), ConfigurationUpdateStatus.FAILURE
+ .name());
+ } else if (currentValue.equalsIgnoreCase("FAILURE")) {
+ priorityFilter.setValues(ConfigurationUpdateStatus.FAILURE.name());
+ }
+ }
+ return priorityFilter;
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
new file mode 100644
index 0000000..083c43b
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java
@@ -0,0 +1,548 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2010 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.groups;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.events.SubmitValuesEvent;
+import com.smartgwt.client.widgets.form.events.SubmitValuesHandler;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate;
+import org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria;
+import org.rhq.core.domain.criteria.ResourceGroupCriteria;
+import org.rhq.core.domain.dashboard.DashboardPortlet;
+import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
+import org.rhq.core.domain.util.PageControl;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
+import org.rhq.enterprise.gui.coregui.client.components.measurement.CustomConfigMeasurementRangeEditor;
+import org.rhq.enterprise.gui.coregui.client.dashboard.AutoRefreshPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.CustomSettingsPortlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.Portlet;
+import org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory;
+import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent;
+import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
+import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.common.detail.summary.AbstractActivityView;
+import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupDetailView;
+import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.configuration.GroupResourceConfigurationDataSource;
+import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.configuration.HistoryGroupResourceConfigurationTable;
+import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableCanvas;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+
+/**
+ * @author Simeon Pinder
+ */
+public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implements CustomSettingsPortlet,
+ AutoRefreshPortlet {
+
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "GroupConfigurationUpdates";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_group_config_updates();
+
+ private int groupId = -1;
+ protected LocatableCanvas recentConfigurationContent = new LocatableCanvas(
+ extendLocatorId("RecentConfigurationUpdates"));
+
+ public static final String ID = "id";
+
+ //defines the list of configuration elements to load/persist for this portlet
+ protected static List<String> CONFIG_INCLUDE = new ArrayList<String>();
+ static {
+ CONFIG_INCLUDE.add(Constant.METRIC_RANGE);
+ CONFIG_INCLUDE.add(Constant.METRIC_RANGE_BEGIN_END_FLAG);
+ CONFIG_INCLUDE.add(Constant.METRIC_RANGE_ENABLE);
+ CONFIG_INCLUDE.add(Constant.METRIC_RANGE_LASTN);
+ CONFIG_INCLUDE.add(Constant.METRIC_RANGE_UNIT);
+ CONFIG_INCLUDE.add(Constant.RESULT_COUNT);
+ CONFIG_INCLUDE.add(Constant.CONFIG_UPDATE_STATUS);
+ // CONFIG_INCLUDE.add(Constant.RESULT_SORT_ORDER);
+ }
+
+ // set on initial configuration, the window for this portlet view.
+ protected PortletWindow portletWindow;
+
+ //instance ui widgets
+ protected Canvas containerCanvas;
+
+ protected Timer refreshTimer;
+ protected DashboardPortlet storedPortlet;
+ protected Configuration portletConfig;
+ private ResourceGroupComposite groupComposite;
+ protected boolean portletConfigInitialized = false;
+ protected boolean currentlyLoading = false;
+ protected String baseViewPath = "";
+ private HistoryGroupResourceConfigurationTable groupHistoryTable;
+
+ protected static HashMap<String, String> updatedMapping = new HashMap<String, String>();
+ static {
+ updatedMapping.putAll(PortletConfigurationEditorComponent.CONFIG_PROPERTY_INITIALIZATION);
+ }
+
+ public GroupConfigurationUpdatesPortlet(String locatorId, int groupId) {
+ super(locatorId);
+ //figure out which page we're loading
+ String currentPage = History.getToken();
+ String[] elements = currentPage.split("/");
+ int currentGroupId = AbstractActivityView.groupIdLookup(currentPage);
+ this.groupId = currentGroupId;
+ baseViewPath = elements[0];
+ }
+
+ /**Defines layout for the portlet page.
+ */
+ protected void initializeUi() {
+ setHeight("*");
+ setWidth100();
+
+ //tell canvas to fill it's component
+ recentConfigurationContent.setHeight100();
+ addMember(recentConfigurationContent);
+ markForRedraw();
+ }
+
+ /** Responsible for initialization and lazy configuration of the portlet values
+ */
+ public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
+ //populate portlet configuration details
+ if (null == this.portletWindow && null != portletWindow) {
+ this.portletWindow = portletWindow;
+ }
+
+ if ((null == storedPortlet) || (null == storedPortlet.getConfiguration())) {
+ return;
+ }
+ this.storedPortlet = storedPortlet;
+ portletConfig = storedPortlet.getConfiguration();
+
+ //lazy init any elements not yet configured.
+ for (String key : PortletConfigurationEditorComponent.CONFIG_PROPERTY_INITIALIZATION.keySet()) {
+ if ((portletConfig.getSimple(key) == null) && CONFIG_INCLUDE.contains(key)) {
+ portletConfig.put(new PropertySimple(key,
+ PortletConfigurationEditorComponent.CONFIG_PROPERTY_INITIALIZATION.get(key)));
+ }
+ }
+ }
+
+ public Canvas getHelpCanvas() {
+ return new HTMLFlow(MSG.view_portlet_help_config_updates());
+ }
+
+ @Override
+ public DynamicForm getCustomSettingsForm() {
+ LocatableDynamicForm customSettings = new LocatableDynamicForm(extendLocatorId("customSettings"));
+ LocatableVLayout page = new LocatableVLayout(customSettings.extendLocatorId("page"));
+ //build editor form container
+ final LocatableDynamicForm form = new LocatableDynamicForm(page.extendLocatorId("alert-filter"));
+ form.setMargin(5);
+
+ //add sort priority selector
+ // final SelectItem resultSortSelector = PortletConfigurationEditorComponent
+ // .getResulSortOrderEditor(portletConfig);
+ //add result status selector
+ final SelectItem resultStatusSelector = PortletConfigurationEditorComponent
+ .getConfigurationUpdateStatusEditor(portletConfig);
+
+ //add result count selector
+ final SelectItem resultCountSelector = PortletConfigurationEditorComponent.getResultCountEditor(portletConfig);
+
+ //add range selector
+ final CustomConfigMeasurementRangeEditor measurementRangeEditor = PortletConfigurationEditorComponent
+ .getMeasurementRangeEditor(portletConfig);
+
+ // form.setItems(alertPrioritySelector, resultCountSelector);
+ form.setItems(resultStatusSelector, resultCountSelector);
+
+ //submit handler
+ customSettings.addSubmitValuesHandler(new SubmitValuesHandler() {
+
+ @Override
+ public void onSubmitValues(SubmitValuesEvent event) {
+ String selectedValue;
+
+ // //result sort order
+ // selectedValue = resultSortSelector.getValue().toString();
+ // if ((selectedValue.trim().isEmpty()) || (selectedValue.equalsIgnoreCase(PageOrdering.DESC.name()))) {//then desc
+ // portletConfig.put(new PropertySimple(Constant.RESULT_SORT_ORDER, PageOrdering.DESC));
+ // } else {
+ // portletConfig.put(new PropertySimple(Constant.RESULT_SORT_ORDER, PageOrdering.ASC));
+ // }
+ //config status
+ portletConfig = AbstractActivityView.saveConfigUpdateStatusSelectorSettings(resultStatusSelector,
+ portletConfig);
+
+ //result count
+ portletConfig = AbstractActivityView.saveResultCounterSettings(resultCountSelector, portletConfig);
+
+ //time range settings
+ portletConfig = AbstractActivityView.saveMeasurementRangeEditorSettings(measurementRangeEditor,
+ portletConfig);
+
+ //persist and reload portlet
+ storedPortlet.setConfiguration(portletConfig);
+ configure(portletWindow, storedPortlet);
+ // refresh();
+ redraw();
+ }
+ });
+ form.markForRedraw();
+ page.addMember(measurementRangeEditor);
+ page.addMember(form);
+ customSettings.addChild(page);
+ return customSettings;
+ }
+
+ public static final class Factory implements PortletViewFactory {
+ public static PortletViewFactory INSTANCE = new Factory();
+
+ /* (non-Javadoc)
+ * TODO: This factory ASSUMES the user is currently navigated to a group detail view, and generates a portlet
+ * for that group. It will fail in other scenarios. This mechanism should be improved such that the
+ * factory method can take an EntityContext explicitly indicating, in this case, the group.
+ * @see org.rhq.enterprise.gui.coregui.client.dashboard.PortletViewFactory#getInstance(java.lang.String)
+ */
+ public final Portlet getInstance(String locatorId) {
+
+ String currentPage = History.getToken();
+ int groupId = -1;
+ String[] elements = currentPage.split("/");
+ // process for groups and auto groups Ex. ResourceGroup/10111 or ResourceGroup/AutoCluster/10321
+ try {
+ groupId = Integer.valueOf(elements[1]);
+ } catch (NumberFormatException nfe) {
+ groupId = Integer.valueOf(elements[2]);
+ }
+
+ return new GroupConfigurationUpdatesPortlet(locatorId, groupId);
+ }
+ }
+
+ @Override
+ public void startRefreshCycle() {
+ //current setting
+ final int refreshInterval = UserSessionManager.getUserPreferences().getPageRefreshInterval();
+
+ //cancel any existing timer
+ if (refreshTimer != null) {
+ refreshTimer.cancel();
+ }
+
+ if (refreshInterval >= MeasurementUtility.MINUTES) {
+
+ refreshTimer = new Timer() {
+ public void run() {
+ redraw();
+ }
+ };
+
+ refreshTimer.scheduleRepeating(refreshInterval);
+ }
+ }
+
+ @Override
+ protected void onDestroy() {
+ if (refreshTimer != null) {
+ refreshTimer.cancel();
+ }
+
+ super.onDestroy();
+ }
+
+ @Override
+ protected void onInit() {
+ super.onInit();
+ //disable the refresh timer for this run
+ currentlyLoading = true;
+ initializeUi();
+ loadData();
+ }
+
+ // @Override
+ // protected void refreshTableInfo() {
+ // super.refreshTableInfo();
+ // if (getTableInfo() != null) {
+ // int count = getListGrid().getSelection().length;
+ // getTableInfo().setContents(
+ // MSG.view_table_matchingRows(String.valueOf(getListGrid().getTotalRows()), String.valueOf(count)));
+ // }
+ // }
+
+ @Override
+ public boolean isRefreshing() {
+ return this.currentlyLoading;
+ }
+
+ protected void setRefreshing(boolean currentlyRefreshing) {
+ this.currentlyLoading = currentlyRefreshing;
+ }
+
+ @Override
+ public void redraw() {
+ super.redraw();
+ loadData();
+ }
+
+ private void loadData() {
+ //populate composite data
+ //locate resourceGroupRef
+ ResourceGroupCriteria criteria = new ResourceGroupCriteria();
+ criteria.addFilterId(this.groupId);
+ criteria.fetchConfigurationUpdates(false);
+ criteria.fetchExplicitResources(false);
+ criteria.fetchGroupDefinition(false);
+ criteria.fetchOperationHistories(false);
+
+ // for autoclusters and autogroups we need to add more criteria
+ final boolean isAutoCluster = isAutoCluster();
+ final boolean isAutoGroup = isAutoGroup();
+ if (isAutoCluster) {
+ criteria.addFilterVisible(false);
+ } else if (isAutoGroup) {
+ criteria.addFilterVisible(false);
+ criteria.addFilterPrivate(true);
+ }
+
+ //locate the resource group
+ GWTServiceLookup.getResourceGroupService().findResourceGroupCompositesByCriteria(criteria,
+ new AsyncCallback<PageList<ResourceGroupComposite>>() {
+ @Override
+ public void onFailure(Throwable caught) {
+ Log.debug("Error retrieving resource group composite for group [" + groupId + "]:"
+ + caught.getMessage());
+ currentlyLoading = false;
+ }
+
+ @Override
+ public void onSuccess(PageList<ResourceGroupComposite> results) {
+ if (!results.isEmpty()) {
+ groupComposite = results.get(0);
+ //instantiate view
+
+ PageControl lastFive = new PageControl(0, 5);
+ GroupResourceConfigurationUpdateCriteria criteria = new GroupResourceConfigurationUpdateCriteria();
+ criteria.setPageControl(lastFive);
+ //TODO: spinder: move this up into the pageControl.
+ criteria.addSortStatus(PageOrdering.DESC);
+ List<Integer> filterResourceGroupIds = new ArrayList<Integer>();
+ filterResourceGroupIds.add(groupId);
+ criteria.addFilterResourceGroupIds(filterResourceGroupIds);
+
+ groupHistoryTable = new HistoryGroupResourceConfigurationTable(extendLocatorId("Table"),
+ groupComposite);
+ // groupHistoryTable.setDataSource(new GroupConfigurationUdpatesCriteriaDataSource(portletConfig,
+ // groupId));
+ // groupHistoryTable.setShowHeader(false);
+ // groupHistoryTable.setShowFooterRefresh(false);
+ } else {
+ //TODO: spinder fix for empties
+ // Criteria criteria = new Criteria();
+ ResourceGroup emptyGroup = new ResourceGroup("");
+ emptyGroup.setId(-1);
+ Long zero = new Long(0);
+ groupComposite = new ResourceGroupComposite(zero, zero, zero, zero, emptyGroup);
+ // groupOperations = new GroupOperationsCriteriaHistoryListView(locatorId,
+ // new GroupOperationsCriteriaDataSource(portletConfig), null, criteria, groupComposite);
+ groupHistoryTable = new HistoryGroupResourceConfigurationTable(extendLocatorId("Table"),
+ groupComposite);
+ // groupHistoryTable.setDataSource(new GroupConfigurationUdpatesCriteriaDataSource(portletConfig,
+ // groupId));
+ // groupHistoryTable.setShowHeader(false);
+ // groupHistoryTable.setShowFooterRefresh(false);
+ }
+
+ groupHistoryTable.setDataSource(new GroupConfigurationUdpatesCriteriaDataSource(portletConfig,
+ groupId));
+ groupHistoryTable.setShowHeader(false);
+ groupHistoryTable.setShowFooterRefresh(false);
+
+ //cleanup
+ for (Canvas child : recentConfigurationContent.getChildren()) {
+ child.destroy();
+ }
+ recentConfigurationContent.addChild(groupHistoryTable);
+ recentConfigurationContent.markForRedraw();
+ currentlyLoading = false;
+ }
+ });
+ }
+
+ private boolean isAutoGroup() {
+ return ResourceGroupDetailView.AUTO_GROUP_VIEW_PATH.equals(getBaseViewPath());
+ }
+
+ private boolean isAutoCluster() {
+ return ResourceGroupDetailView.AUTO_CLUSTER_VIEW_PATH.equals(getBaseViewPath());
+ }
+
+ public String getBaseViewPath() {
+ return baseViewPath;
+ }
+
+ class GroupConfigurationUdpatesCriteriaDataSource extends GroupResourceConfigurationDataSource {
+
+ public GroupConfigurationUdpatesCriteriaDataSource(Configuration portletConfig, int groupId) {
+ super(groupId);
+ this.portletConfig = portletConfig;
+ this.groupId = groupId;
+ }
+
+ private int groupId;
+ private Configuration portletConfig;
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response,
+ final GroupResourceConfigurationUpdateCriteria criteria) {
+ ConfigurationGWTServiceAsync configurationService = GWTServiceLookup.getConfigurationService();
+
+ configurationService.findGroupResourceConfigurationUpdatesByCriteria(criteria,
+ new AsyncCallback<PageList<GroupResourceConfigurationUpdate>>() {
+
+ @Override
+ public void onSuccess(PageList<GroupResourceConfigurationUpdate> result) {
+ response.setData(buildRecords(result));
+ //adjust for portlets that restrict result size
+ response.setTotalRows(result.size());
+ processResponse(request.getRequestId(), response);
+ }
+
+ @Override
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_group_resConfig_table_failFetch(), caught);
+ response.setStatus(DSResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+ });
+ }
+
+ @Override
+ protected GroupResourceConfigurationUpdateCriteria getFetchCriteria(final DSRequest request) {
+ //initialize criteria
+ GroupResourceConfigurationUpdateCriteria criteria = new GroupResourceConfigurationUpdateCriteria();
+
+ criteria.addFilterResourceGroupIds(Arrays.asList(groupId));
+
+ //initialize to only five for quick queries.
+ PageControl pageControl = new PageControl(0, 5);//default to displaying five
+ //customize query with latest configuration selections
+
+ //retrieve previous settings from portlet config
+ if (portletConfig != null) {
+ // //result sort order
+ // PropertySimple property = portletConfig.getSimple(Constant.RESULT_SORT_ORDER);
+ // if (property != null) {
+ // String currentSetting = property.getStringValue();
+ // if (currentSetting.trim().isEmpty() || currentSetting.equalsIgnoreCase(PageOrdering.DESC.name())) {
+ // criteria.addSortStatus(PageOrdering.DESC);
+ // } else {
+ // criteria.addSortStatus(PageOrdering.ASC);
+ // }
+ // }
+ //result timeframe if enabled
+ PropertySimple property = portletConfig.getSimple(Constant.METRIC_RANGE_ENABLE);
+ if (Boolean.valueOf(property.getBooleanValue())) {//then proceed setting
+
+ boolean isAdvanced = false;
+ //detect type of widget[Simple|Advanced]
+ property = portletConfig.getSimple(Constant.METRIC_RANGE_BEGIN_END_FLAG);
+ if (property != null) {
+ isAdvanced = property.getBooleanValue();
+ }
+ if (isAdvanced) {
+ //Advanced time settings
+ property = portletConfig.getSimple(Constant.METRIC_RANGE);
+ if (property != null) {
+ String currentSetting = property.getStringValue();
+ String[] range = currentSetting.split(",");
+ criteria.addFilterStartTime(Long.valueOf(range[0]));
+ criteria.addFilterEndTime(Long.valueOf(range[1]));
+ }
+ } else {
+ //Simple time settings
+ property = portletConfig.getSimple(Constant.METRIC_RANGE_LASTN);
+ if (property != null) {
+ int lastN = property.getIntegerValue();
+ property = portletConfig.getSimple(Constant.METRIC_RANGE_UNIT);
+ int lastUnits = property.getIntegerValue();
+ ArrayList<Long> beginEnd = MeasurementUtility.calculateTimeFrame(lastN, Integer
+ .valueOf(lastUnits));
+ criteria.addFilterStartTime(Long.valueOf(beginEnd.get(0)));
+ criteria.addFilterEndTime(Long.valueOf(beginEnd.get(1)));
+ }
+ }
+ }
+
+ //result count
+ property = portletConfig.getSimple(Constant.RESULT_COUNT);
+ if (property != null) {
+ String currentSetting = property.getStringValue();
+ if (currentSetting.trim().isEmpty() || currentSetting.equalsIgnoreCase("5")) {
+ pageControl.setPageSize(5);
+ } else {
+ pageControl = new PageControl(0, Integer.valueOf(currentSetting));
+ }
+ }
+ criteria.setPageControl(pageControl);
+
+ //detect operation status filter
+ property = portletConfig.getSimple(Constant.CONFIG_UPDATE_STATUS);
+ if (property != null) {
+ String currentSetting = property.getStringValue();
+ String[] parsedValues = currentSetting.trim().split(",");
+ if (currentSetting.trim().isEmpty()
+ || parsedValues.length == ConfigurationUpdateStatus.values().length) {
+ //all operation stati assumed
+ } else {
+ ConfigurationUpdateStatus[] updateStatus = new ConfigurationUpdateStatus[parsedValues.length];
+ int indx = 0;
+ for (String priority : parsedValues) {
+ ConfigurationUpdateStatus s = ConfigurationUpdateStatus.valueOf(priority);
+ updateStatus[indx++] = s;
+ }
+ criteria.addFilterStatuses(updateStatus);
+ }
+ }
+ }
+ return criteria;
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
index 5fec813..0ee3647 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java
@@ -41,6 +41,7 @@ import com.smartgwt.client.widgets.toolbar.ToolStrip;
import org.rhq.core.domain.alert.AlertPriority;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.criteria.ResourceGroupCriteria;
import org.rhq.core.domain.measurement.MeasurementDefinition;
@@ -507,6 +508,25 @@ public abstract class AbstractActivityView extends LocatableVLayout implements R
/** Takes the current value of the widget and persists it into the configuration object passed in.
*
+ * @param configUpdateStatusSelector
+ * @param portletConfig
+ * returns populated configuration object.
+ */
+ public static Configuration saveConfigUpdateStatusSelectorSettings(final SelectItem configStatusSelector,
+ final Configuration portletConfig) {
+ String selectedValue;
+ selectedValue = configStatusSelector.getValue().toString();
+ if ((selectedValue.trim().isEmpty())
+ || (selectedValue.split(",").length == ConfigurationUpdateStatus.values().length)) {//then no operation status specified
+ portletConfig.put(new PropertySimple(Constant.CONFIG_UPDATE_STATUS, Constant.CONFIG_UPDATE_STATUS_DEFAULT));
+ } else {//some subset of available configUpdate statuses will be used
+ portletConfig.put(new PropertySimple(Constant.CONFIG_UPDATE_STATUS, selectedValue));
+ }
+ return portletConfig;
+ }
+
+ /** Takes the current value of the widget and persists it into the configuration object passed in.
+ *
* @param measurementRangeEditor
* @param portletConfig
* returns populated configuration object.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java
new file mode 100644
index 0000000..770753a
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/GroupResourceConfigurationDataSource.java
@@ -0,0 +1,97 @@
+package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.configuration;
+
+import java.util.ArrayList;
+import java.util.Date;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.data.DSRequest;
+import com.smartgwt.client.data.DSResponse;
+import com.smartgwt.client.data.Record;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+
+import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate;
+import org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI;
+import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTServiceAsync;
+import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+
+/**
+ * DataSource implementation for HistoryGroupResourceConfigurationTable.
+ *
+ * @author John Mazzitelli
+ * @author Simeon Pinder
+ */
+public class GroupResourceConfigurationDataSource extends
+ RPCDataSource<GroupResourceConfigurationUpdate, GroupResourceConfigurationUpdateCriteria> {
+
+ private int groupId;
+
+ public class Field {
+ public static final String ID = "id";
+ public static final String DATECREATED = "dateCreated";
+ public static final String LASTUPDATED = "lastUpdated";
+ public static final String STATUS = "status";
+ public static final String USER = "user";
+ public static final String OBJECT = "object";
+ }
+
+ public GroupResourceConfigurationDataSource(int groupId) {
+ super();
+ this.groupId = groupId;
+ }
+
+ @Override
+ public GroupResourceConfigurationUpdate copyValues(Record from) {
+ return (GroupResourceConfigurationUpdate) from.getAttributeAsObject(Field.OBJECT);
+ }
+
+ @Override
+ public ListGridRecord copyValues(GroupResourceConfigurationUpdate from) {
+ ListGridRecord record = new ListGridRecord();
+
+ record.setAttribute(Field.ID, from.getId());
+ record.setAttribute(Field.DATECREATED, new Date(from.getCreatedTime()));
+ record.setAttribute(Field.LASTUPDATED, new Date(from.getModifiedTime()));
+ record.setAttribute(Field.STATUS, from.getStatus().name());
+ record.setAttribute(Field.USER, from.getSubjectName());
+
+ record.setAttribute(Field.OBJECT, from);
+
+ return record;
+ }
+
+ @Override
+ protected void executeFetch(final DSRequest request, final DSResponse response,
+ final GroupResourceConfigurationUpdateCriteria criteria) {
+ ConfigurationGWTServiceAsync configurationService = GWTServiceLookup.getConfigurationService();
+
+ configurationService.findGroupResourceConfigurationUpdatesByCriteria(criteria,
+ new AsyncCallback<PageList<GroupResourceConfigurationUpdate>>() {
+
+ @Override
+ public void onSuccess(PageList<GroupResourceConfigurationUpdate> result) {
+ response.setData(buildRecords(result));
+ response.setTotalRows(result.getTotalSize());
+ processResponse(request.getRequestId(), response);
+ }
+
+ @Override
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_group_resConfig_table_failFetch(), caught);
+ response.setStatus(DSResponse.STATUS_FAILURE);
+ processResponse(request.getRequestId(), response);
+ }
+ });
+ }
+
+ @Override
+ protected GroupResourceConfigurationUpdateCriteria getFetchCriteria(final DSRequest request) {
+ GroupResourceConfigurationUpdateCriteria criteria = new GroupResourceConfigurationUpdateCriteria();
+ ArrayList<Integer> groupList = new ArrayList<Integer>(1);
+ groupList.add(this.groupId);
+ criteria.addFilterResourceGroupIds(groupList);
+ return criteria;
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationTable.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationTable.java
index 35be43c..ae52f4d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationTable.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/configuration/HistoryGroupResourceConfigurationTable.java
@@ -18,14 +18,10 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.configuration;
-import java.util.ArrayList;
-import java.util.Date;
import java.util.EnumSet;
import java.util.HashMap;
import com.google.gwt.user.client.rpc.AsyncCallback;
-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.grid.HoverCustomizer;
@@ -37,12 +33,9 @@ import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
import org.rhq.core.domain.configuration.AbstractConfigurationUpdate;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
-import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate;
-import org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria;
import org.rhq.core.domain.resource.composite.ResourcePermission;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
-import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ErrorMessageWindow;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
@@ -53,7 +46,6 @@ import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablem
import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
@@ -61,7 +53,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
*
* @author John Mazzitelli
*/
-public class HistoryGroupResourceConfigurationTable extends Table<HistoryGroupResourceConfigurationTable.DataSource> {
+public class HistoryGroupResourceConfigurationTable extends Table<GroupResourceConfigurationDataSource> {
private final ResourceGroup group;
private final ResourcePermission groupPerms;
@@ -70,16 +62,21 @@ public class HistoryGroupResourceConfigurationTable extends Table<HistoryGroupRe
this.group = groupComposite.getResourceGroup();
this.groupPerms = groupComposite.getResourcePermission();
- setDataSource(new DataSource());
+ setDataSource(new GroupResourceConfigurationDataSource(this.group.getId()));
}
@Override
protected void configureTable() {
- ListGridField fieldId = new ListGridField(DataSource.Field.ID, MSG.common_title_version());
- ListGridField fieldDateCreated = new ListGridField(DataSource.Field.DATECREATED, MSG.common_title_dateCreated());
- ListGridField fieldLastUpdated = new ListGridField(DataSource.Field.LASTUPDATED, MSG.common_title_lastUpdated());
- ListGridField fieldStatus = new ListGridField(DataSource.Field.STATUS, MSG.common_title_status());
- ListGridField fieldUser = new ListGridField(DataSource.Field.USER, MSG.common_title_user());
+ ListGridField fieldId = new ListGridField(GroupResourceConfigurationDataSource.Field.ID, MSG
+ .common_title_version());
+ ListGridField fieldDateCreated = new ListGridField(GroupResourceConfigurationDataSource.Field.DATECREATED, MSG
+ .common_title_dateCreated());
+ ListGridField fieldLastUpdated = new ListGridField(GroupResourceConfigurationDataSource.Field.LASTUPDATED, MSG
+ .common_title_lastUpdated());
+ ListGridField fieldStatus = new ListGridField(GroupResourceConfigurationDataSource.Field.STATUS, MSG
+ .common_title_status());
+ ListGridField fieldUser = new ListGridField(GroupResourceConfigurationDataSource.Field.USER, MSG
+ .common_title_user());
TimestampCellFormatter.prepareDateField(fieldDateCreated);
TimestampCellFormatter.prepareDateField(fieldLastUpdated);
@@ -135,7 +132,7 @@ public class HistoryGroupResourceConfigurationTable extends Table<HistoryGroupRe
Integer[] updateIds = new Integer[selection.length];
int i = 0;
for (ListGridRecord record : selection) {
- updateIds[i++] = record.getAttributeAsInt(DataSource.Field.ID);
+ updateIds[i++] = record.getAttributeAsInt(GroupResourceConfigurationDataSource.Field.ID);
}
service.deleteGroupResourceConfigurationUpdate(groupId, updateIds, new AsyncCallback<Void>() {
@@ -163,7 +160,7 @@ public class HistoryGroupResourceConfigurationTable extends Table<HistoryGroupRe
public void executeAction(ListGridRecord[] selection, Object actionValue) {
CoreGUI.goToView(LinkManager.getGroupResourceConfigurationUpdateHistoryLink(
HistoryGroupResourceConfigurationTable.this.group.getId(), null)
- + "/" + selection[0].getAttribute(DataSource.Field.ID) + "/Settings");
+ + "/" + selection[0].getAttribute(GroupResourceConfigurationDataSource.Field.ID) + "/Settings");
}
});
@@ -173,7 +170,7 @@ public class HistoryGroupResourceConfigurationTable extends Table<HistoryGroupRe
public void executeAction(ListGridRecord[] selection, Object actionValue) {
CoreGUI.goToView(LinkManager.getGroupResourceConfigurationUpdateHistoryLink(
HistoryGroupResourceConfigurationTable.this.group.getId(), null)
- + "/" + selection[0].getAttribute(DataSource.Field.ID) + "/Members");
+ + "/" + selection[0].getAttribute(GroupResourceConfigurationDataSource.Field.ID) + "/Members");
}
});
@@ -182,7 +179,7 @@ public class HistoryGroupResourceConfigurationTable extends Table<HistoryGroupRe
private String getStatusHtmlString(Record record) {
String html = null;
AbstractConfigurationUpdate obj = (AbstractConfigurationUpdate) record
- .getAttributeAsObject(DataSource.Field.OBJECT);
+ .getAttributeAsObject(GroupResourceConfigurationDataSource.Field.OBJECT);
switch (obj.getStatus()) {
case SUCCESS: {
html = MSG.view_group_resConfig_table_statusSuccess();
@@ -217,69 +214,4 @@ public class HistoryGroupResourceConfigurationTable extends Table<HistoryGroupRe
}
return html;
}
-
- class DataSource extends RPCDataSource<GroupResourceConfigurationUpdate, GroupResourceConfigurationUpdateCriteria> {
-
- public class Field {
- public static final String ID = "id";
- public static final String DATECREATED = "dateCreated";
- public static final String LASTUPDATED = "lastUpdated";
- public static final String STATUS = "status";
- public static final String USER = "user";
- public static final String OBJECT = "object";
- }
-
- @Override
- public GroupResourceConfigurationUpdate copyValues(Record from) {
- return (GroupResourceConfigurationUpdate) from.getAttributeAsObject(DataSource.Field.OBJECT);
- }
-
- @Override
- public ListGridRecord copyValues(GroupResourceConfigurationUpdate from) {
- ListGridRecord record = new ListGridRecord();
-
- record.setAttribute(Field.ID, from.getId());
- record.setAttribute(Field.DATECREATED, new Date(from.getCreatedTime()));
- record.setAttribute(Field.LASTUPDATED, new Date(from.getModifiedTime()));
- record.setAttribute(Field.STATUS, from.getStatus().name());
- record.setAttribute(Field.USER, from.getSubjectName());
-
- record.setAttribute(Field.OBJECT, from);
-
- return record;
- }
-
- @Override
- protected void executeFetch(final DSRequest request, final DSResponse response,
- final GroupResourceConfigurationUpdateCriteria criteria) {
- ConfigurationGWTServiceAsync configurationService = GWTServiceLookup.getConfigurationService();
-
- configurationService.findGroupResourceConfigurationUpdatesByCriteria(criteria,
- new AsyncCallback<PageList<GroupResourceConfigurationUpdate>>() {
-
- @Override
- public void onSuccess(PageList<GroupResourceConfigurationUpdate> result) {
- response.setData(buildRecords(result));
- response.setTotalRows(result.getTotalSize());
- processResponse(request.getRequestId(), response);
- }
-
- @Override
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_group_resConfig_table_failFetch(), caught);
- response.setStatus(DSResponse.STATUS_FAILURE);
- processResponse(request.getRequestId(), response);
- }
- });
- }
-
- @Override
- protected GroupResourceConfigurationUpdateCriteria getFetchCriteria(final DSRequest request) {
- GroupResourceConfigurationUpdateCriteria criteria = new GroupResourceConfigurationUpdateCriteria();
- ArrayList<Integer> groupList = new ArrayList<Integer>(1);
- groupList.add(HistoryGroupResourceConfigurationTable.this.group.getId());
- criteria.addFilterResourceGroupIds(groupList);
- return criteria;
- }
- }
}
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 fd78426..0e5dadc 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
@@ -109,6 +109,7 @@ common_title_configuration = Configuration
common_title_compatibleGroups = Compatible Groups
common_title_compatibleGroups_total = Compatible Group Total
common_title_component_errors = Component Errors
+common_title_config_update_status = Update Status
common_title_count = Count
common_title_custom = Custom
common_title_dashboard_name = Dashboard Name
@@ -146,6 +147,7 @@ common_title_mixedGroups_total = Mixed Group Total
common_title_name = Name
common_title_new_dashboard = New Dashboard
common_title_numeric_type = Numeric Type
+common_title_operation_status = Operation Status
common_title_operations = Operations
common_title_operations_range = Operation Range
common_title_over = Over
@@ -177,6 +179,8 @@ common_title_resource_inventory = Resource Inventory
common_title_resource_id = Resource ID
common_title_resource_name = Resource Name
common_title_resource_type = Resource Type
+common_title_results_count = Results Count
+common_title_results_count_tooltip = Displays this number of results
common_title_role = Role
common_title_roles = Roles
common_title_search = Search
@@ -189,6 +193,8 @@ common_title_service_total = Service Total
common_title_settings = Settings
common_title_show = Show
common_title_show_more = Show more...
+common_title_sort_order = Sort Order
+common_title_sort_order_tooltip = Sets sort order for results.
common_title_start = Start
common_title_status = Status
common_title_stop= Stop
@@ -230,12 +236,14 @@ common_val_na = N/A
common_val_none = None
# Common Statuses
-common_status_success = Success
+common_status_canceled = Canceled
+common_status_deferred = Deferred
common_status_failed = Failed
common_status_inprogress = In Progress
-common_status_canceled = Canceled
+common_status_nochange = No Change
+common_status_success = Success
common_status_unknown = Unknown
-common_status_deferred = Deferred
+
common_status_partial = Partial
# 1st, 2nd, 3rd, 4th, etc.
@@ -1468,6 +1476,7 @@ view_portlet_defaultName_tagCloud = Tag Count
view_portlet_defaultName_group_alerts =Group: Alerts
view_portlet_defaultName_group_bundles = Group: Bundle Deployments
+view_portlet_defaultName_group_config_updates = Group: Configuration Updates
view_portlet_defaultName_group_events = Group: Event Counts
view_portlet_defaultName_group_metrics = Group: Metrics
view_portlet_defaultName_group_oobs = Group: OOB Conditions
@@ -1475,6 +1484,7 @@ view_portlet_defaultName_group_operations = Group: Operations
view_portlet_defaultName_group_pkg_hisory = Group: Package History
view_portlet_defaultName_resource_alerts = Resource: Alerts
view_portlet_defaultName_resource_bundles = Resource: Bundle Deployments
+view_portlet_defaultName_resource_config_updates = Resource: Configuration Updates
view_portlet_defaultName_resource_events = Resource: Event Counts
view_portlet_defaultName_resource_metrics = Resource: Measurements
view_portlet_defaultName_resource_oobs = Resource: OOB Metrics
@@ -1483,6 +1493,7 @@ view_portlet_defaultName_resource_pkg_hisory = Resource: Package History
view_portlet_help_autodiscovery = This portlet allows import or ignore of newly discovered resources. Imported resources are added to inventory for monitoring and management. Ignored resources are not imported and are hidden from view unless explicitly unignored.
view_portlet_help_bundle_deps = This portlet shows relevant bundle deployments based on display criteria configured.
+view_portlet_help_config_updates =This portlet displays recent configuration changes consistent with configuration settings.
view_portlet_help_eventcounts = This portlet displays Event counts consistent with display criteria configured.
view_portlet_help_favoriteResources = This portlet displays the current user''s favorite resources.
view_portlet_help_graph = This portlet displays the resource metric graph.
commit 12cdec5fb2943458bc5b4bcfd4ab6f2c9c3718c3
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Thu Mar 31 11:40:18 2011 -0400
remove redundant header for recentAlerts, trim space around operations portlet widget.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
index 9a9a124..2ef5bd8 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupOperationsPortlet.java
@@ -198,8 +198,6 @@ public class GroupOperationsPortlet extends LocatableVLayout implements CustomSe
/**Defines layout for the portlet page.
*/
protected void initializeUi() {
- setPadding(5);
- setMembersMargin(5);
setHeight("*");
setWidth100();
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 763ed79..93fd686 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
@@ -67,6 +67,7 @@ public abstract class AbstractRecentAlertsPortlet extends AlertHistoryView imple
setShowFilterForm(false); //disable filter form for portlet
setOverflow(Overflow.VISIBLE);
setShowFooterRefresh(false); //disable footer refresh button as redundant for portlets
+ setShowHeader(false);//disable header for portlets
}
public Timer getRefreshTimer() {
13 years, 1 month
[rhq] modules/enterprise
by Jay Shaughnessy
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;
13 years, 1 month