JWS-17 re-design behaviour of Option.toString
authorSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Thu, 19 Sep 2013 13:44:57 +0000 (14:44 +0100)
committerSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Thu, 19 Sep 2013 13:44:57 +0000 (14:44 +0100)
datamodel/compbio/metadata/Option.java
webservices/compbio/ws/client/MetadataHelper.java

index 93361dd..7d9e9e4 100644 (file)
@@ -208,7 +208,11 @@ public class Option<T> implements Argument<T> {
                        value += "Default value: " + this.defaultValue + SysPrefs.newlinechar;\r
                }\r
                if (null != this.furtherDetails) {\r
+                       if (null != this.basicURL) {\r
                        value += "URL: " + this.basicURL + this.furtherDetails + SysPrefs.newlinechar;\r
+               }else {\r
+                       value += "Relative URL: " + this.furtherDetails + SysPrefs.newlinechar;\r
+               }\r
                } else {\r
                        value += "URL: unknown URL" + SysPrefs.newlinechar;\r
                }\r
index d5d8b06..20a9f76 100644 (file)
@@ -44,7 +44,26 @@ public class MetadataHelper {
         * @param msaws\r
         *            web service proxy\r
         * @return List of options supported by a web service\r
-        * @throws MalformedURLException \r
+        */\r
+       static <T> List<Option<T>> getParametersList(Metadata<T> msaws) {\r
+               assert msaws != null;\r
+               RunnerConfig<T> config = msaws.getRunnerOptions();\r
+               if (config == null) {\r
+                       return Collections.emptyList();\r
+               }\r
+               return config.getArguments();\r
+       }\r
+\r
+       /**\r
+        * Returns a list of options supported by web service\r
+        * \r
+        * @param <T>\r
+        *            web service type\r
+        * @param msaws\r
+        *            web service proxy\r
+        * @param host\r
+        *            the server URL, as a string\r
+        * @return List of options supported by a web service\r
         */\r
        static <T> List<Option<T>> getParametersList(Metadata<T> msaws, String host) throws MalformedURLException {\r
                assert msaws != null;\r
@@ -59,11 +78,6 @@ public class MetadataHelper {
                return opts;\r
        }\r
 \r
-       static <T> List<Option<T>> getParametersList(Metadata<T> msaws) throws MalformedURLException {\r
-               return getParametersList (msaws, "http://unknown.jabaws.server.ac.uk");\r
-       }\r
-       \r
-       \r
        /**\r
         * Returns an objects from which the list of presets supported by web\r
         * service <T> can be obtained\r