t2-server 0.6.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/CHANGES.rdoc +48 -0
- data/LICENCE.rdoc +2 -2
- data/README.rdoc +245 -10
- data/Rakefile +108 -0
- data/bin/t2-delete-runs +21 -34
- data/bin/t2-get-output +134 -0
- data/bin/t2-run-workflow +121 -109
- data/bin/t2-server-admin +128 -0
- data/bin/t2-server-info +25 -38
- data/lib/t2-server-cli.rb +116 -0
- data/lib/t2-server.rb +16 -27
- data/lib/t2-server/admin.rb +147 -0
- data/lib/t2-server/connection-parameters.rb +144 -0
- data/lib/t2-server/connection.rb +352 -0
- data/lib/t2-server/credentials.rb +84 -0
- data/lib/t2-server/exceptions.rb +42 -21
- data/lib/t2-server/port.rb +472 -0
- data/lib/t2-server/run.rb +822 -227
- data/lib/t2-server/server.rb +313 -317
- data/lib/t2-server/util.rb +71 -0
- data/lib/t2-server/xml/libxml.rb +87 -0
- data/lib/t2-server/xml/nokogiri.rb +85 -0
- data/lib/t2-server/xml/rexml.rb +85 -0
- data/lib/t2-server/xml/xml.rb +111 -0
- data/lib/t2server.rb +4 -1
- data/t2-server.gemspec +112 -0
- data/test/tc_admin.rb +63 -0
- data/test/{tc_paths.rb → tc_params.rb} +11 -25
- data/test/tc_perms.rb +132 -0
- data/test/tc_run.rb +200 -67
- data/test/tc_secure.rb +191 -0
- data/test/tc_server.rb +25 -23
- data/test/tc_util.rb +74 -0
- data/test/ts_t2server.rb +57 -12
- data/test/workflows/always_fail.t2flow +69 -0
- data/test/workflows/list_and_value.t2flow +12 -0
- data/test/workflows/list_with_errors.t2flow +107 -0
- data/test/workflows/secure/basic-http.t2flow +74 -0
- data/test/workflows/secure/basic-https.t2flow +74 -0
- data/test/workflows/secure/client-https.t2flow +162 -0
- data/test/workflows/secure/digest-http.t2flow +129 -0
- data/test/workflows/secure/digest-https.t2flow +107 -0
- data/test/workflows/secure/heater-pk.pem +20 -0
- data/test/workflows/secure/user-cert.p12 +0 -0
- data/test/workflows/secure/ws-http.t2flow +180 -0
- data/test/workflows/secure/ws-https.t2flow +180 -0
- data/test/workflows/strings.txt +10 -0
- data/test/workflows/xml_xpath.t2flow +136 -136
- data/version.yml +4 -0
- metadata +132 -34
- data/lib/t2-server/xml.rb +0 -86
@@ -0,0 +1,71 @@
|
|
1
|
+
# Copyright (c) 2010-2012 The University of Manchester, UK.
|
2
|
+
#
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# * Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# * Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# * Neither the names of The University of Manchester nor the names of its
|
16
|
+
# contributors may be used to endorse or promote products derived from this
|
17
|
+
# software without specific prior written permission.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
20
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
21
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
23
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
24
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
#
|
31
|
+
# Author: Robert Haines
|
32
|
+
|
33
|
+
module T2Server
|
34
|
+
module Util
|
35
|
+
|
36
|
+
# :call-seq:
|
37
|
+
# Util.strip_uri_credentials(uri) -> URI, Credentials
|
38
|
+
#
|
39
|
+
# Strip user credentials from an address in URI or String format and return
|
40
|
+
# a tuple of the URI minus the credentials and a T2Server::Credentials
|
41
|
+
# object.
|
42
|
+
def self.strip_uri_credentials(uri)
|
43
|
+
# we want to use URIs here but strings can be passed in
|
44
|
+
unless uri.is_a? URI
|
45
|
+
uri = URI.parse(Util.strip_path_slashes(uri))
|
46
|
+
end
|
47
|
+
|
48
|
+
creds = nil
|
49
|
+
|
50
|
+
# strip username and password from the URI if present
|
51
|
+
if uri.user != nil
|
52
|
+
creds = T2Server::HttpBasic.new(uri.user, uri.password)
|
53
|
+
|
54
|
+
uri = URI::HTTP.new(uri.scheme, nil, uri.host, uri.port, nil,
|
55
|
+
uri.path, nil, nil, nil);
|
56
|
+
end
|
57
|
+
|
58
|
+
[uri, creds]
|
59
|
+
end
|
60
|
+
|
61
|
+
# :call-seq:
|
62
|
+
# Util.strip_path_slashes(path) -> String
|
63
|
+
#
|
64
|
+
# Returns a new String with one leading and one trailing slash
|
65
|
+
# removed from the ends of _path_ (if present).
|
66
|
+
def self.strip_path_slashes(path)
|
67
|
+
path.gsub(/^\//, "").chomp("/")
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# Copyright (c) 2010-2012 The University of Manchester, UK.
|
2
|
+
#
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# * Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# * Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# * Neither the names of The University of Manchester nor the names of its
|
16
|
+
# contributors may be used to endorse or promote products derived from this
|
17
|
+
# software without specific prior written permission.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
20
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
21
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
23
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
24
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
#
|
31
|
+
# Author: Robert Haines
|
32
|
+
|
33
|
+
require 'rubygems'
|
34
|
+
require 'libxml'
|
35
|
+
|
36
|
+
module T2Server
|
37
|
+
module XML
|
38
|
+
# Shut the libxml error handler up
|
39
|
+
LibXML::XML::Error.set_handler(&LibXML::XML::Error::QUIET_HANDLER)
|
40
|
+
|
41
|
+
module Methods
|
42
|
+
def xml_document(string)
|
43
|
+
LibXML::XML::Document.string(string)
|
44
|
+
end
|
45
|
+
|
46
|
+
def xml_text_node(text)
|
47
|
+
LibXML::XML::Node.new_text(text)
|
48
|
+
end
|
49
|
+
|
50
|
+
def xml_first_child(node)
|
51
|
+
node.first
|
52
|
+
end
|
53
|
+
|
54
|
+
def xml_children(doc, &block)
|
55
|
+
doc.each { |node| yield node }
|
56
|
+
end
|
57
|
+
|
58
|
+
def xml_node_name(node)
|
59
|
+
node.name
|
60
|
+
end
|
61
|
+
|
62
|
+
def xml_node_content(node)
|
63
|
+
node.content
|
64
|
+
end
|
65
|
+
|
66
|
+
def xml_node_attribute(node, attribute)
|
67
|
+
node.attributes[attribute]
|
68
|
+
end
|
69
|
+
|
70
|
+
def xpath_compile(xpath)
|
71
|
+
LibXML::XML::XPath::Expression.new(xpath)
|
72
|
+
end
|
73
|
+
|
74
|
+
def xpath_find(doc, expr)
|
75
|
+
doc.find(expr, Namespaces::MAP)
|
76
|
+
end
|
77
|
+
|
78
|
+
def xpath_first(doc, expr)
|
79
|
+
doc.find_first(expr, Namespaces::MAP)
|
80
|
+
end
|
81
|
+
|
82
|
+
def xpath_attr(doc, expr, attribute)
|
83
|
+
doc.find_first(expr, Namespaces::MAP).attributes[attribute]
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# Copyright (c) 2010-2012 The University of Manchester, UK.
|
2
|
+
#
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# * Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# * Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# * Neither the names of The University of Manchester nor the names of its
|
16
|
+
# contributors may be used to endorse or promote products derived from this
|
17
|
+
# software without specific prior written permission.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
20
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
21
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
23
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
24
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
#
|
31
|
+
# Author: Robert Haines
|
32
|
+
|
33
|
+
require 'rubygems'
|
34
|
+
require 'nokogiri'
|
35
|
+
|
36
|
+
module T2Server
|
37
|
+
module XML
|
38
|
+
|
39
|
+
module Methods
|
40
|
+
def xml_document(string)
|
41
|
+
Nokogiri::XML(string)
|
42
|
+
end
|
43
|
+
|
44
|
+
def xml_text_node(text)
|
45
|
+
Nokogiri::XML::Text.new(text, Nokogiri::XML::Document.new).to_s
|
46
|
+
end
|
47
|
+
|
48
|
+
def xml_first_child(node)
|
49
|
+
node.first_element_child
|
50
|
+
end
|
51
|
+
|
52
|
+
def xml_children(doc, &block)
|
53
|
+
doc.children.each &block
|
54
|
+
end
|
55
|
+
|
56
|
+
def xml_node_name(node)
|
57
|
+
node.node_name
|
58
|
+
end
|
59
|
+
|
60
|
+
def xml_node_content(node)
|
61
|
+
node.content
|
62
|
+
end
|
63
|
+
|
64
|
+
def xml_node_attribute(node, attribute)
|
65
|
+
node[attribute]
|
66
|
+
end
|
67
|
+
|
68
|
+
def xpath_compile(xpath)
|
69
|
+
xpath
|
70
|
+
end
|
71
|
+
|
72
|
+
def xpath_find(doc, expr)
|
73
|
+
doc.xpath(expr, Namespaces::MAP)
|
74
|
+
end
|
75
|
+
|
76
|
+
def xpath_first(doc, expr)
|
77
|
+
doc.at_xpath(expr, Namespaces::MAP)
|
78
|
+
end
|
79
|
+
|
80
|
+
def xpath_attr(doc, expr, attribute)
|
81
|
+
doc.at_xpath(expr, Namespaces::MAP)[attribute]
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# Copyright (c) 2010-2012 The University of Manchester, UK.
|
2
|
+
#
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# * Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# * Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# * Neither the names of The University of Manchester nor the names of its
|
16
|
+
# contributors may be used to endorse or promote products derived from this
|
17
|
+
# software without specific prior written permission.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
20
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
21
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
23
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
24
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
#
|
31
|
+
# Author: Robert Haines
|
32
|
+
|
33
|
+
require 'rexml/document'
|
34
|
+
require 'rexml/text'
|
35
|
+
|
36
|
+
module T2Server
|
37
|
+
module XML
|
38
|
+
|
39
|
+
module Methods
|
40
|
+
def xml_document(string)
|
41
|
+
REXML::Document.new(string)
|
42
|
+
end
|
43
|
+
|
44
|
+
def xml_text_node(text)
|
45
|
+
REXML::Text.new(text).to_s
|
46
|
+
end
|
47
|
+
|
48
|
+
def xml_first_child(node)
|
49
|
+
node.first
|
50
|
+
end
|
51
|
+
|
52
|
+
def xml_children(doc, &block)
|
53
|
+
doc.each { |node| yield node }
|
54
|
+
end
|
55
|
+
|
56
|
+
def xml_node_name(node)
|
57
|
+
node.name
|
58
|
+
end
|
59
|
+
|
60
|
+
def xml_node_content(node)
|
61
|
+
node.text
|
62
|
+
end
|
63
|
+
|
64
|
+
def xml_node_attribute(node, attribute)
|
65
|
+
node.attributes[attribute]
|
66
|
+
end
|
67
|
+
|
68
|
+
def xpath_compile(xpath)
|
69
|
+
xpath
|
70
|
+
end
|
71
|
+
|
72
|
+
def xpath_find(doc, expr)
|
73
|
+
REXML::XPath.each(doc, expr, Namespaces::MAP)
|
74
|
+
end
|
75
|
+
|
76
|
+
def xpath_first(doc, expr)
|
77
|
+
REXML::XPath.first(doc, expr, Namespaces::MAP)
|
78
|
+
end
|
79
|
+
|
80
|
+
def xpath_attr(doc, expr, attribute)
|
81
|
+
REXML::XPath.first(doc, expr, Namespaces::MAP).attributes[attribute]
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# Copyright (c) 2010-2012 The University of Manchester, UK.
|
2
|
+
#
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# * Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# * Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# * Neither the names of The University of Manchester nor the names of its
|
16
|
+
# contributors may be used to endorse or promote products derived from this
|
17
|
+
# software without specific prior written permission.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
20
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
21
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
23
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
24
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
#
|
31
|
+
# Author: Robert Haines
|
32
|
+
|
33
|
+
begin
|
34
|
+
require 't2-server/xml/libxml'
|
35
|
+
rescue LoadError
|
36
|
+
begin
|
37
|
+
require 't2-server/xml/nokogiri'
|
38
|
+
rescue LoadError
|
39
|
+
require 't2-server/xml/rexml'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
module T2Server
|
44
|
+
module XML
|
45
|
+
|
46
|
+
module Namespaces
|
47
|
+
SERVER = "http://ns.taverna.org.uk/2010/xml/server/"
|
48
|
+
REST = SERVER + "rest/"
|
49
|
+
ADMIN = SERVER + "admin/"
|
50
|
+
PORT = "http://ns.taverna.org.uk/2010/port/"
|
51
|
+
|
52
|
+
MAP = {
|
53
|
+
"nss" => Namespaces::SERVER,
|
54
|
+
"nsr" => Namespaces::REST,
|
55
|
+
"nsa" => Namespaces::ADMIN,
|
56
|
+
"port" => Namespaces::PORT
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
module Fragments
|
61
|
+
WORKFLOW = "<t2s:workflow xmlns:t2s=\"#{Namespaces::SERVER}\">\n" +
|
62
|
+
" %s\n</t2s:workflow>"
|
63
|
+
RUNINPUT = "<t2sr:runInput xmlns:t2sr=\"#{Namespaces::REST}\">\n" +
|
64
|
+
" %s\n</t2sr:runInput>"
|
65
|
+
RUNINPUTVALUE = RUNINPUT % "<t2sr:value>%s</t2sr:value>"
|
66
|
+
RUNINPUTFILE = RUNINPUT % "<t2sr:file>%s</t2sr:file>"
|
67
|
+
UPLOAD = "<t2sr:upload xmlns:t2sr=\"#{Namespaces::REST}\" " +
|
68
|
+
"t2sr:name=\"%s\">\n %s\n</t2sr:upload>"
|
69
|
+
MKDIR = "<t2sr:mkdir xmlns:t2sr=\"#{Namespaces::REST}\" " +
|
70
|
+
"t2sr:name=\"%s\" />"
|
71
|
+
|
72
|
+
PERMISSION = "<t2sr:userName>%s</t2sr:userName>" +
|
73
|
+
"<t2sr:permission>%s</t2sr:permission>"
|
74
|
+
PERM_UPDATE = "<t2sr:permissionUpdate " +
|
75
|
+
"xmlns:t2sr=\"#{Namespaces::REST}\">" +
|
76
|
+
"#{PERMISSION}</t2sr:permissionUpdate>"
|
77
|
+
|
78
|
+
SERVICE_URI = "<t2s:serviceURI>%s</t2s:serviceURI>"
|
79
|
+
CREDENTIAL = "<t2sr:credential xmlns:t2sr=\"#{Namespaces::REST}\"" +
|
80
|
+
" xmlns:t2s=\"#{Namespaces::SERVER}\">\n" +
|
81
|
+
"%s\n</t2sr:credential>"
|
82
|
+
USERPASS_CRED = "<t2s:userpass>\n" +
|
83
|
+
" #{SERVICE_URI}\n" +
|
84
|
+
" <t2s:username>%s</t2s:username>\n" +
|
85
|
+
" <t2s:password>%s</t2s:password>\n" +
|
86
|
+
"</t2s:userpass>"
|
87
|
+
|
88
|
+
KEYPAIR_CRED = "<t2s:keypair>\n" +
|
89
|
+
" #{SERVICE_URI}\n" +
|
90
|
+
" <t2s:credentialName>%s</t2s:credentialName>\n" +
|
91
|
+
" <t2s:credentialBytes>%s</t2s:credentialBytes>\n" +
|
92
|
+
" <t2s:fileType>%s</t2s:fileType>\n" +
|
93
|
+
" <t2s:unlockPassword>%s</t2s:unlockPassword>\n" +
|
94
|
+
"</t2s:keypair>"
|
95
|
+
|
96
|
+
TRUST = "<t2s:trustedIdentity " +
|
97
|
+
"xmlns:t2s=\"#{Namespaces::SERVER}\">\n" +
|
98
|
+
" <t2s:certificateBytes>%s</t2s:certificateBytes>\n" +
|
99
|
+
" <t2s:fileType>%s</t2s:fileType>\n" +
|
100
|
+
"</t2s:trustedIdentity>"
|
101
|
+
end
|
102
|
+
|
103
|
+
module Methods
|
104
|
+
# The methods in this namespace are provided by the particular XML
|
105
|
+
# library selected above. The xpath_compile method needs to be declared
|
106
|
+
# as a module method so it can be used as a class method when it is
|
107
|
+
# mixed in.
|
108
|
+
module_function :xpath_compile
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
data/lib/t2server.rb
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
#
|
15
15
|
# * Neither the names of The University of Manchester nor the names of its
|
16
16
|
# contributors may be used to endorse or promote products derived from this
|
17
|
-
# software without specific prior written permission.
|
17
|
+
# software without specific prior written permission.
|
18
18
|
#
|
19
19
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
20
20
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
@@ -32,4 +32,7 @@
|
|
32
32
|
|
33
33
|
# This is simply here to provide backwards compatibility. Old versions had an
|
34
34
|
# inconsistancy between the gem name and the file to require to use it.
|
35
|
+
warn "[DEPRECATION] Code should no longer require 't2server'. Please use " +
|
36
|
+
"require 't2-server' as this is consistent with the gem name. In version " +
|
37
|
+
"1.0 require 't2server' will cease to work."
|
35
38
|
require 't2-server'
|