Project

General

Profile

1 56679 konstantin
//version compatibility: 2.0.0-SNAPSHOT
2 51340 konstantin
3 52897 argiro.kok
//function createOtherResearchProducts() {
4
//	db.entity.save({"pid" : "orp", "name" : "Other Research Products"});
5
//	orpId = db.entity.find( { pid: "orp" }).map( function(entity) { return entity._id.str; } ).toString();
6 51508 argiro.kok
//
7 52897 argiro.kok
//	db.page.save({"name" : "Other Research Products Landing", "route" : "/search/other", "type" : "landing", "connect":true,"openaire":true,"entities" : [orpId]});
8
//	db.page.save({"name" : "Search Other Research Products", "route" : "/search/find/other", "type" : "search", "connect":true,"openaire":true,"entities" : [orpId]});
9
//	db.page.save({"name" : "Advanced Search Other Research Products", "route" : "/search/advanced/other", "type" : "search", "connect":true,"openaire":true,"entities" : [orpId]});
10 51508 argiro.kok
//
11 52897 argiro.kok
//	orpLanding = db.page.find( { route: "/search/other" }).map( function(page) { return page._id.str; } ).toString();
12
//	searchOrp = db.page.find( { route: "/search/find/other" }).map( function(page) { return page._id.str; } ).toString();
13
//	advancedSearchOrp = db.page.find( { route: "/search/advanced/other" }).map( function(page) { return page._id.str; } ).toString();
14
//
15
//	communities = db.community.find().map( function(community) { return community; } );
16
//
17
//	for (var i = 0; i < communities.length; i++) {
18
//		community_pages = communities[i].pages;
19
//
20
//		community_pages[orpLanding] = true;
21
//		community_pages[searchOrp] = true;
22
//		community_pages[advancedSearchOrp] = true;
23
//
24
//		community_pid = communities[i].pid;
25
//		db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
26
//        print("Update pages for " + community_pid);
27
//
28
//		community_entities = communities[i].entities;
29
//
30
//		community_entities[orpId] = true;
31
//
32
//		community_pid = communities[i].pid;
33
//		db.community.update({ "pid" : community_pid },{$set: { "entities": community_entities}});
34
//        print("Update entities for " + community_pid);
35
//	}
36
//}
37 51340 konstantin
38 56679 konstantin
// function createNotificationsCollection() {
39
// 	db.createCollection("notifications");
40
// }
41
//
42
// function addDivHelpContentsForCommunity(communityPid) {
43
// 	link_context_form = db.divId.find( { name: "link-context-form" }).map( function(divId) { return divId._id.str; } ).toString();
44
//     link_project_form = db.divId.find( { name: "link-project-form" }).map( function(divId) { return divId._id.str; } ).toString();
45
//     link_result_form = db.divId.find( { name: "link-result-form" }).map( function(divId) { return divId._id.str; } ).toString();
46
//     link_result_bulk = db.divId.find( { name: "link-result-bulk" }).map( function(divId) { return divId._id.str; } ).toString();
47
//     link_metadata = db.divId.find( { name: "link-metadata" }).map( function(divId) { return divId._id.str; } ).toString();
48
//
49
//     link_context_form_content = '<div> <div><span class="uk-text-bold"><span uk-icon="icon: info">&nbsp;</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>';
50
//     link_project_form_content = '<div> <div><span class="uk-text-bold"><span uk-icon="icon: info">&nbsp;</span> Information:</span> Search for projects using project name or grant id. Limit results filtering by funder.</div> </div>';
51
//     link_result_form_content = '<div> <div><span class="uk-text-bold"><span uk-icon="icon: info">&nbsp;</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&#39;s ORCID</div> </div> ';
52
//     link_result_bulk_content = '<div> <div><span class="uk-text-bold"><span uk-icon="icon: info">&nbsp;</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 &quot;DOI&quot;,&quot;ACCESS_MODE&quot;,&quot;DATE&quot;.</li> <li>The value &quot;DOI&quot; is required</li> <li>Access mode column should have values: &quot;OPEN&quot;,&quot;CLOSED&quot; or &quot;EMBARGO&quot;.</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 &quot;OPEN&quot;.</li> </ul> </div> </div> ';
53
//     link_metadata_content = '<div> <div><span class="uk-text-bold"><span uk-icon="icon: info">&nbsp;</span> Information:</span> Manage access mode &amp; type of selected research results. For OpenAIRE this functionality isn&#39;t available.</div> </div>';
54
//
55
//     communityID = db.community.find({ "pid" : communityPid}).map( function(community) { return community._id.str.toString(); } );
56
//
57
//     db.divHelpContent.save({ "divId" : link_context_form, "community" : communityID, "content" : link_context_form_content, "isActive" : false });
58
//     db.divHelpContent.save({ "divId" : link_project_form, "community" : communityID, "content" : link_project_form_content, "isActive" : false });
59
//     db.divHelpContent.save({ "divId" : link_result_form, "community" : communityID, "content" : link_result_form_content, "isActive" : true });
60
//     db.divHelpContent.save({ "divId" : link_result_bulk, "community" : communityID, "content" : link_result_bulk_content, "isActive" : true });
61
//     db.divHelpContent.save({ "divId" : link_metadata, "community" : communityID, "content" : link_metadata_content, "isActive" : false });
62
// }
63
//
64
// function addDefaultHtmlToHtmlPagesForCommunity(communityPid) {
65
// 	about = db.page.find( { route: "/about" }).map( function(page) { return page._id.str; } ).toString()
66
// 	organizations = db.page.find( { route: "/organizations" }).map( function(page) { return page._id.str; } ).toString()
67
//
68
//     communityID = db.community.find({ "pid" : communityPid}).map( function(community) { return community._id.str.toString(); } );
69
//
70
// 	db.htmlPageContent.save({"page" : about, "community" : communityID, "content" : '<div><div class="uk-article-title custom-article-title"> About the community </div> <p> This is an introductory text. To be updated... </p> </div>'})
71
// 	db.htmlPageContent.save({"page" : organizations, "community" : communityID, "content" : '<div><div class="uk-article-title custom-article-title"> Organizations related to the community </div> <p> This is an introductory text. Here follows the list of organizations... </p> <div class="uk-child-width-1-3@m uk-text-center uk-grid-match " uk-grid > <div class="uk-card uk-card-default uk-margin-bottom uk-padding-remove"> <div class="uk-card-media-top"> <img src="https://upload.wikimedia.org/wikipedia/el/2/2b/Logo_uoa_blue.png" alt="" class="uk-height-small uk-responsive-height "> </div> <div class="uk-card-body"> <h3 class="uk-card-title"> <a class="wk-link-reset" href="https://www.uoa.gr/">University of Athens</a> </h3> </div> </div> <div class="uk-card uk-card-default uk-margin-bottom uk-padding-remove"> <div class="uk-card-media-top"> <img src="https://pbs.twimg.com/profile_images/631127495933165569/ElbqhHK0_400x400.jpg" alt="" class="uk-height-small uk-responsive-height "> </div> <div class="uk-card-body"> <h3 class="uk-card-title"> <a class="wk-link-reset" href="https://www.athena-innovation.gr/en">Athena Research & Innovation center</a> </h3> </div> </div> <div class="uk-card uk-card-default uk-margin-bottom uk-padding-remove"> <div class="uk-card-media-top"> <img src="" alt="Logo 1" class="uk-height-small uk-responsive-height "> </div> <div class="uk-card-body"> <h3 class="uk-card-title"> <a class="wk-link-reset" href="">Organization 1</a> </h3> </div> </div> <div class="uk-card uk-card-default uk-margin-bottom uk-padding-remove"> <div class="uk-card-media-top"> <img src="" alt="Logo 2" class="uk-height-small uk-responsive-height "> </div> <div class="uk-card-body"> <h3 class="uk-card-title"> <a class="wk-link-reset" href="">Organization 2</a> </h3> </div> </div> <div class="uk-card uk-card-default uk-margin-bottom uk-padding-remove"> <div class="uk-card-media-top"> <img src="" alt="Logo 3" class="uk-height-small uk-responsive-height "> </div> <div class="uk-card-body"> <h3 class="uk-card-title"> <a class="wk-link-reset" href="">Organization 3</a> </h3> </div> </div> </div></div>'})
72
// }
73
//
74
// function addORPInStatistics() {
75
//
76
//     communitiesStatistics = db.statistics.find().map( function(community) { return community; } );
77
//
78
// 	for (var i = 0; i < communitiesStatistics.length; i++) {
79
//
80
//         stats =communitiesStatistics[i]
81
//     print("stats " + stats.pid);
82
//         var numbers_map = {};
83
//         numbers_map["total"] = { "showInMonitor" : true, "showInDashboard" : false };
84
//         numbers_map["project"] = { "showInMonitor" : true, "showInDashboard" : false };
85
//         numbers_map["open"] = { "showInMonitor" : true, "showInDashboard" : false };
86
//         numbers_map["closed"] = { "showInMonitor" : true, "showInDashboard" : false };
87
//         numbers_map["embargo"] = { "showInMonitor" : true, "showInDashboard" : false };
88
//         numbers_map["restricted"] = { "showInMonitor" : true, "showInDashboard" : false };
89
//         var numbers = {"map":numbers_map};
90
//         var charts_map = {};
91
//         charts_map["timeline"] = { "showInMonitor" : true, "showInDashboard" : false };
92
//         charts_map["graph"] = { "showInMonitor" : true, "showInDashboard" : false };
93
//         charts_map["projectTable"] = { "showInMonitor" : true, "showInDashboard" : false };
94
//         charts_map["projectColumn"] = { "showInMonitor" : true, "showInDashboard" : false };
95
//         charts_map["projectPie"] = { "showInMonitor" : true, "showInDashboard" : false };
96
//         var charts = {"map":charts_map};
97
//
98
//         var statistics_entities = {"charts":charts,"numbers":numbers}
99
//         var orp ="orp";
100
//         stats.entities[orp]=statistics_entities;
101
//
102
//         db.statistics.update({ "pid" : stats.pid },{$set: { "entities": stats.entities}});
103
//         // db.statistics.update(stats);
104
//
105
//     }
106
// }
107
//
108
// function createShareInZenodoPage() {
109
// 	db.page.save({"name" : "Share in Zenodo", "route" : "/participate/share-zenodo", "type" : "share", "connect":true,"openaire":false,"entities" : []});
110
//     shareInZenodo = db.page.find( { route: "/participate/share-zenodo" }).map( function(page) { return page._id.str; } ).toString();
111
// 	communities = db.community.find().map( function(community) { return community; } );
112
//
113
// 	for (var i = 0; i < communities.length; i++) {
114
// 		community_pages = communities[i].pages;
115
//
116
// 		community_pages[shareInZenodo] = true;
117
//
118
// 		community_pid = communities[i].pid;
119
// 		db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
120
//         print("Update pages for " + community_pid);
121
//     }
122
// }
123
//
124 57319 k.triantaf
function addCommunityLayout() {
125
    //db.createCollection("layout");
126
    communities = db.community.find().map( function(community) { return community; } );
127
    for (var i = 0; i < communities.length; i++) {
128
        var layoutId = db.layout.insertOne({"color": "#EBB13E"}).insertedId.str;
129
        community_pid = communities[i].pid;
130
        db.community.update({ "pid" : community_pid }, {$set: {"layout": layoutId}});
131
        print("Creating layout for " + community_pid);
132
    }
133
}
134 56679 konstantin
//
135
// function addCuratorsPage() {
136
//     curatorsId = db.page.insertOne({"name" : "Curators", "route" : "/curators", "type" : "other", "connect":true,"openaire":false,"entities" : []}).insertedId.str;
137
//     print("Creating curators page with id " + curatorsId);
138
//     communities = db.community.find().map( function(community) { return community; } );
139
//     for (var i = 0; i < communities.length; i++) {
140
//         community_pages = communities[i].pages;
141
//
142
//         community_pages[curatorsId] = false;
143
//
144
//         community_pid = communities[i].pid;
145
//         db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
146
//         print("Add curators page with id " + curatorsId + " on community " + community_pid);
147
//     }
148
// }
149
//
150
// function removeMonitorPage() {
151
//     monitor = db.page.find( { route: "/monitor" }).map( function(page) { return page._id.str; } ).toString()
152
//     db.page.remove({"route" : "/monitor"});
153
//     print("Remove Monitor page with  id " + monitor);
154
//     communities = db.community.find().map( function(community) { return community; } );
155
//     for (var i = 0; i < communities.length; i++) {
156
//         community_pages = communities[i].pages;
157
//
158
//         delete community_pages[monitor];
159
//
160
//         community_pid = communities[i].pid;
161
//         db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
162
//         print("Remove monitor page with id " + monitor + " on community " + community_pid);
163
//     }
164
// }
165
//
166
// function pageOptionConnectAsCommunities() {
167
//   pages = db.page.find().map( function(page) { return page; } );
168
//   for (var i = 0; i < pages.length; i++) {
169
//     page = pages[i];
170
//
171
//     db.page.update(
172
//       { "_id" : page._id },
173
//       { $set: {"communities": page.connect, "connect": false}}
174
//     );
175
//   }
176
// }
177
//
178
// function organizationsPageTypeFromHtmlToOther() {
179
//   db.page.update(
180
//     { "route" : "/organizations" },
181
//     { $set: {"type": "other"}}
182
//   );
183
// }
184
//
185
//
186
// function removeHtmlPageContentsFromOrganizationsPage() {
187
//   organizations = db.page.find( { route: "/organizations" }).map( function(page) { return page._id.str; } ).toString();
188
//   db.htmlPageContent.remove({"page" : organizations});
189
// }
190
//
191
// function addOpenaireConnectCommunitiesOptionsInDivIds() {
192
//   db.divId.updateMany(
193
//     { },
194
//     { $set: {"connect":false,"communities":false,"openaire":true}}
195
//   );
196
// }
197
//
198
// function addHomeNewsAndOrganizationsDivIds() {
199
//   home = db.page.find( { route: "/" }).map( function(page) { return page._id.str; } ).toString();
200
//   organizations = db.page.find( { route: "/organizations" }).map( function(page) { return page._id.str; } ).toString()
201
//
202
//   db.divId.save({ "name" : "home-news", "pages" : [home], "connect":true,"communities":false,"openaire":true});
203
//   print("divId home-news saved");
204
//   db.divId.save({ "name" : "organizations", "pages" : [organizations], "connect":false,"communities":true,"openaire":false});
205
//   print("divId organizations saved");
206
//
207
//   organizations_class = db.divId.find( { name: "organizations" }).map( function(divId) { return divId._id.str; } ).toString();
208
//   organizations_class_content = '<div> <p>Here you can write more details about the organizations related to your community.</p> </div>';
209
//
210
//   communities = db.community.find().map( function(community) { return community; } );
211
//   for (var i = 0; i < communities.length; i++) {
212
//     community = communities[i];
213
//     if(community.pid != "openaire" && community.pid != "connect") {
214
//       //print(community.pid);
215
//       db.divHelpContent.save({
216
//         "divId": organizations_class,
217
//         "community": community._id.str,
218
//         "content": organizations_class_content,
219
//         "isActive": false
220
//       });
221
//     }
222
//   }
223
// }
224
//
225
// function removeLinkingDivHelpContentsForCommunitiesAndConnect() {
226
//   link_context_form = db.divId.find( { name: "link-context-form" }).map( function(divId) { return divId._id.str; } ).toString();
227
//   link_project_form = db.divId.find( { name: "link-project-form" }).map( function(divId) { return divId._id.str; } ).toString();
228
//   link_result_form = db.divId.find( { name: "link-result-form" }).map( function(divId) { return divId._id.str; } ).toString();
229
//   link_result_bulk = db.divId.find( { name: "link-result-bulk" }).map( function(divId) { return divId._id.str; } ).toString();
230
//   link_metadata = db.divId.find( { name: "link-metadata" }).map( function(divId) { return divId._id.str; } ).toString();
231
//
232
//   communities = db.community.find().map( function(community) { return community; } );
233
//   for (var i = 0; i < communities.length; i++) {
234
//     community = communities[i];
235
//     if(community.pid != "openaire") {
236
//       db.divHelpContent.remove({"divId" : link_context_form, "community" : community._id.str});
237
//       db.divHelpContent.remove({"divId" : link_project_form, "community" : community._id.str});
238
//       db.divHelpContent.remove({"divId" : link_result_form, "community" : community._id.str});
239
//       db.divHelpContent.remove({"divId" : link_result_bulk, "community" : community._id.str});
240
//       db.divHelpContent.remove({"divId" : link_metadata, "community" : community._id.str});
241
//     }
242
//   }
243
// }
244 53555 konstantin
245 56679 konstantin
function addPositionsInPages() {
246
  print("Add positions in Pages\n");
247 53555 konstantin
248 56679 konstantin
  // Other Pages
249 56770 konstantin
  db.page.update({ route: "/" },{ $set: {"top":true,"bottom":true,"right":false,"left":true}});
250 56679 konstantin
  print("Positions for 'Other Pages' updated");
251 53555 konstantin
252 56679 konstantin
  // Other Pages for Connect
253
  db.page.update({ route: "/about/learn-how" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
254
  db.page.update({ route: "/about/learn-in-depth" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
255
  db.page.update({ route: "/contact-us" },{ $set: {"top":false,"bottom":false,"right":true,"left":false}});
256
  db.page.update({ route: "/content" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
257 53555 konstantin
258 56679 konstantin
  db.page.update({ route: "/curators" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
259
  db.page.update({ route: "/organizations" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
260
  db.page.update({ route : "/invite" }, { $set: {"top":true,"bottom":false,"right":false,"left":false}});
261
  print("Positions for 'Other Pages for Connect' updated");
262 53555 konstantin
263 56679 konstantin
  // Testing Page for help contents (Connect)
264
  db.page.update({ route : "/helper-test"}, { $set: {"top":true,"bottom":false,"right":false,"left":false}});
265
  print("Positions for 'Testing Page for help contents (Connect)' updated");
266 53564 argiro.kok
267 56679 konstantin
  // Other Pages for Explore
268
  db.page.update({ route: "/mail-preferences" },{ $set: {"top":true,"bottom":true,"right":true,"left":true}});
269
  print("Positions for 'Other Pages for Explore' updated");
270 53594 konstantin
271 56679 konstantin
  // Landing Pages
272
  db.page.update({ route: "/search/publication" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
273
  db.page.update({ route: "/search/dataset" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
274
  db.page.update({ route: "/search/software" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
275
  db.page.update({ route: "/search/other" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
276
  db.page.update({ route: "/search/project" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
277
  db.page.update({ route: "/search/organization" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
278
  db.page.update({ route: "/search/dataprovider" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
279 53594 konstantin
280 56679 konstantin
  db.page.update({ route: "/project-report" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
281
  print("Positions for 'Landing Pages' updated");
282 53564 argiro.kok
283 56679 konstantin
  // Search Pages
284
  db.page.update({ route: "/search/find" },{ $set: {"top":false,"bottom":false,"right":false,"left":false}});
285 53564 argiro.kok
286 56679 konstantin
  db.page.update({ route: "/search/find/communities" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
287 53564 argiro.kok
288 56679 konstantin
  db.page.update({ route: "/search/find/publications" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
289
  db.page.update({ route: "/search/find/datasets" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
290
  db.page.update({ route: "/search/find/software" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
291
  db.page.update({ route: "/search/find/other" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
292
  db.page.update({ route: "/search/find/projects" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
293
  db.page.update({ route: "/search/find/organizations" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
294
  db.page.update({ route: "/search/find/dataproviders" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
295
  print("Positions for 'Search Pages' updated");
296 53564 argiro.kok
297 56679 konstantin
  // Advanced Search Pages
298
  db.page.update({ route: "/search/advanced/publications" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
299
  db.page.update({ route: "/search/advanced/datasets" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
300
  db.page.update({ route: "/search/advanced/software" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
301
  db.page.update({ route: "/search/advanced/other" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
302
  db.page.update({ route: "/search/advanced/projects" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
303
  db.page.update({ route: "/search/advanced/organizations" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
304
  db.page.update({ route: "/search/advanced/dataproviders" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
305
  print("Positions for 'Advanced Search Pages' updated");
306 53564 argiro.kok
307 56679 konstantin
  // Search Content Provider Pages
308
  db.page.update({ route: "/search/journals" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
309
  db.page.update({ route: "/search/entity-registries" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
310
  db.page.update({ route: "/search/content-providers" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
311
  db.page.update({ route: "/search/journals-table" },{ $set: {"top":false,"bottom":false,"right":false,"left":false}});
312
  db.page.update({ route: "/search/entity-registries-table" },{ $set: {"top":false,"bottom":false,"right":false,"left":false}});
313
  db.page.update({ route: "/search/content-providers-table" },{ $set: {"top":false,"bottom":false,"right":false,"left":false}});
314
  print("Positions for 'Search Content Providers Pages' updated");
315 53564 argiro.kok
316 56679 konstantin
  // Deposit Pages
317
  db.page.update({ route: "/participate/deposit-publications" },{ $set: {"top":false,"bottom":false,"right":false,"left":false}});
318
  db.page.update({ route: "/participate/deposit-datasets" },{ $set: {"top":false,"bottom":false,"right":false,"left":false}});
319
  db.page.update({ route: "/participate/deposit-publications-result" },{ $set: {"top":false,"bottom":false,"right":false,"left":false}});
320
  db.page.update({ route: "/participate/deposit-datasets-result" },{ $set: {"top":false,"bottom":false,"right":false,"left":false}});
321
  db.page.update({ route: "/participate/deposit-subject-result" },{ $set: {"top":false,"bottom":false,"right":false,"left":false}});
322 56791 konstantin
  db.page.update({ route: "/participate/deposit/zenodo" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
323 56679 konstantin
  db.page.update({ route: "/participate/deposit/learn-how" },{ $set: {"top":false,"bottom":true,"right":false,"left":false}});
324
  db.page.update({ route: "/participate/deposit-search" },{ $set: {"top":true,"bottom":false,"right":false,"left":false}});
325
  print("Positions for 'Deposit Pages' updated");
326
327
  // Linking Pages
328 56770 konstantin
  db.page.update({ route: "/participate/claim" },{ $set: {"top":false,"bottom":true,"right":false,"left":false}});
329
  db.page.update({ route: "/participate/direct-claim" },{ $set: {"top":false,"bottom":true,"right":false,"left":false}});
330
  db.page.update({ route: "/myclaims" },{ $set: {"top":true,"bottom":true,"right":true,"left":false}});
331
  db.page.update({ route: "/claims" },{ $set: {"top":true,"bottom":true,"right":true,"left":false}});
332 56679 konstantin
  db.page.update({ route: "/claims-project-manager" },{ $set: {"top":false,"bottom":false,"right":false,"left":false}});
333
  print("Positions for 'Linking Pages' updated");
334 53564 argiro.kok
}
335
336 56679 konstantin
function addMissingAndNewPages() {
337
  print("Add missing and new Pages\n");
338 53936 konstantin
339 56679 konstantin
  db.page.save({"name" : "Search Communities", "route" : "/search/find/communities", "type" : "search", "connect":true,"communities":false,"openaire":false,"entities" : [], "top":true,"bottom":false,"right":false,"left":false});
340 53936 konstantin
341 56679 konstantin
  db.page.save({"name" : "Deposit your research - Learn How", "route" : "/participate/deposit/learn-how", "type" : "share", "connect":false,"communities":true,"openaire":false,"entities" : [], "top":true,"bottom":true,"right":true,"left":true});
342
  db.page.save({"name" : "Deposit Browse & Search repositories", "route" : "/participate/deposit/search", "type" : "share", "connect":false,"communities":true,"openaire":false,"entities" : [], "top":true,"bottom":true,"right":true,"left":true});
343 53936 konstantin
344 56679 konstantin
  db.page.save({"name" : "About - Learn in depth", "route" : "/about/learn-in-depth", "type" : "other", "connect":true,"communities":false,"openaire":false,"entities" : [], "top":true,"bottom":true,"right":true,"left":true});
345
  db.page.save({"name" : "Contact us", "route" : "/contact-us", "type" : "other", "connect":true,"communities":false,"openaire":false,"entities" : [], "top":true,"bottom":true,"right":true,"left":true});
346 53936 konstantin
347 56679 konstantin
  db.page.save({"name" : "Content Policy", "route" : "/content", "type" : "other", "connect":true,"communities":false,"openaire":false,"entities" : [], "top":true,"bottom":true,"right":true,"left":true});
348 55027 k.triantaf
349 56679 konstantin
  db.page.save({"name" : "Invite", "route" : "/invite", "type" : "other", "connect":false,"communities":true,"openaire":false,"entities" : [], "top":true,"bottom":true,"right":false,"left":false});
350 56039 k.triantaf
351 56679 konstantin
  db.page.save({"name" : "Mail Preferences", "route" : "/mail-preferences", "type" : "other", "connect":false,"communities":false,"openaire":true,"entities" : [], "top":true,"bottom":true,"right":true,"left":true});
352 56039 k.triantaf
353 56679 konstantin
  // Testing Page for help contents (Connect)
354 56790 konstantin
  db.page.save({"name" : "Helper Test", "route" : "/helper-test", "type" : "other", "connect":true, "communities": false, "openaire": false, "entities": [], "top": true, "bottom": false, "left": false, "right": false});
355 56039 k.triantaf
}
356
357 56788 konstantin
function addNewRoutesInCommunities() {
358
  searchCommunities = db.page.find( { route: "/search/find/communities" }).map( function(page) { return page._id.str; } ).toString()
359
360
  depositLearnHow = db.page.find( { route: "/participate/deposit/learn-how" }).map( function(page) { return page._id.str; } ).toString();
361
  depositSearch = db.page.find( { route: "/participate/deposit/search" }).map( function(page) { return page._id.str; } ).toString();
362
363
  about = db.page.find( { route: "/about/learn-how" }).map( function(page) { return page._id.str; } ).toString()
364
  aboutLearnInDepth = db.page.find( { route: "/about/learn-in-depth" }).map( function(page) { return page._id.str; } ).toString()
365
366
  contactUs = db.page.find( { route: "/contact-us" }).map( function(page) { return page._id.str; } ).toString()
367
  contentPolicy = db.page.find( { route: "/content" }).map( function(page) { return page._id.str; } ).toString()
368
  invite = db.page.find( { route: "/invite" }).map( function(page) { return page._id.str; } ).toString()
369
  helperTest = db.page.find( { route: "/helper-test" }).map( function(page) { return page._id.str; } ).toString()
370
  mailPreferences = db.page.find( { route: "/mail-preferences" }).map( function(page) { return page._id.str; } ).toString()
371
372
  communities = db.community.find().map( function(community) { return community; } );
373
374
	for (var i = 0; i < communities.length; i++) {
375
		community_pages = communities[i].pages;
376
377
		community_pages[searchCommunities] = true;
378
		community_pages[depositLearnHow] = true;
379
		community_pages[depositSearch] = true;
380
    community_pages[about] = true;
381
    community_pages[aboutLearnInDepth] = true;
382
    community_pages[contactUs] = true;
383
    community_pages[contentPolicy] = true;
384
    community_pages[invite] = true;
385
    community_pages[helperTest] = true;
386
    community_pages[mailPreferences] = true;
387
388
		community_pid = communities[i].pid;
389
		db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
390
		print("Update pages for " + community_pid);
391
	}
392
}
393
394 56679 konstantin
function changePageRoutesAboutAndZenodo() {
395
  print("change Page Routes '/about' and '/participate/share-zenodo'\n");
396 56090 k.triantaf
397 56788 konstantin
  db.page.update({ route: "/about" },{ $set: {"route": "/about/learn-how", "name" : "About - Learn How", "type" : "other", "connect":true,"communities":false }});
398 56679 konstantin
  db.page.update({ route: "/participate/share-zenodo" },{ $set: {"route": "/participate/deposit/zenodo"}});
399 56090 k.triantaf
}
400
401 56679 konstantin
function enableProjectReportPageInCommunities() {
402
    print("Enable project report page in communities \n");
403 56174 konstantin
404 56679 konstantin
  db.page.update({ route : "/project-report" },{ $set: {"communities": true}});
405 56174 konstantin
}
406
407 56679 konstantin
function addDepositPoliciesHelpContentInAllCommunities() {
408
    print("add deposit policies in help content in all communitites except 'openaire' and 'connect' in Deposit-Learn How page\n");
409 56293 konstantin
410 56679 konstantin
  deposit_first_page = db.page.find( { route: "/participate/deposit/learn-how" }).map( function(page) { return page._id.str; } ).toString();
411
  deposit_first_page_content = "" +
412
    "<div class=\"uk-width-3-5 uk-align-center\"> " +
413
    " <div class=\"uk-text-bold\">How to comply with funder Open Access policies</div> " +
414
    " <ul class=\"uk-list uk-list-bullet\"> " +
415
    "   <li>Read the <a class=\"custom-external\" href=\"https://www.openaire.eu/how-to-comply-to-h2020-mandates-for-publications\" target=\"_blank\"> OpenAIRE guide to learn how to comply with EC H2020 Open Access policy on publications </a></li> " +
416
    "   <li>Read the <a class=\"custom-external\" href=\"https://www.openaire.eu/how-to-comply-to-h2020-mandates-for-data\" target=\"_blank\"> OpenAIRE guide to learn how to comply with EC H2020 Open Access policy on research data </a></li> " +
417
    "   <li>If you want to know about National Open Access policies, please check them out <a class=\"custom-external\" href=\"https://www.openaire.eu/frontpage/country-pages\" target=\"_blank\">here</a></li> " +
418
    "   <li>All OpenAIRE guides can be found <a class=\"custom-external\" href=\"https://www.openaire.eu/guides\" target=\"_blank\">here</a></li> " +
419
    " </ul> " +
420
    "</div>";
421 56293 konstantin
422 56679 konstantin
  communities = db.community.find().map( function(community) { return community; } );
423
  for (var i = 0; i < communities.length; i++) {
424
    community = communities[i];
425
    if (community.pid != "connect" && community.pid != "openaire") {
426
      db.pageHelpContent.save({
427
        "page" : deposit_first_page,
428
        "community" : community._id.str,
429
        "placement" : "bottom",
430
        "order" : 1,
431
        "content" : deposit_first_page_content,
432
        "isActive" : true,
433
        "isPriorTo" : false
434
      });
435 56293 konstantin
436 56679 konstantin
    }
437
  }
438 56293 konstantin
}
439
440 56679 konstantin
function moveOrganizationsDivHelpContentsToPageHelpContents() {
441
  print("move organizations div help contents to page help contents for all communities\n ");
442 56293 konstantin
443 56679 konstantin
  organizations_page = db.page.find( { route: "/organizations" }).map( function(page) { return page._id.str; } ).toString();
444 56293 konstantin
445 56679 konstantin
  organizations_divId = db.divId.find( { name: "organizations" }).map( function(divId) { return divId._id.str; } ).toString();
446
  print("organizations divId: "+organizations_divId);
447 56293 konstantin
448 56679 konstantin
  communities = db.community.find().map(function (community) {
449
    return community;
450
  });
451 56293 konstantin
  for (var i = 0; i < communities.length; i++) {
452
    community = communities[i];
453 56679 konstantin
    print("community pid: "+community.pid);
454
455
    divHelpContents = db.divHelpContent.find({"community": community._id.str, "divId": organizations_divId}).map(function (divHelpContent) {
456
      return divHelpContent;
457
    });
458
459
    for (var j = 0; j < divHelpContents.length; j++) {
460
      divHelpContent = divHelpContents[j];
461
462
      db.pageHelpContent.save({
463
        "page": organizations_page,
464 56293 konstantin
        "community": community._id.str,
465 56679 konstantin
        "placement": "top",
466
        "order": j+1,
467
        "content": divHelpContent.content,
468
        "isActive": divHelpContent.isActive,
469
        "isPriorTo": false
470 56293 konstantin
      });
471 56679 konstantin
472
      db.divHelpContent.remove({"_id" : divHelpContent._id});
473 56293 konstantin
    }
474
  }
475
}
476
477 56679 konstantin
function deleteHomeDivHelpContents() {
478
    print("delete div help contents for divId 'home-news'\n");
479 56293 konstantin
480 56679 konstantin
  home_divId = db.divId.find( { name: "home-news" }).map( function(divId) { return divId._id.str; } ).toString();
481
  connect_communityId = db.community.find( { pid: "connect" }).map( function(community) { return community._id.str; } ).toString();
482
483
  divHelpContents = db.divHelpContent.find({"community": connect_communityId, "divId": home_divId}).map(function (divHelpContent) {
484
    return divHelpContent;
485
  });
486
487
  for (var i = 0; i < divHelpContents.length; i++) {
488
    divHelpContent = divHelpContents[i]
489
490
    db.divHelpContent.remove({"_id" : divHelpContent._id});
491 56293 konstantin
  }
492
}
493
494 56679 konstantin
function deleteHomeAndOrganizationsDivIds() {
495
  print("delete 'home-news' and 'organizations' divIds\n");
496 55029 k.triantaf
497 56679 konstantin
  db.divId.remove({"name" : "home-news"});
498
  db.divId.remove({"name" : "organizations"});
499
}
500
501 56785 konstantin
function addHelpTextsInHomePage() {
502
  print("add help contents in Home Page for community connect\n");
503
504
  communityID = db.community.find( { pid: "connect" }).map( function(community) { return community._id.str; } ).toString();
505
  home_page = db.page.find( { route: "/" }).map( function(page) { return page._id.str; } ).toString();
506
507
  bottom_1_content = "<div>Home news section</div>";
508
509
  db.pageHelpContent.save({
510
    "page" : home_page,
511
    "community" : communityID,
512
    "placement" : "bottom",
513
    "order" : 1,
514
    "content" : bottom_1_content,
515
    "isActive" : false,
516
    "isPriorTo" : false
517
  });
518
519
  bottom_2_content = "<div style=\"background-color: #CFDEF1;\"\n" +
520
    "     class=\"uk-background-norepeat uk-background-cover uk-section-overlap uk-position-relative uk-preserve-color uk-margin-large-top\">\n" +
521
    "  <div class=\"uk-container uk-container-large uk-section\">\n" +
522
    "    <div class=\"uk-flex uk-flex-middle uk-padding uk-grid\" uk-grid=\"\">\n" +
523
    "      <div class=\"uk-text-center uk-width-1-1@s uk-width-1-3@m uk-first-column\"><img src=\"assets/connect-assets/contact/1.png\"\n" +
524
    "                                                                                     width=\"237\" height=\"250\"></div>\n" +
525
    "      <div class=\"uk-width-expand\">\n" +
526
    "        <div class=\"uk-text-bold uk-h4\">\n" +
527
    "          <div>Let us help you develop a collaborative Open Science Gateway for your community. It is fast. It is\n" +
528
    "            reliable.\n" +
529
    "          </div>\n" +
530
    "        </div>\n" +
531
    "        <div class=\"uk-margin-medium\">Get in touch with our team to find out how.</div>\n" +
532
    "        <div class=\"uk-inline\"><a class=\"uk-button portal-button\" routerlink=\"/contact-us\"\n" +
533
    "                                  routerlinkactive=\"router-link-active\" ng-reflect-router-link=\"/contact-us\"\n" +
534
    "                                  ng-reflect-router-link-active=\"router-link-active\" href=\"/contact-us\"> CONTACT\n" +
535
    "          US</a>\n" +
536
    "        </div>\n" +
537
    "      </div>\n" +
538
    "    </div>\n" +
539
    "  </div>\n" +
540
    "</div>\n";
541
542
  db.pageHelpContent.save({
543
    "page" : home_page,
544
    "community" : communityID,
545
    "placement" : "bottom",
546
    "order" : 2,
547
    "content" : bottom_2_content,
548
    "isActive" : true,
549
    "isPriorTo" : false
550
  });
551
552
  left_content = "<div style=\"background-image: url('assets/connect-assets/home/banner.jpg') !important;\"\n" +
553
    "     class=\"uk-section uk-background-norepeat uk-background-bottom-center uk-background-cover uk-section-overlap uk-position-relative uk-preserve-color\">\n" +
554
    "  <div class=\" uk-section uk-padding-remove-bottom\">\n" +
555
    "    <div class=\"uk-position-cover\"></div>\n" +
556
    "    <div class=\"uk-position-relative uk-panel\">\n" +
557
    "      <div class=\"uk-container uk-container-large uk-section\">\n" +
558
    "        <div class=\"uk-grid\">\n" +
559
    "          <div class=\"uk-width-1-2@m uk-width-1-1@s\">\n" +
560
    "            <div class=\"uk-h1\">Build an Open Research <b>Gateway</b> for your <b>Community</b></div>\n" +
561
    "            <h4 class=\"uk-margin-remove-top\">Turn Open Science into practice</h4>\n" +
562
    "            <div class=\"uk-h5 uk-margin-top\">Share and link your research results.<br> Across organizations, across\n" +
563
    "              borders.<br>Customized to your needs.\n" +
564
    "            </div>\n" +
565
    "          </div>\n" +
566
    "          <div class=\"uk-width-1-1 uk-inline uk-margin-medium-top uk-margin-medium-bottom\"><a\n" +
567
    "            class=\"uk-button portal-button\" routerlink=\"/about/learn-how\" routerlinkactive=\"router-link-active\"\n" +
568
    "            ng-reflect-router-link=\"/about/learn-how\" ng-reflect-router-link-active=\"router-link-active\"\n" +
569
    "            href=\"/about/learn-how\"> LEARN HOW</a></div>\n" +
570
    "        </div>\n" +
571
    "      </div>\n" +
572
    "    </div>\n" +
573
    "  </div>\n" +
574
    "</div>\n";
575
576
  db.pageHelpContent.save({
577
    "page" : home_page,
578
    "community" : communityID,
579
    "placement" : "left",
580
    "order" : 1,
581
    "content" : left_content,
582
    "isActive" : true,
583
    "isPriorTo" : false
584
  });
585
586
  top_1_content = "<div class=\"uk-container uk-container-large uk-margin-medium-top\">\n" +
587
    "  <div class=\"uk-text-center uk-text-bold uk-h4\">Open and FAIR science is our mission</div>\n" +
588
    "  <div class=\"uk-margin-medium-top\">\n" +
589
    "    <div class=\"uk-child-width-1-3@m uk-child-width-1-1@s uk-grid-match uk-grid-medium uk-grid-margin uk-grid\"\n" +
590
    "         uk-grid=\"\"\n" +
591
    "         uk-height-match=\".target\">\n" +
592
    "      <div class=\"uk-first-column\">\n" +
593
    "        <div class=\"uk-card uk-card-default uk-padding-small connectInfoCard\">\n" +
594
    "          <div class=\"uk-card-media-top uk-flex uk-flex-middle uk-flex-center\">\n" +
595
    "            <div class=\"target\" style=\"min-height: 108.1px;\"><img src=\"assets/connect-assets/home/1.png\" width=\"100\" height=\"89\"></div>\n" +
596
    "          </div>\n" +
597
    "          <div class=\"uk-card-body uk-padding-remove-horizontal uk-padding-remove-bottom\">\n" +
598
    "            <div class=\"target\" style=\"min-height: 137.6px;\"><h5 class=\"uk-text-bold uk-text-center\">A Virtual Research\n" +
599
    "              Environment</h5>\n" +
600
    "              <div>An overlay platform making it easy to share, link, disseminate and monitor all your publications,\n" +
601
    "                data,\n" +
602
    "                software, methods. In one place.\n" +
603
    "              </div>\n" +
604
    "            </div>\n" +
605
    "            <hr>\n" +
606
    "            <div>\n" +
607
    "              <div class=\"uk-text-uppercase text-center\">Features</div>\n" +
608
    "              <ul class=\"uk-list\">\n" +
609
    "                <li><div\n" +
610
    "                  class=\"uk-border-circle uk-icon-button icon-button-small portal-icon-button uk-margin-small-right uk-icon\"\n" +
611
    "                  uk-icon=\"check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"\n" +
612
    "                                       data-svg=\"check\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\"\n" +
613
    "                                                                  points=\"4,10 8,15 17,4\"></polyline></svg></div>\n" +
614
    "                  Access\n" +
615
    "                  to OpenAIRE resources\n" +
616
    "                </li>\n" +
617
    "                <li><div\n" +
618
    "                  class=\"uk-border-circle uk-icon-button icon-button-small portal-icon-button uk-margin-small-right uk-icon\"\n" +
619
    "                  uk-icon=\"check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"\n" +
620
    "                                       data-svg=\"check\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\"\n" +
621
    "                                                                  points=\"4,10 8,15 17,4\"></polyline></svg></div>\n" +
622
    "                  Moderated, front-end linking\n" +
623
    "                </li>\n" +
624
    "                <li><div\n" +
625
    "                  class=\"uk-border-circle uk-icon-button icon-button-small portal-icon-button uk-margin-small-right uk-icon\"\n" +
626
    "                  uk-icon=\"check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"\n" +
627
    "                                       data-svg=\"check\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\"\n" +
628
    "                                                                  points=\"4,10 8,15 17,4\"></polyline></svg></div>\n" +
629
    "                  Cross-platform search\n" +
630
    "                </li>\n" +
631
    "              </ul>\n" +
632
    "            </div>\n" +
633
    "          </div>\n" +
634
    "        </div>\n" +
635
    "      </div>\n" +
636
    "      <div>\n" +
637
    "        <div class=\"uk-card uk-card-default uk-padding-small connectInfoCard\">\n" +
638
    "          <div class=\"uk-card-media-top uk-flex uk-flex-middle uk-flex-center\">\n" +
639
    "            <div class=\"target\"><img src=\"assets/connect-assets/home/2.png\" width=\"100\" height=\"108\"></div>\n" +
640
    "          </div>\n" +
641
    "          <div class=\"uk-card-body uk-padding-remove-horizontal uk-padding-remove-bottom\">\n" +
642
    "            <div class=\"target\" style=\"min-height: 137.6px;\"><h5 class=\"uk-text-bold uk-text-center\">Open Science in\n" +
643
    "              action</h5>\n" +
644
    "              <div>A time-saving bundle of services for researchers to effortlessly practice open science. An integral\n" +
645
    "                part of the European Open Science Cloud.\n" +
646
    "              </div>\n" +
647
    "            </div>\n" +
648
    "            <hr>\n" +
649
    "            <div>\n" +
650
    "              <div class=\"uk-text-uppercase text-center\">Features</div>\n" +
651
    "              <ul class=\"uk-list\">\n" +
652
    "                <li><div\n" +
653
    "                  class=\"uk-border-circle uk-icon-button icon-button-small portal-icon-button uk-margin-small-right uk-icon\"\n" +
654
    "                  uk-icon=\"check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"\n" +
655
    "                                       data-svg=\"check\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\"\n" +
656
    "                                                                  points=\"4,10 8,15 17,4\"></polyline></svg></div> Use\n" +
657
    "                  of\n" +
658
    "                  OpenAIRE Guidelines\n" +
659
    "                </li>\n" +
660
    "                <li><div\n" +
661
    "                  class=\"uk-border-circle uk-icon-button icon-button-small portal-icon-button uk-margin-small-right uk-icon\"\n" +
662
    "                  uk-icon=\"check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"\n" +
663
    "                                       data-svg=\"check\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\"\n" +
664
    "                                                                  points=\"4,10 8,15 17,4\"></polyline></svg></div> DOIs\n" +
665
    "                  via Zenodo\n" +
666
    "                </li>\n" +
667
    "                <li><div\n" +
668
    "                  class=\"uk-border-circle uk-icon-button icon-button-small portal-icon-button uk-margin-small-right uk-icon\"\n" +
669
    "                  uk-icon=\"check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"\n" +
670
    "                                       data-svg=\"check\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\"\n" +
671
    "                                                                  points=\"4,10 8,15 17,4\"></polyline></svg></div> EOSC\n" +
672
    "                  Single Sign-On\n" +
673
    "                </li>\n" +
674
    "              </ul>\n" +
675
    "            </div>\n" +
676
    "          </div>\n" +
677
    "        </div>\n" +
678
    "      </div>\n" +
679
    "      <div>\n" +
680
    "        <div class=\"uk-card uk-card-default uk-padding-small connectInfoCard\">\n" +
681
    "          <div class=\"uk-card-media-top uk-flex uk-flex-middle uk-flex-center\">\n" +
682
    "            <div class=\"target\" style=\"min-height: 108.1px;\"><img src=\"assets/connect-assets/home/3.png\" width=\"120\" height=\"104\">\n" +
683
    "            </div>\n" +
684
    "          </div>\n" +
685
    "          <div class=\"uk-card-body uk-padding-remove-horizontal uk-padding-remove-bottom\">\n" +
686
    "            <div class=\"target\"><h5 class=\"uk-text-bold uk-text-center\">Customized to your needs</h5>\n" +
687
    "              <div>A Science Gateway with your own brand, rules for aggregation, text &amp; data mining, and\n" +
688
    "                presentation.\n" +
689
    "                Run by you via a simple, yet powerful backend administration tool.\n" +
690
    "              </div>\n" +
691
    "            </div>\n" +
692
    "            <hr>\n" +
693
    "            <div>\n" +
694
    "              <div class=\"uk-text-uppercase text-center\">Features</div>\n" +
695
    "              <ul class=\"uk-list\">\n" +
696
    "                <li><div\n" +
697
    "                  class=\"uk-border-circle uk-icon-button icon-button-small portal-icon-button uk-margin-small-right uk-icon\"\n" +
698
    "                  uk-icon=\"check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"\n" +
699
    "                                       data-svg=\"check\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\"\n" +
700
    "                                                                  points=\"4,10 8,15 17,4\"></polyline></svg></div>\n" +
701
    "                  Access\n" +
702
    "                  control\n" +
703
    "                </li>\n" +
704
    "                <li><div\n" +
705
    "                  class=\"uk-border-circle uk-icon-button icon-button-small portal-icon-button uk-margin-small-right uk-icon\"\n" +
706
    "                  uk-icon=\"check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"\n" +
707
    "                                       data-svg=\"check\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\"\n" +
708
    "                                                                  points=\"4,10 8,15 17,4\"></polyline></svg></div>\n" +
709
    "                  Analytics: rich set of indicators\n" +
710
    "                </li>\n" +
711
    "                <li><div\n" +
712
    "                  class=\"uk-border-circle uk-icon-button icon-button-small portal-icon-button uk-margin-small-right uk-icon\"\n" +
713
    "                  uk-icon=\"check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"\n" +
714
    "                                       data-svg=\"check\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\"\n" +
715
    "                                                                  points=\"4,10 8,15 17,4\"></polyline></svg></div> Look\n" +
716
    "                  &amp; feel to match your brand\n" +
717
    "                </li>\n" +
718
    "              </ul>\n" +
719
    "            </div>\n" +
720
    "          </div>\n" +
721
    "        </div>\n" +
722
    "      </div>\n" +
723
    "    </div>\n" +
724
    "  </div>\n" +
725
    "</div>\n";
726
727
  db.pageHelpContent.save({
728
    "page" : home_page,
729
    "community" : communityID,
730
    "placement" : "top",
731
    "order" : 1,
732
    "content" : top_1_content,
733
    "isActive" : true,
734
    "isPriorTo" : false
735
  });
736
737
  top_2_content = "<div style=\"background-image: url('assets/connect-assets/home/background.png') !important;\"\n" +
738
    "     class=\"uk-margin-large-top uk-section uk-background-norepeat uk-background-top-center uk-background-cover uk-section-overlap uk-position-relative uk-preserve-color\">\n" +
739
    "  <div class=\"uk-container uk-container-large\">\n" +
740
    "    <div tabindex=\"-1\" uk-slider=\"velocity: 0;autoplay: true;autoplay-interval: 4000;pause-on-hover: false;center: true\"\n" +
741
    "         class=\"uk-slider\">\n" +
742
    "      <div class=\"uk-slider-container\">\n" +
743
    "        <ul class=\"uk-slider-items uk-child-width-1-1\" style=\"transform: translateX(-1300px);\">\n" +
744
    "          <li class=\"ng-star-inserted uk-active\" tabindex=\"-1\" style=\"order: 1;\">\n" +
745
    "            <div class=\"uk-flex uk-padding uk-child-width-1-2@m uk-child-width-1-1@s uk-grid\" uk-grid=\"\">\n" +
746
    "              <div class=\"uk-first-column\"><img class=\"uk-box-shadow-large uk-border-rounded\"\n" +
747
    "                                                src=\"assets/connect-assets/home/gifs/deposit.gif\"></div>\n" +
748
    "              <div class=\"uk-margin-top\">\n" +
749
    "                <div>\n" +
750
    "                  <div class=\"uk-text-bold uk-h4\">Find a repository to deposit your research outcome</div>\n" +
751
    "                  <div class=\"uk-margin-medium\"> This is OpenAIRE’s key service for research communities, both\n" +
752
    "                    established and emerging ones. Our service helps you reach out and engage all your researchers to\n" +
753
    "                    practice open science out-of-the-box.\n" +
754
    "                  </div>\n" +
755
    "                  <div class=\"uk-inline\"><a class=\"uk-button portal-button uk-text-uppercase\"\n" +
756
    "                                            routerlinkactive=\"router-link-active\"\n" +
757
    "                                            ng-reflect-router-link=\"/about/learn-how\"\n" +
758
    "                                            ng-reflect-router-link-active=\"router-link-active\"\n" +
759
    "                                            href=\"/about/learn-how\">learn more</a></div>\n" +
760
    "                </div>\n" +
761
    "              </div>\n" +
762
    "            </div>\n" +
763
    "          </li>\n" +
764
    "          <li tabindex=\"-1\" style=\"order: 1;\">\n" +
765
    "            <div class=\"uk-flex uk-padding uk-child-width-1-2@m uk-child-width-1-1@s uk-grid\" uk-grid=\"\">\n" +
766
    "              <div class=\"uk-first-column\"><img class=\"uk-box-shadow-large uk-border-rounded\"\n" +
767
    "                                                src=\"assets/connect-assets/home/gifs/link.gif\"></div>\n" +
768
    "              <div class=\"uk-margin-top\">\n" +
769
    "                <div>\n" +
770
    "                  <div class=\"uk-text-bold uk-h4\">Link your research output with your community, funding, and other\n" +
771
    "                    research products\n" +
772
    "                  </div>\n" +
773
    "                  <div class=\"uk-margin-medium\"> This is OpenAIRE’s key service for research communities, both\n" +
774
    "                    established and emerging ones. Our service helps you reach out and engage all your researchers to\n" +
775
    "                    practice open science out-of-the-box.\n" +
776
    "                  </div>\n" +
777
    "                  <div class=\"uk-inline\"><a class=\"uk-button portal-button uk-text-uppercase\"\n" +
778
    "                                            routerlinkactive=\"router-link-active\"\n" +
779
    "                                            ng-reflect-router-link=\"/about/learn-how\"\n" +
780
    "                                            ng-reflect-router-link-active=\"router-link-active\"\n" +
781
    "                                            href=\"/about/learn-how\">learn more</a></div>\n" +
782
    "                </div>\n" +
783
    "              </div>\n" +
784
    "            </div>\n" +
785
    "          </li>\n" +
786
    "          <li tabindex=\"-1\" style=\"order: 1;\">\n" +
787
    "            <div class=\"uk-flex uk-padding uk-child-width-1-2@m uk-child-width-1-1@s uk-grid\" uk-grid=\"\">\n" +
788
    "              <div class=\"uk-first-column\"><img class=\"uk-box-shadow-large uk-border-rounded\"\n" +
789
    "                                                src=\"assets/connect-assets/home/gifs/overview.gif\"></div>\n" +
790
    "              <div class=\"uk-margin-top\">\n" +
791
    "                <div>\n" +
792
    "                  <div class=\"uk-text-bold uk-h4\">View community's overview at a glance</div>\n" +
793
    "                  <div class=\"uk-margin-medium\"> This is OpenAIRE’s key service for research communities, both\n" +
794
    "                    established and emerging ones. Our service helps you reach out and engage all your researchers to\n" +
795
    "                    practice open science out-of-the-box.\n" +
796
    "                  </div>\n" +
797
    "                  <div class=\"uk-inline\"><a class=\"uk-button portal-button uk-text-uppercase\"\n" +
798
    "                                            routerlinkactive=\"router-link-active\"\n" +
799
    "                                            ng-reflect-router-link=\"/about/learn-how\"\n" +
800
    "                                            ng-reflect-router-link-active=\"router-link-active\"\n" +
801
    "                                            href=\"/about/learn-how\">learn more</a></div>\n" +
802
    "                </div>\n" +
803
    "              </div>\n" +
804
    "            </div>\n" +
805
    "          </li>\n" +
806
    "          <li tabindex=\"-1\" style=\"order: 1;\">\n" +
807
    "            <div class=\"uk-flex uk-padding uk-child-width-1-2@m uk-child-width-1-1@s uk-grid\" uk-grid=\"\">\n" +
808
    "              <div class=\"uk-first-column\"><img class=\"uk-box-shadow-large uk-border-rounded\"\n" +
809
    "                                                src=\"assets/connect-assets/home/gifs/results.gif\"></div>\n" +
810
    "              <div class=\"uk-margin-top\">\n" +
811
    "                <div>\n" +
812
    "                  <div class=\"uk-text-bold uk-h4\">Search &amp; browse your community's research products.</div>\n" +
813
    "                  <div class=\"uk-margin-medium\"> This is OpenAIRE’s key service for research communities, both\n" +
814
    "                    established and emerging ones. Our service helps you reach out and engage all your researchers to\n" +
815
    "                    practice open science out-of-the-box.\n" +
816
    "                  </div>\n" +
817
    "                  <div class=\"uk-inline\"><a class=\"uk-button portal-button uk-text-uppercase\"\n" +
818
    "                                            routerlinkactive=\"router-link-active\"\n" +
819
    "                                            ng-reflect-router-link=\"/about/learn-how\"\n" +
820
    "                                            ng-reflect-router-link-active=\"router-link-active\"\n" +
821
    "                                            href=\"/about/learn-how\">learn more</a></div>\n" +
822
    "                </div>\n" +
823
    "              </div>\n" +
824
    "            </div>\n" +
825
    "          </li>\n" +
826
    "          <li tabindex=\"-1\">\n" +
827
    "            <div class=\"uk-flex uk-padding uk-child-width-1-2@m uk-child-width-1-1@s uk-grid\" uk-grid=\"\">\n" +
828
    "              <div class=\"uk-first-column\"><img class=\"uk-box-shadow-large uk-border-rounded\"\n" +
829
    "                                                src=\"assets/connect-assets/home/gifs/graph-analysis.gif\"></div>\n" +
830
    "              <div class=\"uk-margin-top\" ng-reflect-klass=\"uk-margin-top\" ng-reflect-ng-class=\"\">\n" +
831
    "                <div>\n" +
832
    "                  <div class=\"uk-text-bold uk-h4\">View statistics for your community's research products.</div>\n" +
833
    "                  <div class=\"uk-margin-medium\"> This is OpenAIRE’s key service for research communities, both\n" +
834
    "                    established and emerging ones. Our service helps you reach out and engage all your researchers to\n" +
835
    "                    practice open science out-of-the-box.\n" +
836
    "                  </div>\n" +
837
    "                  <div class=\"uk-inline\"><a class=\"uk-button portal-button uk-text-uppercase\"\n" +
838
    "                                            routerlinkactive=\"router-link-active\"\n" +
839
    "                                            ng-reflect-router-link=\"/about/learn-how\"\n" +
840
    "                                            ng-reflect-router-link-active=\"router-link-active\"\n" +
841
    "                                            href=\"/about/learn-how\">learn more</a></div>\n" +
842
    "                </div>\n" +
843
    "              </div>\n" +
844
    "            </div>\n" +
845
    "          </li>\n" +
846
    "        </ul>\n" +
847
    "        <ul class=\"uk-slider-nav uk-dotnav uk-flex-center uk-margin\">\n" +
848
    "          <li uk-slider-item=\"0\" class=\"uk-active\"><a href=\"#\"></a></li>\n" +
849
    "          <li uk-slider-item=\"1\" class=\"\"><a href=\"#\"></a></li>\n" +
850
    "          <li uk-slider-item=\"2\" class=\"\"><a href=\"#\"></a></li>\n" +
851
    "          <li uk-slider-item=\"3\" class=\"\"><a href=\"#\"></a></li>\n" +
852
    "          <li uk-slider-item=\"4\" class=\"\"><a href=\"#\"></a></li>\n" +
853
    "        </ul>\n" +
854
    "      </div>\n" +
855
    "    </div>\n" +
856
    "  </div>\n" +
857
    "</div>\n";
858
859
  db.pageHelpContent.save({
860
    "page" : home_page,
861
    "community" : communityID,
862
    "placement" : "top",
863
    "order" : 2,
864
    "content" : top_2_content,
865
    "isActive" : true,
866
    "isPriorTo" : false
867
  });
868
}
869
870
function addHelpTextsInAboutLearnHowPage() {
871
  print("add help contents in About - Learn How Page for community connect\n");
872
873
  communityID = db.community.find({pid: "connect"}).map(function (community) { return community._id.str; }).toString();
874
  about_page = db.page.find( { route: "/about/learn-how" }).map( function(page) { return page._id.str; } ).toString()
875
876
  top_1_content = "<div\n" +
877
    "  class=\"uk-section uk-background-norepeat uk-background-cover uk-section-overlap uk-position-relative uk-preserve-color\"\n" +
878
    "  style=\" min-height: calc(7.89999px + 60vh);  background-image: url('assets/connect-assets/about/background.png') !important;\">\n" +
879
    "  <div class=\"uk-container uk-container-large uk-section uk-margin-top uk-padding-remove-top\">\n" +
880
    "    <div class=\"uk-margin-large-top uk-grid\"><h1 class=\"uk-width-1-1 font-41 uk-text-bold\">Learn the process</h1>\n" +
881
    "      <div class=\"uk-width-1-2@l uk-width-1-1@s uk-h5 uk-margin-top\">Build a <b>Gateway to your community's</b> open\n" +
882
    "        and linked research outcomes. Customized to your needs.\n" +
883
    "      </div>\n" +
884
    "    </div>\n" +
885
    "    <div class=\"uk-margin-large-top uk-flex uk-child-width-1-3@m uk-child-width-1-1@s uk-flex-center uk-grid\"\n" +
886
    "         uk-grid=\"\">\n" +
887
    "      <div class=\"uk-flex uk-child-width-1-1@m uk-child-width-1-2@s uk-grid uk-first-column uk-grid-stack\" uk-grid=\"\">\n" +
888
    "        <div class=\"uk-first-column\">\n" +
889
    "          <h5 class=\"uk-text-bold uk-margin-small-bottom\">1. Understanding your needs</h5>\n" +
890
    "          <div > First, we learn about your requirements and challenges. We help you\n" +
891
    "            understand Open Science practices within EOSC and together we’ll talk about how OpenAIRE RCD fits as a\n" +
892
    "            solution.\n" +
893
    "          </div>\n" +
894
    "        </div>\n" +
895
    "        <div class=\"uk-visible@m uk-grid-margin uk-first-column\">\n" +
896
    "          <h5 class=\"uk-text-bold uk-margin-small-bottom\">4. Roll out the service</h5>\n" +
897
    "          <div > We jointly roll out your new Community Gateway. You take over the business\n" +
898
    "            operations and start engaging your researchers, we take care of the smooth operation of the e-service.\n" +
899
    "          </div>\n" +
900
    "        </div>\n" +
901
    "        <div class=\"uk-hidden@m\">\n" +
902
    "          <h5 class=\"uk-text-bold uk-margin-small-bottom\">2. Develop a pilot</h5>\n" +
903
    "          <div > How do you work today, and how would you like to work tomorrow? We translate\n" +
904
    "            your needs into rules and processes and we configure operational OpenAIRE services. By the end of this\n" +
905
    "            phase, we’ll have defined the basic configuration of your Community Gateway.\n" +
906
    "          </div>\n" +
907
    "        </div>\n" +
908
    "      </div>\n" +
909
    "      <div class=\"uk-text-center\"><img src=\"assets/connect-assets/about/cycle.png\"></div>\n" +
910
    "      <div class=\"uk-flex uk-child-width-1-1@m uk-child-width-1-2@s uk-grid uk-grid-stack\" uk-grid=\"\">\n" +
911
    "        <div class=\"uk-visible@m uk-first-column\">\n" +
912
    "          <h5 class=\"uk-text-bold uk-margin-small-bottom\">2. Develop a pilot</h5>\n" +
913
    "          <div > How do you work today, and how would you like to work tomorrow? We translate\n" +
914
    "            your needs into rules and processes and we configure operational OpenAIRE services. By the end of this\n" +
915
    "            phase, we’ll have defined the basic configuration of your Community Gateway.\n" +
916
    "          </div>\n" +
917
    "        </div>\n" +
918
    "        <div class=\"uk-hidden@m uk-visible@s\">\n" +
919
    "          <h5 class=\"uk-text-bold uk-margin-small-bottom\">4. Roll out the service</h5>\n" +
920
    "          <div > We jointly roll out your new Community Gateway. You take over the business\n" +
921
    "            operations and start engaging your researchers, we take care of the smooth operation of the e-service.\n" +
922
    "          </div>\n" +
923
    "        </div>\n" +
924
    "        <div class=\"uk-grid-margin uk-first-column\">\n" +
925
    "          <h5 class=\"uk-text-bold uk-margin-small-bottom\">3. Test and Validate</h5>\n" +
926
    "          <div > You validate and test your new Community Gateway (portal) with your experts\n" +
927
    "            and community to ensure all workflows are in place and quality of data meets your standards. If needed, we\n" +
928
    "            work together in another iteration to further refine and adapt to your needs.\n" +
929
    "          </div>\n" +
930
    "        </div>\n" +
931
    "        <div class=\"uk-hidden@s uk-visible@xs\">\n" +
932
    "          <h5 class=\"uk-text-bold uk-margin-small-bottom\">4. Roll out the service</h5>\n" +
933
    "          <div > We jointly roll out your new Community Gateway. You take over the business\n" +
934
    "            operations and start engaging your researchers, we take care of the smooth operation of the e-service.\n" +
935
    "          </div>\n" +
936
    "        </div>\n" +
937
    "      </div>\n" +
938
    "    </div>\n" +
939
    "    <div class=\"uk-width-1-1 uk-text-center uk-text-large uk-margin-large-top\"><a\n" +
940
    "      class=\"uk-button portal-button uk-text-uppercase\" routerlink=\"/about/learn-in-depth\"\n" +
941
    "      routerlinkactive=\"router-link-active\" ng-reflect-router-link=\"/about/learn-in-depth\"\n" +
942
    "      ng-reflect-router-link-active=\"router-link-active\" href=\"/about/learn-in-depth\"> Learn more details</a></div>\n" +
943
    "  </div>\n" +
944
    "</div>";
945
946
  db.pageHelpContent.save({
947
    "page": about_page,
948
    "community": communityID,
949
    "placement": "top",
950
    "order": 1,
951
    "content": top_1_content,
952
    "isActive": true,
953
    "isPriorTo": false
954
  });
955
956
  top_2_content = "<div style=\"background-image: url('assets/connect-assets/cloud/abstract.png') !important;\"\n" +
957
    "  class=\"uk-background-norepeat uk-section uk-background-center uk-background-cover uk-section-overlap uk-position-relative uk-preserve-color\">\n" +
958
    "  <div class=\"uk-container uk-container-large\">\n" +
959
    "    <div tabindex=\"-1\"\n" +
960
    "         uk-slider=\"velocity: 0;autoplay: true;autoplay-interval: 4000;pause-on-hover: false;center: true\"\n" +
961
    "         class=\"uk-slider\">\n" +
962
    "      <div class=\"uk-slider-container\">\n" +
963
    "        <ul class=\"uk-slider-items uk-child-width-1-1\" style=\"transform: translateX(-1300px);\">\n" +
964
    "          <li class=\"ng-star-inserted uk-active\" tabindex=\"-1\" style=\"order: 1;\">\n" +
965
    "            <div class=\"uk-flex uk-padding uk-child-width-1-2@m uk-child-width-1-1@s uk-grid\" uk-grid=\"\">\n" +
966
    "              <div class=\"uk-first-column\"><img class=\"uk-box-shadow-large uk-border-rounded\"\n" +
967
    "                                                src=\"assets/connect-assets/about/gifs/profile.gif\"></div>\n" +
968
    "              <div class=\"uk-margin-top\" ng-reflect-klass=\"uk-margin-top\" ng-reflect-ng-class=\"\">\n" +
969
    "                <div>\n" +
970
    "                  <div class=\"uk-text-bold uk-h4\">Profile</div>\n" +
971
    "                  <div class=\"uk-margin-medium\"> Edit community information, change logo url, add community managers\n" +
972
    "                    or organizations related to community.\n" +
973
    "                  </div>\n" +
974
    "                </div>\n" +
975
    "              </div>\n" +
976
    "            </div>\n" +
977
    "          </li>\n" +
978
    "          <li  tabindex=\"-1\" style=\"order: 1;\">\n" +
979
    "            <div class=\"uk-flex uk-padding uk-child-width-1-2@m uk-child-width-1-1@s uk-grid\" uk-grid=\"\">\n" +
980
    "              <div class=\"uk-first-column\"><img class=\"uk-box-shadow-large uk-border-rounded\"\n" +
981
    "                                                src=\"assets/connect-assets/about/gifs/content.gif\"></div>\n" +
982
    "              <div class=\"uk-margin-top\" ng-reflect-klass=\"uk-margin-top\" ng-reflect-ng-class=\"\">\n" +
983
    "                <div>\n" +
984
    "                  <div class=\"uk-text-bold uk-h4\">Content</div>\n" +
985
    "                  <div class=\"uk-margin-medium\"> Manage projects, content providers, subjects and zenodo communities\n" +
986
    "                    that are related to the research community.\n" +
987
    "                  </div>\n" +
988
    "                </div>\n" +
989
    "              </div>\n" +
990
    "            </div>\n" +
991
    "          </li>\n" +
992
    "          <li  tabindex=\"-1\" style=\"order: 1;\">\n" +
993
    "            <div class=\"uk-flex uk-padding uk-child-width-1-2@m uk-child-width-1-1@s uk-grid\" uk-grid=\"\">\n" +
994
    "              <div class=\"uk-first-column\"><img class=\"uk-box-shadow-large uk-border-rounded\"\n" +
995
    "                                                src=\"assets/connect-assets/about/gifs/statistics.gif\"></div>\n" +
996
    "              <div class=\"uk-margin-top\" ng-reflect-klass=\"uk-margin-top\" ng-reflect-ng-class=\"\">\n" +
997
    "                <div>\n" +
998
    "                  <div class=\"uk-text-bold uk-h4\">Statistics &amp; Charts</div>\n" +
999
    "                  <div class=\"uk-margin-medium\"> Manage statistical numbers &amp; charts that will be displayed in\n" +
1000
    "                    the community overview and graph analysis views.\n" +
1001
    "                  </div>\n" +
1002
    "                </div>\n" +
1003
    "              </div>\n" +
1004
    "            </div>\n" +
1005
    "          </li>\n" +
1006
    "          <li  tabindex=\"-1\" style=\"order: 1;\">\n" +
1007
    "            <div class=\"uk-flex uk-padding uk-child-width-1-2@m uk-child-width-1-1@s uk-grid\" uk-grid=\"\">\n" +
1008
    "              <div class=\"uk-first-column\"><img class=\"uk-box-shadow-large uk-border-rounded\"\n" +
1009
    "                                                src=\"assets/connect-assets/about/gifs/links.gif\"></div>\n" +
1010
    "              <div class=\"uk-margin-top\" ng-reflect-klass=\"uk-margin-top\" ng-reflect-ng-class=\"\">\n" +
1011
    "                <div>\n" +
1012
    "                  <div class=\"uk-text-bold uk-h4\">Links</div>\n" +
1013
    "                  <div class=\"uk-margin-medium\"> Manage user claims related to the research community.</div>\n" +
1014
    "                </div>\n" +
1015
    "              </div>\n" +
1016
    "            </div>\n" +
1017
    "          </li>\n" +
1018
    "          <li  tabindex=\"-1\" style=\"order: 1;\">\n" +
1019
    "            <div class=\"uk-flex uk-padding uk-child-width-1-2@m uk-child-width-1-1@s uk-grid\" uk-grid=\"\">\n" +
1020
    "              <div class=\"uk-first-column\"><img class=\"uk-box-shadow-large uk-border-rounded\"\n" +
1021
    "                                                src=\"assets/connect-assets/about/gifs/help.gif\"></div>\n" +
1022
    "              <div class=\"uk-margin-top\" ng-reflect-klass=\"uk-margin-top\" ng-reflect-ng-class=\"\">\n" +
1023
    "                <div>\n" +
1024
    "                  <div class=\"uk-text-bold uk-h4\"> Help texts</div>\n" +
1025
    "                  <div class=\"uk-margin-medium\"> Add or edit help text in research community pages.</div>\n" +
1026
    "                </div>\n" +
1027
    "              </div>\n" +
1028
    "            </div>\n" +
1029
    "          </li>\n" +
1030
    "          <li  tabindex=\"-1\">\n" +
1031
    "            <div class=\"uk-flex uk-padding uk-child-width-1-2@m uk-child-width-1-1@s uk-grid\" uk-grid=\"\">\n" +
1032
    "              <div class=\"uk-first-column\"><img class=\"uk-box-shadow-large uk-border-rounded\"\n" +
1033
    "                                                src=\"assets/connect-assets/about/gifs/users.gif\"></div>\n" +
1034
    "              <div class=\"uk-margin-top\" ng-reflect-klass=\"uk-margin-top\" ng-reflect-ng-class=\"\">\n" +
1035
    "                <div>\n" +
1036
    "                  <div class=\"uk-text-bold uk-h4\">Users</div>\n" +
1037
    "                  <div class=\"uk-margin-medium\"> Invite more users to subscribe, manage community subscribers, your\n" +
1038
    "                    personal info and notification settings.\n" +
1039
    "                  </div>\n" +
1040
    "                </div>\n" +
1041
    "              </div>\n" +
1042
    "            </div>\n" +
1043
    "          </li>\n" +
1044
    "        </ul>\n" +
1045
    "        <ul class=\"uk-slider-nav uk-dotnav uk-flex-center uk-margin\">\n" +
1046
    "          <li uk-slider-item=\"0\" class=\"uk-active\"><a href=\"#\"></a></li>\n" +
1047
    "          <li uk-slider-item=\"1\" class=\"\"><a href=\"#\"></a></li>\n" +
1048
    "          <li uk-slider-item=\"2\" class=\"\"><a href=\"#\"></a></li>\n" +
1049
    "          <li uk-slider-item=\"3\" class=\"\"><a href=\"#\"></a></li>\n" +
1050
    "          <li uk-slider-item=\"4\" class=\"\"><a href=\"#\"></a></li>\n" +
1051
    "          <li uk-slider-item=\"5\" class=\"\"><a href=\"#\"></a></li>\n" +
1052
    "        </ul>\n" +
1053
    "      </div>\n" +
1054
    "    </div>\n" +
1055
    "  </div>\n" +
1056
    "</div>\n";
1057
1058
  db.pageHelpContent.save({
1059
    "page": about_page,
1060
    "community": communityID,
1061
    "placement": "top",
1062
    "order": 2,
1063
    "content": top_2_content,
1064
    "isActive": true,
1065
    "isPriorTo": false
1066
  });
1067
1068
  top_3_content = "<div style=\"background-color: #CFDEF1;\"\n" +
1069
    "  class=\"uk-background-norepeat uk-background-cover uk-section-overlap uk-position-relative uk-preserve-color\">\n" +
1070
    "  <div class=\"uk-container uk-container-large uk-section\">\n" +
1071
    "    <div class=\"uk-flex uk-flex-middle uk-padding uk-grid\" uk-grid=\"\">\n" +
1072
    "      <div class=\"uk-width-expand uk-first-column\">\n" +
1073
    "        <div class=\"uk-text-bold uk-h4\">We look forward to working together and helping you unlock the full potential\n" +
1074
    "          of your research community through open science.\n" +
1075
    "        </div>\n" +
1076
    "        <div class=\"uk-margin-medium\">Get in touch with our team to find out how.</div>\n" +
1077
    "        <div class=\"uk-inline\"><a class=\"uk-button portal-button\" routerlink=\"/contact-us\"\n" +
1078
    "                                  routerlinkactive=\"router-link-active\" ng-reflect-router-link=\"/contact-us\"\n" +
1079
    "                                  ng-reflect-router-link-active=\"router-link-active\" href=\"/contact-us\"> CONTACT\n" +
1080
    "          US</a></div>\n" +
1081
    "      </div>\n" +
1082
    "      <div class=\"uk-text-center uk-width-1-1@s uk-width-1-3@m\"><img src=\"assets/connect-assets/contact/3.png\" width=\"263\"\n" +
1083
    "                                                                     height=\"250\"></div>\n" +
1084
    "    </div>\n" +
1085
    "  </div>\n" +
1086
    "</div>\n";
1087
1088
  db.pageHelpContent.save({
1089
    "page": about_page,
1090
    "community": communityID,
1091
    "placement": "top",
1092
    "order": 3,
1093
    "content": top_3_content,
1094
    "isActive": true,
1095
    "isPriorTo": false
1096
  });
1097
1098
  top_4_content = "<div>\n" +
1099
    "  FAQs section\n" +
1100
    "</div>\n";
1101
1102
  db.pageHelpContent.save({
1103
    "page": about_page,
1104
    "community": communityID,
1105
    "placement": "top",
1106
    "order": 4,
1107
    "content": top_4_content,
1108
    "isActive": false,
1109
    "isPriorTo": false
1110
  });
1111
}
1112
1113
function addHelpTextsInAboutLearnInDepthPage() {
1114
  print("add help contents in About - Learn In Depth for community connect\n");
1115
1116
  communityID = db.community.find({pid: "connect"}).map(function (community) { return community._id.str; }).toString();
1117
  aboutLearnInDepth_page = db.page.find({route: "/about/learn-in-depth"}).map(function (page) { return page._id.str; }).toString();
1118
1119
  top_1_content = "<div\n" +
1120
    "  class=\"uk-background-norepeat uk-background-cover uk-section uk-padding-remove-bottom uk-section-overlap uk-position-relative uk-preserve-color\"\n" +
1121
    "  style=\"min-height: calc(7.89999px + 60vh); background-image: url('assets/connect-assets/cloud/background.png') !important;\">\n" +
1122
    "  <div class=\"uk-container uk-container-large uk-section uk-margin-top uk-padding-remove-top\">\n" +
1123
    "    <div uk-grid=\"\" class=\"uk-grid\">\n" +
1124
    "      <div class=\"uk-margin-large-top uk-width-3-4@m uk-width-1-1@s uk-first-column\"><h1\n" +
1125
    "        class=\"uk-width-3-4  uk-margin-medium-bottom\">Let’s set up a Gateway for your Community <b>Together</b></h1>\n" +
1126
    "        <div class=\"uk-width-4-5@m uk-width-1-1@s uk-h5\">\n" +
1127
    "          <div class=\"uk-margin-bottom\">You don’t have to go alone.</div>\n" +
1128
    "          <div> We work with you in <b>4 collaborative steps</b> to identify your needs, putting in practice our\n" +
1129
    "            expertise on open science so you get the most out of OpenAIRE’s operational services.\n" +
1130
    "          </div>\n" +
1131
    "        </div>\n" +
1132
    "      </div>\n" +
1133
    "      <div class=\"uk-margin-large-top uk-width-expand\"><img src=\"assets/connect-assets/banner/together.png\" width=\"308\" height=\"285\">\n" +
1134
    "      </div>\n" +
1135
    "    </div>\n" +
1136
    "  </div>\n" +
1137
    "</div>\n";
1138
1139
  db.pageHelpContent.save({
1140
    "page": aboutLearnInDepth_page,
1141
    "community": communityID,
1142
    "placement": "top",
1143
    "order": 1,
1144
    "content": top_1_content,
1145
    "isActive": true,
1146
    "isPriorTo": false
1147
  });
1148
1149
  top_2_content = "<div class=\"uk-container uk-container-large uk-section uk-padding-remove-top\">\n" +
1150
    "  <ul class=\"uk-breadcrumb\">\n" +
1151 56881 konstantin
    "    <li><a routerlink=\"/about/learn-how\" routerlinkactive=\"router-link-active\" ng-reflect-router-link=\"/about/learn-how\"\n" +
1152
    "           ng-reflect-router-link-active=\"router-link-active\" href=\"/about/learn-how\" class=\"router-link-active\">About</a></li>\n" +
1153 56785 konstantin
    "    <li><span class=\"active\">Learn in-depth</span></li>\n" +
1154
    "  </ul>\n" +
1155
    "  <div uk-grid=\"\" class=\"uk-grid\">\n" +
1156
    "    <div class=\"uk-width-1-6 uk-position-relative uk-flex uk-flex-column uk-first-column\"><img class=\"uk-align-center\"\n" +
1157
    "                                                                                               src=\"assets/connect-assets/about/1.png\"\n" +
1158
    "                                                                                               width=\"100\"><img\n" +
1159
    "      class=\"uk-align-center\" src=\"assets/connect-assets/sketch_line_arrow.svg\"></div>\n" +
1160
    "    <div class=\"uk-width-expand\">\n" +
1161
    "      <div class=\"uk-margin-medium uk-text-bold uk-h4\">1. Analyse your needs</div>\n" +
1162
    "      <div style=\"font-style: italic;\">Identify the scope and goals. Understand open science practices within EOSC and the OpenAIRE services</div>\n" +
1163
    "      <p> In this stage, you get to talk to the OpenAIRE team. Share your expectations with us and let us give you all\n" +
1164
    "        the details about the operational OpenAIRE services, which will be integrated into the Gateway for your\n" +
1165
    "        community. </p>\n" +
1166
    "      <p> Here are the most important questions that the OpenAIRE team will ask you, in order to understand your scope\n" +
1167
    "        and goals: </p>\n" +
1168
    "      <ul class=\"uk-list uk-list-bullet\">\n" +
1169
    "        <li> Do you want a gateway, where researchers can have access to all research products of a discipline? Do you\n" +
1170
    "          want a gateway that gathers any research outcome, produced thanks to the funding and services of a given\n" +
1171
    "          research infrastructure?\n" +
1172
    "        </li>\n" +
1173
    "        <li> Is your community (in)formally organized in sub-communities? Would you like to browse research products and\n" +
1174
    "          get statistics also for these sub-communities? For example, the European Grid Infrastructure (EGI) features\n" +
1175
    "          “virtual organizations” that represent discipline-specific communities and/or specific research projects. The\n" +
1176
    "          research infrastructure DARIAH, on the other hand, is organised in national nodes (e.g. DARIAH-IT, DARIAH-DE).\n" +
1177
    "        </li>\n" +
1178
    "        <li> How can the OpenAIRE team identify the research products of your community, among all those available in\n" +
1179
    "          the OpenAIRE Graph? Through a series of steps: set of keywords, acknowledgment statements, set of projects,\n" +
1180
    "          set of repositories, etc. This can be partial and provisional information that will serve as a starting point\n" +
1181
    "          to the OpenAIRE team. You will be able to refine and update this information, in the second phase “Develop a\n" +
1182
    "          pilot”.\n" +
1183
    "        </li>\n" +
1184
    "      </ul>\n" +
1185
    "    </div>\n" +
1186
    "  </div>\n" +
1187
    "  <div uk-grid=\"\" uk-height-match=\"\" class=\"uk-grid\">\n" +
1188
    "    <div class=\"uk-width-1-6 uk-position-relative uk-flex uk-flex-column uk-first-column\"><img class=\"uk-align-center\"\n" +
1189
    "                                                                                               src=\"assets/connect-assets/about/2.png\"\n" +
1190
    "                                                                                               width=\"100\"><img\n" +
1191
    "      class=\"uk-align-center\" src=\"assets/connect-assets/sketch_line_arrow.svg\"></div>\n" +
1192
    "    <div class=\"uk-width-expand\">\n" +
1193
    "      <div class=\"uk-margin-medium uk-text-bold uk-h4\">2. Develop a pilot</div>\n" +
1194
    "      <div style=\"font-style: italic;\">We translate your needs into rules and processes and we configure operational OpenAIRE services.</div>\n" +
1195
    "      <p> Based on the information gathered in phase 1 “Analyse your needs”, the OpenAIRE team will set up a pilot\n" +
1196
    "        Gateway. We will configure the OpenAIRE mining algorithms to identify research products of the OpenAIRE Graph\n" +
1197
    "        that are relevant to your community. Those, together with some basic statistics, will be available in the pilot\n" +
1198
    "        version of the Community Gateway that will be deployed on the OpenAIRE BETA infrastructure. </p>\n" +
1199
    "      <p> The OpenAIRE team will give you a demo of the Community Gateway, with details on how to refine and update the\n" +
1200
    "        configuration of the Community Gateway, both in terms of criteria for including research products and in terms\n" +
1201
    "        of logo and visible portal pages. </p></div>\n" +
1202
    "  </div>\n" +
1203
    "  <div uk-grid=\"\" uk-height-match=\"\" class=\"uk-grid\">\n" +
1204
    "    <div class=\"uk-width-1-6 uk-position-relative uk-flex uk-flex-column uk-first-column\"><img class=\"uk-align-center\"\n" +
1205
    "                                                                                               src=\"assets/connect-assets/about/3.png\"\n" +
1206
    "                                                                                               width=\"100\"><img\n" +
1207
    "      class=\"uk-align-center\" src=\"assets/connect-assets/sketch_line_arrow_large.svg\"></div>\n" +
1208
    "    <div class=\"uk-width-expand\">\n" +
1209
    "      <div class=\"uk-margin-medium uk-text-bold uk-h4\">3. Test and Validate</div>\n" +
1210
    "      <div style=\"font-style: italic;\">You validate and test your new Community Gateway (portal). If needed, we further refine and adapt to your\n" +
1211
    "        needs</div>\n" +
1212
    "      <p> Upon the completion of phase 2, take the time you need to test all its features, from search and browse for\n" +
1213
    "        research products, to addition/removal of statistics from the portal. You can report any issue you might find\n" +
1214
    "        and ask questions directly to the dedicated OpenAIRE team, via a specially designed collaboration tool. </p>\n" +
1215
    "      <p> Typically, this phase takes some months, as you will have to go through certain procedures. Change the\n" +
1216
    "        configuration of the criteria to include research products, wait for the new configuration to be applied on the\n" +
1217
    "        OpenAIRE graph and validate the results, before you actually decide that the coverage of research products for\n" +
1218
    "        your community is adequate. </p>\n" +
1219
    "      <p> For some communities, the OpenAIRE team may also be able to implement dedicated mining algorithms (e.g. to\n" +
1220
    "        find acknowledgement statements to your community/infrastructure in the full-texts of research articles) that\n" +
1221
    "        may require several rounds of application, validation, and fine-tuning, before it reaches a high precision and\n" +
1222
    "        recall. Your feedback is very important to minimize the effort and time needed for this process to\n" +
1223
    "        complete. </p>\n" +
1224
    "      <div class=\"uk-width-1-1 uk-text-center uk-margin-medium \"><img src=\"assets/connect-assets/OpenAIRE-RCD_howtos.png\" width=\"auto\"\n" +
1225
    "                                                                      height=\"auto\"></div>\n" +
1226
    "    </div>\n" +
1227
    "  </div>\n" +
1228
    "  <div uk-grid=\"\" uk-height-match=\"\" class=\"uk-grid\">\n" +
1229
    "    <div class=\"uk-width-1-6 uk-position-relative uk-first-column\"><img class=\"uk-align-center\" src=\"assets/connect-assets/about/4.png\"\n" +
1230
    "                                                                        width=\"100\"></div>\n" +
1231
    "    <div class=\"uk-width-expand\">\n" +
1232
    "      <div class=\"uk-margin-medium  uk-text-bold uk-h4\">4. Roll out the service</div>\n" +
1233
    "      <div style=\"font-style: italic;\">We jointly roll out your new portal. You take over the business operations and start engaging your\n" +
1234
    "        researchers</div>\n" +
1235
    "      <p> Here we are: the coverage of research products is good, interesting statistics and charts have been selected,\n" +
1236
    "        and the portal pages available for end-users are ready. We can roll out the Community Gateway and make it\n" +
1237
    "        available to all the researchers of the community! </p>\n" +
1238
    "      <p> You, as a Community manager, become the main “promoter” of the Community Gateway. Engage the researchers of\n" +
1239
    "        your community and, when applicable, inform the managers of the research infrastructure about the availability\n" +
1240
    "        of tools for impact monitoring. </p>\n" +
1241
    "      <p> Remember that you will still be able to change the configuration of the Community Gateway in order to address\n" +
1242
    "        any issue that may arise and to follow the evolution of the community (e.g. a new project or a new content\n" +
1243
    "        provider that was not previously available in OpenAIRE). </p>\n" +
1244
    "      <p> Remember that you don’t have to go alone: the dedicated issue tracker you used in the “Test and Validate”\n" +
1245
    "        phase is always available for you to contact the OpenAIRE team and ask for support. </p></div>\n" +
1246
    "  </div>\n" +
1247
    "</div>";
1248
1249
  db.pageHelpContent.save({
1250
    "page": aboutLearnInDepth_page,
1251
    "community": communityID,
1252
    "placement": "top",
1253
    "order": 2,
1254
    "content": top_2_content,
1255
    "isActive": true,
1256
    "isPriorTo": false
1257
  });
1258
1259
  top_3_content = "<div\n" +
1260
    "  class=\"uk-background-norepeat uk-background-cover uk-section-secondary uk-section-overlap uk-position-relative uk-preserve-color\"\n" +
1261
    "  style=\"background-color: #CFDEF1;\">\n" +
1262
    "  <div class=\"uk-container uk-container-large uk-section\">\n" +
1263
    "    <div class=\"uk-flex uk-flex-middle uk-padding uk-grid\" uk-grid=\"\">\n" +
1264
    "      <div class=\"uk-text-center uk-width-1-1@s uk-width-1-2@m uk-first-column\"><img src=\"assets/connect-assets/contact/2.png\"\n" +
1265
    "                                                                                     width=\"329\" height=\"250\"></div>\n" +
1266
    "      <div class=\"uk-width-expand\">\n" +
1267
    "        <div class=\"uk-text-bold uk-h4\">\n" +
1268
    "          <div>Let us help you develop a collaborative Open Science Gateway for your community. It is fast. It is\n" +
1269
    "            reliable.\n" +
1270
    "          </div>\n" +
1271
    "        </div>\n" +
1272
    "        <div class=\"uk-margin-medium\">Get in touch with our team to find out how.</div>\n" +
1273
    "        <div class=\"uk-inline\"><a class=\"uk-button portal-button\" routerlink=\"/contact-us\"\n" +
1274
    "                                  routerlinkactive=\"router-link-active\" ng-reflect-router-link=\"/contact-us\"\n" +
1275
    "                                  ng-reflect-router-link-active=\"router-link-active\" href=\"/contact-us\"> CONTACT US</a>\n" +
1276
    "        </div>\n" +
1277
    "      </div>\n" +
1278
    "    </div>\n" +
1279
    "  </div>\n" +
1280
    "</div>\n";
1281
1282
  db.pageHelpContent.save({
1283
    "page": aboutLearnInDepth_page,
1284
    "community": communityID,
1285
    "placement": "top",
1286
    "order": 3,
1287
    "content": top_3_content,
1288
    "isActive": true,
1289
    "isPriorTo": false
1290
  });
1291
}
1292
1293
function addHelpTextsInContactUsPage() {
1294
  print("add help contents in Contact Us Page for community connect\n");
1295
1296
  communityID = db.community.find({pid: "connect"}).map(function (community) { return community._id.str; }).toString();
1297
  contactUs_page = db.page.find({route: "/contact-us"}).map(function (page) { return page._id.str; }).toString();
1298
1299
  right_content = "<div class=\"uk-margin-auto-top uk-margin-remove-bottom  uk-text-bold uk-h4\">OpenAIRE gives you the virtual\n" +
1300
    "environment and services designed for your community to:\n" +
1301
    "</div>\n" +
1302
    "<ul class=\"uk-list uk-list-divider uk-padding uk-padding-remove-left uk-margin-auto-top\">\n" +
1303
    "  <li><h5><span class=\"uk-text-bold\">Create and Manage</span> your\n" +
1304
    "    Community Gateway</h5></li>\n" +
1305
    "  <li><h5><span class=\"uk-text-bold\">Access, share and link</span> together all your research</h5></li>\n" +
1306
    "  <li><h5><span class=\"uk-text-bold\">Monitor and report</span> your community's progress</h5></li>\n" +
1307
    "</ul>\n";
1308
1309
  db.pageHelpContent.save({
1310
    "page": contactUs_page,
1311
    "community": communityID,
1312
    "placement": "right",
1313
    "order": 1,
1314
    "content": right_content,
1315
    "isActive": true,
1316
    "isPriorTo": false
1317
  });
1318
}
1319
1320
function addHelpTextsInContentPolicyPage() {
1321
  print("add help contents in Content Policy Page for community connect\n");
1322
1323
  communityID = db.community.find({pid: "connect"}).map(function (community) { return community._id.str; }).toString();
1324
  content_page = db.page.find({route: "/content"}).map(function (page) { return page._id.str; }).toString();
1325
1326
  top_content = "<div class=\"uk-margin-large-top tm-middle uk-container\" id=\"tm-main\">\n" +
1327
    "  <div class=\"uk-container  uk-margin-bottom\">\n" +
1328
    "    <div class=\"uk-article-title custom-article-title\"> Content policy</div>\n" +
1329
    "    <div><p> OpenAIRE builds an open scholarly graph of research products (publications, datasets, software and other\n" +
1330
    "      types of research products), linked to each other and to fundings, projects and organizations. The information\n" +
1331
    "      used to build the graph is collected from the OpenAIRE network of content providers and is inferred by OpenAIRE\n" +
1332
    "      algorithms. OpenAIRE algorithms are capable of detecting duplicates and mining information from the full-texts of\n" +
1333
    "      Open Access publications. For more details about the construction of the graph, please check <a\n" +
1334
    "        href=\"https://beta.openaire.eu/aggregation-and-content-provision-workflows\" target=\"_blank\">here</a>. </p>\n" +
1335
    "      <p> Thanks to the Research Community Dashboard (RCD), researchers have a dedicated view of the OpenAIRE graph\n" +
1336
    "        where only the research products relevant to the community are searchable and browsable.<br> There are several\n" +
1337
    "        ways to decide if a research product is relevant to a given community: </p>\n" +
1338
    "      <p class=\"uk-margin-left\"><b>Links:</b> Users can \"claim\" that a research result is relevant to a community via\n" +
1339
    "        the <a routerlink=\"/participate/claim\" routerlinkactive=\"uk-link\" ng-reflect-router-link=\"/participate/claim\"\n" +
1340
    "               ng-reflect-router-link-active=\"uk-link\" href=\"/participate/claim\">Link</a> functionality of the Research\n" +
1341
    "        community dashboard. <br> For more details about linking functionality, please check <a\n" +
1342
    "          href=\"https://beta.openaire.eu/linking\" target=\"_blank\">here</a>. </p>\n" +
1343
    "      <div class=\"uk-margin-left uk-margin-top\"><b>OpenAIRE algorithms:</b> Community managers can configure the\n" +
1344
    "        OpenAIRE algorithms, in order to automatically assign research products to a community based on:\n" +
1345
    "        <div class=\"uk-margin-left\">\n" +
1346
    "          <ul class=\" uk-list uk-list-bullet  \">\n" +
1347
    "            <li> The content providers they have been collected from. <br>Examples: all research products collected from\n" +
1348
    "              \"NeuroVault\" are relevant to the Neuroinformatics community; all research products collected from the\n" +
1349
    "              LINDAT/CLARIN repository are relevant to the CLARIN research initiative.\n" +
1350
    "            </li>\n" +
1351
    "            <li> The projects they have been produced in. <br>Examples: all research products of the project \"Tara\n" +
1352
    "              Mediterranee\" are relevant to the European Marine Science community; all research products of the project\n" +
1353
    "              \"ARIADNE\" are relevant to the Digital Humanities and Cultural Heritage community.\n" +
1354
    "            </li>\n" +
1355
    "            <li> The subjects and keywords (only for RCD serving research communities). <br>Examples: all research\n" +
1356
    "              products having \"SDG11 - Sustainable cities and communities\" among the subjects are relevant to the Greek\n" +
1357
    "              Sustainable Development Solutions Network community; all research products with subject \"agriculture\" are\n" +
1358
    "              relevant to the AgInfra community\n" +
1359
    "            </li>\n" +
1360
    "          </ul>\n" +
1361
    "        </div>\n" +
1362
    "      </div>\n" +
1363
    "      <div class=\"uk-margin-left uk-margin-top\"><b>Acknowledgement statements:</b> Acknowledgement statements found in\n" +
1364
    "        full-texts (only for RCDs serving research infrastructures/initiatives)\n" +
1365
    "      </div>\n" +
1366
    "    </div>\n" +
1367
    "  </div>\n" +
1368
    "</div>\n";
1369
1370
  db.pageHelpContent.save({
1371
    "page": content_page,
1372
    "community": communityID,
1373
    "placement": "top",
1374
    "order": 1,
1375
    "content": top_content,
1376
    "isActive": true,
1377
    "isPriorTo": false
1378
  });
1379
}
1380
1381 56790 konstantin
function removeFaultyEmptyPageFromCommunities() {
1382
  communities = db.community.find().map( function(community) { return community; } );
1383 56679 konstantin
1384 56790 konstantin
  for (var i = 0; i < communities.length; i++) {
1385
    community_pages = communities[i].pages;
1386
1387
    delete community_pages[""];
1388
1389
    community_pid = communities[i].pid;
1390
    db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
1391
    print("Update pages for " + community_pid);
1392
  }
1393
}
1394
1395 56917 k.triantaf
function addMyCommunitiesPage() {
1396
    db.page.save({
1397
        "name": "My Communities",
1398
        "route": "/myCommunities",
1399
        "type": "other",
1400
        "connect": true,
1401
        "communities": false,
1402
        "openaire": false,
1403
        "entities": [],
1404
        "top": false,
1405
        "bottom": false,
1406
        "right": false,
1407
        "left": false
1408
    });
1409
    myCommunities = db.page.find( { route: "/myCommunities" }).map( function(page) { return page._id.str; } ).toString();
1410
    communities = db.community.find().map( function(community) { return community; } );
1411
    for (var i = 0; i < communities.length; i++) {
1412
        community_pages = communities[i].pages;
1413 56790 konstantin
1414 56917 k.triantaf
        community_pages[myCommunities] = true;
1415
        community_pid = communities[i].pid;
1416
        db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
1417
        print("Update pages for " + community_pid);
1418
    }
1419
}
1420
1421 57319 k.triantaf
function removeOldLayouts() {
1422
  db.community.updateMany({}, {$unset: {layout: ""}});
1423
  db.layout.deleteMany({});
1424
}
1425
1426 58306 konstantin
function addSearchResearchOutcomesPages() {
1427
  publicationId = db.entity.find( { pid: "publication" }).map( function(entity) { return entity._id.str; } ).toString()
1428
  datasetId = db.entity.find( { pid: "dataset" }).map( function(entity) { return entity._id.str; } ).toString()
1429
  softwareId = db.entity.find( { pid: "software" }).map( function(entity) { return entity._id.str; } ).toString()
1430
  orpId = db.entity.find( { pid: "orp" }).map( function(entity) { return entity._id.str; } ).toString();
1431
1432 59470 konstantin
  searchResearchOutcomesId = db.page.insertOne({"name" : "Search Research Outcomes", "route" : "/search/find/research-outcomes", "type" : "search", "connect":false,"openaire":true, "communities": true, "entities" : [publicationId, datasetId, softwareId, orpId], "top":true,"bottom":false,"right":false,"left":false}).insertedId.str;
1433
  avancedSearchResearchOutcomesId = db.page.insertOne({"name" : "Advanced Search Research Outcomes", "route" : "/search/advanced/research-outcomes", "type" : "search", "connect":false,"openaire":true, "communities": true, "entities" : [publicationId, datasetId, softwareId, orpId], "top":true,"bottom":false,"right":false,"left":false}).insertedId.str;
1434 58306 konstantin
1435
  print("Creating Search Research Outcomes page with id " + searchResearchOutcomesId);
1436
  print("Creating Advanced Search Research Outcomes page with id " + avancedSearchResearchOutcomesId);
1437
1438
  communities = db.community.find().map( function(community) { return community; } );
1439
  for (var i = 0; i < communities.length; i++) {
1440 59470 konstantin
    community_pages = communities[i].pages;
1441 58306 konstantin
1442 59470 konstantin
    community_pages[searchResearchOutcomesId] = true;
1443
    community_pages[avancedSearchResearchOutcomesId] = true;
1444 58306 konstantin
1445 59470 konstantin
    community_pid = communities[i].pid;
1446
    db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
1447
    print("Add Search Research Outcomes page with id " + searchResearchOutcomesId + " on community " + community_pid);
1448
    print("Add Advanced Search Research Outcomes page with id " + avancedSearchResearchOutcomesId + " on community " + community_pid);
1449 58306 konstantin
  }
1450
}
1451
1452 59470 konstantin
function addPortalType() {
1453
  communities = db.community.find().map( function(community) { return community; } );
1454
  for (var i = 0; i < communities.length; i++) {
1455
    community = communities[i];
1456
    if(community.pid == "openaire") {
1457
      community['type'] = "explore";
1458
    } else if(community.pid == "connect") {
1459
      community['type'] = "connect";
1460
    } else {
1461
      community['type'] = "community";
1462
    }
1463
    db.community.save(community);
1464
  }
1465 58476 konstantin
}
1466
1467 59470 konstantin
function createPagesForEachPortalType() {
1468
  pages = db.page.find().map( function(page) { return page; } );
1469
  for (var i = 0; i < pages.length; i++) {
1470
    page = pages[i];
1471 58476 konstantin
1472 59470 konstantin
    print("createPagesForEachPortalType: page["+i+"] = "+page.name + " ( "+page._id.str+" ) -> openaire: "+page.openaire+" - connect: "+page.connect + " - communities: "+page.communities);
1473 58476 konstantin
1474 59470 konstantin
    if(page.openaire == false) {  // do not include this page in portal profile
1475
      communityOpenaire = db.community.findOne({pid: "openaire"});
1476
      removePageFromPortal(communityOpenaire, page._id, communityOpenaire.pages);
1477
    }
1478
    if(page.connect == false) {  // do not include this page in portal profile
1479
      communityConnect = db.community.findOne({pid: "connect"});
1480
      removePageFromPortal(communityConnect, page._id, communityConnect.pages);
1481
    }
1482
    if(page.communities == false) {
1483
      communities = db.community.find({ "type" : "community" }).map( function(community) { return community; } );
1484
      for (var j = 0; j < communities.length; j++) {
1485
        removePageFromPortal(communities[j], page._id, communities[j].pages);
1486
      }
1487
    }
1488 58476 konstantin
1489 59470 konstantin
    if(page.openaire == true && page.connect == true && page.communities == true) {
1490
      db.page.save({"_id": page._id, "name" : page.name, "route" : page.route, "type" : page.type, "portalType": "community", "entities" : page.entities, "top":page.top, "bottom":page.bottom, "right":page.right,"left":page.left});
1491
      print("Keep for communities");
1492 58476 konstantin
1493 59470 konstantin
      createAndUpdatePageAndContentsForPortal(page, "openaire", "explore");
1494
      //print("Delete and create other for explore");
1495 58476 konstantin
1496 59470 konstantin
      createAndUpdatePageAndContentsForPortal(page, "connect", "connect");
1497
      //print("Delete and create other for connect");
1498 58476 konstantin
1499 59470 konstantin
    } else if(page.openaire == true && page.connect == true) {
1500
      db.page.save({"_id": page._id, "name" : page.name, "route" : page.route, "type" : page.type, "portalType": "connect", "entities" : page.entities, "top":page.top, "bottom":page.bottom, "right":page.right,"left":page.left});
1501
      print("Keep for connect");
1502
1503
      createAndUpdatePageAndContentsForPortal(page, "openaire", "explore");
1504
      //print("Delete and create other for explore");
1505
1506
    } else if(page.openaire == true && page.communities == true) {
1507
      db.page.save({"_id": page._id, "name" : page.name, "route" : page.route, "type" : page.type, "portalType": "community", "entities" : page.entities, "top":page.top, "bottom":page.bottom, "right":page.right,"left":page.left});
1508
      print("Keep for community");
1509
1510
      createAndUpdatePageAndContentsForPortal(page, "openaire", "explore");
1511
      //print("Delete and create other for explore");
1512
1513
    } else if(page.connect == true && page.communities == true) {
1514
      db.page.save({"_id": page._id, "name" : page.name, "route" : page.route, "type" : page.type, "portalType": "community", "entities" : page.entities, "top":page.top, "bottom":page.bottom, "right":page.right,"left":page.left});
1515
      print("Keep for community");
1516
1517
      createAndUpdatePageAndContentsForPortal(page, "connect", "connect");
1518
      //print("Delete and create other for connect");
1519
1520
    } else if(page.openaire == true) {
1521
      db.page.save({"_id": page._id, "name" : page.name, "route" : page.route, "type" : page.type, "portalType": "explore", "entities" : page.entities, "top":page.top, "bottom":page.bottom, "right":page.right,"left":page.left});
1522
      print("Keep for explore");
1523
1524
    } else if(page.connect == true) {
1525
      db.page.save({"_id": page._id, "name" : page.name, "route" : page.route, "type" : page.type, "portalType": "connect", "entities" : page.entities, "top":page.top, "bottom":page.bottom, "right":page.right,"left":page.left});
1526
      print("Keep for connect");
1527
1528
    } else if(page.communities == true) {
1529
      db.page.save({"_id": page._id, "name" : page.name, "route" : page.route, "type" : page.type, "portalType": "community", "entities" : page.entities, "top":page.top, "bottom":page.bottom, "right":page.right,"left":page.left});
1530
      print("Keep for community");
1531
1532
    }
1533 58476 konstantin
  }
1534
}
1535
1536 59470 konstantin
function createAndUpdatePageAndContentsForPortal(page, pid, portalType) {
1537
  db.page.save({"name" : page.name, "route" : page.route, "type" : page.type, "portalType": portalType, "entities" : page.entities, "top":page.top, "bottom":page.bottom, "right":page.right,"left":page.left});
1538
  pageIdForPortalType = db.page.find({portalType: portalType, "route" : page.route}).map(function (page) { return page._id.str; }).toString();
1539
  print("portalType: "+ portalType + " --> new page id: "+ pageIdForPortalType);
1540 58476 konstantin
1541 59470 konstantin
  community = db.community.findOne({pid: pid});
1542 58476 konstantin
1543 59470 konstantin
  community_pages = community.pages;
1544
  community_pages[pageIdForPortalType] = community_pages[page._id.str];
1545
  removePageFromPortal(community, page._id, community_pages);
1546
  if(portalType == "explore") {
1547
    print("    Delete page: "+page._id.str + " = (should be null) "+community.pages[page._id.str]
1548
      + " - new page: "+pageIdForPortalType+" = "+community.pages[pageIdForPortalType]);
1549
  }
1550 58476 konstantin
1551 59470 konstantin
  updatePageHelpContentsForPortalPage(page._id.str, pageIdForPortalType, community._id.str);
1552
}
1553 58476 konstantin
1554 59470 konstantin
function removePageFromPortal(community, pageId, community_pages) {
1555
  delete community_pages[pageId.str];
1556
  db.community.update({"pid": community.pid}, {$set: {"pages": community_pages}});
1557
}
1558
1559
function updatePageHelpContentsForPortalPage(pageId, newPageId, communityId) {
1560
  pageHelpContents = db.pageHelpContent.find({"page" : pageId, "community" : communityId,}).map( function(pageHelpContent) { return pageHelpContent; } );
1561
  for (var i = 0; i < pageHelpContents.length; i++) {
1562
    pageHelpContent = pageHelpContents[i];
1563
    db.pageHelpContent.save({
1564
      "_id": pageHelpContent._id,
1565
      "page": newPageId,
1566
      "community": communityId,
1567
      "placement": pageHelpContent.placement,
1568
      "order": pageHelpContent.order,
1569
      "content": pageHelpContent.content,
1570
      "isActive": pageHelpContent.isActive,
1571
      "isPriorTo": pageHelpContent.isPriorTo
1572 58476 konstantin
    });
1573
  }
1574 59470 konstantin
}
1575 58476 konstantin
1576 59470 konstantin
function createDivIdsForEachPortalType() {
1577
  divIds = db.divId.find().map( function(divId) { return divId; } );
1578
  for (var i = 0; i < divIds.length; i++) {
1579
    divId = divIds[i];
1580
1581
    print("createDivIdsForEachPortalType: divId["+i+"] = "+divId.name + " -> openaire: "+divId.openaire+" - connect: "+divId.connect + " - communities: "+divId.communities);
1582
1583
    if(divId.openaire == true && divId.connect == true && divId.communities == true) {
1584
      createAndUpdateDivIdAndContentsForPortal(divId, null, "community", false);
1585
      createAndUpdateDivIdAndContentsForPortal(divId, "openaire", "explore", true);
1586
      createAndUpdateDivIdAndContentsForPortal(divId, "connect", "connect", true);
1587
1588
    } else if(divId.openaire == true && divId.connect == true) {
1589
      createAndUpdateDivIdAndContentsForPortal(divId, null, "connect", false);
1590
      createAndUpdateDivIdAndContentsForPortal(divId, "openaire", "explore", true);
1591
1592
    } else if(divId.openaire == true && divId.communities == true) {
1593
      createAndUpdateDivIdAndContentsForPortal(divId, null, "community", false);
1594
      createAndUpdateDivIdAndContentsForPortal(divId, "openaire", "explore", true);
1595
1596
    } else if(divId.connect == true && divId.communities == true) {
1597
      createAndUpdateDivIdAndContentsForPortal(divId, null, "community", false);
1598
      createAndUpdateDivIdAndContentsForPortal(divId, "connect", "connect", true);
1599
1600
    } else if(divId.openaire == true) {
1601
      createAndUpdateDivIdAndContentsForPortal(divId, null, "explore", false);
1602
1603
    } else if(divId.connect == true) {
1604
      createAndUpdateDivIdAndContentsForPortal(divId, null, "connect", false);
1605
1606
    } else if(divId.communities == true) {
1607
      createAndUpdateDivIdAndContentsForPortal(divId, null, "community", false);
1608
    }
1609 58476 konstantin
  }
1610
}
1611
1612 59470 konstantin
function updateDivIdPages(pages, portalType) {
1613
  var newPages = [];
1614
  for (var i = 0; i < pages.length; i++) {
1615
    page = db.page.findOne({"_id": ObjectId(pages[i])});
1616
    pageForPortalType = db.page.findOne({portalType: portalType, "route" : page.route});
1617
    if(pageForPortalType) {
1618
      print("page in divId: "+pages[i] + " will be replaced with "+pageForPortalType._id.str);
1619
      newPages.push(pageForPortalType._id.str);
1620
    } else {
1621
      print("page in divId: "+pages[i] + " will be not be replaced. pageForPortalType: "+pageForPortalType);
1622
    }
1623
  }
1624
  return newPages;
1625
}
1626 58550 k.triantaf
1627 59470 konstantin
function createAndUpdateDivIdAndContentsForPortal(divId, pid, portalType, create) {
1628
  var pages = updateDivIdPages(divId.pages, portalType);
1629
  if(pages.length == 0) {
1630
    db.divId.remove({"_id": divId._id});
1631
    communities = db.community.find({ "type" : portalType }).map( function(community) { return community; } );
1632
    for (var j = 0; j < communities.length; j++) {
1633
      db.divHelpContent.remove({"divId": divId._id.str, "community": communities[j]._id.str});
1634
    }
1635
  } else {
1636
    if (create) {
1637
      db.divId.save({"name": divId.name, "pages": pages, "portalType": portalType});
1638
1639
      divIdForPortalType = db.divId.find({portalType: portalType, "name" : divId.name}).map(function (divId) { return divId._id.str; }).toString();
1640
1641
      communityId = db.community.find({pid: pid}).map(function (community) { return community._id.str; }).toString();
1642
1643
      updateDivIdHelpContentsForPortalPage(divId._id.str, divIdForPortalType, communityId);
1644
    } else {
1645
      db.divId.save({"_id": divId._id, "name": divId.name, "pages": pages, "portalType": portalType});
1646
    }
1647 58550 k.triantaf
  }
1648
}
1649
1650 59470 konstantin
function updateDivIdHelpContentsForPortalPage(divIdId, newDivIdId, communityId) {
1651
  divHelpContents = db.divHelpContent.find({"divId" : divIdId, "community" : communityId,}).map( function(divHelpContent) { return divHelpContent; } );
1652
  for (var i = 0; i < divHelpContents.length; i++) {
1653
    divHelpContent = divHelpContents[i];
1654 56917 k.triantaf
1655 59470 konstantin
    db.divHelpContent.save({
1656
      "_id": divHelpContent._id,
1657
      "divId" : newDivIdId,
1658
      "community" : communityId,
1659
      "content" : divHelpContent.content,
1660
      "isActive" : divHelpContent.isActive
1661
    });
1662
  }
1663
}
1664
1665
function renameCollectionAndFields() {
1666
  db.community.renameCollection("portal");
1667
  db.communitySubscribers.renameCollection("portalSubscribers");
1668
1669
  db.divHelpContent.update({"community": {$exists: true}}, {$rename:{"community":"portal"}}, false, true);
1670
  db.pageHelpContent.update({"community": {$exists: true}}, {$rename:{"community":"portal"}}, false, true);
1671
  db.notifications.update({"communityPid": {$exists: true}}, {$rename:{"communityPid":"portalPid"}}, false, true);
1672
}
1673
1674
function addPortalPidInLayoutRecords() {
1675
  communities = db.portal.find().map( function(community) { return community; } );
1676
  for (var j = 0; j < communities.length; j++) {
1677
    community = communities[j];
1678
    if(community.layout) {
1679
      layout = db.layout.findOne({"_id": ObjectId(community.layout)});
1680
      db.layout.save({
1681
        "_id": layout._id,
1682
        "mainColor": layout.mainColor,
1683
        "secondaryColor": layout.secondaryColor,
1684
        "panel": layout.panel,
1685
        "box": layout.box,
1686
        "links": layout.links,
1687
        "buttons": layout.buttons,
1688
        "portalPid": community.pid
1689
      })
1690
1691
      db.portal.update({"_id": community._id}, {$unset: {layout:""}});
1692
    }
1693
  }
1694
}
1695
1696 60497 konstantin
// 22-10-2020
1697
function addPiwik() {
1698
  db.portal.update({"pid": "openaire"}, {$set: {piwik:"6"}});
1699
  db.portal.update({"pid": "connect"}, {$set: {piwik:"80"}});
1700
  db.portal.update({"pid": "dh-ch"}, {$set: {piwik:"81"}});
1701
  db.portal.update({"pid": "ee"}, {$set: {piwik:"82"}});
1702
  db.portal.update({"pid": "egi"}, {$set: {piwik:"83"}});
1703
  db.portal.update({"pid": "elixir-gr"}, {$set: {piwik:"84"}});
1704
  db.portal.update({"pid": "fam"}, {$set: {piwik:"85"}});
1705
  db.portal.update({"pid": "instruct"}, {$set: {piwik:"86"}});
1706
  db.portal.update({"pid": "mes"}, {$set: {piwik:"87"}});
1707
  db.portal.update({"pid": "ni"}, {$set: {piwik:"88"}});
1708
  db.portal.update({"pid": "oa-pg"}, {$set: {piwik:"89"}});
1709
  db.portal.update({"pid": "rda"}, {$set: {piwik:"90"}});
1710
  db.portal.update({"pid": "aginfra"}, {$set: {piwik:"93"}});
1711
  db.portal.update({"pid": "clarin"}, {$set: {piwik:"100"}});
1712
  db.portal.update({"pid": "dariah"}, {$set: {piwik:"103"}});
1713
  db.portal.update({"pid": "epos"}, {$set: {piwik:"217"}});
1714
  db.portal.update({"pid": "beopen"}, {$set: {piwik:"218"}});
1715
  db.portal.update({"pid": "risis"}, {$set: {piwik:"219"}});
1716
  db.portal.update({"pid": "science-innovation-policy"}, {$set: {piwik:"253"}});
1717
  db.portal.update({"pid": "covid-19"}, {$set: {piwik:"267"}});
1718
  db.portal.update({"pid": "rural-digital-europe"}, {$set: {piwik:"319"}});
1719
  db.portal.update({"pid": "enermaps"}, {$set: {piwik:"318"}});
1720 61089 konstantin
1721
  db.portal.update({"pid": "galaxy"}, {$set: {piwik:"453"}});
1722
  db.portal.update({"pid": "gotriple"}, {$set: {piwik:"490"}});
1723
  db.portal.update({"pid": "neanias-underwater"}, {$set: {piwik:"474"}});
1724
  // db.portal.update({"pid": "embrc"}, {$set: {piwik:"474"}});
1725 60497 konstantin
}
1726
1727 61089 konstantin
// 03-06-2021
1728
function addFooterDivIdForConnect() {
1729
  connectHomePageID = db.page.find({"portalType": "connect", "route": "/"}).map( function(page) { return page._id.str; } ).toString();
1730
  db.divId.save({ "name" : "footer", "pages" : [ connectHomePageID ], "portalType" : "connect" });
1731
  print("divId 'footer' added for connect (home page id: "+connectHomePageID + ")");
1732
}
1733
1734
function addFooterDivIdForCommunities() {
1735
  // db.page.save({ "route" : "/", "name" : "Home", "type" : "other", "entities" : [ ], "portalType" : "community", "top" : false, "bottom" : false, "left" : false, "right" : false });
1736
  // print("page 'Home' added for communities");
1737
1738
  communityHomePageID = db.page.find({"portalType": "community", "route": "/"}).map( function(community) { return community._id.str; } ).toString();
1739
  db.divId.save({ "name" : "footer", "pages" : [ communityHomePageID ], "portalType" : "community" });
1740
  print("divId 'footer' added for communities (home page id: "+communityHomePageID + ")");
1741
}
1742
1743
function addHomePageInCommunities() {
1744
  communityHomePageID = db.page.insertOne({ "route" : "/", "name" : "Home", "type" : "other", "entities" : [ ], "portalType" : "community", "top" : false, "bottom" : false, "left" : false, "right" : false }).insertedId.str;
1745
  print("Creating Home page with id " + communityHomePageID);
1746
  communities = db.portal.find({"type": "community"}).map( function(community) { return community; } );
1747
  for (var i = 0; i < communities.length; i++) {
1748
    community_pages = communities[i].pages;
1749
1750
    community_pages[communityHomePageID] = true;
1751
1752
    community_pid = communities[i].pid;
1753 61095 konstantin
    db.portal.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
1754 61089 konstantin
    print("Add home page with id " + communityHomePageID + " on community " + community_pid);
1755
  }
1756
}
1757
1758
function addFooterHelpTextForConnect() {
1759
  connectID = db.portal.find({ "pid" : "connect"}).map( function(portal) { return portal._id.str; } ).toString();
1760
  connectFooterDivIdID = db.divId.find({"portalType": "connect", "name": "footer"}).map( function(divId) { return divId._id.str; } ).toString();
1761
1762
  db.divHelpContent.save(
1763
    { "divId" : connectFooterDivIdID,
1764
      "portal" : connectID,
1765
      "content" : "<p class=\"uk-margin-remove-bottom\"><span style=\"font-size:8pt\">" +
1766
        "OpenAIRE has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541, 731011 and 101017452" +
1767
        "</span></p>",
1768
      "isActive" : true
1769
    }
1770
  );
1771
1772
  print("div help text for divId 'footer' added for connect (connect id: "+ connectID + " - footer divId id: "+connectFooterDivIdID + ")");
1773
}
1774
1775
function addFooterHelpTextForCommunities() {
1776
  communityFooterDivIdID = db.divId.find({"portalType": "community", "name": "footer"}).map( function(divId) { return divId._id.str; } ).toString();
1777
1778
  communities = db.portal.find({"type": "community"}).map( function(community) { return community; } );
1779
  for (var j = 0; j < communities.length; j++) {
1780
    community = communities[j];
1781
1782 61091 konstantin
    var content = "This OpenAIRE gateway is part of a project that has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541, 731011 and 101017452";
1783 61089 konstantin
1784
    if(community.pid == "aginfra" || community.pid == "rural-digital-europe") {
1785
      content = "This OpenAIRE gateway is part of a project that has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541, 731011 and 101017452";
1786
1787
    } else if(community.pid == "clarin" || community.pid == "covid-19" || community.pid == "dariah"
1788
      || community.pid == "dh-ch" || community.pid == "egi" || community.pid == "mes" || community.pid == "epos"
1789
      || community.pid == "elixir-gr" || community.pid == "fam" || community.pid == "ni"
1790
      || community.pid == "sdsn-gr" || community.pid == "instruct" || community.pid == "instruct"
1791
      || community.pid == "rda" || community.pid == "gotriple") {
1792
1793
      content = "This OpenAIRE gateway is part of a project that has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541, 731011 and 101017452";
1794
1795
    } else if(community.pid == "enermaps") {
1796
      content = "This OpenAIRE gateway is part of a project that has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541, 731011, 101017452 and 884161";
1797
1798
    } else if(community.pid == "beopen") {
1799
      content = "This OpenAIRE gateway is part of a project that has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541, 731011, 101017452 and 824323";
1800
1801
    } else if(community.pid == "risis" || community.pid == "science-innovation-policy") {
1802
      content = "This OpenAIRE gateway is part of a project that has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541, 731011, 101017452 and 824091";
1803
    }
1804
1805
    db.divHelpContent.save(
1806
      { "divId" : communityFooterDivIdID,
1807
        "portal" : community._id.str,
1808
        "content" : "<p class=\"uk-margin-remove-bottom\"><span style=\"font-size:8pt\">"+content+"</span></p>",
1809
        "isActive" : true
1810
      }
1811
    );
1812
1813
    print("div help text for divId 'footer' added for community (community id: "+ community._id + " - community pid: " + community.pid + " - footer divId id: "+communityFooterDivIdID + ")");
1814
  }
1815
}
1816
1817
// 04-06-2021 debug helper function
1818
function cleanPagesFromPortals() {
1819
  portals = db.portal.find().map( function(portal) { return portal; } );
1820
  for (var j = 0; j < portals.length; j++) {
1821
    portal = portals[j];
1822
    portal_pages = portal.pages;
1823
1824
    for (var key in portal_pages) {
1825
      // print(key);
1826
      // db.page.findOne({"_id": ObjectId(+'"'+key+'"')});
1827
      if(db.page.find({"_id": ObjectId(key)}).map( function(page) { return page; } ).length == 0) {
1828
        delete portal_pages[key];
1829
        print("deleted page: "+key + " from portal: "+portal.pid);
1830
      }
1831
    }
1832
    portal_pid = portal.pid;
1833
    db.portal.update({ "pid" : portal_pid },{$set: { "pages": portal_pages}});
1834
  }
1835
}
1836
1837 59470 konstantin
use openaireconnect;
1838
1839 52308 konstantin
//updatePages();
1840 51623 konstantin
1841
//updateTypeOfLandingPages();
1842 51828 konstantin
//removeEntitiesFromSearchFindPage();
1843 52308 konstantin
//initDivHelpContents();
1844
1845
//createContentPageWithTypeOther();
1846
//createPagesWithTypeHtml();
1847
//addContent_About_Organizations_PagesToCommunities();
1848
//createCollectionForHtmlPageContents();
1849
//addDefaultHtmlToHtmlPages();
1850
1851 52811 konstantin
//createMonitorPageWithTypeOther();
1852
//addMonitorPageToCommunities();
1853
1854 52897 argiro.kok
//createOtherResearchProducts();
1855 53555 konstantin
1856 55027 k.triantaf
//addDefaultHtmlToHtmlPagesForCommunity("clarin");
1857
//createNotificationsCollection();
1858
//addDivHelpContentsForCommunity("clarin");
1859
//addORPInStatistics();
1860
//createShareInZenodoPage();
1861 56039 k.triantaf
//addCommunityLayout();
1862 56174 konstantin
//addCuratorsPage();
1863
//removeMonitorPage();
1864 56293 konstantin
1865
//pageOptionConnectAsCommunities();
1866
1867 56679 konstantin
//organizationsPageTypeFromHtmlToOther();
1868
//removeHtmlPageContentsFromOrganizationsPage();
1869
//addOpenaireConnectCommunitiesOptionsInDivIds();
1870
//addHomeNewsAndOrganizationsDivIds();
1871
//removeLinkingDivHelpContentsForCommunitiesAndConnect();
1872
1873 56785 konstantin
1874
//-----------------------------------------------------
1875 56917 k.triantaf
// addMissingAndNewPages();
1876
// changePageRoutesAboutAndZenodo();
1877
// addDepositPoliciesHelpContentInAllCommunities();
1878
// moveOrganizationsDivHelpContentsToPageHelpContents();
1879
// deleteHomeDivHelpContents();
1880
// deleteHomeAndOrganizationsDivIds();
1881
// enableProjectReportPageInCommunities();
1882
//
1883
// addPositionsInPages();
1884
//
1885
//
1886
// addHelpTextsInHomePage();
1887
// addHelpTextsInAboutLearnHowPage();
1888
// addHelpTextsInAboutLearnInDepthPage();
1889
// addHelpTextsInContactUsPage();
1890
//
1891
// addHelpTextsInContentPolicyPage();
1892
//
1893
// addNewRoutesInCommunities();
1894 57319 k.triantaf
//addMyCommunitiesPage();
1895
//removeFaultyEmptyPageFromCommunities();
1896
1897 58306 konstantin
// /* 08-10-2019*/
1898
// removeOldLayouts();
1899
1900
// 13-03-2020
1901 58476 konstantin
//addSearchResearchOutcomesPages();
1902
1903 59470 konstantin
// 02-02-2020 - 19-03-2020
1904 61089 konstantin
// addPortalType();
1905
// createPagesForEachPortalType();
1906
// createDivIdsForEachPortalType();
1907
// renameCollectionAndFields();
1908
// addPortalPidInLayoutRecords();
1909 60497 konstantin
1910
// 22-10-2020
1911 61089 konstantin
// addPiwik();
1912
1913
// 03-06-2021
1914
addFooterDivIdForConnect();
1915 61095 konstantin
addFooterHelpTextForConnect();
1916
addHomePageInCommunities();
1917 61089 konstantin
addFooterDivIdForCommunities();
1918
addFooterHelpTextForCommunities();
1919
1920
// 04-06-2021 debug helper function
1921 61554 konstantin
// cleanPagesFromPortals();
1922
1923
// 07-06-2021 debug helper function
1924
// cleanDivHelpTexts();