|
|
|
@ -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));
|
|
|
|
|