From 9fcdb1df748f8c2c521d63ae009dfe77fbeb0849 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 16 Dec 2024 13:50:47 +0200 Subject: [PATCH 1/4] [develop | DONE | ADDED]: uploadService.js: Added in criteria for search organizations, collected from openOrgs (collectedfromdatasourceid) & reldatasourcecompatibilityid=native (missing from 2018 - #3577) | beta-properties.file & dl170-properties.file & production-properties.file & properties.file: Added property "environment". --- services/utils-service/beta-properties.file | 1 + services/utils-service/dl170-properties.file | 2 +- services/utils-service/production-properties.file | 1 + services/utils-service/properties.file | 3 ++- services/utils-service/uploadService.js | 9 +++++---- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/services/utils-service/beta-properties.file b/services/utils-service/beta-properties.file index a5c945f3..ab801cf1 100644 --- a/services/utils-service/beta-properties.file +++ b/services/utils-service/beta-properties.file @@ -10,3 +10,4 @@ max.size = 200 # file size in KB big-max.size = 1000 port = 8000 +environment = beta \ No newline at end of file diff --git a/services/utils-service/dl170-properties.file b/services/utils-service/dl170-properties.file index c06ac7a5..65174e5a 100644 --- a/services/utils-service/dl170-properties.file +++ b/services/utils-service/dl170-properties.file @@ -10,5 +10,5 @@ max.size = 200 # file size in KB big-max.size = 1000 port = 8000 - +environment = development diff --git a/services/utils-service/production-properties.file b/services/utils-service/production-properties.file index 310a105f..4dc9fd79 100644 --- a/services/utils-service/production-properties.file +++ b/services/utils-service/production-properties.file @@ -10,3 +10,4 @@ max.size = 200 # file size in KB big-max.size = 1000 port = 8000 +environment = production \ No newline at end of file diff --git a/services/utils-service/properties.file b/services/utils-service/properties.file index f3678991..13da04e1 100644 --- a/services/utils-service/properties.file +++ b/services/utils-service/properties.file @@ -1,5 +1,5 @@ userInfoUrl = http://dl170.madgik.di.uoa.gr:19080/login-service/userInfo -searchServiceAPIUrl = https://beta.services.openaire.eu/search/v2/api/ +searchServiceAPIUrl = https://services.openaire.eu/search/v2/api/ monitorAPIUrl = http://dl170.madgik.di.uoa.gr:19380/uoa-monitor-service/ irishMonitorAPIUrl = http://dl170.madgik.di.uoa.gr:19680/irish-monitor-service/ fundersServiceAPIUrl = https://dev-openaire.d4science.org/openaire/funders/ @@ -10,3 +10,4 @@ max.size = 200 # file size in KB big-max.size = 1000 port = 8000 +environment = development \ No newline at end of file diff --git a/services/utils-service/uploadService.js b/services/utils-service/uploadService.js index 22d3c1fe..4f5abbf1 100644 --- a/services/utils-service/uploadService.js +++ b/services/utils-service/uploadService.js @@ -104,12 +104,13 @@ app.delete(['/delete/:filename', '/delete/stakeholder/:filename', '/delete/:type app.get('/explore/home', async function (req, res) { try { - // Make requests to multiple APIs + let openOrgsId = properties.get('environment') == "beta" ? 'openaire____%3A%3A0362fcdb3076765d9c0041ad331553e8' : ""; + // Make requests to multiple APIs let requests= [ "http://localhost:" + properties.get('port') + "/portals/countResults", searchServiceAPIUrl +'results/?fields=relfunder&sf=relfunder&format=json&size=0', searchServiceAPIUrl + 'datasources/count?format=json', - searchServiceAPIUrl + 'resources2/?format=json&size=0&type=organizations&fq=(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or reldatasourcecompatibilityid exact openaire-cris_1.1 or reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*)', + searchServiceAPIUrl + 'resources2/?format=json&size=0&type=organizations&fq=(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or reldatasourcecompatibilityid exact openaire-cris_1.1 or reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=* or reldatasourcecompatibilityid = native'+(openOrgsId ? (' or collectedfromdatasourceid="'+openOrgsId+'"') : "")+')', searchServiceAPIUrl + 'projects/?fields=funder&sf=funder&format=json&size=0', searchServiceAPIUrl + 'resources?query=(%20(oaftype%20exact%20result)%20and%20(resulttypeid%20exact%20dataset)%20and%20(relresulttype%3Dpublication)%20%20)&page=0&size=0&format=json', searchServiceAPIUrl + 'resources?query=(%20(oaftype%20exact%20result)%20and%20(resulttypeid%20exact%20software)%20and%20(relresulttype%3Dpublication)%20%20)&page=0&size=0&format=json' @@ -146,11 +147,11 @@ app.get('/explore/home', async function (req, res) { app.get('/explore/search', async function (req, res) { let aggregatedData = {}; try { - // Make requests to multiple APIs + let openOrgsId = properties.get('environment') == "beta" ? 'openaire____%3A%3A0362fcdb3076765d9c0041ad331553e8' : ""; // Make requests to multiple APIs let requests= [ searchServiceAPIUrl +'resources2/?format=json&size=0&type=results', searchServiceAPIUrl + 'datasources/count?format=json', - searchServiceAPIUrl + 'resources2/?format=json&size=0&type=organizations&fq=(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or reldatasourcecompatibilityid exact openaire-cris_1.1 or reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*)', + searchServiceAPIUrl + 'resources2/?format=json&size=0&type=organizations&fq=(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or reldatasourcecompatibilityid exact openaire-cris_1.1 or reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=* or reldatasourcecompatibilityid = native' + (openOrgsId ? (' or collectedfromdatasourceid="'+openOrgsId+'"') : "") +')', searchServiceAPIUrl + 'projects/count?format=json&fq=projectcode<>"unidentified"' ] const dataPromises = requests.map((url) => axios.get( url)); From 40be430508a9592db68b7b7a302d7216fa2d1577 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 16 Dec 2024 16:26:38 +0200 Subject: [PATCH 2/4] Updating openaireLibrary --- explore/src/app/openaireLibrary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/explore/src/app/openaireLibrary b/explore/src/app/openaireLibrary index c4b177f2..f9baf26f 160000 --- a/explore/src/app/openaireLibrary +++ b/explore/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit c4b177f2c511bcc6a0f3faae4dc56cb18a8941c1 +Subproject commit f9baf26f734ee57ca15ae3000ee511793087d7b2 From 25fbfd2f79d6721f21ba451a182e1148b1a9cd37 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 18 Dec 2024 12:40:00 +0200 Subject: [PATCH 3/4] [develop | DONE | CHANGED]: Updated checks for searching organizations collected from openOrgs to apply the new criteria everywhere but productions (to be promoted after testing). --- explore/src/app/openaireLibrary | 2 +- services/utils-service/uploadService.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/explore/src/app/openaireLibrary b/explore/src/app/openaireLibrary index 799af0ba..e90a1efe 160000 --- a/explore/src/app/openaireLibrary +++ b/explore/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 799af0ba6afc4c88c00d6a452c5dba772121070b +Subproject commit e90a1efee3d85049a802ae0bade7b97c26825c7b diff --git a/services/utils-service/uploadService.js b/services/utils-service/uploadService.js index 4f5abbf1..d4ba5743 100644 --- a/services/utils-service/uploadService.js +++ b/services/utils-service/uploadService.js @@ -104,7 +104,7 @@ app.delete(['/delete/:filename', '/delete/stakeholder/:filename', '/delete/:type app.get('/explore/home', async function (req, res) { try { - let openOrgsId = properties.get('environment') == "beta" ? 'openaire____%3A%3A0362fcdb3076765d9c0041ad331553e8' : ""; + let openOrgsId = properties.get('environment') != "production" ? 'openaire____%3A%3A0362fcdb3076765d9c0041ad331553e8' : ""; // Make requests to multiple APIs let requests= [ "http://localhost:" + properties.get('port') + "/portals/countResults", @@ -147,7 +147,7 @@ app.get('/explore/home', async function (req, res) { app.get('/explore/search', async function (req, res) { let aggregatedData = {}; try { - let openOrgsId = properties.get('environment') == "beta" ? 'openaire____%3A%3A0362fcdb3076765d9c0041ad331553e8' : ""; // Make requests to multiple APIs + let openOrgsId = properties.get('environment') != "production" ? 'openaire____%3A%3A0362fcdb3076765d9c0041ad331553e8' : ""; // Make requests to multiple APIs let requests= [ searchServiceAPIUrl +'resources2/?format=json&size=0&type=results', searchServiceAPIUrl + 'datasources/count?format=json', From 6de58c47eb460161621bf6369e4acc56e3f0aae8 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 8 Jan 2025 11:36:56 +0200 Subject: [PATCH 4/4] Updating openaireLibrary --- explore/src/app/openaireLibrary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/explore/src/app/openaireLibrary b/explore/src/app/openaireLibrary index f9baf26f..7b440714 160000 --- a/explore/src/app/openaireLibrary +++ b/explore/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit f9baf26f734ee57ca15ae3000ee511793087d7b2 +Subproject commit 7b4407140c4630c026df1c3dcccf59cac13c3ac3