[rhq] Branch 'release/jon3.0.x' - modules/enterprise
by ips
modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 20221edea965c18481e54b97d2b60ceb50bb1cea
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jan 31 17:12:36 2012 -0500
[BZ 784678] prevent NPE from occurring if -f option is not passed to CLI record command - instead throw a command line
parse exception with an informative error message (https://bugzilla.redhat.com/show_bug.cgi?id=784678)
(cherry picked from commit 55a89fae4b11ca5a8fecb668b87dbcef2bc04cf9)
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java
index e1244ae..f3363aa 100644
--- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java
+++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2012 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -98,8 +98,12 @@ public class RecordCommand implements ClientCommand {
code = getopt.getopt();
}
+ if (recordArgs.file == null) {
+ throw new CommandLineParseException("The file option must be specified.");
+ }
+
if (recordArgs.recordState == null) {
- throw new CommandLineParseException("Either the start or stop option must be specified");
+ throw new CommandLineParseException("Either the start or stop option must be specified.");
}
return recordArgs;
11 years, 10 months
[rhq] modules/enterprise
by ips
modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 55a89fae4b11ca5a8fecb668b87dbcef2bc04cf9
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jan 31 17:12:36 2012 -0500
[BZ 784678] prevent NPE from occurring if -f option is not passed to CLI record command - instead throw a command line
parse exception with an informative error message (https://bugzilla.redhat.com/show_bug.cgi?id=784678)
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java
index e38e81a..468076e 100644
--- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java
+++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2012 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -96,8 +96,12 @@ public class RecordCommand implements ClientCommand {
code = getopt.getopt();
}
+ if (recordArgs.file == null) {
+ throw new CommandLineParseException("The file option must be specified.");
+ }
+
if (recordArgs.recordState == null) {
- throw new CommandLineParseException("Either the start or stop option must be specified");
+ throw new CommandLineParseException("Either the start or stop option must be specified.");
}
return recordArgs;
11 years, 10 months
[rhq] modules/enterprise
by ips
modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java | 1 -
1 file changed, 1 deletion(-)
New commits:
commit ed89cb1f3eb14ef0a805d0723635236bd5870a98
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jan 31 16:59:05 2012 -0500
(minor) remove unused import
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java
index a6b97b8..d42fc6d 100755
--- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java
+++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java
@@ -25,7 +25,6 @@ package org.rhq.enterprise.client;
import gnu.getopt.Getopt;
import gnu.getopt.LongOpt;
-import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
11 years, 10 months
[rhq] modules/enterprise
by ips
modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java | 26 +---------
1 file changed, 3 insertions(+), 23 deletions(-)
New commits:
commit 0c0a5c916127fd3235850e6619d61eaaf96c88eb
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jan 31 16:58:15 2012 -0500
remove a bunch of dead code
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java
index d4444fe..a6b97b8 100755
--- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java
+++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java
@@ -65,8 +65,6 @@ public class ClientMain {
*/
private Thread inputLoopThread;
- private BufferedReader inputReader;
-
// JLine console reader
private ConsoleReader consoleReader;
@@ -114,7 +112,7 @@ public class ClientMain {
private static void initCommands() {
for (Class<ClientCommand> commandClass : ClientCommand.COMMANDS) {
- ClientCommand command = null;
+ ClientCommand command;
try {
command = commandClass.newInstance();
commands.put(command.getPromptCommandString(), command);
@@ -136,8 +134,7 @@ public class ClientMain {
this.serviceCompletor.setServices(remoteClient.getManagers());
}
}
-
- //
+
public ClientMain() throws Exception {
// this.inputReader = new BufferedReader(new
@@ -167,24 +164,15 @@ public class ClientMain {
consoleReader.setUsePagination(true);
}
- // ?? what is this again? Might be able to remove this.
- public void start() {
- outputWriter = new PrintWriter(System.out);
- // inputReader = new BufferedReader(new InputStreamReader(System.in));
-
- }
-
public String getUserInput(String prompt) {
String input_string = "";
- boolean use_default_prompt = (prompt == null);
while ((input_string != null) && (input_string.trim().length() == 0)) {
if (prompt == null) {
if (!loggedIn()) {
prompt = "unconnected$ ";
} else {
- // prompt = host + ":" + port + "> ";
// Modify the prompt to display host:port(logged-in-user)
String loggedInUser = "";
if ((getSubject() != null) && (getSubject().getName() != null)) {
@@ -197,12 +185,10 @@ public class ClientMain {
}
}
}
- // outputWriter.print(prompt);
try {
outputWriter.flush();
input_string = consoleReader.readLine(prompt);
- // inputReader.readLine();
} catch (Exception e) {
input_string = null;
}
@@ -213,12 +199,6 @@ public class ClientMain {
if (!stdinInput) {
outputWriter.println(input_string);
}
- } else if (!stdinInput) {
- // if we are processing a script, we hit the EOF, so close the inputstream
- try {
- inputReader.close();
- } catch (IOException e1) {
- }
}
return input_string;
@@ -602,7 +582,7 @@ public class ClientMain {
/**
* This method allows ClientCommands to insert a small note to be displayed after the command has been executed. A
- * note can be an indicaiton of a problem that was handled or a note about some option that should be changed.
+ * note can be an indication of a problem that was handled or a note about some option that should be changed.
*
* These notes are meant to be terse, and pasted/purged at the end of every command execution.
*
11 years, 10 months
[rhq] Branch 'release/jon3.0.x' - modules/enterprise
by ips
modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java | 26 ++++++----
1 file changed, 16 insertions(+), 10 deletions(-)
New commits:
commit 05fa50e1833a66f2e12dd59bd55839c2b258e765
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jan 31 16:43:11 2012 -0500
[BZ 785218] fix so -v/--version option does not print redundant info
(https://bugzilla.redhat.com/show_bug.cgi?id=785218)
(cherry picked from commit 3c0e9542e0ddfa60828ea44c37af715a79bfcc6b)
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java
index 191c537..d4444fe 100755
--- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java
+++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2012 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -82,6 +82,7 @@ public class ClientMain {
private String user;
private String pass;
private ArrayList<String> notes = new ArrayList<String>();
+ private boolean showDetailedVersion;
// reference to the webservice reference factory
private RemoteClient remoteClient;
@@ -403,7 +404,7 @@ public class ClientMain {
}
private void displayUsage() {
- outputWriter.println("rhq-cli.sh [-h] [-u user] [-p pass] [-P] [-s host] [-t port] [-f file]|[-c command]");
+ outputWriter.println("rhq-cli.sh [-h] [-u user] [-p pass] [-P] [-s host] [-t port] [-v] [-f file]|[-c command]");
}
void processArguments(String[] args) throws IllegalArgumentException, IOException {
@@ -478,10 +479,10 @@ public class ClientMain {
setHost(getopt.getOptarg());
break;
}
- case 'r': {
- setTransport(getopt.getOptarg());
- break;
- }
+ case 'r': {
+ setTransport(getopt.getOptarg());
+ break;
+ }
case 't': {
String portArg = getopt.getOptarg();
try {
@@ -492,15 +493,20 @@ public class ClientMain {
break;
}
case 'v': {
- String versionString = Version.getProductNameAndVersionBuildInfo();
- outputWriter.println(versionString);
+ showDetailedVersion = true;
break;
}
}
}
if (interactiveMode) {
- outputWriter.println(Version.getProductNameAndVersion());
+ String version = (showDetailedVersion) ? Version.getProductNameAndVersionBuildInfo() :
+ Version.getProductNameAndVersion();
+ outputWriter.println(version);
+ if (showDetailedVersion && args.length == 1) {
+ // If -v was the only option specified, exit after printing the version.
+ System.exit(0);
+ }
}
if (user != null && pass != null) {
@@ -516,7 +522,7 @@ public class ClientMain {
}
if (!interactiveMode) {
- commands.get("exec").execute(this, execCmdLine.toArray(new String[] {}));
+ commands.get("exec").execute(this, execCmdLine.toArray(new String[execCmdLine.size()]));
}
}
11 years, 10 months
[rhq] modules/enterprise
by ips
modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java | 26 ++++++----
1 file changed, 16 insertions(+), 10 deletions(-)
New commits:
commit 3c0e9542e0ddfa60828ea44c37af715a79bfcc6b
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jan 31 16:43:11 2012 -0500
[BZ 785218] fix so -v/--version option does not print redundant info
(https://bugzilla.redhat.com/show_bug.cgi?id=785218)
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java
index 191c537..d4444fe 100755
--- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java
+++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2012 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -82,6 +82,7 @@ public class ClientMain {
private String user;
private String pass;
private ArrayList<String> notes = new ArrayList<String>();
+ private boolean showDetailedVersion;
// reference to the webservice reference factory
private RemoteClient remoteClient;
@@ -403,7 +404,7 @@ public class ClientMain {
}
private void displayUsage() {
- outputWriter.println("rhq-cli.sh [-h] [-u user] [-p pass] [-P] [-s host] [-t port] [-f file]|[-c command]");
+ outputWriter.println("rhq-cli.sh [-h] [-u user] [-p pass] [-P] [-s host] [-t port] [-v] [-f file]|[-c command]");
}
void processArguments(String[] args) throws IllegalArgumentException, IOException {
@@ -478,10 +479,10 @@ public class ClientMain {
setHost(getopt.getOptarg());
break;
}
- case 'r': {
- setTransport(getopt.getOptarg());
- break;
- }
+ case 'r': {
+ setTransport(getopt.getOptarg());
+ break;
+ }
case 't': {
String portArg = getopt.getOptarg();
try {
@@ -492,15 +493,20 @@ public class ClientMain {
break;
}
case 'v': {
- String versionString = Version.getProductNameAndVersionBuildInfo();
- outputWriter.println(versionString);
+ showDetailedVersion = true;
break;
}
}
}
if (interactiveMode) {
- outputWriter.println(Version.getProductNameAndVersion());
+ String version = (showDetailedVersion) ? Version.getProductNameAndVersionBuildInfo() :
+ Version.getProductNameAndVersion();
+ outputWriter.println(version);
+ if (showDetailedVersion && args.length == 1) {
+ // If -v was the only option specified, exit after printing the version.
+ System.exit(0);
+ }
}
if (user != null && pass != null) {
@@ -516,7 +522,7 @@ public class ClientMain {
}
if (!interactiveMode) {
- commands.get("exec").execute(this, execCmdLine.toArray(new String[] {}));
+ commands.get("exec").execute(this, execCmdLine.toArray(new String[execCmdLine.size()]));
}
}
11 years, 10 months
[rhq] pom.xml
by Heiko W. Rupp
pom.xml | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 35e9cce2d3dc07636bf2ece0acbde13a3b862eeb
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jan 31 22:33:36 2012 +0100
Upgrade RESTEasy to 2.3.1.GA
diff --git a/pom.xml b/pom.xml
index 3b77493..44c6b34 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,7 +92,7 @@
<twitter4j.version>2.2.4</twitter4j.version>
<commons-codec.version>1.4</commons-codec.version>
<!-- NOTE (ips, 10/04/11): Upgrading testng to 6.2.x causes 10 server-jar tests to fail for an unknown reason. -->
- <!-- NOTE (jshaughn, 01/20/12): With the latest work, the sserver-jar tests passed using testng to 6.3.1, so perhaps an upgrade is possible -->
+ <!-- NOTE (jshaughn, 01/20/12): With the latest work, the sserver-jar tests passed using testng to 6.3.1, so perhaps an upgrade is possible -->
<testng.version>6.1.1</testng.version>
<cobertura.version>1.9.4.1</cobertura.version>
<augeas.version>0.9.0</augeas.version>
@@ -101,7 +101,7 @@
<augeas.zip.location>${settings.localRepository}/net/augeas/augeas-native/${augeas.version}</augeas.zip.location>
<augeas.zip.mask>*-${augeas.classifier}.zip</augeas.zip.mask>
<ant.contrib.version>1.0b3</ant.contrib.version>
- <resteasy.version>2.2.3.GA</resteasy.version>
+ <resteasy.version>2.3.1.GA</resteasy.version>
<freemarker.version>2.3.18</freemarker.version>
<rhq.db.admin.username>rhqadmin</rhq.db.admin.username>
@@ -888,11 +888,11 @@
<phase>generate-sources</phase>
<configuration>
<tasks>
- <mkdir dir="target" />
+ <mkdir dir="target" />
<tstamp>
<format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" timezone="GMT" />
- </tstamp>
+ </tstamp>
<echo file="target/build.properties">buildTime = ${buildTime}${line.separator}</echo>
<exec executable="git" outputproperty="buildNumber" failonerror="false" failifexecutionfails="false">
@@ -918,7 +918,7 @@
</tasks>
</configuration>
</execution>
-
+
<execution>
<id>javadoc-dist</id>
<phase>site</phase>
@@ -949,7 +949,7 @@
</goals>
<configuration>
<files>
- <file>${project.build.directory}/build.properties</file>
+ <file>${project.build.directory}/build.properties</file>
</files>
<quiet>true</quiet>
</configuration>
11 years, 10 months
[rhq] Branch 'release/jon3.0.x' - modules/enterprise
by ips
modules/enterprise/remoting/cli/pom.xml | 8 -
modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/VersionCommand.java | 49 ++++++++--
2 files changed, 41 insertions(+), 16 deletions(-)
New commits:
commit a4a6b535f5431652372af02cf77483e8d5f6ae03
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jan 31 16:08:05 2012 -0500
[BZ 784983] fix output of CLI version command (https://bugzilla.redhat.com/show_bug.cgi?id=784983)
(cherry picked from commit 43f016c9d9da95d2f5ea1bed4d1ee7fdbf9e07c3)
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index d94c40b..8ed89b5 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -178,14 +178,6 @@
</includes>
<archive>
<index>true</index>
- <manifestEntries>
- <Implementation-Title>${rhq.product.name} - ${project.name}</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- <Specification-Vendor>org.jboss</Specification-Vendor>
- <Specification-Title>JBossWS</Specification-Title>
- <Specification-Version>${jbossws-native-dist.version}</Specification-Version>
- <Build-Number>${buildNumber}</Build-Number>
- </manifestEntries>
</archive>
</configuration>
</plugin>
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/VersionCommand.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/VersionCommand.java
index d27c3f3..2df0b72 100644
--- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/VersionCommand.java
+++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/VersionCommand.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2012 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -19,7 +19,10 @@
package org.rhq.enterprise.client.commands;
import java.util.Properties;
+import java.util.jar.Attributes;
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
import org.rhq.enterprise.client.ClientMain;
import org.rhq.enterprise.client.Version;
@@ -35,26 +38,56 @@ public class VersionCommand implements ClientCommand {
}
public boolean execute(ClientMain client, String[] args) {
- if (args.length <= 1) {
+ VersionArgs versionArgs = parseArgs(args);
+ if (versionArgs.verbose) {
client.getPrintWriter().println(Version.getVersionPropertiesAsString());
} else {
Properties props = Version.getVersionProperties();
- for (int i = 1; i < args.length; i++) {
- client.getPrintWriter().println(args[i] + "=" + props.getProperty(args[i], "<unknown>"));
- }
+ String version = props.getProperty(Attributes.Name.IMPLEMENTATION_VERSION.toString());
+ client.getPrintWriter().println(version);
}
+
return true;
}
public String getSyntax() {
- return "version [prop name]...";
+ return getPromptCommandString() + " [-v | --verbose]";
}
public String getHelp() {
- return "Show version information and properties";
+ return "Show CLI version information";
}
public String getDetailedHelp() {
- return getHelp();
+ return getHelp() + ". If no arguments are specified, the CLI's version is printed. If the verbose option is "
+ + "specified, the values of the main attributes from the CLI jar's MANIFEST.MF are printed.";
+ }
+
+ private VersionArgs parseArgs(String[] args) {
+ String shortOpts = "-:v";
+ LongOpt[] longOpts = {
+ new LongOpt("verbose", LongOpt.OPTIONAL_ARGUMENT, null, 'v')
+ };
+ Getopt getopt = new Getopt("exec", args, shortOpts, longOpts);
+
+ VersionArgs versionArgs = new VersionArgs();
+
+ int code = getopt.getopt();
+ while (code != -1) {
+ switch (code) {
+ case ':':
+ throw new IllegalArgumentException("Illegal option.");
+ case 'v':
+ versionArgs.verbose = true;
+ break;
+ }
+ code = getopt.getopt();
+ }
+
+ return versionArgs;
+ }
+
+ private static class VersionArgs {
+ boolean verbose;
}
}
\ No newline at end of file
11 years, 10 months
[rhq] 3 commits - modules/enterprise
by ips
modules/enterprise/remoting/cli/pom.xml | 8 -
modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java | 6 -
modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/VersionCommand.java | 49 ++++++++--
3 files changed, 43 insertions(+), 20 deletions(-)
New commits:
commit 43f016c9d9da95d2f5ea1bed4d1ee7fdbf9e07c3
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jan 31 16:08:05 2012 -0500
[BZ 784983] fix output of CLI version command (https://bugzilla.redhat.com/show_bug.cgi?id=784983)
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index 32921bb..21e9c47 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -172,14 +172,6 @@
</includes>
<archive>
<index>true</index>
- <manifestEntries>
- <Implementation-Title>${rhq.product.name} - ${project.name}</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- <Specification-Vendor>org.jboss</Specification-Vendor>
- <Specification-Title>JBossWS</Specification-Title>
- <Specification-Version>${jbossws-native-dist.version}</Specification-Version>
- <Build-Number>${buildNumber}</Build-Number>
- </manifestEntries>
</archive>
</configuration>
</plugin>
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/VersionCommand.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/VersionCommand.java
index d27c3f3..2df0b72 100644
--- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/VersionCommand.java
+++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/VersionCommand.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2012 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -19,7 +19,10 @@
package org.rhq.enterprise.client.commands;
import java.util.Properties;
+import java.util.jar.Attributes;
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
import org.rhq.enterprise.client.ClientMain;
import org.rhq.enterprise.client.Version;
@@ -35,26 +38,56 @@ public class VersionCommand implements ClientCommand {
}
public boolean execute(ClientMain client, String[] args) {
- if (args.length <= 1) {
+ VersionArgs versionArgs = parseArgs(args);
+ if (versionArgs.verbose) {
client.getPrintWriter().println(Version.getVersionPropertiesAsString());
} else {
Properties props = Version.getVersionProperties();
- for (int i = 1; i < args.length; i++) {
- client.getPrintWriter().println(args[i] + "=" + props.getProperty(args[i], "<unknown>"));
- }
+ String version = props.getProperty(Attributes.Name.IMPLEMENTATION_VERSION.toString());
+ client.getPrintWriter().println(version);
}
+
return true;
}
public String getSyntax() {
- return "version [prop name]...";
+ return getPromptCommandString() + " [-v | --verbose]";
}
public String getHelp() {
- return "Show version information and properties";
+ return "Show CLI version information";
}
public String getDetailedHelp() {
- return getHelp();
+ return getHelp() + ". If no arguments are specified, the CLI's version is printed. If the verbose option is "
+ + "specified, the values of the main attributes from the CLI jar's MANIFEST.MF are printed.";
+ }
+
+ private VersionArgs parseArgs(String[] args) {
+ String shortOpts = "-:v";
+ LongOpt[] longOpts = {
+ new LongOpt("verbose", LongOpt.OPTIONAL_ARGUMENT, null, 'v')
+ };
+ Getopt getopt = new Getopt("exec", args, shortOpts, longOpts);
+
+ VersionArgs versionArgs = new VersionArgs();
+
+ int code = getopt.getopt();
+ while (code != -1) {
+ switch (code) {
+ case ':':
+ throw new IllegalArgumentException("Illegal option.");
+ case 'v':
+ versionArgs.verbose = true;
+ break;
+ }
+ code = getopt.getopt();
+ }
+
+ return versionArgs;
+ }
+
+ private static class VersionArgs {
+ boolean verbose;
}
}
\ No newline at end of file
commit 5853591e052fc9bf2e852f98c6fdb9ad4f278c2a
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jan 31 16:00:44 2012 -0500
minor: make help output consistent w/ the other CLI commands
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java
index 7db869a..e38e81a 100644
--- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java
+++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java
@@ -128,7 +128,7 @@ public class RecordCommand implements ClientCommand {
}
public String getHelp() {
- return "Records user input commands to a specified file. Use the --start option to begin recording. Use the " +
+ return "Record user input commands to a specified file. Use the --start option to begin recording. Use the " +
"--end option to stop recording. Use --append to append output to the end of an existing file; otherwise, " +
"recording will start at the beginning of the file.";
}
commit ab6ce9d9ddbb25d78a8d46859a9e025a2d820094
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jan 31 15:34:47 2012 -0500
fix typo and remove redundant import
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java
index e1244ae..7db869a 100644
--- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java
+++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java
@@ -20,10 +20,8 @@
* if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
package org.rhq.enterprise.client.commands;
-import org.rhq.enterprise.client.Controller;
import org.rhq.enterprise.client.ClientMain;
import org.rhq.enterprise.client.NoOpRecorder;
import org.rhq.enterprise.client.Recorder;
@@ -132,7 +130,7 @@ public class RecordCommand implements ClientCommand {
public String getHelp() {
return "Records user input commands to a specified file. Use the --start option to begin recording. Use the " +
"--end option to stop recording. Use --append to append output to the end of an existing file; otherwise, " +
- "recording will start at the begining of the file.";
+ "recording will start at the beginning of the file.";
}
public String getDetailedHelp() {
11 years, 10 months
[rhq] Branch 'feature/gwt-upgrade' - 2 commits - modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java | 29 ++++++----
modules/enterprise/gui/coregui/src/main/webapp/images/global/permission_checked_disabled_11.png |binary
2 files changed, 20 insertions(+), 9 deletions(-)
New commits:
commit a4c0b1aaf0dbbc3d1a82292534eb224993fb2378
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Tue Jan 31 12:29:47 2012 -0800
[BZ734162] Improvement: (UXD) Non-editable checkbox in Roles is confusing. Added non-enabled checkbox for when read-only checkbox is checked. Kind of a third state - checked, not checked and checked read-only(disabled check).
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
index 36c0c3d..1ebd2a2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
@@ -160,7 +160,7 @@ public class PermissionsEditor extends LocatableVStack {
descriptionField.setWrap(true);
final ListGridField authorizedField = createAuthorizedField("authorized",
- MSG.view_adminRoles_permissions_isAuthorized(), "name", grid);
+ MSG.view_adminRoles_permissions_isAuthorized(), "name", grid, false);
grid.setFields(iconField, displayNameField, authorizedField, descriptionField);
@@ -203,9 +203,9 @@ public class PermissionsEditor extends LocatableVStack {
descriptionField.setWrap(true);
ListGridField readField = createAuthorizedField("readAuthorized", MSG.view_adminRoles_permissions_isRead(),
- "readName", grid);
+ "readName", grid, true);
ListGridField writeField = createAuthorizedField("writeAuthorized", MSG.view_adminRoles_permissions_isWrite(),
- "writeName", grid);
+ "writeName", grid, false);
grid.setFields(iconField, displayNameField, readField, writeField, descriptionField);
@@ -298,24 +298,30 @@ public class PermissionsEditor extends LocatableVStack {
return grid;
}
- private ListGridField createAuthorizedField(String name, String title, final String nameField, final ListGrid grid) {
+ private ListGridField createAuthorizedField(String name, String title, final String nameField, final ListGrid grid, boolean readOnlyColumn) {
final ListGridField authorizedField = new ListGridField(name, title, 65);
// Show images rather than true/false.
authorizedField.setType(ListGridFieldType.IMAGE);
authorizedField.setImageSize(11);
+
LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>(2);
- valueMap.put(Boolean.TRUE.toString(), "global/permission_enabled_11.png");
- valueMap.put(Boolean.FALSE.toString(), "global/permission_disabled_11.png");
+ // set the proper images different for read-only column
+ if(readOnlyColumn){
+ valueMap.put(Boolean.TRUE.toString(), "global/permission_checked_disabled_11.png");
+ valueMap.put(Boolean.FALSE.toString(), "global/permission_disabled_11.png");
+ }else {
+ valueMap.put(Boolean.TRUE.toString(), "global/permission_enabled_11.png");
+ valueMap.put(Boolean.FALSE.toString(), "global/permission_disabled_11.png");
+ }
+ authorizedField.setValueMap(valueMap);
+ authorizedField.setCanEdit(true);
CheckboxItem editor = new CheckboxItem();
authorizedField.setEditorType(editor);
if (!this.isReadOnly) {
Log.debug("Non-Readonly field " +name);
- authorizedField.setCanEdit(true);
- valueMap.put(Boolean.TRUE.toString(), "global/permission_enabled_11.png");
- valueMap.put(Boolean.FALSE.toString(), "global/permission_disabled_11.png");
grid.setEditEvent(ListGridEditEvent.CLICK);
final Record[] recordBeingEdited = { null };
authorizedField.addRecordClickHandler(new RecordClickHandler() {
@@ -358,14 +364,7 @@ public class PermissionsEditor extends LocatableVStack {
}
}
});
- } else {
- Log.debug("Readonly field " +name);
- authorizedField.setCanEdit(false);
- // used different image for read-only
- valueMap.put(Boolean.TRUE.toString(), "global/permission_checked_disabled_11.png");
- valueMap.put(Boolean.FALSE.toString(), "global/permission_disabled_11.png");
}
- authorizedField.setValueMap(valueMap);
return authorizedField;
}
commit c37ea2641b13e7cfdb3f939e0b916916caa3d5fe
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Tue Jan 31 11:00:40 2012 -0800
[BZ734162] Improvement: (UXD) Non-editable checkbox in Roles is confusing.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
index 2ca1d73..36c0c3d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionsEditor.java
@@ -24,6 +24,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Set;
+import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.JavaScriptObject;
import com.smartgwt.client.core.RefDataClass;
import com.smartgwt.client.data.Record;
@@ -33,6 +34,7 @@ import com.smartgwt.client.types.ListGridEditEvent;
import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.util.JSOHelper;
import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.CheckboxItem;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
@@ -305,13 +307,16 @@ public class PermissionsEditor extends LocatableVStack {
LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>(2);
valueMap.put(Boolean.TRUE.toString(), "global/permission_enabled_11.png");
valueMap.put(Boolean.FALSE.toString(), "global/permission_disabled_11.png");
- authorizedField.setValueMap(valueMap);
+
+ CheckboxItem editor = new CheckboxItem();
+ authorizedField.setEditorType(editor);
if (!this.isReadOnly) {
+ Log.debug("Non-Readonly field " +name);
authorizedField.setCanEdit(true);
+ valueMap.put(Boolean.TRUE.toString(), "global/permission_enabled_11.png");
+ valueMap.put(Boolean.FALSE.toString(), "global/permission_disabled_11.png");
grid.setEditEvent(ListGridEditEvent.CLICK);
- CheckboxItem editor = new CheckboxItem();
- authorizedField.setEditorType(editor);
final Record[] recordBeingEdited = { null };
authorizedField.addRecordClickHandler(new RecordClickHandler() {
public void onRecordClick(RecordClickEvent event) {
@@ -353,7 +358,14 @@ public class PermissionsEditor extends LocatableVStack {
}
}
});
+ } else {
+ Log.debug("Readonly field " +name);
+ authorizedField.setCanEdit(false);
+ // used different image for read-only
+ valueMap.put(Boolean.TRUE.toString(), "global/permission_checked_disabled_11.png");
+ valueMap.put(Boolean.FALSE.toString(), "global/permission_disabled_11.png");
}
+ authorizedField.setValueMap(valueMap);
return authorizedField;
}
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/permission_checked_disabled_11.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/permission_checked_disabled_11.png
new file mode 100644
index 0000000..00bba51
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/permission_checked_disabled_11.png differ
11 years, 10 months