Project

General

Profile

1
//version compatibility: 1.1.1-SNAPSHOT
2
print("here");
3

    
4
function dropDB(){
5
print("\n\n Drop DB\n\n")
6
	db.dropDatabase()
7
}
8
function createCollections(){
9
print("\n\n Create Collections \n\n")
10
	db.createCollection("community")
11
	db.createCollection("divHelpContent")
12
	db.createCollection("divId")
13
	db.createCollection("entity")
14
	db.createCollection("page")
15
	db.createCollection("pageHelpContent")
16
	db.createCollection("statistics")
17
	db.createCollection("communitySubscribers")
18
	db.createCollection("htmlPageContent")
19
	db.createCollection("notifications")
20
}
21
function initializeEntitiesPagesDivIds(){
22
print("\n\n Initialize entities, pages & divIds \n\n")
23
	db.entity.save({"pid" : "publication", "name" : "Publication"})
24
	db.entity.save({"pid" : "dataset", "name" : "Research Data"})
25
	db.entity.save({"pid" : "software", "name" : "Software"})
26
	db.entity.save({"pid" : "orp", "name" : "Other Research Products"});
27
	db.entity.save({"pid" : "project", "name" : "Project"})
28
	db.entity.save({"pid" : "organization", "name" : "Organization"})
29
	db.entity.save({"pid" : "datasource", "name" : "Content Provider"})
30

    
31
	publicationId = db.entity.find( { pid: "publication" }).map( function(entity) { return entity._id.str; } ).toString()
32
	datasetId = db.entity.find( { pid: "dataset" }).map( function(entity) { return entity._id.str; } ).toString()
33
	softwareId = db.entity.find( { pid: "software" }).map( function(entity) { return entity._id.str; } ).toString()
34
	orpId = db.entity.find( { pid: "orp" }).map( function(entity) { return entity._id.str; } ).toString();
35
	projectId = db.entity.find( { pid: "project" }).map( function(entity) { return entity._id.str; } ).toString()
36
	organizationId = db.entity.find( { pid: "organization" }).map( function(entity) { return entity._id.str; } ).toString()
37
	datasourceId = db.entity.find( { pid: "datasource" }).map( function(entity) { return entity._id.str; } ).toString()
38

    
39
	db.page.save({"name" : "Publication Landing", "route" : "/search/publication", "type" : "landing", "connect":true,"openaire":true,"entities" : [publicationId]})
40
	db.page.save({"name" : "Research Data Landing", "route" : "/search/dataset", "type" : "landing", "connect":true,"openaire":true,"entities" : [datasetId]})
41
	db.page.save({"name" : "Software Landing", "route" : "/search/software", "type" : "landing", "connect":true,"openaire":true,"entities" : [softwareId]})
42
	db.page.save({"name" : "Other Research Products Landing", "route" : "/search/other", "type" : "landing", "connect":true,"openaire":true,"entities" : [orpId]});
43
	db.page.save({"name" : "Project Landing", "route" : "/search/project", "type" : "landing", "connect":true,"openaire":true,"entities" : [projectId]})
44
	db.page.save({"name" : "Organization Landing", "route" : "/search/organization", "type" : "landing", "connect":true,"openaire":true,"entities" : [organizationId]})
45
	db.page.save({"name" : "Content Provider Landing", "route" : "/search/dataprovider", "type" : "landing", "connect":true,"openaire":true,"entities" : [datasourceId]})
46
	db.page.save({"name" : "Project Report", "route" : "/project-report", "type" : "landing", "connect":false,"openaire":true,"entities" : [projectId]})
47

    
48
	db.page.save({"name" : "Search Find", "type" : "search", "connect":false,"openaire":true,"entities" : [], "route" : "/search/find"})
49

    
50
	db.page.save({"name" : "Search Publications", "route" : "/search/find/publications", "type" : "search", "connect":true,"openaire":true,"entities" : [publicationId]})
51
	db.page.save({"name" : "Search Research Data", "route" : "/search/find/datasets", "type" : "search", "connect":true,"openaire":true,"entities" : [datasetId]})
52
	db.page.save({"name" : "Search Software", "route" : "/search/find/software", "type" : "search", "connect":true,"openaire":true,"entities" : [softwareId]})
53
	db.page.save({"name" : "Search Other Research Products", "route" : "/search/find/other", "type" : "search", "connect":true,"openaire":true,"entities" : [orpId]});
54
	db.page.save({"name" : "Search Projects", "route" : "/search/find/projects", "type" : "search", "connect":true,"openaire":true,"entities" : [projectId]})
55
	db.page.save({"name" : "Search Organizations", "route" : "/search/find/organizations", "type" : "search", "connect":false,"openaire":true,"entities" : [organizationId]})
56
	db.page.save({"name" : "Search Content Providers", "route" : "/search/find/dataproviders", "type" : "search", "connect":true,"openaire":true,"entities" : [datasourceId]})
57

    
58
	db.page.save({"name" : "Advanced Search Publications", "route" : "/search/advanced/publications", "type" : "search", "connect":true,"openaire":true,"entities" : [publicationId]})
59
	db.page.save({"name" : "Advanced Search Research Data ", "route" : "/search/advanced/datasets", "type" : "search", "connect":true,"openaire":true,"entities" : [datasetId]})
60
	db.page.save({"name" : "Advanced Search Software", "route" : "/search/advanced/software", "type" : "search", "connect":true,"openaire":true,"entities" : [softwareId]})
61
	db.page.save({"name" : "Advanced Search Other Research Products", "route" : "/search/advanced/other", "type" : "search", "connect":true,"openaire":true,"entities" : [orpId]});
62
	db.page.save({"name" : "Advanced Search Projects", "route" : "/search/advanced/projects", "type" : "search", "connect":false,"openaire":true,"entities" : [projectId]})
63
	db.page.save({"name" : "Advanced Search Organizations", "route" : "/search/advanced/organizations", "type" : "search", "connect":false,"openaire":true,"entities" : [organizationId]})
64
	db.page.save({"name" : "Advanced Search Content Providers", "route" : "/search/advanced/dataproviders", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
65

    
66
	db.page.save({"name" : "Search Journals", "route" : "/search/journals", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
67
	db.page.save({"name" : "Search Entity Registries", "route" : "/search/entity-registries", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
68
	db.page.save({"name" : "Search Compatible Content Providers", "route" : "/search/content-providers", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
69
	db.page.save({"name" : "Search Journals - Table view", "route" : "/search/journals-table", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
70
	db.page.save({"name" : "Search Entity Registries - Table view", "route" : "/search/entity-registries-table", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
71
	db.page.save({"name" : "Search Compatible Content Providers -Table view", "route" : "/search/content-providers-table", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
72

    
73
	db.page.save({"name" : "Deposit Publications", "route" : "/participate/deposit-publications", "type" : "share", "connect":true,"openaire":true,"entities" : [publicationId]})
74
	db.page.save({"name" : "Deposit Research Data", "route" : "/participate/deposit-datasets", "type" : "share", "connect":true,"openaire":true,"entities" : [datasetId]})
75
	db.page.save({"name" : "Deposit Publications Results", "route" : "/participate/deposit-publications-result", "type" : "share", "connect":true,"openaire":true,"entities" : [publicationId]})
76
	db.page.save({"name" : "Deposit Research Data Results", "route" : "/participate/deposit-datasets-result", "type" : "share", "connect":true,"openaire":true,"entities" : [datasetId]})
77
	db.page.save({"name" : "Deposit Research Data subject result", "route" : "/participate/deposit-subject-result", "type" : "share", "connect":true,"openaire":true,"entities" : [datasetId]})
78
	db.page.save({"name" : "Share in Zenodo", "route" : "/participate/share-zenodo", "type" : "share", "connect":true,"openaire":false,"entities" : []})
79

    
80
	db.page.save({"name" : "Link", "route" : "/participate/claim", "type" : "link", "connect":true,"openaire":true,"entities" : [projectId]})
81
	db.page.save({"name" : "Direct Link", "route" : "/participate/direct-claim", "type" : "link", "connect":true,"openaire":true,"entities" : []})
82
	db.page.save({"name" : "My claims", "route" : "/myclaims", "type" : "link", "connect":true,"openaire":true,"entities" : []})
83
	db.page.save({"name" : "Administrator claims", "route" : "/claims", "type" : "link", "connect":true,"openaire":true,"entities" : []})
84
	db.page.save({"name" : "Claims Project Manager", "route" : "/claims-project-manager", "type" : "link", "connect":false,"openaire":true,"entities" : []})
85

    
86
	db.page.save({"name" : "Monitor", "route" : "/monitor", "type" : "other", "connect":true,"openaire":false,"entities" : []})
87

    
88
	db.page.save({"name" : "About", "route" : "/about", "type" : "html", "connect":true,"openaire":false,"entities" : []})
89
	db.page.save({"name" : "Organizations", "route" : "/organizations", "type" : "html", "connect":true,"openaire":false,"entities" : []})
90

    
91
    link = db.page.find( { route: "/participate/claim" }).map( function(page) { return page._id.str; } ).toString()
92
	directLink = db.page.find( { route: "/participate/direct-claim" }).map( function(page) { return page._id.str; } ).toString()
93

    
94
	db.divId.save({ "name" : "link-context-form", "pages" : [link, directLink]})
95
    db.divId.save({ "name" : "link-project-form", "pages" : [link, directLink]})
96
    db.divId.save({ "name" : "link-result-form", "pages" : [link, directLink]})
97
    db.divId.save({ "name" : "link-result-bulk", "pages" : [link]})
98
    db.divId.save({ "name" : "link-metadata", "pages" : [link, directLink]})
99
}
100
function createCommunity(name,communityPid){
101
    var communitySaved =  db.community.find( { pid: communityPid }).map( function(community) { return community._id.str; } ).toString()
102
    if(communitySaved){
103
        print("\n\n Community \'"+name +"\' exists\n\n");
104
        return ;
105
    }
106
    print("\n\n Create community \n\n");
107
    print("Name:"+name);
108
    print("communityPid:"+communityPid);
109

    
110
	publicationLanding = db.page.find( { route: "/search/publication" }).map( function(page) { return page._id.str; } ).toString()
111
	datasetLanding = db.page.find( { route: "/search/dataset" }).map( function(page) { return page._id.str; } ).toString()
112
	softwareLanding = db.page.find( { route: "/search/software" }).map( function(page) { return page._id.str; } ).toString()
113
	orpLanding = db.page.find( { route: "/search/other" }).map( function(page) { return page._id.str; } ).toString();
114
	projectLanding = db.page.find( { route: "/search/project" }).map( function(page) { return page._id.str; } ).toString()
115
	organizationLanding = db.page.find( { route: "/search/organization" }).map( function(page) { return page._id.str; } ).toString()
116
	dataproviderLanding = db.page.find( { route: "/search/dataprovider" }).map( function(page) { return page._id.str; } ).toString()
117
	projectReport = db.page.find( { route: "/project-report" }).map( function(page) { return page._id.str; } ).toString()
118

    
119
	searchFind = db.page.find( { route: "/search/find" }).map( function(page) { return page._id.str; } ).toString()
120

    
121
	searchPublications = db.page.find( { route: "/search/find/publications" }).map( function(page) { return page._id.str; } ).toString()
122
	searchDatasets = db.page.find( { route: "/search/find/datasets" }).map( function(page) { return page._id.str; } ).toString()
123
	searchSoftware = db.page.find( { route: "/search/find/software" }).map( function(page) { return page._id.str; } ).toString()
124
	searchOrp = db.page.find( { route: "/search/find/other" }).map( function(page) { return page._id.str; } ).toString();
125
	searchProject = db.page.find( { route: "/search/find/projects" }).map( function(page) { return page._id.str; } ).toString()
126
	searchOrganization = db.page.find( { route: "/search/find/organizations" }).map( function(page) { return page._id.str; } ).toString()
127
	searchDataprovider = db.page.find( { route: "/search/find/dataproviders" }).map( function(page) { return page._id.str; } ).toString()
128

    
129
	advancedSearchPublications = db.page.find( { route: "/search/advanced/publications" }).map( function(page) { return page._id.str; } ).toString()
130
	advancedSearchDatasets = db.page.find( { route: "/search/advanced/datasets" }).map( function(page) { return page._id.str; } ).toString()
131
	advancedSearchSoftware = db.page.find( { route: "/search/advanced/software" }).map( function(page) { return page._id.str; } ).toString()
132
	advancedSearchOrp = db.page.find( { route: "/search/advanced/other" }).map( function(page) { return page._id.str; } ).toString();
133
	advancedSearchProject = db.page.find( { route: "/search/advanced/projects" }).map( function(page) { return page._id.str; } ).toString()
134
	advancedSearchOrganization = db.page.find( { route: "/search/advanced/organizations" }).map( function(page) { return page._id.str; } ).toString()
135
	advancedSearchDataprovider = db.page.find( { route: "/search/advanced/dataproviders" }).map( function(page) { return page._id.str; } ).toString()
136

    
137
	searchJournals = db.page.find( { route: "/search/journals" }).map( function(page) { return page._id.str; } ).toString()
138
	searchEntityRegistries = db.page.find( { route: "/search/entity-registries" }).map( function(page) { return page._id.str; } ).toString()
139
	searchContentProviders = db.page.find( { route: "/search/content-providers" }).map( function(page) { return page._id.str; } ).toString()
140
	searchJournalsTable = db.page.find( { route: "/search/journals-table" }).map( function(page) { return page._id.str; } ).toString()
141
	searchEntityRegistriesTable = db.page.find( { route: "/search/entity-registries-table" }).map( function(page) { return page._id.str; } ).toString()
142
	searchContentProvidersTable = db.page.find( { route: "/search/content-providers-table" }).map( function(page) { return page._id.str; } ).toString()
143

    
144
	depositPublications = db.page.find( { route: "/participate/deposit-publications" }).map( function(page) { return page._id.str; } ).toString()
145
	depositDatasets = db.page.find( { route: "/participate/deposit-datasets" }).map( function(page) { return page._id.str; } ).toString()
146
	depositPublicationsResults = db.page.find( { route: "/participate/deposit-publications-result" }).map( function(page) { return page._id.str; } ).toString()
147
	depositDatasetsResults = db.page.find( { route: "/participate/deposit-datasets-result" }).map( function(page) { return page._id.str; } ).toString()
148
	depositDatasetSybjectResults = db.page.find( { route: "/participate/deposit-subject-result" }).map( function(page) { return page._id.str; } ).toString()
149
    shareInZenodo = db.page.find( { route: "/participate/share-zenodo" }).map( function(page) { return page._id.str; } ).toString();
150

    
151
	link = db.page.find( { route: "/participate/claim" }).map( function(page) { return page._id.str; } ).toString()
152
	directLink = db.page.find( { route: "/participate/direct-claim" }).map( function(page) { return page._id.str; } ).toString()
153
	myClaims = db.page.find( { route: "/myclaims" }).map( function(page) { return page._id.str; } ).toString()
154
	administratorClaims = db.page.find( { route: "/claims" }).map( function(page) { return page._id.str; } ).toString()
155
	claimsProjectManager = db.page.find( { route: "/claims-project-manager" }).map( function(page) { return page._id.str; } ).toString()
156

    
157
	monitor = db.page.find( { route: "/monitor" }).map( function(page) { return page._id.str; } ).toString()
158

    
159
	about = db.page.find( { route: "/about" }).map( function(page) { return page._id.str; } ).toString()
160
	organizations = db.page.find( { route: "/organizations" }).map( function(page) { return page._id.str; } ).toString()
161

    
162
	var community_pages = {}
163
	community_pages[publicationLanding] = true;
164
	community_pages[datasetLanding] = true;
165
	community_pages[softwareLanding] = true;
166
	community_pages[orpLanding] = true;
167
	community_pages[projectLanding] = true;
168
	community_pages[organizationLanding] = true;
169
	community_pages[dataproviderLanding] = true;
170
	community_pages[projectReport] = true;
171
	community_pages[searchFind] = true;
172
	community_pages[searchPublications] = true;
173
	community_pages[searchDatasets] = true;
174
	community_pages[searchSoftware] = true;
175
	community_pages[searchOrp] = true;
176
	community_pages[searchProject] = true;
177
	community_pages[searchOrganization] = true;
178
	community_pages[searchDataprovider] = true;
179
	community_pages[advancedSearchPublications] = true;
180
	community_pages[advancedSearchDatasets] = true;
181
	community_pages[advancedSearchSoftware] = true;
182
	community_pages[advancedSearchOrp] = true;
183
	community_pages[advancedSearchProject] = true;
184
	community_pages[advancedSearchOrganization] = true;
185
	community_pages[advancedSearchDataprovider] = true;
186
	community_pages[searchJournals] = true;
187
	community_pages[searchEntityRegistries] = true;
188
	community_pages[searchContentProviders] = true;
189
	community_pages[searchJournalsTable] = true;
190
	community_pages[searchEntityRegistriesTable] = true;
191
	community_pages[searchContentProvidersTable] = true;
192
	community_pages[depositPublications] = true;
193
	community_pages[depositDatasets] = true;
194
	community_pages[depositPublicationsResults] = true;
195
	community_pages[depositDatasetsResults] = true;
196
	community_pages[depositDatasetSybjectResults] = true;
197
	community_pages[shareInZenodo] = true;
198
	community_pages[link] = true;
199
	community_pages[directLink] = true;
200
	community_pages[myClaims] = true;
201
	community_pages[administratorClaims] = true;
202
	community_pages[claimsProjectManager] = true;
203
	community_pages[monitor] = true;
204
	community_pages[about] = false;
205
	community_pages[organizations] = false;
206

    
207
	publicationId = db.entity.find( { pid: "publication" }).map( function(entity) { return entity._id.str; } ).toString()
208
	datasetId = db.entity.find( { pid: "dataset" }).map( function(entity) { return entity._id.str; } ).toString()
209
	softwareId = db.entity.find( { pid: "software" }).map( function(entity) { return entity._id.str; } ).toString()
210
	orpId = db.entity.find( { pid: "orp" }).map( function(entity) { return entity._id.str; } ).toString();
211
	projectId = db.entity.find( { pid: "project" }).map( function(entity) { return entity._id.str; } ).toString()
212
	organizationId = db.entity.find( { pid: "organization" }).map( function(entity) { return entity._id.str; } ).toString()
213
	datasourceId = db.entity.find( { pid: "datasource" }).map( function(entity) { return entity._id.str; } ).toString();
214
	print("PAges:"+publicationId);
215
	var community_entities = {}
216
	community_entities[publicationId] = true;
217
	community_entities[datasetId] = true;
218
	community_entities[softwareId] = true;
219
	community_entities[orpId] = true;
220
	community_entities[projectId] = true;
221
	community_entities[organizationId] = true;
222
	community_entities[datasourceId] = true;
223

    
224
 	db.community.save({	"name" : name, "pid" : communityPid, "pages" : community_pages, "entities" : community_entities})
225

    
226
	openaireCommunity = db.community.find( { pid: communityPid }).map( function(community) { return community._id.str; } ).toString()
227

    
228
    var numbers_map = {};
229
        numbers_map["total"] = { "showInMonitor" : true, "showInDashboard" : false };
230
        numbers_map["project"] = { "showInMonitor" : true, "showInDashboard" : false };
231
        numbers_map["open"] = { "showInMonitor" : true, "showInDashboard" : false };
232
        numbers_map["closed"] = { "showInMonitor" : true, "showInDashboard" : false };
233
        numbers_map["embargo"] = { "showInMonitor" : true, "showInDashboard" : false };
234
        numbers_map["restricted"] = { "showInMonitor" : true, "showInDashboard" : false };
235
    var numbers = {"map":numbers_map};
236
    var charts_map = {};
237
        charts_map["timeline"] = { "showInMonitor" : true, "showInDashboard" : false };
238
        charts_map["graph"] = { "showInMonitor" : true, "showInDashboard" : false };
239
        charts_map["projectTable"] = { "showInMonitor" : true, "showInDashboard" : false };
240
        charts_map["projectColumn"] = { "showInMonitor" : true, "showInDashboard" : false };
241
        charts_map["projectPie"] = { "showInMonitor" : true, "showInDashboard" : false };
242
    var charts = {"map":charts_map};
243

    
244
	var statistics_entities = {"charts":charts,"numbers":numbers}
245
	var entities = {};
246
	entities["publication"]=statistics_entities;
247
	entities["dataset"]=statistics_entities;
248
	entities["software"]=statistics_entities;
249
    entities["orp"]=statistics_entities;
250
	var statistics = {"pid" : communityPid, "entities" : entities};
251

    
252
    db.statistics.save(statistics);
253

    
254
    var subscribers = [];
255
    db.communitySubscribers.save({ "pid" : communityPid, "subscribers" : subscribers})
256

    
257
    link_context_form = db.divId.find( { name: "link-context-form" }).map( function(divId) { return divId._id.str; } ).toString();
258
    link_project_form = db.divId.find( { name: "link-project-form" }).map( function(divId) { return divId._id.str; } ).toString();
259
    link_result_form = db.divId.find( { name: "link-result-form" }).map( function(divId) { return divId._id.str; } ).toString();
260
    link_result_bulk = db.divId.find( { name: "link-result-bulk" }).map( function(divId) { return divId._id.str; } ).toString();
261
    link_metadata = db.divId.find( { name: "link-metadata" }).map( function(divId) { return divId._id.str; } ).toString();
262

    
263
    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>';
264
    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>';
265
    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> ';
266
    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> ';
267
    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>';
268

    
269
    communityID = db.community.find({ "pid" : communityPid}).map( function(community) { return community._id.str.toString(); } );
270

    
271
    db.divHelpContent.save({ "divId" : link_context_form, "community" : communityID, "content" : link_context_form_content, "isActive" : false });
272
    db.divHelpContent.save({ "divId" : link_project_form, "community" : communityID, "content" : link_project_form_content, "isActive" : false });
273
    db.divHelpContent.save({ "divId" : link_result_form, "community" : communityID, "content" : link_result_form_content, "isActive" : true });
274
    db.divHelpContent.save({ "divId" : link_result_bulk, "community" : communityID, "content" : link_result_bulk_content, "isActive" : true });
275
    db.divHelpContent.save({ "divId" : link_metadata, "community" : communityID, "content" : link_metadata_content, "isActive" : false });
276

    
277
print("\n\n Done \n\n");
278

    
279
}
280
function createAllCommunities(){
281
    createCommunity("OpenAIRE","openaire");
282
    createCommunity("EGI Federation","egi");
283
    createCommunity("SDSN - Greece ","ee");
284
    createCommunity("Fisheries and Aquaculture Management","fam");
285
    createCommunity("Instruct-ERIC","instruct");
286
    createCommunity("Elixir","elixir-gr");
287
    createCommunity("European Marine Science","mes");
288
    createCommunity("EC post-grant Open Access Pilot","oa-pg");
289
    createCommunity("Neuroinformatics","ni");
290
    createCommunity("Research Data Alliance","rda");
291
    createCommunity("Digital Humanities and Cultural Heritage","dh-ch");
292
	createCommunity("AGINFRA","aginfra");
293
	createCommunity("Clarin","clarin");
294
}
295

    
296
function addDefaultHtmlToHtmlPages() {
297
	about = db.page.find( { route: "/about" }).map( function(page) { return page._id.str; } ).toString()
298
	organizations = db.page.find( { route: "/organizations" }).map( function(page) { return page._id.str; } ).toString()
299

    
300
	communities = db.community.find().map( function(community) { return community._id.str.toString(); } );
301

    
302
	for (var i = 0; i < communities.length; i++) {
303
 		db.htmlPageContent.save({"page" : about, "community" : communities[i], "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>'})
304
 		db.htmlPageContent.save({"page" : organizations, "community" : communities[i], "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>'})
305
	}
306
}
307

    
308
use openaire_admin;
309

    
310
dropDB();
311
createCollections();
312
initializeEntitiesPagesDivIds();
313
createAllCommunities();
314
addDefaultHtmlToHtmlPages();
(2-2/4)