1 |
52363
|
konstantin
|
//version compatibility: 1.1.0-SNAPSHOT
|
2 |
51340
|
konstantin
|
|
3 |
51508
|
argiro.kok
|
function updateStats(){
|
4 |
|
|
print("Update Stats...")
|
5 |
|
|
db.statistics.drop();
|
6 |
|
|
db.createCollection("statistics")
|
7 |
51340
|
konstantin
|
|
8 |
51508
|
argiro.kok
|
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["software"]=statistics_entities;
|
33 |
|
|
var statistics = {"pid" : communityPid, "entities" : entities};
|
34 |
|
|
db.statistics.save(statistics);
|
35 |
|
|
print("Update stats for " + communityPid)
|
36 |
|
|
}
|
37 |
51273
|
argiro.kok
|
}
|
38 |
51508
|
argiro.kok
|
function updateDivIds(){
|
39 |
|
|
print("Update DivIds...")
|
40 |
51340
|
konstantin
|
|
41 |
51508
|
argiro.kok
|
//db.divId.drop();
|
42 |
|
|
//db.createCollection("divId")
|
43 |
|
|
//
|
44 |
|
|
//link = db.page.find( { route: "/participate/claim" }).map( function(page) { return page._id.str; } ).toString()
|
45 |
|
|
//directLink = db.page.find( { route: "/participate/direct-claim" }).map( function(page) { return page._id.str; } ).toString()
|
46 |
|
|
//
|
47 |
|
|
//db.divId.save({ "name" : "link-context-form", "pages" : [link, directLink]})
|
48 |
|
|
//db.divId.save({ "name" : "link-project-form", "pages" : [link, directLink]})
|
49 |
|
|
//db.divId.save({ "name" : "link-result-form", "pages" : [link, directLink]})
|
50 |
|
|
//db.divId.save({ "name" : "link-result-bulk", "pages" : [link]})
|
51 |
|
|
//db.divId.save({ "name" : "link-metadata", "pages" : [link, directLink]})
|
52 |
|
|
}
|
53 |
|
|
function updatePages(){
|
54 |
|
|
print("\n\nUpdate Pages with connect & openaire fields...")
|
55 |
|
|
db.page.update({ "route" : "/search/publication" },{$set: { "connect": true, "openaire":true }});
|
56 |
|
|
db.page.update({ "route" : "/search/dataset" },{$set: { "connect": true, "openaire":true }});
|
57 |
|
|
db.page.update({ "route" : "/search/software" },{$set: { "connect": true, "openaire":true }});
|
58 |
|
|
db.page.update({ "route" : "/search/project" },{$set: { "connect": true, "openaire":true }});
|
59 |
|
|
db.page.update({ "route" : "/search/organization" },{$set: { "connect": true, "openaire":true }});
|
60 |
|
|
db.page.update({ "route" : "/search/dataprovider" },{$set: { "connect": true, "openaire":true }});
|
61 |
|
|
db.page.update({ "route" : "/project-report" },{$set: { "connect": false, "openaire":true }});
|
62 |
51340
|
konstantin
|
|
63 |
51531
|
konstantin
|
db.page.update({ "route" : "/search/find" },{$set: { "connect": false, "openaire":true }});
|
64 |
51340
|
konstantin
|
|
65 |
51508
|
argiro.kok
|
db.page.update({ "route" : "/search/find/publications" },{$set: { "connect": true, "openaire":true }});
|
66 |
|
|
db.page.update({ "route" : "/search/find/datasets" },{$set: { "connect": true, "openaire":true }});
|
67 |
|
|
db.page.update({ "route" : "/search/find/software" },{$set: { "connect": true, "openaire":true }});
|
68 |
|
|
db.page.update({ "route" : "/search/find/projects" },{$set: { "connect": true, "openaire":true }});
|
69 |
|
|
db.page.update({ "route" : "/search/find/organizations" },{$set: { "connect": false, "openaire":true }});
|
70 |
|
|
db.page.update({ "route" : "/search/find/dataproviders" },{$set: { "connect": true, "openaire":true }});
|
71 |
|
|
|
72 |
|
|
db.page.update({ "route" : "/search/advanced/publications" },{$set: { "connect": true, "openaire":true }});
|
73 |
|
|
db.page.update({ "route" : "/search/advanced/datasets" },{$set: { "connect": true, "openaire":true }});
|
74 |
|
|
db.page.update({ "route" : "/search/advanced/software" },{$set: { "connect": true, "openaire":true }});
|
75 |
|
|
db.page.update({ "route" : "/search/advanced/projects" },{$set: { "connect": false, "openaire":true }});
|
76 |
|
|
db.page.update({ "route" : "/search/advanced/organizations" },{$set: { "connect": false, "openaire":true }});
|
77 |
51531
|
konstantin
|
db.page.update({ "route" : "/search/advanced/dataproviders" },{$set: { "connect": false, "openaire":true }});
|
78 |
51508
|
argiro.kok
|
|
79 |
|
|
db.page.update({ "route" : "/search/journals" },{$set: { "connect": false, "openaire":true }});
|
80 |
|
|
db.page.update({ "route" : "/search/entity-registries" },{$set: { "connect": false, "openaire":true }});
|
81 |
|
|
db.page.update({ "route" : "/search/content-providers" },{$set: { "connect": false, "openaire":true }});
|
82 |
|
|
db.page.update({ "route" : "/search/journals-table" },{$set: { "connect": false, "openaire":true }});
|
83 |
|
|
db.page.update({ "route" : "/search/entity-registries-table" },{$set: { "connect": false, "openaire":true }});
|
84 |
|
|
db.page.update({ "route" : "/search/content-providers-table" },{$set: { "connect": false, "openaire":true }});
|
85 |
|
|
|
86 |
|
|
db.page.update({ "route" : "/participate/deposit-publications" },{$set: { "connect": true, "openaire":true }});
|
87 |
|
|
db.page.update({ "route" : "/participate/deposit-datasets" },{$set: { "connect": true, "openaire":true }});
|
88 |
51531
|
konstantin
|
db.page.update({ "route" : "/participate/deposit-publications-result" },{$set: { "connect": true, "openaire":true }});
|
89 |
|
|
db.page.update({ "route" : "/participate/deposit-datasets-result" },{$set: { "connect": true, "openaire":true }});
|
90 |
51508
|
argiro.kok
|
db.page.update({ "route" : "/participate/deposit-subject-result" },{$set: { "connect": true, "openaire":true }});
|
91 |
|
|
|
92 |
|
|
db.page.update({ "route" : "/participate/claim" },{$set: { "connect": true, "openaire":true }});
|
93 |
|
|
db.page.update({ "route" : "/participate/direct-claim" },{$set: { "connect": true, "openaire":true }});
|
94 |
|
|
db.page.update({ "route" : "/myclaims" },{$set: { "connect": true, "openaire":true }});
|
95 |
|
|
db.page.update({ "route" : "/claims" },{$set: { "connect": false, "openaire":true }});
|
96 |
|
|
db.page.update({ "route" : "/claims-project-manager" },{$set: { "connect": false, "openaire":true }});
|
97 |
|
|
|
98 |
|
|
print("Updated\n\n")
|
99 |
|
|
};
|
100 |
|
|
|
101 |
51623
|
konstantin
|
function updateTypeOfLandingPages(){
|
102 |
|
|
print("\n\nUpdate type of Landing Pages (from 'search' to 'landing')...")
|
103 |
|
|
db.page.update({ "route" : "/search/publication" },{$set: { "type": "landing"}});
|
104 |
|
|
db.page.update({ "route" : "/search/dataset" },{$set: { "type": "landing"}});
|
105 |
|
|
db.page.update({ "route" : "/search/software" },{$set: { "type": "landing"}});
|
106 |
|
|
db.page.update({ "route" : "/search/project" },{$set: { "type": "landing"}});
|
107 |
|
|
db.page.update({ "route" : "/search/organization" },{$set: { "type": "landing"}});
|
108 |
|
|
db.page.update({ "route" : "/search/dataprovider" },{$set: { "type": "landing"}});
|
109 |
|
|
db.page.update({ "route" : "/project-report" },{$set: { "type": "landing"}});
|
110 |
|
|
|
111 |
|
|
print("Updated\n\n")
|
112 |
|
|
};
|
113 |
|
|
|
114 |
|
|
function removeEntitiesFromSearchFindPage() {
|
115 |
|
|
db.page.update({ "route" : "/search/find" },{$set: {"entities" : []}});
|
116 |
|
|
}
|
117 |
|
|
|
118 |
51828
|
konstantin
|
function initDivHelpContents(){
|
119 |
|
|
print("Init Div Help Contents for every community...")
|
120 |
|
|
|
121 |
|
|
link_context_form = db.divId.find( { name: "link-context-form" }).map( function(divId) { return divId._id.str; } ).toString();
|
122 |
|
|
link_project_form = db.divId.find( { name: "link-project-form" }).map( function(divId) { return divId._id.str; } ).toString();
|
123 |
|
|
link_result_form = db.divId.find( { name: "link-result-form" }).map( function(divId) { return divId._id.str; } ).toString();
|
124 |
|
|
link_result_bulk = db.divId.find( { name: "link-result-bulk" }).map( function(divId) { return divId._id.str; } ).toString();
|
125 |
|
|
link_metadata = db.divId.find( { name: "link-metadata" }).map( function(divId) { return divId._id.str; } ).toString();
|
126 |
|
|
|
127 |
51846
|
argiro.kok
|
link_context_form_content = '<div> <div><span class="uk-text-bold"><span uk-icon="icon: info"> </span> Information:</span> Select a research community and/or a category and search for a community concept, or browse to the community tree through the categories</div> </div>';
|
128 |
|
|
link_project_form_content = '<div> <div><span class="uk-text-bold"><span uk-icon="icon: info"> </span> Information:</span> Search for projects using project name or grant id. Limit results filtering by funder.</div> </div>';
|
129 |
|
|
link_result_form_content = '<div> <div><span class="uk-text-bold"><span uk-icon="icon: info"> </span> Information:</span></div> Search for research results in OpenAIRE information space, Datacite, CrossRef or ORCID. <div class="uk-text-small">Use keywords, DOI (more than one - space separated), author's ORCID</div> </div> ';
|
130 |
|
|
link_result_bulk_content = '<div> <div><span class="uk-text-bold"><span uk-icon="icon: info"> </span> Information:</span> Upload a csv file containing a list of DOIs. For each DOI found in the file, metadata will be fetched from CrossRef or Datacite and will be added to your selected research results.</div> <div class="uk-margin-top uk-text-small"><span class="uk-text-bold">CSV format:</span> <ul class="uk-list"> <li>The format of CSV file should be "DOI","ACCESS_MODE","DATE".</li> <li>The value "DOI" is required</li> <li>Access mode column should have values: "OPEN","CLOSED" or "EMBARGO".</li> <li>Date column valid format is YYYY-MM-DD and is required when access mode has value EMBARGO.</li> <li>In case access mode is not available default value is "OPEN".</li> </ul> </div> </div> ';
|
131 |
|
|
link_metadata_content = '<div> <div><span class="uk-text-bold"><span uk-icon="icon: info"> </span> Information:</span> Manage access mode & type of selected research results. For OpenAIRE this functionality isn't available.</div> </div>';
|
132 |
51828
|
konstantin
|
|
133 |
|
|
communities = db.community.find().map( function(community) { return community._id.str.toString(); } );
|
134 |
|
|
|
135 |
|
|
for (var i = 0; i < communities.length; i++) {
|
136 |
|
|
//db.divHelpContent.drop();
|
137 |
|
|
//db.createCollection("divHelpContent");
|
138 |
|
|
|
139 |
51846
|
argiro.kok
|
db.divHelpContent.save({ "divId" : link_context_form, "community" : communities[i], "content" : link_context_form_content, "isActive" : false });
|
140 |
|
|
db.divHelpContent.save({ "divId" : link_project_form, "community" : communities[i], "content" : link_project_form_content, "isActive" : false });
|
141 |
51828
|
konstantin
|
db.divHelpContent.save({ "divId" : link_result_form, "community" : communities[i], "content" : link_result_form_content, "isActive" : true });
|
142 |
|
|
db.divHelpContent.save({ "divId" : link_result_bulk, "community" : communities[i], "content" : link_result_bulk_content, "isActive" : true });
|
143 |
51846
|
argiro.kok
|
db.divHelpContent.save({ "divId" : link_metadata, "community" : communities[i], "content" : link_metadata_content, "isActive" : false });
|
144 |
51828
|
konstantin
|
|
145 |
|
|
print("Div Help Contents for community "+ communities[i] +" were just created");
|
146 |
|
|
}
|
147 |
|
|
|
148 |
|
|
}
|
149 |
52308
|
konstantin
|
|
150 |
|
|
function createMonitorPageWithTypeOther() {
|
151 |
|
|
db.page.save({"name" : "Monitor", "route" : "/monitor", "type" : "other", "connect":true,"openaire":false,"entities" : []})
|
152 |
|
|
}
|
153 |
|
|
|
154 |
|
|
function addMonitorPageToCommunities() {
|
155 |
|
|
communities = db.community.find().map( function(community) { return community; } );
|
156 |
|
|
|
157 |
|
|
monitor = db.page.find( { route: "/monitor" }).map( function(page) { return page._id.str; } ).toString()
|
158 |
|
|
|
159 |
|
|
for (var i = 0; i < communities.length; i++) {
|
160 |
|
|
community_pages = communities[i].pages;
|
161 |
|
|
|
162 |
|
|
community_pages[monitor] = false;;
|
163 |
|
|
|
164 |
|
|
community_pid = communities[i].pid;
|
165 |
|
|
db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
|
166 |
|
|
print("Update pages for " + community_pid);
|
167 |
|
|
}
|
168 |
|
|
}
|
169 |
|
|
|
170 |
|
|
function createContentPageWithTypeOther() {
|
171 |
|
|
db.page.save({"name" : "Content", "route" : "/content", "type" : "other", "connect":true,"openaire":false,"entities" : []});
|
172 |
|
|
}
|
173 |
|
|
|
174 |
|
|
function createPagesWithTypeHtml() {
|
175 |
|
|
db.page.save({"name" : "About", "route" : "/about", "type" : "html", "connect":true,"openaire":false,"entities" : []});
|
176 |
|
|
db.page.save({"name" : "Organizations", "route" : "/organizations", "type" : "html", "connect":true,"openaire":false,"entities" : []});
|
177 |
|
|
}
|
178 |
|
|
|
179 |
|
|
function addContent_About_Organizations_PagesToCommunities() {
|
180 |
|
|
communities = db.community.find().map( function(community) { return community; } );
|
181 |
|
|
|
182 |
|
|
content = db.page.find( { route: "/content" }).map( function(page) { return page._id.str; } ).toString()
|
183 |
|
|
|
184 |
|
|
about = db.page.find( { route: "/about" }).map( function(page) { return page._id.str; } ).toString()
|
185 |
|
|
organizations = db.page.find( { route: "/organizations" }).map( function(page) { return page._id.str; } ).toString()
|
186 |
|
|
|
187 |
|
|
for (var i = 0; i < communities.length; i++) {
|
188 |
|
|
community_pages = communities[i].pages;
|
189 |
|
|
|
190 |
|
|
community_pages[content] = false;
|
191 |
|
|
community_pages[about] = false;
|
192 |
|
|
community_pages[organizations] = false;
|
193 |
|
|
|
194 |
|
|
community_pid = communities[i].pid;
|
195 |
|
|
db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
|
196 |
|
|
print("Update pages for " + community_pid);
|
197 |
|
|
}
|
198 |
|
|
}
|
199 |
|
|
|
200 |
|
|
function createCollectionForHtmlPageContents() {
|
201 |
|
|
db.createCollection("htmlPageContent");
|
202 |
|
|
}
|
203 |
|
|
|
204 |
|
|
function addDefaultHtmlToHtmlPages() {
|
205 |
|
|
about = db.page.find( { route: "/about" }).map( function(page) { return page._id.str; } ).toString()
|
206 |
|
|
organizations = db.page.find( { route: "/organizations" }).map( function(page) { return page._id.str; } ).toString()
|
207 |
|
|
|
208 |
|
|
communities = db.community.find().map( function(community) { return community._id.str.toString(); } );
|
209 |
|
|
|
210 |
|
|
for (var i = 0; i < communities.length; i++) {
|
211 |
|
|
db.htmlPageContent.save({"page" : about, "community" : communities[i], "content" : "<div>Build your html page: About</div>"})
|
212 |
|
|
db.htmlPageContent.save({"page" : organizations, "community" : communities[i], "content" : "<div>Build your html page: Organizations</div>"})
|
213 |
|
|
}
|
214 |
|
|
}
|
215 |
|
|
|
216 |
51846
|
argiro.kok
|
use openaire_admin;
|
217 |
51828
|
konstantin
|
|
218 |
52308
|
konstantin
|
//updatePages();
|
219 |
51623
|
konstantin
|
|
220 |
|
|
//updateTypeOfLandingPages();
|
221 |
51828
|
konstantin
|
//removeEntitiesFromSearchFindPage();
|
222 |
52308
|
konstantin
|
//initDivHelpContents();
|
223 |
|
|
|
224 |
|
|
//createContentPageWithTypeOther();
|
225 |
|
|
//createPagesWithTypeHtml();
|
226 |
|
|
//addContent_About_Organizations_PagesToCommunities();
|
227 |
|
|
//createCollectionForHtmlPageContents();
|
228 |
|
|
//addDefaultHtmlToHtmlPages();
|
229 |
|
|
|
230 |
|
|
createMonitorPageWithTypeOther();
|
231 |
|
|
addMonitorPageToCommunities();
|