line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ELab::Client; |
2
|
|
|
|
|
|
|
# ABSTRACT: Access the eLabFTW API with Perl |
3
|
|
|
|
|
|
|
$ELab::Client::VERSION = '0.010'; |
4
|
1
|
|
|
1
|
|
2693
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
36
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
670
|
use Moose; |
|
1
|
|
|
|
|
532037
|
|
|
1
|
|
|
|
|
10
|
|
8
|
1
|
|
|
1
|
|
9043
|
use MooseX::NonMoose; |
|
1
|
|
|
|
|
1216
|
|
|
1
|
|
|
|
|
5
|
|
9
|
1
|
|
|
1
|
|
85009
|
use MooseX::Params::Validate; |
|
1
|
|
|
|
|
102200
|
|
|
1
|
|
|
|
|
9
|
|
10
|
1
|
|
|
1
|
|
1536
|
use JSON; |
|
1
|
|
|
|
|
9862
|
|
|
1
|
|
|
|
|
13
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
extends 'REST::Client'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has token => ( |
15
|
|
|
|
|
|
|
is => 'ro', |
16
|
|
|
|
|
|
|
isa => 'Str', |
17
|
|
|
|
|
|
|
required => 1, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has endpoint => ( |
21
|
|
|
|
|
|
|
is => 'ro', |
22
|
|
|
|
|
|
|
isa => 'Str', |
23
|
|
|
|
|
|
|
default => 'api/v1/' |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub BUILD { |
28
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
29
|
0
|
|
|
|
|
|
my $args = shift; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
$self->addHeader('Authorization', $self->token()); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub elab_get { |
35
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
36
|
0
|
|
|
|
|
|
my $url = shift; |
37
|
0
|
|
|
|
|
|
my $result = $self->GET($self->endpoint().$url); |
38
|
0
|
0
|
|
|
|
|
return undef unless $result->responseCode() eq '200'; |
39
|
0
|
|
|
|
|
|
return $result->responseContent(); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub elab_post { |
43
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
44
|
0
|
|
|
|
|
|
my $url = shift; |
45
|
0
|
|
|
|
|
|
my $data = shift; |
46
|
0
|
|
|
|
|
|
$data =~ s/^\?//; # buildQuery starts with "?" (makes no sense here) |
47
|
0
|
|
|
|
|
|
my $headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }; |
48
|
0
|
|
|
|
|
|
my $result = $self->POST($self->endpoint().$url, $data, $headers); |
49
|
0
|
0
|
|
|
|
|
return undef unless $result->responseCode() eq '200'; |
50
|
0
|
|
|
|
|
|
return $result->responseContent(); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# from here on we try to follow elabapy in terms of function names |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub create_experiment { |
58
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
59
|
0
|
|
|
|
|
|
return decode_json $self->elab_post("experiments"); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub create_item { |
65
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
66
|
0
|
|
|
|
|
|
my $type = shift; |
67
|
0
|
|
|
|
|
|
return decode_json $self->elab_post("items/$type"); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub create_template { |
73
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
74
|
0
|
|
|
|
|
|
return decode_json $self->elab_post("templates"); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub get_all_experiments { |
80
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
81
|
0
|
|
|
|
|
|
my (%args) = validated_hash( |
82
|
|
|
|
|
|
|
\@_, |
83
|
|
|
|
|
|
|
limit => { isa => 'Int', default => 25 }, |
84
|
|
|
|
|
|
|
offset => { isa => 'Int', default => 0 }, |
85
|
|
|
|
|
|
|
); |
86
|
0
|
|
|
|
|
|
return decode_json $self->elab_get("experiments/?".$self->buildQuery(%args)); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub get_experiment { |
92
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
93
|
0
|
|
|
|
|
|
my $id = shift; |
94
|
0
|
|
|
|
|
|
return decode_json $self->elab_get("experiments/$id"); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub get_all_items { |
100
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
101
|
0
|
|
|
|
|
|
my (%args) = validated_hash( |
102
|
|
|
|
|
|
|
\@_, |
103
|
|
|
|
|
|
|
limit => { isa => 'Int', default => 25 }, |
104
|
|
|
|
|
|
|
offset => { isa => 'Int', default => 0 }, |
105
|
|
|
|
|
|
|
); |
106
|
0
|
|
|
|
|
|
return decode_json $self->elab_get("items/".$self->buildQuery(%args)); |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub get_item { |
113
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
114
|
0
|
|
|
|
|
|
my $id = shift; |
115
|
0
|
|
|
|
|
|
return decode_json $self->elab_get("items/$id"); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub get_items_types { |
121
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
122
|
0
|
|
|
|
|
|
return decode_json $self->elab_get("items_types/"); |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub get_tags { |
128
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
129
|
0
|
|
|
|
|
|
return decode_json $self->elab_get("tags/"); |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub get_upload { |
135
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
136
|
0
|
|
|
|
|
|
my $id = shift; |
137
|
0
|
|
|
|
|
|
return $self->elab_get("uploads/$id"); |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub get_status { |
143
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
144
|
0
|
|
|
|
|
|
return decode_json $self->elab_get("status/"); |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
sub get_all_templates { |
150
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
151
|
0
|
|
|
|
|
|
return decode_json $self->elab_get("templates/"); |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
sub get_template { |
157
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
158
|
0
|
|
|
|
|
|
my $id = shift; |
159
|
0
|
|
|
|
|
|
return decode_json $self->elab_get("templates/$id"); |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
sub post_experiment { |
165
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
166
|
0
|
|
|
|
|
|
my $id = shift; |
167
|
0
|
|
|
|
|
|
my (%args) = validated_hash( |
168
|
|
|
|
|
|
|
\@_, |
169
|
|
|
|
|
|
|
title => { isa => 'Str', optional => 1 }, |
170
|
|
|
|
|
|
|
date => { isa => 'Str', optional => 1 }, |
171
|
|
|
|
|
|
|
body => { isa => 'Str', optional => 1 }, |
172
|
|
|
|
|
|
|
bodyappend => { isa => 'Str', optional => 1 }, |
173
|
|
|
|
|
|
|
); |
174
|
0
|
|
|
|
|
|
return decode_json $self->elab_post("experiments/$id", $self->buildQuery(%args)); |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
sub post_item { |
180
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
181
|
0
|
|
|
|
|
|
my $id = shift; |
182
|
0
|
|
|
|
|
|
my (%args) = validated_hash( |
183
|
|
|
|
|
|
|
\@_, |
184
|
|
|
|
|
|
|
title => { isa => 'Str', optional => 1 }, |
185
|
|
|
|
|
|
|
date => { isa => 'Str', optional => 1 }, |
186
|
|
|
|
|
|
|
body => { isa => 'Str', optional => 1 }, |
187
|
|
|
|
|
|
|
bodyappend => { isa => 'Str', optional => 1 }, |
188
|
|
|
|
|
|
|
); |
189
|
0
|
|
|
|
|
|
return decode_json $self->elab_post("items/$id", $self->buildQuery(%args)); |
190
|
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
sub post_template { |
195
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
196
|
0
|
|
|
|
|
|
my $id = shift; |
197
|
0
|
|
|
|
|
|
my (%args) = validated_hash( |
198
|
|
|
|
|
|
|
\@_, |
199
|
|
|
|
|
|
|
title => { isa => 'Str', optional => 1 }, |
200
|
|
|
|
|
|
|
date => { isa => 'Str', optional => 1 }, |
201
|
|
|
|
|
|
|
body => { isa => 'Str', optional => 1 }, |
202
|
|
|
|
|
|
|
); |
203
|
0
|
|
|
|
|
|
return decode_json $self->elab_post("templates/$id", $self->buildQuery(%args)); |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
sub add_link_to_experiment { |
209
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
210
|
0
|
|
|
|
|
|
my $id = shift; |
211
|
0
|
|
|
|
|
|
my (%args) = validated_hash( |
212
|
|
|
|
|
|
|
\@_, |
213
|
|
|
|
|
|
|
link => { isa => 'Str' }, |
214
|
|
|
|
|
|
|
); |
215
|
0
|
|
|
|
|
|
return decode_json $self->elab_post("experiments/$id", $self->buildQuery(%args)); |
216
|
|
|
|
|
|
|
} |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
sub add_link_to_item { |
221
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
222
|
0
|
|
|
|
|
|
my $id = shift; |
223
|
0
|
|
|
|
|
|
my (%args) = validated_hash( |
224
|
|
|
|
|
|
|
\@_, |
225
|
|
|
|
|
|
|
link => { isa => 'Str' }, |
226
|
|
|
|
|
|
|
); |
227
|
0
|
|
|
|
|
|
return decode_json $self->elab_post("items/$id", $self->buildQuery(%args)); |
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
# missing: upload_to_experiment |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
# missing: upload_to_item |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
# missing: upload_to_item |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
# missing: add_tag_to_experiment |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
# missing: add_tag_to_item |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
# missing: get_backup_zip |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
# missing: get_bookable |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
# missing: create_event |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
# missing: get_event |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
# missing: get_all_events |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
# missing: destroy_event |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
|
264
|
1
|
|
|
1
|
|
1125
|
no Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
265
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
1; |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
__END__ |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
=pod |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
=encoding UTF-8 |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=head1 NAME |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
ELab::Client - Access the eLabFTW API with Perl |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
=head1 VERSION |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
version 0.010 |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
=head1 SYNOPSYS |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
use ELab::Client; |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
my $elab = ELab::Client->new( |
288
|
|
|
|
|
|
|
host => 'https://elab.somewhere.de/', |
289
|
|
|
|
|
|
|
token => 'ae...d4', |
290
|
|
|
|
|
|
|
); |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
my $e = $elab->post_experiment(4, |
293
|
|
|
|
|
|
|
title => "New experiment title", |
294
|
|
|
|
|
|
|
body => "The new body text" |
295
|
|
|
|
|
|
|
); |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
This module is work in progress, and coverage of the API is by far not complete yet. |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
=head1 METHODS |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
=head2 create_experiment |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
Creates a new experiment: |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
my $e = $elab->create_experiment(); |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
The return value is a hash reference with fields |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
result string 'success' or error message |
310
|
|
|
|
|
|
|
id string id of the new experiment |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
=head2 create_item |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
Creates a new database item of type $type: |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
my $e = $elab->create_item($type); |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
The return value is a hash reference with fields |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
result string 'success' or error message |
321
|
|
|
|
|
|
|
id string id of the new item |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
=head2 create_template |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
Creates a new template: |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
my $t = $elab->create_template(); |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
The return value is a hash reference with fields |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
result string 'success' or error message |
332
|
|
|
|
|
|
|
id string id of the new template |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=head2 get_all_experiments |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
Lists experiments, with maximum number limit and starting at offset. |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
my $a = $elab->get_all_experiments(limit => 15, offset => 0); |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
The return value is an array reference, where each element is a hash reference |
341
|
|
|
|
|
|
|
describing an experiment (not fully, but abbreviated). |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
=head2 get_experiment |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
Returns an experiment. |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
my $e = $elab->get_experiment($id); |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
The return value is a hash reference with the full experiment information. |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
=head2 get_all_items |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
Lists database items, with maximum number limit and starting at offset. |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
my $a = $elab->get_all_items(limit => 25, offset => 0); |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
The return value is an array reference, where each element is a hash reference |
358
|
|
|
|
|
|
|
corresponding to a database item. |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
=head2 get_item |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
Returns a database item. |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
my $i = $elab->get_item($id); |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
=head2 get_items_types |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
Returns a list of database item types. |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
my $t = $elab->get_items_types(); |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
The return value is an array reference ... |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
=head2 get_tags |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
Returns the tags of the team. |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
my $t = $elab->get_tags(); |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
=head2 get_upload |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
Get an uploaded file from its id |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
my $data = $elab->get_upload($id); |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
The result is the raw binary data of the uploaded file. |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
=head2 get_status |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
Get a list of possible experiment states (statuses?)... |
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
my $s = $elab->get_status(); |
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
=head2 get_all_templates |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
my $t = $elab->get_all_templates(); |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
=head2 get_template |
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
my $t = $elab->get_template($id); |
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
=head2 post_experiment |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
my $e = $elab->post_experiment(13, |
405
|
|
|
|
|
|
|
title => "Updated experiment title", |
406
|
|
|
|
|
|
|
body => "Updated experiment body text" |
407
|
|
|
|
|
|
|
); |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
=head2 post_item |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
my $i = $elab->post_item(4, |
412
|
|
|
|
|
|
|
title => "Database item", |
413
|
|
|
|
|
|
|
body => "here are the bodies" |
414
|
|
|
|
|
|
|
); |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
=head2 post_template |
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
=head2 add_link_to_experiment |
419
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
=head2 add_link_to_item |
421
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
=head1 AUTHOR |
423
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
Andreas K. Huettel <dilfridge@gentoo.org> |
425
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
427
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
This software is copyright (c) 2021 by Andreas K. Huettel. |
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
431
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
=cut |