diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts index 8f8cad9a..db7c4802 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts @@ -124,10 +124,10 @@ export class SearchPageComponent { } var keyword = params['keyword']; - console.info("Type:" + this.type + "filters: "+(this.type == 'publication'?allFqs:parameters)); + console.info("Type:" + this.type + "filters: "+allFqs); var doiQuery =(keyword && keyword.length > 0 && keyword.split(" ").length ==1 )?'or ((pidclassid exact doi) and (pid exact "'+ keyword+'"))':""; var keywordQuery =(doiQuery.length > 0 )? "((" + this.quote(keyword) + ")" + doiQuery + ")":this.quote(keyword); - return (keyword && keyword.length > 0?'q='+(this.type == 'publication' ||this.type == 'dataset' ?keywordQuery:keyword)+"&op=and":'')+(this.type == 'publication'?allFqs:parameters); + return (keyword && keyword.length > 0?'q='+(this.type == 'publication' ||this.type == 'dataset' ?keywordQuery:keyword)+"&op=and":'') + allFqs; } public getIndexQueryParametersFromUrl(params){ var parameters = ""; @@ -227,39 +227,38 @@ export class SearchPageComponent { * */ private createSearchQueryParameters(filters:Filter[]){ - //TODO when final search is done- remove allLimits/filterLimits and use allFqs/fq - var allLimits=""; + // var allLimits=""; var allFqs = ""; for (let filter of filters){ if(filter.countSelectedValues > 0){ - var filterLimits=""; + // var filterLimits=""; var fq = ""; var count_selected=0; var fieldId = this.indexIdsMap[filter.filterId]; for (let value of filter.values){ if(value.selected == true){ count_selected++; - filterLimits+='&' + fieldId+ '='+ value.id+"&" + this.fieldIdsMap[fieldId].operator + "="+((count_selected == 1)?"and":filter.filterOperator); + // filterLimits+='&' + fieldId+ '='+ value.id+"&" + this.fieldIdsMap[fieldId].operator + "="+((count_selected == 1)?"and":filter.filterOperator); fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + this.quote(value.id); } } fq="&fq="+fq; - allLimits += filterLimits; + // allLimits += filterLimits; allFqs += fq; } } //TODO when final search is done- remove op=and from keyword var doiQuery =(this.searchUtils.keyword.length > 0 && this.searchUtils.keyword.split(" ").length ==1 )?'or ((pidclassid exact doi) and (pid exact "'+ this.searchUtils.keyword+'"))':""; var keywordQuery =(doiQuery.length > 0 )? "((" + this.quote(this.searchUtils.keyword) + ")" + doiQuery + ")":this.quote(this.searchUtils.keyword); - return (this.searchUtils.keyword.length > 0?'q='+(this.type == 'publication' ||this.type == 'dataset' ?keywordQuery:this.searchUtils.keyword)+"&op=and":'')+(this.type == 'publication'?allFqs:allLimits); + return (this.searchUtils.keyword.length > 0?'q='+(this.type == 'publication' ||this.type == 'dataset' ?keywordQuery:this.searchUtils.keyword)+"&op=and":'')+allFqs; } private createIndexQueryParameters(filters:Filter[]){ //TODO - var allLimits=""; + // var allLimits=""; var allFqs = ""; for (let filter of filters){ if(filter.countSelectedValues > 0){ - var filterLimits=""; + // var filterLimits=""; var count_selected=0; var fq = ""; @@ -267,13 +266,13 @@ export class SearchPageComponent { for (let value of filter.values){ if(value.selected == true){ count_selected++; - filterLimits+=((count_selected == 1)?" and (":" "+filter.filterOperator+" ") + filter.filterId+ '='+ value.id; + // filterLimits+=((count_selected == 1)?" and (":" "+filter.filterOperator+" ") + filter.filterId+ '='+ value.id; fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + this.quote(value.id); } } - filterLimits+=(filterLimits.length > 0 )?' ) ':''; - allLimits += filterLimits; + // filterLimits+=(filterLimits.length > 0 )?' ) ':''; + // allLimits += filterLimits; if(count_selected > 0){ fq="&fq="+fq; allFqs += fq; diff --git a/portal-2/src/app/searchPages/simple/searchDatasets.component.ts b/portal-2/src/app/searchPages/simple/searchDatasets.component.ts index e91876b8..552cac05 100644 --- a/portal-2/src/app/searchPages/simple/searchDatasets.component.ts +++ b/portal-2/src/app/searchPages/simple/searchDatasets.component.ts @@ -113,9 +113,9 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number) public getResultsForDataproviders(id:string, resultsFrom:string, page: number, size: number){ var parameters; if(resultsFrom == "collectedFrom") { - parameters = "datasets?"+resultsFrom+"="+id+"&cl=and"; + parameters = "datasets?fq=collectedfromdatasourceid exact "+'"'+id+'"'; } else if(resultsFrom == "hostedBy") { - parameters = "datasets?"+resultsFrom+"="+id+"&hs=and"; + parameters = "datasets?fq=resulthostingdatasourceid exact "+'"'+id+'"'; } if(parameters != "") { diff --git a/portal-2/src/app/services/dataProvider.service.ts b/portal-2/src/app/services/dataProvider.service.ts index 2a03e65a..7fd4a929 100644 --- a/portal-2/src/app/services/dataProvider.service.ts +++ b/portal-2/src/app/services/dataProvider.service.ts @@ -17,7 +17,7 @@ export class DataProviderService { getPublicationInfo (id: string):any { console.info("getDataProviderInfo in service"); - let url = OpenaireProperties.getSearchAPIURL() + 'datasources/' +id; + let url = OpenaireProperties.getSearchAPIURLLast() + 'datasources/' +id +"?format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/dataset.service.ts b/portal-2/src/app/services/dataset.service.ts index 238adbe8..c80130e1 100644 --- a/portal-2/src/app/services/dataset.service.ts +++ b/portal-2/src/app/services/dataset.service.ts @@ -18,7 +18,7 @@ export class DatasetService { getDatasetInfo (id: string):any { console.info("getDatasetInfo in service"); - let url = OpenaireProperties.getSearchAPIURL()+'datasets/'+id; + let url = OpenaireProperties. getSearchAPIURLLast()+'datasets/'+id+"?format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/entitySearch.service.ts b/portal-2/src/app/services/entitySearch.service.ts index 4db2aec0..0ca3ce6e 100644 --- a/portal-2/src/app/services/entitySearch.service.ts +++ b/portal-2/src/app/services/entitySearch.service.ts @@ -14,7 +14,8 @@ export class EntitiesSearchService { constructor(private http: Http, public _cache: CacheService) {} searchProjectsByFunder(keyword:string, funderId:string):any { - let url = OpenaireProperties.getSearchAPIURL()+"projects?"+((keyword && keyword.length > 0)?("q=" +keyword+"&op=and"):"")+"&funder="+funderId+"&fn=and&size=10&page=1"; + //TODO ............. + let url = OpenaireProperties. getSearchAPIURLLast()+"projects?"+((keyword && keyword.length > 0)?("q=" +keyword+"&op=and"):"")+"&funder="+funderId+"&fn=and&size=10&page=1"+"&format=json"; return this.http.get(url).toPromise() .then(request => { @@ -57,12 +58,12 @@ export class EntitiesSearchService { } private searchEntity (keyword: string,APIname:string,oafEntityType:string, type:string):any { - let link = OpenaireProperties.getSearchAPIURL()+APIname; + let link = OpenaireProperties. getSearchAPIURLLast()+APIname+"?format=json"; return this.search(link,keyword,oafEntityType,type) } private fetchEntity (id: string,APIname:string,oafEntityType:string, type:string):any { - let link = OpenaireProperties.getSearchAPIURL()+APIname; + let link = OpenaireProperties. getSearchAPIURLLast()+APIname+"?format=json"; return this.fetch(link,id,oafEntityType,type) } private fetch (link,id,oafEntityType,type){ diff --git a/portal-2/src/app/services/organization.service.ts b/portal-2/src/app/services/organization.service.ts index fd588392..ee9791ab 100644 --- a/portal-2/src/app/services/organization.service.ts +++ b/portal-2/src/app/services/organization.service.ts @@ -17,7 +17,7 @@ export class OrganizationService { getOrganizationInfo (id: string):any { console.info("getOrganizationInfo in service"); - let url = OpenaireProperties.getSearchAPIURL()+'organizations/'+id; + let url = OpenaireProperties. getSearchAPIURLLast()+'organizations/'+id+"?format=json"; let key = url; // if (this._cache.has(key)) { // console.log("HEre in req after put in cache "+this._cache.has(key)); diff --git a/portal-2/src/app/services/person.service.ts b/portal-2/src/app/services/person.service.ts index a851fa14..c58624ec 100644 --- a/portal-2/src/app/services/person.service.ts +++ b/portal-2/src/app/services/person.service.ts @@ -33,7 +33,7 @@ export class PersonService { console.info("getPersonInfo in service"); - let url = OpenaireProperties.getSearchAPIURL()+'people/'+id; + let url = OpenaireProperties. getSearchAPIURLLast()+'people/'+id+"?format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/project.service.ts b/portal-2/src/app/services/project.service.ts index 595f2cd0..2ee4ed53 100644 --- a/portal-2/src/app/services/project.service.ts +++ b/portal-2/src/app/services/project.service.ts @@ -17,7 +17,7 @@ export class ProjectService { getProjectInfo (id: string):any { console.info("getProjectInfo in service"); - let url = OpenaireProperties.getSearchAPIURL() + 'projects/'+id; + let url = OpenaireProperties. getSearchAPIURLLast() + 'projects/'+id+"?format=json"; let key = url; // if (this._cache.has(key)) { // return Observable.of(this._cache.get(key)); @@ -39,7 +39,7 @@ export class ProjectService { */ getProjectDates (id: string):any { - let url = OpenaireProperties.getSearchAPIURL()+'projects/'+id; + let url = OpenaireProperties. getSearchAPIURLLast()+'projects/'+id+"?format=json"; let key = url+'_projectDates'; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/publication.service.ts b/portal-2/src/app/services/publication.service.ts index 6ceecc06..53b38247 100644 --- a/portal-2/src/app/services/publication.service.ts +++ b/portal-2/src/app/services/publication.service.ts @@ -16,7 +16,7 @@ export class PublicationService { getPublicationInfo (id: string):any { console.info("getPublicationInfo in service"); - let url = OpenaireProperties.getSearchAPIURL() + 'publications/' +id; + let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/refineFieldResults.service.ts b/portal-2/src/app/services/refineFieldResults.service.ts index 18b54104..4dcee351 100644 --- a/portal-2/src/app/services/refineFieldResults.service.ts +++ b/portal-2/src/app/services/refineFieldResults.service.ts @@ -13,7 +13,7 @@ export class RefineFieldResultsService { constructor(private http: Http, public _cache: CacheService) {} getRefineFieldResultsByFieldName(fieldName:string, entityName:string):any{ - let link = OpenaireProperties.getSearchAPIURLForEntity(entityName)+"?fields="+fieldName; + let link = OpenaireProperties.getSearchAPIURLForEntity(entityName)+"?fields="+fieldName + "&format=json"; return this.getField(link,fieldName) } diff --git a/portal-2/src/app/services/searchDataproviders.service.ts b/portal-2/src/app/services/searchDataproviders.service.ts index e2ece315..3679a066 100644 --- a/portal-2/src/app/services/searchDataproviders.service.ts +++ b/portal-2/src/app/services/searchDataproviders.service.ts @@ -14,7 +14,7 @@ export class SearchDataprovidersService { searchDataproviders (params: string, refineParams:string, page: number, size: number, refineFields:string[] ):any { - let link = OpenaireProperties.getSearchAPIURL()+"datasources"; + let link = OpenaireProperties. getSearchAPIURLLast()+"datasources"; let url = link+"?"; if(params!= null && params != '' ) { @@ -23,7 +23,7 @@ export class SearchDataprovidersService { if(refineParams!= null && refineParams != '' ) { url += refineParams; } - url += "&page="+(page)+"&size="+size; + url += "&page="+(page-1)+"&size="+size+"&format=json"; let key = url; if (this._cache.has(key)) { @@ -48,7 +48,7 @@ export class SearchDataprovidersService { url +=" ( "+basicQuery+ " ) "; } - url += "&page="+(page-1)+"&size="+size; + url += "&page="+(page-1)+"&size="+size+"&format=json"; url += "&format=json"; let key = url; if (this._cache.has(key)) { @@ -71,7 +71,7 @@ export class SearchDataprovidersService { if(refineParams!= null && refineParams != '' ) { url += refineParams; } - url += "&page="+(page-1)+"&size="+size; + url += "&page="+(page-1)+"&size="+size+"&format=json"; url += "&format=json"; let key = url; if (this._cache.has(key)) { @@ -94,7 +94,7 @@ export class SearchDataprovidersService { if(refineParams!= null && refineParams != '' ) { url += refineParams; } - url += "&page="+(page-1)+"&size="+size; + url += "&page="+(page-1)+"&size="+size+"&format=json"; url += "&format=json"; let key = url; if (this._cache.has(key)) { @@ -118,7 +118,7 @@ export class SearchDataprovidersService { compatibilities = " and (datasourcecompatibilityid <> UNKNOWN) and (datasourcecompatibilityid <> openaire2.0_data)" } let url = link+"?query=(((deletedbyinference = false) AND (oaftype exact datasource)) "+((compatibilities && compatibilities.length > 0)?" "+compatibilities+" ":"")+") and (relorganizationid exact "+id+")"; - url += "&page="+(page-1)+"&size="+size; + url += "&page="+(page-1)+"&size="+size+"&format=json"; url += "&format=json"; let key = url; @@ -142,7 +142,7 @@ export class SearchDataprovidersService { url +=" ( "+basicQuery+ " ) "; } - url += "&page="+(page-1)+"&size="+size; + url += "&page="+(page-1)+"&size="+size+"&format=json"; url += "&format=json"; let key = url; if (this._cache.has(key)) { @@ -156,8 +156,8 @@ export class SearchDataprovidersService { }); } searchDataprovidersForEntity (params: string, page: number, size: number):any { - let link = OpenaireProperties.getSearchAPIURL(); - let url = link+params+"/datasources"; + let link = OpenaireProperties. getSearchAPIURLLast(); + let url = link+params+"/datasources?format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -172,7 +172,7 @@ export class SearchDataprovidersService { searchDataprovidersCSV (params: string, refineParams:string, page: number, size: number):any { - let link = OpenaireProperties.getSearchAPIURL()+"datasources"; + let link = OpenaireProperties. getSearchAPIURLLast()+"datasources"; let url = link+"?"; if(params!= null && params != '' ) { @@ -181,7 +181,7 @@ export class SearchDataprovidersService { if(refineParams!= null && refineParams != '' ) { url += refineParams; } - url += "&page="+page+"&size="+size; + url += "&page="+(page-1)+"&size="+size+"&format=json"; let key = url; if (this._cache.has(key)) { @@ -205,7 +205,7 @@ export class SearchDataprovidersService { if(refineParams!= null && refineParams != '' ) { url += refineParams; } - url += "&page="+page+"&size="+size; + url += "&page="+(page - 1)+"&size="+size+"&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -228,7 +228,7 @@ export class SearchDataprovidersService { if(refineParams!= null && refineParams != '' ) { url += refineParams; } - url += "&page="+page+"&size="+size; + url += "&page="+(page - 1)+"&size="+size+"&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -363,7 +363,7 @@ export class SearchDataprovidersService { numOfDataproviders(params: string):any { console.info("getOfDataproviders : Dataproviders Service + params="+params); - let url = OpenaireProperties.getSearchAPIURL()+params; + let url = OpenaireProperties. getSearchAPIURLLast()+params+(params.indexOf("?") == -1 ?"?":"&")+"format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/searchDatasets.service.ts b/portal-2/src/app/services/searchDatasets.service.ts index 716470af..e9aeb82c 100644 --- a/portal-2/src/app/services/searchDatasets.service.ts +++ b/portal-2/src/app/services/searchDatasets.service.ts @@ -16,7 +16,7 @@ export class SearchDatasetsService { searchDatasets (params: string, refineParams:string, page: number, size: number, refineFields:string[] ):any { - let link = OpenaireProperties.getSearchAPIURL()+"datasets"; + let link = OpenaireProperties.getSearchAPIURLLast()+"datasets"; let url = link+"?"; if(params!= null && params != '' ) { @@ -25,7 +25,7 @@ export class SearchDatasetsService { if(refineParams!= null && refineParams != '' ) { url += refineParams; } - url += "&page="+page+"&size="+size; + url += "&page="+ (page-1) +"&size="+size+"&format=json"; let key = url; if (this._cache.has(key)) { @@ -65,8 +65,8 @@ export class SearchDatasetsService { }); } searchDatasetsForEntity (params: string, page: number, size: number):any { - let link = OpenaireProperties.getSearchAPIURL(); - let url = link+params+"/datasets"; + let link = OpenaireProperties.getSearchAPIURLLast(); + let url = link+params+"/datasets"+"?format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -80,8 +80,8 @@ export class SearchDatasetsService { } searchDatasetsForDataproviders(params: string, page: number, size: number):any { - let link = OpenaireProperties.getSearchAPIURL(); - let url = link+params; + let link = OpenaireProperties.getSearchAPIURLLast(); + let url = link+params+"&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -206,9 +206,9 @@ export class SearchDatasetsService { numOfEntityDatasets(id: string, entity: string):any { - //OpenaireProperties.getSearchAPIURL() + //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURL()+entity+id+"/datasets/count" + let url = OpenaireProperties.getSearchAPIURLLast()+entity+id+"/datasets/count"+"?format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -223,9 +223,9 @@ export class SearchDatasetsService { numOfSearchDatasets(params: string):any { - //OpenaireProperties.getSearchAPIURL() + //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURL()+"datasets/count?q="+params; + let url = OpenaireProperties.getSearchAPIURLLast()+"datasets/count?q="+params+"&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/searchOrganizations.service.ts b/portal-2/src/app/services/searchOrganizations.service.ts index a386bf1b..c815b041 100644 --- a/portal-2/src/app/services/searchOrganizations.service.ts +++ b/portal-2/src/app/services/searchOrganizations.service.ts @@ -80,7 +80,7 @@ export class SearchOrganizationsService { console.info("In searchOrganizations"); - let link = OpenaireProperties.getSearchAPIURL()+"organizations"; + let link = OpenaireProperties.getSearchAPIURLLast()+"organizations"; let url = link+"?"; if(params!= null && params != '' ) { @@ -89,7 +89,7 @@ export class SearchOrganizationsService { if(refineParams!= null && refineParams != '' ) { url += refineParams; } - url += "&page="+page+"&size="+size; + url += "&page="+(page-1)+"&size="+size + "&format=json"; let key = url; if (this._cache.has(key)) { @@ -207,9 +207,9 @@ export class SearchOrganizationsService { numOfEntityOrganizations(id: string, entity: string):any { - //OpenaireProperties.getSearchAPIURL() + //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURL()+entity+id+"/organizations/count" + let url = OpenaireProperties.getSearchAPIURLLast()+entity+id+"/organizations/count"+ "?format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -224,9 +224,10 @@ export class SearchOrganizationsService { numOfSearchOrganizations(params: string):any { - //OpenaireProperties.getSearchAPIURL() + //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURL()+"organizations/count?q="+params; + let url = OpenaireProperties.getSearchAPIURLLast()+"organizations/count?q="+params+ "&format=json"; + let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/searchPeople.service.ts b/portal-2/src/app/services/searchPeople.service.ts index 4b0ffff3..2e3c6d14 100644 --- a/portal-2/src/app/services/searchPeople.service.ts +++ b/portal-2/src/app/services/searchPeople.service.ts @@ -18,7 +18,7 @@ export class SearchPeopleService { console.info("In searchProjects"); - let link = OpenaireProperties.getSearchAPIURL()+"people"; + let link = OpenaireProperties.getSearchAPIURLLast()+"people"; let url = link+"?"; if(params!= null && params != '' ) { @@ -27,7 +27,7 @@ export class SearchPeopleService { if(refineParams!= null && params != '' ) { url += refineParams; } - url += "&page="+page+"&size="+size; + url += "&page="+(page-1)+"&size="+size + "&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -90,9 +90,9 @@ export class SearchPeopleService { numOfEntityPeople(id: string, entity: string):any { - //OpenaireProperties.getSearchAPIURL() + //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURL()+entity+id+"/people/count" + let url = OpenaireProperties.getSearchAPIURLLast()+entity+id+"/people/count"+ "?format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -107,9 +107,9 @@ export class SearchPeopleService { numOfSearchPeople(params: string):any { - //OpenaireProperties.getSearchAPIURL() + //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURL()+"people/count?q="+params; + let url = OpenaireProperties.getSearchAPIURLLast()+"people/count?q="+params+ "&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/searchProjects.service.ts b/portal-2/src/app/services/searchProjects.service.ts index 142a9908..4ba099e7 100644 --- a/portal-2/src/app/services/searchProjects.service.ts +++ b/portal-2/src/app/services/searchProjects.service.ts @@ -19,7 +19,7 @@ export class SearchProjectsService { console.info("In searchProjects"); - let link = OpenaireProperties.getSearchAPIURL()+"projects"; + let link = OpenaireProperties.getSearchAPIURLLast()+"projects"; let url = link+"?"; if(params!= null && params != '' ) { @@ -28,7 +28,7 @@ export class SearchProjectsService { if(refineParams!= null && refineParams != '' ) { url += refineParams; } - url += "&page="+page+"&size="+size; + url += "&page="+(page-1)+"&size="+size + "&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -90,7 +90,7 @@ export class SearchProjectsService { }); } getFunders():any { - let url = OpenaireProperties.getSearchAPIURL()+"projects?refine=true&fields=funderid&size=0"; + let url = OpenaireProperties.getSearchAPIURLLast()+"projects?refine=true&fields=funderid&size=0"+ "&format=json";; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -206,9 +206,9 @@ export class SearchProjectsService { numOfEntityProjects(id: string, entity: string):any { - //OpenaireProperties.getSearchAPIURL() + //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURL()+entity+id+"/projects/count" + let url = OpenaireProperties.getSearchAPIURLLast()+entity+id+"/projects/count"+ "?format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -223,9 +223,9 @@ export class SearchProjectsService { numOfSearchProjects(params: string):any { - //OpenaireProperties.getSearchAPIURL() + //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURL()+"projects/count?q="+params; + let url = OpenaireProperties.getSearchAPIURLLast()+"projects/count?q="+params+ "&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/searchPublications.service.ts b/portal-2/src/app/services/searchPublications.service.ts index eff3e575..74745914 100644 --- a/portal-2/src/app/services/searchPublications.service.ts +++ b/portal-2/src/app/services/searchPublications.service.ts @@ -68,8 +68,8 @@ export class SearchPublicationsService { }); } searchPublicationsForEntity (params: string, page: number, size: number):any { - let link = OpenaireProperties.getSearchAPIURL(); - let url = link+params+"/publications"; + let link = OpenaireProperties.getSearchAPIURLLast(); + let url = link+params+"/publications"+ "?format=json"; let key = url; if (this._cache.has(key)) { @@ -85,8 +85,8 @@ export class SearchPublicationsService { } searchPublicationsForDataproviders(params: string, page: number, size: number):any { - let link = OpenaireProperties.getSearchAPIURL(); - let url = link+params; + let link = OpenaireProperties.getSearchAPIURLLast(); + let url = link+params+ "&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -101,7 +101,7 @@ export class SearchPublicationsService { searchPublicationsCSV (params: string, refineParams:string, page: number, size: number):any { - let link = OpenaireProperties.getSearchAPIURL()+"publications"; + let link = OpenaireProperties.getSearchAPIURLLast()+"publications"; let url = link+"?"; if(params!= null && params != '' ) { @@ -110,7 +110,7 @@ export class SearchPublicationsService { if(refineParams!= null && refineParams != '' ) { url += refineParams; } - url += "&page="+page+"&size="+size; + url += "&page="+(page-1)+"&size="+size+ "&format=json"; let key = url; if (this._cache.has(key)) { @@ -320,9 +320,9 @@ export class SearchPublicationsService { numOfEntityPublications(id: string, entity: string):any { - //OpenaireProperties.getSearchAPIURL() + //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURL()+entity+id+"/publications/count" + let url = OpenaireProperties.getSearchAPIURLLast()+entity+id+"/publications/count"+ "?format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); @@ -336,9 +336,9 @@ export class SearchPublicationsService { numOfSearchPublications(params: string):any { - //OpenaireProperties.getSearchAPIURL() + //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURL()+"publications/count?q="+params; + let url = OpenaireProperties.getSearchAPIURLLast()+"publications/count?q="+params+ "&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/utils/properties/openaireProperties.ts b/portal-2/src/app/utils/properties/openaireProperties.ts index e4bce948..42b4a38b 100644 --- a/portal-2/src/app/utils/properties/openaireProperties.ts +++ b/portal-2/src/app/utils/properties/openaireProperties.ts @@ -32,11 +32,11 @@ export class OpenaireProperties { // private static searchAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"; // private static searchAPIURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"; // private searchAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2.0/api/"; - private static searchAPIURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"; + // private static searchAPIURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"; - private static searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT-last/rest/v2/api/"; + private static searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT-new/rest/v2/api/"; - private static searchResourcesAPIURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT-last/rest/v2/api/resources"; + private static searchResourcesAPIURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT-new/rest/v2/api/resources"; //private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/"; private static searchServiveURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/"; @@ -107,11 +107,11 @@ export class OpenaireProperties { public static getLinkToSearchPeople():string{ return this.baseSearchLink + this.searchLinkToPeople; } - + // Services - APIs' getters - public static getSearchAPIURL():string{ - return this.searchAPIURL; - } + // public static getSearchAPIURL():string{ + // return this.searchAPIURL; + // } // Services - APIs' getters public static getSearchAPIURLLast():string{ return this.searchAPIURLLAst; @@ -136,7 +136,7 @@ export class OpenaireProperties { }else if(entityType == "person"){ suffix="people/"; } - return this.searchAPIURL + suffix; + return this.searchAPIURLLAst + suffix; } public static getSearchServiceURL():string{ return this.searchServiveURL;