JAl-1601 JAL-715 RestServiceDescription constructor allows specification of a series...
authorJames Procter <jprocter@ls30857.local>
Fri, 5 Jun 2015 09:58:56 +0000 (10:58 +0100)
committerJames Procter <jprocter@ls30857.local>
Fri, 5 Jun 2015 09:59:44 +0000 (10:59 +0100)
src/jalview/gui/RestServiceEditorPane.java
src/jalview/ws/rest/RestClient.java
src/jalview/ws/rest/RestServiceDescription.java

index 8a77329..75ebcd5 100644 (file)
@@ -112,7 +112,7 @@ public class RestServiceEditorPane extends GRestServiceEditorPane
     });
     currentservice = new RestServiceDescription("Analysis",
             "service description", "service name", "http://localhost/", "",
-            null, false, false, '-');
+            null, null, false, false, '-');
     initGuiWith(currentservice);
     refreshCutnPaste(false);
     updateButtons();
@@ -130,7 +130,7 @@ public class RestServiceEditorPane extends GRestServiceEditorPane
     {
       currentservice = new RestServiceDescription("Analysis",
               "service description", "service name", "http://localhost/",
-              "", null, false, false, '-');
+              "", null, null, false, false, '-');
     }
     initGuiWith(currentservice);
     refreshCutnPaste(false);
@@ -373,8 +373,8 @@ public class RestServiceEditorPane extends GRestServiceEditorPane
     RestServiceDescription newService = new RestServiceDescription(
             (String) action.getSelectedItem(), descr.getText().trim(), name
                     .getText().trim(), url.getText().trim(), urlsuff
-                    .getText().trim(), inputTypes, hSeparable.isSelected(),
-            vSeparable.isSelected(), gc);
+                    .getText().trim(), null, inputTypes,
+            hSeparable.isSelected(), vSeparable.isSelected(), gc);
 
     if (newService.isValid())
     {
index f9b72e3..29f51e1 100644 (file)
@@ -346,7 +346,7 @@ public class RestClient extends WSClient implements WSClientI,
             description,
             name,
             "http://zeus.few.vu.nl/programs/shmrwww/index.php?tool=jalview",// ?tool=jalview&mbjob[method]=shmr&mbjob[description]=step1",
-            "?tool=jalview", iparams, true, false, '-');
+            "?tool=jalview", null, iparams, true, false, '-');
     // a priori knowledge of the data returned from the service
     shmrService.addResultDatatype(JvDataType.ANNOTATION);
     return new RestClient(shmrService);
index 6f89393..cfaa76f 100644 (file)
@@ -51,18 +51,21 @@ public class RestServiceDescription
   }
 
   /**
-   * @param details
    * @param postUrl
    * @param urlSuffix
+   * @param urlPrefix
+   *          null or prefix for forming result URL from job
    * @param inputParams
    * @param hseparable
    * @param vseparable
    * @param gapCharacter
+   * @param details
    */
   public RestServiceDescription(String action, String description,
           String name, String postUrl, String urlSuffix,
-          Map<String, InputType> inputParams, boolean hseparable,
-          boolean vseparable, char gapCharacter)
+          List<String> urlPrefix,
+          Map<String, InputType> inputParams,
+          boolean hseparable, boolean vseparable, char gapCharacter)
   {
     super();
     this.details = new UIinfo();
@@ -70,6 +73,8 @@ public class RestServiceDescription
     details.description = description == null ? "" : description;
     details.Name = name == null ? "" : name;
     this.postUrl = postUrl == null ? "" : postUrl;
+    // TODO decide if nullable
+    this.rurlPref = urlPrefix;
     this.urlSuffix = urlSuffix == null ? "" : urlSuffix;
     if (inputParams != null)
     {
@@ -93,6 +98,8 @@ public class RestServiceDescription
     diff |= hseparable != other.hseparable;
     diff |= !(urlSuffix == null && other.urlSuffix == null || (urlSuffix != null
             && other.urlSuffix != null && urlSuffix.equals(other.urlSuffix)));
+    diff |= !(rurlPref == null && other.rurlPref == null || (rurlPref != null
+            && other.rurlPref != null && rurlPref.equals(other.rurlPref)));
     // TODO - robust diff that includes constants and reordering of URL
     // diff |= !(postUrl.equals(other.postUrl));
     // diff |= !inputParams.equals(other.inputParams);
@@ -234,6 +241,11 @@ public class RestServiceDescription
   String urlSuffix;
 
   /**
+   * prefix for poll and result URLs when null, urlSuffix is used
+   */
+  List<String> rurlPref = null;
+
+  /**
    * input info given as key/value pairs - mapped to post arguments
    */
   Map<String, InputType> inputParams = new HashMap<String, InputType>();