Index: modules/uoa-admin-tools/update_db.js
===================================================================
--- modules/uoa-admin-tools/update_db.js	(revision 51507)
+++ modules/uoa-admin-tools/update_db.js	(revision 51508)
@@ -2,47 +2,102 @@
 
 use openaire_admin;
 
-db.statistics.drop();
-db.createCollection("statistics")
+function updateStats(){
+    print("Update Stats...")
+    db.statistics.drop();
+    db.createCollection("statistics")
 
-var communities = db.community.find().map( function(entity) { return entity.pid } );
-print(communities);
-for(var i =0; i < communities.length; i++){
-    print(communities[i]);
-    var communityPid = communities[i];
-    var numbers_map = {};
-        numbers_map["total"] = { "showInMonitor" : true, "showInDashboard" : false };
-        numbers_map["project"] = { "showInMonitor" : true, "showInDashboard" : false };
-        numbers_map["open"] = { "showInMonitor" : true, "showInDashboard" : false };
-        numbers_map["closed"] = { "showInMonitor" : true, "showInDashboard" : false };
-        numbers_map["embargo"] = { "showInMonitor" : true, "showInDashboard" : false };
-        numbers_map["restricted"] = { "showInMonitor" : true, "showInDashboard" : false };
-        var numbers = {"map":numbers_map};
-        var charts_map = {};
-            charts_map["timeline"] = { "showInMonitor" : true, "showInDashboard" : false };
-            charts_map["graph"] = { "showInMonitor" : true, "showInDashboard" : false };
-            charts_map["projectTable"] = { "showInMonitor" : true, "showInDashboard" : false };
-            charts_map["projectColumn"] = { "showInMonitor" : true, "showInDashboard" : false };
-            charts_map["projectPie"] = { "showInMonitor" : true, "showInDashboard" : false };
-        var charts = {"map":charts_map};
-        var statistics_entities = {"charts":charts,"numbers":numbers}
-        var entities = {};
-        entities["publication"]=statistics_entities;
-        entities["dataset"]=statistics_entities;
-        entities["sofware"]=statistics_entities;
-        var statistics = {"pid" : communityPid, "entities" : entities};
-        db.statistics.save(statistics);
-        print("Update stats for " + communityPid)
+    var communities = db.community.find().map( function(entity) { return entity.pid } );
+    print(communities);
+    for(var i =0; i < communities.length; i++){
+        print(communities[i]);
+        var communityPid = communities[i];
+        var numbers_map = {};
+            numbers_map["total"] = { "showInMonitor" : true, "showInDashboard" : false };
+            numbers_map["project"] = { "showInMonitor" : true, "showInDashboard" : false };
+            numbers_map["open"] = { "showInMonitor" : true, "showInDashboard" : false };
+            numbers_map["closed"] = { "showInMonitor" : true, "showInDashboard" : false };
+            numbers_map["embargo"] = { "showInMonitor" : true, "showInDashboard" : false };
+            numbers_map["restricted"] = { "showInMonitor" : true, "showInDashboard" : false };
+            var numbers = {"map":numbers_map};
+            var charts_map = {};
+                charts_map["timeline"] = { "showInMonitor" : true, "showInDashboard" : false };
+                charts_map["graph"] = { "showInMonitor" : true, "showInDashboard" : false };
+                charts_map["projectTable"] = { "showInMonitor" : true, "showInDashboard" : false };
+                charts_map["projectColumn"] = { "showInMonitor" : true, "showInDashboard" : false };
+                charts_map["projectPie"] = { "showInMonitor" : true, "showInDashboard" : false };
+            var charts = {"map":charts_map};
+            var statistics_entities = {"charts":charts,"numbers":numbers}
+            var entities = {};
+            entities["publication"]=statistics_entities;
+            entities["dataset"]=statistics_entities;
+            entities["software"]=statistics_entities;
+            var statistics = {"pid" : communityPid, "entities" : entities};
+            db.statistics.save(statistics);
+            print("Update stats for " + communityPid)
+    }
 }
+function updateDivIds(){
+ print("Update DivIds...")
 
-db.divId.drop();
-db.createCollection("divId")
+//db.divId.drop();
+//db.createCollection("divId")
+//
+//link = db.page.find( { route: "/participate/claim" }).map( function(page) { return page._id.str; } ).toString()
+//directLink = db.page.find( { route: "/participate/direct-claim" }).map( function(page) { return page._id.str; } ).toString()
+//
+//db.divId.save({ "name" : "link-context-form", "pages" : [link, directLink]})
+//db.divId.save({ "name" : "link-project-form", "pages" : [link, directLink]})
+//db.divId.save({ "name" : "link-result-form", "pages" : [link, directLink]})
+//db.divId.save({ "name" : "link-result-bulk", "pages" : [link]})
+//db.divId.save({ "name" : "link-metadata", "pages" : [link, directLink]})
+}
+function updatePages(){
+ print("\n\nUpdate Pages with connect & openaire fields...")
+ db.page.update({ "route" : "/search/publication" },{$set: { "connect": true, "openaire":true }});
+ db.page.update({ "route" : "/search/dataset" },{$set: { "connect": true, "openaire":true }});
+ db.page.update({ "route" : "/search/software" },{$set: { "connect": true, "openaire":true }});
+ db.page.update({ "route" : "/search/project" },{$set: { "connect": true, "openaire":true }});
+ db.page.update({ "route" : "/search/organization" },{$set: { "connect": true, "openaire":true }});
+ db.page.update({ "route" : "/search/dataprovider" },{$set: { "connect": true, "openaire":true }});
+ db.page.update({ "route" : "/project-report" },{$set: { "connect": false, "openaire":true }});
 
-link = db.page.find( { route: "/participate/claim" }).map( function(page) { return page._id.str; } ).toString()
-directLink = db.page.find( { route: "/participate/direct-claim" }).map( function(page) { return page._id.str; } ).toString()
+  db.page.update({ "route" : "/find" },{$set: { "connect": false, "openaire":true }});
 
-db.divId.save({ "name" : "link-context-form", "pages" : [link, directLink]})
-db.divId.save({ "name" : "link-project-form", "pages" : [link, directLink]})
-db.divId.save({ "name" : "link-result-form", "pages" : [link, directLink]})
-db.divId.save({ "name" : "link-result-bulk", "pages" : [link]})
-db.divId.save({ "name" : "link-metadata", "pages" : [link, directLink]})
\ No newline at end of file
+  db.page.update({ "route" : "/search/find/publications" },{$set: { "connect": true, "openaire":true }});
+  db.page.update({ "route" : "/search/find/datasets" },{$set: { "connect": true, "openaire":true }});
+  db.page.update({ "route" : "/search/find/software" },{$set: { "connect": true, "openaire":true }});
+  db.page.update({ "route" : "/search/find/projects" },{$set: { "connect": true, "openaire":true }});
+  db.page.update({ "route" : "/search/find/organizations" },{$set: { "connect": false, "openaire":true }});
+  db.page.update({ "route" : "/search/find/dataproviders" },{$set: { "connect": true, "openaire":true }});
+
+  db.page.update({ "route" : "/search/advanced/publications" },{$set: { "connect": true, "openaire":true }});
+  db.page.update({ "route" : "/search/advanced/datasets" },{$set: { "connect": true, "openaire":true }});
+  db.page.update({ "route" : "/search/advanced/software" },{$set: { "connect": true, "openaire":true }});
+  db.page.update({ "route" : "/search/advanced/projects" },{$set: { "connect": false, "openaire":true }});
+  db.page.update({ "route" : "/search/advanced/organizations" },{$set: { "connect": false, "openaire":true }});
+  db.page.update({ "route" : "/search/find/dataproviders" },{$set: { "connect": false, "openaire":true }});
+
+  db.page.update({ "route" : "/search/journals" },{$set: { "connect": false, "openaire":true }});
+  db.page.update({ "route" : "/search/entity-registries" },{$set: { "connect": false, "openaire":true }});
+  db.page.update({ "route" : "/search/content-providers" },{$set: { "connect": false, "openaire":true }});
+  db.page.update({ "route" : "/search/journals-table" },{$set: { "connect": false, "openaire":true }});
+  db.page.update({ "route" : "/search/entity-registries-table" },{$set: { "connect": false, "openaire":true }});
+  db.page.update({ "route" : "/search/content-providers-table" },{$set: { "connect": false, "openaire":true }});
+
+   db.page.update({ "route" : "/participate/deposit-publications" },{$set: { "connect": true, "openaire":true }});
+   db.page.update({ "route" : "/participate/deposit-datasets" },{$set: { "connect": true, "openaire":true }});
+   db.page.update({ "route" : "/participate/deposit-publications-results" },{$set: { "connect": true, "openaire":true }});
+   db.page.update({ "route" : "/participate/deposit-datasets-results" },{$set: { "connect": true, "openaire":true }});
+   db.page.update({ "route" : "/participate/deposit-subject-result" },{$set: { "connect": true, "openaire":true }});
+
+   db.page.update({ "route" : "/participate/claim" },{$set: { "connect": true, "openaire":true }});
+   db.page.update({ "route" : "/participate/direct-claim" },{$set: { "connect": true, "openaire":true }});
+   db.page.update({ "route" : "/myclaims" },{$set: { "connect": true, "openaire":true }});
+   db.page.update({ "route" : "/claims" },{$set: { "connect": false, "openaire":true }});
+   db.page.update({ "route" : "/claims-project-manager" },{$set: { "connect": false, "openaire":true }});
+
+   print("Updated\n\n")
+};
+
+//updatePages();
\ No newline at end of file
Index: modules/uoa-admin-tools/init_db.js
===================================================================
--- modules/uoa-admin-tools/init_db.js	(revision 51507)
+++ modules/uoa-admin-tools/init_db.js	(revision 51508)
@@ -1,14 +1,13 @@
 //version compatibility: 1.0.1-SNAPSHOT
 
-use openaire_admin
+use openaire_admin;
 
-var drop = false;
-if(drop) {
+function dropDB(){
+print("\n\n Drop DB\n\n")
 	db.dropDatabase()
 }
-
-if(db.stats().collections == 0) {
-
+function createCollections(){
+print("\n\n Create Collections \n\n")
 	db.createCollection("community")
 	db.createCollection("divHelpContent")
 	db.createCollection("divId")
@@ -17,7 +16,9 @@
 	db.createCollection("pageHelpContent")
 	db.createCollection("statistics")
 	db.createCollection("communitySubscribers")
-
+}
+function initializeEntitiesPagesDivIds(){
+print("\n\n Initialize entities, pages & divIds \n\n")
 	db.entity.save({"pid" : "publication", "name" : "Publication"})
 	db.entity.save({"pid" : "dataset", "name" : "Research Data"})
 	db.entity.save({"pid" : "software", "name" : "Software"})
@@ -32,49 +33,64 @@
 	organizationId = db.entity.find( { pid: "organization" }).map( function(entity) { return entity._id.str; } ).toString()
 	datasourceId = db.entity.find( { pid: "datasource" }).map( function(entity) { return entity._id.str; } ).toString()
 
-	db.page.save({"name" : "Publication Landing", "route" : "/search/publication", "type" : "search", "entities" : [publicationId]})
-	db.page.save({"name" : "Research Data Landing", "route" : "/search/dataset", "type" : "search", "entities" : [datasetId]})
-	db.page.save({"name" : "Software Landing", "route" : "/search/software", "type" : "search", "entities" : [softwareId]})
-	db.page.save({"name" : "Project Landing", "route" : "/search/project", "type" : "search", "entities" : [projectId]})
-	db.page.save({"name" : "Organization Landing", "route" : "/search/organization", "type" : "search", "entities" : [organizationId]})
-	db.page.save({"name" : "Content Provider Landing", "route" : "/search/dataprovider", "type" : "search", "entities" : [datasourceId]})
-	db.page.save({"name" : "Project Report", "route" : "/project-report", "type" : "search", "entities" : [projectId]})
+	db.page.save({"name" : "Publication Landing", "route" : "/search/publication", "type" : "search", "connect":true,"openaire":true,"entities" : [publicationId]})
+	db.page.save({"name" : "Research Data Landing", "route" : "/search/dataset", "type" : "search", "connect":true,"openaire":true,"entities" : [datasetId]})
+	db.page.save({"name" : "Software Landing", "route" : "/search/software", "type" : "search", "connect":true,"openaire":true,"entities" : [softwareId]})
+	db.page.save({"name" : "Project Landing", "route" : "/search/project", "type" : "search", "connect":true,"openaire":true,"entities" : [projectId]})
+	db.page.save({"name" : "Organization Landing", "route" : "/search/organization", "type" : "search", "connect":true,"openaire":true,"entities" : [organizationId]})
+	db.page.save({"name" : "Content Provider Landing", "route" : "/search/dataprovider", "type" : "search", "connect":true,"openaire":true,"entities" : [datasourceId]})
+	db.page.save({"name" : "Project Report", "route" : "/project-report", "type" : "search", "connect":false,"openaire":true,"entities" : [projectId]})
 
-	db.page.save({"name" : "Search Find", "type" : "search", "entities" : [publicationId, datasetId, softwareId, projectId, organizationId, datasourceId], "route" : "/search/find"})
+	db.page.save({"name" : "Search Find", "type" : "search", "connect":false,"openaire":true,"entities" : [publicationId, datasetId, softwareId, projectId, organizationId, datasourceId], "route" : "/search/find"})
 
-	db.page.save({"name" : "Search Publications", "route" : "/search/find/publications", "type" : "search", "entities" : [publicationId]})
-	db.page.save({"name" : "Search Research Data ", "route" : "/search/find/datasets", "type" : "search", "entities" : [datasetId]})
-	db.page.save({"name" : "Search Software", "route" : "/search/find/software", "type" : "search", "entities" : [softwareId]})
-	db.page.save({"name" : "Search Projects", "route" : "/search/find/projects", "type" : "search", "entities" : [projectId]})
-	db.page.save({"name" : "Search Organizations", "route" : "/search/find/organizations", "type" : "search", "entities" : [organizationId]})
-	db.page.save({"name" : "Search Content Providers", "route" : "/search/find/dataproviders", "type" : "search", "entities" : [datasourceId]})
+	db.page.save({"name" : "Search Publications", "route" : "/search/find/publications", "type" : "search", "connect":true,"openaire":true,"entities" : [publicationId]})
+	db.page.save({"name" : "Search Research Data ", "route" : "/search/find/datasets", "type" : "search", "connect":true,"openaire":true,"entities" : [datasetId]})
+	db.page.save({"name" : "Search Software", "route" : "/search/find/software", "type" : "search", "connect":true,"openaire":true,"entities" : [softwareId]})
+	db.page.save({"name" : "Search Projects", "route" : "/search/find/projects", "type" : "search", "connect":true,"openaire":true,"entities" : [projectId]})
+	db.page.save({"name" : "Search Organizations", "route" : "/search/find/organizations", "type" : "search", "connect":false,"openaire":true,"entities" : [organizationId]})
+	db.page.save({"name" : "Search Content Providers", "route" : "/search/find/dataproviders", "type" : "search", "connect":true,"openaire":true,"entities" : [datasourceId]})
 
-	db.page.save({"name" : "Advanced Search Publications", "route" : "/search/advanced/publications", "type" : "search", "entities" : [publicationId]})
-	db.page.save({"name" : "Advanced Search Research Data ", "route" : "/search/advanced/datasets", "type" : "search", "entities" : [datasetId]})
-	db.page.save({"name" : "Advanced Search Software", "route" : "/search/advanced/software", "type" : "search", "entities" : [softwareId]})
-	db.page.save({"name" : "Advanced Search Projects", "route" : "/search/advanced/projects", "type" : "search", "entities" : [projectId]})
-	db.page.save({"name" : "Advanced Search Organizations", "route" : "/search/advanced/organizations", "type" : "search", "entities" : [organizationId]})
-	db.page.save({"name" : "Advanced Search Content Providers", "route" : "/search/advanced/dataproviders", "type" : "search", "entities" : [datasourceId]})
+	db.page.save({"name" : "Advanced Search Publications", "route" : "/search/advanced/publications", "type" : "search", "connect":true,"openaire":true,"entities" : [publicationId]})
+	db.page.save({"name" : "Advanced Search Research Data ", "route" : "/search/advanced/datasets", "type" : "search", "connect":true,"openaire":true,"entities" : [datasetId]})
+	db.page.save({"name" : "Advanced Search Software", "route" : "/search/advanced/software", "type" : "search", "connect":true,"openaire":true,"entities" : [softwareId]})
+	db.page.save({"name" : "Advanced Search Projects", "route" : "/search/advanced/projects", "type" : "search", "connect":false,"openaire":true,"entities" : [projectId]})
+	db.page.save({"name" : "Advanced Search Organizations", "route" : "/search/advanced/organizations", "type" : "search", "connect":false,"openaire":true,"entities" : [organizationId]})
+	db.page.save({"name" : "Advanced Search Content Providers", "route" : "/search/advanced/dataproviders", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
 
-	db.page.save({"name" : "Search Journals", "route" : "/search/journals", "type" : "search", "entities" : [datasourceId]})
-	db.page.save({"name" : "Search Entity Registries", "route" : "/search/entity-registries", "type" : "search", "entities" : [datasourceId]})
-	db.page.save({"name" : "Search Compatible Content Providers", "route" : "/search/content-providers", "type" : "search", "entities" : [datasourceId]})
-	db.page.save({"name" : "Search Journals - Table view ", "route" : "/search/journals-table", "type" : "search", "entities" : [datasourceId]})
-	db.page.save({"name" : "Search Entity Registries - Table view", "route" : "/search/entity-registries-table", "type" : "search", "entities" : [datasourceId]})
-	db.page.save({"name" : "Search Compatible Content Providers -Table view", "route" : "/search/content-providers-table", "type" : "search", "entities" : [datasourceId]})
+	db.page.save({"name" : "Search Journals", "route" : "/search/journals", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
+	db.page.save({"name" : "Search Entity Registries", "route" : "/search/entity-registries", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
+	db.page.save({"name" : "Search Compatible Content Providers", "route" : "/search/content-providers", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
+	db.page.save({"name" : "Search Journals - Table view ", "route" : "/search/journals-table", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
+	db.page.save({"name" : "Search Entity Registries - Table view", "route" : "/search/entity-registries-table", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
+	db.page.save({"name" : "Search Compatible Content Providers -Table view", "route" : "/search/content-providers-table", "type" : "search", "connect":false,"openaire":true,"entities" : [datasourceId]})
 
-	db.page.save({"name" : "Deposit Publications", "route" : "/participate/deposit-publications", "type" : "share", "entities" : [publicationId]})
-	db.page.save({"name" : "Deposit Research Data", "route" : "/participate/deposit-datasets", "type" : "share", "entities" : [datasetId]})
-	db.page.save({"name" : "Deposit Publications Results", "route" : "/participate/deposit-publications-result", "type" : "share", "entities" : [publicationId]})
-	db.page.save({"name" : "Deposit Research Data Results", "route" : "/participate/deposit-datasets-result", "type" : "share","entities" : [datasetId]})
-	db.page.save({"name" : "Deposit Research Data subject result", "route" : "/participate/deposit-subject-result", "type" : "share", "entities" : [datasetId]})
+	db.page.save({"name" : "Deposit Publications", "route" : "/participate/deposit-publications", "type" : "share", "connect":true,"openaire":true,"entities" : [publicationId]})
+	db.page.save({"name" : "Deposit Research Data", "route" : "/participate/deposit-datasets", "type" : "share", "connect":true,"openaire":true,"entities" : [datasetId]})
+	db.page.save({"name" : "Deposit Publications Results", "route" : "/participate/deposit-publications-result", "type" : "share", "connect":true,"openaire":true,"entities" : [publicationId]})
+	db.page.save({"name" : "Deposit Research Data Results", "route" : "/participate/deposit-datasets-result", "type" : "share", "connect":true,"openaire":true,"entities" : [datasetId]})
+	db.page.save({"name" : "Deposit Research Data subject result", "route" : "/participate/deposit-subject-result", "type" : "share", "connect":true,"openaire":true,"entities" : [datasetId]})
 
-	db.page.save({"name" : "Link", "route" : "/participate/claim", "type" : "link", "entities" : [projectId]})
-	db.page.save({"name" : "Direct Link", "route" : "/participate/direct-claim", "type" : "link", "entities" : []})
-	db.page.save({"name" : "My claims", "route" : "/myclaims", "type" : "link", "entities" : []})
-	db.page.save({"name" : "Administrator claims", "route" : "/claims", "type" : "link", "entities" : []})
-	db.page.save({"name" : "Claims Project Manager", "route" : "/claims-project-manager", "type" : "link", "entities" : []})
+	db.page.save({"name" : "Link", "route" : "/participate/claim", "type" : "link", "connect":true,"openaire":true,"entities" : [projectId]})
+	db.page.save({"name" : "Direct Link", "route" : "/participate/direct-claim", "type" : "link", "connect":true,"openaire":true,"entities" : []})
+	db.page.save({"name" : "My claims", "route" : "/myclaims", "type" : "link", "connect":true,"openaire":true,"entities" : []})
+	db.page.save({"name" : "Administrator claims", "route" : "/claims", "type" : "link", "connect":true,"openaire":true,"entities" : []})
+	db.page.save({"name" : "Claims Project Manager", "route" : "/claims-project-manager", "type" : "link", "connect":false,"openaire":true,"entities" : []})
 
+	db.page.save({"name" : "Monitor", "route" : "/monitor", "type" : "statistics", "connect":true,"openaire":false,"entities" : []})
+
+    link = db.page.find( { route: "/participate/claim" }).map( function(page) { return page._id.str; } ).toString()
+	directLink = db.page.find( { route: "/participate/direct-claim" }).map( function(page) { return page._id.str; } ).toString()
+
+	db.divId.save({ "name" : "link-context-form", "pages" : [link, directLink]})
+    db.divId.save({ "name" : "link-project-form", "pages" : [link, directLink]})
+    db.divId.save({ "name" : "link-result-form", "pages" : [link, directLink]})
+    db.divId.save({ "name" : "link-result-bulk", "pages" : [link]})
+    db.divId.save({ "name" : "link-metadata", "pages" : [link, directLink]})
+}
+function createCommunity(name,communityPid){
+print("\n\n Create community \n\n");
+print("Name:"+name);
+print("communityPid:"+communityPid);
 	publicationLanding = db.page.find( { route: "/search/publication" }).map( function(page) { return page._id.str; } ).toString()
 	datasetLanding = db.page.find( { route: "/search/dataset" }).map( function(page) { return page._id.str; } ).toString()
 	softwareLanding = db.page.find( { route: "/search/software" }).map( function(page) { return page._id.str; } ).toString()
@@ -156,6 +172,12 @@
 	community_pages[administratorClaims] = true;
 	community_pages[claimsProjectManager] = true;
 
+	publicationId = db.entity.find( { pid: "publication" }).map( function(entity) { return entity._id.str; } ).toString()
+	datasetId = db.entity.find( { pid: "dataset" }).map( function(entity) { return entity._id.str; } ).toString()
+	softwareId = db.entity.find( { pid: "software" }).map( function(entity) { return entity._id.str; } ).toString()
+	projectId = db.entity.find( { pid: "project" }).map( function(entity) { return entity._id.str; } ).toString()
+	organizationId = db.entity.find( { pid: "organization" }).map( function(entity) { return entity._id.str; } ).toString()
+	datasourceId = db.entity.find( { pid: "datasource" }).map( function(entity) { return entity._id.str; } ).toString()
 	var community_entities = {}
 	community_entities[publicationId] = true;
 	community_entities[datasetId] = true;
@@ -163,17 +185,11 @@
 	community_entities[projectId] = true;
 	community_entities[organizationId] = true;
 	community_entities[datasourceId] = true;
-    var communityPid="test";
-	db.community.save({	"name" : "OpenAIRE", "pid" : communityPid, "pages" : community_pages, "entities" : community_entities})
 
+ 	db.community.save({	"name" : name, "pid" : communityPid, "pages" : community_pages, "entities" : community_entities})
+
 	openaireCommunity = db.community.find( { pid: communityPid }).map( function(community) { return community._id.str; } ).toString()
 
-	db.divId.save({ "name" : "link-context-form", "pages" : [link, directLink]})
-	db.divId.save({ "name" : "link-project-form", "pages" : [link, directLink]})
-	db.divId.save({ "name" : "link-result-form", "pages" : [link, directLink]})
-	db.divId.save({ "name" : "link-result-bulk", "pages" : [link]})
-	db.divId.save({ "name" : "link-metadata", "pages" : [link, directLink]})
-
     var numbers_map = {};
         numbers_map["total"] = { "showInMonitor" : true, "showInDashboard" : false };
         numbers_map["project"] = { "showInMonitor" : true, "showInDashboard" : false };
@@ -194,7 +210,7 @@
 	var entities = {};
 	entities["publication"]=statistics_entities;
 	entities["dataset"]=statistics_entities;
-	entities["sofware"]=statistics_entities;
+	entities["software"]=statistics_entities;
 	var statistics = {"pid" : communityPid, "entities" : entities};
 
     db.statistics.save(statistics);
@@ -201,5 +217,13 @@
 
     var subscribers = [];
     db.communitySubscribers.save({ "pid" : communityPid, "subscribers" : subscribers})
+print("\n\n Done \n\n");
 
-}
+};
+
+//dropDB();
+//createCollections();
+//initializeEntitiesPagesDivIds();
+//createCommunity("OpenAIRE","openaire");
+
+createCommunity("EGI","egi");
\ No newline at end of file
Index: modules/uoa-admin-tools/src/test/java/eu/dnetlib/uoaadmintools/UoaAdminToolsApplicationTests.java
===================================================================
--- modules/uoa-admin-tools/src/test/java/eu/dnetlib/uoaadmintools/UoaAdminToolsApplicationTests.java	(revision 51507)
+++ modules/uoa-admin-tools/src/test/java/eu/dnetlib/uoaadmintools/UoaAdminToolsApplicationTests.java	(revision 51508)
@@ -214,5 +214,13 @@
 //			}
 	}
 
+	@Test
+	public void testPages() {
 
+		System.out.println( pageDAO.findByConnect(false).size());
+		for (Page p: pageDAO.findByConnect(false) ){
+			System.out.println(p.getRoute()+" Con: "+p.getConnect()+" Op: "+p.getOpenaire());
+		}
+	}
+
 }
Index: modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/dao/PageDAO.java
===================================================================
--- modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/dao/PageDAO.java	(revision 51507)
+++ modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/dao/PageDAO.java	(revision 51508)
@@ -6,7 +6,8 @@
 
 public interface PageDAO {
     List<Page> findAll();
-
+    List<Page> findByConnect(boolean connect);
+    List<Page> findByOpenaire(boolean openaire);
     Page findById(String Id);
 
     Page save(Page page);
Index: modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/dao/MongoDBPageDAO.java
===================================================================
--- modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/dao/MongoDBPageDAO.java	(revision 51507)
+++ modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/dao/MongoDBPageDAO.java	(revision 51508)
@@ -8,7 +8,8 @@
 
 public interface MongoDBPageDAO extends PageDAO, MongoRepository<Page, String> {
     List<Page> findAll();
-
+    List<Page> findByConnect(boolean connect);
+    List<Page> findByOpenaire(boolean openaire);
     Page findById(String Id);
 
     Page save(Page page);
Index: modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/entities/Page.java
===================================================================
--- modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/entities/Page.java	(revision 51507)
+++ modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/entities/Page.java	(revision 51508)
@@ -16,6 +16,8 @@
     private String name;
     private String type;
     private List<String> entities;
+    private Boolean connect;
+    private Boolean openaire;
 
     public Page() {
     }
@@ -55,4 +57,20 @@
     public List<String> getEntities() { return entities; }
 
     public void setEntities(List<String> entities) { this.entities = entities; }
+
+    public Boolean getConnect() {
+        return connect;
+    }
+
+    public void setConnect(Boolean connect) {
+        this.connect = connect;
+    }
+
+    public Boolean getOpenaire() {
+        return openaire;
+    }
+
+    public void setOpenaire(Boolean openaire) {
+        this.openaire = openaire;
+    }
 }
Index: modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/controllers/PageController.java
===================================================================
--- modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/controllers/PageController.java	(revision 51507)
+++ modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/controllers/PageController.java	(revision 51508)
@@ -9,10 +9,7 @@
 import org.springframework.web.bind.annotation.*;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @RestController
 @CrossOrigin(origins = "*")
@@ -38,8 +35,16 @@
     private DivIdController divIdController;
 
     @RequestMapping(value = "/page", method = RequestMethod.GET)
-    public List<Page> getAllPages() {
-        return pageDAO.findAll();
+    public List<Page> getAllPages(@RequestParam String pid) {
+        List<Page> pages;
+        if(pid !=null){
+            pages = (pid=="openaire")? pageDAO.findByOpenaire(true):pageDAO.findByConnect(true);
+        }
+        else{
+            pages = pageDAO.findAll();
+        }
+        pages.sort(Comparator.comparing(Page::getName));
+        return pages;
     }
 
     @RequestMapping(value = "/page", method = RequestMethod.DELETE)
Index: modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/controllers/CommunityController.java
===================================================================
--- modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/controllers/CommunityController.java	(revision 51507)
+++ modules/uoa-admin-tools/src/main/java/eu/dnetlib/uoaadmintools/controllers/CommunityController.java	(revision 51508)
@@ -289,25 +289,29 @@
                 }
 
                 Page p = pageDAO.findById(page.getKey());
-                if ((page_type == null && page_route == null) || (page_route == null && p.getType().equals(page_type))
-                        || p.getRoute().equals(page_route)) {
-                    CommunityPage communityPage = new CommunityPage(p);
 
-                    List<Entity> entities = new ArrayList<>();
-                    for (String entity : p.getEntities()) {
-                        entities.add(entityDAO.findById(entity));
-                    }
-                    communityPage.setEntities(entities);
-                    communityPage.setIsEnabled(page.getValue());
+                if((pid == "openaire" && p.getOpenaire()) ||(pid!="openaire" && p.getConnect())) {
+                    if ((page_type == null && page_route == null) || (page_route == null && p.getType().equals(page_type))
+                            || p.getRoute().equals(page_route)) {
+                        CommunityPage communityPage = new CommunityPage(p);
 
-                    return_pages.add(communityPage);
+                        List<Entity> entities = new ArrayList<>();
+                        for (String entity : p.getEntities()) {
+                            entities.add(entityDAO.findById(entity));
+                        }
+                        communityPage.setEntities(entities);
+                        communityPage.setIsEnabled(page.getValue());
 
-                    if (page_route != null) {
-                        break;
+                        return_pages.add(communityPage);
+
+                        if (page_route != null) {
+                            break;
+                        }
                     }
                 }
             }
         }
+        return_pages.sort(Comparator.comparing(CommunityPage::getName));
         return return_pages;
     }
 
