1
|
//version compatibility: 1.0.1-SNAPSHOT
|
2
|
|
3
|
use openaire_admin;
|
4
|
|
5
|
db.statistics.drop();
|
6
|
db.createCollection("statistics")
|
7
|
|
8
|
var communities = db.community.find().map( function(entity) { return entity.pid } );
|
9
|
print(communities);
|
10
|
for(var i =0; i < communities.length; i++){
|
11
|
print(communities[i]);
|
12
|
var communityPid = communities[i];
|
13
|
var numbers_map = {};
|
14
|
numbers_map["total"] = { "showInMonitor" : true, "showInDashboard" : false };
|
15
|
numbers_map["project"] = { "showInMonitor" : true, "showInDashboard" : false };
|
16
|
numbers_map["open"] = { "showInMonitor" : true, "showInDashboard" : false };
|
17
|
numbers_map["closed"] = { "showInMonitor" : true, "showInDashboard" : false };
|
18
|
numbers_map["embargo"] = { "showInMonitor" : true, "showInDashboard" : false };
|
19
|
numbers_map["restricted"] = { "showInMonitor" : true, "showInDashboard" : false };
|
20
|
var numbers = {"map":numbers_map};
|
21
|
var charts_map = {};
|
22
|
charts_map["timeline"] = { "showInMonitor" : true, "showInDashboard" : false };
|
23
|
charts_map["graph"] = { "showInMonitor" : true, "showInDashboard" : false };
|
24
|
charts_map["projectTable"] = { "showInMonitor" : true, "showInDashboard" : false };
|
25
|
charts_map["projectColumn"] = { "showInMonitor" : true, "showInDashboard" : false };
|
26
|
charts_map["projectPie"] = { "showInMonitor" : true, "showInDashboard" : false };
|
27
|
var charts = {"map":charts_map};
|
28
|
var statistics_entities = {"charts":charts,"numbers":numbers}
|
29
|
var entities = {};
|
30
|
entities["publication"]=statistics_entities;
|
31
|
entities["dataset"]=statistics_entities;
|
32
|
entities["sofware"]=statistics_entities;
|
33
|
var statistics = {"pid" : communityPid, "entities" : entities};
|
34
|
db.statistics.save(statistics);
|
35
|
print("Update stats for " + communityPid)
|
36
|
}
|
37
|
|
38
|
db.divId.drop();
|
39
|
db.createCollection("divId")
|
40
|
|
41
|
link = db.page.find( { route: "/participate/claim" }).map( function(page) { return page._id.str; } ).toString()
|
42
|
directLink = db.page.find( { route: "/participate/direct-claim" }).map( function(page) { return page._id.str; } ).toString()
|
43
|
|
44
|
db.divId.save({ "name" : "link-context-form", "pages" : [link, directLink]})
|
45
|
db.divId.save({ "name" : "link-project-form", "pages" : [link, directLink]})
|
46
|
db.divId.save({ "name" : "link-result-form", "pages" : [link, directLink]})
|
47
|
db.divId.save({ "name" : "link-result-bulk", "pages" : [link]})
|
48
|
db.divId.save({ "name" : "link-metadata", "pages" : [link, directLink]})
|