You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/02/17 12:37:26 UTC

[11/50] [abbrv] incubator-taverna-commandline git commit: Add -bundle (replaces -outputdoc)

Add -bundle (replaces -outputdoc)

Saves Workflow Run Bundle to file


Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/commit/e8f020f4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/tree/e8f020f4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/diff/e8f020f4

Branch: refs/heads/master
Commit: e8f020f400ec6c3dfa13fb3ca61d34e5f0c38fff
Parents: 473e379
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Tue Oct 28 22:30:21 2014 +0000
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Tue Oct 28 22:30:21 2014 +0000

----------------------------------------------------------------------
 .../commandline/CommandLineOptionsImpl.java     | 30 ++++++++++++++------
 1 file changed, 22 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/blob/e8f020f4/src/main/java/uk/org/taverna/commandline/CommandLineOptionsImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/uk/org/taverna/commandline/CommandLineOptionsImpl.java b/src/main/java/uk/org/taverna/commandline/CommandLineOptionsImpl.java
index 78e9b0d..b702e03 100644
--- a/src/main/java/uk/org/taverna/commandline/CommandLineOptionsImpl.java
+++ b/src/main/java/uk/org/taverna/commandline/CommandLineOptionsImpl.java
@@ -49,6 +49,8 @@ import org.apache.log4j.Logger;
  */
 public class CommandLineOptionsImpl implements CommandLineOptions {
 
+	private static final String OUTPUTDIR = "outputdir";
+	private static final String BUNDLE = "bundle";
 	private static final Logger logger = Logger.getLogger(CommandLineOptionsImpl.class);
 	private Options options;
 	private CommandLine commandLine;
@@ -202,7 +204,7 @@ public class CommandLineOptionsImpl implements CommandLineOptions {
 	 */
 	@Override
 	public String getOutputDirectory() {
-		return getOptionValue("outputdir");
+		return getOptionValue(OUTPUTDIR);
 	}
 
 	@Override
@@ -297,11 +299,11 @@ public class CommandLineOptionsImpl implements CommandLineOptions {
 				.withDescription(
 						"Save outputs as files in directory, default "
 								+ "is to make a new directory workflowName_output.")
-				.create("outputdir");
+				.create(OUTPUTDIR);
 
-		Option outputdocOption = OptionBuilder.withArgName("document").hasArg()
-				.withDescription("Save outputs to a new Baclava document.")
-				.create("outputdoc");
+		Option bundleOption = OptionBuilder.withArgName(BUNDLE).hasArg()
+				.withDescription("Save outputs to a new Workflow Run Bundle (zip).")
+				.create(BUNDLE);
 
 		Option logFileOption = OptionBuilder
 				.withArgName("filename")
@@ -371,7 +373,7 @@ public class CommandLineOptionsImpl implements CommandLineOptions {
 		options.addOption(inputDelimiterOption);
 		options.addOption(inputdocOption);
 		options.addOption(outputOption);
-		options.addOption(outputdocOption);
+		options.addOption(bundleOption);
 		options.addOption(inMemOption);
 		options.addOption(embedded);
 		options.addOption(clientserver);
@@ -424,8 +426,20 @@ public class CommandLineOptionsImpl implements CommandLineOptions {
 	 */
 	@Override
 	public boolean saveResultsToDirectory() {
-		return (options.hasOption("outputdir") || !options
-				.hasOption("outputdoc"));
+		return (options.hasOption(OUTPUTDIR) || !hasSaveResultsToBundle());
+	}
+
+	@Override
+	public String saveResultsToBundle() {
+		if (! hasSaveResultsToBundle()) { 
+			return null;
+		}
+		return getOptionValue(BUNDLE);
+	}
+
+	@Override
+	public boolean hasSaveResultsToBundle() {
+		return hasOption(BUNDLE);
 	}
 
 }