Project

General

Profile

« Previous | Next » 

Revision 46770

added a clean version of DLI Portal

View differences:

modules/dli-service-portal/trunk/static/angular/service_v10.js
1
/**
2
 * Created by sandro on 6/19/15.
3
 */
4

  
5

  
6

  
7
dliApp.factory('queryService', ['$http', function ($http) {
8

  
9
    var factory = {}
10
    factory.query = function (query, page, filter, value) {
11
        $http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
12
        if (page == null){
13
            return $http.post('/api/post/', $.param({'action': "query", 'query': query, 'filter':filter, 'value':value}));
14
        }
15
        else {
16
            return $http.post('/api/post/', $.param({'action': "query", 'query': query, 'start': (page - 1) * 10, 'filter':filter, 'value':value}));
17
        }
18
    }
19
    factory.getStatsDetail = function () {
20
        //$http.defaults.headers.get["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
21
        return $http.get('currentStats.json');
22
    }
23

  
24
    factory.getStats = function () {
25
        //$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
26
        return $http.get('stats2.json');
27
    }
28

  
29
    factory.getDatasources = function() {
30
        $http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
31
        return $http.post('/api/ds_info/');
32
    }
33

  
34

  
35
    factory.getItem = function (identifier) {
36
        $http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
37
        return $http.post('/api/item/' + identifier);
38
    }
39

  
40
    factory.getItem = function (identifier, type, from) {
41
        $http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
42
        return $http.post('/api/item/' + identifier, $.param({'type': type, 'from': from}));
43
    }
44

  
45
    factory.getDsInfo = function (identifier, name) {
46
        $http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
47
        return $http.post('/api/ds_info/', $.param({'id': identifier, 'name':name}));
48
    }
49

  
50
    return factory;
51
}]);
modules/dli-service-portal/trunk/test/dli/testES.py
1
import unittest
2
from eu.dnetlib.es_connector import DLIESConnector
3
import time
4

  
5
DLI_INDEX = 'dli'
6
ES_HOST = 'ip-90-147-167-27.ct1.garrservices.it'
7

  
8

  
9
class TestDLIESConnector(unittest.TestCase):
10
    def setUp(self):
11
        self.connector = DLIESConnector(ES_HOST, DLI_INDEX)
12

  
13
    def testQuery(self):
14
        start_time = time.time()
15
        result = self.connector.simple_query('protein')
16
        print("---Request time: %s milliseconds ---" % ((time.time() - start_time) * 1000))
17
        self.assertTrue(result.total > 0)
18

  
19
    def tearDown(self):
20
        self.connector = None
21

  
22
if __name__ == '__main__':
23
    unittest.main()
modules/dli-service-portal/trunk/static/angular/dliApplication.js
1
var dliApp = angular.module('dliApp', ['ngRoute']);
2

  
3

  
4

  
5
dliApp.config(function ($routeProvider) {
6
    $routeProvider.
7
        when('/', {
8
            templateUrl: 'partials/index.html',
9
            controller: 'mainPageController'
10
        })
11
        .when('/query/q=:q*', {
12
            templateUrl: 'partials/query.html',
13
            controller: 'queryController'
14
        })
15
        .when('/query/page=:page/q=:q*', {
16
            templateUrl: 'partials/query.html',
17
            controller: 'queryController'
18
        })
19
        .when('/query/:f/q=:q*', {
20
            templateUrl: 'partials/query.html',
21
            controller: 'queryController'
22
        })
23
        .when('/query/:f/page=:page/q=:q*', {
24
            templateUrl: 'partials/query.html',
25
            controller: 'queryController'
26
        })
27
        .when('/detail/:id*', {
28
            templateUrl: 'partials/detail.html',
29
            controller: 'detailController'
30
        }).when('/datasources', {
31
            templateUrl: 'partials/datasources.html',
32
            controller: 'datasourcesController'
33
        }).when('/datasource/id/:id', {
34
            templateUrl: 'partials/datasourceDetail.html',
35
            controller: 'datasourceDetailController'
36
        }).when('/datasource/name/:name', {
37
            templateUrl: 'partials/datasourceDetail.html',
38
            controller: 'datasourceDetailController'
39
        }).when('/api', {
40
            templateUrl: 'partials/api.html',
41
            controller: 'mainPageController'
42
        }).when('/about', {
43
            templateUrl: 'partials/about.html',
44
            controller: 'mainPageController'
45
        }).when('/contact', {
46
            templateUrl: 'partials/contactus.html',
47
            controller: 'mainPageController'
48
        }).when('/statistics', {
49
            templateUrl: 'partials/statistics.html',
50
            controller: 'statsController'
51
        })
52

  
53

  
54
        .otherwise({
55
            redirectTo: '/'
56
        })
57
});
modules/dli-service-portal/trunk/DLI.py
1
#!/usr/bin/python
2

  
3
from flask import Flask, jsonify, request
4
from flask.json import JSONEncoder
5
from eu.dnetlib.es_connector import DLIESConnector
6
from flask_prometheus import monitor
7

  
8
from logger import dlilogger
9

  
10
DLI_INDEX = 'dli'
11

  
12
ES_HOST = 'ip-90-147-167-27.ct1.garrservices.it'
13

  
14

  
15
class MyJSONEncoder(JSONEncoder):
16
    def default(self, obj):
17
        return obj.__dict__
18

  
19

  
20
app = Flask(__name__)
21
app.debug = False
22
app.json_encoder = MyJSONEncoder
23

  
24
base_dnet_url = "http://localhost:8280/app"
25

  
26

  
27
# q = QueryResolver("http://localhost:8983/solr/DLIF-index-cleaned_shard1_replica1")
28

  
29
class InvalidUsage(Exception):
30
    status_code = 400
31

  
32
    def __init__(self, message, status_code=None, payload=None):
33
        Exception.__init__(self)
34
        self.message = message
35
        if status_code is not None:
36
            self.status_code = status_code
37
        self.payload = payload
38

  
39
    def to_dict(self):
40
        rv = dict(self.payload or ())
41
        rv['message'] = self.message
42
        return rv
43

  
44

  
45
# Routes
46
@app.route('/')
47
def root():
48
    return app.send_static_file('index.html')
49

  
50

  
51
@app.route('/<path:path>')
52
def static_proxy(path):
53
    # send_static_file will guess the correct MIME type
54
    return app.send_static_file(path)
55

  
56

  
57
@app.route('/api/item/<path:identifier>', methods=['post', 'get'])
58
def get_item(identifier):
59
    if identifier:
60
        object_type = request.form.get('type')
61
        start = request.form.get('from')
62
        if len(object_type) == 0:
63
            object_type = None
64
        if len(start) == 0:
65
            start = None
66
        else:
67
            start = int(start)
68
        connector = DLIESConnector(ES_HOST, DLI_INDEX)
69
        return jsonify(result=connector.item_by_id(identifier, object_type, start))
70
    else:
71
        raise InvalidUsage('This view is gone', status_code=410)
72

  
73

  
74
@app.route('/api/stats/', methods=['post', 'get'])
75
def stats():
76
    raise Exception("Method to be implemented")
77
    # q = QueryResolver(host, base_dnet_url)
78
    # return jsonify(stats=q.get_stats())
79

  
80

  
81
@app.route('/api/ds_info/', methods=['post', 'get'])
82
def info():
83
    raise Exception("Method to be implemented")
84
    # q = QueryResolver(host, base_dnet_url)
85
    # if 'id' in request.form:
86
    #     id = request.form['id']
87
    #     name = request.form['name']
88
    #     result = q.get_ds_info(id, name)
89
    #     return jsonify(info=result)
90
    # result = q.get_all_ds()
91
    # return jsonify(info=result)
92

  
93

  
94
@app.route('/api/stats_detail/', methods=['post', 'get'])
95
def stats_detail():
96
    return ""
97

  
98
    # q = QueryResolver(host, base_dnet_url)
99
    # return jsonify(stats=q.get_stats_detail())
100

  
101

  
102
@app.route('/api/post/', methods=['post', 'get'])
103
def query_post():
104
    action = None
105
    query = None
106
    filter_key = None
107
    filter_value = None
108
    result = {}
109

  
110
    start = 0
111
    if 'action' in request.form:
112
        action = request.form['action']
113
    if 'query' in request.form:
114
        query = request.form['query']
115
    if 'start' in request.form:
116
        start = int(request.form['start'])
117
    if 'filter' in request.form:
118
        filter_key = request.form['filter']
119

  
120
    if action == 'query' and query is not None:
121
        connector = DLIESConnector(ES_HOST, DLI_INDEX)
122
        try:
123
            result = connector.simple_query(query, start=start, user_filter=filter_key)
124
        except Exception as e:
125
            print e
126
        return jsonify(result=result)
127
    else:
128
        return jsonify(error={'error_code': 'an error occur during query on server'})
129

  
130

  
131
if __name__ == '__main__':
132
    app.logger.addHandler(dlilogger)
133
    monitor(app, port=8000)
134
    app.run()
modules/dli-service-portal/trunk/logger.py
1
import logging
2

  
3
dlilogger = logging.getLogger('dli')
4
hdlr = logging.FileHandler('dli.log')
5
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
6
hdlr.setFormatter(formatter)
7
dlilogger.addHandler(hdlr)
8
dlilogger.setLevel(logging.WARNING)
modules/dli-service-portal/trunk/static/stats2.json
1
{
2
  "historyLinks": [
3
    [
4
      "x",
5
      "2015-08-04",
6
      "2015-08-24",
7
      "2015-09-17",
8
      "2015-09-22",
9
      "2015-09-23",
10
      "2015-09-24",
11
      "2015-09-29",
12
      "2015-10-08",
13
      "2015-11-09",
14
      "2015-12-15",
15
      "2016-01-05",
16
      "2016-01-07",
17
      "2016-01-18",
18
      "2016-01-21",
19
      "2016-02-09",
20
      "2016-12-12",
21
      "2017-04-02"
22
    ],
23
    [
24
      "OpenAIRE",
25
      "18730",
26
      "20682",
27
      "27490",
28
      "27490",
29
      "27490",
30
      "27490",
31
      "27490",
32
      "17064",
33
      "17064",
34
      "17064",
35
      "17064",
36
      "17064",
37
      "17064",
38
      "17064",
39
      "17064",
40
      "17064",
41
      "23890"
42
    ],
43
    [
44
      "RCSB",
45
      "175648",
46
      "175648",
47
      "175648",
48
      "175648",
49
      "175648",
50
      "175648",
51
      "175648",
52
      "175648",
53
      "175648",
54
      "175648",
55
      "175648",
56
      "175648",
57
      "175648",
58
      "175648",
59
      "175648",
60
      "175648",
61
      "172974"
62
    ],
63
    [
64
      "PANGAEA",
65
      "752474",
66
      "775128",
67
      "782648",
68
      "782648",
69
      "782648",
70
      "782648",
71
      "782648",
72
      "826532",
73
      "826532",
74
      "848282",
75
      "848282",
76
      "848282",
77
      "848282",
78
      "848282",
79
      "848282",
80
      "894598",
81
      "934720"
82
    ],
83
    [
84
      "Datasets in DataCite",
85
      "3609550",
86
      "4444966",
87
      "4439540",
88
      "4439540",
89
      "4439540",
90
      "4439540",
91
      "4439540",
92
      "6128471",
93
      "6128471",
94
      "7273251",
95
      "7273251",
96
      "7273251",
97
      "7273251",
98
      "7273251",
99
      "7273251",
100
      "7273251",
101
      "13609310"
102
    ],
103
    [
104
      "Cambridge Crystallographic Data Centre",
105
      "986512",
106
      "1025640",
107
      "1033396",
108
      "1033396",
109
      "1033396",
110
      "1033396",
111
      "1033396",
112
      "1045020",
113
      "1045020",
114
      "1067074",
115
      "1067074",
116
      "1067074",
117
      "1067074",
118
      "1067074",
119
      "1067074",
120
      "1067074",
121
      "695698"
122
    ],
123
    [
124
      "Mendeley Data and published articles",
125
      "0",
126
      "0",
127
      "0",
128
      "0",
129
      "0",
130
      "0",
131
      "0",
132
      "0",
133
      "0",
134
      "0",
135
      "0",
136
      "0",
137
      "0",
138
      "0",
139
      "36",
140
      "36",
141
      "0"
142
    ],
143
    [
144
      "ICPSR",
145
      "0",
146
      "0",
147
      "0",
148
      "0",
149
      "0",
150
      "0",
151
      "16120",
152
      "16120",
153
      "16120",
154
      "16120",
155
      "16120",
156
      "16120",
157
      "16120",
158
      "16120",
159
      "16120",
160
      "16120",
161
      "266808"
162
    ],
163
    [
164
      "Australian National Data Service",
165
      "19020",
166
      "19086",
167
      "17719",
168
      "17719",
169
      "17719",
170
      "17719",
171
      "17719",
172
      "0",
173
      "17725",
174
      "19078",
175
      "19078",
176
      "19078",
177
      "19078",
178
      "19078",
179
      "19078",
180
      "19078",
181
      "366988"
182
    ],
183
    [
184
      "EuropePMC",
185
      "0",
186
      "0",
187
      "0",
188
      "0",
189
      "0",
190
      "0",
191
      "0",
192
      "0",
193
      "0",
194
      "0",
195
      "0",
196
      "0",
197
      "0",
198
      "1032868",
199
      "1032868",
200
      "1032868",
201
      "996002"
202
    ],
203
    [
204
      "Thomson Reuters",
205
      "48466",
206
      "48466",
207
      "48466",
208
      "48466",
209
      "48466",
210
      "48466",
211
      "48466",
212
      "48466",
213
      "48466",
214
      "48466",
215
      "48466",
216
      "48466",
217
      "48466",
218
      "48466",
219
      "48466",
220
      "48466",
221
      "48956"
222
    ],
223
    [
224
      "Springer Nature",
225
      "0",
226
      "0",
227
      "0",
228
      "0",
229
      "60392",
230
      "60392",
231
      "60392",
232
      "60392",
233
      "60392",
234
      "60392",
235
      "60392",
236
      "60392",
237
      "60392",
238
      "60392",
239
      "60392",
240
      "60392",
241
      "56510"
242
    ],
243
    [
244
      "Elsevier",
245
      "138976",
246
      "138976",
247
      "138976",
248
      "138976",
249
      "138976",
250
      "138976",
251
      "138976",
252
      "138976",
253
      "138976",
254
      "138976",
255
      "138976",
256
      "138976",
257
      "138976",
258
      "138976",
259
      "138976",
260
      "138976",
261
      "138972"
262
    ],
263
    [
264
      "3TU Datacentrum",
265
      "0",
266
      "0",
267
      "0",
268
      "432",
269
      "432",
270
      "432",
271
      "432",
272
      "432",
273
      "432",
274
      "432",
275
      "432",
276
      "432",
277
      "432",
278
      "432",
279
      "432",
280
      "432",
281
      "432"
282
    ],
283
    [
284
      "IEEE",
285
      "0",
286
      "0",
287
      "0",
288
      "0",
289
      "0",
290
      "0",
291
      "0",
292
      "0",
293
      "0",
294
      "94",
295
      "94",
296
      "94",
297
      "94",
298
      "94",
299
      "94",
300
      "94",
301
      "94"
302
    ],
303
    [
304
      "IEDA",
305
      "0",
306
      "0",
307
      "1498",
308
      "1498",
309
      "1498",
310
      "1498",
311
      "1498",
312
      "1498",
313
      "1498",
314
      "1498",
315
      "1498",
316
      "1498",
317
      "1498",
318
      "1498",
319
      "1498",
320
      "1498",
321
      "1544"
322
    ]
323
  ],
324
  "historyObjects": [
325
    [
326
      "x",
327
      "2015-08-04",
328
      "2015-08-24",
329
      "2015-09-17",
330
      "2015-09-22",
331
      "2015-09-23",
332
      "2015-09-24",
333
      "2015-09-29",
334
      "2015-10-08",
335
      "2015-11-09",
336
      "2015-12-15",
337
      "2016-01-05",
338
      "2016-01-07",
339
      "2016-01-18",
340
      "2016-01-21",
341
      "2016-02-09",
342
      "2016-12-12",
343
      "2017-04-02"
344
    ],
345
    [
346
      "OpenAIRE",
347
      "9813",
348
      "10800",
349
      "15038",
350
      "15038",
351
      "15038",
352
      "15038",
353
      "15038",
354
      "9773",
355
      "9773",
356
      "9773",
357
      "9773",
358
      "9773",
359
      "9773",
360
      "9773",
361
      "9773",
362
      "9773",
363
      "19282"
364
    ],
365
    [
366
      "RCSB",
367
      "133443",
368
      "133444",
369
      "133445",
370
      "133445",
371
      "133643",
372
      "133643",
373
      "133643",
374
      "133643",
375
      "133643",
376
      "133643",
377
      "133643",
378
      "133643",
379
      "133643",
380
      "133643",
381
      "133643",
382
      "133643",
383
      "88787"
384
    ],
385
    [
386
      "PANGAEA",
387
      "274561",
388
      "283768",
389
      "288094",
390
      "288094",
391
      "288094",
392
      "288094",
393
      "288094",
394
      "303640",
395
      "303640",
396
      "307183",
397
      "307183",
398
      "307183",
399
      "307183",
400
      "307183",
401
      "307183",
402
      "317688",
403
      "312594"
404
    ],
405
    [
406
      "Datasets in DataCite",
407
      "682951",
408
      "701126",
409
      "700981",
410
      "700981",
411
      "700981",
412
      "700981",
413
      "700981",
414
      "731757",
415
      "731757",
416
      "1300877",
417
      "1300877",
418
      "1300877",
419
      "1300877",
420
      "1300877",
421
      "1300877",
422
      "1300877",
423
      "1429074"
424
    ],
425
    [
426
      "Cambridge Crystallographic Data Centre",
427
      "706225",
428
      "733642",
429
      "739337",
430
      "739337",
431
      "739337",
432
      "739337",
433
      "739337",
434
      "747253",
435
      "747253",
436
      "762327",
437
      "762327",
438
      "762327",
439
      "762327",
440
      "762327",
441
      "762327",
442
      "762327",
443
      "598979"
444
    ],
445
    [
446
      "Mendeley Data and published articles",
447
      "0",
448
      "0",
449
      "0",
450
      "0",
451
      "0",
452
      "0",
453
      "0",
454
      "0",
455
      "0",
456
      "0",
457
      "0",
458
      "0",
459
      "0",
460
      "0",
461
      "33",
462
      "33",
463
      "0"
464
    ],
465
    [
466
      "ICPSR",
467
      "0",
468
      "0",
469
      "0",
470
      "0",
471
      "0",
472
      "0",
473
      "5607",
474
      "5607",
475
      "5607",
476
      "5607",
477
      "5607",
478
      "5607",
479
      "5607",
480
      "5607",
481
      "5607",
482
      "5607",
483
      "70112"
484
    ],
485
    [
486
      "Australian National Data Service",
487
      "6151",
488
      "6183",
489
      "5650",
490
      "5650",
491
      "5650",
492
      "5650",
493
      "5650",
494
      "0",
495
      "5655",
496
      "6195",
497
      "6195",
498
      "6195",
499
      "6195",
500
      "6195",
501
      "6195",
502
      "6195",
503
      "154666"
504
    ],
505
    [
506
      "EuropePMC",
507
      "7576",
508
      "7576",
509
      "7576",
510
      "7576",
511
      "7576",
512
      "7576",
513
      "7576",
514
      "7549",
515
      "7549",
516
      "7576",
517
      "7576",
518
      "7576",
519
      "516064",
520
      "516064",
521
      "516070",
522
      "516070",
523
      "396191"
524
    ],
525
    [
526
      "CrossRef",
527
      "291673",
528
      "300850",
529
      "304017",
530
      "304023",
531
      "310132",
532
      "310132",
533
      "313934",
534
      "314175",
535
      "314175",
536
      "0",
537
      "312964",
538
      "312964",
539
      "312976",
540
      "312976",
541
      "312996",
542
      "313625",
543
      "380499"
544
    ],
545
    [
546
      "Thomson Reuters",
547
      "28540",
548
      "28540",
549
      "28540",
550
      "28540",
551
      "28540",
552
      "28540",
553
      "28540",
554
      "28540",
555
      "28540",
556
      "28540",
557
      "28540",
558
      "28540",
559
      "28540",
560
      "28540",
561
      "28540",
562
      "28540",
563
      "4663"
564
    ],
565
    [
566
      "Springer Nature",
567
      "0",
568
      "0",
569
      "0",
570
      "0",
571
      "35671",
572
      "35671",
573
      "35671",
574
      "35672",
575
      "35672",
576
      "35672",
577
      "35672",
578
      "35672",
579
      "35672",
580
      "35672",
581
      "35672",
582
      "35672",
583
      "28213"
584
    ],
585
    [
586
      "Elsevier",
587
      "73233",
588
      "73233",
589
      "73233",
590
      "73233",
591
      "73233",
592
      "73233",
593
      "73233",
594
      "73233",
595
      "73233",
596
      "73233",
597
      "73233",
598
      "73233",
599
      "73233",
600
      "73233",
601
      "73233",
602
      "73233",
603
      "24329"
604
    ],
605
    [
606
      "3TU Datacentrum",
607
      "0",
608
      "0",
609
      "0",
610
      "351",
611
      "351",
612
      "351",
613
      "351",
614
      "351",
615
      "351",
616
      "351",
617
      "351",
618
      "351",
619
      "351",
620
      "351",
621
      "351",
622
      "351",
623
      "351"
624
    ],
625
    [
626
      "IEEE",
627
      "0",
628
      "0",
629
      "0",
630
      "0",
631
      "0",
632
      "0",
633
      "0",
634
      "0",
635
      "0",
636
      "63",
637
      "63",
638
      "63",
639
      "63",
640
      "63",
641
      "63",
642
      "63",
643
      "12"
644
    ],
645
    [
646
      "IEDA",
647
      "0",
648
      "0",
649
      "916",
650
      "916",
651
      "916",
652
      "916",
653
      "916",
654
      "0",
655
      "916",
656
      "916",
657
      "916",
658
      "916",
659
      "916",
660
      "916",
661
      "916",
662
      "916",
663
      "518"
664
    ]
665
  ]
666
}
modules/dli-service-portal/trunk/static/font-awesome/less/list.less
1
// List Icons
2
// -------------------------
3

  
4
.@{fa-css-prefix}-ul {
5
  padding-left: 0;
6
  margin-left: @fa-li-width;
7
  list-style-type: none;
8
  > li { position: relative; }
9
}
10
.@{fa-css-prefix}-li {
11
  position: absolute;
12
  left: -@fa-li-width;
13
  width: @fa-li-width;
14
  top: (2em / 14);
15
  text-align: center;
16
  &.@{fa-css-prefix}-lg {
17
    left: (-@fa-li-width + (4em / 14));
18
  }
19
}
modules/dli-service-portal/trunk/static/font-awesome/less/stacked.less
1
// Stacked Icons
2
// -------------------------
3

  
4
.@{fa-css-prefix}-stack {
5
  position: relative;
6
  display: inline-block;
7
  width: 2em;
8
  height: 2em;
9
  line-height: 2em;
10
  vertical-align: middle;
11
}
12
.@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x {
13
  position: absolute;
14
  left: 0;
15
  width: 100%;
16
  text-align: center;
17
}
18
.@{fa-css-prefix}-stack-1x { line-height: inherit; }
19
.@{fa-css-prefix}-stack-2x { font-size: 2em; }
20
.@{fa-css-prefix}-inverse { color: @fa-inverse; }
modules/dli-service-portal/trunk/static/font-awesome/less/mixins.less
1
// Mixins
2
// --------------------------
3

  
4
.fa-icon() {
5
  display: inline-block;
6
  font: normal normal normal 14px/1 FontAwesome; // shortening font declaration
7
  font-size: inherit; // can't have font-size inherit on line above, so need to override
8
  text-rendering: auto; // optimizelegibility throws things off #1094
9
  -webkit-font-smoothing: antialiased;
10
  -moz-osx-font-smoothing: grayscale;
11
}
12

  
13
.fa-icon-rotate(@degrees, @rotation) {
14
  filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation);
15
  -webkit-transform: rotate(@degrees);
16
      -ms-transform: rotate(@degrees);
17
          transform: rotate(@degrees);
18
}
19

  
20
.fa-icon-flip(@horiz, @vert, @rotation) {
21
  filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1);
22
  -webkit-transform: scale(@horiz, @vert);
23
      -ms-transform: scale(@horiz, @vert);
24
          transform: scale(@horiz, @vert);
25
}
modules/dli-service-portal/trunk/static/partials/datasourceDetail.html
1
<div class="container">
2
    <div class="row">
3
        <div class="col-lg-12">
4
            <h3>Datasource Info </h3>
5
        </div>
6
    </div>
7

  
8
    <div class="row">
9
        <div class="col-lg-12">
10
            <img src="{{ datasource.iconURI }}" style="max-height: 100px"/>
11
        </div>
12
    </div>
13
    <div class="row">
14
        <div class="col-lg-6">
15
            <ul>
16

  
17
                <li>Datasource Name: <b class=blue-text>{{ datasource.officialName }}</b></li>
18
                <li>Datasource webPage: <a href="{{ datasource.webSite }}">{{ datasource.webSite }}</a></li>
19
                <li>Number of Datasets: <b>{{ lastStats.numberOfDatasets }}</b></li>
20
                <li>Number of Publications: <b>{{ lastStats.numberOfPublication }}</b></li>
21
                <li>Number of Relations: <b>{{ lastStats.numberOfRelations }}</b></li>
22

  
23

  
24
            </ul>
25
        </div>
26
    </div>
27

  
28
    <div class="row">
29
        <div class="col-lg-12">
30
            <ul id="myTabs" class="nav nav-tabs text-center" role="tablist">
31
                <li role="presentation" class="active"><a href="#stats" role="tab" id="profile-tab" data-toggle="tab"
32
                                                          aria-controls="profile" aria-expanded="false"><h4>
33
                    Statistics</h4></a></li>
34
                <li role="presentation"><a href="#dataset" id="home-tab" role="tab" data-toggle="tab"
35
                                           aria-controls="home" aria-expanded="true"><h4>Datasets</h4></a></li>
36
                <li role="presentation"><a href="#publication" role="tab" id="profile-tab" data-toggle="tab"
37
                                           aria-controls="profile" aria-expanded="false"><h4>Publications</h4></a></li>
38

  
39
            </ul>
40
            <div id="myTabContent" class="tab-content">
41
                <div role="tabpanel" class="tab-pane fade active in" id="stats" aria-labelledby="home-tab">
42
                    <h1>Stats</h1>
43

  
44
                    <div id="chart_history_links"></div>
45
                </div>
46
                <div role="tabpanel" class="tab-pane fade " id="dataset" aria-labelledby="dropdown1-tab">
47
                    <h1>Dataset</h1>
48

  
49
                    <div class="row" ng-show="result_dataset.length">
50
                        <div class="col-lg-6 col-lg-offset-6">
51
                            <a href='#/query/q=entitytype:"dataset" AND provenance:"{{ datasource.officialName }}"'
52
                               class="btn btn-primary">See other Datasets <span
53
                                    class="glyphicon glyphicon-circle-arrow-right"></span></a>
54
                        </div>
55
                    </div>
56

  
57
                    <div class="row" ng-repeat="result in result_dataset">
58
                        <div class="col-lg-12">
59
                            <a href="#/detail/{{ result.identifier }}">
60
                                <i ng-hide="result.objectType!= 'unknown' "
61
                                   style="padding: 10px"
62
                                   class="fa fa-question-circle fa-2x blue-text circle responsive-img"></i>
63
                                <i ng-show="result.objectType=='dataset'" style="padding: 10px"
64
                                   class="fa fa-database fa-2x blue-text circle responsive-img"></i>
65
                                <i style="padding: 10px" ng-show="result.objectType=='publication'"
66
                                   class="fa fa-book fa-2x blue-text circle responsive-img"></i>
67
                                <b ng-show="result.title">{{ result.title }}</b>
68
                                <b ng-hide="result.title">Metadata non resolved for pid : {{ result.pid }}</b>
69
                            </a>
70
                        </div>
71

  
72
                        <div class="col-lg-12">
73
                            <d style="font-size: small"></d>
74
                            <auth style="font-size: small; color: #1565C0"
75
                                  ng-repeat="author in result.authors">
76
                                <f ng-hide="$index==0">,</f>
77
                                {{ author }}
78
                            </auth>
79
                            <d ng-show="result.date">- {{ result.date }}</d>
80
                            </d>
81
                        </div>
82
                        <p>
83

  
84
                        <div class="col-lg-2">
85
                            <auth style="font-size: small" class="orange-text"><b>{{ countRelatedDatasets(result) }}</b>
86
                                Related Datasets
87
                            </auth>
88
                        </div>
89
                        <div class="col-lg-2">
90
                            <auth style="font-size: small" class="orange-text">
91
                                <b> {{ countRelatedPublication(result) }}</b> Related Publications
92
                            </auth>
93
                        </div>
94
                        <div class="col-lg-2">
95
                            <auth style="font-size: small" class="orange-text"><b>{{ countOtherRelations(result) }}</b>
96
                                Other Relations
97
                            </auth>
98
                        </div>
99
                        <div class="col-lg-2">
100
                            <auth style="font-size: small" class="orange-text"><a
101
                                    href="{{ result.resolved_url }}" class="orange-text"> <i
102
                                    class="fa fa-link"></i> Original Object </a></auth>
103
                        </div>
104
                        <div class="col-lg-3">
105
                            [
106
                            <auth style="font-size: small" class="orange-text"
107
                                  ng-repeat="prov in result.provenance_record">
108
                                <f ng-hide="$index==0">,</f>
109
                                <a href='#/datasource/name/{{ prov.name }}' style="color: orange">{{ prov.name }}</a>
110
                            </auth>
111
                            <d style="font-size: small">]</d>
112
                        </div>
113

  
114
                    </div>
115

  
116

  
117
                </div>
118
                <div role="tabpanel" class="tab-pane fade" id="publication" aria-labelledby="profile-tab">
119
                    <h1>Publication</h1>
120

  
121
                    <div class="row" ng-show="result_publication">
122
                        <div class="col-lg-6 col-lg-offset-6">
123
                            <a href='#/query/q=entitytype:"publication" AND provenance:"{{ datasource.officialName }}"'
124
                               class="btn btn-primary">See other Publication <span
125
                                    class="glyphicon glyphicon-circle-arrow-right"></span></a>
126
                        </div>
127
                    </div>
128
                    <div class="row" ng-repeat="result in result_publication">
129
                        <div class="col-lg-12">
130
                            <a href="#/detail/{{ result.identifier }}">
131
                                <i ng-hide="result.objectType!= 'unknown' "
132
                                   style="padding: 10px"
133
                                   class="fa fa-question-circle fa-2x blue-text circle responsive-img"></i>
134
                                <i ng-show="result.objectType=='dataset'" style="padding: 10px"
135
                                   class="fa fa-database fa-2x blue-text circle responsive-img"></i>
136
                                <i style="padding: 10px" ng-show="result.objectType=='publication'"
137
                                   class="fa fa-book fa-2x blue-text circle responsive-img"></i>
138
                                <b ng-show="result.title">{{ result.title }}</b>
139
                                <b ng-hide="result.title">Metadata non resolved for pid : {{ result.pid }}</b>
140
                            </a>
141
                        </div>
142

  
143
                        <div class="col-lg-12">
144
                            <d style="font-size: small"></d>
145
                            <auth style="font-size: small; color: #1565C0"
146
                                  ng-repeat="author in result.authors">
147
                                <f ng-hide="$index==0">,</f>
148
                                {{ author }}
149
                            </auth>
150
                            <d ng-show="result.date">- {{ result.date }}</d>
151
                            </d>
152
                        </div>
153
                        <p>
154

  
155
                        <div class="col-lg-2">
156
                            <auth style="font-size: small" class="orange-text"><b>{{ countRelatedDatasets(result) }}</b>
157
                                Related Datasets
158
                            </auth>
159
                        </div>
160
                        <div class="col-lg-2">
161
                            <auth style="font-size: small" class="orange-text">
162
                                <b> {{ countRelatedPublication(result) }}</b> Related Publications
163
                            </auth>
164
                        </div>
165
                        <div class="col-lg-2">
166
                            <auth style="font-size: small" class="orange-text"><b>{{ countOtherRelations(result) }}</b>
167
                                Other Relations
168
                            </auth>
169
                        </div>
170
                        <div class="col-lg-2">
171
                            <auth style="font-size: small" class="orange-text"><a
172
                                    href="{{ result.resolved_url }}" class="orange-text"> <i
173
                                    class="fa fa-link"></i> Original Object </a></auth>
174
                        </div>
175
                        <div class="col-lg-3">
176
                            [
177
                            <auth style="font-size: small" class="orange-text"
178
                                  ng-repeat="prov in result.provenance_record">
179
                                <f ng-hide="$index==0">,</f>
180
                                <a href='#/datasource/name/{{ prov.name }}' style="color: orange">{{ prov.name }}</a>
181
                            </auth>
182
                            <d style="font-size: small">]</d>
183
                        </div>
184

  
185
                    </div>
186

  
187
                </div>
188

  
189
            </div>
190
        </div>
191
    </div>
192

  
193

  
194
</div>
195

  
196
<script>
197
    $('#myTabs a').click(function (e) {
198
        e.preventDefault()
199
        $(this).tab('show')
200
    });
201
</script>
modules/dli-service-portal/trunk/static/partials/datasources.html
1
<div class="row container-fluid">
2

  
3

  
4
    <h1>Datasource's Map</h1>
5

  
6

  
7
    <div class="row">
8
        <div class="col-lg-2">
9
           <ul class="list-group">
10
                <li class="list-group-item"  ng-repeat="item in my_markers">
11
                    <a href="{{ item.weburl }}" > {{ item.name }}</a></li>
12

  
13
            </ul>
14

  
15
        </div>
16
        <div class="col-lg-8" >
17
            <div id="world-map" style="width: 100%; height: 500px;  margin: 40px" ></div>
18

  
19

  
20
        </div>
21
    </div>
22
</div>
23

  
24
<script src="js/createMap.js"></script>
modules/dli-service-portal/trunk/static/partials/detail.html
1
<section>
2

  
3

  
4
    <div>
5
        <div class="row">
6
            <div class="col-lg-11 col-lg-offset-1" style="font-size: large">
7
                <i ng-show="item.typology=='dataset'" style="padding: 10px"
8
                   class="fa fa-database fa-2x  responsive-img"></i>
9
                <i ng-show="item.typology=='publication'" style="padding: 10px"
10
                   class="fa fa-book fa-2x circle responsive-img"></i>
11
                <i ng-hide="item.typology=='publication' || item.typology=='dataset'"
12
                   class="fa fa-question-circle fa-2x blue-text circle responsive-img"></i>
13
                <b><a href="{{ item.resolved_url }}" style="margin: 10px">
14
                    <d>    {{ item.title[0] }} </d>
15
                    <d ng-hide="item.title">metadata not available - Pid not resolved</d>
16

  
17
                </a></b></div>
18
        </div>
19
    </div>
20

  
21

  
22
    <div class="row">
23
        <div class="col-lg-11 col-lg-offset-1">
24
            <table style="width: 100%">
25
                <tr>
26
                    <td style="width: 20%"><b>Typology:</b></td>
27
                    <td> {{ item.typology }}</td>
28
                </tr>
29
                <tr>
30
                    <td><b>Identifier:</b></td>
31
                    <td ng-repeat="id in item.localIdentifier"> {{ id.id }}</td>
32
                </tr>
33
                <tr>
34
                    <td><b>Identifier type:</b></td>
35
                    <td ng-repeat="id in item.localIdentifier"> {{ id.type }}</td>
36
                </tr>
37
                <tr>
38
                    <td class="valign-wrapper"><b>Author(s):</b></td>
39
                    <td class="green-text">
40
                        <f ng-repeat="a in item.author">{{ a }},</f>
41
                    </td>
42
                </tr>
43
                <tr>
44
                    <td><b>Date:</b></td>
45
                    <td class="valign-wrapper green-text"> {{ item.date[0] }}</td>
46
                </tr>
47
            </table>
48
            <br>
49
            <table style="width: 100%">
50
                <tr>
51
                    <td style="width: 20%"><b>provenance (of this object):</b></td>
52
                    <td class="valign-wrapper">
53
                        <table style="width: 100%">
54
                            <thead>
55
                            <tr>
56
                                <th class="center-align" style="width: 20%">Date Of Collection</th>
57
                                <th class="center-align" style="width: 20%">Datasource</th>
58
                                <th class="center-align" style="width: 60%">Action</th>
59
                            </tr>
60
                            </thead>
61
                            <tbody>
62
                            <tr ng-repeat="d in item.datasources">
63
                                <td class="centered">{{ d.collectionDate }}</td>
64
                                <td class="centered">{{ d.datasourceName }}</td>
65
                                <td class="centered">
66
                                    <div ng-show="d.completionStatus==='complete'  && d.provisionMode==='collected'">
67
                                        Full-metadata record collected from {{ d.datasourceName }}
68
                                    </div>
69
                                    <div ng-show="d.completionStatus==='incomplete'">Object PID collected from
70
                                        {{ d.datasourceName }}
71
                                    </div>
72
                                    <div ng-show="d.completionStatus==='complete' && d.provisionMode==='resolved'">
73
                                        Full-metadata record collected from {{ d.datasourceName }}
74
                                    </div>
75
                                </td>
76
                            </tr>
77
                            </tbody>
78
                        </table>
79
                    </td>
80
                </tr>
81
            </table>
82
            <br>
83
        </div>
84
    </div>
85

  
86
    <div class="row">
87
        <div class="col-lg-11 col-lg-offset-1">
88
            <ul id="myTabs" class="nav nav-tabs text-center" role="tablist">
89
                <li role="presentation" ng-class="active"><a href="#dataset" id="home-tab" role="tab" data-toggle="tab"
90
                                                             aria-controls="home" aria-expanded="true"><h4>Link To
91
                    Datasets ({{ item.relatedDatasets }})</h4></a></li>
92
                <li role="presentation" ng-class=""><a href="#publication" role="tab" id="profile-tab" data-toggle="tab"
93
                                                       aria-controls="profile" aria-expanded="false"><h4>Link To
94
                    Publications ({{ item.relatedPublications }})</h4></a></li>
95
                <li role="presentation" ng-class=""><a href="#other" role="tab" id="profile-tab" data-toggle="tab"
96
                                                       aria-controls="profile" aria-expanded="false"><h4>Other Links
97
                    ({{ item.relatedUnknown }})</h4></a></li>
98
            </ul>
99
            <div id="myTabContent" class="tab-content">
100
                <div role="tabpanel" class="tab-pane fade active in" id="dataset" aria-labelledby="home-tab">
101

  
102
                    <div ng-repeat="rels in relations.related_dataset">
103
                        <div class="row">
104
                            <div class="col-lg-12"><a href="#/detail/{{ rels.target.dnetIdentifier }}" class="blue-text"> <i
105
                                    style="padding: 10px"
106
                                    class="fa fa-database fa-2x blue-text circle responsive-img"></i><b>{{ rels.target.title }}</b>
107
                            </a></div>
108

  
109
                            <div class="col-lg-12">
110
                                <f style="color: green" ng-repeat="a in rels.target.creator">{{ a.name }},</f>
111
                            </div>
112
                            <div ng-repeat="ids in rels.target.identifier">
113
                                <div class="col-lg-12"><b>PID</b> : {{ ids.identifier }}</div>
114
                                <div class="col-lg-12"><b>PID Type</b> : {{ ids.schema }}</div>
115
                            </div>
116
                        </div>
117
                        <div class="row">
118
                            <div class="col-lg-2">
119
                                <b>provenance (of this link): </b>
120
                            </div>
121
                            <div class="col-lg-8">
122
                                <table style="width: 100%">
123
                                    <thead>
124
                                    <tr>
125
                                        <th class="center-align" style="width: 20%">Date Of Collection</th>
126
                                        <th class="center-align" style="width: 20%">Datasource</th>
127
                                        <th class="center-align" style="width: 60%">Action</th>
128
                                    </tr>
129
                                    </thead>
130
                                    <tbody>
131
                                    <tr ng-repeat="d in rels.linkprovider">
132
                                        <td class="left-align">{{ d.collectionDate }}</td>
133
                                        <td class="left-align">{{ d.name }}</td>
134
                                        <td class="left-align">
135
                                            Relation collected from {{ d.name }}
136
                                        </td>
137
                                    </tr>
138
                                    </tbody>
139
                                </table>
140
                            </div>
141
                        </div>
142
                    </div>
143

  
144
                    <div class="row centered">
145
                            <div class="text-center">
146
                                <ul class="pagination centered">
147
                                    <li><a ng-click="prevPage('dataset')">&lt;</a></li>
148
                                    <li ><a ng-click="nextPage('dataset')">&gt;</a></li>
149
                                </ul>
150
                            </div>
151
                    </div>
152
                </div>
153
                <div role="tabpanel" class="tab-pane fade" id="publication" aria-labelledby="profile-tab">
154
                    <div ng-repeat="rels in relations.related_publications">
155
                        <div class="row">
156
                            <div class="col-lg-12">
157
                                <a href="#/detail/{{ rels.target.dnetIdentifier }}" class="blue-text">
158
                                    <i style="padding: 10px" class="fa fa-book fa-2x blue-text circle responsive-img"></i>
159
                                    <b>{{ rels.target.title }}</b>
160
                                </a>
161
                            </div>
162
                            <div class="col-lg-12">
163
                                <f style="color: green" ng-repeat="a in rels.target.creator">{{ a.name }},</f>
164
                            </div>
165
                            <div ng-repeat="ids in rels.target.identifier">
166
                                <div class="col-lg-12"><b>PID</b> : {{ ids.identifier }}</div>
167
                                <div class="col-lg-12"><b>PID Type</b> : {{ ids.schema }}</div>
168
                            </div>
169
                        </div>
170
                        <div class="row">
171
                            <div class="col-lg-2">
172
                                <b>provenance (of this link): </b>
173
                            </div>
174
                            <div class="col-lg-8">
175
                                <table style="width: 100%">
176
                                    <thead>
177
                                    <tr>
178
                                        <th class="center-align" style="width: 20%">Date Of Collection</th>
179
                                        <th class="center-align" style="width: 20%">Datasource</th>
180
                                        <th class="center-align" style="width: 60%">Action</th>
181
                                    </tr>
182
                                    </thead>
183
                                    <tbody>
184
                                    <tr ng-repeat="d in rels.linkprovider">
185
                                        <td class="left-align">{{ d.collectionDate }}</td>
186
                                        <td class="left-align">{{ d.name }}</td>
187
                                        <td class="left-align">
188
                                            Relation collected from {{ d.name }}
189
                                        </td>
190
                                    </tr>
191
                                    </tbody>
192
                                </table>
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff