[rhq] modules/enterprise
by mazz
modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java | 34 ++++++++--
1 file changed, 30 insertions(+), 4 deletions(-)
New commits:
commit 3e3e382b7657c746e35bc61096cc0ec7091807f2
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu May 5 13:35:01 2011 -0400
BZ 702109 - skip fields that are static final or transient since they won't be serialized anyway.
diff --git a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java
index 6cea6b8..de57afb 100644
--- a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java
+++ b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/util/HibernateDetachUtility.java
@@ -24,9 +24,9 @@ import java.beans.PropertyDescriptor;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -55,6 +55,20 @@ public class HibernateDetachUtility {
SERIALIZATION, JAXB
}
+ // be able to configure the deepest recursion this utility will be allowed to go (see BZ 702109 that precipitated this need)
+ private static final String DEPTH_ALLOWED_SYSPROP = "rhq.server.hibernate-detach-utility.depth-allowed";
+ private static final int depthAllowed;
+ static {
+ int value;
+ try {
+ String str = System.getProperty(DEPTH_ALLOWED_SYSPROP, "50");
+ value = Integer.parseInt(str);
+ } catch (Throwable t) {
+ value = 50;
+ }
+ depthAllowed = value;
+ }
+
public static void nullOutUninitializedFields(Object value, SerializationType serializationType) throws Exception {
long start = System.currentTimeMillis();
Map<Integer, Object> checkedObjects = new HashMap<Integer, Object>();
@@ -71,8 +85,13 @@ public class HibernateDetachUtility {
private static void nullOutUninitializedFields(Object value, Map<Integer, Object> checkedObjects, int depth,
SerializationType serializationType) throws Exception {
- if (depth > 50) {
- LOG.warn("Getting different object hierarchies back from calls: " + value.getClass().getName());
+ if (depth > depthAllowed) {
+ LOG.warn("Recursed too deep [" + depth + " > " + depthAllowed
+ + "], will not attempt to detach object of type ["
+ + ((value != null) ? value.getClass().getName() : "N/A")
+ + "]. This may cause serialization errors later. If so, "
+ + "you can try to work around this by setting the system property [" + DEPTH_ALLOWED_SYSPROP
+ + "] to a value higher than [" + depth + "].");
return;
}
@@ -163,7 +182,14 @@ public class HibernateDetachUtility {
Class tmpClass = object.getClass();
List<Field> fieldsToClean = new ArrayList<Field>();
while (tmpClass != null && tmpClass != Object.class) {
- Collections.addAll(fieldsToClean, tmpClass.getDeclaredFields());
+ Field[] declaredFields = tmpClass.getDeclaredFields();
+ for (Field declaredField : declaredFields) {
+ // do not process static final or transient fields since they won't be serialized anyway
+ int modifiers = declaredField.getModifiers();
+ if (!((Modifier.isFinal(modifiers) && Modifier.isStatic(modifiers)) || Modifier.isTransient(modifiers))) {
+ fieldsToClean.add(declaredField);
+ }
+ }
tmpClass = tmpClass.getSuperclass();
}
13 years
[rhq] Branch 'release-3.0.1-apache-fixes' - modules/plugins
by lkrejci
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/ApacheAugeasNode.java | 69 +++++++---
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java | 6
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java | 25 +--
3 files changed, 62 insertions(+), 38 deletions(-)
New commits:
commit 258be003ddf7bf022611ef183ed60a7e7ee7ef18
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed May 4 18:40:08 2011 +0200
BZ 700616 - Augeas tree abstraction now replaces the Include nodes with their contents instead of just appending their contents to their children list.
This seems to be the original intended behavior of the class according to its description but actually was not the case.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/ApacheAugeasNode.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/ApacheAugeasNode.java
index 6cb168e..99cc8cb 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/ApacheAugeasNode.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/ApacheAugeasNode.java
@@ -24,7 +24,10 @@ package org.rhq.plugins.apache.augeas;
import java.io.File;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.rhq.augeas.node.AugeasNode;
import org.rhq.augeas.node.AugeasNodeLazy;
@@ -42,13 +45,14 @@ import org.rhq.augeas.tree.AugeasTreeException;
* and modifies the get* methods to handle these as well.
*
* @author Filip Drabek
+ * @author Lukas Krejci
*/
public class ApacheAugeasNode extends AugeasNodeLazy implements AugeasNode {
/**
* List of included nodes.
*/
- private List<AugeasNode> includedNodes;
+ private Map<Integer, List<AugeasNode>> includedNodes;
public ApacheAugeasNode(String fullPath, AugeasTree tree) {
super(fullPath, tree);
@@ -72,8 +76,22 @@ public class ApacheAugeasNode extends AugeasNodeLazy implements AugeasNode {
public List<AugeasNode> getChildNodes() {
List<AugeasNode> nodes = null;
nodes = ag.match(getFullPath() + File.separatorChar + "*");
- if (includedNodes != null)
- nodes.addAll(includedNodes);
+
+ if (includedNodes != null) {
+ //to avoid having to recompute indexes to insert the included nodes into the
+ //list of nodes as seen by augeas, let's include them from the biggest index
+ //to the lowest.
+ List<Integer> includeNodeIndexes = new ArrayList<Integer>(includedNodes.keySet());
+ Collections.sort(includeNodeIndexes, Collections.reverseOrder());
+
+ for(Integer idx : includeNodeIndexes) {
+ //remove the include node itself
+ nodes.remove(idx);
+
+ //add the included nodes instead of it
+ nodes.addAll(idx, includedNodes.get(idx));
+ }
+ }
return nodes;
}
@@ -83,26 +101,36 @@ public class ApacheAugeasNode extends AugeasNodeLazy implements AugeasNode {
*
* @param nodes
*/
- public void addIncludeNodes(List<AugeasNode> nodes) {
+ public void addIncludeNodes(AugeasNode includeNode, List<AugeasNode> nodes) {
if (nodes.isEmpty())
return;
if (includedNodes == null)
- includedNodes = new ArrayList<AugeasNode>();
-
- includedNodes.addAll(nodes);
- }
-
- /**
- * Adds the node to the list of the included child nodes.
- *
- * @param node
- */
- public void addIncludeNode(AugeasNode node) {
- if (includedNodes == null)
- includedNodes = new ArrayList<AugeasNode>();
-
- includedNodes.add(node);
+ includedNodes = new HashMap<Integer, List<AugeasNode>>();
+
+ List<AugeasNode> childNodes = super.getChildNodes();
+ int idx = 0;
+ boolean found = false;
+
+ for(AugeasNode child : childNodes) {
+ if (child.getLabel().equals(includeNode.getLabel()) && child.getSeq() == includeNode.getSeq()) {
+ found = true;
+ break;
+ }
+
+ ++idx;
+ }
+
+ if (found) {
+ List<AugeasNode> alreadyIncluded = includedNodes.get(idx);
+ if (alreadyIncluded == null) {
+ //copy the nodes over to a new list so that we can modify it later without modifying the original collection
+ //which might be unexpected on the caller site.
+ includedNodes.put(idx, new ArrayList<AugeasNode>(nodes));
+ } else {
+ alreadyIncluded.addAll(nodes);
+ }
+ }
}
public AugeasNode getParentNode() {
@@ -132,7 +160,8 @@ public class ApacheAugeasNode extends AugeasNodeLazy implements AugeasNode {
//else if this node is included from another file
//and we would destroy that association here.
}
+
public void setParentNode(AugeasNode node){
this.parentNode = node;
- }
+ }
}
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java
index d4f7dd2..a3a715c 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java
@@ -109,7 +109,7 @@ public class AugeasConfigurationApache extends PluginDescriptorBasedAugeasConfig
File check = new File(expression);
File root = new File(check.isAbsolute() ? Glob.rootPortion(expression) : serverRootPath);
- files.addAll(Glob.match(root, expression));
+ files.addAll(Glob.match(root, expression, Glob.ALPHABETICAL_COMPARATOR));
for (File fl : files){
if (fl.exists() && fl.isFile()) {
@@ -155,7 +155,7 @@ public class AugeasConfigurationApache extends PluginDescriptorBasedAugeasConfig
File check = new File(incl);
File root = new File(check.isAbsolute() ? Glob.rootPortion(incl) : serverRootPath);
- files.addAll(Glob.match(root, incl));
+ files.addAll(Glob.match(root, incl, Glob.ALPHABETICAL_COMPARATOR));
}
if (module.getExcludedGlobs() != null) {
@@ -191,7 +191,7 @@ public class AugeasConfigurationApache extends PluginDescriptorBasedAugeasConfig
for (String path : foundIncludes) {
File check = new File(path);
File root = new File(check.isAbsolute() ? Glob.rootPortion(path) : serverRoot);
- for (File f :Glob.match(root, path)){
+ for (File f :Glob.match(root, path, Glob.ALPHABETICAL_COMPARATOR)){
ret.add(f);
}
}
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java
index e6454b7..fbde74f 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java
@@ -43,7 +43,6 @@ public class AugeasTreeBuilderApache implements AugeasTreeBuilder {
private Map<String, List<File>> includes;
private Map<AugeasNode, List<String>> incl;
- private static final String[] NESTED_INCLUDE_DIRECTIVES = { "<VirtualHost", "<Directory" };
private Augeas ag;
public AugeasTreeBuilderApache() {
@@ -78,7 +77,7 @@ public class AugeasTreeBuilderApache implements AugeasTreeBuilder {
File check = new File(inclName);
File root = new File(check.isAbsolute() ? Glob.rootPortion(inclName) : apacheConfig.getServerRootPath());
- files.addAll(Glob.match(root, inclName));
+ files.addAll(Glob.match(root, inclName, Glob.ALPHABETICAL_COMPARATOR));
if (module.getExcludedGlobs() != null)
Glob.excludeAll(files, module.getExcludedGlobs());
@@ -87,7 +86,7 @@ public class AugeasTreeBuilderApache implements AugeasTreeBuilder {
includes.put(inclName, files);
}
- updateIncludes((ApacheAugeasNode) rootNode, tree, rootPath, false);
+ updateIncludes((ApacheAugeasNode) rootNode, tree, rootPath, null);
//List<String> rootconf = new ArrayList<String>();
// rootconf.add(ApacheAugeasTree.AUGEAS_DATA_PATH + rootPath);
@@ -97,7 +96,7 @@ public class AugeasTreeBuilderApache implements AugeasTreeBuilder {
return tree;
}
- public void updateIncludes(ApacheAugeasNode parentNode, AugeasTree tree, String fileName, boolean update)
+ public void updateIncludes(ApacheAugeasNode parentNode, AugeasTree tree, String fileName, AugeasNode includeNode)
throws AugeasRhqException {
List<String> nestedNodes = ag.match(ApacheAugeasTree.AUGEAS_DATA_PATH + fileName + File.separator + "*");
@@ -111,14 +110,14 @@ public class AugeasTreeBuilderApache implements AugeasTreeBuilder {
createdNodes.add(newNode);
}
- if (update)
- parentNode.addIncludeNodes(createdNodes);
+ if (includeNode != null)
+ parentNode.addIncludeNodes(includeNode, createdNodes);
for (AugeasNode node : createdNodes) {
- if (canContainIncludes(node.getLabel())) {
+ if (canContainNestedNodes(node.getLabel())) {
String labelName = node.getLabel()
+ ((node.getSeq() != 0) ? "[" + String.valueOf(node.getSeq()) + "]" : "");
- updateIncludes((ApacheAugeasNode) node, tree, fileName + File.separator + labelName, false);
+ updateIncludes((ApacheAugeasNode) node, tree, fileName + File.separator + labelName, null);
}
if (node.getLabel().equals("Include")) {
String val = ag.get(node.getFullPath() + File.separator + "param");
@@ -128,7 +127,7 @@ public class AugeasTreeBuilderApache implements AugeasTreeBuilder {
List<String> names = new ArrayList<String>();
for (File file : files) {
names.add(ApacheAugeasTree.AUGEAS_DATA_PATH + file.getAbsolutePath());
- updateIncludes((ApacheAugeasNode) node.getParentNode(), tree, file.getAbsolutePath(), true);
+ updateIncludes((ApacheAugeasNode) node.getParentNode(), tree, file.getAbsolutePath(), node);
}
if (incl.containsKey(node.getParentNode())) {
List<String> list = incl.get(node.getParentNode());
@@ -140,11 +139,7 @@ public class AugeasTreeBuilderApache implements AugeasTreeBuilder {
}
}
- private boolean canContainIncludes(String name) {
- for (String directive : NESTED_INCLUDE_DIRECTIVES) {
- if (directive.equals(name))
- return true;
- }
- return false;
+ private boolean canContainNestedNodes(String name) {
+ return name.startsWith("<");
}
}
13 years
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryDetails.java | 32 ++++++++--
1 file changed, 26 insertions(+), 6 deletions(-)
New commits:
commit 8ce65681ef299f1a57d6dc9108caf399b3ee6797
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed May 4 11:32:20 2011 -0400
BZ 695408
when viewing the details of a created child history, you can now see the resource type of the created resource.
when viewing the details of a deleted child history, you can now see the resource type AND the resource name of the deleted resource.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryDetails.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryDetails.java
index 1b7fe79..6e8105a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryDetails.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ChildHistoryDetails.java
@@ -119,7 +119,12 @@ public class ChildHistoryDetails extends LocatableVLayout {
StaticTextItem createdResourceKey = new StaticTextItem("createdResourceKey", MSG.common_title_resource_key());
createdResourceKey.setValue(history.getNewResourceKey());
- // TODO: show resource info, like type
+ StaticTextItem createdResourceType = new StaticTextItem("createdResourceType", MSG.common_title_resource_type());
+ if (history.getResourceType() != null) {
+ createdResourceType.setValue(history.getResourceType().getName());
+ } else {
+ createdResourceType.setValue(MSG.common_status_unknown());
+ }
TextAreaItem errorMessage = new TextAreaItem("errorMessage", MSG.common_title_error());
errorMessage.setValue(history.getErrorMessage());
@@ -130,10 +135,10 @@ public class ChildHistoryDetails extends LocatableVLayout {
if (history.getErrorMessage() != null && history.getErrorMessage().length() > 0) {
form.setItems(id, type, createdTimestamp, modifiedTimestamp, subject, createdResourceName,
- createdResourceKey, status, errorMessage);
+ createdResourceKey, createdResourceType, status, errorMessage);
} else {
form.setItems(id, type, createdTimestamp, modifiedTimestamp, subject, createdResourceName,
- createdResourceKey, status);
+ createdResourceKey, createdResourceType, status);
}
return form;
@@ -182,7 +187,20 @@ public class ChildHistoryDetails extends LocatableVLayout {
status.setValue("?");
}
- // TODO: show resource info, like name, type
+ StaticTextItem deletedResourceName = new StaticTextItem("deletedResourceName", MSG.common_title_resource_name());
+ StaticTextItem deletedResourceType = new StaticTextItem("deletedResourceType", MSG.common_title_resource_type());
+
+ if (history.getResource() != null) {
+ deletedResourceName.setValue(history.getResource().getName());
+ if (history.getResource().getResourceType() != null) {
+ deletedResourceType.setValue(history.getResource().getResourceType().getName());
+ } else {
+ deletedResourceType.setValue(MSG.common_status_unknown());
+ }
+ } else {
+ deletedResourceName.setValue(MSG.common_status_unknown());
+ deletedResourceType.setValue(MSG.common_status_unknown());
+ }
TextAreaItem errorMessage = new TextAreaItem("errorMessage", MSG.common_title_error());
errorMessage.setValue(history.getErrorMessage());
@@ -192,9 +210,11 @@ public class ChildHistoryDetails extends LocatableVLayout {
errorMessage.setHeight("100%");
if (history.getErrorMessage() != null && history.getErrorMessage().length() > 0) {
- form.setItems(id, type, createdTimestamp, modifiedTimestamp, subject, status, errorMessage);
+ form.setItems(id, type, createdTimestamp, modifiedTimestamp, subject, deletedResourceName,
+ deletedResourceType, status, errorMessage);
} else {
- form.setItems(id, type, createdTimestamp, modifiedTimestamp, subject, status);
+ form.setItems(id, type, createdTimestamp, modifiedTimestamp, subject, deletedResourceName,
+ deletedResourceType, status);
}
return form;
13 years
[rhq] Branch 'release-4.0.0' - modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java | 18 +++++++---
1 file changed, 14 insertions(+), 4 deletions(-)
New commits:
commit f9c0b1515c047fa0e84b3da2c87c3fc2ca368b01
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue May 3 16:10:45 2011 -0400
BZ 701774 - ignore when a condition value cannot be converted to a Double - its probably a trait and can't be converted anyway
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
index 6475640..b3574bc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
@@ -374,8 +374,13 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
conditionText = AlertFormatUtility.formatAlertConditionForDisplay(condition);
conditionValue = conditionLog.getValue();
if (condition.getMeasurementDefinition() != null) {
- conditionValue = MeasurementConverterClient.format(Double.valueOf(conditionLog.getValue()), condition
- .getMeasurementDefinition().getUnits(), true);
+ try {
+ conditionValue = MeasurementConverterClient.format(Double.valueOf(conditionLog.getValue()),
+ condition.getMeasurementDefinition().getUnits(), true);
+ } catch (Exception e) {
+ // the condition log value was probably not a number (most likely a trait). Ignore this exception.
+ // even if any other errors occur trying to format the value, ignore this and just use the raw value string
+ }
}
} else {
conditionText = MSG.view_alerts_field_condition_text_none();
@@ -393,8 +398,13 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
dc.setAttribute("text", AlertFormatUtility.formatAlertConditionForDisplay(condition));
String value = log.getValue();
if (condition.getMeasurementDefinition() != null) {
- value = MeasurementConverterClient.format(Double.valueOf(log.getValue()), condition
- .getMeasurementDefinition().getUnits(), true);
+ try {
+ value = MeasurementConverterClient.format(Double.valueOf(log.getValue()), condition
+ .getMeasurementDefinition().getUnits(), true);
+ } catch (Exception e) {
+ // the condition log value was probably not a number (most likely a trait). Ignore this exception.
+ // even if any other errors occur trying to format the value, ignore this and just use the raw value string
+ }
}
dc.setAttribute("value", value);
conditions[i++] = dc;
13 years
[rhq] Branch 'as7plugin' - 25 commits - chkdist.sh modules/core modules/enterprise publish_release.sh
by Heiko W. Rupp
chkdist.sh | 136 ++++
modules/core/dbutils/pom.xml | 2
modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/OperationScheduleIdSetterUpgradeTask.java | 10
modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/ResourceAncestryUpgradeTask.java | 25
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 39 -
modules/enterprise/gui/coregui/pom.xml | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 51 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java | 18
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupConfigurationUpdatesPortlet.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java | 9
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/detail/summary/AbstractActivityView.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java | 13
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml | 29
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 4
modules/enterprise/server/container/pom.xml | 36 -
publish_release.sh | 318 ++++++++++
18 files changed, 614 insertions(+), 100 deletions(-)
New commits:
commit 3f081f6dc8e72c207bc0bacb8465f8d6195418d7
Merge: ba33706 341a653
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed May 4 15:25:27 2011 +0200
Merge branch 'master' into as7plugin
commit 341a6533382ceee1bd134bbe346fc593ea75d90d
Merge: ae4f1ec f8d1ed1
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Wed May 4 15:25:09 2011 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit f8d1ed14a40dd8a5fb6e798f4317f00e810f640f
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue May 3 20:52:47 2011 -0400
call CoreGUI.goToView(), rather than History.newItem(), in native event handler
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index a41031d..09ca49b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -161,10 +161,10 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
// make sure it's not a hyperlink that GWT already handles
if (element.getPropertyString("__listener") == null) {
String url = element.getAttribute("href");
- String token = getHistoryToken(url);
- if (token != null) {
- GWT.log("Forcing History.newItem(\"" + token + "\")...");
- History.newItem(token);
+ String viewPath = getViewPath(url);
+ if (viewPath != null) {
+ GWT.log("Forcing CoreGUI.goToView(\"" + viewPath + "\")...");
+ CoreGUI.goToView(viewPath);
nativeEvent.preventDefault();
}
}
@@ -173,7 +173,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
}
}
- private static String getHistoryToken(String url) {
+ private static String getViewPath(String url) {
String token;
if (url.startsWith("#")) {
token = url.substring(1);
@@ -537,4 +537,5 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
public static boolean isDebugMode() {
return !GWT.isScript();
}
+
}
commit 4c0c992c2b1ebb560a6d4e9666591614ff1ff7c0
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue May 3 17:43:04 2011 -0400
add magic Event.NativePreviewHandler that makes anchor tags not reload the whole page in IE; remove unused printWidgetTree method
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index 47a5c1f..a41031d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -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
@@ -22,10 +22,13 @@ import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.EventTarget;
+import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
@@ -54,7 +57,6 @@ import org.rhq.enterprise.gui.coregui.client.test.TestRemoteServiceStatisticsVie
import org.rhq.enterprise.gui.coregui.client.test.TestDataSourceResponseStatisticsView;
import org.rhq.enterprise.gui.coregui.client.test.TestTopView;
import org.rhq.enterprise.gui.coregui.client.util.ErrorHandler;
-import org.rhq.enterprise.gui.coregui.client.util.WidgetUtility;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.message.MessageCenter;
import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
@@ -65,7 +67,7 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
* @author Greg Hinkle
* @author Ian Springer
*/
-public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
+public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.NativePreviewHandler {
public static final String CONTENT_CANVAS_ID = "BaseContent";
@@ -121,6 +123,8 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
coreGUI = this;
+ Event.addNativePreviewHandler(this);
+
registerPageKeys();
GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
@@ -147,6 +151,42 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
loadingPanel.removeFromParent();
}
+ public void onPreviewNativeEvent(Event.NativePreviewEvent event) {
+ if (SC.isIE() && event.getTypeInt() == Event.ONCLICK) {
+ NativeEvent nativeEvent = event.getNativeEvent();
+ EventTarget target = nativeEvent.getEventTarget();
+ if (Element.is(target)) {
+ Element element = Element.as(target);
+ if ("a".equalsIgnoreCase(element.getTagName())) {
+ // make sure it's not a hyperlink that GWT already handles
+ if (element.getPropertyString("__listener") == null) {
+ String url = element.getAttribute("href");
+ String token = getHistoryToken(url);
+ if (token != null) {
+ GWT.log("Forcing History.newItem(\"" + token + "\")...");
+ History.newItem(token);
+ nativeEvent.preventDefault();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private static String getHistoryToken(String url) {
+ String token;
+ if (url.startsWith("#")) {
+ token = url.substring(1);
+ } else if (url.startsWith("/#")) {
+ token = url.substring(2);
+ } else if (url.contains(Location.getHost()) && url.indexOf('#') > 0) {
+ token = url.substring(url.indexOf('#') + 1);
+ } else {
+ token = null;
+ }
+ return token;
+ }
+
private void registerPageKeys() {
if (isDebugMode()) {
KeyIdentifier debugKey = new KeyIdentifier();
@@ -310,10 +350,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
return errorHandler;
}
- public static void printWidgetTree() {
- WidgetUtility.printWidgetTree(coreGUI.rootCanvas);
- }
-
private static String getDefaultView() {
// TODO: should this be Dashboard or a User Preference?
return DEFAULT_VIEW;
commit 3a5aab6588c68bab424a0269942aa11e2a602b92
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue May 3 16:10:45 2011 -0400
BZ 701774 - ignore when a condition value cannot be converted to a Double - its probably a trait and can't be converted anyway
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
index 6475640..b3574bc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
@@ -374,8 +374,13 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
conditionText = AlertFormatUtility.formatAlertConditionForDisplay(condition);
conditionValue = conditionLog.getValue();
if (condition.getMeasurementDefinition() != null) {
- conditionValue = MeasurementConverterClient.format(Double.valueOf(conditionLog.getValue()), condition
- .getMeasurementDefinition().getUnits(), true);
+ try {
+ conditionValue = MeasurementConverterClient.format(Double.valueOf(conditionLog.getValue()),
+ condition.getMeasurementDefinition().getUnits(), true);
+ } catch (Exception e) {
+ // the condition log value was probably not a number (most likely a trait). Ignore this exception.
+ // even if any other errors occur trying to format the value, ignore this and just use the raw value string
+ }
}
} else {
conditionText = MSG.view_alerts_field_condition_text_none();
@@ -393,8 +398,13 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
dc.setAttribute("text", AlertFormatUtility.formatAlertConditionForDisplay(condition));
String value = log.getValue();
if (condition.getMeasurementDefinition() != null) {
- value = MeasurementConverterClient.format(Double.valueOf(log.getValue()), condition
- .getMeasurementDefinition().getUnits(), true);
+ try {
+ value = MeasurementConverterClient.format(Double.valueOf(log.getValue()), condition
+ .getMeasurementDefinition().getUnits(), true);
+ } catch (Exception e) {
+ // the condition log value was probably not a number (most likely a trait). Ignore this exception.
+ // even if any other errors occur trying to format the value, ignore this and just use the raw value string
+ }
}
dc.setAttribute("value", value);
conditions[i++] = dc;
commit 85349670fb3e4fc3b99c3a99afe3e387869b6587
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue May 3 14:45:16 2011 -0400
BZ 696753 and 701314
bump up the timeout when importing, ignoring and unignoring from the auto-discovery queue.
in addition, if any timeout occurs anywhere in the ui, we'll log it as a Warning now and give the user
some information about what is happening (i.e the request timed out, the server may still be processing the request and to wait and see if it succeeded)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
index a1d1403..6dde533 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/discovery/ResourceAutodiscoveryView.java
@@ -74,7 +74,7 @@ public class ResourceAutodiscoveryView extends LocatableVLayout {
private ToolStrip footer;
private DataSource dataSource;
- private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService();
+ private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(60000);
public ResourceAutodiscoveryView(String locatorId) {
super(locatorId);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java
index e54ee38..3ce2f52 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java
@@ -25,6 +25,7 @@ import com.allen_sauer.gwt.log.client.Log;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
/**
* @author Greg Hinkle
@@ -42,7 +43,17 @@ public class ErrorHandler {
}
public void handleError(String message, Throwable t) {
- Message errorMessage = new Message(message, t, Message.Severity.Error);
+ Severity severity;
+
+ if ((t != null) && (t instanceof com.google.gwt.http.client.RequestTimeoutException)) {
+ // if its a timeout exception, log it as a warning since the request might still complete on the server
+ severity = Message.Severity.Warning;
+ message = MSG.common_msg_asyncTimeout(message);
+ } else {
+ severity = Message.Severity.Error;
+ }
+
+ Message errorMessage = new Message(message, t, severity);
CoreGUI.getMessageCenter().notify(errorMessage);
if (t != null) {
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 cf9dbbc..0f75682 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
@@ -231,6 +231,9 @@ common_msg_noItemsToShow = No items to show
common_msg_notYetImplemented = Not Yet Implemented
common_msg_see_more = see more...
common_msg_step_x_of_y = Step {0} of {1}
+common_msg_asyncTimeout = {0}. This occurred because the server is taking a long time to complete this request. \
+Please be aware that the server may still be processing your request and it may complete shortly. \
+You can check the server logs to see if any abnormal errors occurred.
# Common Values
#--------------
commit 24a49a6d06f87cff4251da3f438efa63b77a9072
Merge: 4ea1e7e dcdd7f2
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue May 3 10:29:09 2011 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 4ea1e7edd0b669faeb7e52cccfe392ee06ce85ab
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue May 3 10:28:27 2011 -0400
Removing hudson hack profile now that extra steps hudson plugin is available
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index 4905ef7..b4116aa 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -431,42 +431,6 @@
</plugins>
</build>
</profile>
-
- <!--
- As the profile id indicates, this is a short-term temporary hack until
- our hudson server gets the M2 Extra Build Steps plugin involved. Once
- that plugin is available, this profile along with the shell script it
- references will be removed.
- -->
- <profile>
- <id>hudson-hack</id>
- <activation>
- <property>
- <name>hudson.hack</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-plugin-zip</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>exec</goal>
- </goals>
- <configuration>
- <executable>${basedir}/src/main/shell/zip_all_plugins</executable>
- <workingDirectory>../../../</workingDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
</profiles>
</project>
commit ae4f1ec7485c7a15de42a9a5554069867e7a1a7d
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon May 2 15:49:08 2011 +0200
BZ 667218 - create operation schedule sequence on upgrade
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 50ad317..64af8e7 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -22,7 +22,7 @@
<properties>
<scm.module.path>modules/core/dbutils/</scm.module.path>
- <db.schema.version>2.106</db.schema.version>
+ <db.schema.version>2.107</db.schema.version>
</properties>
<dependencies>
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 57f82f0..b7f801f 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3204,7 +3204,7 @@
<!-- give the 'SUPER USER' and 'ALL RESOURCES' roles permission to delete/purge events (this permission
previously did not exist, and event deletion/purging could be performed by any user with authz to
view the resource/group in question).
-
+
a user with MANAGE_SECURITY must explicitly grant this permission to other roles after upgrade-->
<schema-directSQL>
<statement desc="Inserting MANAGE_EVENTS permission for 'Super User' role">
@@ -3235,7 +3235,7 @@
</statement>
</schema-directSQL>
</schemaSpec>
-
+
<schemaSpec version="2.97">
<!-- Support subject-owned groups (e.g. autogroups) -->
<schema-addColumn table="RHQ_RESOURCE_GROUP" column="SUBJECT_ID" columnType="INTEGER" />
@@ -3328,7 +3328,7 @@
REFERENCES RHQ_RESOURCE_GROUP (ID)
</statement>
</schema-directSQL>
-
+
<!-- Add category for distinguishing what kind of dashboard this is -->
<schema-addColumn table="RHQ_DASHBOARD" column="CATEGORY" columnType="VARCHAR2" precision="20"/>
<schema-directSQL>
@@ -3337,12 +3337,12 @@
SET CATEGORY = 'INVENTORY'
</statement>
</schema-directSQL>
- <schema-alterColumn table="RHQ_DASHBOARD" column="CATEGORY" nullable="FALSE" />
+ <schema-alterColumn table="RHQ_DASHBOARD" column="CATEGORY" nullable="FALSE" />
</schemaSpec>
<schemaSpec version="2.104">
<!-- package types no longer require to be coupled with a resource type. They can exist on their own. -->
- <schema-alterColumn table="RHQ_PACKAGE_TYPE" column="RESOURCE_TYPE_ID" nullable="true"/>
+ <schema-alterColumn table="RHQ_PACKAGE_TYPE" column="RESOURCE_TYPE_ID" nullable="true"/>
</schemaSpec>
<schemaSpec version="2.105">
@@ -3367,12 +3367,12 @@
REFERENCES RHQ_SUBJECT (ID)
</statement>
</schema-directSQL>
-
+
<!-- Now add modify the permissions to give all the roles with MANAGE_INVENTORY
the new MANAGE_REPOSITORIES privilege so that people's privs remain unchanged. -->
<schema-directSQL>
<statement>
- INSERT INTO RHQ_PERMISSION (role_id, operation)
+ INSERT INTO RHQ_PERMISSION (role_id, operation)
SELECT role_id, 15 FROM RHQ_PERMISSION WHERE operation = 1
</statement>
</schema-directSQL>
@@ -3381,9 +3381,12 @@
<schemaSpec version="2.106">
<!-- add pre-computed disambiguated name for Resource -->
<schema-addColumn table="RHQ_RESOURCE" column="ANCESTRY" columnType="VARCHAR2" precision="4000" />
- <schema-javaTask className="ResourceAncestryUpgradeTask" />
+ <schema-javaTask className="ResourceAncestryUpgradeTask" />
</schemaSpec>
+ <schemaSpec version="2.107">
+ <schema-createSequence name="RHQ_OPERATION_SCHEDULE_ID_SEQ" initial="10001"/>
+ </schemaSpec>
</dbupgrade>
</target>
</project>
commit dcdd7f2581e36451ab8a9b9fe8916be87fe8e2fb
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 29 16:47:21 2011 -0400
[BZ 700868 - RHQ3 ---> RHQ4 Upgrade error with Oracle]
More upgrade fixes, oracle-specific but postgres should retested now.
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/ResourceAncestryUpgradeTask.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/ResourceAncestryUpgradeTask.java
index d07e09b..60727eb 100644
--- a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/ResourceAncestryUpgradeTask.java
+++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/ResourceAncestryUpgradeTask.java
@@ -18,6 +18,7 @@
*/
package org.rhq.core.db.upgrade;
+import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
@@ -50,8 +51,16 @@ public class ResourceAncestryUpgradeTask implements DatabaseUpgradeTask {
+ " res.RESOURCE_TYPE_ID=rt.ID and rt.CATEGORY='PLATFORM'";
List<Object[]> rs = databaseType.executeSelectSql(connection, sql);
for (Object[] result : rs) {
- int rtId = (Integer) result[0];
- int resId = (Integer) result[1];
+ int rtId;
+ int resId;
+
+ if (result[0] instanceof BigDecimal) {
+ rtId = ((BigDecimal) result[0]).intValue();
+ resId = ((BigDecimal) result[1]).intValue();
+ } else {
+ rtId = (Integer) result[0];
+ resId = (Integer) result[1];
+ }
String resName = (String) result[2];
handleChildren(rtId, resId, resName, null);
@@ -66,8 +75,16 @@ public class ResourceAncestryUpgradeTask implements DatabaseUpgradeTask {
+ " res.RESOURCE_TYPE_ID=rt.ID and res.PARENT_RESOURCE_ID=" + parentResId;
List<Object[]> rs = databaseType.executeSelectSql(connection, sql);
for (Object[] result : rs) {
- int rtId = (Integer) result[0];
- int resId = (Integer) result[1];
+ int rtId;
+ int resId;
+
+ if (result[0] instanceof BigDecimal) {
+ rtId = ((BigDecimal) result[0]).intValue();
+ resId = ((BigDecimal) result[1]).intValue();
+ } else {
+ rtId = (Integer) result[0];
+ resId = (Integer) result[1];
+ }
String resName = (String) result[2];
String ancestry = getAncestry(parentRtId, parentResId, parentResName, parentAncestry);
String updateSql = "update RHQ_RESOURCE set ANCESTRY='" + ancestry + "' where ID=" + resId;
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 57f82f0..a82c9bf 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3288,10 +3288,14 @@
<!-- Finally, make ID the primary key, rather than (JOB_NAME, JOB_GROUP), and make
(JOB_NAME, JOB_GROUP) a unique index instead. -->
<schema-directSQL>
- <statement desc="Changing primary key of RHQ_OPERATION_SCHEDULE to ID...">
- ALTER TABLE RHQ_OPERATION_SCHEDULE DROP CONSTRAINT RHQ_OPERATION_SCHEDULE_KEY;
- ALTER TABLE RHQ_OPERATION_SCHEDULE ADD PRIMARY KEY (ID);
- CREATE UNIQUE INDEX RHQ_OPERATION_SCHEDULE_KEY_IDX ON RHQ_OPERATION_SCHEDULE (JOB_NAME, JOB_GROUP);
+ <statement desc="Changing primary key of RHQ_OPERATION_SCHEDULE to ID. Step1/3...">
+ ALTER TABLE RHQ_OPERATION_SCHEDULE DROP CONSTRAINT RHQ_OPERATION_SCHEDULE_KEY
+ </statement>
+ <statement desc="Changing primary key of RHQ_OPERATION_SCHEDULE to ID. Step2/3...">
+ ALTER TABLE RHQ_OPERATION_SCHEDULE ADD PRIMARY KEY (ID)
+ </statement>
+ <statement desc="Changing primary key of RHQ_OPERATION_SCHEDULE to ID. Step3/3...">
+ CREATE UNIQUE INDEX RHQ_OPERATION_SCHEDULE_KEY_IDX ON RHQ_OPERATION_SCHEDULE (JOB_NAME, JOB_GROUP)
</statement>
</schema-directSQL>
</schemaSpec>
@@ -3350,15 +3354,13 @@
<schema-addColumn table="RHQ_REPO" column="IS_PRIVATE" columnType="BOOLEAN" />
<schema-directSQL>
<statement targetDBVendor="postgresql" desc="Set is_private flag for existing repos to false">
- UPDATE RHQ_REPO
- SET IS_PRIVATE = false
+ UPDATE RHQ_REPO SET IS_PRIVATE = false
</statement>
<statement targetDBVendor="oracle" desc="Set is_private flag for existing repos to false">
- UPDATE RHQ_REPO
- SET IS_PRIVATE = 0
+ UPDATE RHQ_REPO SET IS_PRIVATE = 0
</statement>
</schema-directSQL>
- <schema-alterColumn table="RHQ_REPO" column="IS_PRIVATE" nullable="FALSE" default="TRUE"/>
+ <schema-alterColumn table="RHQ_REPO" column="IS_PRIVATE" nullable="FALSE"/>
<schema-directSQL>
<statement desc="Creating OWNER_ID foreign key relation on RHQ_REPO">
ALTER TABLE RHQ_REPO
commit b808940a9b0104de15f561ae45c0b9b643f43f42
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 29 14:50:34 2011 -0400
[BZ 700868 - RHQ3 ---> RHQ4 Upgrade error with Oracle]
remove terminating semi-colons in queries. oracle does not like this.
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/OperationScheduleIdSetterUpgradeTask.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/OperationScheduleIdSetterUpgradeTask.java
index 58692c9..1d4c445 100644
--- a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/OperationScheduleIdSetterUpgradeTask.java
+++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/OperationScheduleIdSetterUpgradeTask.java
@@ -38,23 +38,23 @@ public class OperationScheduleIdSetterUpgradeTask implements DatabaseUpgradeTask
@Override
public void execute(DatabaseType databaseType, Connection connection) throws SQLException {
- String selectSQL = "SELECT job_name FROM rhq_operation_schedule;";
+ String selectSQL = "SELECT job_name FROM rhq_operation_schedule";
System.out.println("Executing: " + selectSQL);
List<Object[]> results = databaseType.executeSelectSql(connection, selectSQL);
Map<Long, String> sortedJobNames = new TreeMap<Long, String>();
for (Object[] result : results) {
- String jobName = (String)result[0]; // e.g.: rhq-resource-10001--121207376-1292542028679
+ String jobName = (String) result[0]; // e.g.: rhq-resource-10001--121207376-1292542028679
// last portion is the job's creation time, e.g.: 1292542028679
Long ctime = Long.valueOf(jobName.substring(jobName.lastIndexOf('-') + 1));
sortedJobNames.put(ctime, jobName);
}
int id = 10001;
for (String jobName : sortedJobNames.values()) {
- String updateSQL = "UPDATE rhq_operation_schedule SET id = " + (id++) + " WHERE job_name = '" + jobName +
- "';";
+ String updateSQL = "UPDATE rhq_operation_schedule SET id = " + (id++) + " WHERE job_name = '" + jobName
+ + "'";
System.out.println("Executing: " + updateSQL);
databaseType.executeSql(connection, updateSQL);
}
}
-
+
}
commit e2c5380318047627b1d6993dc74e1c9900754ae6
Merge: 1d6a2a8 e512102
Author: John Sanda <jsanda(a)redhat.com>
Date: Fri Apr 29 12:39:30 2011 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 1d6a2a898ee925a35d6160e61a2095dbd37476f5
Author: John Sanda <jsanda(a)redhat.com>
Date: Fri Apr 29 11:03:38 2011 -0400
Uncomment if block to allow maven to deploy artifacts
diff --git a/publish_release.sh b/publish_release.sh
index 534de03..3e5b0c4 100755
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -196,11 +196,11 @@ if [ -z "$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS" ]; then
MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS="6"
fi
-#if [ "$MODE" = "production" ] && [ "$RELEASE_TYPE" = "community" ]; then
-# MAVEN_RELEASE_PERFORM_GOAL="deploy"
-#else
+if [ "$MODE" = "production" ] && [ "$RELEASE_TYPE" = "community" ]; then
+ MAVEN_RELEASE_PERFORM_GOAL="deploy"
+else
MAVEN_RELEASE_PERFORM_GOAL="install"
-#fi
+fi
# Set the system character encoding to ISO-8859-1 to ensure i18log reads its
commit 1c2ebdc48061732d8da6c6c1ac842d9ac0fa7ca2
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Apr 29 10:56:39 2011 -0400
by default, GWT-compile support for both the "en" and "de" locales
(cherry picked from commit e5121025d6c9c0588c28d31b84713e8e43955948)
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index 7cff82b..b93f878 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -62,9 +63,9 @@
up gwt compilation. -->
<gwt.draftCompile>false</gwt.draftCompile>
- <!-- Set the default locale for the GUI. Currently supported locales are "default" (for English) or "de" (for
- German). -->
- <gwt.locale>default</gwt.locale>
+ <!-- Comma-separated list of the locales that should be included during GWT compilation. Currently supported
+ locales (i.e. locales for which we have localized message bundles) are "en" and "de". -->
+ <gwt.locale>en,de</gwt.locale>
</properties>
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index a7b603d..f63dbd9 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -1,5 +1,5 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0//EN"
- "http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-source/c...">
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.4//EN"
+ "http://google-web-toolkit.googlecode.com/svn/tags/2.0.4/distro-source/cor...">
<module>
@@ -89,17 +89,28 @@
The gwt.userAgent property is substituted by the Maven resources plugin
during the resources phase. The default value (defined in coregui/pom.xml)
is "ie6,ie8,gecko1_8,safari,opera" (i.e. all supported browsers, except FF1).
- To override this value, specify the user.agent property on the mvn
- command line (e.g. -Duser.agent=gecko1_8) or in your ~/.m2/settings.xml.
+ To override this value, specify the gwt.userAgent property on the mvn
+ command line (e.g. -Dgwt.userAgent=gecko1_8) or in your ~/.m2/settings.xml.
-->
<set-property name="user.agent" value="${gwt.userAgent}"/>
- <!-- Support for locales ('en' need not be specified as long as @DefaultLocale annotates
- the Constants, ConstantsWithLookup, and Messages class). Note, these other locales
- must have a file suffixed with _<locale>.properties in the same package/directory as
- the corresponding GWT i18n interface class resides.-->
- <!--<extend-property name="locale" values="de,fr"/>-->
+ <!--
+ A comma-separated list of the supported locales.
+
+ Each of the locales, aside from the default locale (en) must have a message
+ bundle properties file suffixed with _<locale>.properties in the same package
+ in which the corresponding GWT i18n interface class resides.
+
+ The gwt.locale property is substituted by the Maven resources plugin
+ during the resources phase. The default value (defined in coregui/pom.xml)
+ is "en,de", which are the languages for which we currently have localized
+ messages. To override this value, specify the gwt.locale property on the
+ mvn command line (e.g. -Dgwt.locale=en) or in your ~/.m2/settings.xml.
+ -->
<extend-property name="locale" values="${gwt.locale}" />
+ <!-- If the user's locale is not supported, fallback to "en", rather than the "default" locale. -->
+ <!-- TODO (ips, 04/29/11): Uncomment the below line once we upgrade to GWT 2.1 or later. -->
+ <!--<set-property-fallback name="locale" value="en"/>-->
<entry-point class='org.rhq.enterprise.gui.coregui.client.CoreGUI'/>
<entry-point class='org.rhq.enterprise.gui.coregui.client.SearchGUI'/>
commit aa71bbe4968a3289b5d41d4a2357330deae02182
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Apr 28 15:03:52 2011 -0400
Adding the rhq-publish-release profile to -P so it is activated
diff --git a/publish_release.sh b/publish_release.sh
index e15857f..534de03 100755
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -177,7 +177,7 @@ MAVEN_SETTINGS_FILE="$WORKSPACE/settings.xml"
PROJECT_GIT_URL="git://git.fedorahosted.org/rhq/rhq.git"
-MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors -Penterprise,dist,release"
+MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors -Prhq-publish-release,enterprise,dist"
if [ "$MODE" = "test" ]; then
MAVEN_ARGS="$MAVEN_ARGS -DskipTests=true"
commit 9995bc6ee8b1355d543ea986f222f8477e57b321
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Apr 28 14:46:43 2011 -0400
Fixing error handling checking for script args
diff --git a/publish_release.sh b/publish_release.sh
index 177a11b..e15857f 100755
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -35,7 +35,7 @@ usage()
# Process command line args.
EXE=`basename $0`
-if [ "$#" -ne 6 ]; then
+if [ "$#" -ne 3 ]; then
usage
fi
RELEASE_TYPE="$1"
commit e5121025d6c9c0588c28d31b84713e8e43955948
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Apr 29 10:56:39 2011 -0400
by default, GWT-compile support for both the "en" and "de" locales
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index 7cff82b..b93f878 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -62,9 +63,9 @@
up gwt compilation. -->
<gwt.draftCompile>false</gwt.draftCompile>
- <!-- Set the default locale for the GUI. Currently supported locales are "default" (for English) or "de" (for
- German). -->
- <gwt.locale>default</gwt.locale>
+ <!-- Comma-separated list of the locales that should be included during GWT compilation. Currently supported
+ locales (i.e. locales for which we have localized message bundles) are "en" and "de". -->
+ <gwt.locale>en,de</gwt.locale>
</properties>
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index a7b603d..f63dbd9 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -1,5 +1,5 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0//EN"
- "http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-source/c...">
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.4//EN"
+ "http://google-web-toolkit.googlecode.com/svn/tags/2.0.4/distro-source/cor...">
<module>
@@ -89,17 +89,28 @@
The gwt.userAgent property is substituted by the Maven resources plugin
during the resources phase. The default value (defined in coregui/pom.xml)
is "ie6,ie8,gecko1_8,safari,opera" (i.e. all supported browsers, except FF1).
- To override this value, specify the user.agent property on the mvn
- command line (e.g. -Duser.agent=gecko1_8) or in your ~/.m2/settings.xml.
+ To override this value, specify the gwt.userAgent property on the mvn
+ command line (e.g. -Dgwt.userAgent=gecko1_8) or in your ~/.m2/settings.xml.
-->
<set-property name="user.agent" value="${gwt.userAgent}"/>
- <!-- Support for locales ('en' need not be specified as long as @DefaultLocale annotates
- the Constants, ConstantsWithLookup, and Messages class). Note, these other locales
- must have a file suffixed with _<locale>.properties in the same package/directory as
- the corresponding GWT i18n interface class resides.-->
- <!--<extend-property name="locale" values="de,fr"/>-->
+ <!--
+ A comma-separated list of the supported locales.
+
+ Each of the locales, aside from the default locale (en) must have a message
+ bundle properties file suffixed with _<locale>.properties in the same package
+ in which the corresponding GWT i18n interface class resides.
+
+ The gwt.locale property is substituted by the Maven resources plugin
+ during the resources phase. The default value (defined in coregui/pom.xml)
+ is "en,de", which are the languages for which we currently have localized
+ messages. To override this value, specify the gwt.locale property on the
+ mvn command line (e.g. -Dgwt.locale=en) or in your ~/.m2/settings.xml.
+ -->
<extend-property name="locale" values="${gwt.locale}" />
+ <!-- If the user's locale is not supported, fallback to "en", rather than the "default" locale. -->
+ <!-- TODO (ips, 04/29/11): Uncomment the below line once we upgrade to GWT 2.1 or later. -->
+ <!--<set-property-fallback name="locale" value="en"/>-->
<entry-point class='org.rhq.enterprise.gui.coregui.client.CoreGUI'/>
<entry-point class='org.rhq.enterprise.gui.coregui.client.SearchGUI'/>
commit c76a944d159c23baf04e0967d044504b782b85cd
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Thu Apr 28 16:40:47 2011 -0400
BZ 698607: fix issue with monitor portlet not retrieving details for autogroups and erroneous msg.
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 f4fa675..ee1fbc5 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
@@ -121,9 +121,8 @@ public class GroupConfigurationUpdatesPortlet extends LocatableVLayout implement
super(locatorId);
//figure out which page we're loading
String currentPage = History.getToken();
- String[] elements = currentPage.split("/");
this.groupId = groupId;
- baseViewPath = elements[0];
+ baseViewPath = AbstractActivityView.groupPathLookup(currentPage);
}
public GroupConfigurationUpdatesPortlet(String locatorId) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
index 1c5b526..e45fbab 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
@@ -114,10 +114,9 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
super(locatorId);
//figure out which page we're loading
String currentPage = History.getToken();
- String[] elements = currentPage.split("/");
int groupId = AbstractActivityView.groupIdLookup(currentPage);
this.groupId = groupId;
- baseViewPath = elements[0];
+ baseViewPath = AbstractActivityView.groupPathLookup(currentPage);
}
@Override
@@ -437,7 +436,7 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
LocatableDynamicForm row = AbstractActivityView
.createEmptyDisplayRow(recentMeasurementsContent
.extendLocatorId("None"),
- AbstractActivityView.RECENT_MEASUREMENTS_NONE);
+ AbstractActivityView.RECENT_MEASUREMENTS_GROUP_NONE);
column.addMember(row);
} else {
//insert see more link
@@ -454,7 +453,7 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
LocatableDynamicForm row = AbstractActivityView
.createEmptyDisplayRow(recentMeasurementsContent
.extendLocatorId("None"),
- AbstractActivityView.RECENT_MEASUREMENTS_NONE);
+ AbstractActivityView.RECENT_MEASUREMENTS_GROUP_NONE);
column.addMember(row);
}
setRefreshing(false);
@@ -465,7 +464,7 @@ public class GroupMetricsPortlet extends LocatableVLayout implements CustomSetti
}
} else {
LocatableDynamicForm row = AbstractActivityView.createEmptyDisplayRow(recentMeasurementsContent
- .extendLocatorId("None"), AbstractActivityView.RECENT_MEASUREMENTS_NONE);
+ .extendLocatorId("None"), AbstractActivityView.RECENT_MEASUREMENTS_GROUP_NONE);
column.addMember(row);
setRefreshing(false);
}
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 c1f1042..cc51b5d 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
@@ -95,6 +95,7 @@ public abstract class AbstractActivityView extends LocatableVLayout implements R
//retrieve localized text
public static String RECENT_MEASUREMENTS = MSG.common_title_recent_measurements();
public static String RECENT_MEASUREMENTS_NONE = MSG.view_resource_inventory_activity_no_recent_metrics();
+ public static String RECENT_MEASUREMENTS_GROUP_NONE = MSG.view_group_inventory_activity_no_recent_metrics();
public static String RECENT_ALERTS = MSG.common_title_recent_alerts();
public static String RECENT_ALERTS_NONE = MSG.view_resource_inventory_activity_no_recent_alerts();
public static String RECENT_OOB = MSG.common_title_recent_oob_metrics();
@@ -636,19 +637,19 @@ public abstract class AbstractActivityView extends LocatableVLayout implements R
return groupId;
}
- /* Utility method to extract groupId from
+ /* Utility method to extract group base path from current page
*
*/
public static String groupPathLookup(String currentPage) {
String groupBasePath = "";
if ((currentPage != null) && (!currentPage.trim().isEmpty())) {
String[] elements = currentPage.split("/");
- //process for groups and auto groups Ex. ResourceGroup/10111 or ResourceGroup/AutoCluster/10321
+ //process for groups and auto groups Ex. ResourceGroup/10111 , ResourceGroup/AutoCluster/10321 , Resource/AutoGroup/10141
try {
Integer.valueOf(elements[1]);
groupBasePath = elements[0];
} catch (NumberFormatException nfe) {
- groupBasePath = elements[1] + "/" + elements[1];
+ groupBasePath = elements[0] + "/" + elements[1];
}
}
return groupBasePath;
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 01045ce..cf9dbbc 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
@@ -1854,6 +1854,7 @@ view_group_detail_failLoad = Failed to load group for group with ID [{0}]
view_group_detail_failLoadComp = Failed to load group composite for group with ID [{0}]
view_group_detail_recursiveChange = You successfully changed the recursive setting for group [{0}]
view_group_detail_failRecursiveChange = Failed to update the recursive setting for group [{0}]
+view_group_inventory_activity_no_recent_metrics=This group has no recent metrics
view_group_membership_failFetch = Failed to fetch Resource Group
view_group_membership_saveFailure = Failed to update membership of group [{0}]
view_group_membership_saveSuccessful = You have updated the membership of group [{0}]
commit 6afd5f4136f620345213ada1685f6f27c96972d9
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Apr 28 13:16:52 2011 -0400
Removing variables that are needed for tagging but not for publishing
diff --git a/publish_release.sh b/publish_release.sh
index cbdcf6f..177a11b 100755
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -28,7 +28,7 @@ abort()
usage()
{
- abort "$@" "Usage: $EXE community|enterprise RELEASE_VERSION DEVELOPMENT_VERSION RELEASE_BRANCH GIT_USERNAME test|production" "Example: $EXE enterprise 3.0.0.GA 3.0.0-SNAPSHOT release-3.0.0 ips test"
+ abort "$@" "Usage: $EXE community|enterprise RELEASE_BRANCH test|production" "Example: $EXE enterprise release-3.0.0 test"
}
@@ -42,11 +42,9 @@ RELEASE_TYPE="$1"
if [ "$RELEASE_TYPE" != "community" ] && [ "$RELEASE_TYPE" != "enterprise" ]; then
usage "Invalid release type: $RELEASE_TYPE (valid release types are 'community' or 'enterprise')"
fi
-RELEASE_VERSION="$2"
-DEVELOPMENT_VERSION="$3"
-RELEASE_BRANCH="$4"
-GIT_USERNAME="$5"
-MODE="$6"
+RELEASE_BRANCH="$2"
+MODE="$3"
+
if [ "$MODE" != "test" ] && [ "$MODE" != "production" ]; then
usage "Invalid mode: $MODE (valid modes are 'test' or 'production')"
fi
@@ -205,10 +203,6 @@ fi
#fi
-TAG_VERSION=`echo $RELEASE_VERSION | sed 's/\./_/g'`
-RELEASE_TAG="${TAG_PREFIX}_${TAG_VERSION}"
-
-
# Set the system character encoding to ISO-8859-1 to ensure i18log reads its
# messages and writes its resource bundle properties files in that encoding,
# since that is how the German and French I18NMessage annotation values are
@@ -233,10 +227,8 @@ echo "WORKING_DIR=$WORKING_DIR"
echo "PROJECT_NAME=$PROJECT_NAME"
echo "PROJECT_GIT_URL=$PROJECT_GIT_URL"
echo "RELEASE_TYPE=$RELEASE_TYPE"
-echo "RELEASE_VERSION=$RELEASE_VERSION"
echo "DEVELOPMENT_VERSION=$DEVELOPMENT_VERSION"
echo "RELEASE_BRANCH=$RELEASE_BRANCH"
-echo "RELEASE_TAG=$RELEASE_TAG"
echo "MODE=$MODE"
echo "MAVEN_LOCAL_REPO_DIR=$MAVEN_LOCAL_REPO_DIR"
echo "MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS=$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS"
@@ -324,12 +316,3 @@ mvn $MAVEN_RELEASE_PERFORM_GOAL $MAVEN_ARGS -Ddbreset
[ "$?" -ne 0 ] && abort "Release build failed. Please see above Maven output for details, fix any issues, then try again."
echo
echo "Release build succeeded!"
-
-
-echo
-echo "=============================== Release Info =================================="
-echo "Version: $RELEASE_VERSION"
-echo "Branch URL: $PROJECT_GIT_WEB_URL;a=shortlog;h=refs/heads/$RELEASE_BRANCH"
-echo "Tag URL: $PROJECT_GIT_WEB_URL;a=shortlog;h=refs/tags/$RELEASE_TAG"
-echo "==============================================================================="
-
commit 65c380ab752343a24a1efd2119825cf070f3d698
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Apr 28 12:57:16 2011 -0400
Look for settings.xml in the workspace.
diff --git a/publish_release.sh b/publish_release.sh
index eb1ce04..cbdcf6f 100755
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -175,6 +175,8 @@ elif [ -z "$WORKING_DIR" ]; then
MAVEN_SETTINGS_FILE="$HOME/release/m2-settings.xml"
fi
+MAVEN_SETTINGS_FILE="$WORKSPACE/settings.xml"
+
PROJECT_GIT_URL="git://git.fedorahosted.org/rhq/rhq.git"
MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors -Penterprise,dist,release"
commit ec90b2f03d82ddf217cdc35b99b0cb52c15530c4
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Apr 28 12:48:09 2011 -0400
Removing the generated settings.xml from script
The generated settings.xml contained info like internal host names that
should not be put out in the public repo.
diff --git a/publish_release.sh b/publish_release.sh
old mode 100644
new mode 100755
index 71635b3..eb1ce04
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -167,7 +167,7 @@ if [ -n "$HUDSON_URL" ] && [ -n "$WORKSPACE" ]; then
echo "We appear to be running in a Hudson job."
WORKING_DIR="$WORKSPACE"
MAVEN_LOCAL_REPO_DIR="$HOME/.m2/hudson-release-$RELEASE_TYPE-repository"
- MAVEN_SETTINGS_FILE="$HOME/.m2/hudson-$JOB_NAME-settings.xml"
+ #MAVEN_SETTINGS_FILE="$HOME/.m2/hudson-$JOB_NAME-settings.xml"
elif [ -z "$WORKING_DIR" ]; then
WORKING_DIR="$HOME/release/rhq"
MAVEN_LOCAL_REPO_DIR="$HOME/release/m2-repository"
@@ -270,55 +270,6 @@ if [ -f "$MAVEN_LOCAL_REPO_DIR" ]; then
fi
mkdir -p "$MAVEN_LOCAL_REPO_DIR"
-
-# Create the Maven settings file.
-cat <<EOF >"${MAVEN_SETTINGS_FILE}"
-<settings>
- <localRepository>$MAVEN_LOCAL_REPO_DIR</localRepository>
-
- <profiles>
-
- <profile>
- <id>release</id>
- <properties>
-<rhq.test.ds.server-name>vmg01.mw.lab.eng.bos.redhat.com</rhq.test.ds.server-name>
- <rhq.db.admin.username>jon2</rhq.db.admin.username>
- <rhq.db.admin.password>jboss42</rhq.db.admin.password>
- <rhq.test.ds.user-name>jon2</rhq.test.ds.user-name>
- <rhq.test.ds.password>jboss42</rhq.test.ds.password>
- <rhq.test.ds.db-name>rhq_release</rhq.test.ds.db-name>
- <rhq.test.ds.connection-url>jdbc:postgresql://${rhq.test.ds.server-name}:5432/${rhq.test.ds.db-name}</rhq.test.ds.connection-url>
- <rhq.test.ds.type-mapping>PostgreSQL</rhq.test.ds.type-mapping>
- <rhq.test.ds.driver-class>org.postgresql.Driver</rhq.test.ds.driver-class>
- <rhq.test.ds.xa-datasource-class>org.postgresql.xa.PGXADataSource</rhq.test.ds.xa-datasource-class>
- <rhq.test.ds.hibernate-dialect>org.hibernate.dialect.PostgreSQLDialect</rhq.test.ds.hibernate-dialect>
- <!-- quartz properties -->
- <rhq.test.quartz.driverDelegateClass>org.quartz.impl.jdbcjobstore.PostgreSQLDelegate</rhq.test.quartz.driverDelegateClass>
- <rhq.test.quartz.selectWithLockSQL>SELECT * FROM {0}LOCKS ROWLOCK WHERE LOCK_NAME = ? FOR UPDATE</rhq.test.quartz.selectWithLockSQL>
- <rhq.test.quartz.lockHandlerClass>org.quartz.impl.jdbcjobstore.StdRowLockSemaphore</rhq.test.quartz.lockHandlerClass>
-
- <DatabaseTest.nofail>true</DatabaseTest.nofail>
-
- <rhq.testng.excludedGroups>agent-comm,comm-client,postgres-plugin,native-system</rhq.testng.excludedGroups>
-
- <gwt-plugin.extraJvmArgs>-Xms512M -Xmx1024M -XX:PermSize=256M -XX:MaxPermSize=512M</gwt-plugin.extraJvmArgs>
- </properties>
- </profile>
-
- </profiles>
-
- <!-- This is used by the deploy plugin to publish release artifacts to the jboss.org Nexus repo. -->
- <servers>
- <server>
- <id>jboss-releases-repository</id>
- <username>$JBOSS_ORG_USERNAME</username>
- <password>$JBOSS_ORG_PASSWORD</password>
- </server>
- </servers>
-
-</settings>
-EOF
-
# We only need to worry about cloning the repo if we are not running on hudson
if [ ! "$HUDSON_URL" ]; then
# Clone and/or checkout the source from git.
commit 8ae637d3f3deacbab62e093b8fd1e279250faf2d
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Apr 28 11:42:27 2011 -0400
Initial commit for publish_release script
This script is essentially the portion of the release.sh script that
runs maven to deploy/publish build artifacts. The release script cannot
currently be run from hudson since hudson does not have write access to
the remote git repo.
diff --git a/publish_release.sh b/publish_release.sh
new file mode 100644
index 0000000..71635b3
--- /dev/null
+++ b/publish_release.sh
@@ -0,0 +1,382 @@
+#!/bin/sh
+
+if [ -n "$RELEASE_DEBUG" ]; then
+ echo "Debug output is enabled."
+ set -x
+fi
+
+
+# Constants
+
+PROJECT_NAME="rhq"
+PROJECT_DISPLAY_NAME="RHQ"
+PROJECT_GIT_WEB_URL="http://git.fedorahosted.org/git/?p=rhq/rhq.git"
+TAG_PREFIX="RHQ"
+MINIMUM_MAVEN_VERSION="2.1.0"
+
+
+# Functions
+
+abort()
+{
+ echo >&2
+ for ARG in "$@"; do
+ echo "$ARG" >&2
+ done
+ exit 1
+}
+
+usage()
+{
+ abort "$@" "Usage: $EXE community|enterprise RELEASE_VERSION DEVELOPMENT_VERSION RELEASE_BRANCH GIT_USERNAME test|production" "Example: $EXE enterprise 3.0.0.GA 3.0.0-SNAPSHOT release-3.0.0 ips test"
+}
+
+
+# Process command line args.
+
+EXE=`basename $0`
+if [ "$#" -ne 6 ]; then
+ usage
+fi
+RELEASE_TYPE="$1"
+if [ "$RELEASE_TYPE" != "community" ] && [ "$RELEASE_TYPE" != "enterprise" ]; then
+ usage "Invalid release type: $RELEASE_TYPE (valid release types are 'community' or 'enterprise')"
+fi
+RELEASE_VERSION="$2"
+DEVELOPMENT_VERSION="$3"
+RELEASE_BRANCH="$4"
+GIT_USERNAME="$5"
+MODE="$6"
+if [ "$MODE" != "test" ] && [ "$MODE" != "production" ]; then
+ usage "Invalid mode: $MODE (valid modes are 'test' or 'production')"
+fi
+
+if [ "$MODE" = "production" ]; then
+ if [ -z "$JBOSS_ORG_USERNAME" ] || [ -z "$JBOSS_ORG_PASSWORD" ]; then
+ usage "In production mode, jboss.org credentials must be specified via the JBOSS_ORG_USERNAME and JBOSS_ORG_PASSWORD environment variables."
+ fi
+fi
+
+
+# Make sure JAVA_HOME points to a valid JDK 1.6+ install.
+
+if [ -z "$JAVA_HOME" ]; then
+ abort "JAVA_HOME environment variable is not set - JAVA_HOME must point to a JDK (not JRE) 6 install dir."
+fi
+
+if [ ! -d "$JAVA_HOME" ]; then
+ abort "JAVA_HOME ($JAVA_HOME) does not exist or is not a directory - JAVA_HOME must point to a JDK (not JRE) 6 install dir."
+fi
+
+echo "Prepending $JAVA_HOME/bin to PATH..."
+PATH="$JAVA_HOME/bin:$PATH"
+
+if ! which java >/dev/null 2>&1; then
+ abort "java not found in PATH ($PATH) - JAVA_HOME must point to a JDK (not JRE) 6 install dir."
+fi
+
+if ! which javac >/dev/null 2>&1; then
+ abort "javac not found in PATH ($PATH) - JAVA_HOME must point to a JDK (not JRE) 6 install dir."
+fi
+
+if ! javap java.util.Deque >/dev/null 2>&1; then
+ abort "java.util.Deque not found - Java version appears to be less than 1.6 - Jave version must be 1.6 or later."
+fi
+
+# TODO: Check that JDK version is < 1.7.
+
+
+# If this is an enterprise release, make sure JAVA5_HOME points to a valid JDK 1.5 install.
+# We need this to validate only Java 5 or earlier APIs are used in all modules, except the CLI, which requires Java 6.
+
+if [ "$RELEASE_TYPE" = "enterprise" ]; then
+ if [ -z "$JAVA5_HOME" ]; then
+ abort "JAVA5_HOME environment variable is not set - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+ fi
+
+ if [ ! -d "$JAVA5_HOME" ]; then
+ abort "JAVA5_HOME ($JAVA5_HOME) does not exist or is not a directory - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+ fi
+
+ if [ ! -x "$JAVA5_HOME/bin/java" ]; then
+ abort "$JAVA5_HOME/bin/java does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+ fi
+
+ if [ ! -x "$JAVA5_HOME/bin/javac" ]; then
+ abort "$JAVA5_HOME/bin/javac does not exist or is not executable - JAVA5_HOME must point to a JDK (not JRE) 1.5 install dir."
+ fi
+
+ if ! "$JAVA5_HOME/bin/javap" java.lang.Enum >/dev/null 2>&1; then
+ abort "java.lang.Enum not found - JAVA5_HOME ($JAVA5_HOME) version appears to be less than 1.5 - version must be 1.5.x."
+ fi
+
+ if "$JAVA5_HOME/bin/javap" java.util.Deque >/dev/null 2>&1; then
+ abort "java.util.Deque found - JAVA5_HOME ($JAVA5_HOME) version appears to be greater than or equal to 1.6 - version must be 1.5.x."
+ fi
+fi
+
+
+# Make sure M2_HOME points to a valid Maven 2.1.x or 2.2.x install.
+
+if [ -z "$M2_HOME" ]; then
+ abort "M2_HOME environment variable is not set - M2_HOME must point to a Maven, $MINIMUM_MAVEN_VERSION or later, install dir."
+fi
+
+if [ ! -d "$M2_HOME" ]; then
+ abort "M2_HOME ($M2_HOME) does not exist or is not a directory - M2_HOME must point to a Maven, $MINIMUM_MAVEN_VERSION or later, install dir."
+fi
+
+echo "Prepending $M2_HOME/bin to PATH..."
+PATH="$M2_HOME/bin:$PATH"
+
+if ! which mvn >/dev/null 2>&1; then
+ abort "mvn not found in PATH ($PATH) - M2_HOME must point to a Maven, $MINIMUM_MAVEN_VERSION or later, install dir."
+fi
+
+mvn -version >/dev/null
+[ $? -ne 0 ] && abort "mvn --version failed with exit code $?."
+MAVEN_VERSION=`mvn -version | head -1 | sed 's|[^0-9]*\([^ ]*\).*|\1|'`
+if echo $MAVEN_VERSION | grep -Ev "^(2\.[12]|3\.0)"; then
+ abort "Unsupported Maven version - $MAVEN_VERSION. Only Maven 2.1.x, 2.2.x, or 3.0.x is supported. Please update the value of M2_HOME, then try again."
+fi
+
+
+# Make sure git 1.6.x or 1.7.x is in the PATH.
+
+if ! which git >/dev/null 2>&1; then
+ abort "git not found in PATH ($PATH)."
+fi
+
+git --version >/dev/null
+[ $? -ne 0 ] && abort "git --version failed with exit code $?."
+GIT_VERSION=`git --version | sed 's|[^0-9]*\([^ ]*\).*|\1|'`
+if echo $GIT_VERSION | grep -v "^1.[67]"; then
+ abort "Unsupported git version - $GIT_VERSION. Only git 1.6.x or 1.7.x are supported. Please add a directory containing a supported version of git to your PATH, then try again."
+fi
+
+
+# Set various environment variables.
+
+MAVEN_OPTS="-Xms512M -Xmx1024M -XX:PermSize=128M -XX:MaxPermSize=256M"
+export MAVEN_OPTS
+
+
+# Set various local variables.
+
+if [ -n "$HUDSON_URL" ] && [ -n "$WORKSPACE" ]; then
+ echo "We appear to be running in a Hudson job."
+ WORKING_DIR="$WORKSPACE"
+ MAVEN_LOCAL_REPO_DIR="$HOME/.m2/hudson-release-$RELEASE_TYPE-repository"
+ MAVEN_SETTINGS_FILE="$HOME/.m2/hudson-$JOB_NAME-settings.xml"
+elif [ -z "$WORKING_DIR" ]; then
+ WORKING_DIR="$HOME/release/rhq"
+ MAVEN_LOCAL_REPO_DIR="$HOME/release/m2-repository"
+ #MAVEN_LOCAL_REPO_DIR="$HOME/.m2/repository"
+ MAVEN_SETTINGS_FILE="$HOME/release/m2-settings.xml"
+fi
+
+PROJECT_GIT_URL="git://git.fedorahosted.org/rhq/rhq.git"
+
+MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors -Penterprise,dist,release"
+
+if [ "$MODE" = "test" ]; then
+ MAVEN_ARGS="$MAVEN_ARGS -DskipTests=true"
+fi
+
+if [ "$RELEASE_TYPE" = "enterprise" ]; then
+ MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav -Djava5.home=$JAVA5_HOME/jre"
+fi
+if [ -n "$RELEASE_DEBUG" ]; then
+ MAVEN_ARGS="$MAVEN_ARGS --debug"
+fi
+if [ -n "$RELEASE_ADDITIONAL_MAVEN_ARGS" ]; then
+ MAVEN_ARGS="$MAVEN_ARGS $RELEASE_ADDITIONAL_MAVEN_ARGS"
+fi
+if [ -z "$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS" ]; then
+ MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS="6"
+fi
+
+#if [ "$MODE" = "production" ] && [ "$RELEASE_TYPE" = "community" ]; then
+# MAVEN_RELEASE_PERFORM_GOAL="deploy"
+#else
+ MAVEN_RELEASE_PERFORM_GOAL="install"
+#fi
+
+
+TAG_VERSION=`echo $RELEASE_VERSION | sed 's/\./_/g'`
+RELEASE_TAG="${TAG_PREFIX}_${TAG_VERSION}"
+
+
+# Set the system character encoding to ISO-8859-1 to ensure i18log reads its
+# messages and writes its resource bundle properties files in that encoding,
+# since that is how the German and French I18NMessage annotation values are
+# encoded and the encoding used by i18nlog to read in resource bundle
+# property files.
+LANG=en_US.iso8859
+export LANG
+
+
+# Print out a summary of the environment.
+
+echo
+echo "========================== Environment Variables =============================="
+echo "JAVA_HOME=$JAVA_HOME"
+[ "$RELEASE_TYPE" = "enterprise" ] && echo "JAVA5_HOME=$JAVA5_HOME"
+echo "M2_HOME=$M2_HOME"
+echo "MAVEN_OPTS=$MAVEN_OPTS"
+echo "PATH=$PATH"
+echo "LANG=$LANG"
+echo "============================= Local Variables ================================="
+echo "WORKING_DIR=$WORKING_DIR"
+echo "PROJECT_NAME=$PROJECT_NAME"
+echo "PROJECT_GIT_URL=$PROJECT_GIT_URL"
+echo "RELEASE_TYPE=$RELEASE_TYPE"
+echo "RELEASE_VERSION=$RELEASE_VERSION"
+echo "DEVELOPMENT_VERSION=$DEVELOPMENT_VERSION"
+echo "RELEASE_BRANCH=$RELEASE_BRANCH"
+echo "RELEASE_TAG=$RELEASE_TAG"
+echo "MODE=$MODE"
+echo "MAVEN_LOCAL_REPO_DIR=$MAVEN_LOCAL_REPO_DIR"
+echo "MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS=$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS"
+echo "MAVEN_SETTINGS_FILE=$MAVEN_SETTINGS_FILE"
+echo "MAVEN_ARGS=$MAVEN_ARGS"
+echo "MAVEN_RELEASE_PERFORM_GOAL=$MAVEN_RELEASE_PERFORM_GOAL"
+echo "JBOSS_ORG_USERNAME=$JBOSS_ORG_USERNAME"
+echo "============================= Program Versions ================================"
+git --version
+echo
+java -version
+echo
+mvn --version | head -1
+echo "==============================================================================="
+echo
+
+
+# Clean the Maven local repo if it hasn't been purged recently.
+
+if [ -f "$MAVEN_LOCAL_REPO_DIR" ]; then
+ if [ "$MODE" = "production" ]; then
+ echo "Purging MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) since this is a production build..."
+ #rm -rf "$MAVEN_LOCAL_REPO_DIR"
+ else
+ echo boo
+ #OUTPUT=`find "$MAVEN_LOCAL_REPO_DIR" -maxdepth 0 -mtime $MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS`
+ #if [ -n "$OUTPUT" ]; then
+ # echo "MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) has existed for more than $MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS hours - purging it for a clean-clean build..."
+ # rm -rf "$MAVEN_LOCAL_REPO_DIR"
+ #fi
+ fi
+
+fi
+mkdir -p "$MAVEN_LOCAL_REPO_DIR"
+
+
+# Create the Maven settings file.
+cat <<EOF >"${MAVEN_SETTINGS_FILE}"
+<settings>
+ <localRepository>$MAVEN_LOCAL_REPO_DIR</localRepository>
+
+ <profiles>
+
+ <profile>
+ <id>release</id>
+ <properties>
+<rhq.test.ds.server-name>vmg01.mw.lab.eng.bos.redhat.com</rhq.test.ds.server-name>
+ <rhq.db.admin.username>jon2</rhq.db.admin.username>
+ <rhq.db.admin.password>jboss42</rhq.db.admin.password>
+ <rhq.test.ds.user-name>jon2</rhq.test.ds.user-name>
+ <rhq.test.ds.password>jboss42</rhq.test.ds.password>
+ <rhq.test.ds.db-name>rhq_release</rhq.test.ds.db-name>
+ <rhq.test.ds.connection-url>jdbc:postgresql://${rhq.test.ds.server-name}:5432/${rhq.test.ds.db-name}</rhq.test.ds.connection-url>
+ <rhq.test.ds.type-mapping>PostgreSQL</rhq.test.ds.type-mapping>
+ <rhq.test.ds.driver-class>org.postgresql.Driver</rhq.test.ds.driver-class>
+ <rhq.test.ds.xa-datasource-class>org.postgresql.xa.PGXADataSource</rhq.test.ds.xa-datasource-class>
+ <rhq.test.ds.hibernate-dialect>org.hibernate.dialect.PostgreSQLDialect</rhq.test.ds.hibernate-dialect>
+ <!-- quartz properties -->
+ <rhq.test.quartz.driverDelegateClass>org.quartz.impl.jdbcjobstore.PostgreSQLDelegate</rhq.test.quartz.driverDelegateClass>
+ <rhq.test.quartz.selectWithLockSQL>SELECT * FROM {0}LOCKS ROWLOCK WHERE LOCK_NAME = ? FOR UPDATE</rhq.test.quartz.selectWithLockSQL>
+ <rhq.test.quartz.lockHandlerClass>org.quartz.impl.jdbcjobstore.StdRowLockSemaphore</rhq.test.quartz.lockHandlerClass>
+
+ <DatabaseTest.nofail>true</DatabaseTest.nofail>
+
+ <rhq.testng.excludedGroups>agent-comm,comm-client,postgres-plugin,native-system</rhq.testng.excludedGroups>
+
+ <gwt-plugin.extraJvmArgs>-Xms512M -Xmx1024M -XX:PermSize=256M -XX:MaxPermSize=512M</gwt-plugin.extraJvmArgs>
+ </properties>
+ </profile>
+
+ </profiles>
+
+ <!-- This is used by the deploy plugin to publish release artifacts to the jboss.org Nexus repo. -->
+ <servers>
+ <server>
+ <id>jboss-releases-repository</id>
+ <username>$JBOSS_ORG_USERNAME</username>
+ <password>$JBOSS_ORG_PASSWORD</password>
+ </server>
+ </servers>
+
+</settings>
+EOF
+
+# We only need to worry about cloning the repo if we are not running on hudson
+if [ ! "$HUDSON_URL" ]; then
+ # Clone and/or checkout the source from git.
+
+ if [ -d "$WORKING_DIR" ]; then
+ cd "$WORKING_DIR"
+ git status >/dev/null 2>&1
+ GIT_STATUS_EXIT_CODE=$?
+ # Note, git 1.6 and earlier returns an exit code of 1, rather than 0, if there are any uncommitted changes,
+ # and git 1.7 returns 0, so we check if the exit code is less than or equal to 1 to determine if $WORKING_DIR
+ # is truly a git working copy.
+ if [ "$GIT_STATUS_EXIT_CODE" -le 1 ]; then
+ echo "Checking out a clean copy of the release branch ($RELEASE_BRANCH)..."
+ git fetch origin "$RELEASE_BRANCH"
+ [ "$?" -ne 0 ] && abort "Failed to fetch release branch ($RELEASE_BRANCH)."
+ git checkout "$RELEASE_BRANCH" 2>/dev/null
+ if [ "$?" -ne 0 ]; then
+ git checkout --track -b "$RELEASE_BRANCH" "origin/$RELEASE_BRANCH"
+ fi
+ [ "$?" -ne 0 ] && abort "Failed to checkout release branch ($RELEASE_BRANCH)."
+ git reset --hard "origin/$RELEASE_BRANCH"
+ [ "$?" -ne 0 ] && abort "Failed to reset release branch ($RELEASE_BRANCH)."
+ git clean -dxf
+ [ "$?" -ne 0 ] && abort "Failed to clean release branch ($RELEASE_BRANCH)."
+ git pull
+ [ "$?" -ne 0 ] && abort "Failed to update release branch ($RELEASE_BRANCH)."
+ else
+ echo "$WORKING_DIR does not appear to be a git working directory ('git status' returned $GIT_STATUS_EXIT_CODE) - removing it so we can freshly clone the repo..."
+ cd ..
+ rm -rf "$WORKING_DIR"
+ [ "$?" -ne 0 ] && abort "Failed to remove bogus working directory ($WORKING_DIR)."
+ fi
+ fi
+
+ if [ ! -d "$WORKING_DIR" ]; then
+ echo "Cloning the $PROJECT_NAME git repo (this will take about 10-15 minutes)..."
+ git clone "$PROJECT_GIT_URL" "$WORKING_DIR"
+ [ "$?" -ne 0 ] && abort "Failed to clone $PROJECT_NAME git repo ($PROJECT_GIT_URL)."
+ cd "$WORKING_DIR"
+ if [ "$RELEASE_BRANCH" != "master" ]; then
+ git checkout --track -b $RELEASE_BRANCH "origin/$RELEASE_BRANCH"
+ fi
+ [ "$?" -ne 0 ] && abort "Failed to checkout release branch ($RELEASE_BRANCH)."
+ fi
+fi
+
+
+echo "Building release from tag and publishing Maven artifacts (this will take about 10-15 minutes)..."
+mvn $MAVEN_RELEASE_PERFORM_GOAL $MAVEN_ARGS -Ddbreset
+[ "$?" -ne 0 ] && abort "Release build failed. Please see above Maven output for details, fix any issues, then try again."
+echo
+echo "Release build succeeded!"
+
+
+echo
+echo "=============================== Release Info =================================="
+echo "Version: $RELEASE_VERSION"
+echo "Branch URL: $PROJECT_GIT_WEB_URL;a=shortlog;h=refs/heads/$RELEASE_BRANCH"
+echo "Tag URL: $PROJECT_GIT_WEB_URL;a=shortlog;h=refs/tags/$RELEASE_TAG"
+echo "==============================================================================="
+
commit cc0bd46fdbd593384c25152fcc0cbd108ceb326c
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 28 11:00:17 2011 -0400
some minor fixes
diff --git a/chkdist.sh b/chkdist.sh
index 16e3a5c..ff2edd2 100755
--- a/chkdist.sh
+++ b/chkdist.sh
@@ -24,7 +24,7 @@ pass()
fail()
{
_MSG="$1"
- echo "[FAILED] $_MSG" >&2
+ echo "[FAILED] $_MSG"
EXIT_CODE=2
return 1
}
@@ -87,10 +87,10 @@ else
fi
# Unzip the dist zip to a temp dir.
-TMP_DIR="/tmp/chkjondist$$"
+TMP_DIR="/tmp/chkdist$$"
unzip -q "$RHQ_DIST_ZIPFILE" -d $TMP_DIR
-# e.g.: /tmp/chkjondist12345/rhq-server-4.0.0)
+# e.g.: /tmp/chkdist12345/rhq-server-4.0.0)
RHQ_DIR=`ls -d $TMP_DIR/*`
AS_CONFIG_DIR="$RHQ_DIR/jbossas/server/default"
@@ -117,7 +117,8 @@ SNAPSHOT_JARS=`find "$RHQ_EAR_DIR" -name "*-SNAPSHOT.jar"`
if [ -z "$SNAPSHOT_JARS" ]; then
pass "No snapshot jars are included."
else
- fail "The following snapshot jars are included: $SNAPSHOT_JARS"
+ fail "The following snapshot jars are included:"
+ echo "$SNAPSHOT_JARS"
fi
# Check encoding of message bundles.
commit 3c14cc9f692aada117c2f6f45149691696688809
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Apr 28 10:55:02 2011 -0400
script for checking/validating a release zipfile
diff --git a/chkdist.sh b/chkdist.sh
new file mode 100755
index 0000000..16e3a5c
--- /dev/null
+++ b/chkdist.sh
@@ -0,0 +1,135 @@
+#!/bin/sh
+
+#
+# A script to validate an RHQ distribution zipfile.
+#
+
+abort()
+{
+ _MSG="$1"
+ if [ -n "$_MSG" ]; then
+ echo "$_MSG" >&2
+ fi
+ echo "Usage: $SCRIPT_NAME rhq-dist-zipfile" >&2
+ exit 1
+}
+
+pass()
+{
+ _MSG="$1"
+ echo "[PASSED] $_MSG"
+ return 0
+}
+
+fail()
+{
+ _MSG="$1"
+ echo "[FAILED] $_MSG" >&2
+ EXIT_CODE=2
+ return 1
+}
+
+chkfile()
+{
+ _PATH=`eval echo $1`
+ _DESC="$2"
+ _COUNT=`ls -d1 "$_PATH" 2>/dev/null | wc -l`
+ if [ $_COUNT -eq 1 ]; then
+ pass "$_DESC is included."
+ else
+ fail "$_DESC ($_PATH) is missing."
+ fi
+ return $?
+}
+
+chknofile()
+{
+ _PATH=`eval echo $1`
+ _DESC="$2"
+ _COUNT=`ls -d1 "$_PATH" 2>/dev/null | wc -l`
+ if [ $_COUNT -eq 0 ]; then
+ pass "$_DESC is not included."
+ else
+ fail "$_DESC ($_PATH) is present."
+ fi
+ return $?
+}
+
+chkdir()
+{
+ _PATH="$1"
+ _DESC="$2"
+ if [ -d "$_PATH" ]; then
+ pass "$_DESC is included."
+ else
+ fail "$_DESC ($_PATH) is missing."
+ fi
+ return $?
+}
+
+SCRIPT_NAME=`basename $0`
+
+RHQ_DIST_ZIPFILE="$1"
+
+# Validate arguments.
+[ -z "$RHQ_DIST_ZIPFILE" ] && abort "Argument missing."
+[ -d "$RHQ_DIST_ZIPFILE" ] && abort "$RHQ_DIST_ZIPFILE is a directory, not a regular file."
+[ ! -e "$RHQ_DIST_ZIPFILE" ] && abort "$RHQ_DIST_ZIPFILE does not exist."
+
+# Check zip file dize is in expected range.
+ZIPFILESIZE=`ls -l "$RHQ_DIST_ZIPFILE" | awk '{print $5}'`
+if [ "$ZIPFILESIZE" -lt 185000000 ]; then
+ fail "Dist zipfile size is less than 185 MB."
+elif [ "$ZIPFILESIZE" -gt 200000000 ]; then
+ fail "Dist zipfile size is greater than 200 MB."
+else
+ pass "Dist zipfile size is between 185 and 200 MB."
+fi
+
+# Unzip the dist zip to a temp dir.
+TMP_DIR="/tmp/chkjondist$$"
+unzip -q "$RHQ_DIST_ZIPFILE" -d $TMP_DIR
+
+# e.g.: /tmp/chkjondist12345/rhq-server-4.0.0)
+RHQ_DIR=`ls -d $TMP_DIR/*`
+
+AS_CONFIG_DIR="$RHQ_DIR/jbossas/server/default"
+RHQ_EAR_DIR="$AS_CONFIG_DIR/deploy/rhq.ear.rej"
+
+EXIT_CODE=0
+
+# Check for existence of various dirs and files.
+chkdir "$RHQ_EAR_DIR" "RHQ EAR"
+chknofile "$RHQ_EAR_DIR/rhq-downloads/connectors/connector-apache.zip" "Apache Connectors zipfile"
+chkfile "$RHQ_EAR_DIR/rhq-downloads/connectors/connector-rtfilter.zip" "Servlet RT Connectors zipfile"
+chkfile "$AS_CONFIG_DIR/lib/postgresql-*.jar" "PostgreSQL JDBC driver"
+chknofile "$AS_CONFIG_DIR/lib/ojdbc5-*.jar" "Oracle JDBC driver"
+
+# Check that JSPs are precompiled.
+if [ -f "$RHQ_EAR_DIR/rhq-portal.war/WEB-INF/classes/jsp/portal/MainLayout_jsp.class" ]; then
+ pass "JSPs are precompiled."
+else
+ fail "JSPs are not precompiled."
+fi
+
+# Check that no SNAPSHOT jars are included.
+SNAPSHOT_JARS=`find "$RHQ_EAR_DIR" -name "*-SNAPSHOT.jar"`
+if [ -z "$SNAPSHOT_JARS" ]; then
+ pass "No snapshot jars are included."
+else
+ fail "The following snapshot jars are included: $SNAPSHOT_JARS"
+fi
+
+# Check encoding of message bundles.
+ENCODING=`file $RHQ_DIR/jbossas/server/default/deploy/rhq-installer.war/WEB-INF/classes/InstallerMessages_de.properties | cut -d: -f2 | cut -d' ' -f2`
+if [ "$ENCODING" = "ISO-8859" ]; then
+ pass "Message bundle encoding is correct."
+else
+ fail "Message bundle encoding is incorrect (expected: ISO-8859, actual: $ENCODING). LANG environment variable was probably not set to en_US.iso88591 in shell that was used to build the release."
+fi
+
+# Cleanup.
+rm -rf "$TMP_DIR"
+
+exit $EXIT_CODE
+
commit 0bbe5a50f2ee6760a90822f76df8033b1a8c24fa
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Apr 28 09:51:43 2011 -0400
BZ 700226 - be able to delete multiple config history items
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryView.java
index 72966cf..07c4080 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/AbstractConfigurationHistoryView.java
@@ -97,7 +97,8 @@ public abstract class AbstractConfigurationHistoryView<T extends AbstractConfigu
int[] doomedIds = new int[selection.length];
int i = 0;
for (ListGridRecord selected : selection) {
- doomedIds[i] = selected.getAttributeAsInt(AbstractConfigurationHistoryDataSource.Field.ID);
+ doomedIds[i++] = selected
+ .getAttributeAsInt(AbstractConfigurationHistoryDataSource.Field.ID);
if (selected
.getAttribute(AbstractConfigurationHistoryDataSource.Field.GROUP_CONFIG_UPDATE_ID) != null) {
CoreGUI.getMessageCenter().notify(
13 years
[rhq] Branch 'as7plugin' - 3 commits - modules/plugins
by Heiko W. Rupp
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java | 65 ----------
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Descriptor.java | 38 ++++-
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/SubsystemDiscovery.java | 4
3 files changed, 35 insertions(+), 72 deletions(-)
New commits:
commit ba33706d7029e1771a3329a429d1348d7c3a29a1
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon May 2 15:39:05 2011 +0200
Also handle nested elements.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Descriptor.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Descriptor.java
index 599f61c..8e42fdf 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Descriptor.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/Domain2Descriptor.java
@@ -94,8 +94,11 @@ public class Domain2Descriptor {
attributesMap = (Map<String, Object>) resMap.get("attributes");
}
+ createProperties(doMetrcis, attributesMap, 0);
+ }
+ private void createProperties(boolean doMetrcis, Map<String, Object> attributesMap, int indent) {
for (Map.Entry<String,Object> entry : attributesMap.entrySet()) {
Map<String,Object> props = (Map<String, Object>) entry.getValue();
@@ -118,12 +121,21 @@ public class Domain2Descriptor {
case LIST:
typeString = "-list-";
break; // Handled below
+ case OBJECT: // an embedded map
+ typeString = "-object-";
+ System.out.println("<c:list-property name=\"" + entry.getKey() +"\" description=\"" +
+ props.get("description") + "\" >");
+ createProperties(doMetrcis,
+ (Map<String, Object>) ((Map<String, Object>) entry.getValue()).get("attributes"), indent+4);
+ System.out.println("</c:list-property>");
+
+ continue;
default:
typeString = "- unknown -";
System.err.println("Unknown type " + ptype + " for " + entry.getKey());
}
- if (ptype==Type.LIST && !doMetrcis) {
+ if (ptype== Type.LIST && !doMetrcis) {
System.out.println("<c:list-property name=\"" + entry.getKey() +"\" >");
System.out.println(" <c:simple-property name=\"" + entry.getKey() + "\" />");
@@ -134,14 +146,19 @@ public class Domain2Descriptor {
continue;
}
+ String accessType = (String) props.get("access-type");
+ if (accessType==null)
+ accessType = "read-only"; // default of as7
if (doMetrcis) {
- if (!props.get("access-type").equals("metric"))
+ if (!accessType.equals("metric"))
continue;
- StringBuilder sb = new StringBuilder("<metric property=\"");
+ StringBuilder sb = new StringBuilder();
+ doIndent(indent,sb);
+ sb.append("<metric property=\"");
sb.append(entry.getKey()).append('"');
sb.append(" type=\"").append(typeString).append("\"");
- if (ptype==Type.STRING)
+ if (ptype== Type.STRING)
sb.append(" dataType=\"trait\"");
String description = (String) props.get("description");
@@ -155,8 +172,12 @@ public class Domain2Descriptor {
}
else {
+ if (accessType.equals("metric"))
+ continue;
- StringBuilder sb = new StringBuilder("<c:simple-property name=\"");
+ StringBuilder sb = new StringBuilder();
+ doIndent(indent,sb);
+ sb.append("<c:simple-property name=\"");
sb.append(entry.getKey()).append('"');
Object required = props.get("required");
@@ -166,7 +187,7 @@ public class Domain2Descriptor {
sb.append(" type=\"").append(typeString).append("\"");
sb.append(" readOnly=\"");
- if (props.get("access-type").equals("read-only"))
+ if (accessType!=null && accessType.equals("read-only")) // TODO if no access-type is given, the one from the parent applies
sb.append("true");
else
sb.append("false");
@@ -183,8 +204,11 @@ public class Domain2Descriptor {
System.out.println(sb.toString());
}
}
+ }
-
+ private void doIndent(int indent, StringBuilder sb) {
+ for (int i = 0 ; i < indent ; i++)
+ sb.append(' ');
}
private Type getTypeFromProps(Map<String, Object> props) {
commit 07e330834624e13d48342c9a3e9ba5037490af11
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon May 2 10:47:44 2011 +0200
Remove unused import.
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 03a0f12..a50ea45 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
@@ -29,7 +29,6 @@ import org.rhq.modules.plugins.jbossas7.json.ReadResource;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
commit d58b242f0d092d7b95b9e544edbc1eae5e32038c
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Thu Apr 28 15:05:57 2011 +0200
Get rid of the old getLevelData() method. We are doing that via operation now.
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 12d3ec6..eace9b8 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
@@ -26,13 +26,11 @@ import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
-import java.net.URLConnection;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
-import org.jetbrains.annotations.Nullable;
import org.rhq.modules.plugins.jbossas7.json.ComplexResult;
import org.rhq.modules.plugins.jbossas7.json.Operation;
@@ -47,7 +45,6 @@ public class ASConnection {
private final Log log = LogFactory.getLog(ASConnection.class);
URL url;
String urlString;
- private StringBuilder builder;
private ObjectMapper mapper;
public ASConnection(String host, int port) {
@@ -63,64 +60,6 @@ public class ASConnection {
}
- @Deprecated
- JsonNode getLevelData(@Nullable String base, boolean recursive, boolean includeMetrics) throws Exception{
- String ops = null;
- if (recursive)
- ops = "recursive";
- if (includeMetrics)
- ops += "&include-runtime=true";
-
- return getLevelData(base,ops);
-}
-
- /**
- * Return the JSON-Object for a certain path.
- *
- * @param base Path to the object/subsystem. Can be null/"" for the base objects
- * @param ops OperationDescription to run on the api can be null
- * @return A JSONObject encoding the level plus sub levels provided
- * @throws Exception If anything goes wrong
- */
- @Deprecated
- JsonNode getLevelData(@Nullable String base, @Nullable String ops) throws Exception {
-
- URL url2;
- String spec;
- url2 = getBaseUrl(base, ops);
-
- JsonNode tree = null;
-
- URLConnection conn = url2.openConnection();
- InputStream inputStream = null;
- try {
- inputStream = conn.getInputStream();
- } catch (IOException e) {
- System.err.println(e.getMessage());
- return tree;
- }
- BufferedReader in = new BufferedReader(new InputStreamReader(
- inputStream));
- try {
- String line;
- StringBuilder builder = new StringBuilder();
- while ((line = in.readLine()) != null) {
- builder.append(line);
- }
-
- ObjectMapper mapper = new ObjectMapper();
-
- tree = mapper.readTree(builder.toString());
-
- } catch (IOException ioe) {
- System.err.println("for in put " + url2 + " : " + ioe.getMessage());
- } finally {
- in.close();
- }
-
- return tree;
- }
-
static boolean isErrorReply(JsonNode in) {
if (in == null)
@@ -182,14 +121,14 @@ public class ASConnection {
br = new BufferedReader(new InputStreamReader(
inputStream));
String line;
- builder = new StringBuilder();
+ StringBuilder builder = new StringBuilder();
while ((line = br.readLine()) != null) {
builder.append(line);
}
String outcome;
JsonNode operationResult=null;
- if (builder!=null) {
+ if (builder !=null) {
outcome= builder.toString();
operationResult = mapper.readTree(outcome);
}
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 50dd55c..03a0f12 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
@@ -25,6 +25,7 @@ import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
import org.rhq.modules.plugins.jbossas7.json.PROPERTY_VALUE;
import org.rhq.modules.plugins.jbossas7.json.ReadChildrenNames;
+import org.rhq.modules.plugins.jbossas7.json.ReadResource;
import java.util.ArrayList;
import java.util.Arrays;
@@ -106,7 +107,7 @@ public class SubsystemDiscovery implements ResourceDiscoveryComponent<BaseCompon
JsonNode json ;
if (!recursive)
- json = connection.getLevelData(path,recursive, false);
+ json = connection.executeRaw(new ReadResource(parentComponent.pathToAddress(path)));
else {
List<PROPERTY_VALUE> addr ;
addr = parentComponent.pathToAddress(parentPath);
13 years
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 11 +++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
New commits:
commit f8d1ed14a40dd8a5fb6e798f4317f00e810f640f
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue May 3 20:52:47 2011 -0400
call CoreGUI.goToView(), rather than History.newItem(), in native event handler
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index a41031d..09ca49b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -161,10 +161,10 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
// make sure it's not a hyperlink that GWT already handles
if (element.getPropertyString("__listener") == null) {
String url = element.getAttribute("href");
- String token = getHistoryToken(url);
- if (token != null) {
- GWT.log("Forcing History.newItem(\"" + token + "\")...");
- History.newItem(token);
+ String viewPath = getViewPath(url);
+ if (viewPath != null) {
+ GWT.log("Forcing CoreGUI.goToView(\"" + viewPath + "\")...");
+ CoreGUI.goToView(viewPath);
nativeEvent.preventDefault();
}
}
@@ -173,7 +173,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
}
}
- private static String getHistoryToken(String url) {
+ private static String getViewPath(String url) {
String token;
if (url.startsWith("#")) {
token = url.substring(1);
@@ -537,4 +537,5 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.Na
public static boolean isDebugMode() {
return !GWT.isScript();
}
+
}
13 years
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 50 ++++++++--
1 file changed, 43 insertions(+), 7 deletions(-)
New commits:
commit 4c0c992c2b1ebb560a6d4e9666591614ff1ff7c0
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue May 3 17:43:04 2011 -0400
add magic Event.NativePreviewHandler that makes anchor tags not reload the whole page in IE; remove unused printWidgetTree method
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
index 47a5c1f..a41031d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java
@@ -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
@@ -22,10 +22,13 @@ import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.EventTarget;
+import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
@@ -54,7 +57,6 @@ import org.rhq.enterprise.gui.coregui.client.test.TestRemoteServiceStatisticsVie
import org.rhq.enterprise.gui.coregui.client.test.TestDataSourceResponseStatisticsView;
import org.rhq.enterprise.gui.coregui.client.test.TestTopView;
import org.rhq.enterprise.gui.coregui.client.util.ErrorHandler;
-import org.rhq.enterprise.gui.coregui.client.util.WidgetUtility;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.message.MessageCenter;
import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
@@ -65,7 +67,7 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
* @author Greg Hinkle
* @author Ian Springer
*/
-public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
+public class CoreGUI implements EntryPoint, ValueChangeHandler<String>, Event.NativePreviewHandler {
public static final String CONTENT_CANVAS_ID = "BaseContent";
@@ -121,6 +123,8 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
coreGUI = this;
+ Event.addNativePreviewHandler(this);
+
registerPageKeys();
GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
@@ -147,6 +151,42 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
loadingPanel.removeFromParent();
}
+ public void onPreviewNativeEvent(Event.NativePreviewEvent event) {
+ if (SC.isIE() && event.getTypeInt() == Event.ONCLICK) {
+ NativeEvent nativeEvent = event.getNativeEvent();
+ EventTarget target = nativeEvent.getEventTarget();
+ if (Element.is(target)) {
+ Element element = Element.as(target);
+ if ("a".equalsIgnoreCase(element.getTagName())) {
+ // make sure it's not a hyperlink that GWT already handles
+ if (element.getPropertyString("__listener") == null) {
+ String url = element.getAttribute("href");
+ String token = getHistoryToken(url);
+ if (token != null) {
+ GWT.log("Forcing History.newItem(\"" + token + "\")...");
+ History.newItem(token);
+ nativeEvent.preventDefault();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private static String getHistoryToken(String url) {
+ String token;
+ if (url.startsWith("#")) {
+ token = url.substring(1);
+ } else if (url.startsWith("/#")) {
+ token = url.substring(2);
+ } else if (url.contains(Location.getHost()) && url.indexOf('#') > 0) {
+ token = url.substring(url.indexOf('#') + 1);
+ } else {
+ token = null;
+ }
+ return token;
+ }
+
private void registerPageKeys() {
if (isDebugMode()) {
KeyIdentifier debugKey = new KeyIdentifier();
@@ -310,10 +350,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
return errorHandler;
}
- public static void printWidgetTree() {
- WidgetUtility.printWidgetTree(coreGUI.rootCanvas);
- }
-
private static String getDefaultView() {
// TODO: should this be Dashboard or a User Preference?
return DEFAULT_VIEW;
13 years
[rhq] Branch 'ie-fragment-fix' - modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/Link.java | 7 +++++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java | 4 ----
2 files changed, 5 insertions(+), 6 deletions(-)
New commits:
commit 5e4986e56683e8c1bc1195c7555d8db914b75474
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue May 3 16:24:25 2011 -0400
fix width of Links; re-enable underlining of ancestry links on hover
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/Link.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/Link.java
index 95352b4..c421b9f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/Link.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/Link.java
@@ -50,8 +50,11 @@ public class Link extends LocatableHTMLFlow {
this.mouseOutStyleName = DEFAULT_MOUSE_OUT_STYLE_NAME;
// TODO (ips, 04/28/11): This is hacky - try to find a better way.
- int width = calculateWidth(linkText);
- setWidth(width);
+ //int width = calculateWidth(linkText);
+ //setWidth(width);
+ setAutoWidth();
+ // Convert spaces to non-breaking spaces to prevent breaks within the link.
+ linkText = linkText.replace(" ", " ");
setContents(linkText);
addClickHandler(clickHandler);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java
index b8ff07b..ca12e66 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/AncestryUtil.java
@@ -125,10 +125,6 @@ public abstract class AncestryUtil {
String url = LinkManager.getResourceLink(ancestorResourceId);
String suffix = resourceId + "_" + entryTokens[1];
ViewLink viewLink = new ViewLink(ancestorName + suffix, ancestorName, url);
- viewLink.setMouseOverStyleName(null);
- viewLink.setMouseOutStyleName(null);
- //viewLink.setOverflow(Overflow.VISIBLE);
- //viewLink.setAutoWidth();
hStack.addMember(viewLink);
} else {
HTMLFlow html = new HTMLFlow(ancestorName);
13 years
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java | 18 +++++++---
1 file changed, 14 insertions(+), 4 deletions(-)
New commits:
commit 3a5aab6588c68bab424a0269942aa11e2a602b92
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue May 3 16:10:45 2011 -0400
BZ 701774 - ignore when a condition value cannot be converted to a Double - its probably a trait and can't be converted anyway
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
index 6475640..b3574bc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java
@@ -374,8 +374,13 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
conditionText = AlertFormatUtility.formatAlertConditionForDisplay(condition);
conditionValue = conditionLog.getValue();
if (condition.getMeasurementDefinition() != null) {
- conditionValue = MeasurementConverterClient.format(Double.valueOf(conditionLog.getValue()), condition
- .getMeasurementDefinition().getUnits(), true);
+ try {
+ conditionValue = MeasurementConverterClient.format(Double.valueOf(conditionLog.getValue()),
+ condition.getMeasurementDefinition().getUnits(), true);
+ } catch (Exception e) {
+ // the condition log value was probably not a number (most likely a trait). Ignore this exception.
+ // even if any other errors occur trying to format the value, ignore this and just use the raw value string
+ }
}
} else {
conditionText = MSG.view_alerts_field_condition_text_none();
@@ -393,8 +398,13 @@ public class AlertDataSource extends RPCDataSource<Alert, AlertCriteria> {
dc.setAttribute("text", AlertFormatUtility.formatAlertConditionForDisplay(condition));
String value = log.getValue();
if (condition.getMeasurementDefinition() != null) {
- value = MeasurementConverterClient.format(Double.valueOf(log.getValue()), condition
- .getMeasurementDefinition().getUnits(), true);
+ try {
+ value = MeasurementConverterClient.format(Double.valueOf(log.getValue()), condition
+ .getMeasurementDefinition().getUnits(), true);
+ } catch (Exception e) {
+ // the condition log value was probably not a number (most likely a trait). Ignore this exception.
+ // even if any other errors occur trying to format the value, ignore this and just use the raw value string
+ }
}
dc.setAttribute("value", value);
conditions[i++] = dc;
13 years