myexperiment-rest 0.2.8 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +13 -0
- data/README +3 -3
- data/Rakefile +4 -9
- data/bin/get_workflow_data.rb +27 -9
- data/doc/rdoc/CHANGES.html +30 -4
- data/doc/rdoc/LICENSE.html +8 -4
- data/doc/rdoc/MyExperimentREST.html +101 -10
- data/doc/rdoc/MyExperimentREST/{TavernaIOData.html → MyExperimentIOData.html} +76 -14
- data/doc/rdoc/MyExperimentREST/{TavernaUser.html → MyExperimentUser.html} +122 -22
- data/doc/rdoc/MyExperimentREST/{TavernaWorkflow.html → MyExperimentWorkflow.html} +87 -62
- data/doc/rdoc/MyExperimentREST/Urls.html +168 -0
- data/doc/rdoc/MyExperimentREST/User.html +260 -0
- data/doc/rdoc/MyExperimentREST/{Workflows.html → Workflow.html} +72 -61
- data/doc/rdoc/README.html +12 -7
- data/doc/rdoc/created.rid +7 -5
- data/doc/rdoc/index.html +30 -11
- data/doc/rdoc/lib/myexperiment-rest/constants_rb.html +52 -0
- data/doc/rdoc/lib/myexperiment-rest/{myexperiment_rest_rb.html → user_rb.html} +2 -8
- data/doc/rdoc/lib/myexperiment-rest/workflow_rb.html +54 -0
- data/doc/rdoc/lib/myexperiment-rest_rb.html +10 -2
- data/lib/myexperiment-rest.rb +42 -1
- data/lib/myexperiment-rest/constants.rb +11 -0
- data/lib/myexperiment-rest/user.rb +83 -0
- data/lib/myexperiment-rest/workflow.rb +145 -0
- metadata +21 -15
- data/lib/myexperiment-rest/myexperiment_rest.rb +0 -190
@@ -0,0 +1,260 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: MyExperimentREST::User</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
<script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body id="top" class="class">
|
19
|
+
|
20
|
+
<div id="metadata">
|
21
|
+
<div id="home-metadata">
|
22
|
+
<div id="home-section" class="section">
|
23
|
+
<h3 class="section-header">
|
24
|
+
<a href="../index.html">Home</a>
|
25
|
+
<a href="../index.html#classes">Classes</a>
|
26
|
+
<a href="../index.html#methods">Methods</a>
|
27
|
+
</h3>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div id="file-metadata">
|
32
|
+
<div id="file-list-section" class="section">
|
33
|
+
<h3 class="section-header">In Files</h3>
|
34
|
+
<div class="section-body">
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li><a href="../lib/myexperiment-rest/user_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="lib/myexperiment-rest/user.rb">lib/myexperiment-rest/user.rb</a></li>
|
39
|
+
|
40
|
+
</ul>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
<!-- Parent Class -->
|
50
|
+
<div id="parent-class-section" class="section">
|
51
|
+
<h3 class="section-header">Parent</h3>
|
52
|
+
|
53
|
+
<p class="link">Object</p>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Method Quickref -->
|
64
|
+
<div id="method-list-section" class="section">
|
65
|
+
<h3 class="section-header">Methods</h3>
|
66
|
+
<ul class="link-list">
|
67
|
+
|
68
|
+
<li><a href="#method-c-from_id">::from_id</a></li>
|
69
|
+
|
70
|
+
<li><a href="#method-c-from_uri">::from_uri</a></li>
|
71
|
+
|
72
|
+
</ul>
|
73
|
+
</div>
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="project-metadata">
|
80
|
+
|
81
|
+
|
82
|
+
<div id="fileindex-section" class="section project-section">
|
83
|
+
<h3 class="section-header">Files</h3>
|
84
|
+
<ul>
|
85
|
+
|
86
|
+
<li class="file"><a href="../CHANGES.html">CHANGES</a></li>
|
87
|
+
|
88
|
+
<li class="file"><a href="../LICENSE.html">LICENSE</a></li>
|
89
|
+
|
90
|
+
<li class="file"><a href="../README.html">README</a></li>
|
91
|
+
|
92
|
+
</ul>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
<div id="classindex-section" class="section project-section">
|
97
|
+
<h3 class="section-header">Class/Module Index
|
98
|
+
<span class="search-toggle"><img src="../images/find.png"
|
99
|
+
height="16" width="16" alt="[+]"
|
100
|
+
title="show/hide quicksearch" /></span></h3>
|
101
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
102
|
+
<fieldset>
|
103
|
+
<legend>Quicksearch</legend>
|
104
|
+
<input type="text" name="quicksearch" value=""
|
105
|
+
class="quicksearch-field" />
|
106
|
+
</fieldset>
|
107
|
+
</form>
|
108
|
+
|
109
|
+
<ul class="link-list">
|
110
|
+
|
111
|
+
<li><a href="../MyExperimentREST.html">MyExperimentREST</a></li>
|
112
|
+
|
113
|
+
<li><a href="../MyExperimentREST/MyExperimentIOData.html">MyExperimentREST::MyExperimentIOData</a></li>
|
114
|
+
|
115
|
+
<li><a href="../MyExperimentREST/MyExperimentUser.html">MyExperimentREST::MyExperimentUser</a></li>
|
116
|
+
|
117
|
+
<li><a href="../MyExperimentREST/MyExperimentWorkflow.html">MyExperimentREST::MyExperimentWorkflow</a></li>
|
118
|
+
|
119
|
+
<li><a href="../MyExperimentREST/Urls.html">MyExperimentREST::Urls</a></li>
|
120
|
+
|
121
|
+
<li><a href="../MyExperimentREST/User.html">MyExperimentREST::User</a></li>
|
122
|
+
|
123
|
+
<li><a href="../MyExperimentREST/Workflow.html">MyExperimentREST::Workflow</a></li>
|
124
|
+
|
125
|
+
</ul>
|
126
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
|
130
|
+
</div>
|
131
|
+
</div>
|
132
|
+
|
133
|
+
<div id="documentation">
|
134
|
+
<h1 class="class">MyExperimentREST::User</h1>
|
135
|
+
|
136
|
+
<div id="description" class="description">
|
137
|
+
|
138
|
+
<p>Connects to myExperiment REST API and creates a <em><a
|
139
|
+
href="MyExperimentUser.html">MyExperimentUser</a></em> object.</p>
|
140
|
+
|
141
|
+
</div><!-- description -->
|
142
|
+
|
143
|
+
|
144
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<!-- Methods -->
|
154
|
+
|
155
|
+
<div id="public-class-method-details" class="method-section section">
|
156
|
+
<h3 class="section-header">Public Class Methods</h3>
|
157
|
+
|
158
|
+
|
159
|
+
<div id="from_id-method" class="method-detail ">
|
160
|
+
<a name="method-c-from_id"></a>
|
161
|
+
|
162
|
+
|
163
|
+
<div class="method-heading">
|
164
|
+
<span class="method-name">from_id</span><span
|
165
|
+
class="method-args">(user_id)</span>
|
166
|
+
<span class="method-click-advice">click to toggle source</span>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
|
170
|
+
<div class="method-description">
|
171
|
+
|
172
|
+
<p>Returns a <em><a href="MyExperimentUser.html">MyExperimentUser</a></em>
|
173
|
+
object given a myExperiment id for that user.</p>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<div class="method-source-code" id="from_id-source">
|
178
|
+
<pre>
|
179
|
+
<span class="ruby-comment"># File lib/myexperiment-rest/user.rb, line 31</span>
|
180
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">from_id</span>(<span class="ruby-identifier">user_id</span>)
|
181
|
+
|
182
|
+
<span class="ruby-comment"># Get user resource information</span>
|
183
|
+
<span class="ruby-identifier">xml</span> = <span class="ruby-constant">MyExperimentREST</span>.<span class="ruby-identifier">get_myexperiment_data</span>(<span class="ruby-constant">Urls</span><span class="ruby-operator">::</span><span class="ruby-constant">USER_URL</span>, <span class="ruby-value">:id</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">user_id</span>)
|
184
|
+
|
185
|
+
<span class="ruby-constant">MyExperimentUser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">xml</span>)
|
186
|
+
<span class="ruby-keyword">end</span></pre>
|
187
|
+
</div><!-- from_id-source -->
|
188
|
+
|
189
|
+
</div>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
</div><!-- from_id-method -->
|
195
|
+
|
196
|
+
|
197
|
+
<div id="from_uri-method" class="method-detail ">
|
198
|
+
<a name="method-c-from_uri"></a>
|
199
|
+
|
200
|
+
|
201
|
+
<div class="method-heading">
|
202
|
+
<span class="method-name">from_uri</span><span
|
203
|
+
class="method-args">(uri)</span>
|
204
|
+
<span class="method-click-advice">click to toggle source</span>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
<div class="method-description">
|
209
|
+
|
210
|
+
<p>Returns a <em><a href="MyExperimentUser.html">MyExperimentUser</a></em>
|
211
|
+
object given a URI of the user in the repository as a String.</p>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
<div class="method-source-code" id="from_uri-source">
|
216
|
+
<pre>
|
217
|
+
<span class="ruby-comment"># File lib/myexperiment-rest/user.rb, line 11</span>
|
218
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">from_uri</span>(<span class="ruby-identifier">uri</span>)
|
219
|
+
|
220
|
+
<span class="ruby-identifier">user_id</span> = <span class="ruby-string">''</span>
|
221
|
+
|
222
|
+
<span class="ruby-comment"># Get user id - will match both user/74 and users.xml?id=74</span>
|
223
|
+
<span class="ruby-identifier">uri_id</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/user.*[\/?](id=)?(\d+)/</span>)
|
224
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">uri_id</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
|
225
|
+
<span class="ruby-identifier">user_id</span> = <span class="ruby-identifier">uri_id</span>[<span class="ruby-value">2</span>]
|
226
|
+
<span class="ruby-keyword">else</span>
|
227
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">"Could not match user id."</span>
|
228
|
+
<span class="ruby-keyword">end</span>
|
229
|
+
|
230
|
+
<span class="ruby-comment"># Get user resource information</span>
|
231
|
+
<span class="ruby-identifier">xml</span> = <span class="ruby-constant">MyExperimentREST</span>.<span class="ruby-identifier">get_myexperiment_data</span>(<span class="ruby-constant">Urls</span><span class="ruby-operator">::</span><span class="ruby-constant">USER_URL</span>, <span class="ruby-value">:id</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">user_id</span>)
|
232
|
+
|
233
|
+
<span class="ruby-constant">MyExperimentUser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">xml</span>)
|
234
|
+
<span class="ruby-keyword">end</span></pre>
|
235
|
+
</div><!-- from_uri-source -->
|
236
|
+
|
237
|
+
</div>
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
</div><!-- from_uri-method -->
|
243
|
+
|
244
|
+
|
245
|
+
</div><!-- public-class-method-details -->
|
246
|
+
|
247
|
+
</div><!-- 5Buntitled-5D -->
|
248
|
+
|
249
|
+
|
250
|
+
</div><!-- documentation -->
|
251
|
+
|
252
|
+
<div id="validator-badges">
|
253
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
254
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
255
|
+
Rdoc Generator</a> 2</small>.</p>
|
256
|
+
</div>
|
257
|
+
|
258
|
+
</body>
|
259
|
+
</html>
|
260
|
+
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<head>
|
6
6
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
7
7
|
|
8
|
-
<title>Class: MyExperimentREST::
|
8
|
+
<title>Class: MyExperimentREST::Workflow</title>
|
9
9
|
|
10
10
|
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
11
|
|
@@ -34,8 +34,8 @@
|
|
34
34
|
<div class="section-body">
|
35
35
|
<ul>
|
36
36
|
|
37
|
-
<li><a href="../lib/myexperiment-rest/
|
38
|
-
class="thickbox" title="lib/myexperiment-rest/
|
37
|
+
<li><a href="../lib/myexperiment-rest/workflow_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="lib/myexperiment-rest/workflow.rb">lib/myexperiment-rest/workflow.rb</a></li>
|
39
39
|
|
40
40
|
</ul>
|
41
41
|
</div>
|
@@ -65,25 +65,15 @@
|
|
65
65
|
<h3 class="section-header">Methods</h3>
|
66
66
|
<ul class="link-list">
|
67
67
|
|
68
|
-
<li><a href="#method-
|
68
|
+
<li><a href="#method-c-from_id_and_version">::from_id_and_version</a></li>
|
69
|
+
|
70
|
+
<li><a href="#method-c-from_uri">::from_uri</a></li>
|
69
71
|
|
70
72
|
</ul>
|
71
73
|
</div>
|
72
74
|
|
73
75
|
|
74
76
|
|
75
|
-
<!-- Included Modules -->
|
76
|
-
<div id="includes-section" class="section">
|
77
|
-
<h3 class="section-header">Included Modules</h3>
|
78
|
-
<ul class="link-list">
|
79
|
-
|
80
|
-
|
81
|
-
<li><span class="include">LibXML</span></li>
|
82
|
-
|
83
|
-
|
84
|
-
</ul>
|
85
|
-
</div>
|
86
|
-
|
87
77
|
</div>
|
88
78
|
|
89
79
|
<div id="project-metadata">
|
@@ -120,13 +110,17 @@
|
|
120
110
|
|
121
111
|
<li><a href="../MyExperimentREST.html">MyExperimentREST</a></li>
|
122
112
|
|
123
|
-
<li><a href="../MyExperimentREST/
|
113
|
+
<li><a href="../MyExperimentREST/MyExperimentIOData.html">MyExperimentREST::MyExperimentIOData</a></li>
|
114
|
+
|
115
|
+
<li><a href="../MyExperimentREST/MyExperimentUser.html">MyExperimentREST::MyExperimentUser</a></li>
|
116
|
+
|
117
|
+
<li><a href="../MyExperimentREST/MyExperimentWorkflow.html">MyExperimentREST::MyExperimentWorkflow</a></li>
|
124
118
|
|
125
|
-
<li><a href="../MyExperimentREST/
|
119
|
+
<li><a href="../MyExperimentREST/Urls.html">MyExperimentREST::Urls</a></li>
|
126
120
|
|
127
|
-
<li><a href="../MyExperimentREST/
|
121
|
+
<li><a href="../MyExperimentREST/User.html">MyExperimentREST::User</a></li>
|
128
122
|
|
129
|
-
<li><a href="../MyExperimentREST/
|
123
|
+
<li><a href="../MyExperimentREST/Workflow.html">MyExperimentREST::Workflow</a></li>
|
130
124
|
|
131
125
|
</ul>
|
132
126
|
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
@@ -137,12 +131,12 @@
|
|
137
131
|
</div>
|
138
132
|
|
139
133
|
<div id="documentation">
|
140
|
-
<h1 class="class">MyExperimentREST::
|
134
|
+
<h1 class="class">MyExperimentREST::Workflow</h1>
|
141
135
|
|
142
136
|
<div id="description" class="description">
|
143
137
|
|
144
138
|
<p>Connects to myExperiment REST API and creates a <em><a
|
145
|
-
href="
|
139
|
+
href="MyExperimentWorkflow.html">MyExperimentWorkflow</a></em> object.</p>
|
146
140
|
|
147
141
|
</div><!-- description -->
|
148
142
|
|
@@ -155,41 +149,58 @@ href="TavernaWorkflow.html">TavernaWorkflow</a></em> object.</p>
|
|
155
149
|
|
156
150
|
|
157
151
|
|
158
|
-
<!-- Attributes -->
|
159
|
-
<div id="attribute-method-details" class="method-section section">
|
160
|
-
<h3 class="section-header">Attributes</h3>
|
161
152
|
|
162
|
-
|
163
|
-
|
164
|
-
|
153
|
+
<!-- Methods -->
|
154
|
+
|
155
|
+
<div id="public-class-method-details" class="method-section section">
|
156
|
+
<h3 class="section-header">Public Class Methods</h3>
|
157
|
+
|
158
|
+
|
159
|
+
<div id="from_id_and_version-method" class="method-detail ">
|
160
|
+
<a name="method-c-from_id_and_version"></a>
|
161
|
+
|
165
162
|
|
166
|
-
<div class="method-heading
|
167
|
-
<span class="method-name">
|
168
|
-
class="
|
163
|
+
<div class="method-heading">
|
164
|
+
<span class="method-name">from_id_and_version</span><span
|
165
|
+
class="method-args">(id, version='')</span>
|
166
|
+
<span class="method-click-advice">click to toggle source</span>
|
169
167
|
</div>
|
168
|
+
|
170
169
|
|
171
170
|
<div class="method-description">
|
172
|
-
|
173
|
-
|
174
|
-
|
171
|
+
|
172
|
+
<p>Returns a <em><a
|
173
|
+
href="MyExperimentWorkflow.html">MyExperimentWorkflow</a></em> object given
|
174
|
+
a myExperiment id and version for that workflow.</p>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<div class="method-source-code" id="from_id_and_version-source">
|
179
|
+
<pre>
|
180
|
+
<span class="ruby-comment"># File lib/myexperiment-rest/workflow.rb, line 38</span>
|
181
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">from_id_and_version</span>(<span class="ruby-identifier">id</span>, <span class="ruby-identifier">version</span>=<span class="ruby-string">''</span>)
|
182
|
+
|
183
|
+
<span class="ruby-comment"># Get workflow resource information</span>
|
184
|
+
<span class="ruby-identifier">xml</span> = <span class="ruby-constant">MyExperimentREST</span>.<span class="ruby-identifier">get_myexperiment_data</span>(<span class="ruby-constant">Urls</span><span class="ruby-operator">::</span><span class="ruby-constant">WORKFLOW_URL</span>, <span class="ruby-value">:id</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">id</span>, <span class="ruby-value">:version</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">version</span>)
|
185
|
+
|
186
|
+
<span class="ruby-constant">MyExperimentWorkflow</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">xml</span>)
|
187
|
+
<span class="ruby-keyword">end</span></pre>
|
188
|
+
</div><!-- from_id_and_version-source -->
|
189
|
+
|
175
190
|
</div>
|
176
|
-
</div>
|
177
|
-
|
178
|
-
</div><!-- attribute-method-details -->
|
179
|
-
|
180
191
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
</div><!-- from_id_and_version-method -->
|
185
196
|
|
186
197
|
|
187
|
-
<div id="
|
188
|
-
<a name="method-
|
198
|
+
<div id="from_uri-method" class="method-detail ">
|
199
|
+
<a name="method-c-from_uri"></a>
|
189
200
|
|
190
201
|
|
191
202
|
<div class="method-heading">
|
192
|
-
<span class="method-name">
|
203
|
+
<span class="method-name">from_uri</span><span
|
193
204
|
class="method-args">(uri)</span>
|
194
205
|
<span class="method-click-advice">click to toggle source</span>
|
195
206
|
</div>
|
@@ -197,22 +208,24 @@ href="TavernaWorkflow.html">TavernaWorkflow</a></em> object.</p>
|
|
197
208
|
|
198
209
|
<div class="method-description">
|
199
210
|
|
200
|
-
<p>
|
211
|
+
<p>Returns a <em><a
|
212
|
+
href="MyExperimentWorkflow.html">MyExperimentWorkflow</a></em> object given
|
213
|
+
a URI of the workflow in the repository as a String.</p>
|
201
214
|
|
202
215
|
|
203
216
|
|
204
|
-
<div class="method-source-code" id="
|
217
|
+
<div class="method-source-code" id="from_uri-source">
|
205
218
|
<pre>
|
206
|
-
<span class="ruby-comment"># File lib/myexperiment-rest/
|
207
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">
|
219
|
+
<span class="ruby-comment"># File lib/myexperiment-rest/workflow.rb, line 11</span>
|
220
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">from_uri</span>(<span class="ruby-identifier">uri</span>)
|
208
221
|
|
209
222
|
<span class="ruby-identifier">workflow_id</span> = <span class="ruby-string">''</span>
|
210
223
|
<span class="ruby-identifier">workflow_version</span> = <span class="ruby-string">''</span>
|
211
224
|
|
212
|
-
<span class="ruby-comment"># Get workflow id</span>
|
213
|
-
<span class="ruby-identifier">uri_id</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/
|
225
|
+
<span class="ruby-comment"># Get workflow id - will match both workflow/74 and workflows.xml?id=74</span>
|
226
|
+
<span class="ruby-identifier">uri_id</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/workflow.*[\/?](id=)?(\d+)/</span>)
|
214
227
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">uri_id</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
|
215
|
-
<span class="ruby-identifier">workflow_id</span> = <span class="ruby-identifier">uri_id</span>[<span class="ruby-value">
|
228
|
+
<span class="ruby-identifier">workflow_id</span> = <span class="ruby-identifier">uri_id</span>[<span class="ruby-value">2</span>]
|
216
229
|
<span class="ruby-keyword">else</span>
|
217
230
|
<span class="ruby-identifier">raise</span> <span class="ruby-string">"Could not match workflow id."</span>
|
218
231
|
<span class="ruby-keyword">end</span>
|
@@ -223,24 +236,22 @@ href="TavernaWorkflow.html">TavernaWorkflow</a></em> object.</p>
|
|
223
236
|
<span class="ruby-identifier">workflow_version</span> = <span class="ruby-identifier">uri_version</span>[<span class="ruby-value">1</span>]
|
224
237
|
<span class="ruby-keyword">end</span>
|
225
238
|
|
226
|
-
<span class="ruby-comment"># Get workflow resource information
|
227
|
-
<span class="ruby-identifier">
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
<span class="ruby-identifier">populate_workflow</span>(<span class="ruby-identifier">response</span>)
|
239
|
+
<span class="ruby-comment"># Get workflow resource information </span>
|
240
|
+
<span class="ruby-identifier">xml</span> = <span class="ruby-constant">MyExperimentREST</span>.<span class="ruby-identifier">get_myexperiment_data</span>(<span class="ruby-constant">Urls</span><span class="ruby-operator">::</span><span class="ruby-constant">WORKFLOW_URL</span>, <span class="ruby-value">:id</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">workflow_id</span>, <span class="ruby-value">:version</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">workflow_version</span>)
|
241
|
+
|
242
|
+
<span class="ruby-constant">MyExperimentWorkflow</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">xml</span>)
|
232
243
|
<span class="ruby-keyword">end</span></pre>
|
233
|
-
</div><!--
|
244
|
+
</div><!-- from_uri-source -->
|
234
245
|
|
235
246
|
</div>
|
236
247
|
|
237
248
|
|
238
249
|
|
239
250
|
|
240
|
-
</div><!--
|
251
|
+
</div><!-- from_uri-method -->
|
241
252
|
|
242
253
|
|
243
|
-
</div><!-- public-
|
254
|
+
</div><!-- public-class-method-details -->
|
244
255
|
|
245
256
|
</div><!-- 5Buntitled-5D -->
|
246
257
|
|