-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrepoExample_production.php
364 lines (329 loc) · 13.5 KB
/
repoExample_production.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<?php
require __DIR__ . "/../../config/bootstrap.php";
redirectOutside();
$studies = array();
$url = "https://dev-openebench.bsc.es/api/scientific/Dataset.json";
$arrContextOptions = array(
"ssl" => array(
"verify_peer" => false,
"verify_peer_name" => false,
),
);
$response = file_get_contents($url, false, stream_context_create($arrContextOptions));
$response_d = '[
{
"_id": "CAMEO:2017-01-14_00000003_1_M",
"datalink": {
"uri": "https://www.cameo3d.org/static/data/modeling/2017.01.14/2NAS_A/target.pdb",
"attrs": "url",
"validation_date": "2017-01-14T00:00:00Z",
"status": "ok"
},
"type": "metrics_reference",
"version": "1",
"name": "Solution structure of a PWWP doamin from Trypanosoma brucei",
"description": "Target 3_1 of week 2017-01-14",
"dates": {
"creation": "2017-01-14T00:00:00Z",
"modification": "2017-01-18T00:00:00Z"
},
"depends_on": {
"rel_dataset_ids": [
{
"dataset_id": "CAMEO:2017-01-14_00000003_1_I",
"role": "input"
}
]
},
"_schema": "https://www.elixir-europe.org/excelerate/WP2/json-schemas/0.4#Dataset",
"community_id": "CAMEO",
"dataset_contact_ids": [
"help.CAMEO-3D"
],
"visibility": "public"
},
{
"_id": "CAMEO:2017-01-14_00000004_1_M",
"_schema": "https://www.elixir-europe.org/excelerate/WP2/json-schemas/0.4#Dataset",
"name": "The solution NMR structure of the C-terminal effector domain of BfmR from Acinetobacter baumannii",
"version": "1",
"description": "Target 04_1 of week 2017-01-14",
"dates": {
"creation": "2017-01-14T00:00:00Z",
"modification": "2017-01-18T00:00:00Z"
},
"type": "metrics_reference",
"datalink": {
"uri": "https://www.cameo3d.org/static/data/modeling/2017.01.14/2NAZ_A/target.pdb",
"attrs": "url",
"validation_date": "2017-01-14T00:00:00Z",
"status": "ok"
},
"community_id": "CAMEO",
"depends_on": {
"rel_dataset_ids": [
{
"dataset_id": "CAMEO:2017-01-14_00000004_1_I",
"role": "input"
}
]
},
"dataset_contact_ids": [
"help.CAMEO-3D"
],
"visibility": "public"
},
{
"_id": "CAMEO:2017-01-14_00000010_1_M",
"_schema": "https://www.elixir-europe.org/excelerate/WP2/json-schemas/0.4#Dataset",
"name": "Crystal structure of phosphoribulokinase from Methanospirillum hungatei",
"version": "1",
"description": "Target 10_1 of week 2017-01-14",
"dates": {
"creation": "2017-01-14T00:00:00Z",
"modification": "2017-01-18T00:00:00Z"
},
"type": "metrics_reference",
"datalink": {
"uri": "https://www.cameo3d.org/static/data/modeling/2017.01.14/5B3F_B/target.pdb",
"attrs": "url",
"validation_date": "2017-01-14T00:00:00Z",
"status": "ok"
},
"community_id": "CAMEO",
"depends_on": {
"rel_dataset_ids": [
{
"dataset_id": "CAMEO:2017-01-14_00000010_1_I",
"role": "input"
}
]
},
"dataset_contact_ids": [
"help.CAMEO-3D"
],
"visibility": "public"
},
{
"_id": "CAMEO:2017-01-14_00000013_2_M",
"datalink": {
"uri": "https://www.cameo3d.org/static/data/modeling/2017.01.14/5CIR_G/target.pdb",
"attrs": "url",
"validation_date": "2017-01-14T00:00:00Z",
"status": "ok"
},
"type": "metrics_reference",
"version": "1",
"name": "Crystal structure of death receptor 4 (DR4; TNFFRSF10A) bound to TRAIL (TNFSF10)",
"description": "Target 13_2 of week 2017-01-14",
"dates": {
"creation": "2017-01-14T00:00:00Z",
"modification": "2017-01-18T00:00:00Z"
},
"depends_on": {
"rel_dataset_ids": [
{
"dataset_id": "CAMEO:2017-01-14_00000013_1_I",
"role": "input"
}
]
},
"_schema": "https://www.elixir-europe.org/excelerate/WP2/json-schemas/0.4#Dataset",
"community_id": "CAMEO",
"dataset_contact_ids": [
"help.CAMEO-3D"
],
"visibility": "public"
},
{
"_id": "CAMEO:2017-01-14_00000021_1_M",
"type": "metrics_reference",
"datalink": {
"uri": "https://www.cameo3d.org/static/data/modeling/2017.01.14/5EJJ_B/target.pdb",
"attrs": "url",
"validation_date": "2017-01-14T00:00:00Z",
"status": "ok"
},
"name": "Crystal structure of UfSP from C.elegans",
"description": "Target 21_1 of week 2017-01-14",
"dates": {
"creation": "2017-01-14T00:00:00Z",
"modification": "2017-01-18T00:00:00Z"
},
"depends_on": {
"rel_dataset_ids": [
{
"dataset_id": "CAMEO:2017-01-14_00000021_1_I",
"role": "input"
}
]
},
"_schema": "https://www.elixir-europe.org/excelerate/WP2/json-schemas/0.4#Dataset",
"community_id": "CAMEO",
"version": "1",
"dataset_contact_ids": [
"help.CAMEO"
],
"visibility": "public"
},
{
"_id": "CAMEO:2017-01-14_00000024_1_M",
"name": "Insights into Hunter syndrome from the structure of iduronate-2- sulfatase",
"description": "Target 24_1 of week 2017-01-14",
"dates": {
"creation": "2017-01-14T00:00:00Z",
"modification": "2017-01-18T00:00:00Z"
},
"type": "metrics_reference",
"datalink": {
"uri": "https://www.cameo3d.org/static/data/modeling/2017.01.14/5FQL_A/target.pdb",
"attrs": "url",
"validation_date": "2017-01-14T00:00:00Z",
"status": "ok"
},
"version": "1",
"depends_on": {
"rel_dataset_ids": [
{
"dataset_id": "CAMEO:2017-01-14_00000024_1_I",
"role": "input"
}
]
},
"_schema": "https://www.elixir-europe.org/excelerate/WP2/json-schemas/0.4#Dataset",
"community_id": "CAMEO",
"dataset_contact_ids": [
"help.CAMEO-3D"
],
"visibility": "public"
}
]';
// $array = json_decode($response_d);
$array = json_decode($response)->Dataset;
?>
<?php require "../htmlib/header.inc.php"; ?>
<body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white page-container-bg-solid page-sidebar-fixed">
<div class="page-wrapper">
<?php require "../htmlib/top.inc.php"; ?>
<?php require "../htmlib/menu.inc.php"; ?>
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
<!-- BEGIN CONTENT BODY -->
<div class="page-content">
<!-- BEGIN PAGE HEADER-->
<!-- BEGIN PAGE BAR -->
<div class="page-bar">
<ul class="page-breadcrumb">
<li>
<a href="home/">Home</a>
<i class="fa fa-circle"></i>
</li>
<li>
<span>Get Data</span>
<i class="fa fa-circle"></i>
</li>
<li>
<span>From Repository List</span>
</li>
</ul>
</div>
<!-- END PAGE BAR -->
<!-- BEGIN PAGE TITLE-->
<h1 class="page-title">List of Datasets
</h1>
<!-- END PAGE TITLE-->
<!-- END PAGE HEADER-->
<?php
if (isset($_SESSION['errorData'])) {
if (isset($_SESSION['errorData']['Info'])) {
?>
<div class="alert alert-info">
<?php
} else {
?>
<div class="alert alert-warning">
<?php } ?>
<?php foreach ($_SESSION['errorData'] as $subTitle => $txts) {
print "$subTitle<br/>";
foreach ($txts as $txt) {
print "<div style=\"margin-left:20px;\">$txt</div>";
}
}
unset($_SESSION['errorData']);
?>
</div>
<?php } ?>
<div class="mt-element-step">
<div class="row step-line"> </div>
</div>
<div class="row">
<div class="col-md-12">
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet light portlet-fit bordered">
<div class="portlet-title">
<div class="caption">
<i class="icon-share font-red-sunglo hide"></i>
<span class="caption-subject font-dark bold uppercase">Browse Datasets</span>
</div>
</div>
<div class="portlet-body">
<!-- <div id="loading-datatable"><div id="loading-spinner">LOADING</div></div> -->
<table class="table table-striped table-hover table-bordered" id="table-repository">
<thead>
<tr>
<th> Id </th>
<th> Title </th>
<th> Description </th>
<th> Version </th>
<th> Type </th>
<th> Community </th>
<th> Visibility </th>
<th> Import </th>
</tr>
</thead>
<tbody>
<?php foreach ($array as $obj) :
if ($obj->type == "metrics_reference") :
// get URL from datalink
$datalink = $obj->datalink;
$URL = "";
if ($datalink->attrs == "curie") {
#$URL = resolve_curie_via_idsolv($datalink->uri);
$URL = "www.google.cat";
} else {
$URL = $datalink->uri;
}
// print entry
?>
<tr>
<td> <?php echo "$obj->_id" ?> </td>
<td> <?php echo "$obj->name" ?> </td>
<td> <?php echo "$obj->description" ?> </td>
<td> <?php echo "$obj->version" ?> </td>
<td> <?php echo "$obj->type" ?> </td>
<td> <?php echo "$obj->community_id" ?> </td>
<td> <?php echo "$obj->visibility" ?> </td>
<td style="vertical-align:middle;">
<a href="applib/getData.php?uploadType=repository&url=<?php echo "$URL"; ?>&community=<?php echo "$obj->community_id"; ?>&type=<?php echo "$obj->type" ?>&id=<?php echo "$obj->_id" ?>">
<i class="font-green fa fa-download tooltips" aria-hidden="true" style="font-size:22px;" data-container="body" data-html="true" data-placement="right" data-original-title="<p align='left' style='margin:0'>Import dataset to workspace</p>"></i></a>
</td>
</tr>
<?php
endif;
endforeach;
?>
</tbody>
</table>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
</div>
</div>
</div>
<!-- END CONTENT BODY -->
</div>
<!-- END CONTENT -->
<?php
require "../htmlib/footer.inc.php";
require "../htmlib/js.inc.php";
?>