X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Frest%2FRestClient.java;h=9032823c67952074321ad12b4096256349d81c5d;hb=8edebdd9789b2d93fb8f9db24b8be2c1e6317690;hp=1acecb4e70acb7b0276fde9adf74616f7e79cf56;hpb=6940b5ac884139626e962201ae00c56c66d18039;p=jalview.git diff --git a/src/jalview/ws/rest/RestClient.java b/src/jalview/ws/rest/RestClient.java index 1acecb4..9032823 100644 --- a/src/jalview/ws/rest/RestClient.java +++ b/src/jalview/ws/rest/RestClient.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -28,10 +28,14 @@ import jalview.gui.AlignmentPanel; import jalview.gui.Desktop; import jalview.gui.WebserviceInfo; import jalview.io.packed.DataProvider.JvDataType; +import jalview.io.packed.JalviewDataset; import jalview.util.MessageManager; import jalview.ws.WSClient; import jalview.ws.WSClientI; import jalview.ws.WSMenuEntryProviderI; +import jalview.ws.rest.params.Alignment; +import jalview.ws.rest.params.JobConstant; +import jalview.ws.rest.params.SeqGroupIndexVector; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -75,7 +79,7 @@ public class RestClient extends WSClient implements WSClientI, */ protected AlignFrame recoverAlignFrameForView() { - return jalview.gui.Desktop.getAlignFrameFor(av); + return Desktop.getAlignFrameFor(av); } public RestClient(RestServiceDescription service2, AlignFrame alignFrame) @@ -107,7 +111,7 @@ public class RestClient extends WSClient implements WSClientI, if (!headless) { wsInfo = new WebserviceInfo(WebServiceJobTitle, WebServiceName + "\n" - + WebServiceReference); + + WebServiceReference, true); wsInfo.setRenderAsHtml(true); } @@ -224,7 +228,7 @@ public class RestClient extends WSClient implements WSClientI, /** * input data context */ - jalview.io.packed.JalviewDataset jds; + JalviewDataset jds; /** * informative name for results @@ -316,7 +320,7 @@ public class RestClient extends WSClient implements WSClientI, { String action = "Analysis", description = "Sequence Harmony and Multi-Relief (Brandt et al. 2010)", name = MessageManager.getString("label.multiharmony"); Hashtable iparams = new Hashtable(); - jalview.ws.rest.params.JobConstant toolp; + JobConstant toolp; // toolp = new jalview.ws.rest.JobConstant("tool","jalview"); // iparams.put(toolp.token, toolp); // toolp = new jalview.ws.rest.params.JobConstant("mbjob[method]","shmr"); @@ -329,13 +333,13 @@ public class RestClient extends WSClient implements WSClientI, // toolp = new jalview.ws.rest.params.JobConstant("blast","0"); // iparams.put(toolp.token, toolp); - jalview.ws.rest.params.Alignment aliinput = new jalview.ws.rest.params.Alignment(); + Alignment aliinput = new Alignment(); // SHMR server has a 65K limit for content pasted into the 'ali' parameter, // so we always upload our files. aliinput.token = "ali_file"; aliinput.writeAsFile = true; iparams.put(aliinput.token, aliinput); - jalview.ws.rest.params.SeqGroupIndexVector sgroups = new jalview.ws.rest.params.SeqGroupIndexVector(); + SeqGroupIndexVector sgroups = new SeqGroupIndexVector(); sgroups.setMinsize(2); sgroups.min = 2;// need at least two group defined to make a partition iparams.put("groups", sgroups); @@ -384,7 +388,7 @@ public class RestClient extends WSClient implements WSClientI, try { for (RestServiceDescription descr : RestServiceDescription - .parseDescriptions(jalview.bin.Cache.getDefault( + .parseDescriptions(Cache.getDefault( RSBS_SERVICES, makeShmmrRestClient().service.toString()))) { @@ -407,33 +411,6 @@ public class RestClient extends WSClient implements WSClientI, return lst; } - public static void main(String args[]) - { - try - { - RestClient[] clients = getRestClients(); - System.out.println("Got " + clients.length + " clients."); - int i = 0; - Vector urls = new Vector(); - for (RestClient cl : clients) - { - System.out.println("" + (++i) + ": " + cl.service.toString()); - urls.add(cl.service.toString()); - } - setRsbsServices(urls); - if (clients.length != getRestClients().length) - { - System.err - .println("Failed. Differing numbers of clients when stringified and parsed again."); - } - - } catch (Throwable x) - { - System.err.println("Failed. Unexpected exception."); - x.printStackTrace(); - } - } - public String getAction() { return service.details.Action;