[rhq] release.sh
by ips
release.sh | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
New commits:
commit dce3f196748e87a14fa8935638b268d898c32c2e
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Mar 4 15:52:38 2011 -0500
don't build the tag, since we always want to do that from a Hudson job
diff --git a/release.sh b/release.sh
index 97e2cf3..0de47a0 100755
--- a/release.sh
+++ b/release.sh
@@ -197,11 +197,11 @@ if [ -z "$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS" ]; then
fi
# TODO: We may eventually want to reenable publishing of enterprise artifacts.
-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
TAG_VERSION=`echo $RELEASE_VERSION | sed 's/\./_/g'`
@@ -454,16 +454,16 @@ echo "Tagging succeeded!"
# Checkout the tag and build it. If in production mode, publish the Maven artifacts.
-echo "Checking out release tag $RELEASE_TAG..."
-git checkout "$RELEASE_TAG"
-[ "$?" -ne 0 ] && abort "Checkout of release tag ($RELEASE_TAG) failed. Please see above git output for details, fix any issues, then try again."
-git clean -dxf
-[ "$?" -ne 0 ] && abort "Failed to cleanup unversioned files. Please see above git output for details, fix any issues, then try again."
-echo "Building release from tag and publishing Maven artifacts (this will take about 10-15 minutes)..."
-mvn $MAVEN_RELEASE_PERFORM_GOAL $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true
-[ "$?" -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 "Checking out release tag $RELEASE_TAG..."
+#git checkout "$RELEASE_TAG"
+#[ "$?" -ne 0 ] && abort "Checkout of release tag ($RELEASE_TAG) failed. Please see above git output for details, fix any issues, then try again."
+#git clean -dxf
+#[ "$?" -ne 0 ] && abort "Failed to cleanup unversioned files. Please see above git output for details, fix any issues, then try again."
+#echo "Building release from tag and publishing Maven artifacts (this will take about 10-15 minutes)..."
+#mvn $MAVEN_RELEASE_PERFORM_GOAL $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true
+#[ "$?" -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
13 years, 2 months
[rhq] release.sh
by ips
release.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 1bd9814ccaccdd4952c3a11af21d10eb71e82cb3
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Mar 4 15:19:00 2011 -0500
fix to git checkout
diff --git a/release.sh b/release.sh
index 3615019..97e2cf3 100755
--- a/release.sh
+++ b/release.sh
@@ -355,7 +355,9 @@ if [ ! -d "$WORKING_DIR" ]; then
git clone "$PROJECT_GIT_URL" "$WORKING_DIR"
[ "$?" -ne 0 ] && abort "Failed to clone $PROJECT_NAME git repo ($PROJECT_GIT_URL)."
cd "$CLONE_DIR"
- git checkout --track -b $RELEASE_BRANCH "origin/$RELEASE_BRANCH"
+ 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
13 years, 2 months
[rhq] modules/test-utils
by ips
modules/test-utils/pom.xml | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit 9805554e749f78ef0caa111532cbc43cf21044b9
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Mar 4 15:01:02 2011 -0500
cosmetic
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index be722ca..cb02492 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
+
<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/xsd/maven-4.0.0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
<version>4.0.0-SNAPSHOT</version>
</parent>
+
<artifactId>test-utils</artifactId>
<name>RHQ Test Utils</name>
@@ -170,4 +174,6 @@
</build>
</profile>
</profiles>
+
</project>
+
13 years, 2 months
[rhq] modules/enterprise
by Simeon Pinder
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
New commits:
commit be33092a99dac1fa9f51d74b5237be27b3ff67a3
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Mar 4 13:50:56 2011 -0500
copy/paste bug with Group Activity. Using wrong id in query.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
index 27dfc22..b692f71 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/ActivityView.java
@@ -36,7 +36,6 @@ import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.alert.Alert;
-import org.rhq.core.domain.alert.AlertDefinition;
import org.rhq.core.domain.bundle.BundleDeployment;
import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate;
import org.rhq.core.domain.content.InstalledPackageHistory;
@@ -129,19 +128,12 @@ public class ActivityView extends AbstractActivityView {
*/
private void getRecentAlerts() {
final int groupId = this.groupComposite.getResourceGroup().getId();
- Integer[] filterGroupAlertDefinitionIds;
- Set<AlertDefinition> alertDefinitions = this.groupComposite.getResourceGroup().getAlertDefinitions();
- filterGroupAlertDefinitionIds = new Integer[alertDefinitions.size()];
- int i = 0;
- for (AlertDefinition def : alertDefinitions) {
- filterGroupAlertDefinitionIds[i++] = def.getId();
- }
//fetches last five alerts for this resource
AlertCriteria criteria = new AlertCriteria();
PageControl pageControl = new PageControl(0, 5);
pageControl.initDefaultOrderingField("ctime", PageOrdering.DESC);
criteria.setPageControl(pageControl);
- criteria.addFilterGroupAlertDefinitionIds(filterGroupAlertDefinitionIds);
+ criteria.addFilterResourceGroupIds(groupId);
GWTServiceLookup.getAlertService().findAlertsByCriteria(criteria, new AsyncCallback<PageList<Alert>>() {
@Override
public void onSuccess(PageList<Alert> result) {
13 years, 2 months
[rhq] Branch 'release-3.0.1' - modules/plugins
by fdrabek
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/ManagedComponentDeployer.java | 64 +++++-----
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/DeploymentUtils.java | 50 +++----
2 files changed, 62 insertions(+), 52 deletions(-)
New commits:
commit 8d936c05f084df1856d895cb10d60d72ebeddd64
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Fri Mar 4 20:50:43 2011 +0100
BZ-669542 - Deploying exploded WAR to JBoss EAP 5 throws NPE operation fails
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/ManagedComponentDeployer.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/ManagedComponentDeployer.java
index 1b2d7f0..5733012 100644
--- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/ManagedComponentDeployer.java
+++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/ManagedComponentDeployer.java
@@ -30,11 +30,13 @@ import java.util.jar.Manifest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.jboss.deployers.spi.management.KnownDeploymentTypes;
import org.jboss.deployers.spi.management.ManagementView;
import org.jboss.deployers.spi.management.deploy.DeploymentManager;
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.profileservice.spi.ProfileKey;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.content.PackageDetailsKey;
import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
@@ -60,7 +62,7 @@ public class ManagedComponentDeployer implements Deployer {
private PackageDownloader downloader;
private ProfileServiceConnection profileServiceConnection;
-
+
/**
* @param downloader
*/
@@ -88,7 +90,7 @@ public class ManagedComponentDeployer implements Deployer {
abortIfApplicationAlreadyDeployed(resourceType, archiveFile);
Configuration deployTimeConfig = details.getDeploymentTimeConfiguration();
- @SuppressWarnings( { "ConstantConditions" })
+ @SuppressWarnings({ "ConstantConditions" })
boolean deployExploded = deployTimeConfig.getSimple("deployExploded").getBooleanValue();
DeploymentManager deploymentManager = this.profileServiceConnection.getDeploymentManager();
@@ -114,8 +116,9 @@ public class ManagedComponentDeployer implements Deployer {
deploymentManager.loadProfile(FARM_PROFILE_KEY);
}
+ String[] deployedArchives;
try {
- DeploymentUtils.deployArchive(deploymentManager, archiveFile, deployExploded);
+ deployedArchives = DeploymentUtils.deployArchive(deploymentManager, archiveFile, deployExploded);
} finally {
// Make sure to switch back to the 'applications' profile if we switched to the 'farm' profile above.
if (deployFarmed) {
@@ -125,29 +128,38 @@ public class ManagedComponentDeployer implements Deployer {
//if deployed exploded, we need to store the sha of source package for correct versioning
if (deployExploded) {
- String shaString = new MessageDigestGenerator(MessageDigestGenerator.SHA_256)
- .getDigestString(archiveFile);
- String deploymentName = deployTimeConfig.getSimple(DEPLOYMENT_NAME_PROPERTY).getStringValue();
- URI deployePackageURI = URI.create(deploymentName);
- // e.g.: foo.war
- String path = deployePackageURI.getPath();
- File location = new File(path);
- //We've located the deployed
- if ((location != null) && (location.isDirectory())) {
- File manifestFile = new File(location, "META-INF/MANIFEST.MF");
- Manifest manifest;
- if (manifestFile.exists()) {
- FileInputStream inputStream = new FileInputStream(manifestFile);
- manifest = new Manifest(inputStream);
- inputStream.close();
- } else {
- manifest = new Manifest();
+ for (String archive : deployedArchives) {
+
+ String shaString = new MessageDigestGenerator(MessageDigestGenerator.SHA_256)
+ .getDigestString(archiveFile);
+
+ URI deployePackageURI = URI.create(archive);
+ // e.g.: foo.war
+ String path = deployePackageURI.getPath();
+ File location = new File(path);
+ //We've located the deployed
+ if ((location != null) && (location.isDirectory())) {
+ File manifestFile = new File(location, "META-INF/MANIFEST.MF");
+ Manifest manifest;
+ if (manifestFile.exists()) {
+ FileInputStream inputStream = new FileInputStream(manifestFile);
+ manifest = new Manifest(inputStream);
+ inputStream.close();
+ } else {
+ File metaInf = new File(location, "META-INF");
+ if (!metaInf.exists())
+ if (!metaInf.mkdir())
+ throw new Exception("Could not create directory " + location + "META-INF.");
+
+ manifestFile = new File(metaInf, "MANIFEST.MF");
+ manifest = new Manifest();
+ }
+ Attributes attribs = manifest.getMainAttributes();
+ attribs.putValue("RHQ-Sha256", shaString);
+ FileOutputStream outputStream = new FileOutputStream(manifestFile);
+ manifest.write(outputStream);
+ outputStream.close();
}
- Attributes attribs = manifest.getMainAttributes();
- attribs.putValue("RHQ-Sha256", shaString);
- FileOutputStream outputStream = new FileOutputStream(manifestFile);
- manifest.write(outputStream);
- outputStream.close();
}
}
@@ -179,5 +191,5 @@ public class ManagedComponentDeployer implements Deployer {
throw new IllegalArgumentException("An application named '" + archiveFileName
+ "' is already deployed.");
}
- }
+ }
}
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/DeploymentUtils.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/DeploymentUtils.java
index 7d720e2..7fb2ee8 100644
--- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/DeploymentUtils.java
+++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/DeploymentUtils.java
@@ -23,18 +23,20 @@
package org.rhq.plugins.jbossas5.util;
import java.io.File;
-import java.net.URL;
import java.net.MalformedURLException;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.jboss.deployers.spi.management.deploy.DeploymentManager;
import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
import org.jboss.profileservice.spi.DeploymentOption;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.util.exception.ThrowableUtil;
@@ -72,15 +74,14 @@ public class DeploymentUtils {
*
* @throws Exception if the deployment fails for any reason
*/
- public static void deployArchive(DeploymentManager deploymentManager, File archiveFile, boolean deployExploded)
+ public static String[] deployArchive(DeploymentManager deploymentManager, File archiveFile, boolean deployExploded)
throws Exception {
String archiveFileName = archiveFile.getName();
LOG.debug("Deploying '" + archiveFileName + "' (deployExploded=" + deployExploded + ")...");
URL contentURL;
try {
contentURL = archiveFile.toURI().toURL();
- }
- catch (MalformedURLException e) {
+ } catch (MalformedURLException e) {
throw new IllegalArgumentException("Failed to convert archive file path '" + archiveFile + "' to URL.", e);
}
List<DeploymentOption> deploymentOptions = new ArrayList<DeploymentOption>();
@@ -91,20 +92,19 @@ public class DeploymentUtils {
DeploymentStatus distributeStatus;
Exception distributeFailure = null;
try {
- progress = deploymentManager.distribute(archiveFileName, contentURL, deploymentOptions
- .toArray(new DeploymentOption[deploymentOptions.size()]));
+ progress = deploymentManager.distribute(archiveFileName, contentURL,
+ deploymentOptions.toArray(new DeploymentOption[deploymentOptions.size()]));
distributeStatus = run(progress);
if (distributeStatus.isFailed()) {
- distributeFailure = (distributeStatus.getFailure() != null) ? distributeStatus.getFailure() :
- new Exception("Distribute failed for unknown reason.");
+ distributeFailure = (distributeStatus.getFailure() != null) ? distributeStatus.getFailure()
+ : new Exception("Distribute failed for unknown reason.");
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
distributeFailure = e;
}
if (distributeFailure != null) {
throw new Exception("Failed to distribute '" + contentURL + "' to '" + archiveFileName + "' - cause: "
- + ThrowableUtil.getAllMessages(distributeFailure));
+ + ThrowableUtil.getAllMessages(distributeFailure));
}
// Now that we've successfully distributed the deployment, we need to start it.
@@ -115,16 +115,15 @@ public class DeploymentUtils {
progress = deploymentManager.start(deploymentNames);
startStatus = run(progress);
if (startStatus.isFailed()) {
- startFailure = (startStatus.getFailure() != null) ? startStatus.getFailure() :
- new Exception("Start failed for unknown reason.");
+ startFailure = (startStatus.getFailure() != null) ? startStatus.getFailure() : new Exception(
+ "Start failed for unknown reason.");
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
startFailure = e;
}
if (startFailure != null) {
- LOG.error("Failed to start deployment " + Arrays.asList(deploymentNames)
- + " during deployment of '" + archiveFileName + "'. Backing out the deployment...", startFailure);
+ LOG.error("Failed to start deployment " + Arrays.asList(deploymentNames) + " during deployment of '"
+ + archiveFileName + "'. Backing out the deployment...", startFailure);
// If start failed, the app is invalid, so back out the deployment.
DeploymentStatus removeStatus;
Exception removeFailure = null;
@@ -132,23 +131,22 @@ public class DeploymentUtils {
progress = deploymentManager.remove(deploymentNames);
removeStatus = run(progress);
if (removeStatus.isFailed()) {
- removeFailure = (removeStatus.getFailure() != null) ? removeStatus.getFailure() :
- new Exception("Remove failed for unknown reason.");
+ removeFailure = (removeStatus.getFailure() != null) ? removeStatus.getFailure() : new Exception(
+ "Remove failed for unknown reason.");
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
removeFailure = e;
}
if (removeFailure != null) {
- LOG.error("Failed to remove deployment " + Arrays.asList(deploymentNames)
- + " after start failure.", removeFailure);
+ LOG.error("Failed to remove deployment " + Arrays.asList(deploymentNames) + " after start failure.",
+ removeFailure);
}
throw new Exception("Failed to start deployment " + Arrays.asList(deploymentNames)
- + " during deployment of '" + archiveFileName + "' - cause: " +
- ThrowableUtil.getAllMessages(startFailure));
+ + " during deployment of '" + archiveFileName + "' - cause: "
+ + ThrowableUtil.getAllMessages(startFailure));
}
// If we made it this far, the deployment (distribution+start) was successful.
- return;
+ return deploymentNames;
}
public static DeploymentStatus run(DeploymentProgress progress) {
13 years, 2 months
[rhq] pom.xml
by ips
pom.xml | 39 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
New commits:
commit 45fa01fcb98acdc9156fe3d8b332e5ed54596d98
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Mar 4 14:42:33 2011 -0500
build sources and javadoc jars when release profile is activated
diff --git a/pom.xml b/pom.xml
index 97e45f7..68cab4c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -631,7 +631,7 @@
</configuration>
</plugin>
- <!-- Ensure all code compiles and runs on Java 5 or later. -->
+ <!-- Ensure all code compiles and runs on Java 6 or later. -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
@@ -1128,6 +1128,43 @@
</build>
</profile>
+ <!-- This profile should be enabled when a release is being published.
+ It will ensure that sources and javadoc jars are built and published
+ for each source module. -->
+ <profile>
+ <id>release</id>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
</profiles>
13 years, 2 months
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/MeasurementUserPreferences.java | 13 ++++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java | 17 ++++++++++
2 files changed, 24 insertions(+), 6 deletions(-)
New commits:
commit 7fbb1b079239ac88f747a17ae1a419415cb10349
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Mar 4 12:34:00 2011 -0500
fix for legacy support - it seems the old UI persisted empty strings for some preference values.
make the new gwt code lenient when it finds empty strings - it will not assume default values for metric range perferences
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/MeasurementUserPreferences.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/MeasurementUserPreferences.java
index 9be048f..76ca6c9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/MeasurementUserPreferences.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/MeasurementUserPreferences.java
@@ -98,12 +98,13 @@ public class MeasurementUserPreferences {
MetricRangePreferences prefs = new MetricRangePreferences();
prefs.explicitBeginEnd = Boolean.valueOf(
- userPrefs.getPreference(PREF_METRIC_RANGE_BEGIN_END_FLAG, DEFAULT_VALUE_RANGE_RO)).booleanValue();
+ userPrefs.getPreferenceEmptyStringIsDefault(PREF_METRIC_RANGE_BEGIN_END_FLAG, DEFAULT_VALUE_RANGE_RO))
+ .booleanValue();
if (prefs.explicitBeginEnd == false) {
- prefs.lastN = Integer.valueOf(userPrefs.getPreference(PREF_METRIC_RANGE_LASTN, DEFAULT_VALUE_RANGE_LASTN
- .toString()));
- prefs.unit = Integer.valueOf(userPrefs.getPreference(PREF_METRIC_RANGE_UNIT, DEFAULT_VALUE_RANGE_UNIT
- .toString()));
+ prefs.lastN = Integer.valueOf(userPrefs.getPreferenceEmptyStringIsDefault(PREF_METRIC_RANGE_LASTN,
+ DEFAULT_VALUE_RANGE_LASTN.toString()));
+ prefs.unit = Integer.valueOf(userPrefs.getPreferenceEmptyStringIsDefault(PREF_METRIC_RANGE_UNIT,
+ DEFAULT_VALUE_RANGE_UNIT.toString()));
List<Long> range = MeasurementUtility.calculateTimeFrame(prefs.lastN, prefs.unit);
prefs.begin = range.get(0);
@@ -111,7 +112,7 @@ public class MeasurementUserPreferences {
} else {
try {
String rangeString = userPrefs.getPreference(PREF_METRIC_RANGE);
- if (rangeString != null) {
+ if (rangeString != null && rangeString.trim().length() > 0) {
if (rangeString.contains(",")) { // legacy support: old prefs used to use commas
rangeString = rangeString.replace(",", UserPreferences.PREF_LIST_DELIM);
//userPrefs.setPreference(PREF_METRIC_RANGE, rangeString); // TODO set only if we don't support JSF anymore
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java
index 1626065..3e34ceb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/preferences/UserPreferences.java
@@ -191,6 +191,23 @@ public class UserPreferences {
return userConfiguration.getSimpleValue(name, defaultValue);
}
+ /**
+ * Similar to {@link #getPreference(String, String)} except if the preference
+ * exists, but its value is an empty string, this method returns the defaultValue.
+ * In other words, an empty preference value is just as if it was null.
+ *
+ * @param name name of preference
+ * @param defaultValue the value returned if the preference value was null or an empty string
+ * @return the preference value
+ */
+ protected String getPreferenceEmptyStringIsDefault(String name, String defaultValue) {
+ String value = userConfiguration.getSimpleValue(name, null);
+ if (value == null || value.trim().length() == 0) {
+ value = defaultValue;
+ }
+ return value;
+ }
+
protected void setPreference(String name, Collection<?> value) {
StringBuilder buffer = new StringBuilder();
boolean first = true;
13 years, 2 months
[rhq] modules/enterprise
by ips
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java | 2
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml | 62 ----------
modules/enterprise/gui/portal-war/src/main/webapp/index.html | 10 -
3 files changed, 7 insertions(+), 67 deletions(-)
New commits:
commit 4d5aee7d3cef032462a497626d53b9cf85a705a7
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Mar 4 11:41:02 2011 -0500
remove Redirecting to coregui.war message from portal-war redirect page to make redirect less obvious; remove commented-out Struts taglibs from portal-war web.xml; fix typo in config editor
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
index a63e70f..a986d06 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
@@ -479,7 +479,7 @@ public class ConfigurationEditor extends LocatableVLayout {
+ group.getDisplayName()
+ "</div>"
+ (group.getDescription() != null ? ("<div style='padding-left: 10px; font-weight: normal; font-size: smaller; float: left;'>"
- + " -" + group.getDescription() + "</div>")
+ + " - " + group.getDescription() + "</div>")
: ""));
section.setExpanded(!group.isDefaultHidden());
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
index 2cdedb1..c9b61e7 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml
@@ -531,67 +531,5 @@
<error-code>404</error-code>
<location>/common/GenericError.jsp</location>
</error-page>
-
-
-
- <!----><!-- Struts Tag Library Descriptors --><!--
- <taglib>
- <taglib-uri>struts-bean</taglib-uri>
- <taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>struts-html</taglib-uri>
- <taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>struts-logic</taglib-uri>
- <taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>struts-nested</taglib-uri>
- <taglib-location>/WEB-INF/tld/struts-nested.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>struts-tiles</taglib-uri>
- <taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location>
- </taglib>
---><!--
- <taglib>
- <taglib-uri>struts-validator</taglib-uri>
- <taglib-location>/WEB-INF/tld/struts-validator.tld</taglib-location>
- </taglib>
---><!--
- <taglib>
- <taglib-uri>struts-html-el</taglib-uri>
- <taglib-location>/WEB-INF/tld/struts-html-el.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>struts-logic-el</taglib-uri>
- <taglib-location>/WEB-INF/tld/struts-logic-el.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>jstl-c</taglib-uri>
- <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>jstl-c-rt</taglib-uri>
- <taglib-location>/WEB-INF/tld/c-rt.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>jstl-fmt</taglib-uri>
- <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>hq</taglib-uri>
- <taglib-location>/WEB-INF/tld/hq.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>display</taglib-uri>
- <taglib-location>/WEB-INF/tld/display.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>rt</taglib-uri>
- <taglib-location>/WEB-INF/tld/rt.tld</taglib-location>
- </taglib>-->
</web-app>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/index.html b/modules/enterprise/gui/portal-war/src/main/webapp/index.html
index cb07c35..74eaaa5 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/index.html
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/index.html
@@ -1,9 +1,11 @@
<html>
+
<head>
- <meta http-equiv="Refresh" content="0; URL=/coregui/CoreGUI.html#Dashboards"/>
+ <meta http-equiv="Refresh" content="0; URL=/coregui/"/>
</head>
- <body>
- <p>Redirecting to <a href="/coregui/CoreGUI.html#Dashboards">coregui.war</a>...</p>
+
+ <body bgcolor="white">
+
</body>
-</html>
+</html>
13 years, 2 months
[rhq] modules/enterprise
by lkrejci
modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/ScriptCommand.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 623fa7448d2f3d085a03054bbec602445dbed77d
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Mar 4 17:12:07 2011 +0100
do *NOT* reset the bindings of the script engine on issuing a command in the CLI. That would clear any user defined variables...
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/ScriptCommand.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/ScriptCommand.java
index 8da9d9f..693885f 100644
--- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/ScriptCommand.java
+++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/ScriptCommand.java
@@ -181,7 +181,7 @@ public class ScriptCommand implements ClientCommand {
bindings.put("configurationEditor", new ConfigurationEditor(client));
bindings.put("rhq", new Controller(client));
- ScriptEngineFactory.injectStandardBindings(jsEngine, bindings, true);
+ ScriptEngineFactory.injectStandardBindings(jsEngine, bindings, false);
ScriptEngineFactory.bindIndirectionMethods(jsEngine, "configurationEditor", bindings.get("configurationEditor"));
ScriptEngineFactory.bindIndirectionMethods(jsEngine, "rhq", bindings.get("rhq"));
13 years, 2 months
[rhq] Branch 'release-3.0.0' - modules/plugins
by fdrabek
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/ManagedComponentDeployer.java | 63 +++++-----
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/DeploymentUtils.java | 50 +++----
2 files changed, 60 insertions(+), 53 deletions(-)
New commits:
commit 7a31e489c2fa86af2175554131e5ef6cce4480b1
Author: Filip Drabek <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
Date: Fri Mar 4 16:04:18 2011 +0100
BZ- 669542 - Deploying exploded WAR to JBoss EAP 5 throws NPE operation fails
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/ManagedComponentDeployer.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/ManagedComponentDeployer.java
index 1b2d7f0..7c802fa 100644
--- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/ManagedComponentDeployer.java
+++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/ManagedComponentDeployer.java
@@ -30,11 +30,13 @@ import java.util.jar.Manifest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.jboss.deployers.spi.management.KnownDeploymentTypes;
import org.jboss.deployers.spi.management.ManagementView;
import org.jboss.deployers.spi.management.deploy.DeploymentManager;
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.profileservice.spi.ProfileKey;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.content.PackageDetailsKey;
import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
@@ -60,7 +62,7 @@ public class ManagedComponentDeployer implements Deployer {
private PackageDownloader downloader;
private ProfileServiceConnection profileServiceConnection;
-
+
/**
* @param downloader
*/
@@ -88,7 +90,7 @@ public class ManagedComponentDeployer implements Deployer {
abortIfApplicationAlreadyDeployed(resourceType, archiveFile);
Configuration deployTimeConfig = details.getDeploymentTimeConfiguration();
- @SuppressWarnings( { "ConstantConditions" })
+ @SuppressWarnings({ "ConstantConditions" })
boolean deployExploded = deployTimeConfig.getSimple("deployExploded").getBooleanValue();
DeploymentManager deploymentManager = this.profileServiceConnection.getDeploymentManager();
@@ -113,9 +115,9 @@ public class ManagedComponentDeployer implements Deployer {
}
deploymentManager.loadProfile(FARM_PROFILE_KEY);
}
-
+ String[] archives = null;
try {
- DeploymentUtils.deployArchive(deploymentManager, archiveFile, deployExploded);
+ archives = DeploymentUtils.deployArchive(deploymentManager, archiveFile, deployExploded);
} finally {
// Make sure to switch back to the 'applications' profile if we switched to the 'farm' profile above.
if (deployFarmed) {
@@ -125,29 +127,36 @@ public class ManagedComponentDeployer implements Deployer {
//if deployed exploded, we need to store the sha of source package for correct versioning
if (deployExploded) {
- String shaString = new MessageDigestGenerator(MessageDigestGenerator.SHA_256)
- .getDigestString(archiveFile);
- String deploymentName = deployTimeConfig.getSimple(DEPLOYMENT_NAME_PROPERTY).getStringValue();
- URI deployePackageURI = URI.create(deploymentName);
- // e.g.: foo.war
- String path = deployePackageURI.getPath();
- File location = new File(path);
- //We've located the deployed
- if ((location != null) && (location.isDirectory())) {
- File manifestFile = new File(location, "META-INF/MANIFEST.MF");
- Manifest manifest;
- if (manifestFile.exists()) {
- FileInputStream inputStream = new FileInputStream(manifestFile);
- manifest = new Manifest(inputStream);
- inputStream.close();
- } else {
- manifest = new Manifest();
+ for (String arch : archives) {
+ String shaString = new MessageDigestGenerator(MessageDigestGenerator.SHA_256)
+ .getDigestString(archiveFile);
+
+ URI deployePackageURI = URI.create(arch);
+ // e.g.: foo.war
+ String path = deployePackageURI.getPath();
+ File location = new File(path);
+ //We've located the deployed
+ if ((location != null) && (location.isDirectory())) {
+ File manifestFile = new File(location, "META-INF/MANIFEST.MF");
+ Manifest manifest;
+ if (manifestFile.exists()) {
+ FileInputStream inputStream = new FileInputStream(manifestFile);
+ manifest = new Manifest(inputStream);
+ inputStream.close();
+ } else {
+ File metaInf = new File(location, "META-INF");
+ if (!metaInf.exists())
+ metaInf.mkdir();
+
+ manifestFile = new File(metaInf, "MANIFEST.MF");
+ manifest = new Manifest();
+ }
+ Attributes attribs = manifest.getMainAttributes();
+ attribs.putValue("RHQ-Sha256", shaString);
+ FileOutputStream outputStream = new FileOutputStream(manifestFile);
+ manifest.write(outputStream);
+ outputStream.close();
}
- Attributes attribs = manifest.getMainAttributes();
- attribs.putValue("RHQ-Sha256", shaString);
- FileOutputStream outputStream = new FileOutputStream(manifestFile);
- manifest.write(outputStream);
- outputStream.close();
}
}
@@ -179,5 +188,5 @@ public class ManagedComponentDeployer implements Deployer {
throw new IllegalArgumentException("An application named '" + archiveFileName
+ "' is already deployed.");
}
- }
+ }
}
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/DeploymentUtils.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/DeploymentUtils.java
index 7d720e2..7fb2ee8 100644
--- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/DeploymentUtils.java
+++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/DeploymentUtils.java
@@ -23,18 +23,20 @@
package org.rhq.plugins.jbossas5.util;
import java.io.File;
-import java.net.URL;
import java.net.MalformedURLException;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.jboss.deployers.spi.management.deploy.DeploymentManager;
import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
import org.jboss.profileservice.spi.DeploymentOption;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.util.exception.ThrowableUtil;
@@ -72,15 +74,14 @@ public class DeploymentUtils {
*
* @throws Exception if the deployment fails for any reason
*/
- public static void deployArchive(DeploymentManager deploymentManager, File archiveFile, boolean deployExploded)
+ public static String[] deployArchive(DeploymentManager deploymentManager, File archiveFile, boolean deployExploded)
throws Exception {
String archiveFileName = archiveFile.getName();
LOG.debug("Deploying '" + archiveFileName + "' (deployExploded=" + deployExploded + ")...");
URL contentURL;
try {
contentURL = archiveFile.toURI().toURL();
- }
- catch (MalformedURLException e) {
+ } catch (MalformedURLException e) {
throw new IllegalArgumentException("Failed to convert archive file path '" + archiveFile + "' to URL.", e);
}
List<DeploymentOption> deploymentOptions = new ArrayList<DeploymentOption>();
@@ -91,20 +92,19 @@ public class DeploymentUtils {
DeploymentStatus distributeStatus;
Exception distributeFailure = null;
try {
- progress = deploymentManager.distribute(archiveFileName, contentURL, deploymentOptions
- .toArray(new DeploymentOption[deploymentOptions.size()]));
+ progress = deploymentManager.distribute(archiveFileName, contentURL,
+ deploymentOptions.toArray(new DeploymentOption[deploymentOptions.size()]));
distributeStatus = run(progress);
if (distributeStatus.isFailed()) {
- distributeFailure = (distributeStatus.getFailure() != null) ? distributeStatus.getFailure() :
- new Exception("Distribute failed for unknown reason.");
+ distributeFailure = (distributeStatus.getFailure() != null) ? distributeStatus.getFailure()
+ : new Exception("Distribute failed for unknown reason.");
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
distributeFailure = e;
}
if (distributeFailure != null) {
throw new Exception("Failed to distribute '" + contentURL + "' to '" + archiveFileName + "' - cause: "
- + ThrowableUtil.getAllMessages(distributeFailure));
+ + ThrowableUtil.getAllMessages(distributeFailure));
}
// Now that we've successfully distributed the deployment, we need to start it.
@@ -115,16 +115,15 @@ public class DeploymentUtils {
progress = deploymentManager.start(deploymentNames);
startStatus = run(progress);
if (startStatus.isFailed()) {
- startFailure = (startStatus.getFailure() != null) ? startStatus.getFailure() :
- new Exception("Start failed for unknown reason.");
+ startFailure = (startStatus.getFailure() != null) ? startStatus.getFailure() : new Exception(
+ "Start failed for unknown reason.");
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
startFailure = e;
}
if (startFailure != null) {
- LOG.error("Failed to start deployment " + Arrays.asList(deploymentNames)
- + " during deployment of '" + archiveFileName + "'. Backing out the deployment...", startFailure);
+ LOG.error("Failed to start deployment " + Arrays.asList(deploymentNames) + " during deployment of '"
+ + archiveFileName + "'. Backing out the deployment...", startFailure);
// If start failed, the app is invalid, so back out the deployment.
DeploymentStatus removeStatus;
Exception removeFailure = null;
@@ -132,23 +131,22 @@ public class DeploymentUtils {
progress = deploymentManager.remove(deploymentNames);
removeStatus = run(progress);
if (removeStatus.isFailed()) {
- removeFailure = (removeStatus.getFailure() != null) ? removeStatus.getFailure() :
- new Exception("Remove failed for unknown reason.");
+ removeFailure = (removeStatus.getFailure() != null) ? removeStatus.getFailure() : new Exception(
+ "Remove failed for unknown reason.");
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
removeFailure = e;
}
if (removeFailure != null) {
- LOG.error("Failed to remove deployment " + Arrays.asList(deploymentNames)
- + " after start failure.", removeFailure);
+ LOG.error("Failed to remove deployment " + Arrays.asList(deploymentNames) + " after start failure.",
+ removeFailure);
}
throw new Exception("Failed to start deployment " + Arrays.asList(deploymentNames)
- + " during deployment of '" + archiveFileName + "' - cause: " +
- ThrowableUtil.getAllMessages(startFailure));
+ + " during deployment of '" + archiveFileName + "' - cause: "
+ + ThrowableUtil.getAllMessages(startFailure));
}
// If we made it this far, the deployment (distribution+start) was successful.
- return;
+ return deploymentNames;
}
public static DeploymentStatus run(DeploymentProgress progress) {
13 years, 2 months