t2-server 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES.rdoc +6 -0
 - data/LICENCE.rdoc +1 -1
 - data/README.rdoc +2 -2
 - data/bin/t2-delete-runs +1 -1
 - data/bin/t2-run-workflow +11 -1
 - data/bin/t2-server-info +1 -1
 - data/lib/t2-server.rb +2 -2
 - data/lib/t2-server/exceptions.rb +1 -1
 - data/lib/t2-server/run.rb +1 -1
 - data/lib/t2-server/server.rb +26 -14
 - data/lib/t2-server/xml.rb +1 -1
 - data/lib/t2server.rb +1 -1
 - data/test/tc_paths.rb +1 -1
 - data/test/tc_run.rb +9 -1
 - data/test/tc_server.rb +1 -1
 - data/test/ts_t2server.rb +2 -1
 - data/test/workflows/xml_xpath.t2flow +137 -0
 - metadata +5 -4
 
    
        data/CHANGES.rdoc
    CHANGED
    
    | 
         @@ -1,5 +1,11 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            = Changes log for the T2 Ruby Gem
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            == Version 0.6.1
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            * Store server addresses internally as URI objects.
         
     | 
| 
      
 6 
     | 
    
         
            +
            * t2-run-workflow: Add a no-wait option.
         
     | 
| 
      
 7 
     | 
    
         
            +
            * Fix input value escaping to allow XML in inputs.
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
       3 
9 
     | 
    
         
             
            == Version 0.6.0
         
     | 
| 
       4 
10 
     | 
    
         | 
| 
       5 
11 
     | 
    
         
             
            * Add a new API call Run#get_output_ports
         
     | 
    
        data/LICENCE.rdoc
    CHANGED
    
    
    
        data/README.rdoc
    CHANGED
    
    | 
         @@ -1,12 +1,12 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            = Taverna[http://www.taverna.org.uk/] 2 Server Interaction Gem
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            Authors::     Robert Haines
         
     | 
| 
       4 
     | 
    
         
            -
            Gem Version:: 0.6. 
     | 
| 
      
 4 
     | 
    
         
            +
            Gem Version:: 0.6.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            API Version:: 2.2a1
         
     | 
| 
       6 
6 
     | 
    
         
             
            Contact::     mailto:rhaines@manchester.ac.uk
         
     | 
| 
       7 
7 
     | 
    
         
             
            URL::         http://taverna.sourceforge.net/
         
     | 
| 
       8 
8 
     | 
    
         
             
            Licence::     BSD (See LICENCE or http://www.opensource.org/licenses/bsd-license.php)
         
     | 
| 
       9 
     | 
    
         
            -
            Copyright::   (c) 2010 The University of Manchester, UK
         
     | 
| 
      
 9 
     | 
    
         
            +
            Copyright::   (c) 2010, 2011 The University of Manchester, UK
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
            == Synopsis
         
     | 
    
        data/bin/t2-delete-runs
    CHANGED
    
    
    
        data/bin/t2-run-workflow
    CHANGED
    
    | 
         @@ -1,5 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #!/usr/bin/env ruby
         
     | 
| 
       2 
     | 
    
         
            -
            # Copyright (c) 2010, The University of Manchester, UK.
         
     | 
| 
      
 2 
     | 
    
         
            +
            # Copyright (c) 2010, 2011 The University of Manchester, UK.
         
     | 
| 
       3 
3 
     | 
    
         
             
            #
         
     | 
| 
       4 
4 
     | 
    
         
             
            # All rights reserved.
         
     | 
| 
       5 
5 
     | 
    
         
             
            #
         
     | 
| 
         @@ -42,6 +42,7 @@ wkf_file = "" 
     | 
|
| 
       42 
42 
     | 
    
         
             
            output_refs = false
         
     | 
| 
       43 
43 
     | 
    
         
             
            baclava_out = ""
         
     | 
| 
       44 
44 
     | 
    
         
             
            delete_run = false
         
     | 
| 
      
 45 
     | 
    
         
            +
            no_wait = false
         
     | 
| 
       45 
46 
     | 
    
         
             
            opts = OptionParser.new do |opt|
         
     | 
| 
       46 
47 
     | 
    
         
             
              opt.banner = "Usage: t2-run-workflow [options] server-address"
         
     | 
| 
       47 
48 
     | 
    
         
             
              opt.separator ""
         
     | 
| 
         @@ -72,6 +73,10 @@ opts = OptionParser.new do |opt| 
     | 
|
| 
       72 
73 
     | 
    
         
             
                  baclava_out = "out.xml"
         
     | 
| 
       73 
74 
     | 
    
         
             
                end
         
     | 
| 
       74 
75 
     | 
    
         
             
              end
         
     | 
| 
      
 76 
     | 
    
         
            +
              opt.on("-n", "--no-wait", "Do not wait for workflow to finish, return " +
         
     | 
| 
      
 77 
     | 
    
         
            +
                "once it has started running") do |val|
         
     | 
| 
      
 78 
     | 
    
         
            +
                  no_wait = true
         
     | 
| 
      
 79 
     | 
    
         
            +
              end
         
     | 
| 
       75 
80 
     | 
    
         
             
              opt.on("-r", "--output-refs", "Return URIs that point to the data items " +
         
     | 
| 
       76 
81 
     | 
    
         
             
                "of the output rather than the data items themselves.") do |val|
         
     | 
| 
       77 
82 
     | 
    
         
             
                output_refs = val
         
     | 
| 
         @@ -142,6 +147,11 @@ run.set_baclava_output(baclava_out) unless baclava_out == "" 
     | 
|
| 
       142 
147 
     | 
    
         
             
            # start run and wait until it is finished
         
     | 
| 
       143 
148 
     | 
    
         
             
            run.start
         
     | 
| 
       144 
149 
     | 
    
         
             
            puts "Started at #{run.start_time}"
         
     | 
| 
      
 150 
     | 
    
         
            +
             
     | 
| 
      
 151 
     | 
    
         
            +
            # bail out if user doesn't want to wait
         
     | 
| 
      
 152 
     | 
    
         
            +
            exit 0 if no_wait
         
     | 
| 
      
 153 
     | 
    
         
            +
             
     | 
| 
      
 154 
     | 
    
         
            +
            # otherwise wait
         
     | 
| 
       145 
155 
     | 
    
         
             
            print "Running"
         
     | 
| 
       146 
156 
     | 
    
         
             
            run.wait(:progress => true)
         
     | 
| 
       147 
157 
     | 
    
         
             
            puts "Finished at #{run.finish_time}"
         
     | 
    
        data/bin/t2-server-info
    CHANGED
    
    
    
        data/lib/t2-server.rb
    CHANGED
    
    | 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # Copyright (c) 2010, The University of Manchester, UK.
         
     | 
| 
      
 1 
     | 
    
         
            +
            # Copyright (c) 2010, 2011 The University of Manchester, UK.
         
     | 
| 
       2 
2 
     | 
    
         
             
            #
         
     | 
| 
       3 
3 
     | 
    
         
             
            # All rights reserved.
         
     | 
| 
       4 
4 
     | 
    
         
             
            #
         
     | 
| 
         @@ -43,7 +43,7 @@ require 't2-server/run' 
     | 
|
| 
       43 
43 
     | 
    
         
             
            #   Taverna 2 Server instance.
         
     | 
| 
       44 
44 
     | 
    
         
             
            module T2Server
         
     | 
| 
       45 
45 
     | 
    
         
             
              # The version of this library
         
     | 
| 
       46 
     | 
    
         
            -
              GEM_VERSION = "0.6. 
     | 
| 
      
 46 
     | 
    
         
            +
              GEM_VERSION = "0.6.1"
         
     | 
| 
       47 
47 
     | 
    
         
             
              # The version of the Taverna 2 Server API that this library can interface with
         
     | 
| 
       48 
48 
     | 
    
         
             
              API_VERSION = "2.2a1"
         
     | 
| 
       49 
49 
     | 
    
         
             
            end
         
     | 
    
        data/lib/t2-server/exceptions.rb
    CHANGED
    
    
    
        data/lib/t2-server/run.rb
    CHANGED
    
    
    
        data/lib/t2-server/server.rb
    CHANGED
    
    | 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # Copyright (c) 2010, The University of Manchester, UK.
         
     | 
| 
      
 1 
     | 
    
         
            +
            # Copyright (c) 2010, 2011 The University of Manchester, UK.
         
     | 
| 
       2 
2 
     | 
    
         
             
            #
         
     | 
| 
       3 
3 
     | 
    
         
             
            # All rights reserved.
         
     | 
| 
       4 
4 
     | 
    
         
             
            #
         
     | 
| 
         @@ -45,7 +45,7 @@ module T2Server 
     | 
|
| 
       45 
45 
     | 
    
         | 
| 
       46 
46 
     | 
    
         
             
                private_class_method :new
         
     | 
| 
       47 
47 
     | 
    
         | 
| 
       48 
     | 
    
         
            -
                # The URI of this server instance 
     | 
| 
      
 48 
     | 
    
         
            +
                # The URI of this server instance.
         
     | 
| 
       49 
49 
     | 
    
         
             
                attr_reader :uri
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
51 
     | 
    
         
             
                # The maximum number of runs that this server will allow at any one time.
         
     | 
| 
         @@ -59,12 +59,11 @@ module T2Server 
     | 
|
| 
       59 
59 
     | 
    
         
             
                # :stopdoc:
         
     | 
| 
       60 
60 
     | 
    
         
             
                # New is private but rdoc does not get it right! Hence :stopdoc: section.
         
     | 
| 
       61 
61 
     | 
    
         
             
                def initialize(uri, username, password)
         
     | 
| 
       62 
     | 
    
         
            -
                  @uri = uri 
     | 
| 
       63 
     | 
    
         
            -
                   
     | 
| 
       64 
     | 
    
         
            -
                  @ 
     | 
| 
       65 
     | 
    
         
            -
                  @ 
     | 
| 
       66 
     | 
    
         
            -
                  @ 
     | 
| 
       67 
     | 
    
         
            -
                  @rest_path = uri.path + "/rest"
         
     | 
| 
      
 62 
     | 
    
         
            +
                  @uri = uri
         
     | 
| 
      
 63 
     | 
    
         
            +
                  @host = @uri.host
         
     | 
| 
      
 64 
     | 
    
         
            +
                  @port = @uri.port
         
     | 
| 
      
 65 
     | 
    
         
            +
                  @base_path = @uri.path
         
     | 
| 
      
 66 
     | 
    
         
            +
                  @rest_path = @uri.path + "/rest"
         
     | 
| 
       68 
67 
     | 
    
         | 
| 
       69 
68 
     | 
    
         
             
                  # set up http connection
         
     | 
| 
       70 
69 
     | 
    
         
             
                  @http = Net::HTTP.new(@host, @port)
         
     | 
| 
         @@ -72,8 +71,8 @@ module T2Server 
     | 
|
| 
       72 
71 
     | 
    
         
             
                  # use ssl?
         
     | 
| 
       73 
72 
     | 
    
         
             
                  @ssl = uri.scheme == "https"
         
     | 
| 
       74 
73 
     | 
    
         
             
                  if ssl?
         
     | 
| 
       75 
     | 
    
         
            -
                    @username =  
     | 
| 
       76 
     | 
    
         
            -
                    @password =  
     | 
| 
      
 74 
     | 
    
         
            +
                    @username = username
         
     | 
| 
      
 75 
     | 
    
         
            +
                    @password = password
         
     | 
| 
       77 
76 
     | 
    
         | 
| 
       78 
77 
     | 
    
         
             
                    @http.use_ssl = true
         
     | 
| 
       79 
78 
     | 
    
         
             
                    @http.verify_mode = OpenSSL::SSL::VERIFY_NONE
         
     | 
| 
         @@ -102,12 +101,23 @@ module T2Server 
     | 
|
| 
       102 
101 
     | 
    
         
             
                # The username and password can also be passed in separately.
         
     | 
| 
       103 
102 
     | 
    
         
             
                # A Server instance is returned that represents the connection.
         
     | 
| 
       104 
103 
     | 
    
         
             
                def Server.connect(uri, username="", password="")
         
     | 
| 
      
 104 
     | 
    
         
            +
                  # we want to use URIs here but strings can be passed in
         
     | 
| 
      
 105 
     | 
    
         
            +
                  if !uri.instance_of? URI
         
     | 
| 
      
 106 
     | 
    
         
            +
                    uri = URI.parse(uri.strip_path);
         
     | 
| 
      
 107 
     | 
    
         
            +
                  end
         
     | 
| 
      
 108 
     | 
    
         
            +
                  
         
     | 
| 
      
 109 
     | 
    
         
            +
                  # strip username and password from the URI if present
         
     | 
| 
      
 110 
     | 
    
         
            +
                  username = uri.user || username
         
     | 
| 
      
 111 
     | 
    
         
            +
                  password = uri.password || password
         
     | 
| 
      
 112 
     | 
    
         
            +
                  new_uri = URI::HTTP.new(uri.scheme, nil, uri.host, uri.port, nil,
         
     | 
| 
      
 113 
     | 
    
         
            +
                    uri.path, nil, nil, nil);
         
     | 
| 
      
 114 
     | 
    
         
            +
                  
         
     | 
| 
       105 
115 
     | 
    
         
             
                  # see if we've already got this server
         
     | 
| 
       106 
     | 
    
         
            -
                  server = @@servers.find {|s| s.uri ==  
     | 
| 
      
 116 
     | 
    
         
            +
                  server = @@servers.find {|s| s.uri == new_uri}
         
     | 
| 
       107 
117 
     | 
    
         | 
| 
       108 
118 
     | 
    
         
             
                  if !server
         
     | 
| 
       109 
119 
     | 
    
         
             
                    # no, so create new one and return it
         
     | 
| 
       110 
     | 
    
         
            -
                    server = new( 
     | 
| 
      
 120 
     | 
    
         
            +
                    server = new(new_uri, username, password)
         
     | 
| 
       111 
121 
     | 
    
         
             
                    @@servers << server
         
     | 
| 
       112 
122 
     | 
    
         
             
                  end
         
     | 
| 
       113 
123 
     | 
    
         | 
| 
         @@ -235,8 +245,9 @@ module T2Server 
     | 
|
| 
       235 
245 
     | 
    
         
             
                    run = run(run)
         
     | 
| 
       236 
246 
     | 
    
         
             
                  end
         
     | 
| 
       237 
247 
     | 
    
         | 
| 
      
 248 
     | 
    
         
            +
                  xml_value = XML::Node.new_text(value)
         
     | 
| 
       238 
249 
     | 
    
         
             
                  path = "#{@links[:runs]}/#{run.uuid}/#{run.inputs}/input/#{input}"
         
     | 
| 
       239 
     | 
    
         
            -
                  set_attribute(path, Fragments::RUNINPUTVALUE %  
     | 
| 
      
 250 
     | 
    
         
            +
                  set_attribute(path, Fragments::RUNINPUTVALUE % xml_value, "application/xml")
         
     | 
| 
       240 
251 
     | 
    
         
             
                rescue AttributeNotFoundError => e
         
     | 
| 
       241 
252 
     | 
    
         
             
                  if get_runs.has_key? run.uuid
         
     | 
| 
       242 
253 
     | 
    
         
             
                    raise e
         
     | 
| 
         @@ -256,8 +267,9 @@ module T2Server 
     | 
|
| 
       256 
267 
     | 
    
         
             
                    run = run(run)
         
     | 
| 
       257 
268 
     | 
    
         
             
                  end
         
     | 
| 
       258 
269 
     | 
    
         | 
| 
      
 270 
     | 
    
         
            +
                  xml_value = XML::Node.new_text(filename)
         
     | 
| 
       259 
271 
     | 
    
         
             
                  path = "#{@links[:runs]}/#{run.uuid}/#{run.inputs}/input/#{input}"
         
     | 
| 
       260 
     | 
    
         
            -
                  set_attribute(path, Fragments::RUNINPUTFILE %  
     | 
| 
      
 272 
     | 
    
         
            +
                  set_attribute(path, Fragments::RUNINPUTFILE % xml_value, "application/xml")
         
     | 
| 
       261 
273 
     | 
    
         
             
                rescue AttributeNotFoundError => e
         
     | 
| 
       262 
274 
     | 
    
         
             
                  if get_runs.has_key? run.uuid
         
     | 
| 
       263 
275 
     | 
    
         
             
                    raise e
         
     | 
    
        data/lib/t2-server/xml.rb
    CHANGED
    
    
    
        data/lib/t2server.rb
    CHANGED
    
    
    
        data/test/tc_paths.rb
    CHANGED
    
    
    
        data/test/tc_run.rb
    CHANGED
    
    | 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # Copyright (c) 2010, The University of Manchester, UK.
         
     | 
| 
      
 1 
     | 
    
         
            +
            # Copyright (c) 2010, 2011 The University of Manchester, UK.
         
     | 
| 
       2 
2 
     | 
    
         
             
            #
         
     | 
| 
       3 
3 
     | 
    
         
             
            # All rights reserved.
         
     | 
| 
       4 
4 
     | 
    
         
             
            #
         
     | 
| 
         @@ -68,6 +68,14 @@ class TestRun < Test::Unit::TestCase 
     | 
|
| 
       68 
68 
     | 
    
         
             
                # deletion
         
     | 
| 
       69 
69 
     | 
    
         
             
                assert(@run.delete)
         
     | 
| 
       70 
70 
     | 
    
         | 
| 
      
 71 
     | 
    
         
            +
                # run with xml input
         
     | 
| 
      
 72 
     | 
    
         
            +
                @run = T2Server::Run.create($address, $wkf_xml)
         
     | 
| 
      
 73 
     | 
    
         
            +
                @run.set_input("xml","<hello><yes>hello</yes><no>everybody</no><yes>world</yes></hello>")
         
     | 
| 
      
 74 
     | 
    
         
            +
                @run.set_input("xpath","//yes")
         
     | 
| 
      
 75 
     | 
    
         
            +
                @run.start
         
     | 
| 
      
 76 
     | 
    
         
            +
                @run.wait
         
     | 
| 
      
 77 
     | 
    
         
            +
                assert_equal(@run.get_output("nodes"), ["hello", "world"])
         
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
       71 
79 
     | 
    
         
             
                # run with file input
         
     | 
| 
       72 
80 
     | 
    
         
             
                @run = T2Server::Run.create($address, $wkf_pass)
         
     | 
| 
       73 
81 
     | 
    
         | 
    
        data/test/tc_server.rb
    CHANGED
    
    
    
        data/test/ts_t2server.rb
    CHANGED
    
    | 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # Copyright (c) 2010, The University of Manchester, UK.
         
     | 
| 
      
 1 
     | 
    
         
            +
            # Copyright (c) 2010, 2011 The University of Manchester, UK.
         
     | 
| 
       2 
2 
     | 
    
         
             
            #
         
     | 
| 
       3 
3 
     | 
    
         
             
            # All rights reserved.
         
     | 
| 
       4 
4 
     | 
    
         
             
            #
         
     | 
| 
         @@ -57,6 +57,7 @@ require 'tc_paths' 
     | 
|
| 
       57 
57 
     | 
    
         
             
            if $address != ""
         
     | 
| 
       58 
58 
     | 
    
         
             
              $wkf_pass   = File.read("test/workflows/pass_through.t2flow")
         
     | 
| 
       59 
59 
     | 
    
         
             
              $wkf_lists  = File.read("test/workflows/empty_list.t2flow")
         
     | 
| 
      
 60 
     | 
    
         
            +
              $wkf_xml    = File.read("test/workflows/xml_xpath.t2flow")
         
     | 
| 
       60 
61 
     | 
    
         
             
              $list_input = "test/workflows/empty_list_input.baclava"
         
     | 
| 
       61 
62 
     | 
    
         
             
              $file_input = "test/workflows/in.txt"
         
     | 
| 
       62 
63 
     | 
    
         | 
| 
         @@ -0,0 +1,137 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="bac27078-6e26-48b0-a127-56146f1eff2b" role="top"><name>Workflow1</name><inputPorts><port><name>xml</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port><port><name>xpath</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>nodes</name><annotations /></port><port><name>xml_nodes</name><annotations /></port></outputPorts><processors><processor><name>get_element</name><inputPorts><port><name>xml-text</name><depth>0</depth></port><port><name>xpath</name><depth>0</depth></port></inputPorts><outputPorts><port><name>nodelist</name><depth>1</depth><granularDepth>1</granularDepth></port><port><name>nodelistAsXML</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="xml-text" to="xml-text" /><map from="xpath" to="xpath" /></inputMap><outputMap><map from="nodelistAsXML" to="nodelistAsXML" /><map from="nodelist" to="nodelist" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
         
     | 
| 
      
 2 
     | 
    
         
            +
              <localworkerName>net.sourceforge.taverna.scuflworkers.xml.XPathTextWorker</localworkerName>
         
     | 
| 
      
 3 
     | 
    
         
            +
              <script>import org.dom4j.Document;
         
     | 
| 
      
 4 
     | 
    
         
            +
            import org.dom4j.Node;
         
     | 
| 
      
 5 
     | 
    
         
            +
            import org.dom4j.io.SAXReader;
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            SAXReader reader = new SAXReader(false);
         
     | 
| 
      
 8 
     | 
    
         
            +
            reader.setIncludeInternalDTDDeclarations(false);
         
     | 
| 
      
 9 
     | 
    
         
            +
            reader.setIncludeExternalDTDDeclarations(false);
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            Document document = reader.read(new StringReader(xmltext));
         
     | 
| 
      
 12 
     | 
    
         
            +
            List nodelist = document.selectNodes(xpath);
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            // Process the elements in the nodelist
         
     | 
| 
      
 15 
     | 
    
         
            +
            ArrayList outputList = new ArrayList();
         
     | 
| 
      
 16 
     | 
    
         
            +
            ArrayList outputXmlList = new ArrayList();
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            String val = null;
         
     | 
| 
      
 19 
     | 
    
         
            +
            String xmlVal = null;
         
     | 
| 
      
 20 
     | 
    
         
            +
            for (Iterator iter = nodelist.iterator(); iter.hasNext();) {
         
     | 
| 
      
 21 
     | 
    
         
            +
            	Node element = (Node) iter.next();
         
     | 
| 
      
 22 
     | 
    
         
            +
            	xmlVal = element.asXML();
         
     | 
| 
      
 23 
     | 
    
         
            +
            	val = element.getStringValue();
         
     | 
| 
      
 24 
     | 
    
         
            +
            	if (val != null && !val.equals("")) {
         
     | 
| 
      
 25 
     | 
    
         
            +
            		outputList.add(val);
         
     | 
| 
      
 26 
     | 
    
         
            +
            		outputXmlList.add(xmlVal);
         
     | 
| 
      
 27 
     | 
    
         
            +
            	}
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            }
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            List nodelist=outputList;
         
     | 
| 
      
 32 
     | 
    
         
            +
            List nodelistAsXML=outputXmlList;</script>
         
     | 
| 
      
 33 
     | 
    
         
            +
              <dependencies>
         
     | 
| 
      
 34 
     | 
    
         
            +
                <string>dom4j:dom4j:1.6</string>
         
     | 
| 
      
 35 
     | 
    
         
            +
              </dependencies>
         
     | 
| 
      
 36 
     | 
    
         
            +
              <classLoaderSharing>workflow</classLoaderSharing>
         
     | 
| 
      
 37 
     | 
    
         
            +
              <localDependencies />
         
     | 
| 
      
 38 
     | 
    
         
            +
              <artifactDependencies>
         
     | 
| 
      
 39 
     | 
    
         
            +
                <net.sf.taverna.raven.repository.BasicArtifact>
         
     | 
| 
      
 40 
     | 
    
         
            +
                  <groupId>dom4j</groupId>
         
     | 
| 
      
 41 
     | 
    
         
            +
                  <artifactId>dom4j</artifactId>
         
     | 
| 
      
 42 
     | 
    
         
            +
                  <version>1.6</version>
         
     | 
| 
      
 43 
     | 
    
         
            +
                  <hashCode>716010169</hashCode>
         
     | 
| 
      
 44 
     | 
    
         
            +
                </net.sf.taverna.raven.repository.BasicArtifact>
         
     | 
| 
      
 45 
     | 
    
         
            +
              </artifactDependencies>
         
     | 
| 
      
 46 
     | 
    
         
            +
              <inputs>
         
     | 
| 
      
 47 
     | 
    
         
            +
                <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
         
     | 
| 
      
 48 
     | 
    
         
            +
                  <handledReferenceSchemes />
         
     | 
| 
      
 49 
     | 
    
         
            +
                  <translatedElementType>java.lang.String</translatedElementType>
         
     | 
| 
      
 50 
     | 
    
         
            +
                  <allowsLiteralValues>true</allowsLiteralValues>
         
     | 
| 
      
 51 
     | 
    
         
            +
                  <name>xpath</name>
         
     | 
| 
      
 52 
     | 
    
         
            +
                  <depth>0</depth>
         
     | 
| 
      
 53 
     | 
    
         
            +
                  <mimeTypes>
         
     | 
| 
      
 54 
     | 
    
         
            +
                    <string>'text/plain'</string>
         
     | 
| 
      
 55 
     | 
    
         
            +
                  </mimeTypes>
         
     | 
| 
      
 56 
     | 
    
         
            +
                </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
         
     | 
| 
      
 57 
     | 
    
         
            +
                <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
         
     | 
| 
      
 58 
     | 
    
         
            +
                  <handledReferenceSchemes />
         
     | 
| 
      
 59 
     | 
    
         
            +
                  <translatedElementType>java.lang.String</translatedElementType>
         
     | 
| 
      
 60 
     | 
    
         
            +
                  <allowsLiteralValues>true</allowsLiteralValues>
         
     | 
| 
      
 61 
     | 
    
         
            +
                  <name>xml-text</name>
         
     | 
| 
      
 62 
     | 
    
         
            +
                  <depth>0</depth>
         
     | 
| 
      
 63 
     | 
    
         
            +
                  <mimeTypes>
         
     | 
| 
      
 64 
     | 
    
         
            +
                    <string>'text/xml'</string>
         
     | 
| 
      
 65 
     | 
    
         
            +
                  </mimeTypes>
         
     | 
| 
      
 66 
     | 
    
         
            +
                </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
         
     | 
| 
      
 67 
     | 
    
         
            +
              </inputs>
         
     | 
| 
      
 68 
     | 
    
         
            +
              <outputs>
         
     | 
| 
      
 69 
     | 
    
         
            +
                <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
         
     | 
| 
      
 70 
     | 
    
         
            +
                  <granularDepth>1</granularDepth>
         
     | 
| 
      
 71 
     | 
    
         
            +
                  <name>nodelist</name>
         
     | 
| 
      
 72 
     | 
    
         
            +
                  <depth>1</depth>
         
     | 
| 
      
 73 
     | 
    
         
            +
                  <mimeTypes>
         
     | 
| 
      
 74 
     | 
    
         
            +
                    <string>l('text/plain')</string>
         
     | 
| 
      
 75 
     | 
    
         
            +
                  </mimeTypes>
         
     | 
| 
      
 76 
     | 
    
         
            +
                </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
         
     | 
| 
      
 77 
     | 
    
         
            +
                <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
         
     | 
| 
      
 78 
     | 
    
         
            +
                  <granularDepth>1</granularDepth>
         
     | 
| 
      
 79 
     | 
    
         
            +
                  <name>nodelistAsXML</name>
         
     | 
| 
      
 80 
     | 
    
         
            +
                  <depth>1</depth>
         
     | 
| 
      
 81 
     | 
    
         
            +
                  <mimeTypes>
         
     | 
| 
      
 82 
     | 
    
         
            +
                    <string>l('text/plain')</string>
         
     | 
| 
      
 83 
     | 
    
         
            +
                  </mimeTypes>
         
     | 
| 
      
 84 
     | 
    
         
            +
                </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
         
     | 
| 
      
 85 
     | 
    
         
            +
              </outputs>
         
     | 
| 
      
 86 
     | 
    
         
            +
            </net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
         
     | 
| 
      
 87 
     | 
    
         
            +
              <maxJobs>1</maxJobs>
         
     | 
| 
      
 88 
     | 
    
         
            +
            </net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="">
         
     | 
| 
      
 89 
     | 
    
         
            +
              <backoffFactor>1.0</backoffFactor>
         
     | 
| 
      
 90 
     | 
    
         
            +
              <initialDelay>1000</initialDelay>
         
     | 
| 
      
 91 
     | 
    
         
            +
              <maxDelay>5000</maxDelay>
         
     | 
| 
      
 92 
     | 
    
         
            +
              <maxRetries>0</maxRetries>
         
     | 
| 
      
 93 
     | 
    
         
            +
            </net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="xml-text" depth="0" /><port name="xpath" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>get_element</processor><port>xml-text</port></sink><source type="dataflow"><port>xml</port></source></datalink><datalink><sink type="processor"><processor>get_element</processor><port>xpath</port></sink><source type="dataflow"><port>xpath</port></source></datalink><datalink><sink type="dataflow"><port>nodes</port></sink><source type="processor"><processor>get_element</processor><port>nodelist</port></source></datalink><datalink><sink type="dataflow"><port>xml_nodes</port></sink><source type="processor"><processor>get_element</processor><port>nodelistAsXML</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
         
     | 
| 
      
 94 
     | 
    
         
            +
              <annotationAssertions>
         
     | 
| 
      
 95 
     | 
    
         
            +
                <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
         
     | 
| 
      
 96 
     | 
    
         
            +
                  <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
         
     | 
| 
      
 97 
     | 
    
         
            +
                    <identification>bac27078-6e26-48b0-a127-56146f1eff2b</identification>
         
     | 
| 
      
 98 
     | 
    
         
            +
                  </annotationBean>
         
     | 
| 
      
 99 
     | 
    
         
            +
                  <date>2011-05-13 10:10:44.677 BST</date>
         
     | 
| 
      
 100 
     | 
    
         
            +
                  <creators />
         
     | 
| 
      
 101 
     | 
    
         
            +
                  <curationEventList />
         
     | 
| 
      
 102 
     | 
    
         
            +
                </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
         
     | 
| 
      
 103 
     | 
    
         
            +
              </annotationAssertions>
         
     | 
| 
      
 104 
     | 
    
         
            +
            </net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
         
     | 
| 
      
 105 
     | 
    
         
            +
              <annotationAssertions>
         
     | 
| 
      
 106 
     | 
    
         
            +
                <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
         
     | 
| 
      
 107 
     | 
    
         
            +
                  <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
         
     | 
| 
      
 108 
     | 
    
         
            +
                    <identification>221474df-64d5-4da5-bd27-244625a8bcfa</identification>
         
     | 
| 
      
 109 
     | 
    
         
            +
                  </annotationBean>
         
     | 
| 
      
 110 
     | 
    
         
            +
                  <date>2011-05-13 10:04:40.297 BST</date>
         
     | 
| 
      
 111 
     | 
    
         
            +
                  <creators />
         
     | 
| 
      
 112 
     | 
    
         
            +
                  <curationEventList />
         
     | 
| 
      
 113 
     | 
    
         
            +
                </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
         
     | 
| 
      
 114 
     | 
    
         
            +
              </annotationAssertions>
         
     | 
| 
      
 115 
     | 
    
         
            +
            </net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
         
     | 
| 
      
 116 
     | 
    
         
            +
              <annotationAssertions>
         
     | 
| 
      
 117 
     | 
    
         
            +
                <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
         
     | 
| 
      
 118 
     | 
    
         
            +
                  <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
         
     | 
| 
      
 119 
     | 
    
         
            +
                    <identification>00e06598-e7fa-4509-8276-4fbee7d8e525</identification>
         
     | 
| 
      
 120 
     | 
    
         
            +
                  </annotationBean>
         
     | 
| 
      
 121 
     | 
    
         
            +
                  <date>2011-05-13 10:01:30.899 BST</date>
         
     | 
| 
      
 122 
     | 
    
         
            +
                  <creators />
         
     | 
| 
      
 123 
     | 
    
         
            +
                  <curationEventList />
         
     | 
| 
      
 124 
     | 
    
         
            +
                </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
         
     | 
| 
      
 125 
     | 
    
         
            +
              </annotationAssertions>
         
     | 
| 
      
 126 
     | 
    
         
            +
            </net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
         
     | 
| 
      
 127 
     | 
    
         
            +
              <annotationAssertions>
         
     | 
| 
      
 128 
     | 
    
         
            +
                <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
         
     | 
| 
      
 129 
     | 
    
         
            +
                  <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
         
     | 
| 
      
 130 
     | 
    
         
            +
                    <identification>082e06b0-6bfa-4287-a109-0163fa81fd9b</identification>
         
     | 
| 
      
 131 
     | 
    
         
            +
                  </annotationBean>
         
     | 
| 
      
 132 
     | 
    
         
            +
                  <date>2011-05-13 09:54:10.765 BST</date>
         
     | 
| 
      
 133 
     | 
    
         
            +
                  <creators />
         
     | 
| 
      
 134 
     | 
    
         
            +
                  <curationEventList />
         
     | 
| 
      
 135 
     | 
    
         
            +
                </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
         
     | 
| 
      
 136 
     | 
    
         
            +
              </annotationAssertions>
         
     | 
| 
      
 137 
     | 
    
         
            +
            </net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,13 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: t2-server
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              hash:  
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 5
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       6 
6 
     | 
    
         
             
              segments: 
         
     | 
| 
       7 
7 
     | 
    
         
             
              - 0
         
     | 
| 
       8 
8 
     | 
    
         
             
              - 6
         
     | 
| 
       9 
     | 
    
         
            -
              -  
     | 
| 
       10 
     | 
    
         
            -
              version: 0.6. 
     | 
| 
      
 9 
     | 
    
         
            +
              - 1
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 0.6.1
         
     | 
| 
       11 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       12 
12 
     | 
    
         
             
            authors: 
         
     | 
| 
       13 
13 
     | 
    
         
             
            - Robert Haines
         
     | 
| 
         @@ -15,7 +15,7 @@ autorequire: 
     | 
|
| 
       15 
15 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       16 
16 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
            date: 2011- 
     | 
| 
      
 18 
     | 
    
         
            +
            date: 2011-05-13 00:00:00 +01:00
         
     | 
| 
       19 
19 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       20 
20 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       21 
21 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
         @@ -94,6 +94,7 @@ files: 
     | 
|
| 
       94 
94 
     | 
    
         
             
            - test/workflows/pass_through.t2flow
         
     | 
| 
       95 
95 
     | 
    
         
             
            - test/workflows/empty_list_input.baclava
         
     | 
| 
       96 
96 
     | 
    
         
             
            - test/workflows/empty_list.t2flow
         
     | 
| 
      
 97 
     | 
    
         
            +
            - test/workflows/xml_xpath.t2flow
         
     | 
| 
       97 
98 
     | 
    
         
             
            - test/workflows/in.txt
         
     | 
| 
       98 
99 
     | 
    
         
             
            - test/ts_t2server.rb
         
     | 
| 
       99 
100 
     | 
    
         
             
            - README.rdoc
         
     |