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..d4ba5743 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') != "production" ? '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') != "production" ? '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));