[rhq] 3 commits - modules/common modules/enterprise
by mazz
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java | 42 -
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java | 64 +
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AbstractBundleTask.java | 3
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AuditTask.java | 47 -
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractUrlFileType.java | 79 ++
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentUnitType.java | 356 ++++++++--
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/UrlArchiveType.java | 63 +
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/UrlFileType.java | 78 ++
modules/common/ant-bundle/src/main/resources/org/rhq/bundle/antlib.xml | 2
modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java | 98 ++
modules/common/ant-bundle/src/test/resources/test-bundle-url-input.properties | 1
modules/common/ant-bundle/src/test/resources/test-bundle-url.xml | 26
modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java | 2
13 files changed, 748 insertions(+), 113 deletions(-)
New commits:
commit 9f09183904e6c03dc81b058f715a12ce02bc662c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Dec 24 00:09:50 2010 -0500
BZ 609154 - be able to specify archives and raw files via remote URLs rather than bundle them directly in the bundle distro. The agents must have access to this URL for the bundle to be provisioned.
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java
index f5d32eb..e26a7da 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java
@@ -85,9 +85,9 @@ public class AntLauncher {
public BundleAntProject executeBundleDeployFile(File buildFile, Properties buildProperties,
List<BuildListener> buildListeners) throws InvalidBuildFileException {
// Parse and validate the build file before even attempting to execute it.
- BundleAntProject parsedProject = parseBundleDeployFile(buildFile);
+ BundleAntProject parsedProject = parseBundleDeployFile(buildFile, buildProperties);
- BundleAntProject project = createProject(buildFile, false);
+ BundleAntProject project = createProject(buildFile, false, buildProperties);
// The parse above got us all the bundle files names. The rest of this method
// will be able to re-determine everything else for 'project' but these filenames.
@@ -96,17 +96,6 @@ public class AntLauncher {
project.getBundleFileNames().addAll(parsedProject.getBundleFileNames());
try {
- if (buildProperties != null) {
- for (Map.Entry<Object, Object> property : buildProperties.entrySet()) {
- // On the assumption that these properties will be slurped in via Properties.load we
- // need to escape backslashes to have them treated as literals
- project.setUserProperty(property.getKey().toString(), property.getValue().toString().replace("\\",
- "\\\\"));
- }
- }
- project.setUserProperty(MagicNames.ANT_FILE, buildFile.getAbsolutePath());
- project.setUserProperty(MagicNames.ANT_FILE_TYPE, MagicNames.ANT_FILE_TYPE_FILE);
-
if (buildListeners != null) {
for (BuildListener buildListener : buildListeners) {
project.addBuildListener(buildListener);
@@ -131,8 +120,9 @@ public class AntLauncher {
}
}
- public BundleAntProject parseBundleDeployFile(File buildFile) throws InvalidBuildFileException {
- BundleAntProject project = createProject(buildFile, true);
+ public BundleAntProject parseBundleDeployFile(File buildFile, Properties buildProperties)
+ throws InvalidBuildFileException {
+ BundleAntProject project = createProject(buildFile, true, buildProperties);
ProjectHelper2 projectHelper = new ProjectHelper2();
try {
@@ -157,10 +147,23 @@ public class AntLauncher {
return project;
}
- private BundleAntProject createProject(File buildFile, boolean parseOnly) {
+ private BundleAntProject createProject(File buildFile, boolean parseOnly, Properties buildProperties) {
+
ClassLoader classLoader = getClass().getClassLoader();
BundleAntProject project = new BundleAntProject(parseOnly);
+
+ if (buildProperties != null) {
+ for (Map.Entry<Object, Object> property : buildProperties.entrySet()) {
+ // On the assumption that these properties will be slurped in via Properties.load we
+ // need to escape backslashes to have them treated as literals
+ project.setUserProperty(property.getKey().toString(), property.getValue().toString().replace("\\",
+ "\\\\"));
+ }
+ }
+ project.setUserProperty(MagicNames.ANT_FILE, buildFile.getAbsolutePath());
+ project.setUserProperty(MagicNames.ANT_FILE_TYPE, MagicNames.ANT_FILE_TYPE_FILE);
+
project.setCoreLoader(classLoader);
project.init();
project.setBaseDir(buildFile.getParentFile());
@@ -246,6 +249,13 @@ public class AntLauncher {
for (String archive : archives.values()) {
project.getBundleFileNames().add(archive);
}
+
+ // note that we do NOT add url-files and url-archives to the BundleFileNames because those are
+ // not true "bundle files" that are stored with the bundle version in the database. Those will
+ // be downloaded by the agents at the time the recipe is invoked. There is nothing server side
+ // that need to be known about the files/archives from URLs.
+
+ return;
}
private void abortIfTaskWithinTarget(Target target, Task task) throws InvalidBuildFileException {
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java
index 6fab4ba..1beb540 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java
@@ -69,9 +69,12 @@ public class BundleAntProject extends Project {
private final Set<String> bundleFileNames = new HashSet<String>();
private int deploymentId;
private DeploymentPhase deploymentPhase;
- private DeployDifferences deployDiffs = new DeployDifferences();
private boolean dryRun;
+ // results of project execution
+ private DeployDifferences deployDiffs = new DeployDifferences();
+ private Set<File> downloadedFiles = new HashSet<File>();
+
public BundleAntProject() {
this(false);
}
@@ -150,10 +153,6 @@ public class BundleAntProject extends Project {
this.deploymentPhase = deploymentPhase;
}
- public DeployDifferences getDeployDifferences() {
- return deployDiffs;
- }
-
public void setDryRun(boolean dryRun) {
this.dryRun = dryRun;
}
@@ -162,6 +161,20 @@ public class BundleAntProject extends Project {
return dryRun;
}
+ public DeployDifferences getDeployDifferences() {
+ return deployDiffs;
+ }
+
+ /**
+ * If there were url-file or url-archives, this returns the set of files
+ * that were downloaded from the URLs.
+ *
+ * @return downloaded files from remote URLs that contain our bundle content
+ */
+ public Set<File> getDownloadedFiles() {
+ return downloadedFiles;
+ }
+
/**
* Logs a message in a format that our audit task/agent-side audit log listener knows about.
* When running in the agent, this audit log will be sent to the server.
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractUrlFileType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractUrlFileType.java
new file mode 100644
index 0000000..8eecee4
--- /dev/null
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractUrlFileType.java
@@ -0,0 +1,79 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2010 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.bundle.ant.type;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.tools.ant.BuildException;
+
+/**
+ * A base class for the functionality shared by {@link UrlFileType} and {@link UrlArchiveType}.
+ *
+ * @author Ian Springer
+ * @author John Mazzitelli
+ */
+public abstract class AbstractUrlFileType extends AbstractBundleType {
+ private String url;
+ private URL source;
+
+ /**
+ * Returns the base filename of the URL (no parent paths will be in the returned name).
+ * If there is no path, the hostname of the URL is used.
+ *
+ * @return base filename of the source file
+ */
+ public String getBaseName() {
+ String path = this.source.getPath();
+ if (path.endsWith("/")) {
+ path = path.substring(0, path.length());
+ }
+ int lastSlash = path.lastIndexOf('/');
+ if (lastSlash != -1) {
+ path = path.substring(lastSlash + 1);
+ }
+ if (path.length() == 0) {
+ path = this.source.getHost();
+ }
+ return path;
+ }
+
+ public URL getSource() {
+ return this.source;
+ }
+
+ public String getUrl() {
+ return this.url;
+ }
+
+ public void setUrl(String urlString) {
+ this.url = urlString;
+ try {
+ this.source = new URL(urlString);
+ } catch (MalformedURLException e) {
+ throw new BuildException("URL specified by 'url' attribute [" + urlString
+ + "] is malformed - it must be a valid URL.");
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentUnitType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentUnitType.java
index 8d00a96..dfcbcab 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentUnitType.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentUnitType.java
@@ -18,7 +18,12 @@
package org.rhq.bundle.ant.type;
import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
@@ -31,10 +36,13 @@ import org.apache.tools.ant.Project;
import org.apache.tools.ant.Target;
import org.rhq.bundle.ant.DeployPropertyNames;
+import org.rhq.bundle.ant.BundleAntProject.AuditStatus;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.system.SystemInfoFactory;
import org.rhq.core.template.TemplateEngine;
+import org.rhq.core.util.exception.ThrowableUtil;
+import org.rhq.core.util.stream.StreamUtil;
import org.rhq.core.util.updater.DeployDifferences;
import org.rhq.core.util.updater.Deployer;
import org.rhq.core.util.updater.DeploymentData;
@@ -48,13 +56,21 @@ import org.rhq.core.util.updater.DeploymentProperties;
public class DeploymentUnitType extends AbstractBundleType {
private String name;
private String manageRootDir = Boolean.TRUE.toString();
+
private Map<File, File> files = new LinkedHashMap<File, File>();
- private Map<File, String> localFileNames = new LinkedHashMap<File, String>();
+ private Map<URL, File> urlFiles = new LinkedHashMap<URL, File>();
private Set<File> rawFilesToReplace = new LinkedHashSet<File>();
+ private Set<URL> rawUrlFilesToReplace = new LinkedHashSet<URL>();
+ private Map<File, String> localFileNames = new LinkedHashMap<File, String>();
+
private Set<File> archives = new LinkedHashSet<File>();
- private Map<File, String> localArchiveNames = new LinkedHashMap<File, String>();
- private Map<File, Boolean> archivesExploded = new HashMap<File, Boolean>();
+ private Set<URL> urlArchives = new LinkedHashSet<URL>();
private Map<File, Pattern> archiveReplacePatterns = new HashMap<File, Pattern>();
+ private Map<URL, Pattern> urlArchiveReplacePatterns = new HashMap<URL, Pattern>();
+ private Map<File, Boolean> archivesExploded = new HashMap<File, Boolean>();
+ private Map<URL, Boolean> urlArchivesExploded = new HashMap<URL, Boolean>();
+ private Map<File, String> localArchiveNames = new LinkedHashMap<File, String>();
+
private SystemServiceType systemService;
private Pattern ignorePattern;
private String preinstallTarget;
@@ -67,72 +83,282 @@ public class DeploymentUnitType extends AbstractBundleType {
}
public void install(boolean revert, boolean clean) throws BuildException {
- if (this.preinstallTarget != null) {
- Target target = (Target) getProject().getTargets().get(this.preinstallTarget);
- if (target == null) {
- throw new BuildException("Specified preinstall target (" + this.preinstallTarget + ") does not exist.");
- }
- target.performTasks();
+ if (clean) {
+ getProject().auditLog(
+ AuditStatus.WARN,
+ "Clean Requested",
+ "A clean deployment has been requested. Files will be deleted!",
+ "A clean deployment has been requested. Files will be deleted"
+ + " from the destination directory prior to the new deployment files getting written", null);
+ }
+ if (revert) {
+ getProject().auditLog(
+ AuditStatus.WARN,
+ "Revert Requested",
+ "The previous deployment will be reverted!",
+ "The previous deployment will be reverted. An attempt to restore"
+ + " backed up files and the old deployment content will be made", null);
}
- int deploymentId = getProject().getDeploymentId();
- DeploymentProperties deploymentProps = new DeploymentProperties(deploymentId, getProject().getBundleName(),
- getProject().getBundleVersion(), getProject().getBundleDescription());
- File deployDir = getProject().getDeployDir();
- TemplateEngine templateEngine = createTemplateEngine();
+ try {
+ boolean dryRun = getProject().isDryRun();
- if (this.files.isEmpty() && this.archives.isEmpty()) {
- throw new BuildException(
- "You must specify at least one file to deploy via nested rhq:file, rhq:archive, and/or rhq:system-service elements.");
- }
- if (!this.files.isEmpty()) {
- log("Deploying files " + this.files + "...", Project.MSG_VERBOSE);
- }
- if (!this.archives.isEmpty()) {
- log("Deploying archives " + this.archives + "...", Project.MSG_VERBOSE);
+ if (this.preinstallTarget != null) {
+ getProject().auditLog(AuditStatus.SUCCESS, "Pre-Install Started", "The pre install target will start",
+ "The pre install target named [" + this.preinstallTarget + "] will start", null);
+ Target target = (Target) getProject().getTargets().get(this.preinstallTarget);
+ if (target == null) {
+ try {
+ getProject().auditLog(
+ AuditStatus.FAILURE,
+ "Pre-Install Failure",
+ "The pre install target does not exist",
+ "The pre install target specified in the recipe [" + this.preinstallTarget
+ + "] does not exist.", null);
+ } catch (Throwable ignore) {
+ // swallow any errors that occur here, we want to throw the real build exception
+ }
+ throw new BuildException("Specified preinstall target (" + this.preinstallTarget
+ + ") does not exist.");
+ }
+ target.performTasks();
+ getProject().auditLog(AuditStatus.SUCCESS, "Pre-Install Finished",
+ "The pre install target has finished", null, null);
+ }
+
+ int deploymentId = getProject().getDeploymentId();
+ DeploymentProperties deploymentProps = new DeploymentProperties(deploymentId, getProject().getBundleName(),
+ getProject().getBundleVersion(), getProject().getBundleDescription());
+ File deployDir = getProject().getDeployDir();
+ TemplateEngine templateEngine = createTemplateEngine();
+
+ boolean haveSomethingToDo = false;
+ if (!this.files.isEmpty()) {
+ haveSomethingToDo = true;
+ log("Deploying files " + this.files + "...", Project.MSG_VERBOSE);
+ }
+ if (!this.urlFiles.isEmpty()) {
+ haveSomethingToDo = true;
+ log("Deploying files from URL " + this.urlFiles + "...", Project.MSG_VERBOSE);
+ }
+ if (!this.archives.isEmpty()) {
+ haveSomethingToDo = true;
+ log("Deploying archives " + this.archives + "...", Project.MSG_VERBOSE);
+ }
+ if (!this.urlArchives.isEmpty()) {
+ haveSomethingToDo = true;
+ log("Deploying archives from URL " + this.urlArchives + "...", Project.MSG_VERBOSE);
+ }
+ if (!haveSomethingToDo) {
+ throw new BuildException(
+ "You must specify at least one file to deploy via nested file, archive, url-file, url-archive types in your recipe");
+ }
+
+ boolean willManageRootDir = Boolean.parseBoolean(this.manageRootDir);
+ if (willManageRootDir) {
+ log("Managing the root directory of this deployment unit - unrelated files found will be removed",
+ Project.MSG_VERBOSE);
+ // don't send an audit message on this unless we are really going to move files out of the way (i.e. !dryrun)
+ if (!dryRun) {
+ getProject()
+ .auditLog(
+ AuditStatus.WARN,
+ "Managing Top Level Deployment Directory",
+ "The top level deployment directory will be managed - files found there will be backed up and removed!",
+ "The bundle recipe has requested that the top level deployment directory be fully managed by RHQ."
+ + "This means any files currently located in the top level deployment directory will be removed and backed up",
+ null);
+ }
+ } else {
+ log("Not managing the root directory of this deployment unit - unrelated files will remain intact",
+ Project.MSG_VERBOSE);
+ }
+
+ Set<File> allArchives = new HashSet<File>(this.archives);
+ Map<File, File> allFiles = new HashMap<File, File>(this.files);
+ Map<File, Pattern> allArchiveReplacePatterns = new HashMap<File, Pattern>(this.archiveReplacePatterns);
+ Set<File> allRawFilesToReplace = new HashSet<File>(this.rawFilesToReplace);
+ Map<File, Boolean> allArchivesExploded = new HashMap<File, Boolean>(this.archivesExploded);
+ downloadFilesFromUrlEndpoints(allArchives, allFiles, allArchiveReplacePatterns, allRawFilesToReplace,
+ allArchivesExploded);
+
+ try {
+ DeploymentData deploymentData = new DeploymentData(deploymentProps, allArchives, allFiles, getProject()
+ .getBaseDir(), deployDir, allArchiveReplacePatterns, allRawFilesToReplace, templateEngine,
+ this.ignorePattern, willManageRootDir, allArchivesExploded);
+ Deployer deployer = new Deployer(deploymentData);
+ DeployDifferences diffs = getProject().getDeployDifferences();
+
+ // we only want to emit audit trail when something is really going to happen on disk; don't log if doing a dry run
+ if (!dryRun) {
+ getProject().auditLog(AuditStatus.SUCCESS, "Deployer Started", "The deployer has started its work",
+ null, null);
+ }
+
+ if (revert) {
+ deployer.redeployAndRestoreBackupFiles(diffs, clean, dryRun);
+ } else {
+ deployer.deploy(diffs, clean, dryRun);
+ }
+
+ // we only want to emit audit trail when something is really going to happen on disk; don't log if doing a dry run
+ if (!dryRun) {
+ getProject().auditLog(AuditStatus.SUCCESS, "Deployer Finished",
+ "The deployer has finished its work", null, diffs.toString());
+ }
+ } catch (Throwable t) {
+ try {
+ getProject().auditLog(AuditStatus.FAILURE, "Deployer Failed",
+ "The deployer encountered an error and could not finished", ThrowableUtil.getAllMessages(t),
+ ThrowableUtil.getStackAsString(t));
+ } catch (Throwable ignore) {
+ // swallow any errors that occur here, we want to throw the real build exception
+ }
+ throw new BuildException("Failed to deploy bundle [" + getProject().getBundleName() + "] version ["
+ + getProject().getBundleVersion() + "]: " + t, t);
+ }
+
+ if (this.systemService != null) {
+ this.systemService.install();
+ }
+
+ if (this.postinstallTarget != null) {
+ getProject().auditLog(AuditStatus.SUCCESS, "Post-Install Started",
+ "The post install target will start",
+ "The post install target named [" + this.postinstallTarget + "] will start", null);
+ Target target = (Target) getProject().getTargets().get(this.postinstallTarget);
+ if (target == null) {
+ try {
+ getProject().auditLog(
+ AuditStatus.FAILURE,
+ "Post-Install Failure",
+ "The post install target does not exist",
+ "The post install target specified in the recipe [" + this.postinstallTarget
+ + "] does not exist.", null);
+ } catch (Throwable ignore) {
+ // swallow any errors that occur here, we want to throw the real build exception
+ }
+ throw new BuildException("Specified postinstall target (" + this.postinstallTarget
+ + ") does not exist.");
+ }
+ target.performTasks();
+ getProject().auditLog(AuditStatus.SUCCESS, "Post-Install Finished",
+ "The post install target has finished", null, null);
+ }
+ } catch (Throwable t) {
+ try {
+ getProject().auditLog(AuditStatus.FAILURE, "Error Occurred",
+ "The deployment could not complete successfully.", ThrowableUtil.getAllMessages(t),
+ ThrowableUtil.getStackAsString(t));
+ } catch (Throwable ignore) {
+ // swallow any errors that occur here, we want to throw the real build exception
+ }
+ if (t instanceof BuildException) {
+ throw (BuildException) t;
+ } else {
+ throw new BuildException(t);
+ }
}
+ return;
+ }
+
+ /**
+ * This will download any files/archives that are found at URL endpoints as declared in the ant recipe.
+ *
+ * @param allArchives when a new archive is downloaded, its information is added to this
+ * @param allFiles when a new raw file is downloaded, its information is added to this
+ * @param allArchiveReplacePatterns when a new archive is downloaded, its information is added to this
+ * @param allRawFilesToReplace when a new raw file is downloaded, its information is added to this
+ * @param allArchivesExploded when a new archive is downloaded, its information is added to this
+ */
+ private void downloadFilesFromUrlEndpoints(Set<File> allArchives, Map<File, File> allFiles,
+ Map<File, Pattern> allArchiveReplacePatterns, Set<File> allRawFilesToReplace,
+ Map<File, Boolean> allArchivesExploded) throws Exception {
- boolean willManageRootDir = Boolean.parseBoolean(this.manageRootDir);
- if (willManageRootDir) {
- log("Managing the root directory of this deployment unit - unrelated files found will be removed",
- Project.MSG_VERBOSE);
- } else {
- log("Not managing the root directory of this deployment unit - unrelated files will remain intact",
- Project.MSG_VERBOSE);
+ // check to see if we even need to download anything, if not, do nothing and return immediately
+ if (this.urlFiles.isEmpty() && this.urlArchives.isEmpty()) {
+ return;
}
- DeploymentData deploymentData = new DeploymentData(deploymentProps, this.archives, this.files, getProject()
- .getBaseDir(), deployDir, this.archiveReplacePatterns, this.rawFilesToReplace, templateEngine,
- this.ignorePattern, willManageRootDir, this.archivesExploded);
- Deployer deployer = new Deployer(deploymentData);
+ // download all our files in the base dir, as if they came with the bundle like normal files
+ File downloadDir = getProject().getBaseDir();
+ Set<File> downloadedFiles = getProject().getDownloadedFiles();
+
try {
- DeployDifferences diffs = getProject().getDeployDifferences();
- boolean dryRun = getProject().isDryRun();
- if (revert) {
- deployer.redeployAndRestoreBackupFiles(diffs, clean, dryRun);
- } else {
- deployer.deploy(diffs, clean, dryRun);
+ // do the raw files first
+ for (Map.Entry<URL, File> fileEntry : this.urlFiles.entrySet()) {
+ URL url = fileEntry.getKey();
+ File destFile = fileEntry.getValue();
+ File tmpFile = new File(downloadDir, destFile.getPath()); // use getPath in case they have 2+ raw files with the same name
+ download(url, tmpFile);
+ downloadedFiles.add(tmpFile);
+ allFiles.put(tmpFile, destFile);
+ if (this.rawUrlFilesToReplace.contains(url)) {
+ allRawFilesToReplace.add(tmpFile);
+ }
}
- getProject().log("Results:\n" + diffs + "\n");
+
+ // do the archives next
+ for (URL url : this.urlArchives) {
+ // determine what the base filename should be of our downloaded tmp archive file
+ String baseFileName = url.getPath();
+ if (baseFileName.endsWith("/")) {
+ baseFileName = baseFileName.substring(0, baseFileName.length());
+ }
+ int lastSlash = baseFileName.lastIndexOf('/');
+ if (lastSlash != -1) {
+ baseFileName = baseFileName.substring(lastSlash + 1);
+ }
+ if (baseFileName.length() == 0) {
+ baseFileName = url.getHost();
+ }
+
+ File tmpFile = new File(downloadDir, baseFileName);
+ download(url, tmpFile);
+ downloadedFiles.add(tmpFile);
+ allArchives.add(tmpFile);
+ if (this.urlArchiveReplacePatterns.containsKey(url)) {
+ allArchiveReplacePatterns.put(tmpFile, this.urlArchiveReplacePatterns.get(url));
+ }
+ if (this.urlArchivesExploded.containsKey(url)) {
+ allArchivesExploded.put(tmpFile, this.urlArchivesExploded.get(url));
+ }
+ }
+
+ return;
+
} catch (Exception e) {
- throw new BuildException("Failed to deploy bundle '" + getProject().getBundleName() + "' version "
- + getProject().getBundleVersion() + ": " + e, e);
+ // can't do anything with any files we did download - be nice and clean up
+ try {
+ for (File doomed : downloadedFiles) {
+ doomed.delete();
+ }
+ } catch (Exception ignore) {
+ // ignore this, we just can't delete them - but we want to throw our original exception
+ }
+ throw e;
}
+ }
- if (this.systemService != null) {
- this.systemService.install();
- }
+ private void download(URL url, File tmpFile) throws Exception {
+ getProject().auditLog(AuditStatus.SUCCESS, "File Download Started", "Downloading file from URL",
+ "Downloading file from URL: " + url, null);
- if (this.postinstallTarget != null) {
- Target target = (Target) getProject().getTargets().get(this.postinstallTarget);
- if (target == null) {
- throw new BuildException("Specified postinstall target (" + this.postinstallTarget
- + ") does not exist.");
- }
- target.performTasks();
+ long size;
+ try {
+ InputStream in = url.openStream();
+ tmpFile.getParentFile().mkdirs(); // if this fails, our next line will throw a file-not-found error and we'll abort
+ OutputStream out = new FileOutputStream(tmpFile);
+ size = StreamUtil.copy(in, out);
+ } catch (Exception e) {
+ getProject().auditLog(AuditStatus.FAILURE, "File Download Failed",
+ "Failed to download content from a remote server", "Failed to download file from: " + url,
+ ThrowableUtil.getStackAsString(e));
+ throw e;
}
- return;
+ getProject().auditLog(AuditStatus.SUCCESS, "File Download Finished", "Successfully downloaded file from URL",
+ "Downloaded file of size [" + size + "] bytes from URL: " + url, null);
}
public void start() throws BuildException {
@@ -289,6 +515,28 @@ public class DeploymentUnitType extends AbstractBundleType {
this.archivesExploded.put(archive.getSource(), exploded);
}
+ public void addConfigured(UrlFileType file) {
+ File destFile = file.getDestinationFile();
+ if (destFile == null) {
+ File destDir = file.getDestinationDir();
+ destFile = new File(destDir, file.getBaseName());
+ }
+ this.urlFiles.put(file.getSource(), destFile); // key=full absolute path, value=could be relative or absolute
+ if (file.isReplace()) {
+ this.rawUrlFilesToReplace.add(file.getSource());
+ }
+ }
+
+ public void addConfigured(UrlArchiveType archive) {
+ this.urlArchives.add(archive.getSource());
+ Pattern replacePattern = archive.getReplacePattern();
+ if (replacePattern != null) {
+ this.urlArchiveReplacePatterns.put(archive.getSource(), replacePattern);
+ }
+ Boolean exploded = Boolean.valueOf(archive.getExploded());
+ this.urlArchivesExploded.put(archive.getSource(), exploded);
+ }
+
public void addConfigured(IgnoreType ignore) {
List<FileSet> fileSets = ignore.getFileSets();
this.ignorePattern = getPattern(fileSets);
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/UrlArchiveType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/UrlArchiveType.java
new file mode 100644
index 0000000..af664aa
--- /dev/null
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/UrlArchiveType.java
@@ -0,0 +1,63 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2010 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.bundle.ant.type;
+
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.BuildException;
+
+/**
+ * An archive file to be exploded during the bundle deployment (it could remain compressed if exploded="false" is specified)
+ * Can optionally contain a rhq:replace child element that specifies the set of files that contain
+ * template variables (e.g. @@http.port(a)@) which need to be replaced with the value of the corresponding property.
+ *
+ * This archive file is located at a remote location specified by a URL.
+ *
+ * @author Ian Springer
+ * @author John Mazzitelli
+ */
+public class UrlArchiveType extends AbstractUrlFileType {
+ private Pattern replacePattern;
+ private String exploded = Boolean.TRUE.toString();
+
+ public void addConfigured(ReplaceType replace) {
+ List<FileSet> fileSets = replace.getFileSets();
+ this.replacePattern = getPattern(fileSets);
+ }
+
+ public Pattern getReplacePattern() {
+ return replacePattern;
+ }
+
+ public String getExploded() {
+ return exploded;
+ }
+
+ public void setExploded(String exploded) {
+ if (!Boolean.TRUE.toString().equalsIgnoreCase(exploded) && !Boolean.FALSE.toString().equalsIgnoreCase(exploded)) {
+ throw new BuildException("'exploded' attribute must be 'true' or 'false': " + exploded);
+ }
+ this.exploded = exploded;
+ }
+}
\ No newline at end of file
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/UrlFileType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/UrlFileType.java
new file mode 100644
index 0000000..b4c20b0
--- /dev/null
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/UrlFileType.java
@@ -0,0 +1,78 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2010 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.rhq.bundle.ant.type;
+
+import java.io.File;
+
+import org.apache.tools.ant.BuildException;
+
+/**
+ * A file to be copied during the bundle deployment. If the replace attribute is set to true, any template variables
+ * (e.g. @@http.port(a)@) inside the file will be replaced with the value of the corresponding property.
+ *
+ * This file is located at a remote location specified by a URL.
+ *
+ * @author Ian Springer
+ * @author John Mazzitelli
+ */
+public class UrlFileType extends AbstractUrlFileType {
+ private File destinationDir;
+ private File destinationFile;
+ private boolean replace;
+
+ public File getDestinationDir() {
+ return this.destinationDir;
+ }
+
+ // Pass in a String, rather than a File, since we don't want Ant to resolve the path relative to basedir if it's relative.
+ public void setDestinationDir(String destinationDir) {
+ if (this.destinationFile != null) {
+ throw new BuildException(
+ "Both 'destinationDir' and 'destinationFile' attributes are defined - only one or the other may be specified.");
+ }
+ this.destinationDir = new File(destinationDir);
+ }
+
+ public File getDestinationFile() {
+ if (this.destinationDir == null && this.destinationFile == null) {
+ return new File(getBaseName()); // the default destination is the same relative path as that of its local name
+ }
+ return this.destinationFile;
+ }
+
+ public void setDestinationFile(String destinationFile) {
+ if (this.destinationDir != null) {
+ throw new BuildException(
+ "Both 'destinationDir' and 'destinationFile' attributes are defined - only one or the other may be specified.");
+ }
+ this.destinationFile = new File(destinationFile);
+ }
+
+ public boolean isReplace() {
+ return replace;
+ }
+
+ public void setReplace(boolean replace) {
+ this.replace = replace;
+ }
+}
\ No newline at end of file
diff --git a/modules/common/ant-bundle/src/main/resources/org/rhq/bundle/antlib.xml b/modules/common/ant-bundle/src/main/resources/org/rhq/bundle/antlib.xml
index 010077e..d5cf418 100644
--- a/modules/common/ant-bundle/src/main/resources/org/rhq/bundle/antlib.xml
+++ b/modules/common/ant-bundle/src/main/resources/org/rhq/bundle/antlib.xml
@@ -13,6 +13,8 @@
<!-- deployment type's child types -->
<typedef name="file" classname="org.rhq.bundle.ant.type.FileType"/>
<typedef name="archive" classname="org.rhq.bundle.ant.type.ArchiveType"/>
+ <typedef name="url-file" classname="org.rhq.bundle.ant.type.UrlFileType"/>
+ <typedef name="url-archive" classname="org.rhq.bundle.ant.type.UrlArchiveType"/>
<typedef name="replace" classname="org.rhq.bundle.ant.type.ReplaceType"/>
<typedef name="ignore" classname="org.rhq.bundle.ant.type.IgnoreType"/>
<typedef name="fileset" classname="org.rhq.bundle.ant.type.FileSet"/>
diff --git a/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java b/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java
index 4eb4369..92f43b4 100644
--- a/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java
+++ b/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java
@@ -78,7 +78,7 @@ public class AntLauncherTest {
AntLauncher ant = new AntLauncher();
- BundleAntProject project = ant.parseBundleDeployFile(getBuildXml("test-bundle-v1.xml"));
+ BundleAntProject project = ant.parseBundleDeployFile(getBuildXml("test-bundle-v1.xml"), null);
assert project != null;
Set<String> bundleFiles = project.getBundleFileNames();
assert bundleFiles != null;
@@ -518,8 +518,8 @@ public class AntLauncherTest {
assert new File(DEPLOY_DIR, "subdir/test0.txt").exists() : "missing raw file from default destination location";
assert new File(DEPLOY_DIR, "another/foo.txt").exists() : "missing raw file from the destinationFile";
assert new File(DEPLOY_DIR, "second.dir/test2.txt").exists() : "missing raw file from the destinationDir";
- assert !new File(DEPLOY_DIR, "subdir/test1.zip").exists() : "should not be here because destinationFile was specified";
- assert !new File(DEPLOY_DIR, "subdir/test2.zip").exists() : "should not be here because destinationFile was specified";
+ assert !new File(DEPLOY_DIR, "subdir/test1.txt").exists() : "should not be here because destinationFile was specified";
+ assert !new File(DEPLOY_DIR, "subdir/test2.txt").exists() : "should not be here because destinationFile was specified";
assert new File(DEPLOY_DIR, "subdir/test.zip").exists() : "missing unexploded zip file";
assert new File(DEPLOY_DIR, "subdir/test-replace.zip").exists() : "missing unexploded zip file";
assert !new File(DEPLOY_DIR, "subdir/test-explode.zip").exists() : "should have been exploded";
@@ -544,6 +544,98 @@ public class AntLauncherTest {
}
}
+ public void testUrlFilesAndArchives() throws Exception {
+ // We want to test a fresh install, so make sure the deploy dir doesn't pre-exist.
+ FileUtil.purge(DEPLOY_DIR, true);
+
+ // we need to create our own directory structure so we can use file: URLs
+ File tmpUrlLocation = FileUtil.createTempDirectory("anttest", ".url", null);
+ Set<File> downloadedFiles = null;
+
+ try {
+ File subdir = new File(tmpUrlLocation, "subdir"); // must match the name in the recipe
+ subdir.mkdirs();
+ writeFile("file0", subdir, "test0.txt"); // filename must match recipe
+ writeFile("file1", subdir, "test1.txt"); // filename must match recipe
+ writeFile("X=@@X@@\n", subdir, "test2.txt"); // filename must match recipe
+ createZip(new String[] { "one", "two" }, subdir, "test.zip", new String[] { "one.txt", "two.txt" });
+ createZip(new String[] { "3", "4" }, subdir, "test-explode.zip", new String[] { "three.txt", "four.txt" });
+ createZip(new String[] { "X=@@X@@\n" }, subdir, "test-replace.zip", new String[] { "template.txt" }); // will be exploded then recompressed
+
+ AntLauncher ant = new AntLauncher();
+ Properties inputProps = createInputProperties("/test-bundle-url-input.properties");
+ inputProps.setProperty("rhq.test.url.dir", tmpUrlLocation.toURI().toURL().toString()); // we use this so our recipe can use URLs
+ List<BuildListener> buildListeners = createBuildListeners();
+
+ BundleAntProject project = ant.executeBundleDeployFile(getBuildXml("test-bundle-url.xml"), inputProps,
+ buildListeners);
+ assert project != null;
+
+ Set<String> bundleFiles = project.getBundleFileNames();
+ assert bundleFiles != null;
+ assert bundleFiles.size() == 0 : "we don't have any bundle files - only downloaded files from URLs: "
+ + bundleFiles;
+
+ downloadedFiles = project.getDownloadedFiles();
+ assert downloadedFiles != null;
+ assert downloadedFiles.size() == 6 : downloadedFiles;
+ ArrayList<String> expectedDownloadedFileNames = new ArrayList<String>();
+ // remember, we store url downloaded files under the names of their destination file/dir, not source location
+ expectedDownloadedFileNames.add("test0.txt");
+ expectedDownloadedFileNames.add("foo.txt");
+ expectedDownloadedFileNames.add("test2.txt");
+ expectedDownloadedFileNames.add("test.zip");
+ expectedDownloadedFileNames.add("test-explode.zip");
+ expectedDownloadedFileNames.add("test-replace.zip");
+ for (File downloadedFile : downloadedFiles) {
+ assert expectedDownloadedFileNames.contains(downloadedFile.getName()) : "We downloaded a file but its not in the project's list: "
+ + downloadedFile;
+ }
+
+ assert new File(DEPLOY_DIR, "test0.txt").exists() : "missing raw file from default destination location";
+ assert new File(DEPLOY_DIR, "another/foo.txt").exists() : "missing raw file from the destinationFile";
+ assert new File(DEPLOY_DIR, "second.dir/test2.txt").exists() : "missing raw file from the destinationDir";
+ assert !new File(DEPLOY_DIR, "test1.txt").exists() : "should not be here because destinationFile was specified";
+ assert !new File(DEPLOY_DIR, "test2.txt").exists() : "should not be here because destinationFile was specified";
+ assert new File(DEPLOY_DIR, "test.zip").exists() : "missing unexploded zip file";
+ assert new File(DEPLOY_DIR, "test-replace.zip").exists() : "missing unexploded zip file";
+ assert !new File(DEPLOY_DIR, "test-explode.zip").exists() : "should have been exploded";
+
+ // test that the file in the zip is realized
+ final String[] templateVarValue = new String[] { null };
+ ZipUtil.walkZipFile(new File(DEPLOY_DIR, "test-replace.zip"), new ZipUtil.ZipEntryVisitor() {
+ @Override
+ public boolean visit(ZipEntry entry, ZipInputStream stream) throws Exception {
+ if (entry.getName().equals("template.txt")) {
+ Properties props = new Properties();
+ props.load(stream);
+ templateVarValue[0] = props.getProperty("X");
+ }
+ return true;
+ }
+ });
+ assert templateVarValue[0] != null && templateVarValue[0].equals("9876") : templateVarValue[0];
+
+ // test that our raw file was realized
+ File realizedFile = new File(DEPLOY_DIR, "second.dir/test2.txt");
+ Properties props = new Properties();
+ FileInputStream inStream = new FileInputStream(realizedFile);
+ try {
+ props.load(inStream);
+ assert props.getProperty("X", "<unset>").equals("9876");
+ } finally {
+ inStream.close();
+ }
+ } finally {
+ FileUtil.purge(tmpUrlLocation, true);
+ if (downloadedFiles != null) {
+ for (File doomed : downloadedFiles) {
+ doomed.delete();
+ }
+ }
+ }
+ }
+
private List<BuildListener> createBuildListeners() {
List<BuildListener> buildListeners = new ArrayList<BuildListener>();
DefaultLogger logger = new DefaultLogger();
diff --git a/modules/common/ant-bundle/src/test/resources/test-bundle-url-input.properties b/modules/common/ant-bundle/src/test/resources/test-bundle-url-input.properties
new file mode 100644
index 0000000..6f7b9ba
--- /dev/null
+++ b/modules/common/ant-bundle/src/test/resources/test-bundle-url-input.properties
@@ -0,0 +1 @@
+X=9876
diff --git a/modules/common/ant-bundle/src/test/resources/test-bundle-url.xml b/modules/common/ant-bundle/src/test/resources/test-bundle-url.xml
new file mode 100644
index 0000000..ebfdd81
--- /dev/null
+++ b/modules/common/ant-bundle/src/test/resources/test-bundle-url.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<project name="test-bundle" default="main" xmlns:rhq="antlib:org.rhq.bundle">
+
+ <rhq:bundle name="test" version="1">
+
+ <rhq:input-property name="X" />
+
+ <rhq:deployment-unit name="appserver">
+ <rhq:url-file url="${rhq.test.url.dir}/subdir/test0.txt" replace="false" />
+ <rhq:url-file url="${rhq.test.url.dir}/subdir/test1.txt" destinationFile="another/foo.txt" replace="false" />
+ <rhq:url-file url="${rhq.test.url.dir}/subdir/test2.txt" destinationDir="second.dir" replace="true" />
+ <rhq:url-archive url="${rhq.test.url.dir}/subdir/test.zip" exploded="false" />
+ <rhq:url-archive url="${rhq.test.url.dir}/subdir/test-explode.zip" exploded="true" />
+ <rhq:url-archive url="${rhq.test.url.dir}/subdir/test-replace.zip" exploded="false">
+ <rhq:replace>
+ <rhq:fileset includes="template.txt"/>
+ </rhq:replace>
+ </rhq:url-archive>
+ </rhq:deployment-unit>
+
+ </rhq:bundle>
+
+ <target name="main"/>
+
+</project>
\ No newline at end of file
diff --git a/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java b/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java
index 07fcad5..82354b6 100644
--- a/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java
+++ b/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java
@@ -106,7 +106,7 @@ public class AntBundleServerPluginComponent implements ServerPluginComponent, Bu
// parse, but do not execute, the Ant script
AntLauncher antLauncher = new AntLauncher();
- BundleAntProject project = antLauncher.parseBundleDeployFile(recipeFile);
+ BundleAntProject project = antLauncher.parseBundleDeployFile(recipeFile, null);
// obtain the parse results
deploymentProps = new DeploymentProperties(0, project.getBundleName(), project.getBundleVersion(), project
commit 33f4acf7c1b1c118bc0e3996cb6f573ac0e636c2
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Dec 23 14:40:47 2010 -0500
move the auditLog method over to the project so both our tasks and types can use it
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java
index a80e61e..6fab4ba 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java
@@ -23,6 +23,7 @@
package org.rhq.bundle.ant;
import java.io.File;
+import java.util.Date;
import java.util.HashSet;
import java.util.Set;
@@ -42,11 +43,18 @@ import org.rhq.core.util.updater.DeployDifferences;
* This project object is to be used by either the bundle {@link AntLauncher} or custom
* bundle Ant tasks. The launcher or tasks can inform this project object of things that
* are happening as the Ant script is being parsed and/or executed.
+ *
+ * Also provides a common method for any task to invoke to send an audit message.
*
* @author John Mazzitelli
* @author Ian Springer
*/
public class BundleAntProject extends Project {
+ // these statuses should match those of see BundleResourceDeploymentHistory.Status
+ public enum AuditStatus {
+ SUCCESS, FAILURE, WARN
+ };
+
// Bundle-level attributes
private boolean parseOnly;
@@ -153,4 +161,37 @@ public class BundleAntProject extends Project {
public boolean isDryRun() {
return dryRun;
}
+
+ /**
+ * Logs a message in a format that our audit task/agent-side audit log listener knows about.
+ * When running in the agent, this audit log will be sent to the server.
+ * It is always logged at part of the normal Ant logger mechanism.
+ *
+ * @param status SUCCESS, FAILURE or WARN
+ * @param action audit action, a short summary easily displayed (e.g "File Download")
+ * @param info information about the action target, easily displayed (e.g. "myfile.zip")
+ * @param message Optional, brief (one or two lines) information message
+ * @param details Optional, verbose data, such as full file text or long error messages/stack traces
+ */
+ public void auditLog(AuditStatus status, String action, String info, String message, String details) {
+ if (status == null) {
+ status = AuditStatus.SUCCESS;
+ }
+
+ // this will log a message with a very specific format that is understood
+ // by the agent-side build listener's messageLogged method:
+ // org.rhq.plugins.ant.DeploymentAuditorBuildListener.messageLogged(BuildEvent)
+ // RHQ_AUDIT_MESSAGE___<status>___<action>___<info>___<message>___<details>
+ StringBuilder str = new StringBuilder("RHQ_AUDIT_MESSAGE___");
+ str.append(status.name());
+ str.append("___");
+ str.append((action != null) ? action : "Audit Message");
+ str.append("___");
+ str.append((info != null) ? info : "Timestamp: " + new Date().toString());
+ str.append("___");
+ str.append((message != null) ? message : "");
+ str.append("___");
+ str.append((details != null) ? details : "");
+ this.log(str.toString(), Project.MSG_INFO);
+ }
}
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AbstractBundleTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AbstractBundleTask.java
index a95724a..f6d819a 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AbstractBundleTask.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AbstractBundleTask.java
@@ -18,9 +18,6 @@
*/
package org.rhq.bundle.ant.task;
-import java.util.Date;
-
-import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.rhq.bundle.ant.BundleAntProject;
@@ -33,15 +30,9 @@ import org.rhq.bundle.ant.BundleAntProject;
* As new tasks are created by extending this task object, developers must make sure
* they add the new tasks to the bundle-ant-tasks.properties file.
*
- * Also provides a common method for any task to invoke to send an audit message.
- *
* @author John Mazzitelli
*/
public abstract class AbstractBundleTask extends Task {
- // these statuses should match those of see BundleResourceDeploymentHistory.Status
- enum AuditStatus {
- SUCCESS, FAILURE, WARN
- };
/**
* Returns the specific {@link BundleAntProject} object that is invoking this task.
@@ -54,37 +45,4 @@ public abstract class AbstractBundleTask extends Task {
public BundleAntProject getProject() {
return (BundleAntProject) super.getProject();
}
-
- /**
- * Logs a message in a format that our audit task/agent-side audit log listener knows about.
- * When running in the agent, this audit log will be sent to the server.
- * It is always logged at part of the normal Ant logger mechanism.
- *
- * @param status SUCCESS, FAILURE or WARN
- * @param action audit action, a short summary easily displayed (e.g "File Download")
- * @param info information about the action target, easily displayed (e.g. "myfile.zip")
- * @param message Optional, brief (one or two lines) information message
- * @param details Optional, verbose data, such as full file text or long error messages/stack traces
- */
- protected void auditLog(AuditStatus status, String action, String info, String message, String details) {
- if (status == null) {
- status = AuditStatus.SUCCESS;
- }
-
- // this will log a message with a very specific format that is understood
- // by the agent-side build listener's messageLogged method:
- // org.rhq.plugins.ant.DeploymentAuditorBuildListener.messageLogged(BuildEvent)
- // RHQ_AUDIT_MESSAGE___<status>___<action>___<info>___<message>___<details>
- StringBuilder str = new StringBuilder("RHQ_AUDIT_MESSAGE___");
- str.append(status.name());
- str.append("___");
- str.append((action != null) ? action : "Audit Message");
- str.append("___");
- str.append((info != null) ? info : "Timestamp: " + new Date().toString());
- str.append("___");
- str.append((message != null) ? message : "");
- str.append("___");
- str.append((details != null) ? details : "");
- getProject().log(str.toString(), Project.MSG_INFO);
- }
}
\ No newline at end of file
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AuditTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AuditTask.java
index a74b77c..19f284b 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AuditTask.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AuditTask.java
@@ -20,6 +20,8 @@ package org.rhq.bundle.ant.task;
import org.apache.tools.ant.BuildException;
+import org.rhq.bundle.ant.BundleAntProject.AuditStatus;
+
/**
* The rhq:audit task is a way recipe authors can add their own audit messages to the stream
* of audit messages that the server gets to see how the progress went with the provisioning of a bundle.
@@ -44,7 +46,7 @@ public class AuditTask extends AbstractBundleTask {
@Override
public void execute() throws BuildException {
- auditLog(status, action, info, message, details);
+ getProject().auditLog(status, action, info, message, details);
}
public AuditStatus getStatus() {
commit da2d86a9cc49ac57c5a0caa91b3339b8cb89d24c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Dec 23 14:25:47 2010 -0500
pull up the audit code so all tasks can emit audit messages (on the agent, this sends them to the server)
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AbstractBundleTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AbstractBundleTask.java
index eabad70..a95724a 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AbstractBundleTask.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AbstractBundleTask.java
@@ -18,6 +18,9 @@
*/
package org.rhq.bundle.ant.task;
+import java.util.Date;
+
+import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.rhq.bundle.ant.BundleAntProject;
@@ -29,10 +32,17 @@ import org.rhq.bundle.ant.BundleAntProject;
*
* As new tasks are created by extending this task object, developers must make sure
* they add the new tasks to the bundle-ant-tasks.properties file.
- *
+ *
+ * Also provides a common method for any task to invoke to send an audit message.
+ *
* @author John Mazzitelli
*/
public abstract class AbstractBundleTask extends Task {
+ // these statuses should match those of see BundleResourceDeploymentHistory.Status
+ enum AuditStatus {
+ SUCCESS, FAILURE, WARN
+ };
+
/**
* Returns the specific {@link BundleAntProject} object that is invoking this task.
* This task can call methods on the returned project object to inform the project
@@ -44,4 +54,37 @@ public abstract class AbstractBundleTask extends Task {
public BundleAntProject getProject() {
return (BundleAntProject) super.getProject();
}
+
+ /**
+ * Logs a message in a format that our audit task/agent-side audit log listener knows about.
+ * When running in the agent, this audit log will be sent to the server.
+ * It is always logged at part of the normal Ant logger mechanism.
+ *
+ * @param status SUCCESS, FAILURE or WARN
+ * @param action audit action, a short summary easily displayed (e.g "File Download")
+ * @param info information about the action target, easily displayed (e.g. "myfile.zip")
+ * @param message Optional, brief (one or two lines) information message
+ * @param details Optional, verbose data, such as full file text or long error messages/stack traces
+ */
+ protected void auditLog(AuditStatus status, String action, String info, String message, String details) {
+ if (status == null) {
+ status = AuditStatus.SUCCESS;
+ }
+
+ // this will log a message with a very specific format that is understood
+ // by the agent-side build listener's messageLogged method:
+ // org.rhq.plugins.ant.DeploymentAuditorBuildListener.messageLogged(BuildEvent)
+ // RHQ_AUDIT_MESSAGE___<status>___<action>___<info>___<message>___<details>
+ StringBuilder str = new StringBuilder("RHQ_AUDIT_MESSAGE___");
+ str.append(status.name());
+ str.append("___");
+ str.append((action != null) ? action : "Audit Message");
+ str.append("___");
+ str.append((info != null) ? info : "Timestamp: " + new Date().toString());
+ str.append("___");
+ str.append((message != null) ? message : "");
+ str.append("___");
+ str.append((details != null) ? details : "");
+ getProject().log(str.toString(), Project.MSG_INFO);
+ }
}
\ No newline at end of file
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AuditTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AuditTask.java
index af0e60b..a74b77c 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AuditTask.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/AuditTask.java
@@ -18,10 +18,7 @@
*/
package org.rhq.bundle.ant.task;
-import java.util.Date;
-
import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
/**
* The rhq:audit task is a way recipe authors can add their own audit messages to the stream
@@ -34,7 +31,7 @@ import org.apache.tools.ant.Project;
* @author John Mazzitelli
*/
public class AuditTask extends AbstractBundleTask {
- private String status = "SUCCESS"; // must match one of SUCCESS, WARN, or FAILURE (see BundleResourceDeploymentHistory.Status)
+ private AuditStatus status = AuditStatus.SUCCESS; // see BundleResourceDeploymentHistory.Status
private String action = null;
private String info = null;
private String message = "";
@@ -43,34 +40,27 @@ public class AuditTask extends AbstractBundleTask {
@Override
public void maybeConfigure() throws BuildException {
super.maybeConfigure(); // inits the attribute fields
- validateAttributes();
}
@Override
public void execute() throws BuildException {
- // this will log a message with a very specific format that is understood
- // by the agent-side build listener's messageLogged method:
- // org.rhq.plugins.ant.DeploymentAuditorBuildListener.messageLogged(BuildEvent)
- // RHQ_AUDIT_MESSAGE___<status>___<action>___<info>___<message>___<details>
- StringBuilder str = new StringBuilder("RHQ_AUDIT_MESSAGE___");
- str.append(this.status);
- str.append("___");
- str.append((this.action != null) ? this.action : "Audit Message");
- str.append("___");
- str.append((this.info != null) ? this.info : "Timestamp: " + new Date().toString());
- str.append("___");
- str.append(this.message);
- str.append("___");
- str.append(this.details);
- getProject().log(str.toString(), Project.MSG_INFO);
+ auditLog(status, action, info, message, details);
}
- public String getStatus() {
+ public AuditStatus getStatus() {
return status;
}
public void setStatus(String status) {
- this.status = status;
+ if (this.status == null) {
+ this.status = AuditStatus.SUCCESS;
+ } else {
+ try {
+ this.status = AuditStatus.valueOf(status.toUpperCase());
+ } catch (Exception e) {
+ throw new BuildException("The 'status' attribute must be either 'SUCCESS', 'WARN' or 'FAILURE'");
+ }
+ }
}
public String getAction() {
@@ -106,15 +96,4 @@ public class AuditTask extends AbstractBundleTask {
this.details += getProject().replaceProperties(msg);
}
}
-
- protected void validateAttributes() throws BuildException {
- if (this.status == null) {
- this.status = "SUCCESS";
- } else if (!this.status.equalsIgnoreCase("SUCCESS") && !this.status.equalsIgnoreCase("FAILURE")
- && !this.status.equalsIgnoreCase("WARN")) {
- throw new BuildException("The 'result' attribute must be either 'SUCCESS', 'WARN' or 'FAILURE'");
- }
- this.status = this.status.toUpperCase();
- }
-
}
\ No newline at end of file
12 years, 11 months
[rhq] modules/enterprise
by Joseph Marques
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit b89e87b60e77452da15d66459f9d752ee7c63e84
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Dec 23 13:42:38 2010 -0500
revert method signature
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java
index 5858d84..3072708 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java
@@ -37,7 +37,7 @@ public class AlertGWTServiceImpl extends AbstractGWTServiceImpl implements Alert
private AlertManagerLocal alertManager = LookupUtil.getAlertManager();
- public PageList<Alert> findAlertsByCriteria(AlertCriteria criteria) throws Exception {
+ public PageList<Alert> findAlertsByCriteria(AlertCriteria criteria) throws RuntimeException {
try {
return SerialUtility.prepare(this.alertManager.findAlertsByCriteria(getSessionSubject(), criteria),
"AlertService.findAlertsByCriteria");
@@ -46,7 +46,7 @@ public class AlertGWTServiceImpl extends AbstractGWTServiceImpl implements Alert
}
}
- public int deleteAlerts(int[] alertIds) throws Exception {
+ public int deleteAlerts(int[] alertIds) throws RuntimeException {
try {
return this.alertManager.deleteAlerts(getSessionSubject(), alertIds);
} catch (Throwable t) {
@@ -54,7 +54,7 @@ public class AlertGWTServiceImpl extends AbstractGWTServiceImpl implements Alert
}
}
- public int deleteAlertsByContext(EntityContext context) throws Exception {
+ public int deleteAlertsByContext(EntityContext context) throws RuntimeException {
try {
return this.alertManager.deleteAlertsByContext(getSessionSubject(), context);
} catch (Throwable t) {
@@ -62,7 +62,7 @@ public class AlertGWTServiceImpl extends AbstractGWTServiceImpl implements Alert
}
}
- public int acknowledgeAlerts(int[] alertIds) throws Exception {
+ public int acknowledgeAlerts(int[] alertIds) throws RuntimeException {
try {
return this.alertManager.acknowledgeAlerts(getSessionSubject(), alertIds);
} catch (Throwable t) {
@@ -70,7 +70,7 @@ public class AlertGWTServiceImpl extends AbstractGWTServiceImpl implements Alert
}
}
- public int acknowledgeAlertsByContext(EntityContext context) throws Exception {
+ public int acknowledgeAlertsByContext(EntityContext context) throws RuntimeException {
try {
return this.alertManager.acknowledgeAlertsByContext(getSessionSubject(), context);
} catch (Throwable t) {
12 years, 11 months
[rhq] 6 commits - modules/enterprise
by Joseph Marques
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 21 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java | 16 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertGWTService.java | 10 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertTemplateGWTService.java | 9 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AuthorizationGWTService.java | 10 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AvailabilityGWTService.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java | 49 ++++----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java | 11 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java | 47 +++++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java | 8 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DashboardGWTService.java | 11 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/EventGWTService.java | 15 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GroupAlertDefinitionGWTService.java | 11 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/LdapGWTService.java | 10 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java | 52 +++++----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/OperationGWTService.java | 22 ++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java | 14 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RepoGWTService.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceBossGWTService.java | 7 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java | 37 +++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java | 33 +++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceTypeGWTService.java | 10 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java | 14 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java | 13 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SubjectGWTService.java | 25 +---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java | 22 +--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupCompositeDataSource.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java | 6 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java | 6 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/inventory/TestSearchBarView.java | 19 ---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/Message.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java | 56 ++++------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java | 10 -
modules/enterprise/gui/coregui/src/main/webapp/images/info/icn_info_blank.png |binary
38 files changed, 309 insertions(+), 279 deletions(-)
New commits:
commit 77e1b14f5f782fbd44e5a738d4581a26ec64513b
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Dec 23 12:59:58 2010 -0500
test out suppression of table header for those with search bars
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index fcc5909..78fb5db 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
@@ -432,6 +432,7 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
}
public void setFilterFormItems(FormItem... formItems) {
+ setShowHeader(false);
this.filterForm.setItems(formItems);
}
commit 264e845a22ba36bdaa62f4d21f0237b15219dcaa
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Dec 23 12:52:26 2010 -0500
declare services to throw exceptions so they are properly gwt-serialized
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java
index 05b813f..f79fa9d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertDefinitionGWTService.java
@@ -30,20 +30,20 @@ public interface AlertDefinitionGWTService extends RemoteService {
PageList<AlertDefinition> findAlertDefinitionsByCriteria(AlertDefinitionCriteria criteria);
- int createAlertDefinition(AlertDefinition alertDefinition, Integer resourceId) throws Exception;
+ int createAlertDefinition(AlertDefinition alertDefinition, Integer resourceId) throws RuntimeException;
AlertDefinition updateAlertDefinition(int alertDefinitionId, AlertDefinition alertDefinition,
- boolean updateInternals) throws Exception;
+ boolean updateInternals) throws RuntimeException;
- int enableAlertDefinitions(int[] alertDefinitionIds) throws Exception;
+ int enableAlertDefinitions(int[] alertDefinitionIds) throws RuntimeException;
- int disableAlertDefinitions(int[] alertDefinitionIds) throws Exception;
+ int disableAlertDefinitions(int[] alertDefinitionIds) throws RuntimeException;
- int removeAlertDefinitions(int[] alertDefinitionIds) throws Exception;
+ int removeAlertDefinitions(int[] alertDefinitionIds) throws RuntimeException;
- String[] getAlertNotificationConfigurationPreview(AlertNotification[] notifs) throws Exception;
+ String[] getAlertNotificationConfigurationPreview(AlertNotification[] notifs) throws RuntimeException;
- String[] getAllAlertSenders() throws Exception;
+ String[] getAllAlertSenders() throws RuntimeException;
- ConfigurationDefinition getConfigurationDefinitionForSender(String sender) throws Exception;
+ ConfigurationDefinition getConfigurationDefinitionForSender(String sender) throws RuntimeException;
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertGWTService.java
index a8fd51a..8cbd431 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertGWTService.java
@@ -37,7 +37,7 @@ public interface AlertGWTService extends RemoteService {
*
* @return all alerts that match the specified criteria
*/
- PageList<Alert> findAlertsByCriteria(AlertCriteria criteria);
+ PageList<Alert> findAlertsByCriteria(AlertCriteria criteria) throws RuntimeException;
/**
* Delete the alerts with the specified ids if the current user has permission to do so (i.e. either
@@ -50,7 +50,7 @@ public interface AlertGWTService extends RemoteService {
* @param alertIds the ids of the alerts to be deleted
* @return the number of alerts deleted
*/
- int deleteAlerts(int[] alertIds);
+ int deleteAlerts(int[] alertIds) throws RuntimeException;
/**
* Deletes all alerts for the given context if the current user has permission to do so (i.e., either
@@ -62,7 +62,7 @@ public interface AlertGWTService extends RemoteService {
* the user
* @return the number of alerts deleted
*/
- int deleteAlertsByContext(EntityContext context);
+ int deleteAlertsByContext(EntityContext context) throws RuntimeException;
/**
* Acknowledges the alerts with the specified ids if the current user has permission to do so (i.e., either
@@ -75,7 +75,7 @@ public interface AlertGWTService extends RemoteService {
* @param alertIds the ids of the alerts to be acknowledged
* @return the number of alerts acknowledged
*/
- int acknowledgeAlerts(int[] alertIds);
+ int acknowledgeAlerts(int[] alertIds) throws RuntimeException;
/**
* Acknowledges all alerts for the given context if the current user has permission to do so (i.e., either
@@ -87,5 +87,5 @@ public interface AlertGWTService extends RemoteService {
* the user
* @return the number of alerts acknowledged
*/
- int acknowledgeAlertsByContext(EntityContext context);
+ int acknowledgeAlertsByContext(EntityContext context) throws RuntimeException;
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertTemplateGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertTemplateGWTService.java
index da8bf55..9f079cb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertTemplateGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AlertTemplateGWTService.java
@@ -34,11 +34,12 @@ public interface AlertTemplateGWTService extends RemoteService {
* @return the updated definition
* @throws Exception
*/
- AlertDefinition updateAlertTemplate(AlertDefinition alertDefinition, boolean purgeInternals) throws Exception;
+ AlertDefinition updateAlertTemplate(AlertDefinition alertDefinition, boolean purgeInternals)
+ throws RuntimeException;
- void enableAlertTemplates(Integer[] alertDefinitionIds) throws Exception;
+ void enableAlertTemplates(Integer[] alertDefinitionIds) throws RuntimeException;
- void disableAlertTemplates(Integer[] alertDefinitionIds) throws Exception;
+ void disableAlertTemplates(Integer[] alertDefinitionIds) throws RuntimeException;
- void removeAlertTemplates(Integer[] alertDefinitionIds) throws Exception;
+ void removeAlertTemplates(Integer[] alertDefinitionIds) throws RuntimeException;
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AuthorizationGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AuthorizationGWTService.java
index 13b5572..249a655 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AuthorizationGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AuthorizationGWTService.java
@@ -36,7 +36,7 @@ public interface AuthorizationGWTService extends RemoteService {
*
* @return the set of permissions that the current user possesses for the specified {@link org.rhq.core.domain.resource.Resource} - never null
*/
- Set<Permission> getExplicitResourcePermissions(int resourceId);
+ Set<Permission> getExplicitResourcePermissions(int resourceId) throws RuntimeException;
/**
* Gets the set of permissions that the current user implicitly possesses for the specified {@link org.rhq.core.domain.resource.Resource}.
@@ -45,7 +45,7 @@ public interface AuthorizationGWTService extends RemoteService {
*
* @return the set of permissions that the current user implicitly possesses for the specified {@link org.rhq.core.domain.resource.Resource} - never null
*/
- Set<Permission> getImplicitResourcePermissions(int resourceId);
+ Set<Permission> getImplicitResourcePermissions(int resourceId) throws RuntimeException;
/**
* Gets the set of permissions that the current user explicitly possesses for the specified {@link org.rhq.core.domain.resource.group.Group}.
@@ -54,7 +54,7 @@ public interface AuthorizationGWTService extends RemoteService {
*
* @return the set of permissions that the current user explicitly possesses for the specified {@link org.rhq.core.domain.resource.group.Group} - never null
*/
- Set<Permission> getExplicitGroupPermissions(int groupId);
+ Set<Permission> getExplicitGroupPermissions(int groupId) throws RuntimeException;
/**
* Gets the set of permissions that the current user implicitly possesses for the specified {@link org.rhq.core.domain.resource.group.Group}.
@@ -63,13 +63,13 @@ public interface AuthorizationGWTService extends RemoteService {
*
* @return the set of permissions that the current user implicitly possesses for the specified {@link org.rhq.core.domain.resource.group.Group}
*/
- Set<Permission> getImplicitGroupPermissions(int groupId);
+ Set<Permission> getImplicitGroupPermissions(int groupId) throws RuntimeException;
/**
* Gets the set of global permissions that the current user explicitly possesses.
*
* @return the set of global permissions that the current user possesses - never null
*/
- Set<Permission> getExplicitGlobalPermissions();
+ Set<Permission> getExplicitGlobalPermissions() throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AvailabilityGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AvailabilityGWTService.java
index fcb5a29..f657b9d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AvailabilityGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/AvailabilityGWTService.java
@@ -20,7 +20,6 @@ package org.rhq.enterprise.gui.coregui.client.gwt;
import com.google.gwt.user.client.rpc.RemoteService;
-import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.measurement.Availability;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
@@ -30,7 +29,6 @@ import org.rhq.core.domain.util.PageList;
*/
public interface AvailabilityGWTService extends RemoteService {
-
- PageList<Availability> findAvailabilityForResource(int resourceId, PageControl pc);
+ PageList<Availability> findAvailabilityForResource(int resourceId, PageControl pc) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java
index 0f58c44..4c7b209 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/BundleGWTService.java
@@ -42,53 +42,58 @@ import org.rhq.core.domain.util.PageList;
public interface BundleGWTService extends RemoteService {
- BundleVersion createBundleVersion(int bundleId, String name, String version, String recipe) throws Exception;
+ BundleVersion createBundleVersion(int bundleId, String name, String version, String recipe) throws RuntimeException;
- BundleVersion createBundleVersionViaURL(String url) throws Exception;
+ BundleVersion createBundleVersionViaURL(String url) throws RuntimeException;
- BundleVersion createBundleVersionViaRecipe(String recipe) throws Exception;
+ BundleVersion createBundleVersionViaRecipe(String recipe) throws RuntimeException;
BundleDeployment createBundleDeployment(int bundleVersionId, int bundleDestinationId, String description,
Configuration configuration, boolean enforcePolicy, int enforcementInterval, boolean pinToBundle)
- throws Exception;
+ throws RuntimeException;
BundleDestination createBundleDestination(int bundleId, String name, String description, String deployDir,
- int groupId) throws Exception;
+ int groupId) throws RuntimeException;
- void deleteBundles(int[] bundleIds) throws Exception;
+ void deleteBundles(int[] bundleIds) throws RuntimeException;
- void deleteBundle(int bundleId) throws Exception;
+ void deleteBundle(int bundleId) throws RuntimeException;
- void deleteBundleDeployment(int bundleDeploymentId) throws Exception;
+ void deleteBundleDeployment(int bundleDeploymentId) throws RuntimeException;
- void deleteBundleDestination(int bundleDestinationId) throws Exception;
+ void deleteBundleDestination(int bundleDestinationId) throws RuntimeException;
- void deleteBundleVersion(int bundleVersionId, boolean deleteBundleIfEmpty) throws Exception;
+ void deleteBundleVersion(int bundleVersionId, boolean deleteBundleIfEmpty) throws RuntimeException;
- PageList<Bundle> findBundlesByCriteria(BundleCriteria criteria) throws Exception;
+ PageList<Bundle> findBundlesByCriteria(BundleCriteria criteria) throws RuntimeException;
- PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria);
+ PageList<BundleDeployment> findBundleDeploymentsByCriteria(BundleDeploymentCriteria criteria)
+ throws RuntimeException;
- PageList<BundleDestination> findBundleDestinationsByCriteria(BundleDestinationCriteria criteria);
+ PageList<BundleDestination> findBundleDestinationsByCriteria(BundleDestinationCriteria criteria)
+ throws RuntimeException;
- PageList<BundleFile> findBundleFilesByCriteria(BundleFileCriteria criteria);
+ PageList<BundleFile> findBundleFilesByCriteria(BundleFileCriteria criteria) throws RuntimeException;
- PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(BundleResourceDeploymentCriteria criteria);
+ PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(BundleResourceDeploymentCriteria criteria)
+ throws RuntimeException;
- PageList<BundleVersion> findBundleVersionsByCriteria(BundleVersionCriteria criteria) throws Exception;
+ PageList<BundleVersion> findBundleVersionsByCriteria(BundleVersionCriteria criteria) throws RuntimeException;
PageList<BundleWithLatestVersionComposite> findBundlesWithLatestVersionCompositesByCriteria(BundleCriteria criteria)
- throws Exception;
+ throws RuntimeException;
- HashMap<String, Boolean> getAllBundleVersionFilenames(int bundleVersionId) throws Exception;
+ HashMap<String, Boolean> getAllBundleVersionFilenames(int bundleVersionId) throws RuntimeException;
- ArrayList<BundleType> getAllBundleTypes() throws Exception;
+ ArrayList<BundleType> getAllBundleTypes() throws RuntimeException;
- String getBundleDeploymentName(int bundleDestinationId, int bundleVersionId, int prevDeploymentId);
+ String getBundleDeploymentName(int bundleDestinationId, int bundleVersionId, int prevDeploymentId)
+ throws RuntimeException;
- BundleDeployment scheduleBundleDeployment(int bundleDeploymentId, boolean isCleanDeployment) throws Exception;
+ BundleDeployment scheduleBundleDeployment(int bundleDeploymentId, boolean isCleanDeployment)
+ throws RuntimeException;
BundleDeployment scheduleRevertBundleDeployment(int bundleDestinationId, String deploymentDescription,
- boolean isCleanDeployment) throws Exception;
+ boolean isCleanDeployment) throws RuntimeException;
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java
index 20d32d5..de16309 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java
@@ -36,7 +36,6 @@ import org.rhq.core.domain.resource.group.composite.ClusterFlyweight;
*/
public interface ClusterGWTService extends RemoteService {
-
/**
* Given a cluster key create a backing group.
* @param clusterKey
@@ -44,7 +43,7 @@ public interface ClusterGWTService extends RemoteService {
* Otherwise no resources will be assigned to the new group.
* @throws IllegalArgumentException if a backing group exists for this clusterKey
*/
- ResourceGroup createAutoClusterBackingGroup(ClusterKey clusterKey, boolean addResources);
+ ResourceGroup createAutoClusterBackingGroup(ClusterKey clusterKey, boolean addResources) throws RuntimeException;
/**
* Return the backing group for the supplied cluster key. Resource membership will represent the resources
@@ -52,17 +51,15 @@ public interface ClusterGWTService extends RemoteService {
* @param clusterKey
* @return The backing group, or null if the key does not have a backing group.
*/
- ResourceGroup getAutoClusterBackingGroup(ClusterKey clusterKey);
+ ResourceGroup getAutoClusterBackingGroup(ClusterKey clusterKey) throws RuntimeException;
/**
* Given a cluster key get the auto cluster resource membership. The membership is always determined
* at call time, regardless of whether a backing group exists. To get the backing group, if it exists,
* for a cluster key then call {@link #getAutoClusterBackingGroup(String)}.
*/
- List<Resource> getAutoClusterResources(ClusterKey clusterKey);
-
-
- ClusterFlyweight getClusterTree(int groupId);
+ List<Resource> getAutoClusterResources(ClusterKey clusterKey) throws RuntimeException;
+ ClusterFlyweight getClusterTree(int groupId) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java
index 5b8c09f..b0ca09b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java
@@ -25,46 +25,55 @@ import org.rhq.core.domain.util.PageList;
*/
@RemoteServiceRelativePath("ConfigurationGWTService")
public interface ConfigurationGWTService extends RemoteService {
- Configuration getPluginConfiguration(int resourceId);
+ Configuration getPluginConfiguration(int resourceId) throws RuntimeException;
- ConfigurationDefinition getPluginConfigurationDefinition(int resourceTypeId);
+ ConfigurationDefinition getPluginConfigurationDefinition(int resourceTypeId) throws RuntimeException;
- Configuration getResourceConfiguration(int resourceId);
+ Configuration getResourceConfiguration(int resourceId) throws RuntimeException;
- ConfigurationDefinition getResourceConfigurationDefinition(int resourceTypeId);
+ ConfigurationDefinition getResourceConfigurationDefinition(int resourceTypeId) throws RuntimeException;
PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates(Integer resourceId, Long beginDate,
- Long endDate, boolean suppressOldest, PageControl pc);
+ Long endDate, boolean suppressOldest, PageControl pc) throws RuntimeException;
- ResourceConfigurationUpdate updateResourceConfiguration(int resourceId, Configuration configuration);
+ ResourceConfigurationUpdate updateResourceConfiguration(int resourceId, Configuration configuration)
+ throws RuntimeException;
- PluginConfigurationUpdate updatePluginConfiguration(int resourceId, Configuration configuration);
+ PluginConfigurationUpdate updatePluginConfiguration(int resourceId, Configuration configuration)
+ throws RuntimeException;
PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdatesByCriteria(
- ResourceConfigurationUpdateCriteria criteria);
+ ResourceConfigurationUpdateCriteria criteria) throws RuntimeException;
PageList<PluginConfigurationUpdate> findPluginConfigurationUpdatesByCriteria(
- PluginConfigurationUpdateCriteria criteria);
+ PluginConfigurationUpdateCriteria criteria) throws RuntimeException;
PageList<GroupResourceConfigurationUpdate> findGroupResourceConfigurationUpdatesByCriteria(
- GroupResourceConfigurationUpdateCriteria criteria);
+ GroupResourceConfigurationUpdateCriteria criteria) throws RuntimeException;
PageList<GroupPluginConfigurationUpdate> findGroupPluginConfigurationUpdatesByCriteria(
- GroupPluginConfigurationUpdateCriteria criteria);
+ GroupPluginConfigurationUpdateCriteria criteria) throws RuntimeException;
- List<DisambiguationReport<ResourceConfigurationComposite>> findResourceConfigurationsForGroup(int groupId);
+ List<DisambiguationReport<ResourceConfigurationComposite>> findResourceConfigurationsForGroup(int groupId)
+ throws RuntimeException;
- List<DisambiguationReport<ResourceConfigurationComposite>> findPluginConfigurationsForGroup(int groupId);
+ List<DisambiguationReport<ResourceConfigurationComposite>> findPluginConfigurationsForGroup(int groupId)
+ throws RuntimeException;
- List<DisambiguationReport<ResourceConfigurationComposite>> findPluginConfigurationsForGroupUpdate(int groupUpdateId);
+ List<DisambiguationReport<ResourceConfigurationComposite>> findPluginConfigurationsForGroupUpdate(int groupUpdateId)
+ throws RuntimeException;
- void updateResourceConfigurationsForGroup(int groupId, List<ResourceConfigurationComposite> resourceConfigurations);
+ void updateResourceConfigurationsForGroup(int groupId, List<ResourceConfigurationComposite> resourceConfigurations)
+ throws RuntimeException;
- void updatePluginConfigurationsForGroup(int groupId, List<ResourceConfigurationComposite> pluginConfigurations);
+ void updatePluginConfigurationsForGroup(int groupId, List<ResourceConfigurationComposite> pluginConfigurations)
+ throws RuntimeException;
- void deleteGroupPluginConfigurationUpdate(Integer groupId, Integer[] groupPluginConfigUpdateIds);
+ void deleteGroupPluginConfigurationUpdate(Integer groupId, Integer[] groupPluginConfigUpdateIds)
+ throws RuntimeException;
- void deleteGroupResourceConfigurationUpdate(Integer groupId, Integer[] groupResourceConfigUpdateIds);
+ void deleteGroupResourceConfigurationUpdate(Integer groupId, Integer[] groupResourceConfigUpdateIds)
+ throws RuntimeException;
- //RawConfiguration dummy(RawConfiguration config);
+ //RawConfiguration dummy(RawConfiguration config) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java
index 9ca5c51..a8da933 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ContentGWTService.java
@@ -37,11 +37,11 @@ import org.rhq.core.domain.util.PageList;
*/
public interface ContentGWTService extends RemoteService {
- void deletePackageVersion(int packageVersionId);
+ void deletePackageVersion(int packageVersionId) throws RuntimeException;
- PageList<PackageVersion> findPackageVersionsByCriteria(PackageVersionCriteria criteria);
+ PageList<PackageVersion> findPackageVersionsByCriteria(PackageVersionCriteria criteria) throws RuntimeException;
- List<Architecture> getArchitectures();
+ List<Architecture> getArchitectures() throws RuntimeException;
- PackageType getResourceCreationPackageType(int resourceTypeId);
+ PackageType getResourceCreationPackageType(int resourceTypeId) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DashboardGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DashboardGWTService.java
index da86756..f56b97a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DashboardGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/DashboardGWTService.java
@@ -26,7 +26,6 @@ import java.util.List;
import com.google.gwt.user.client.rpc.RemoteService;
-import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.dashboard.Dashboard;
/**
@@ -34,14 +33,12 @@ import org.rhq.core.domain.dashboard.Dashboard;
*/
public interface DashboardGWTService extends RemoteService {
+ List<Dashboard> findDashboardsForSubject() throws RuntimeException;
- List<Dashboard> findDashboardsForSubject();
+ List<Dashboard> findSharedDashboards() throws RuntimeException;
- List<Dashboard> findSharedDashboards();
-
- Dashboard storeDashboard(Dashboard dashboard);
-
- void removeDashboard(int dashboardId);
+ Dashboard storeDashboard(Dashboard dashboard) throws RuntimeException;
+ void removeDashboard(int dashboardId) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/EventGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/EventGWTService.java
index 5846d8d..ebe1326 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/EventGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/EventGWTService.java
@@ -39,18 +39,19 @@ import org.rhq.core.domain.util.PageList;
*/
public interface EventGWTService extends RemoteService {
- EventSeverity[] getSeverityBuckets(int resourceId, long begin, long end, int numBuckets);
+ EventSeverity[] getSeverityBuckets(int resourceId, long begin, long end, int numBuckets) throws RuntimeException;
EventSeverity[] getSeverityBucketsForAutoGroup(int parentResourceId, int resourceTypeId, long begin, long end,
- int numBuckets);
+ int numBuckets) throws RuntimeException;
- EventSeverity[] getSeverityBucketsForCompGroup(int resourceGroupId, long begin, long end, int numBuckets);
+ EventSeverity[] getSeverityBucketsForCompGroup(int resourceGroupId, long begin, long end, int numBuckets)
+ throws RuntimeException;
- PageList<Event> findEventsByCriteria(EventCriteria criteria);
+ PageList<Event> findEventsByCriteria(EventCriteria criteria) throws RuntimeException;
- PageList<EventComposite> findEventCompositesByCriteria(EventCriteria criteria);
+ PageList<EventComposite> findEventCompositesByCriteria(EventCriteria criteria) throws RuntimeException;
- int deleteEventsForContext(EntityContext context, List<Integer> eventIds);
+ int deleteEventsForContext(EntityContext context, List<Integer> eventIds) throws RuntimeException;
- int purgeEventsForContext(EntityContext context);
+ int purgeEventsForContext(EntityContext context) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GroupAlertDefinitionGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GroupAlertDefinitionGWTService.java
index ff4299e..55e355d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GroupAlertDefinitionGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GroupAlertDefinitionGWTService.java
@@ -24,7 +24,8 @@ import org.rhq.core.domain.alert.AlertDefinition;
public interface GroupAlertDefinitionGWTService extends RemoteService {
- int createGroupAlertDefinitions(AlertDefinition groupAlertDefinition, Integer resourceGroupId) throws Exception;
+ int createGroupAlertDefinitions(AlertDefinition groupAlertDefinition, Integer resourceGroupId)
+ throws RuntimeException;
/**
* Updates a group alert definition.
@@ -35,11 +36,11 @@ public interface GroupAlertDefinitionGWTService extends RemoteService {
* @throws Exception
*/
AlertDefinition updateGroupAlertDefinitions(AlertDefinition groupAlertDefinition, boolean purgeInternals)
- throws Exception;
+ throws RuntimeException;
- int enableGroupAlertDefinitions(Integer[] groupAlertDefinitionIds) throws Exception;
+ int enableGroupAlertDefinitions(Integer[] groupAlertDefinitionIds) throws RuntimeException;
- int disableGroupAlertDefinitions(Integer[] groupAlertDefinitionIds) throws Exception;
+ int disableGroupAlertDefinitions(Integer[] groupAlertDefinitionIds) throws RuntimeException;
- int removeGroupAlertDefinitions(Integer[] groupAlertDefinitionIds) throws Exception;
+ int removeGroupAlertDefinitions(Integer[] groupAlertDefinitionIds) throws RuntimeException;
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/LdapGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/LdapGWTService.java
index 673f3c7..8356773 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/LdapGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/LdapGWTService.java
@@ -39,12 +39,12 @@ public interface LdapGWTService extends RemoteService {
/**
* @return Map with all LDAP groups available
*/
- Set<Map<String, String>> findAvailableGroups();
+ Set<Map<String, String>> findAvailableGroups() throws RuntimeException;
/**
* @return Map with LDAP details for user passed.
*/
- Map<String, String> getLdapDetailsFor(String user);
+ Map<String, String> getLdapDetailsFor(String user) throws RuntimeException;
/** In setting the LDAP groups for this role, all previous group
* assignments for this role are removed before most up to date
@@ -53,19 +53,19 @@ public interface LdapGWTService extends RemoteService {
* @param roleId
* @param groupIds
*/
- void setLdapGroupsForRole(int roleId, List<String> groupIds);
+ void setLdapGroupsForRole(int roleId, List<String> groupIds) throws RuntimeException;
/** Finds ldap groups already assigned to this role.
*
* @param currentRoleId
* @return
*/
- PageList<LdapGroup> findLdapGroupsAssignedToRole(int currentRoleId);
+ PageList<LdapGroup> findLdapGroupsAssignedToRole(int currentRoleId) throws RuntimeException;
/** Boolean response about whether ldap configured..
*
* @return
*/
- Boolean checkLdapConfiguredStatus();
+ Boolean checkLdapConfiguredStatus() throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
index 4c145b7..0ecd8a4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java
@@ -24,7 +24,6 @@ import java.util.Set;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
-import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria;
import org.rhq.core.domain.criteria.MeasurementDefinitionCriteria;
@@ -47,46 +46,55 @@ import org.rhq.core.domain.util.PageList;
@RemoteServiceRelativePath("MeasurementDataGWTService")
public interface MeasurementDataGWTService extends RemoteService {
- List<MeasurementDataTrait> findCurrentTraitsForResource(int resourceId, DisplayType displayType);
+ List<MeasurementDataTrait> findCurrentTraitsForResource(int resourceId, DisplayType displayType)
+ throws RuntimeException;
- Set<MeasurementData> findLiveData(int resourceId, int[] definitionIds);
+ Set<MeasurementData> findLiveData(int resourceId, int[] definitionIds) throws RuntimeException;
List<List<MeasurementDataNumericHighLowComposite>> findDataForResource(int resourceId, int[] definitionIds,
- long beginTime, long endTime, int numPoints);
+ long beginTime, long endTime, int numPoints) throws RuntimeException;
PageList<CallTimeDataComposite> findCallTimeDataForResource(int scheduleId, long start, long end,
- PageControl pageControl);
+ PageControl pageControl) throws RuntimeException;
- PageList<MeasurementDefinition> findMeasurementDefinitionsByCriteria(MeasurementDefinitionCriteria criteria);
+ PageList<MeasurementDefinition> findMeasurementDefinitionsByCriteria(MeasurementDefinitionCriteria criteria)
+ throws RuntimeException;
- PageList<MeasurementSchedule> findMeasurementSchedulesByCriteria(MeasurementScheduleCriteria criteria);
+ PageList<MeasurementSchedule> findMeasurementSchedulesByCriteria(MeasurementScheduleCriteria criteria)
+ throws RuntimeException;
- PageList<MeasurementScheduleComposite> getMeasurementScheduleCompositesByContext(EntityContext context);
+ PageList<MeasurementScheduleComposite> getMeasurementScheduleCompositesByContext(EntityContext context)
+ throws RuntimeException;
- PageList<MeasurementOOBComposite> getSchedulesWithOOBs(String metricNameFilter,
- String resourceNameFilter, String parentNameFilter, PageControl pc);
+ PageList<MeasurementOOBComposite> getSchedulesWithOOBs(String metricNameFilter, String resourceNameFilter,
+ String parentNameFilter, PageControl pc) throws RuntimeException;
- PageList<MeasurementOOBComposite> getHighestNOOBsForResource(int resourceId, int n);
+ PageList<MeasurementOOBComposite> getHighestNOOBsForResource(int resourceId, int n) throws RuntimeException;
- void enableSchedulesForResource(int resourceId, int[] measurementDefinitionIds);
+ void enableSchedulesForResource(int resourceId, int[] measurementDefinitionIds) throws RuntimeException;
- void disableSchedulesForResource(int resourceId, int[] measurementDefinitionIds);
+ void disableSchedulesForResource(int resourceId, int[] measurementDefinitionIds) throws RuntimeException;
- void updateSchedulesForResource(int resourceId, int[] measurementDefinitionIds, long collectionInterval);
+ void updateSchedulesForResource(int resourceId, int[] measurementDefinitionIds, long collectionInterval)
+ throws RuntimeException;
- void enableSchedulesForCompatibleGroup(int resourceGroupId, int[] measurementDefinitionIds);
+ void enableSchedulesForCompatibleGroup(int resourceGroupId, int[] measurementDefinitionIds) throws RuntimeException;
- void disableSchedulesForCompatibleGroup(int resourceGroupId, int[] measurementDefinitionIds);
+ void disableSchedulesForCompatibleGroup(int resourceGroupId, int[] measurementDefinitionIds)
+ throws RuntimeException;
- void updateSchedulesForCompatibleGroup(int resourceGroupId, int[] measurementDefinitionIds, long collectionInterval);
+ void updateSchedulesForCompatibleGroup(int resourceGroupId, int[] measurementDefinitionIds, long collectionInterval)
+ throws RuntimeException;
- void enableSchedulesForResourceType(int[] measurementDefinitionIds, boolean updateExistingSchedules);
+ void enableSchedulesForResourceType(int[] measurementDefinitionIds, boolean updateExistingSchedules)
+ throws RuntimeException;
- void disableSchedulesForResourceType(int[] measurementDefinitionIds, boolean updateExistingSchedules);
+ void disableSchedulesForResourceType(int[] measurementDefinitionIds, boolean updateExistingSchedules)
+ throws RuntimeException;
void updateSchedulesForResourceType(int[] measurementDefinitionIds, long collectionInterval,
- boolean updateExistingSchedules);
+ boolean updateExistingSchedules) throws RuntimeException;
+
+ PageList<MeasurementDataTrait> findTraitsByCriteria(MeasurementDataTraitCriteria criteria) throws RuntimeException;
- PageList<MeasurementDataTrait> findTraitsByCriteria(MeasurementDataTraitCriteria criteria);
-
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/OperationGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/OperationGWTService.java
index badd227..dd52adc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/OperationGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/OperationGWTService.java
@@ -33,7 +33,6 @@ import org.rhq.core.domain.operation.composite.ResourceOperationLastCompletedCom
import org.rhq.core.domain.operation.composite.ResourceOperationScheduleComposite;
import org.rhq.core.domain.resource.composite.DisambiguationReport;
import org.rhq.core.domain.util.PageList;
-import org.rhq.core.util.exception.ThrowableUtil;
/**
* @author Greg Hinkle
@@ -41,22 +40,25 @@ import org.rhq.core.util.exception.ThrowableUtil;
public interface OperationGWTService extends RemoteService {
PageList<ResourceOperationHistory> findResourceOperationHistoriesByCriteria(
- ResourceOperationHistoryCriteria criteria);
+ ResourceOperationHistoryCriteria criteria) throws RuntimeException;
- PageList<GroupOperationHistory> findGroupOperationHistoriesByCriteria(GroupOperationHistoryCriteria criteria);
+ PageList<GroupOperationHistory> findGroupOperationHistoriesByCriteria(GroupOperationHistoryCriteria criteria)
+ throws RuntimeException;
- List<DisambiguationReport<ResourceOperationLastCompletedComposite>> findRecentCompletedOperations(int pageSize);
+ List<DisambiguationReport<ResourceOperationLastCompletedComposite>> findRecentCompletedOperations(int pageSize)
+ throws RuntimeException;
- List<DisambiguationReport<ResourceOperationScheduleComposite>> findScheduledOperations(int pageSize);
+ List<DisambiguationReport<ResourceOperationScheduleComposite>> findScheduledOperations(int pageSize)
+ throws RuntimeException;
- void invokeResourceOperation(int resourceId, String operationName, Configuration parameters,
- String description, int timeout) throws RuntimeException;
+ void invokeResourceOperation(int resourceId, String operationName, Configuration parameters, String description,
+ int timeout) throws RuntimeException;
- void scheduleResourceOperation(int resourceId, String operationName, Configuration parameters,
- String description, int timeout, String cronString) throws RuntimeException;
+ void scheduleResourceOperation(int resourceId, String operationName, Configuration parameters, String description,
+ int timeout, String cronString) throws RuntimeException;
List<ResourceOperationSchedule> findScheduledResourceOperations(int resourceId) throws RuntimeException;
List<GroupOperationSchedule> findScheduledGroupOperations(int groupId) throws RuntimeException;
-
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java
index bd76bf9..6cd207b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java
@@ -36,17 +36,17 @@ import org.rhq.core.domain.install.remote.RemoteAccessInfo;
public interface RemoteInstallGWTService extends RemoteService {
// --- RemoteInstallManagerRemote
- boolean agentInstallCheck(RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
+ boolean agentInstallCheck(RemoteAccessInfo remoteAccessInfo, String agentInstallPath) throws RuntimeException;
- AgentInstallInfo installAgent(RemoteAccessInfo remoteAccessInfo, String parentPath);
+ AgentInstallInfo installAgent(RemoteAccessInfo remoteAccessInfo, String parentPath) throws RuntimeException;
- String startAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
+ String startAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath) throws RuntimeException;
- String stopAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
+ String stopAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath) throws RuntimeException;
- String agentStatus(RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
+ String agentStatus(RemoteAccessInfo remoteAccessInfo, String agentInstallPath) throws RuntimeException;
- String findAgentInstallPath(RemoteAccessInfo remoteAccessInfo, String parentPath);
+ String findAgentInstallPath(RemoteAccessInfo remoteAccessInfo, String parentPath) throws RuntimeException;
- String[] remotePathDiscover(RemoteAccessInfo remoteAccessInfo, String parentPath);
+ String[] remotePathDiscover(RemoteAccessInfo remoteAccessInfo, String parentPath) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RepoGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RepoGWTService.java
index b8a0a6e..1f52491 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RepoGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RepoGWTService.java
@@ -33,6 +33,6 @@ import org.rhq.core.domain.util.PageList;
*/
public interface RepoGWTService extends RemoteService {
- PageList<Repo> findReposByCriteria(RepoCriteria criteria) throws Exception;
+ PageList<Repo> findReposByCriteria(RepoCriteria criteria) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceBossGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceBossGWTService.java
index a114335..30531ad 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceBossGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceBossGWTService.java
@@ -24,6 +24,7 @@
package org.rhq.enterprise.gui.coregui.client.gwt;
import com.google.gwt.user.client.rpc.RemoteService;
+
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.resource.InventorySummary;
@@ -31,9 +32,9 @@ import org.rhq.core.domain.resource.InventorySummary;
* @author John Sanda
*/
public interface ResourceBossGWTService extends RemoteService {
-
- InventorySummary getInventorySummaryForLoggedInUser();
- InventorySummary getInventorySummary(Subject user);
+ InventorySummary getInventorySummaryForLoggedInUser() throws RuntimeException;
+
+ InventorySummary getInventorySummary(Subject user) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java
index f0daa9d..68e5342 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java
@@ -44,39 +44,42 @@ import org.rhq.core.domain.util.PageList;
public interface ResourceGWTService extends RemoteService {
void createResource(int parentResourceId, int newResourceTypeId, String newResourceName,
- Configuration newResourceConfiguration);
+ Configuration newResourceConfiguration) throws RuntimeException;
void createResource(int parentResourceId, int newResourceTypeId, String newResourceName,
- Configuration deploymentTimeConfiguration, int packageVersionId);
+ Configuration deploymentTimeConfiguration, int packageVersionId) throws RuntimeException;
- List<DeleteResourceHistory> deleteResources(int[] resourceIds);
+ List<DeleteResourceHistory> deleteResources(int[] resourceIds) throws RuntimeException;
- List<RecentlyAddedResourceComposite> findRecentlyAddedResources(long ctime, int maxItems);
+ List<RecentlyAddedResourceComposite> findRecentlyAddedResources(long ctime, int maxItems) throws RuntimeException;
- PageList<Resource> findResourcesByCriteria(ResourceCriteria criteria);
+ PageList<Resource> findResourcesByCriteria(ResourceCriteria criteria) throws RuntimeException;
- PageList<ResourceComposite> findResourceCompositesByCriteria(ResourceCriteria criteria);
+ PageList<ResourceComposite> findResourceCompositesByCriteria(ResourceCriteria criteria) throws RuntimeException;
- List<ResourceError> findResourceErrors(int resourceId);
+ List<ResourceError> findResourceErrors(int resourceId) throws RuntimeException;
- List<DisambiguationReport<ProblemResourceComposite>> findProblemResources(long ctime, int maxItems);
+ List<DisambiguationReport<ProblemResourceComposite>> findProblemResources(long ctime, int maxItems)
+ throws RuntimeException;
- Resource getPlatformForResource(int resourceId);
+ Resource getPlatformForResource(int resourceId) throws RuntimeException;
- Map<Resource, List<Resource>> getQueuedPlatformsAndServers(HashSet<InventoryStatus> statuses, PageControl pc);
+ Map<Resource, List<Resource>> getQueuedPlatformsAndServers(HashSet<InventoryStatus> statuses, PageControl pc)
+ throws RuntimeException;
- List<ResourceLineageComposite> getResourceLineageAndSiblings(int resourceId);
+ List<ResourceLineageComposite> getResourceLineageAndSiblings(int resourceId) throws RuntimeException;
- void ignoreResources(int[] resourceIds);
+ void ignoreResources(int[] resourceIds) throws RuntimeException;
- void importResources(int[] resourceIds);
+ void importResources(int[] resourceIds) throws RuntimeException;
- Resource manuallyAddResource(int resourceTypeId, int parentResourceId, Configuration pluginConfiguration);
+ Resource manuallyAddResource(int resourceTypeId, int parentResourceId, Configuration pluginConfiguration)
+ throws RuntimeException;
- void updateResource(Resource resource);
+ void updateResource(Resource resource) throws RuntimeException;
- void unignoreResources(int[] resourceIds);
+ void unignoreResources(int[] resourceIds) throws RuntimeException;
- List<Integer> uninventoryResources(int[] resourceIds);
+ List<Integer> uninventoryResources(int[] resourceIds) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
index 17c0f6c..bd196fc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java
@@ -35,7 +35,7 @@ import org.rhq.core.domain.util.PageList;
@RemoteServiceRelativePath("ResourceGroupGWTService")
public interface ResourceGroupGWTService extends RemoteService {
- GroupDefinition createGroupDefinition(GroupDefinition groupDefinition);
+ GroupDefinition createGroupDefinition(GroupDefinition groupDefinition) throws RuntimeException;
/**
* The owner will be set to the session subject.
@@ -43,31 +43,34 @@ public interface ResourceGroupGWTService extends RemoteService {
* @param resourceIds initial members
* @return
*/
- ResourceGroup createPrivateResourceGroup(ResourceGroup group, int[] resourceIds);
+ ResourceGroup createPrivateResourceGroup(ResourceGroup group, int[] resourceIds) throws RuntimeException;
- ResourceGroup createResourceGroup(ResourceGroup group, int[] resourceIds);
+ ResourceGroup createResourceGroup(ResourceGroup group, int[] resourceIds) throws RuntimeException;
- void deleteGroupDefinitions(int[] groupDefinitionIds);
+ void deleteGroupDefinitions(int[] groupDefinitionIds) throws RuntimeException;
- void deleteResourceGroups(int[] groupIds);
+ void deleteResourceGroups(int[] groupIds) throws RuntimeException;
- PageList<GroupDefinition> findGroupDefinitionsByCriteria(ResourceGroupDefinitionCriteria criteria);
+ PageList<GroupDefinition> findGroupDefinitionsByCriteria(ResourceGroupDefinitionCriteria criteria)
+ throws RuntimeException;
- PageList<ResourceGroup> findResourceGroupsByCriteria(ResourceGroupCriteria criteria);
+ PageList<ResourceGroup> findResourceGroupsByCriteria(ResourceGroupCriteria criteria) throws RuntimeException;
- PageList<ResourceGroupComposite> findResourceGroupCompositesByCriteria(ResourceGroupCriteria criteria);
+ PageList<ResourceGroupComposite> findResourceGroupCompositesByCriteria(ResourceGroupCriteria criteria)
+ throws RuntimeException;
- void setAssignedResourceGroupsForResource(int resourceId, int[] resourceGroupIds, boolean setType);
+ void setAssignedResourceGroupsForResource(int resourceId, int[] resourceGroupIds, boolean setType)
+ throws RuntimeException;
- void setAssignedResources(int groupId, int[] resourceIds, boolean setType);
+ void setAssignedResources(int groupId, int[] resourceIds, boolean setType) throws RuntimeException;
- void recalculateGroupDefinitions(int[] groupDefinitionIds);
+ void recalculateGroupDefinitions(int[] groupDefinitionIds) throws RuntimeException;
- void updateGroupDefinition(GroupDefinition groupDefinition);
+ void updateGroupDefinition(GroupDefinition groupDefinition) throws RuntimeException;
- void updateResourceGroup(ResourceGroup group);
+ void updateResourceGroup(ResourceGroup group) throws RuntimeException;
- void updateResourceGroup(ResourceGroup group, boolean updateMembership);
+ void updateResourceGroup(ResourceGroup group, boolean updateMembership) throws RuntimeException;
- void setRecursive(int groupId, boolean isRecursive) throws Exception;
+ void setRecursive(int groupId, boolean isRecursive) throws RuntimeException;
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceTypeGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceTypeGWTService.java
index 9d4e471..87a6dec 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceTypeGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceTypeGWTService.java
@@ -15,13 +15,13 @@ import org.rhq.core.domain.util.PageList;
@RemoteServiceRelativePath("ResourceTypeGWTService")
public interface ResourceTypeGWTService extends RemoteService {
- PageList<ResourceType> findResourceTypesByCriteria(ResourceTypeCriteria criteria);
+ PageList<ResourceType> findResourceTypesByCriteria(ResourceTypeCriteria criteria) throws RuntimeException;
- ArrayList<ResourceType> getResourceTypesForResourceAncestors(int resourceId);
+ ArrayList<ResourceType> getResourceTypesForResourceAncestors(int resourceId) throws RuntimeException;
- ArrayList<ResourceType> getAllResourceTypeAncestors(int resourceTypeId);
+ ArrayList<ResourceType> getAllResourceTypeAncestors(int resourceTypeId) throws RuntimeException;
- HashMap<Integer, String> getResourceTypeDescendantsWithOperations(int resourceTypeId);
+ HashMap<Integer, String> getResourceTypeDescendantsWithOperations(int resourceTypeId) throws RuntimeException;
- Map<Integer, ResourceTypeTemplateCountComposite> getTemplateCountCompositeMap();
+ Map<Integer, ResourceTypeTemplateCountComposite> getTemplateCountCompositeMap() throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java
index 1502c16..c2fdcc4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java
@@ -29,17 +29,17 @@ import org.rhq.core.domain.util.PageList;
*/
public interface RoleGWTService extends RemoteService {
- PageList<Role> findRolesByCriteria(RoleCriteria criteria);
+ PageList<Role> findRolesByCriteria(RoleCriteria criteria) throws RuntimeException;
- Role createRole(Role role);
+ Role createRole(Role role) throws RuntimeException;
- Role updateRole(Role role);
+ Role updateRole(Role role) throws RuntimeException;
- void removeRoles(int[] roleIds);
+ void removeRoles(int[] roleIds) throws RuntimeException;
- void setAssignedResourceGroups(int roleId, int[] resourceGroupIds);
+ void setAssignedResourceGroups(int roleId, int[] resourceGroupIds) throws RuntimeException;
- void setAssignedSubjects(int roleId, int[] subjectIds);
+ void setAssignedSubjects(int roleId, int[] subjectIds) throws RuntimeException;
- void setAssignedRolesForSubject(int subjectId, int[] roleIds);
+ void setAssignedRolesForSubject(int subjectId, int[] roleIds) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java
index 00b1d73..5ea5641 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java
@@ -36,18 +36,19 @@ public interface SearchGWTService extends RemoteService {
* search suggestions
*/
List<SearchSuggestion> getTabAwareSuggestions(SearchSubsystem searchSubsystem, String expression,
- int caretPosition, String tab);
+ int caretPosition, String tab) throws RuntimeException;
- List<SearchSuggestion> getSuggestions(SearchSubsystem searchSubsystem, String expression, int caretPosition);
+ List<SearchSuggestion> getSuggestions(SearchSubsystem searchSubsystem, String expression, int caretPosition)
+ throws RuntimeException;
/*
* saved searches
*/
- int createSavedSearch(SavedSearch savedSearch);
+ int createSavedSearch(SavedSearch savedSearch) throws RuntimeException;
- void updateSavedSearch(SavedSearch savedSearch);
+ void updateSavedSearch(SavedSearch savedSearch) throws RuntimeException;
- void deleteSavedSearch(int savedSearchId);
+ void deleteSavedSearch(int savedSearchId) throws RuntimeException;
- List<SavedSearch> findSavedSearchesByCriteria(SavedSearchCriteria criteria);
+ List<SavedSearch> findSavedSearchesByCriteria(SavedSearchCriteria criteria) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SubjectGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SubjectGWTService.java
index 67fd05a..a09cdc1 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SubjectGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SubjectGWTService.java
@@ -18,15 +18,12 @@
*/
package org.rhq.enterprise.gui.coregui.client.gwt;
-import javax.persistence.EntityExistsException;
-
import com.google.gwt.user.client.rpc.RemoteService;
import org.rhq.core.domain.auth.Principal;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.criteria.SubjectCriteria;
import org.rhq.core.domain.util.PageList;
-import org.rhq.enterprise.server.auth.SubjectException;
/**
* @see org.rhq.enterprise.server.auth.SubjectManagerLocal
@@ -41,7 +38,7 @@ public interface SubjectGWTService extends RemoteService {
* @param password The password part ofthe principal
* @throws Exception if the principal could not be added
*/
- void createPrincipal(String username, String password);
+ void createPrincipal(String username, String password) throws RuntimeException;
/**
* Create a a new subject. This <b>ignores</b> the roles in <code>subject</code>. The created subject will not be
@@ -50,7 +47,7 @@ public interface SubjectGWTService extends RemoteService {
* @param subjectToCreate The subject to be created.
* @return the newly persisted {@link Subject}
*/
- Subject createSubject(Subject subjectToCreate);
+ Subject createSubject(Subject subjectToCreate) throws RuntimeException;
/**
* Creates a new subject, including their assigned roles, as well as an associated principal with the specified
@@ -61,7 +58,7 @@ public interface SubjectGWTService extends RemoteService {
*
* @return the persisted subject
*/
- Subject createSubject(Subject subjectToCreate, String password) throws Exception;
+ Subject createSubject(Subject subjectToCreate, String password) throws RuntimeException;
/**
* Deletes the given set of users, including both the {@link Subject} and {@link org.rhq.core.domain.auth.Principal} objects associated with
@@ -70,7 +67,7 @@ public interface SubjectGWTService extends RemoteService {
* @param subjectIds identifies the subject IDs for all the users that are to be deleted
* @throws Exception if failed to delete one or more users
*/
- void deleteSubjects(int[] subjectIds);
+ void deleteSubjects(int[] subjectIds) throws RuntimeException;
/**
* Logs a user into the system. This will authenticate the given user with the given password. If the user was
@@ -82,14 +79,14 @@ public interface SubjectGWTService extends RemoteService {
* @throws org.rhq.enterprise.server.exception.LoginException
* if the login failed for some reason
*/
- Subject login(String username, String password);
+ Subject login(String username, String password) throws RuntimeException;
/**
* Logs out a user.
*
* @param subject The username for the current user
*/
- void logout(Subject subject);
+ void logout(Subject subject) throws RuntimeException;
/**
* Updates an existing subject with new data. This does <b>not</b> cascade any changes to the roles, but it will save
@@ -99,7 +96,7 @@ public interface SubjectGWTService extends RemoteService {
*
* @return the merged subject, which may or may not be the same instance of <code>subjectToModify</code>
*/
- Subject updateSubject(Subject subjectToModify);
+ Subject updateSubject(Subject subjectToModify) throws RuntimeException;
/**
* Updates an existing subject with new data. This cascades changes to roles and LDAP roles, so the passed-in
@@ -110,7 +107,7 @@ public interface SubjectGWTService extends RemoteService {
*
* @return the merged subject, which may or may not be the same instance of <code>subjectToModify</code>
*/
- Subject updateSubject(Subject subjectToModify, String newPassword);
+ Subject updateSubject(Subject subjectToModify, String newPassword) throws RuntimeException;
/**
* Queries subjects using current logged in user.
@@ -118,7 +115,7 @@ public interface SubjectGWTService extends RemoteService {
* @param criteria details for the search
* @return PageList<Subject> matching criteria.
*/
- PageList<Subject> findSubjectsByCriteria(SubjectCriteria criteria);
+ PageList<Subject> findSubjectsByCriteria(SubjectCriteria criteria) throws RuntimeException;
/**
* Checks the subject passed in for LDAP processing, to optionally:
@@ -129,7 +126,7 @@ public interface SubjectGWTService extends RemoteService {
* @param subjectToModify the subject
* @param password the LDAP password
*/
- Subject processSubjectForLdap(Subject subjectToModify, String password);
+ Subject processSubjectForLdap(Subject subjectToModify, String password) throws RuntimeException;
/**
* Checks that the user exists <b>and</b> has a {@link Principal} associated with it. This means that the user both
@@ -140,5 +137,5 @@ public interface SubjectGWTService extends RemoteService {
*
* @return <code>true</code> if the user exists and has a {@link Principal}, <code>false</code> otherwise
*/
- boolean isUserWithPrincipal(String username);
+ boolean isUserWithPrincipal(String username) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java
index 03fb121..1da3e7f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java
@@ -26,5 +26,5 @@ import org.rhq.core.domain.common.ProductInfo;
* @author Ian Springer
*/
public interface SystemGWTService extends RemoteService {
- ProductInfo getProductInfo();
+ ProductInfo getProductInfo() throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java
index 849fbc6..2abfd4a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TagGWTService.java
@@ -26,7 +26,6 @@ import java.util.Set;
import com.google.gwt.user.client.rpc.RemoteService;
-import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.criteria.TagCriteria;
import org.rhq.core.domain.tagging.Tag;
import org.rhq.core.domain.tagging.compsite.TagReportComposite;
@@ -37,24 +36,23 @@ import org.rhq.core.domain.util.PageList;
*/
public interface TagGWTService extends RemoteService {
+ PageList<Tag> findTagsByCriteria(TagCriteria tagCriteria) throws RuntimeException;
- PageList<Tag> findTagsByCriteria(TagCriteria tagCriteria);
+ Set<Tag> addTags(Set<Tag> tags) throws RuntimeException;
- Set<Tag> addTags(Set<Tag> tags);
+ void removeTags(Set<Tag> tags) throws RuntimeException;
- void removeTags(Set<Tag> tags);
+ void updateResourceTags(int resourceId, Set<Tag> tags) throws RuntimeException;
- void updateResourceTags(int resourceId, Set<Tag> tags);
+ void updateResourceGroupTags(int resourceGroupId, Set<Tag> tags) throws RuntimeException;
- void updateResourceGroupTags(int resourceGroupId, Set<Tag> tags);
+ void updateBundleTags(int bundleId, Set<Tag> tags) throws RuntimeException;
- void updateBundleTags(int bundleId, Set<Tag> tags);
+ void updateBundleVersionTags(int bundleVersionId, Set<Tag> tags) throws RuntimeException;
- void updateBundleVersionTags(int bundleVersionId, Set<Tag> tags);
+ void updateBundleDeploymentTags(int bundleDeploymentId, Set<Tag> tags) throws RuntimeException;
- void updateBundleDeploymentTags(int bundleDeploymentId, Set<Tag> tags);
+ void updateBundleDestinationTags(int bundleDestinationId, Set<Tag> tags) throws RuntimeException;
- void updateBundleDestinationTags(int bundleDestinationId, Set<Tag> tags);
-
- PageList<TagReportComposite> findTagReportCompositesByCriteria(TagCriteria tagCriteria);
+ PageList<TagReportComposite> findTagReportCompositesByCriteria(TagCriteria tagCriteria) throws RuntimeException;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java
index 3072708..5858d84 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java
@@ -37,7 +37,7 @@ public class AlertGWTServiceImpl extends AbstractGWTServiceImpl implements Alert
private AlertManagerLocal alertManager = LookupUtil.getAlertManager();
- public PageList<Alert> findAlertsByCriteria(AlertCriteria criteria) throws RuntimeException {
+ public PageList<Alert> findAlertsByCriteria(AlertCriteria criteria) throws Exception {
try {
return SerialUtility.prepare(this.alertManager.findAlertsByCriteria(getSessionSubject(), criteria),
"AlertService.findAlertsByCriteria");
@@ -46,7 +46,7 @@ public class AlertGWTServiceImpl extends AbstractGWTServiceImpl implements Alert
}
}
- public int deleteAlerts(int[] alertIds) throws RuntimeException {
+ public int deleteAlerts(int[] alertIds) throws Exception {
try {
return this.alertManager.deleteAlerts(getSessionSubject(), alertIds);
} catch (Throwable t) {
@@ -54,7 +54,7 @@ public class AlertGWTServiceImpl extends AbstractGWTServiceImpl implements Alert
}
}
- public int deleteAlertsByContext(EntityContext context) throws RuntimeException {
+ public int deleteAlertsByContext(EntityContext context) throws Exception {
try {
return this.alertManager.deleteAlertsByContext(getSessionSubject(), context);
} catch (Throwable t) {
@@ -62,7 +62,7 @@ public class AlertGWTServiceImpl extends AbstractGWTServiceImpl implements Alert
}
}
- public int acknowledgeAlerts(int[] alertIds) throws RuntimeException {
+ public int acknowledgeAlerts(int[] alertIds) throws Exception {
try {
return this.alertManager.acknowledgeAlerts(getSessionSubject(), alertIds);
} catch (Throwable t) {
@@ -70,7 +70,7 @@ public class AlertGWTServiceImpl extends AbstractGWTServiceImpl implements Alert
}
}
- public int acknowledgeAlertsByContext(EntityContext context) throws RuntimeException {
+ public int acknowledgeAlertsByContext(EntityContext context) throws Exception {
try {
return this.alertManager.acknowledgeAlertsByContext(getSessionSubject(), context);
} catch (Throwable t) {
commit ac2bd3ab11776fb8b564208ffc12db584efd985d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Dec 23 12:37:58 2010 -0500
replace global search with always visible message bar
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 dca51dc..4c74934 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
@@ -338,7 +338,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
// default view
History.newItem(DEFAULT_VIEW_PATH);
} else {
- messageBar.clearMessage();
if (pendingMessage != null) {
getMessageCenter().notify(pendingMessage);
pendingMessage = null;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
index a4a1e40..99596e0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
@@ -74,7 +74,7 @@ public class MenuBarView extends LocatableVLayout {
topStrip.addMember(getActionsSection());
addMember(topStrip);
- addMember(new SearchBarPane(this.extendLocatorId("Search")));
+ //addMember(new SearchBarPane(this.extendLocatorId("Search")));
markForRedraw();
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/Message.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/Message.java
index 122f032..c03b508 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/Message.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/Message.java
@@ -38,6 +38,7 @@ public class Message {
// TODO: Add Debug severity?
public enum Severity {
+ Blank("InfoBlank", "info/icn_info_blank.png"), //
Info("InfoBlock", "info/icn_info_blue.png"), //
Warning("WarnBlock", "info/icn_info_orange.png"), //
Error("ErrorBlock", "info/icn_info_red.png"), //
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java
index f0c901d..9aecd39 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java
@@ -35,11 +35,13 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout;
*/
public class MessageBar extends LocatableHLayout implements MessageCenter.MessageListener {
private static final String LOCATOR_ID = "MessageBar";
- private static final int AUTO_HIDE_DELAY_MILLIS = 15000; // 15 seconds
+ private static final int AUTO_HIDE_DELAY_MILLIS = 30000;
- private Label label;
+ private Label label = new Label();
private Message stickyMessage;
+ private static final String NON_BREAKING_SPACE = " ";
+
public MessageBar() {
super(LOCATOR_ID);
@@ -51,71 +53,63 @@ public class MessageBar extends LocatableHLayout implements MessageCenter.Messag
super.onDraw();
setWidth100();
- setHeight(35);
-
setAlign(Alignment.CENTER);
+ label.setAlign(Alignment.CENTER);
+ label.setWidth("400px");
+ label.setHeight("25px");
+
+ setLabelEmpty();
+ addMember(label);
+
CoreGUI.getMessageCenter().addMessageListener(this);
}
@Override
public void onMessage(Message message) {
if (!message.isBackgroundJobResult()) {
- // First clear any previous message.
- clearMessage(message.isSticky());
- displayMessage(message);
+ updateLabel(message);
- // Auto-clear the message after 15 seconds unless it's been designated as sticky.
+ // Auto-clear the message after some time unless it's been designated as sticky.
if (message.isSticky()) {
this.stickyMessage = message;
} else {
- Timer hideTimer = new Timer() {
+ new Timer() {
@Override
public void run() {
clearMessage(false);
if (stickyMessage != null) {
- displayMessage(stickyMessage);
+ updateLabel(stickyMessage);
}
}
- };
- hideTimer.schedule(AUTO_HIDE_DELAY_MILLIS);
+ }.schedule(AUTO_HIDE_DELAY_MILLIS);
}
}
}
- public void clearMessage() {
- clearMessage(true);
- }
-
- private void displayMessage(Message message) {
- this.label = createLabel(message);
- addMember(this.label);
+ private void clearMessage(boolean clearSticky) {
+ setLabelEmpty();
markForRedraw();
- }
- private void clearMessage(boolean clearSticky) {
- if (this.label != null) {
- this.label.destroy();
- markForRedraw();
- }
if (clearSticky) {
this.stickyMessage = null;
}
}
- private Label createLabel(Message message) {
- Label label = new Label();
+ private void setLabelEmpty() {
+ label.setContents(NON_BREAKING_SPACE);
+ label.setIcon(Message.Severity.Blank.getIcon());
+ label.setStyleName(Message.Severity.Blank.getStyle());
+ }
+ private void updateLabel(Message message) {
String contents = (message.getConciseMessage() != null) ? message.getConciseMessage() : message
.getDetailedMessage();
label.setContents(contents);
- label.setAlign(Alignment.CENTER);
String styleName = (contents != null) ? message.getSeverity().getStyle() : null;
label.setStyleName(styleName);
- label.setWidth(400);
-
// TODO: Create some custom edge images in greed, yellow, red, etc. so we can add nice rounded corners to the
// label.
//label.setShowEdges(true);
@@ -123,6 +117,6 @@ public class MessageBar extends LocatableHLayout implements MessageCenter.Messag
String icon = (contents != null) ? message.getSeverity().getIcon() : null;
label.setIcon(icon);
- return label;
+ markForRedraw();
}
}
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/info/icn_info_blank.png b/modules/enterprise/gui/coregui/src/main/webapp/images/info/icn_info_blank.png
new file mode 100644
index 0000000..8198687
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/info/icn_info_blank.png differ
commit d67bdf0d39a3899b805c747890ae7180624847e6
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Dec 23 10:11:56 2010 -0500
enable search bar for all ResourceGroup{Composite} views
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupCompositeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupCompositeDataSource.java
index 2418ec0..e81a82e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupCompositeDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupCompositeDataSource.java
@@ -128,6 +128,7 @@ public class ResourceGroupCompositeDataSource extends RPCDataSource<ResourceGrou
criteria.addFilterDownMemberCount(getFilter(request, "downMemberCount", Long.class));
criteria.addFilterExplicitResourceIds(getFilter(request, "explicitResourceId", Integer.class));
criteria.addFilterGroupDefinitionId(getFilter(request, "groupDefinitionId", Integer.class));
+ criteria.setSearchExpression(getFilter(request, "search", String.class));
return criteria;
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
index 85625d6..f12d6a6 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java
@@ -39,6 +39,7 @@ import com.smartgwt.client.widgets.grid.events.CellDoubleClickEvent;
import com.smartgwt.client.widgets.grid.events.CellDoubleClickHandler;
import org.rhq.core.domain.resource.group.GroupCategory;
+import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
@@ -252,4 +253,9 @@ public class ResourceGroupListView extends Table<ResourceGroupCompositeDataSourc
return view;
}
+ @Override
+ protected SearchSubsystem getSearchSubsystem() {
+ return SearchSubsystem.GROUP;
+ }
+
}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
index 7821ab7..617bffe 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java
@@ -124,6 +124,7 @@ public class ResourceGroupsDataSource extends RPCDataSource<ResourceGroup> {
criteria.addFilterDownMemberCount(getFilter(request, "downMemberCount", Long.class));
criteria.addFilterExplicitResourceIds(getFilter(request, "explicitResourceId", Integer.class));
criteria.addFilterGroupDefinitionId(getFilter(request, "groupDefinitionId", Integer.class));
+ criteria.setSearchExpression(getFilter(request, "search", String.class));
return criteria;
}
commit cb86da0d33b2f1e5e018d9f1a00d69d6fd552c1c
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Dec 23 10:05:34 2010 -0500
enable search bar for all resource search views
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index c569234..fcc5909 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
@@ -73,6 +73,7 @@ import com.smartgwt.client.widgets.menu.MenuItem;
import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
import com.smartgwt.client.widgets.toolbar.ToolStrip;
+import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.RefreshableView;
import org.rhq.enterprise.gui.coregui.client.components.form.SearchBarItem;
@@ -181,7 +182,16 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
super.onInit();
filterForm = new TableFilter(this);
- configureTableFilters();
+
+ /*
+ * table filters and search bar are currently mutually exclusive
+ */
+ if (getSearchSubsystem() == null) {
+ configureTableFilters();
+ } else {
+ final SearchBarItem searchFilter = new SearchBarItem("search", "Search", getSearchSubsystem());
+ setFilterFormItems(searchFilter);
+ }
listGrid = new LocatableListGrid(getLocatorId());
listGrid.setAutoFetchData(autoFetchData);
@@ -863,4 +873,12 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
public void setShowFilterForm(boolean showFilterForm) {
this.showFilterForm = showFilterForm;
}
+
+ /*
+ * by default, no search bar is shown above this table. if this table represents a subsystem that is capable
+ * of search, return the specific object here.
+ */
+ protected SearchSubsystem getSearchSubsystem() {
+ return null;
+ }
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
index 07c1bcc..ff8d83c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
@@ -38,6 +38,7 @@ import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.core.domain.search.SearchSubsystem;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
@@ -231,4 +232,9 @@ public class ResourceSearchView extends Table {
selectListeners.add(listener);
}
+ @Override
+ protected SearchSubsystem getSearchSubsystem() {
+ return SearchSubsystem.RESOURCE;
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/inventory/TestSearchBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/inventory/TestSearchBarView.java
index eb519a9..91fccfc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/inventory/TestSearchBarView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/inventory/TestSearchBarView.java
@@ -1,17 +1,9 @@
package org.rhq.enterprise.gui.coregui.client.test.inventory;
-import org.rhq.core.domain.search.SearchSubsystem;
-import org.rhq.enterprise.gui.coregui.client.components.form.SearchBarItem;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
public class TestSearchBarView extends ResourceSearchView {
public TestSearchBarView(String locatorId) {
super(locatorId);
}
-
- @Override
- protected void configureTableFilters() {
- final SearchBarItem searchFilter = new SearchBarItem("search", "Search", SearchSubsystem.RESOURCE);
- setFilterFormItems(searchFilter);
- }
}
commit 59567145c4c931d29961bf25de76b2dc4d960390
Author: Joseph Marques <joseph(a)redhat.com>
Date: Thu Dec 23 00:42:11 2010 -0500
remove all filters except the SearchBar for the TestSearchBarView
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/inventory/TestSearchBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/inventory/TestSearchBarView.java
index 234d775..eb519a9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/inventory/TestSearchBarView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/inventory/TestSearchBarView.java
@@ -1,13 +1,6 @@
package org.rhq.enterprise.gui.coregui.client.test.inventory;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME;
-
-import com.smartgwt.client.widgets.form.fields.TextItem;
-
-import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.search.SearchSubsystem;
-import org.rhq.enterprise.gui.coregui.client.components.form.EnumSelectItem;
import org.rhq.enterprise.gui.coregui.client.components.form.SearchBarItem;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
@@ -18,11 +11,7 @@ public class TestSearchBarView extends ResourceSearchView {
@Override
protected void configureTableFilters() {
- final TextItem nameFilter = new TextItem(NAME.propertyName(), NAME.title());
- final EnumSelectItem categoryFilter = new EnumSelectItem(CATEGORY.propertyName(), CATEGORY.title(),
- ResourceCategory.class);
final SearchBarItem searchFilter = new SearchBarItem("search", "Search", SearchSubsystem.RESOURCE);
-
- setFilterFormItems(nameFilter, categoryFilter, searchFilter);
+ setFilterFormItems(searchFilter);
}
}
12 years, 11 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java | 16 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java | 84 +++++-----
2 files changed, 59 insertions(+), 41 deletions(-)
New commits:
commit 44ebe352011837c815122fff43497149e5008e1a
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Dec 23 13:05:51 2010 -0500
Dashboard Work for Adding Portlets to a Dashboard
- Add some more support to PortletFactory for better handling portlet
keys *and* names.
- Fix the 'add portlet' drop down menu to use names as opposed to keys.
- make sure when adding a portlet we properly specify name and key, key
was being passed incorrectly.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
index 5843658..9631294 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
@@ -199,8 +199,11 @@ public class DashboardView extends LocatableVLayout {
});
Menu addPortletMenu = new Menu();
- for (String portletName : PortletFactory.getRegisteredPortletKeys()) {
- addPortletMenu.addItem(new MenuItem(portletName));
+ HashMap<String, String> keyNameMap = PortletFactory.getRegisteredPortletNameMap();
+ for (String portletKey : keyNameMap.keySet()) {
+ MenuItem menuItem = new MenuItem(keyNameMap.get(portletKey));
+ menuItem.setAttribute("portletKey", portletKey);
+ addPortletMenu.addItem(menuItem);
}
addPortlet = new LocatableIMenuButton(extendLocatorId("AddPortlet"), MSG.common_title_add_portlet(),
@@ -211,8 +214,9 @@ public class DashboardView extends LocatableVLayout {
addPortletMenu.addItemClickHandler(new ItemClickHandler() {
public void onItemClick(ItemClickEvent itemClickEvent) {
- String portletTitle = itemClickEvent.getItem().getTitle();
- addPortlet(portletTitle, portletTitle);
+ String key = itemClickEvent.getItem().getAttribute("portletKey");
+ String name = itemClickEvent.getItem().getTitle();
+ addPortlet(key, name);
}
});
@@ -407,12 +411,12 @@ public class DashboardView extends LocatableVLayout {
if (portletMap == null) {
portletMap = new HashMap<String, PortletViewFactory>();
for (String key : PortletFactory.getRegisteredPortletKeys()) {
- portletMap.put(key, PortletFactory.getRegisteredPortlet(key));
+ portletMap.put(key, PortletFactory.getRegisteredPortletFactory(key));
}
}
for (PortletWindow portletWindow : portlets) {
for (DashboardPortlet portlet : result.getPortlets()) {
- if (portletWindow.getDashboardPortlet().getId() == portlet.getId()) {
+ if (portletWindow.getDashboardPortlet().equals(portlet)) {
portletWindow.getDashboardPortlet().setConfiguration(portlet.getConfiguration());
//restarting port auto-refresh with newest settings
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
index 4e1ac46..aaa2229 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
@@ -19,10 +19,8 @@
package org.rhq.enterprise.gui.coregui.client.dashboard;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import org.rhq.core.domain.dashboard.DashboardPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.queue.AutodiscoveryPortlet;
@@ -44,39 +42,44 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
*/
public class PortletFactory {
- private static Map<String, PortletViewFactory> registeredPortlets;
+ private static HashMap<String, PortletViewFactory> registeredPortletFactoryMap;
+ private static HashMap<String, String> registeredPortletNameMap;
static {
- registeredPortlets = new HashMap<String, PortletViewFactory>();
-
- registeredPortlets.put(InventorySummaryPortlet.KEY, InventorySummaryPortlet.Factory.INSTANCE);
-
- registeredPortlets.put(RecentlyAddedResourcesPortlet.KEY, RecentlyAddedResourcesPortlet.Factory.INSTANCE);
-
- registeredPortlets.put(PlatformSummaryPortlet.KEY, PlatformSummaryPortlet.Factory.INSTANCE);
-
- registeredPortlets.put(AutodiscoveryPortlet.KEY, AutodiscoveryPortlet.Factory.INSTANCE);
-
- registeredPortlets.put(RecentAlertsPortlet.KEY, RecentAlertsPortlet.Factory.INSTANCE);
-
- registeredPortlets.put(GraphPortlet.KEY, GraphPortlet.Factory.INSTANCE);
-
- registeredPortlets.put(TagCloudPortlet.KEY, TagCloudPortlet.Factory.INSTANCE);
-
- registeredPortlets.put(FavoriteResourcesPortlet.KEY, FavoriteResourcesPortlet.Factory.INSTANCE);
-
- registeredPortlets.put(MashupPortlet.KEY, MashupPortlet.Factory.INSTANCE);
-
- registeredPortlets.put(MessagePortlet.KEY, MessagePortlet.Factory.INSTANCE);
-
- registeredPortlets.put(ProblemResourcesPortlet.KEY, ProblemResourcesPortlet.Factory.INSTANCE);
-
- registeredPortlets.put(OperationsPortlet.KEY, OperationsPortlet.Factory.INSTANCE);
+ registeredPortletFactoryMap = new HashMap<String, PortletViewFactory>();
+ registeredPortletFactoryMap.put(InventorySummaryPortlet.KEY, InventorySummaryPortlet.Factory.INSTANCE);
+ registeredPortletFactoryMap.put(RecentlyAddedResourcesPortlet.KEY,
+ RecentlyAddedResourcesPortlet.Factory.INSTANCE);
+ registeredPortletFactoryMap.put(PlatformSummaryPortlet.KEY, PlatformSummaryPortlet.Factory.INSTANCE);
+ registeredPortletFactoryMap.put(AutodiscoveryPortlet.KEY, AutodiscoveryPortlet.Factory.INSTANCE);
+ registeredPortletFactoryMap.put(RecentAlertsPortlet.KEY, RecentAlertsPortlet.Factory.INSTANCE);
+ registeredPortletFactoryMap.put(GraphPortlet.KEY, GraphPortlet.Factory.INSTANCE);
+ registeredPortletFactoryMap.put(TagCloudPortlet.KEY, TagCloudPortlet.Factory.INSTANCE);
+ registeredPortletFactoryMap.put(FavoriteResourcesPortlet.KEY, FavoriteResourcesPortlet.Factory.INSTANCE);
+ registeredPortletFactoryMap.put(MashupPortlet.KEY, MashupPortlet.Factory.INSTANCE);
+ registeredPortletFactoryMap.put(MessagePortlet.KEY, MessagePortlet.Factory.INSTANCE);
+ registeredPortletFactoryMap.put(ProblemResourcesPortlet.KEY, ProblemResourcesPortlet.Factory.INSTANCE);
+ registeredPortletFactoryMap.put(OperationsPortlet.KEY, OperationsPortlet.Factory.INSTANCE);
+
+ registeredPortletNameMap = new HashMap<String, String>(registeredPortletFactoryMap.size());
+ registeredPortletNameMap.put(InventorySummaryPortlet.KEY, InventorySummaryPortlet.NAME);
+ registeredPortletNameMap.put(RecentlyAddedResourcesPortlet.KEY, RecentlyAddedResourcesPortlet.NAME);
+ registeredPortletNameMap.put(PlatformSummaryPortlet.KEY, PlatformSummaryPortlet.NAME);
+ registeredPortletNameMap.put(AutodiscoveryPortlet.KEY, AutodiscoveryPortlet.NAME);
+ registeredPortletNameMap.put(RecentAlertsPortlet.KEY, RecentAlertsPortlet.NAME);
+ registeredPortletNameMap.put(GraphPortlet.KEY, GraphPortlet.NAME);
+ registeredPortletNameMap.put(TagCloudPortlet.KEY, TagCloudPortlet.NAME);
+ registeredPortletNameMap.put(FavoriteResourcesPortlet.KEY, FavoriteResourcesPortlet.NAME);
+ registeredPortletNameMap.put(MashupPortlet.KEY, MashupPortlet.NAME);
+ registeredPortletNameMap.put(MessagePortlet.KEY, MessagePortlet.NAME);
+ registeredPortletNameMap.put(ProblemResourcesPortlet.KEY, ProblemResourcesPortlet.NAME);
+ registeredPortletNameMap.put(OperationsPortlet.KEY, OperationsPortlet.NAME);
+ //registeredPortletNameMap = Collections.unmodifiableMap(registeredPortletNameMap);
}
public static Portlet buildPortlet(PortletWindow portletWindow, DashboardPortlet storedPortlet) {
- PortletViewFactory viewFactory = registeredPortlets.get(storedPortlet.getPortletKey());
+ PortletViewFactory viewFactory = registeredPortletFactoryMap.get(storedPortlet.getPortletKey());
// TODO: Note, we're using a sequence generated ID here as a locatorId. This is not optimal for repeatable
// tests as a change in the number of default portlets, or a change in test order could make a test
@@ -93,18 +96,29 @@ public class PortletFactory {
return view;
}
- @SuppressWarnings("unchecked")
public static List<String> getRegisteredPortletKeys() {
- ArrayList portlets = new ArrayList(registeredPortlets.keySet());
- Collections.sort(portlets);
- return portlets;
+ ArrayList<String> portletKeys = new ArrayList<String>(registeredPortletFactoryMap.keySet());
+ return portletKeys;
+ }
+
+ /**
+ * @return Unmodifiable Map of registered portlet keys to names
+ */
+ public static HashMap<String, String> getRegisteredPortletNameMap() {
+
+ return registeredPortletNameMap;
+ }
+
+ public static String getRegisteredPortletName(String key) {
+
+ return registeredPortletNameMap.get(key);
}
- public static PortletViewFactory getRegisteredPortlet(String key) {
+ public static PortletViewFactory getRegisteredPortletFactory(String key) {
PortletViewFactory portletFactory = null;
if ((key != null) & (!key.trim().isEmpty())) {
- portletFactory = registeredPortlets.get(key);
+ portletFactory = registeredPortletFactoryMap.get(key);
}
return portletFactory;
}
12 years, 11 months
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java | 18 ++++++++++
1 file changed, 18 insertions(+)
New commits:
commit b0c15054d7c0fc2d72bf350c5b0957d11a7711ec
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Dec 23 12:58:52 2010 -0500
if you are looking at a live deployment, provide a revert button so you can revert right there
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
index 870988e..78651a0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java
@@ -70,6 +70,7 @@ import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.ViewId;
import org.rhq.enterprise.gui.coregui.client.ViewPath;
+import org.rhq.enterprise.gui.coregui.client.bundle.revert.BundleRevertWizard;
import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel;
import org.rhq.enterprise.gui.coregui.client.components.buttons.BackButton;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
@@ -209,6 +210,23 @@ public class BundleDeploymentView extends LocatableVLayout implements Bookmarkab
private Canvas getActionLayout(String locatorId) {
LocatableVLayout actionLayout = new LocatableVLayout(locatorId, 10);
+
+ // we can only revert the live deployments, only show revert button when appropriate
+ if (deployment.isLive()) {
+ IButton revertButton = new LocatableIButton(actionLayout.extendLocatorId("Revert"), MSG
+ .view_bundle_revert());
+ revertButton.setIcon("subsystems/bundle/BundleAction_Revert_16.png");
+ revertButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
+ public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
+ new BundleRevertWizard(deployment.getDestination()).startWizard();
+ }
+ });
+ actionLayout.addMember(revertButton);
+ if (!canManageBundles) {
+ revertButton.setDisabled(true);
+ }
+ }
+
IButton deleteButton = new LocatableIButton(actionLayout.extendLocatorId("Delete"), MSG.common_button_delete());
deleteButton.setIcon("subsystems/bundle/BundleDeploymentAction_Delete_16.png");
deleteButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
12 years, 11 months
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 1a41bcb2e0ada1b50c1c5beaf0c82a9bf74cc5cd
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Dec 23 12:41:22 2010 -0500
let the textarea grow to the width of the popup window so the user can see large amounts of large messages
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java
index 89eec9d..60f5007 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java
@@ -164,6 +164,7 @@ public class BundleResourceDeploymentHistoryListView extends LocatableVLayout {
AutoFitTextAreaItem detail = new AutoFitTextAreaItem("attachment", MSG.common_title_details());
detail.setTitleVAlign(VerticalAlignment.TOP);
+ detail.setWidth("100%");
form.setItems(timestamp, action, category, user, status, info, message, detail);
form.editRecord(record);
12 years, 11 months
[rhq] modules/common
by mazz
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/FileType.java | 17 ++++++----
modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java | 5 ++
modules/common/ant-bundle/src/test/resources/test-bundle-subdir.xml | 1
3 files changed, 16 insertions(+), 7 deletions(-)
New commits:
commit 45656ceb9d368f0549e02aef560e476c2491d276
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Dec 23 11:24:39 2010 -0500
support a default location for <file>s so you don't have to specify a destination if its the same as its name
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/FileType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/FileType.java
index 2e55c0e..b968ced 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/FileType.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/FileType.java
@@ -22,10 +22,10 @@
*/
package org.rhq.bundle.ant.type;
-import org.apache.tools.ant.BuildException;
-
import java.io.File;
+import org.apache.tools.ant.BuildException;
+
/**
* A file to be copied during the bundle deployment. If the replace attribute is set to true, any template variables
* (e.g. @@http.port(a)@) inside the file will be replaced with the value of the corresponding property.
@@ -43,19 +43,24 @@ public class FileType extends AbstractFileType {
// Pass in a String, rather than a File, since we don't want Ant to resolve the path relative to basedir if it's relative.
public void setDestinationDir(String destinationDir) {
- if (getDestinationFile() != null) {
- throw new BuildException("Both 'destinationDir' and 'destinationFile' attributes are defined - only one or the other may be specified.");
+ if (this.destinationFile != null) {
+ throw new BuildException(
+ "Both 'destinationDir' and 'destinationFile' attributes are defined - only one or the other may be specified.");
}
this.destinationDir = new File(destinationDir);
}
public File getDestinationFile() {
+ if (this.destinationDir == null && this.destinationFile == null) {
+ return new File(getName()); // the default destination is the same relative path as that of its local name
+ }
return this.destinationFile;
}
public void setDestinationFile(String destinationFile) {
- if (getDestinationDir() != null) {
- throw new BuildException("Both 'destinationDir' and 'destinationFile' attributes are defined - only one or the other may be specified.");
+ if (this.destinationDir != null) {
+ throw new BuildException(
+ "Both 'destinationDir' and 'destinationFile' attributes are defined - only one or the other may be specified.");
}
this.destinationFile = new File(destinationFile);
}
diff --git a/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java b/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java
index 956ea93..4eb4369 100644
--- a/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java
+++ b/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java
@@ -486,6 +486,7 @@ public class AntLauncherTest {
try {
File subdir = new File(antBasedir, "subdir"); // must match the name in the recipe
subdir.mkdirs();
+ writeFile("file0", subdir, "test0.txt"); // filename must match recipe
writeFile("file1", subdir, "test1.txt"); // filename must match recipe
writeFile("file2", subdir, "test2.txt"); // filename must match recipe
createZip(new String[] { "one", "two" }, subdir, "test.zip", new String[] { "one.txt", "two.txt" });
@@ -506,13 +507,15 @@ public class AntLauncherTest {
assert project != null;
Set<String> bundleFiles = project.getBundleFileNames();
assert bundleFiles != null;
- assert bundleFiles.size() == 5 : bundleFiles;
+ assert bundleFiles.size() == 6 : bundleFiles;
+ assert bundleFiles.contains("subdir/test0.txt") : bundleFiles;
assert bundleFiles.contains("subdir/test1.txt") : bundleFiles;
assert bundleFiles.contains("subdir/test2.txt") : bundleFiles;
assert bundleFiles.contains("subdir/test.zip") : bundleFiles;
assert bundleFiles.contains("subdir/test-explode.zip") : bundleFiles;
assert bundleFiles.contains("subdir/test-replace.zip") : bundleFiles;
+ assert new File(DEPLOY_DIR, "subdir/test0.txt").exists() : "missing raw file from default destination location";
assert new File(DEPLOY_DIR, "another/foo.txt").exists() : "missing raw file from the destinationFile";
assert new File(DEPLOY_DIR, "second.dir/test2.txt").exists() : "missing raw file from the destinationDir";
assert !new File(DEPLOY_DIR, "subdir/test1.zip").exists() : "should not be here because destinationFile was specified";
diff --git a/modules/common/ant-bundle/src/test/resources/test-bundle-subdir.xml b/modules/common/ant-bundle/src/test/resources/test-bundle-subdir.xml
index 940ecf1..af3dbd2 100644
--- a/modules/common/ant-bundle/src/test/resources/test-bundle-subdir.xml
+++ b/modules/common/ant-bundle/src/test/resources/test-bundle-subdir.xml
@@ -7,6 +7,7 @@
<rhq:input-property name="X" />
<rhq:deployment-unit name="appserver">
+ <rhq:file name="subdir/test0.txt" replace="false" />
<rhq:file name="subdir/test1.txt" destinationFile="another/foo.txt" replace="false"/>
<rhq:file name="subdir/test2.txt" destinationDir="second.dir" replace="false"/>
<rhq:archive name="subdir/test.zip" exploded="false" />
12 years, 11 months
[rhq] modules/common
by mazz
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java | 12 -
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractFileType.java | 9 +
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentUnitType.java | 43 ++++++
modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java | 57 +++++---
modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java | 65 ++++++++++
modules/common/ant-bundle/src/test/resources/test-bundle-subdir.xml | 25 +++
6 files changed, 181 insertions(+), 30 deletions(-)
New commits:
commit 9f1a09b854b0f21b66819f2906e7b6659347d2e7
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Dec 23 11:09:49 2010 -0500
BZ 610879 - make sure the ant parser knows the true location of the local raw files and archive files so the UI can ask for them when appropriate
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java
index 86fd666..f5d32eb 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java
@@ -238,13 +238,13 @@ public class AntLauncher {
"The bundle task must contain exactly one rhq:deploymentUnit child element.");
}
DeploymentUnitType deployment = deployments.iterator().next();
- Map<File, File> files = deployment.getFiles();
- for (File file : files.keySet()) {
- project.getBundleFileNames().add(file.getName());
+ Map<File, String> files = deployment.getLocalFileNames();
+ for (String file : files.values()) {
+ project.getBundleFileNames().add(file);
}
- Set<File> archives = deployment.getArchives();
- for (File archive : archives) {
- project.getBundleFileNames().add(archive.getName());
+ Map<File, String> archives = deployment.getLocalArchiveNames();
+ for (String archive : archives.values()) {
+ project.getBundleFileNames().add(archive);
}
}
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractFileType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractFileType.java
index 29b9d92..f5bbe92 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractFileType.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/AbstractFileType.java
@@ -25,7 +25,6 @@ package org.rhq.bundle.ant.type;
import java.io.File;
import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.DataType;
/**
* A base class for the functionality shared by {@link FileType} and {@link ArchiveType}.
@@ -33,6 +32,7 @@ import org.apache.tools.ant.types.DataType;
* @author Ian Springer
*/
public abstract class AbstractFileType extends AbstractBundleType {
+ private String name;
private File source;
// TODO: We currently do not call this method. Do we want to or should we just let the Deployer utility handle
@@ -43,7 +43,7 @@ public abstract class AbstractFileType extends AbstractBundleType {
}
if (this.source.isDirectory()) {
throw new BuildException("File path specified by 'name' attribute (" + this.source
- + ") is a directory - it must be a regular file.");
+ + ") is a directory - it must be a regular file.");
}
}
@@ -51,7 +51,12 @@ public abstract class AbstractFileType extends AbstractBundleType {
return this.source;
}
+ public String getName() {
+ return this.name;
+ }
+
public void setName(String name) {
+ this.name = name;
File file = new File(name);
if (file.isAbsolute()) {
throw new BuildException("Path specified by 'name' attribute (" + name
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentUnitType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentUnitType.java
index 31a52bc..8d00a96 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentUnitType.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/DeploymentUnitType.java
@@ -49,8 +49,10 @@ public class DeploymentUnitType extends AbstractBundleType {
private String name;
private String manageRootDir = Boolean.TRUE.toString();
private Map<File, File> files = new LinkedHashMap<File, File>();
+ private Map<File, String> localFileNames = new LinkedHashMap<File, String>();
private Set<File> rawFilesToReplace = new LinkedHashSet<File>();
private Set<File> archives = new LinkedHashSet<File>();
+ private Map<File, String> localArchiveNames = new LinkedHashMap<File, String>();
private Map<File, Boolean> archivesExploded = new HashMap<File, Boolean>();
private Map<File, Pattern> archiveReplacePatterns = new HashMap<File, Pattern>();
private SystemServiceType systemService;
@@ -175,15 +177,50 @@ public class DeploymentUnitType extends AbstractBundleType {
this.manageRootDir = booleanString;
}
+ /**
+ * Returns a map of all raw files. The key is the full absolute path
+ * to the file as it does or would appear on the file system. The value
+ * is a path that is either absolute or relative - it is the destination
+ * where the file is to be placed when being deployed on the destination file system;
+ * if the value is relative, then it is relative to the root destination directory.
+ *
+ * @return map of raw files
+ */
public Map<File, File> getFiles() {
return files;
}
+ /**
+ * Returns a map of all raw files. The key is the full absolute path
+ * to the file as it does or would appear on the file system (the same key
+ * as the keys in map {@link #getFiles()}).
+ * The value is a path relative to the file as it is found in the bundle distro (this
+ * is the "name" attribute of the "file" type tag).
+ *
+ * @return map of local file names
+ */
+ public Map<File, String> getLocalFileNames() {
+ return localFileNames;
+ }
+
public Set<File> getArchives() {
return archives;
}
/**
+ * Returns a map of all archive files. The key is the full absolute path
+ * to the archive as it does or would appear on the file system (the same key
+ * as the keys in map {@link #getArchives()}).
+ * The value is a path relative to the file as it is found in the bundle distro (this
+ * is the "name" attribute of the "archive" type tag).
+ *
+ * @return map of local file names
+ */
+ public Map<File, String> getLocalArchiveNames() {
+ return localArchiveNames;
+ }
+
+ /**
* Returns a map keyed on {@link #getArchives() archive names} whose values
* are either true or false, where true means the archive is to be deployed exploded
* and false means the archive should be deployed in compressed form.
@@ -220,8 +257,10 @@ public class DeploymentUnitType extends AbstractBundleType {
// Add the init script and its config file to the list of bundle files.
this.files.put(this.systemService.getScriptFile(), this.systemService.getScriptDestFile());
+ this.localFileNames.put(this.systemService.getScriptFile(), this.systemService.getScriptFileName());
if (this.systemService.getConfigFile() != null) {
this.files.put(this.systemService.getConfigFile(), this.systemService.getConfigDestFile());
+ this.localFileNames.put(this.systemService.getConfigFile(), this.systemService.getConfigFileName());
this.rawFilesToReplace.add(this.systemService.getConfigFile());
}
}
@@ -232,7 +271,8 @@ public class DeploymentUnitType extends AbstractBundleType {
File destDir = file.getDestinationDir();
destFile = new File(destDir, file.getSource().getName());
}
- this.files.put(file.getSource(), destFile);
+ this.files.put(file.getSource(), destFile); // key=full absolute path, value=could be relative or absolute
+ this.localFileNames.put(file.getSource(), file.getName());
if (file.isReplace()) {
this.rawFilesToReplace.add(file.getSource());
}
@@ -240,6 +280,7 @@ public class DeploymentUnitType extends AbstractBundleType {
public void addConfigured(ArchiveType archive) {
this.archives.add(archive.getSource());
+ this.localArchiveNames.put(archive.getSource(), archive.getName());
Pattern replacePattern = archive.getReplacePattern();
if (replacePattern != null) {
this.archiveReplacePatterns.put(archive.getSource(), replacePattern);
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java
index fd1fd93..6521d2e 100644
--- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java
+++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java
@@ -18,12 +18,6 @@
*/
package org.rhq.bundle.ant.type;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Chmod;
-import org.apache.tools.ant.taskdefs.Copy;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.optional.unix.Symlink;
-
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
@@ -31,6 +25,12 @@ import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.taskdefs.Chmod;
+import org.apache.tools.ant.taskdefs.Copy;
+import org.apache.tools.ant.taskdefs.Execute;
+import org.apache.tools.ant.taskdefs.optional.unix.Symlink;
+
/**
* An Ant task that installs a system startup/shutdown service. Currently only Red Hat Linux versions are supported.
*
@@ -53,6 +53,8 @@ public class SystemServiceType extends AbstractBundleType {
private String name;
private File scriptFile;
private File configFile;
+ private String scriptFileName;
+ private String configFileName;
private boolean overwriteScript;
private boolean overwriteConfig;
private boolean overwriteLinks = true;
@@ -64,7 +66,7 @@ public class SystemServiceType extends AbstractBundleType {
* before services with a higher priority number.
*/
private Byte startPriority;
-
+
/**
* An integer from 0-99 indicating the service's stop order - services with a lower priority number are stopped
* before services with a higher priority number.
@@ -79,13 +81,13 @@ public class SystemServiceType extends AbstractBundleType {
public void validate() throws BuildException {
validateAttributes();
-
+
this.scriptDestFile = new File(getInitDir(), this.name);
this.configDestFile = new File(getSysConfigDir(), this.name);
}
public void init() throws BuildException {
- if (!OS_NAME.equals("Linux") || !REDHAT_RELEASE_FILE.exists() ) {
+ if (!OS_NAME.equals("Linux") || !REDHAT_RELEASE_FILE.exists()) {
throw new BuildException("The system-service element is only supported on Red Hat Linux systems.");
}
@@ -116,7 +118,7 @@ public class SystemServiceType extends AbstractBundleType {
// Install the script itself (e.g. /etc/init.d/named).
File initDir = getInitDir();
if (!initDir.exists()) {
- initDir.mkdirs();
+ initDir.mkdirs();
}
if (!initDir.canWrite()) {
throw new BuildException(initDir + " directory is not writeable.");
@@ -150,23 +152,23 @@ public class SystemServiceType extends AbstractBundleType {
public void start() throws BuildException {
File scriptFile = getScriptDestFile();
- String[] commandLine = {scriptFile.getAbsolutePath(), "start"};
+ String[] commandLine = { scriptFile.getAbsolutePath(), "start" };
try {
executeCommand(commandLine);
} catch (IOException e) {
- throw new BuildException("Failed to start " + this.name + " system service via command [" + Arrays.toString(commandLine)
- + "].", e);
+ throw new BuildException("Failed to start " + this.name + " system service via command ["
+ + Arrays.toString(commandLine) + "].", e);
}
}
public void stop() throws BuildException {
File scriptFile = getScriptDestFile();
- String[] commandLine = {scriptFile.getAbsolutePath(), "stop"};
+ String[] commandLine = { scriptFile.getAbsolutePath(), "stop" };
try {
executeCommand(commandLine);
} catch (IOException e) {
- throw new BuildException("Failed to stop " + this.name + " system service via command [" + Arrays.toString(commandLine)
- + "].", e);
+ throw new BuildException("Failed to stop " + this.name + " system service via command ["
+ + Arrays.toString(commandLine) + "].", e);
}
}
@@ -182,6 +184,10 @@ public class SystemServiceType extends AbstractBundleType {
this.name = name;
}
+ public String getScriptFileName() {
+ return scriptFileName;
+ }
+
public File getScriptFile() {
return scriptFile;
}
@@ -192,9 +198,14 @@ public class SystemServiceType extends AbstractBundleType {
throw new BuildException("Path specified by 'scriptFile' attribute (" + scriptFile
+ ") is not relative - it must be a relative path, relative to the Ant basedir.");
}
+ this.scriptFileName = scriptFile;
this.scriptFile = getProject().resolveFile(scriptFile);
}
+ public String getConfigFileName() {
+ return configFileName;
+ }
+
public File getConfigFile() {
return configFile;
}
@@ -205,6 +216,7 @@ public class SystemServiceType extends AbstractBundleType {
throw new BuildException("Path specified by 'configFile' attribute (" + configFile
+ ") is not relative - it must be a relative path, relative to the Ant basedir.");
}
+ this.configFileName = configFile;
this.configFile = getProject().resolveFile(configFile);
}
@@ -290,7 +302,7 @@ public class SystemServiceType extends AbstractBundleType {
throw new BuildException("The 'startLevels' attribute must have a non-empty value.");
}
this.startLevelChars = parseLevels(this.startLevels);
- this.stopLevelChars = new TreeSet<Character>();
+ this.stopLevelChars = new TreeSet<Character>();
for (char level : REDHAT_RUN_LEVELS) {
if (!this.startLevelChars.contains(level)) {
this.stopLevelChars.add(level);
@@ -314,7 +326,7 @@ public class SystemServiceType extends AbstractBundleType {
this.root.mkdirs();
if (!this.root.exists()) {
throw new BuildException("Failed to create root directory " + this.root
- + " as specified by 'root' attribute.");
+ + " as specified by 'root' attribute.");
}
}
if (!this.root.isDirectory()) {
@@ -341,12 +353,15 @@ public class SystemServiceType extends AbstractBundleType {
}
} catch (Exception e) {
- throw new BuildException("Invalid run level: " + token
+ throw new BuildException(
+ "Invalid run level: "
+ + token
+ " - the 'startLevels' attribute must be a comma-separated list of run levels - the valid levels are "
+ REDHAT_RUN_LEVELS + ".");
}
if (levelChars.contains(level)) {
- throw new BuildException("The 'startLevels' attribute defines run level " + level + " more than once.");
+ throw new BuildException("The 'startLevels' attribute defines run level " + level
+ + " more than once.");
}
levelChars.add(level);
}
@@ -399,7 +414,7 @@ public class SystemServiceType extends AbstractBundleType {
private int executeCommand(String[] commandLine) throws IOException {
Execute executeTask = new Execute();
- executeTask.setCommandline(commandLine);
+ executeTask.setCommandline(commandLine);
return executeTask.execute();
}
diff --git a/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java b/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java
index 772c3e5..956ea93 100644
--- a/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java
+++ b/modules/common/ant-bundle/src/test/java/org/rhq/bundle/ant/AntLauncherTest.java
@@ -476,6 +476,71 @@ public class AntLauncherTest {
"777");
}
+ public void testSubdirectoriesInRecipe() throws Exception {
+ // We want to test a fresh install, so make sure the deploy dir doesn't pre-exist.
+ FileUtil.purge(DEPLOY_DIR, true);
+
+ // we need to create our own directory structure - let's build a temporary ant basedir
+ // and put our recipe in there as well as a subdirectory with a test raw file and test zip file
+ File antBasedir = FileUtil.createTempDirectory("anttest", ".test", null);
+ try {
+ File subdir = new File(antBasedir, "subdir"); // must match the name in the recipe
+ subdir.mkdirs();
+ writeFile("file1", subdir, "test1.txt"); // filename must match recipe
+ writeFile("file2", subdir, "test2.txt"); // filename must match recipe
+ createZip(new String[] { "one", "two" }, subdir, "test.zip", new String[] { "one.txt", "two.txt" });
+ createZip(new String[] { "3", "4" }, subdir, "test-explode.zip", new String[] { "three.txt", "four.txt" });
+ createZip(new String[] { "X=@@X@@\n" }, subdir, "test-replace.zip", new String[] { "template.txt" }); // will be exploded then recompressed
+ File recipeFile = new File(antBasedir, "deploy.xml");
+ FileUtil.copyFile(new File(ANT_BASEDIR, "test-bundle-subdir.xml"), recipeFile);
+
+ AntLauncher ant = new AntLauncher();
+ Properties inputProps = new Properties();
+ inputProps.setProperty(DeployPropertyNames.DEPLOY_DIR, DEPLOY_DIR.getPath());
+ inputProps.setProperty(DeployPropertyNames.DEPLOY_ID, String.valueOf(++this.deploymentId));
+ inputProps.setProperty(DeployPropertyNames.DEPLOY_PHASE, DeploymentPhase.INSTALL.name());
+ inputProps.setProperty("X", "alpha-omega");
+ List<BuildListener> buildListeners = createBuildListeners();
+
+ BundleAntProject project = ant.executeBundleDeployFile(recipeFile, inputProps, buildListeners);
+ assert project != null;
+ Set<String> bundleFiles = project.getBundleFileNames();
+ assert bundleFiles != null;
+ assert bundleFiles.size() == 5 : bundleFiles;
+ assert bundleFiles.contains("subdir/test1.txt") : bundleFiles;
+ assert bundleFiles.contains("subdir/test2.txt") : bundleFiles;
+ assert bundleFiles.contains("subdir/test.zip") : bundleFiles;
+ assert bundleFiles.contains("subdir/test-explode.zip") : bundleFiles;
+ assert bundleFiles.contains("subdir/test-replace.zip") : bundleFiles;
+
+ assert new File(DEPLOY_DIR, "another/foo.txt").exists() : "missing raw file from the destinationFile";
+ assert new File(DEPLOY_DIR, "second.dir/test2.txt").exists() : "missing raw file from the destinationDir";
+ assert !new File(DEPLOY_DIR, "subdir/test1.zip").exists() : "should not be here because destinationFile was specified";
+ assert !new File(DEPLOY_DIR, "subdir/test2.zip").exists() : "should not be here because destinationFile was specified";
+ assert new File(DEPLOY_DIR, "subdir/test.zip").exists() : "missing unexploded zip file";
+ assert new File(DEPLOY_DIR, "subdir/test-replace.zip").exists() : "missing unexploded zip file";
+ assert !new File(DEPLOY_DIR, "subdir/test-explode.zip").exists() : "should have been exploded";
+
+ // test that the file in the zip is realized
+ final String[] templateVarValue = new String[] { null };
+ ZipUtil.walkZipFile(new File(DEPLOY_DIR, "subdir/test-replace.zip"), new ZipUtil.ZipEntryVisitor() {
+ @Override
+ public boolean visit(ZipEntry entry, ZipInputStream stream) throws Exception {
+ if (entry.getName().equals("template.txt")) {
+ Properties props = new Properties();
+ props.load(stream);
+ templateVarValue[0] = props.getProperty("X");
+ }
+ return true;
+ }
+ });
+ assert templateVarValue[0] != null && templateVarValue[0].equals("alpha-omega") : templateVarValue[0];
+
+ } finally {
+ FileUtil.purge(antBasedir, true);
+ }
+ }
+
private List<BuildListener> createBuildListeners() {
List<BuildListener> buildListeners = new ArrayList<BuildListener>();
DefaultLogger logger = new DefaultLogger();
diff --git a/modules/common/ant-bundle/src/test/resources/test-bundle-subdir.xml b/modules/common/ant-bundle/src/test/resources/test-bundle-subdir.xml
new file mode 100644
index 0000000..940ecf1
--- /dev/null
+++ b/modules/common/ant-bundle/src/test/resources/test-bundle-subdir.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+
+<project name="test-bundle" default="main" xmlns:rhq="antlib:org.rhq.bundle">
+
+ <rhq:bundle name="test" version="1">
+
+ <rhq:input-property name="X" />
+
+ <rhq:deployment-unit name="appserver">
+ <rhq:file name="subdir/test1.txt" destinationFile="another/foo.txt" replace="false"/>
+ <rhq:file name="subdir/test2.txt" destinationDir="second.dir" replace="false"/>
+ <rhq:archive name="subdir/test.zip" exploded="false" />
+ <rhq:archive name="subdir/test-explode.zip" exploded="true" />
+ <rhq:archive name="subdir/test-replace.zip" exploded="false">
+ <rhq:replace>
+ <rhq:fileset includes="template.txt"/>
+ </rhq:replace>
+ </rhq:archive>
+ </rhq:deployment-unit>
+
+ </rhq:bundle>
+
+ <target name="main"/>
+
+</project>
\ No newline at end of file
12 years, 11 months
[rhq] 2 commits - modules/core modules/enterprise
by Jay Shaughnessy
modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java | 2
modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java | 38 ++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java | 59 ++-----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java | 81 ++++------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java | 21 --
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java | 6
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedResourcesPortlet.java | 9 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationsPortlet.java | 10 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java | 9 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MashupPortlet.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MessagePortlet.java | 5
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 42 ++---
18 files changed, 192 insertions(+), 131 deletions(-)
New commits:
commit 2d80a4ce1b73a6e799dc34893647e8cd746ed1bd
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Dec 23 10:31:28 2010 -0500
Dashboard Work
- Always use persisted dashboards. So, when using the default dashbaord,
persist it as opposed to just displaying it. This is trivial db overhead
and allows us to assume we're working with persisted entities (with assigned
ids). This simplifies some logic, especially since portlets unique key is
the id. (note, this was recommended by ghinkle and I agreed it was a good
idea.)
- Implemented hashcode/equals for DashboardPortlet. The dash portlets are
managed in a Set, which uses equals() comparisons. On persisted dash
updates the portlet objects for a dash are replaced and so object
comparisons were failing. Now using the overrides we perform "id"
comparisons.
- Now disable the Dash while persisting a dash update asynchronously. This
prevents the user from losing modifications made during that async window.
For example, rapid portlet removal could be imcomplete. (This replaces the
faulty "synchronized" logic I had put in earlier. synchronized methods are
not (cannot be) honored in smartgwts generated javascript. That code has been
reverted)
- note, [BZ 661808 Removing portlets from the dashboard is not working]
resulted from both the bad equals logic *and* the async update window
problem, yeesh...
- reenabled the ability to delete the last dashboard tab. We had prevented
this so that the user would not have a blank dashboards view. Instead, now
if the user kills his last dashboard we immediately assign and display a
new default dash for the user. This allows a user to delete a dash he
doesn't like/need and basically start over, instead of trying to edit the
current one back into shape.
- replaced some homegrown locatorId logic with SeleniumUtility.getSafeId()
- trivial: fix a few typos in method and variable names
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java b/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java
index 95e920d..4521f36 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/Dashboard.java
@@ -183,7 +183,7 @@ public class Dashboard implements Serializable {
portlets.add(storedPortlet);
}
- public Dashboard deepCoopy(boolean keepIds) {
+ public Dashboard deepCopy(boolean keepIds) {
Dashboard newDashboard = new Dashboard();
if (keepIds) {
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java b/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java
index 19debd6..a83b061 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java
@@ -174,4 +174,35 @@ public class DashboardPortlet implements Serializable {
public String toString() {
return "DashboardPortlet[id=" + id + ",key=" + portletKey + ",name=" + name + "]";
}
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + id;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+
+ if (!(obj instanceof DashboardPortlet)) {
+ return false;
+ }
+
+ final DashboardPortlet other = (DashboardPortlet) obj;
+
+ // id test is only valid for entities. if not persisted entities then fail.
+ if (id <= 0 || other.id <= 0) {
+ return false;
+ } else if (id != other.id) {
+ return false;
+ }
+
+ return true;
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
index 9feaffd..5843658 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java
@@ -59,6 +59,7 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIMenuButton;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableMenu;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
/**
* @author Greg Hinkle
@@ -197,19 +198,18 @@ public class DashboardView extends LocatableVLayout {
}
});
- Menu addPorletMenu = new Menu();
+ Menu addPortletMenu = new Menu();
for (String portletName : PortletFactory.getRegisteredPortletKeys()) {
- addPorletMenu.addItem(new MenuItem(portletName));
+ addPortletMenu.addItem(new MenuItem(portletName));
}
- addPortlet = new LocatableIMenuButton(extendLocatorId("AddPortal"), MSG.common_title_add_portlet(),
- addPorletMenu);
+ addPortlet = new LocatableIMenuButton(extendLocatorId("AddPortlet"), MSG.common_title_add_portlet(),
+ addPortletMenu);
- // addPortlet = new ButtonItem("addPortlet", "Add Portlet");
addPortlet.setIcon("[skin]/images/actions/add.png");
addPortlet.setAutoFit(true);
- addPorletMenu.addItemClickHandler(new ItemClickHandler() {
+ addPortletMenu.addItemClickHandler(new ItemClickHandler() {
public void onItemClick(ItemClickEvent itemClickEvent) {
String portletTitle = itemClickEvent.getItem().getTitle();
addPortlet(portletTitle, portletTitle);
@@ -325,11 +325,7 @@ public class DashboardView extends LocatableVLayout {
}
}
- /**
- * A synchronized call to ensure add/remove/save are exclusive.
- *
- */
- synchronized private void addPortlet(String portletKey, String portletName) {
+ private void addPortlet(String portletKey, String portletName) {
DashboardPortlet storedPortlet = new DashboardPortlet(portletName, portletKey, 250);
final PortletWindow newPortlet = new PortletWindow(extendLocatorId(portletKey), this, storedPortlet);
@@ -369,46 +365,39 @@ public class DashboardView extends LocatableVLayout {
newPortlet.show();
}
}, 750);
- save(storedDashboard);
+ save();
}
- /**
- * A synchronized call to ensure the remove and save are atomic.
- *
- * @param portlet
- */
- synchronized public void removePortlet(DashboardPortlet portlet) {
+ public void removePortlet(DashboardPortlet portlet) {
storedDashboard.removePortlet(portlet);
- save(storedDashboard);
+ save();
}
- /**
- * A synchronized call to ensure add/remove/save are exclusive.
- */
- synchronized private void setDashboard(Dashboard dashboard) {
- storedDashboard = dashboard;
+ public void save(Dashboard dashboard) {
+ if (null != dashboard) {
+ storedDashboard = dashboard;
+ save();
+ }
}
public void save() {
- save(storedDashboard);
- }
+ // since we reset storedDashboard after the async update completes, block modification of the dashboard
+ // during that interval.
+ DashboardView.this.disable();
- private void save(Dashboard dashboard) {
- GWTServiceLookup.getDashboardService().storeDashboard(dashboard, new AsyncCallback<Dashboard>() {
+ GWTServiceLookup.getDashboardService().storeDashboard(storedDashboard, new AsyncCallback<Dashboard>() {
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_dashboardManager_error(), caught);
+ DashboardView.this.enable();
}
public void onSuccess(Dashboard result) {
CoreGUI.getMessageCenter().notify(
new Message(MSG.view_dashboardManager_saved(result.getName()), Message.Severity.Info));
- // use the synchronized call to ensure add/delete portlet doesn't get interrupted. This is really
- // just limited protection for add/remove portlet. Since this now sets storedDashboard,
- // anything using the old version could lose edits. If we want to make this more robust we'll probably
- // need a locking mechanism for editing the dashboard.
- setDashboard(storedDashboard);
updateConfigs(result);
+ storedDashboard = result;
+ DashboardView.this.enable();
}
});
}
@@ -432,8 +421,8 @@ public class DashboardView extends LocatableVLayout {
// TODO: Note, we're using a sequence generated ID here as a locatorId. This is not optimal for repeatable
// tests as a change in the number of default portlets, or a change in test order could make a test
// non-repeatable. But, at the moment we lack the infrastructure to generate a unique, predictable id.
- Portlet view = viewFactory.getInstance(PortletFactory.replaceSpaces(portlet.getPortletKey())
- + "-" + Integer.toString(portlet.getId()));
+ Portlet view = viewFactory.getInstance(SeleniumUtility.getSafeId(portlet.getPortletKey() + "-"
+ + Integer.toString(portlet.getId())));
//add code to re-initialize refresh cycle for portlets
if (view instanceof AutoRefreshPortlet) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
index 1b837bf..e9df895 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
@@ -76,7 +76,7 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
// Each NamedTab is a Dashboard, name=Dashboard.id, title=Dashboard.name
private NamedTabSet tabSet;
- // The ID (0 for default dash)
+ // The ID
private String selectedTabName;
private IButton editButton;
@@ -109,12 +109,31 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
CoreGUI.getErrorHandler().handleError(MSG.view_dashboardsManager_error1(), caught);
}
- public void onSuccess(List<Dashboard> result) {
+ public void onSuccess(final List<Dashboard> result) {
initialized = true;
+
if (result.isEmpty()) {
- result.add(getDefaultDashboard());
+ // if the user has no dashboards persist a default dashboard for him to work with. In
+ // this way we're always working with a persisted dashboard and real entities.
+ addDefaultDashboard();
+
+ } else {
+ updateDashboards(result);
}
- updateDashboards(result);
+ }
+ });
+ }
+
+ private void addDefaultDashboard() {
+ dashboardService.storeDashboard(getDefaultDashboard(), new AsyncCallback<Dashboard>() {
+ public void onFailure(Throwable caught) {
+ CoreGUI.getErrorHandler().handleError(MSG.view_dashboardsManager_error1(), caught);
+ }
+
+ public void onSuccess(Dashboard defaultDashboard) {
+ List<Dashboard> dashboards = new ArrayList<Dashboard>(1);
+ dashboards.add(defaultDashboard);
+ updateDashboards(dashboards);
}
});
}
@@ -190,8 +209,6 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
}
- //updateFirstTabCanCloseState("update dashboards");
-
tabSet.addCloseClickHandler(new CloseClickHandler() {
public void onCloseClick(final TabCloseClickEvent tabCloseClickEvent) {
tabCloseClickEvent.cancel();
@@ -203,12 +220,11 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
dashboardsByName.remove(tabCloseClickEvent.getTab().getTitle());
tabSet.removeTab(tabCloseClickEvent.getTab());
dashboardView.delete();
- // if ( 0 == tabSet.getTabs().length) {
- //
- // }
- History.newItem(VIEW_ID.getName());
- //updateFirstTabCanCloseState("close handler");
+ // if it's the last tab go back to a default tab
+ if (0 == tabSet.getTabs().length) {
+ addDefaultDashboard();
+ }
}
}
});
@@ -311,8 +327,6 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
tabSet.selectTab(tab);
editMode = true;
editButton.setTitle(editMode ? MSG.common_title_view_mode() : MSG.common_title_edit_mode());
-
- //updateFirstTabCanCloseState("store dashboard");
}
});
}
@@ -325,16 +339,13 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
}
public void renderView(ViewPath viewPath) {
- NamedTab[] tabs = tabSet.getTabs();
-
// make sure we have at least a default dashboard tab
- if (0 == tabs.length) {
- List<Dashboard> defaultTabs = new ArrayList<Dashboard>(1);
- defaultTabs.add(getDefaultDashboard());
- updateDashboards(defaultTabs);
- tabs = tabSet.getTabs();
+ if (null == tabSet || 0 == tabSet.getTabs().length) {
+ return;
}
+ NamedTab[] tabs = tabSet.getTabs();
+
// if nothing selected or pathtab does not exist, default to the first tab
NamedTab selectedTab = tabs[0];
selectedTabName = selectedTab.getName();
@@ -351,8 +362,6 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
}
}
- //updateFirstTabCanCloseState("render view");
-
tabSet.selectTab(selectedTab);
}
@@ -364,13 +373,4 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
public boolean isInitialized() {
return initialized;
}
-
- // must be called when the tabset is first loaded (onInit), on each subsequent load, and whenever it changes
- //public void updateFirstTabCanCloseState(String comingFrom) {
- // do not allow closing if there is only one dashboard tab remaining
- // boolean canClose = tabSet.getTabs().length > 1;
- // NamedTab firstTab = tabSet.getTabs()[0];
- // firstTab.setCanClose(canClose);
- //}
-
}
commit 248c9ab7ade22850f2e39f32433cc8b9bbeb5504
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Dec 22 18:41:21 2010 -0500
Dashboard Work
- Add some doc to DashboardPortlet for name and portletKey semantics
- Remove improper I18N of portlet keys and use static keys
- Add explicit I18Nd default names for all portlets
- Make sure name and key are used properly
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java b/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java
index 5562dbe..19debd6 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/dashboard/DashboardPortlet.java
@@ -53,14 +53,17 @@ public class DashboardPortlet implements Serializable {
private static final long serialVersionUID = 1L;
+ // This is the only unique key. dashboard+portletKey+name does not have to be unique
@Column(name = "ID", nullable = false)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_DASHBOARD_PORTLET_ID_SEQ")
@Id
private int id;
+ // A non-displayed, persisted identifier for the portlet.
@Column(name = "PORTLET_KEY")
private String portletKey;
+ // A displayed, persisted, editable name for the portlet.
@Column(name = "NAME")
private String name;
@@ -167,4 +170,8 @@ public class DashboardPortlet implements Serializable {
newPortlet.configuration = this.configuration != null ? this.configuration.deepCopy(keepIds) : null;
return newPortlet;
}
+
+ public String toString() {
+ return "DashboardPortlet[id=" + id + ",key=" + portletKey + ",name=" + name + "]";
+ }
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
index 61bd111..1b837bf 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
@@ -190,7 +190,7 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
}
- updateFirstTabCanCloseState("update dashboards");
+ //updateFirstTabCanCloseState("update dashboards");
tabSet.addCloseClickHandler(new CloseClickHandler() {
public void onCloseClick(final TabCloseClickEvent tabCloseClickEvent) {
@@ -203,9 +203,12 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
dashboardsByName.remove(tabCloseClickEvent.getTab().getTitle());
tabSet.removeTab(tabCloseClickEvent.getTab());
dashboardView.delete();
+ // if ( 0 == tabSet.getTabs().length) {
+ //
+ // }
History.newItem(VIEW_ID.getName());
- updateFirstTabCanCloseState("close handler");
+ //updateFirstTabCanCloseState("close handler");
}
}
});
@@ -223,44 +226,40 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
dashboard.setColumnWidths("32%", "68%");
dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND, "#F1F2F3"));
- DashboardPortlet summary = new DashboardPortlet(MSG.view_dashboardsManager_inventory_title(),
- InventorySummaryPortlet.KEY, 230);
+ DashboardPortlet summary = new DashboardPortlet(InventorySummaryPortlet.NAME, InventorySummaryPortlet.KEY, 230);
dashboard.addPortlet(summary, 0, 0);
- DashboardPortlet tagCloud = new DashboardPortlet(MSG.view_dashboardsManager_tagcloud_title(),
- TagCloudPortlet.KEY, 200);
+ DashboardPortlet tagCloud = new DashboardPortlet(TagCloudPortlet.NAME, TagCloudPortlet.KEY, 200);
dashboard.addPortlet(tagCloud, 0, 1);
// Experimental
// StoredPortlet platformSummary = new StoredPortlet("Platform Summary", PlatformPortletView.KEY, 300);
// col2.add(platformSummary);
- DashboardPortlet welcome = new DashboardPortlet(MSG.view_dashboardsManager_message_title(), MessagePortlet.KEY,
- 180);
+ DashboardPortlet welcome = new DashboardPortlet(MessagePortlet.NAME, MessagePortlet.KEY, 180);
welcome.getConfiguration().put(
new PropertySimple("message", MSG.view_dashboardsManager_message_title_details()));
dashboard.addPortlet(welcome, 1, 0);
- DashboardPortlet news = new DashboardPortlet(MSG.view_dashboardsManager_mashup_title(), MashupPortlet.KEY, 320);
+ DashboardPortlet news = new DashboardPortlet(MashupPortlet.NAME, MashupPortlet.KEY, 320);
news.getConfiguration().put(
new PropertySimple("address", "http://rhq-project.org/display/RHQ/RHQ+News?decorator=popup"));
dashboard.addPortlet(news, 1, 1);
//
- DashboardPortlet discoveryQueue = new DashboardPortlet(MSG.view_portlet_autodiscovery_title(),
- AutodiscoveryPortlet.KEY, 250);
+ DashboardPortlet discoveryQueue = new DashboardPortlet(AutodiscoveryPortlet.NAME, AutodiscoveryPortlet.KEY, 250);
dashboard.addPortlet(discoveryQueue, 1, 2);
- DashboardPortlet recentAlerts = new DashboardPortlet(RecentAlertsPortlet.KEY, RecentAlertsPortlet.KEY, 250);
+ DashboardPortlet recentAlerts = new DashboardPortlet(RecentAlertsPortlet.NAME, RecentAlertsPortlet.KEY, 250);
dashboard.addPortlet(recentAlerts, 1, 3);
- DashboardPortlet recentlyAdded = new DashboardPortlet(MSG.common_title_recently_added(),
+ DashboardPortlet recentlyAdded = new DashboardPortlet(RecentlyAddedResourcesPortlet.NAME,
RecentlyAddedResourcesPortlet.KEY, 250);
dashboard.addPortlet(recentlyAdded, 1, 4);
- DashboardPortlet operations = new DashboardPortlet(MSG.common_title_operations(), OperationsPortlet.KEY, 500);
+ DashboardPortlet operations = new DashboardPortlet(OperationsPortlet.NAME, OperationsPortlet.KEY, 500);
dashboard.addPortlet(operations, 1, 5);
- DashboardPortlet problemResources = new DashboardPortlet(MSG.view_portlet_problem_resources_title(),
+ DashboardPortlet problemResources = new DashboardPortlet(ProblemResourcesPortlet.NAME,
ProblemResourcesPortlet.KEY, 250);
//initialize config for the problemResources portlet.
problemResources.getConfiguration()
@@ -313,7 +312,7 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
editMode = true;
editButton.setTitle(editMode ? MSG.common_title_view_mode() : MSG.common_title_edit_mode());
- updateFirstTabCanCloseState("store dashboard");
+ //updateFirstTabCanCloseState("store dashboard");
}
});
}
@@ -352,7 +351,7 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
}
}
- updateFirstTabCanCloseState("render view");
+ //updateFirstTabCanCloseState("render view");
tabSet.selectTab(selectedTab);
}
@@ -367,11 +366,11 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView
}
// must be called when the tabset is first loaded (onInit), on each subsequent load, and whenever it changes
- public void updateFirstTabCanCloseState(String comingFrom) {
- // do not allow closing if there is only one dashboard tab remaining
- boolean canClose = tabSet.getTabs().length > 1;
- NamedTab firstTab = tabSet.getTabs()[0];
- firstTab.setCanClose(canClose);
- }
+ //public void updateFirstTabCanCloseState(String comingFrom) {
+ // do not allow closing if there is only one dashboard tab remaining
+ // boolean canClose = tabSet.getTabs().length > 1;
+ // NamedTab firstTab = tabSet.getTabs()[0];
+ // firstTab.setCanClose(canClose);
+ //}
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
index 857f893..4e1ac46 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletFactory.java
@@ -37,6 +37,7 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.Inventor
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.TagCloudPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util.MashupPortlet;
import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util.MessagePortlet;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
/**
* @author Greg Hinkle
@@ -49,7 +50,9 @@ public class PortletFactory {
registeredPortlets = new HashMap<String, PortletViewFactory>();
registeredPortlets.put(InventorySummaryPortlet.KEY, InventorySummaryPortlet.Factory.INSTANCE);
+
registeredPortlets.put(RecentlyAddedResourcesPortlet.KEY, RecentlyAddedResourcesPortlet.Factory.INSTANCE);
+
registeredPortlets.put(PlatformSummaryPortlet.KEY, PlatformSummaryPortlet.Factory.INSTANCE);
registeredPortlets.put(AutodiscoveryPortlet.KEY, AutodiscoveryPortlet.Factory.INSTANCE);
@@ -63,8 +66,11 @@ public class PortletFactory {
registeredPortlets.put(FavoriteResourcesPortlet.KEY, FavoriteResourcesPortlet.Factory.INSTANCE);
registeredPortlets.put(MashupPortlet.KEY, MashupPortlet.Factory.INSTANCE);
+
registeredPortlets.put(MessagePortlet.KEY, MessagePortlet.Factory.INSTANCE);
+
registeredPortlets.put(ProblemResourcesPortlet.KEY, ProblemResourcesPortlet.Factory.INSTANCE);
+
registeredPortlets.put(OperationsPortlet.KEY, OperationsPortlet.Factory.INSTANCE);
}
@@ -75,7 +81,7 @@ public class PortletFactory {
// TODO: Note, we're using a sequence generated ID here as a locatorId. This is not optimal for repeatable
// tests as a change in the number of default portlets, or a change in test order could make a test
// non-repeatable. But, at the moment we lack the infrastructure to generate a unique, predictable id.
- Portlet view = viewFactory.getInstance(replaceSpaces(storedPortlet.getPortletKey()) + "-"
+ Portlet view = viewFactory.getInstance(SeleniumUtility.getSafeId(storedPortlet.getPortletKey()) + "-"
+ Integer.toString(storedPortlet.getId()));
view.configure(portletWindow, storedPortlet);
@@ -87,19 +93,6 @@ public class PortletFactory {
return view;
}
- /** Translated spaces to underscore. Spaces not allowed in locator ids.
- *
- * @param portletKey
- * @return
- */
- public static String replaceSpaces(String portletKey) {
- String translated = portletKey;
- if (portletKey != null) {
- translated = portletKey.replaceAll(" ", "_");
- }
- return translated;
- }
-
@SuppressWarnings("unchecked")
public static List<String> getRegisteredPortletKeys() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java
index e31ea1d..e92d367 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/queue/AutodiscoveryPortlet.java
@@ -50,8 +50,13 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout;
*/
public class AutodiscoveryPortlet extends ResourceAutodiscoveryView implements CustomSettingsPortlet,
AutoRefreshPortlet {
+
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "Autodiscovery";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_autodiscovery();
+
//ui attributes/properties/indentifiers
- public static final String KEY = MSG.view_portlet_autodiscovery_title();
private static final String AUTODISCOVERY_PLATFORM_MAX = "auto-discovery-platform-max";
private String unlimited = MSG.common_label_unlimited();
private String defaultValue = unlimited;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java
index 1681d58..b41778b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java
@@ -47,7 +47,10 @@ import org.rhq.enterprise.gui.coregui.client.util.MeasurementUtility;
*/
public class FavoriteResourcesPortlet extends ResourceSearchView implements AutoRefreshPortlet {
- public static final String KEY = MSG.view_portlet_favoriteResources_title();
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "FavoriteResources";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_favoriteResources();
public static final String CFG_TABLE_PREFS = "tablePreferences";
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java
index 0175f28..85a34ff 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java
@@ -47,7 +47,10 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitorin
*/
public class GraphPortlet extends SmallGraphView implements CustomSettingsPortlet {
- public static final String KEY = MSG.view_portlet_graph_title();
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "Graph";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_graph();
private PortletWindow portletWindow;
private DashboardPortlet storedPortlet;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java
index 3540d9b..12bbce7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformSummaryPortlet.java
@@ -62,11 +62,15 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableListGrid;
public class PlatformSummaryPortlet extends LocatableListGrid implements Portlet {
public static final ViewName VIEW_ID = new ViewName("CpuAndMemoryUtilization", MSG.view_reports_platforms());
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "PlatformSummary";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_platformSummary();
+
private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService();
private ResourceTypeGWTServiceAsync typeService = GWTServiceLookup.getResourceTypeGWTService();
private HashMap<Integer, PlatformMetricDefinitions> platformMetricDefinitionsHashMap = new HashMap<Integer, PlatformMetricDefinitions>();
- public static final String KEY = MSG.view_portlet_platform_title();
public PlatformSummaryPortlet(String locatorId) {
super(locatorId);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java
index a9a801d..df8e479 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java
@@ -57,7 +57,11 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
*/
public class RecentAlertsPortlet extends AlertHistoryView implements CustomSettingsPortlet, AutoRefreshPortlet {
- public static final String KEY = MSG.view_portlet_recentAlerts_title();
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "RecentAlerts";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_recentAlerts();
+
//widget keys also used in form population
public static final String ALERT_RANGE_DISPLAY_AMOUNT_VALUE = "alert-range-display-amount-value";
public static final String ALERT_RANGE_PRIORITY_VALUE = "alert-range-priority-value";
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedResourcesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedResourcesPortlet.java
index b80f0d3..f925bde 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedResourcesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/imported/RecentlyAddedResourcesPortlet.java
@@ -50,7 +50,10 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
public class RecentlyAddedResourcesPortlet extends LocatableVLayout implements CustomSettingsPortlet,
AutoRefreshPortlet {
- public static final String KEY = MSG.view_portlet_recentlyAdded_title();
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "RecentlyAddedResources";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_recentlyAddedResources();
private boolean simple = true;
private DashboardPortlet storedPortlet;
@@ -75,7 +78,7 @@ public class RecentlyAddedResourcesPortlet extends LocatableVLayout implements C
treeGrid = new TreeGrid();
treeGrid.setDataSource(getDataSource());
treeGrid.setAutoFetchData(true);
- treeGrid.setTitle(MSG.common_title_recently_added());
+ treeGrid.setTitle(MSG.view_portlet_defaultName_recentlyAddedResources());
treeGrid.setResizeFieldsInRealTime(true);
treeGrid.setTreeFieldTitle("Resource Name");
@@ -92,7 +95,7 @@ public class RecentlyAddedResourcesPortlet extends LocatableVLayout implements C
treeGrid.setFields(resourceNameField, timestampField);
if (!simple) {
- addMember(new HeaderLabel(MSG.common_title_recently_added()));
+ addMember(new HeaderLabel(MSG.view_portlet_defaultName_recentlyAddedResources()));
}
addMember(treeGrid);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationsPortlet.java
index 8ae6ee3..c884170 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/operations/OperationsPortlet.java
@@ -59,14 +59,16 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
*/
public class OperationsPortlet extends LocatableVLayout implements CustomSettingsPortlet, AutoRefreshPortlet {
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "Operations";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_operations();
+
//unique field/form identifiers
public static final String OPERATIONS_RANGE_COMPLETED_ENABLED = "operations-completed-enabled";
public static final String OPERATIONS_RANGE_SCHEDULED_ENABLED = "operations-scheduled-enabled";
public static final String OPERATIONS_RANGE_COMPLETED = "operations-range-completed";
public static final String OPERATIONS_RANGE_SCHEDULED = "operations-range-scheduled";
- //portlet key
- public static final String KEY = MSG.common_title_operations();
- private static final String TITLE = KEY;
private static String recentOperations = MSG.common_title_recent_operations();
private static String scheduledOperations = MSG.common_title_scheduled_operations();
public static String RANGE_DISABLED_MESSAGE = MSG.view_portlet_operations_disabled();
@@ -98,7 +100,7 @@ public class OperationsPortlet extends LocatableVLayout implements CustomSetting
protected void onInit() {
super.onInit();
//set title for larger container
- setTitle(TITLE);
+ //setTitle(TITLE);
this.recentOperationsGrid = new LocatableListGrid(recentOperations);
recentOperationsGrid.setDataSource(getDataSourceCompleted());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
index 8c6f106..d040f7c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/problems/ProblemResourcesPortlet.java
@@ -60,11 +60,14 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableLabel;
*/
public class ProblemResourcesPortlet extends Table implements CustomSettingsPortlet, AutoRefreshPortlet {
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "ProblemResources";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_problemResources();
+
//keys for smart gwt elements. should be unique
public static final String PROBLEM_RESOURCE_SHOW_HRS = "max-problems-query-span";
public static final String PROBLEM_RESOURCE_SHOW_MAX = "max-problems-shown";
- public static final String KEY = MSG.view_portlet_problem_resources_title();
- private static final String TITLE = KEY;
private DashboardPortlet storedPortlet;
//reference to datasource
private ProblemResourcesDataSource dataSource;
@@ -75,7 +78,7 @@ public class ProblemResourcesPortlet extends Table implements CustomSettingsPort
private Timer defaultReloader;
public ProblemResourcesPortlet(String locatorId) {
- super(locatorId, TITLE, true);
+ super(locatorId, NAME, true);
setShowHeader(false);
setShowFooter(true);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java
index adb7911..b5e11ec 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/InventorySummaryPortlet.java
@@ -50,11 +50,17 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
public class InventorySummaryPortlet extends LocatableVLayout implements AutoRefreshPortlet {
+
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "InventorySummary";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_inventorySummary();
+
private ResourceBossGWTServiceAsync resourceBossService = GWTServiceLookup.getResourceBossService();
private LocatableDynamicForm form;
- public static final String KEY = MSG.common_title_summary_counts();
private Timer defaultReloader;
+ private Timer reloader;
public InventorySummaryPortlet(String locatorId) {
super(locatorId);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java
index 1ca4b1f..716f66f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/summary/TagCloudPortlet.java
@@ -36,7 +36,10 @@ import org.rhq.enterprise.gui.coregui.client.report.tag.TagCloudView;
*/
public class TagCloudPortlet extends TagCloudView implements Portlet {
- public static final String KEY = MSG.view_portlet_tagCloud_title();
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "TagCloud";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_tagCloud();
public TagCloudPortlet(String locatorId) {
super(locatorId);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MashupPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MashupPortlet.java
index 8d6af1c..3cff303 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MashupPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MashupPortlet.java
@@ -41,7 +41,10 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHTMLPane;
*/
public class MashupPortlet extends LocatableHTMLPane implements ConfigurablePortlet {
- public static final String KEY = MSG.common_title_mashup();
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "Mashup";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_mashup();
public MashupPortlet(String locatorId) {
super(locatorId);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MessagePortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MessagePortlet.java
index bb37906..2a463aa 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MessagePortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/util/MessagePortlet.java
@@ -41,7 +41,10 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHTMLPane;
*/
public class MessagePortlet extends LocatableHTMLPane implements ConfigurablePortlet {
- public static final String KEY = MSG.view_portlet_message_title();
+ // A non-displayed, persisted identifier for the portlet
+ public static final String KEY = "Message";
+ // A default displayed, persisted name for the portlet
+ public static final String NAME = MSG.view_portlet_defaultName_message();
public MessagePortlet(String locatorId) {
super(locatorId);
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 0263cc9..548d86b 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
@@ -133,14 +133,14 @@ common_title_plugin = Plugin
common_title_port = Port
common_title_portlet_auto_refresh=Portlet Auto-refresh Interval
common_title_providers = Providers
-common_title_recently_added = Recently Added Resources
common_title_recent_alerts = Recent Alerts
-common_title_recent_configuration_updates=Recent Configuration Updates
-common_title_recent_event_counts=Recent Event Counts
-common_title_recent_measurements=Recent Measurements
-common_title_recent_oob_metrics=Recent Out of Bound metrics
+common_title_recent_configuration_updates = Recent Configuration Updates
+common_title_recent_event_counts = Recent Event Counts
+common_title_recent_measurements = Recent Measurements
+common_title_recent_oob_metrics = Recent Out of Bound metrics
common_title_recent_operations = Recent Operations
-common_title_recent_pkg_history=Recent Package History
+common_title_recent_pkg_history = Recent Package History
+common_title_recently_added = Recently Added
common_title_remove_column = Remove Column
common_title_repositories = Repositories
common_title_resource = Resource
@@ -168,7 +168,6 @@ common_title_stop= Stop
common_title_summary = Summary
common_title_tag_cloud = Tag Cloud
common_title_the = The
-common_title_summary_counts = Summary Counts
common_title_timestamp = Date/Time
common_title_total = Total
common_title_type = Type
@@ -1178,17 +1177,25 @@ view_dashboards_portlets_refresh_one_min = Refresh every 1 minute
view_dashboards_portlets_refresh_success1=Updated interval for portlets that auto-refresh
view_dashboards_portlets_refresh_success2=Stopping reload for portlets that auto-refresh
view_dashboardsManager_error1 = Failed to add new dashboard
-# // dup in common
-view_dashboardsManager_inventory_title = Inventory Summary
-view_dashboardsManager_mashup_title = RHQ News
-view_dashboardsManager_message_title = Welcome To RHQ
view_dashboardsManager_message_title_details = <h1>Welcome to RHQ</h1>\n<p>The RHQ project is an abstraction and plug-in based systems management suite that provides extensible and integrated systems management for multiple products and platforms across a set of core features. The project is designed with layered modules that provide a flexible architecture for deployment. It delivers a core user interface that delivers audited and historical management across an entire enterprise. A Server/Agent architecture provides remote management and plugins implement all specific support for managed products.</p>\n <p>This default dashboard can be edited by clicking the (edit mode) button above.</p>
-view_dashboardsManager_tagcloud_title = Tag Cloud
+
+view_portlet_defaultName_autodiscovery = Discovery Queue
+view_portlet_defaultName_favoriteResources = Favorite Resources
+view_portlet_defaultName_graph = Resource Graph
+view_portlet_defaultName_inventorySummary = Inventory Summary
+view_portlet_defaultName_mashup = RHQ News
+view_portlet_defaultName_message = Welcome To RHQ
+view_portlet_defaultName_operations = Operations
+view_portlet_defaultName_platformSummary = Platforms Summary
+view_portlet_defaultName_problemResources = Alerted or Unavailable Resources
+view_portlet_defaultName_recentAlerts = Recent Alerts
+view_portlet_defaultName_recentlyAddedResources = Recently Added Resources
+view_portlet_defaultName_tagCloud = Tag Cloud
+
+
view_portlet_autodiscovery_config_platform_selection = Number of platforms to display
view_portlet_autodiscovery_help_msg = This portlet offers the ability to import newly discovered resources into the inventory for monitoring and management or to ignore them from further action.
-view_portlet_autodiscovery_title = Discovery Queue
view_portlet_favoriteResources_msg = This portlet displays your favorite resources
-view_portlet_favoriteResources_title = Favorite Resources
view_portlet_generic_help = No help available for this portlet
view_portlet_generic_unconfigured = No settings available for this portlet
view_portlet_graph_configure_resource_graph = The resource to graph
@@ -1198,7 +1205,6 @@ view_portlet_graph_configure_title_desc = Configuration of the graph portlet
view_portlet_graph_help_msg = This Portlet supports the graphing of a resource metric.
view_portlet_graph_help_title = Graph Portlet
view_portlet_graph_help_unconfigured = This graph is unconfigured, click the settings button to configure.
-view_portlet_graph_title = Resource Graph
view_portlet_inventory_error1 = Failed to retrieve inventory summary
view_portlet_inventory_tooltip_expand = Click to show more details for this resource.
view_portlet_inventory_tooltip_collapse = Click to hide details for this resource.
@@ -1224,7 +1230,6 @@ view_portlet_operations_disabled = (Results currently disabled. Change settings
view_portlet_operations_help_msg = This portlet displays both operations that have occurred and are scheduled to occur.
view_portlet_platform_help_msg = This portlet displays information about platforms in inventory.
view_portlet_platform_platform_error_1 = Failed to load platform metrics
-view_portlet_platform_title = Platforms Summary
view_portlet_platform_type_error_1 = Could not load type data
view_portlet_problem_resources_config_display_maximum = Maximum number of Problem resources to display.
view_portlet_problem_resources_config_display_range = Show problem resources going back this many hours.
@@ -1233,20 +1238,15 @@ view_portlet_problem_resources_config_problem_label = problem resources on dashb
view_portlet_problem_resources_config_title = ProblemResourcesPortlet Configuration
view_portlet_problem_resources_config_title_desc = The configuration settings for the Problem resources portlet.
view_portlet_problem_resources_help = This portlet displays resources that have reported alerts or Down availability.
-view_portlet_problem_resources_title = Has Alerts or Currently Unavailable
view_portlet_recentAlerts_config_members = Select Members
view_portlet_recentAlerts_config_priority_label = priority Alerts,
view_portlet_recentAlerts_config_when = within the past
view_portlet_recentAlerts_help_msg = Displays recent alerts fired on resources visible to the current user login.
view_portlet_recentAlerts_fail_msg = Failed to load resources assigned for alert filtering.
-# // dup in common
-view_portlet_recentAlerts_title = Recent Alerts
view_portlet_recentlyAdded_approved_platforms = recently approved platforms on dashboard.
view_portlet_recentlyAdded_error1 = Failed to load recently added resources
view_portlet_recentlyAdded_help_msg = This portlet displays resources that have recently been imported into the inventory.
-view_portlet_recentlyAdded_title =Recently Added Portlet
view_portlet_tagCloud_help = portlet displays the relative tag counts in the system visible to the current user.
-view_portlet_tagCloud_title = TagCloud
# =================== Inventory =====================
12 years, 11 months
[rhq] modules/plugins
by mazz
modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/DeploymentAuditorBuildListener.java | 25 ++++------
1 file changed, 11 insertions(+), 14 deletions(-)
New commits:
commit 41332964f7e4ce702f11bb87e0b4db8301c01cdf
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Dec 23 08:31:57 2010 -0500
only send the message to the server if its a real audit message
diff --git a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/DeploymentAuditorBuildListener.java b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/DeploymentAuditorBuildListener.java
index b8476b9..b0a7d84 100644
--- a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/DeploymentAuditorBuildListener.java
+++ b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/DeploymentAuditorBuildListener.java
@@ -75,22 +75,19 @@ public class DeploymentAuditorBuildListener implements BuildListener {
}
public void messageLogged(BuildEvent event) {
- // this will see if this is an audit message (e.g. <rhq:audit>) and if so, send it up to the server
- // see org.rhq.bundle.ant.task.AuditTask.execute()
- // RHQ_AUDIT_MESSAGE___<status>___<action>___<info>___<message>___<details>
-
try {
- Status status = Status.SUCCESS;
- String action = "Audit Message";
- String info = "Recipe Audit Message";
- String message = new Date().toString();
- String details = null;
- BundleResourceDeployment deployment = this.bundleResourceDeployment;
- Category category = Category.AUDIT_MESSAGE;
-
+ // this will see if this is an audit message (e.g. <rhq:audit>) and if so, send it up to the server
+ // see org.rhq.bundle.ant.task.AuditTask.execute()
+ // RHQ_AUDIT_MESSAGE___<status>___<action>___<info>___<message>___<details>
String[] eventStrings = event.getMessage().split("___");
int index = 0;
if (eventStrings[index++].equals("RHQ_AUDIT_MESSAGE")) {
+ Status status = Status.SUCCESS;
+ String action = "Audit Message";
+ String info = "Recipe Audit Message";
+ String message = new Date().toString();
+ String details = null;
+
try {
String statusStr = eventStrings[index++];
status = Status.valueOf(statusStr.toUpperCase());
@@ -101,9 +98,9 @@ public class DeploymentAuditorBuildListener implements BuildListener {
} catch (ArrayIndexOutOfBoundsException e) {
// the message didn't have all the info, just skip looking for the rest and log what we have
}
+ this.bundleManagerProvider.auditDeployment(this.bundleResourceDeployment, action, info,
+ Category.AUDIT_MESSAGE, status, message, details);
}
-
- this.bundleManagerProvider.auditDeployment(deployment, action, info, category, status, message, details);
} catch (Exception e) {
throw new RuntimeException(e);
}
12 years, 11 months