Hi Willem,

 > I’m working on an implementation of the Taverna server client for the
> http://succeed-project.eu/ project,
>
> Recently we’ve upgraded the t2-server-jar to the latest (next) repo on
> github.
>
> The webinterface works just fine with  Strings as output, but if the
> output is of type (‘application/x-list’),
>
> the method getDataAsString
> (https://github.com/myGrid/t2-server-jar/blob/next/src/main/java/uk/org/taverna/server/client/OutputPort.java)
> causes an exception.

Yes, this is intentional. It is difficult to know what the default 
action should be when concatenating a list of values into a string so we 
don't do it by default.

> I’ve created a bug ticket for it on github
> (https://github.com/impactcentre/interoperability-framework/issues/18),
> and added an if statement to handle lists.
>
> Is there a method to loop over the lists and get the results as a String?
>
> Any pointers will be appreciated,

The best thing to do would be to get the value of the output (which in 
this case is a list) and loop over it concatenating it however makes 
most sense for you.

If you look in the next branch of the t2-server-java-cli project 
(https://github.com/myGrid/t2-server-java-cli/tree/next) you can see an 
example of this in GetOutput.java

Something like (where 'port' is your output port):

StrBuilder data = new StrBuilder();
for (AbstractPortValue p : port.getValue()) {
   data.append(p.getDataAsString())
}
String list = data.toString();

You'll have to adjust this for outputs with depth > 1 too.

I hope this is OK for now. I realise that there is a gap in the API here 
where list outputs are concerned but the potentially infinite depth of 
ports needs thinking about too. If you have any suggestions we'd be 
pleased to hear them!

Best wishes,
Rob Haines

>
> Programmer European Projects
>
> Sector Innovation & Development
>
>
>       Koninklijke Bibliotheek, National Library of the Netherlands
> <http://www.kb.nl>    
>       Prins Willem-Alexanderhof 5 | 2595 BE Den Haag
> Postbus 90407 | 2509 LK Den Haag | (070) 314 09 11 | www.kb.nl
> <http://www.kb.nl/>   
>               
>       English version <http://www.kb.nl/red/email.html> | Disclaimer
> <http://www.kb.nl/red/disclaimer.html>        
>
>
>
>
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> taverna-hackers mailing list
> taverna-hackers@lists.sourceforge.net
> Web site: http://www.taverna.org.uk
> Mailing lists: http://www.taverna.org.uk/about/contact-us/
> Developers Guide: http://www.taverna.org.uk/developers/
>


-- 
Robert Haines
myGrid Team
School of Computer Science
University of Manchester

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
taverna-hackers mailing list
taverna-hackers@lists.sourceforge.net
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/about/contact-us/
Developers Guide: http://www.taverna.org.uk/developers/

Reply via email to