X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=webservices%2Fcompbio%2Fws%2Fclient%2FMetadataHelper.java;h=20a9f76a22e7442e4c03d45fed828597d5cfdc7c;hb=b2a2fdc2bd95a64b3908d8ea2f31270b6c7199d3;hp=4803e167c426cf6bc1359e990460d1cca2eae08d;hpb=1e1c3681ba25ee1797a46f871b8c80f259afe2ca;p=jabaws.git diff --git a/webservices/compbio/ws/client/MetadataHelper.java b/webservices/compbio/ws/client/MetadataHelper.java index 4803e16..20a9f76 100644 --- a/webservices/compbio/ws/client/MetadataHelper.java +++ b/webservices/compbio/ws/client/MetadataHelper.java @@ -22,6 +22,8 @@ import static compbio.ws.client.Constraints.pseparator; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.net.MalformedURLException; +import java.net.URL; import compbio.data.msa.Metadata; import compbio.metadata.Limit; @@ -53,6 +55,30 @@ public class MetadataHelper { } /** + * Returns a list of options supported by web service + * + * @param + * web service type + * @param msaws + * web service proxy + * @param host + * the server URL, as a string + * @return List of options supported by a web service + */ + static List> getParametersList(Metadata msaws, String host) throws MalformedURLException { + assert msaws != null; + RunnerConfig config = msaws.getRunnerOptions(); + if (config == null) { + return Collections.emptyList(); + } + List> opts = config.getArguments(); + for (Option o : opts) { + o.setBasicURL(new URL(host + "/")); + } + return opts; + } + + /** * Returns an objects from which the list of presets supported by web * service can be obtained * @@ -98,14 +124,12 @@ public class MetadataHelper { assert presetName != null; PresetManager presets = MetadataHelper.getPresetList(msaws); if (presets == null) { - System.out - .println("No presets are supported by the service! Ignoring -r directive!"); + System.out.println("No presets are supported by the service! Ignoring -r directive!"); return null; } Preset pre = presets.getPresetByName(presetName); if (pre == null) { - System.out.println("Cannot find preset: " + presetName - + " WARN: ignoring -r directive!"); + System.out.println("Cannot find preset: " + presetName + " WARN: ignoring -r directive!"); } return pre; } @@ -131,17 +155,14 @@ public class MetadataHelper { } Option o = options.getArgumentByOptionName(oname); if (o == null) { - System.out.println("WARN ignoring unsuppoted parameter: " - + oname); + System.out.println("WARN ignoring unsuppoted parameter: " + oname); continue; } if (isParameter(param)) { try { o.setValue(getParamValue(param)); } catch (WrongParameterException e) { - System.out - .println("Problem setting value for the parameter: " - + param); + System.out.println("Problem setting value for the parameter: " + param); e.printStackTrace(); } }