From 48d4e0739a95ee0016ec8a753758561339a86e11 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Wed, 9 Oct 2019 16:40:19 +0100 Subject: [PATCH] JAL-3066 Read parameters directly from args list allowing for multiple values. --- j11lib/slivka-client.jar | Bin 70779 -> 70791 bytes .../ws/slivkaws/SlivkaMsaServiceInstance.java | 34 ++++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/j11lib/slivka-client.jar b/j11lib/slivka-client.jar index 28a92daa734e7e1c026e5da17433cb82aea65d63..1725efbb919b512ce6288f3b3a95906d50e4eb37 100644 GIT binary patch delta 5294 zcmYkAbyU<%-^N)&kyyF~Bm|c(X+=Wfrn_4akXjU2Bz|=F3QJ1o(k&&dO9)7JmvlE$ zulN1l&-*@eX3qJ3u4`t_{B_Nlxh}#EEygC$P{zV0$H2wK#n6nXA~>|eREdD|SqZ_j zbRHnu2|xrutHC3fj{dZ-deYY#lV_~hw0PWGn1;Am+*)ZE+}K8#Ocq*2(q*kFbF5hK z6w7rm&QZnf`?82Bdu}Ua*^<_ra$N>?uGWQ5MVYdx{d}3;t;g;CI`Hj-GaI}go7B5j zveje%>xTED*TRW!-%tH7_m_njr8kOXX9;!v%abs^4N~)nEz=?`vc# z7oiFJpMohI!*$H3{xXX9mEht<4g0_0+P$(5e>ze>PG2MPD{08j*-ePSZGxk}%#rS7 zek(5rIBHv;Xv+9l1qIM*;=^*1jus&(oGW5+A~gMbz$rw=P&ua?oI_rtg3V`~U0d(; zjySPMfKS2lM+$KaNI5Mz(i2aR88Yj-OXyya7!D29ADdA1iUmE>N#k1*agip$UKoiY zi_U+mydyYl5SxK#_0r}F%GAI*x(1C8r!_I*Vz-jWFp;w0EQQDzGj%C>3q_7AtD3Os z5gN^ZR+JE^N6T?<&sFV(lY6w)*1LVOp;O^{oh#$nK%ixq=adc$LR5ykUXl;IkL=nz z?|;>h(PXx%U1X~)S30EzXLeu#6gUc&CX4FUd3kyd8_Rlp^&=N1p7od0->Z#@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y%j z@L}J`9sfalwkRN5i5%5o9(*z7eyh7I;oVjl)3C?pBHbF!`ldenc^04W3_4vHj1k>X zI2Y*z^5`6x&3+k_^nK2JnzfUJh@8}`ocAkG<#CKztl2f{J}_+%Sx$pO9an@*1L^NO zUxyG5zkcVf9EOaJPXd<3M3#Z}26yRDz79 zMWS7h>~W~CK?xV9Zc4wE+WTxXqr0f{pocS6@m_Q)0y?RO&T|Z6Z}&niimuNI~h>l z4ghqMkc|eY>;9*GqT@gSDC=MJuap1>2l)U8M-=D(ua|ICJSpe@ewc~l3L^gX-ykT^ z*Z2SsI*$y%j9U`?KaeEh9X|Ra5CBRh1>mCz$pH+1By8jWbASi>Ejhpp_e}&kh#bI; z8i*i6w-WpbGE@A?{~i6`R3iq2cBcUF;cmwM1zc!BO2B2>3><(%ioO}S_kN006-{?vJ diff --git a/src/jalview/ws/slivkaws/SlivkaMsaServiceInstance.java b/src/jalview/ws/slivkaws/SlivkaMsaServiceInstance.java index db1577e..f09ba16 100644 --- a/src/jalview/ws/slivkaws/SlivkaMsaServiceInstance.java +++ b/src/jalview/ws/slivkaws/SlivkaMsaServiceInstance.java @@ -16,9 +16,10 @@ import java.io.IOError; import java.io.IOException; import java.io.InputStream; import java.rmi.ServerError; -import java.util.HashMap; import java.util.List; +import java.util.Optional; +import uk.ac.dundee.compbio.slivkaclient.FieldType; import uk.ac.dundee.compbio.slivkaclient.FormField; import uk.ac.dundee.compbio.slivkaclient.RemoteFile; import uk.ac.dundee.compbio.slivkaclient.SlivkaClient; @@ -44,26 +45,25 @@ public class SlivkaMsaServiceInstance extends SlivkaWSInstance implements Multip InputStream stream = new ByteArrayInputStream(builder.toString().getBytes()); RemoteFile file = client.uploadFile(stream, "input.fasta", "application/fasta"); SlivkaForm form = service.getForm(); - HashMap values = new HashMap<>(list != null ? list.size() : 0); + Optional inputField = form.getFields().stream() + .filter(f -> f.getType() == FieldType.FILE).findFirst(); + if (inputField.isPresent()) + { + form.insert(inputField.get().getName(), file); + } if (list != null) { for (ArgumentI arg : list) { - values.put(arg.getName(), arg.getValue()); - } - } - for (FormField field : form.getFields()) - { - switch (field.getType()) { - case FILE: - form.insert(field.getName(), file); - break; - case BOOLEAN: - String value = values.get(field.getName()); - form.insert(field.getName(), (value != null && !value.isBlank()) ? true : false); - break; - default: - form.insert(field.getName(), field.valueOf(values.get(field.getName()))); + FormField field = form.getField(arg.getName()); + if (field.getType() == FieldType.BOOLEAN) + { + form.insert(arg.getName(), (arg.getValue() != null && !arg.getValue().isBlank()) ? true : false); + } + else + { + form.insert(arg.getName(), field.valueOf(arg.getValue())); + } } } return new JobId(service.getName(), service.getName(), form.submit()); -- 1.7.10.2