diff --git a/deposit/searchResultsInDeposit.component.html b/deposit/searchResultsInDeposit.component.html index f9480da7..cfd55620 100644 --- a/deposit/searchResultsInDeposit.component.html +++ b/deposit/searchResultsInDeposit.component.html @@ -19,7 +19,7 @@
  • + [isCard]="true" deposit="true">
  • diff --git a/landingPages/dataProvider/dataProvider.component.html b/landingPages/dataProvider/dataProvider.component.html index ae3d5f7e..bd67c04a 100644 --- a/landingPages/dataProvider/dataProvider.component.html +++ b/landingPages/dataProvider/dataProvider.component.html @@ -106,7 +106,7 @@
    - + @@ -114,7 +114,10 @@ {{dataProviderInfo.compatibility.name}} - {{dataProviderInfo.compatibility.info}} + {{dataProviderInfo.compatibility.info}} + + Not yet registered in OpenAIRE + {{dataProviderInfo.compatibility.name}} diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 38f9004e..81570f91 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -439,7 +439,7 @@ export class ParsingFunctions { return similarResearchResults; } - parseResults(researchResults: RelationResult[], relation, provenanceAction: string): RelationResult[] { + parseResults(researchResults: RelationResult[], relation, provenanceAction: string, relationName: string): RelationResult[] { if (researchResults == undefined) { researchResults = []; } @@ -452,10 +452,10 @@ export class ParsingFunctions { percentageName: null, class: "", provenanceAction: provenanceAction, - relationName: "" + relationName: relationName }; - researchResult.relationName = relation.to.class; + // researchResult.relationName = relation.to.class; if(relation['resulttype']) { if (relation['resulttype'].classname == "publication") { diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 414d3ac2..30a2a68c 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -361,6 +361,7 @@ export class ResultLandingComponent { let observables: Array> = []; observables.push(this._vocabulariesService.getProvenanceActionVocabulary(this.properties)); observables.push(this._vocabulariesService.getSubjectsVocabulary(this.properties)); + observables.push(this._vocabulariesService.getRelationsVocabulary(this.properties)); // observables.push(this.indexInfoService.getLastIndexDate(properties)); // observables.push(this.indexInfoService.getLastOrcidUpdateDate(properties)); @@ -369,7 +370,7 @@ export class ResultLandingComponent { // this.subscriptions.push(forkJoin(observables).subscribe( // this.subscriptions.push(this._vocabulariesService.getProvenanceActionVocabulary(this.properties).subscribe( vocabularies => { - this.getResultLandingInfo(vocabularies[0], vocabularies[1]); + this.getResultLandingInfo(vocabularies[0], vocabularies[1], vocabularies[2]); }, err => { this.getResultLandingInfo(null, null); this.handleError("Error getting provenance action vocabulary for " + this.type, err); @@ -423,14 +424,14 @@ export class ResultLandingComponent { // return numberOfTabs; // } - private getResultLandingInfo(provenanceActionVocabulary: any, subjectsVocabulary?: string) { + private getResultLandingInfo(provenanceActionVocabulary: any, subjectsVocabulary?: any, relationsVocabulary?: any) { if(this.resultFromInput && this.resultLandingInfo){ this.showLoading = false; return; } this.resultLandingInfo = null; this.hasAltMetrics = false; - this.subscriptions.push(this._resultLandingService.getResultLandingInfo(this.id, this.identifier, this.type, provenanceActionVocabulary, subjectsVocabulary, this.properties).subscribe( + this.subscriptions.push(this._resultLandingService.getResultLandingInfo(this.id, this.identifier, this.type, provenanceActionVocabulary, subjectsVocabulary, relationsVocabulary, this.properties).subscribe( data => { this.resultLandingInfo = data; this.id = this.resultLandingInfo.objIdentifier; diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index 0a85ab77..22af2e71 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -56,7 +56,9 @@ export class ResultLandingService { } } - getResultLandingInfo (id: string, identifier: Identifier, type: string, provenanceActionVocabulary: any, subjectsVocabulary: any, properties: EnvProperties): any { + getResultLandingInfo (id: string, identifier: Identifier, type: string, + provenanceActionVocabulary: any, subjectsVocabulary: any, relationsVocabulary: any, + properties: EnvProperties): any { let url: string = this.buildResultLandingInfoUrl(id, identifier, type); let finalUrl: string = (properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url; @@ -98,7 +100,7 @@ export class ResultLandingService { (res[1]['extraInfo'] !== undefined && res[1]['extraInfo']['citations'] !== undefined) ? res[1]['extraInfo']['citations']['citation'] : null, // 15 ])) - .pipe(map(res => this.parseResultLandingInfo(res, provenanceActionVocabulary, subjectsVocabulary, properties))); + .pipe(map(res => this.parseResultLandingInfo(res, provenanceActionVocabulary, subjectsVocabulary, relationsVocabulary, properties))); } // getProvenanceActionVocabulary (properties: EnvProperties): any { @@ -124,7 +126,7 @@ export class ResultLandingService { return throwError(error || 'Server error'); } - parseResultLandingInfo (data: any, provenanceActionVocabulary: any, subjectsVocabulary: any, properties: EnvProperties): any { + parseResultLandingInfo (data: any, provenanceActionVocabulary: any, subjectsVocabulary: any, relationsVocabulary: any, properties: EnvProperties): any { this.resultLandingInfo = new ResultLandingInfo(); // res @@ -186,7 +188,12 @@ export class ResultLandingService { this.resultLandingInfo.fundedByProjects = this.parsingFunctions.parseFundingByProjects(this.resultLandingInfo.fundedByProjects, relation, provenanceActionVocabulary); } if(relation['to'].scheme && relation['to'].scheme == "dnet:result_result_relations") { - let relationName = relation.to.class; + let relationName: string = relation.to.class; + if(relation.to.class) { + if(relationsVocabulary != null && relation.to.class in relationsVocabulary) { + relationName = relationsVocabulary[relation.to.class]; + } + } if(!this.resultLandingInfo.relatedClassFilters.has(relationName)) { this.resultLandingInfo.relatedClassFilters.add(relationName); } @@ -196,7 +203,7 @@ export class ResultLandingService { provenanceAction = provenanceActionVocabulary[relation.provenanceaction]; } - this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction); + this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName); } else if(relation['to'].class && relation['to'].class.toLowerCase() == "hasauthorinstitution") { this.resultLandingInfo.organizations = this.parseRelatedOrganizations(this.resultLandingInfo.organizations, relation); } diff --git a/orcid/orcid-work.component.ts b/orcid/orcid-work.component.ts index 65f2e9fd..aefee71c 100644 --- a/orcid/orcid-work.component.ts +++ b/orcid/orcid-work.component.ts @@ -438,7 +438,7 @@ export class OrcidWorkComponent { } private getResultLandingInfo(action: string) { - this.subscriptions.push(this.resultLandingService.getResultLandingInfo(this.resultId, null, this.type, null, null, properties).subscribe( + this.subscriptions.push(this.resultLandingService.getResultLandingInfo(this.resultId, null, this.type, null, null, null, properties).subscribe( resultLandingInfo => { this.resultLandingInfo = resultLandingInfo; if (this.resultLandingInfo && this.resultLandingInfo.identifiers) { diff --git a/services/searchDataproviders.service.ts b/services/searchDataproviders.service.ts index 150d47e8..fb9199fe 100644 --- a/services/searchDataproviders.service.ts +++ b/services/searchDataproviders.service.ts @@ -2,9 +2,6 @@ import {Injectable} from '@angular/core'; import {HttpClient} from "@angular/common/http"; import {SearchResult} from '../utils/entities/searchResult'; import {RefineResultsUtils} from './servicesUtils/refineResults.class'; - - - import {StringUtils} from '../utils/string-utils.class'; import{EnvProperties} from '../utils/properties/env-properties'; import {map} from "rxjs/operators"; @@ -31,11 +28,9 @@ export class SearchDataprovidersService { return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - //.map(res => res.json()) - //.do(res => console.info(res)) .pipe(map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "datasource", usedBy)])); } - //((oaftype exact datasource) and(collectedfromdatasourceid exact "openaire____::47ce9e9f4fad46e732cff06419ecaabb")) + advancedSearchDataproviders (params: string, page: number, size: number, properties: EnvProperties, refineParams:string=null, refineFields:string[] =null, refineQuery:string = null, depositQuery:boolean = false ):any { let url = properties.searchAPIURLLAst+"resources"+(depositQuery?'':2)+"/?format=json"; @@ -52,100 +47,9 @@ export class SearchDataprovidersService { url += "&page="+(page-1)+"&size="+size; return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - //.map(res => res.json()) - //.do(res => console.info(res)) .pipe(map(res => [res['meta'].total, this.parseResults(res['results']), RefineResultsUtils.parse(res['refineResults'],refineFields, "datasource")])); } - searchCompatibleDataprovidersTable ( properties:EnvProperties):any { - let size: number = 0; - let url: string= properties.searchResourcesAPIURL; - url += '?query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other) not(datasourcetypeuiid exact "pubsrepository::journal") not(datasourcetypeuiid exact "aggregator::pubsrepository::journals"))'; - url += "&page=0&size=0&format=json"; - - - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - //.map(res => res.json()) - .pipe(map(res => res['meta'].total)); - } - - searchCompatibleDataproviders (params: string,refineParams:string, page: number, size: number, refineFields:string[], properties:EnvProperties ):any { - let url: string = properties.searchResourcesAPIURL; - url += '?query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other) not(datasourcetypeuiid exact "pubsrepository::journal") not(datasourcetypeuiid exact "aggregator::pubsrepository::journals"))'; - if(params!= null && params != '' ) { - url += params; - } - if(refineParams!= null && refineParams != '' ) { - url += refineParams; - } - url += "&page="+(page-1)+"&size="+size+"&format=json"; - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - //.map(res => res.json()) - //.do(res => console.info(res)) - .pipe(map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "datasource")])); - } - - searchEntityRegistriesTable (properties:EnvProperties):any { - let size: number = 0; - let url: string= properties.searchResourcesAPIURL; - url += "?query=((oaftype exact datasource) and(datasourcetypeuiid = other))"; - url += "&page=0&size=0&format=json"; - - - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - //.map(res => res.json()) - .pipe(map(res => res['meta'].total)); - } - - searchEntityRegistries (params: string,refineParams:string, page: number, size: number, refineFields:string[], properties:EnvProperties ):any { - let url = properties.searchResourcesAPIURL; - url += "?query=((oaftype exact datasource) and(datasourcetypeuiid = other))"; - if(params!= null && params != '' ) { - url += params; - } - if(refineParams!= null && refineParams != '' ) { - url += refineParams; - } - url += "&page="+(page-1)+"&size="+size+"&format=json"; - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - //.map(res => res.json()) - //.do(res => console.info(res)) - .pipe(map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "datasource")])); - } - - searchJournalsTable ( properties:EnvProperties):any { - let size: number = 0; - let url: string= properties.searchResourcesAPIURL; - url += '?query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ))'; - url += "&page=0&size=0&format=json"; - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)//.map(res => res.json()) - .pipe(map(res => res['meta'].total)); - } - - searchJournals (params: string,refineParams:string, page: number, size: number, refineFields:string[] , properties:EnvProperties):any { - let url: string = properties.searchResourcesAPIURL; - //url += "?query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other))" - url += '?query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ))'; - - if(params!= null && params != '' ) { - url += params; - } - if(refineParams!= null && refineParams != '' ) { - url += refineParams; - } - url += "&page="+(page-1)+"&size="+size+"&format=json"; - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - //.map(res => res.json()) - //.do(res => console.info(res)) - .pipe(map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "datasource")])); - } - searchDataprovidersForDeposit (id: string,type:string, page: number, size: number, properties:EnvProperties):any { let link = properties.searchResourcesAPIURL; var compatibilities = ""; @@ -165,39 +69,6 @@ export class SearchDataprovidersService { .pipe(map(res => [res['meta'].total, this.parseResults(res['results'])])); } - searchDataprovidersForDepositSearch(params: string, refineParams:string, page: number, size: number, refineFields:string[], properties:EnvProperties, usedBy: string="search" ):any { - let link = properties.searchResourcesAPIURL; - let url = link+"?query=((deletedbyinference = false) AND (oaftype exact datasource)) "+params; - if(refineParams!= null && refineParams != '' ) { - url += refineParams; - } - url += "&page="+(page-1)+"&size="+size+"&format=json"; - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - .pipe(map(res => [res['meta'].total, this.parseResults(res['results']), RefineResultsUtils.parse(res['refineResults'], - refineFields, "datasource", usedBy)])); - } - - searchDataProvidersBySubjects(keyword:string, type:string, page: number, size: number, properties:EnvProperties):any { - let link = properties.searchResourcesAPIURL; - var compatibilities = ""; - if(type == "Research Data"){ - compatibilities = " and (datasourcecompatibilityid <> UNKNOWN) and (datasourcecompatibilityid = openaire2.0_data)" - }else if(type == "Publications"){ - 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 (datasourcesubject all "+'"'+keyword+'"'+") " ; - url += "&page="+(page-1)+"&size="+size+"&format=json"; - - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - //.map(res => res.json()) - .pipe(map(res => [res['meta'].total, this.parseResults(res['results'])])); - - } - getDataProvidersforEntityRegistry(datasourceId: string, page: number, size: number , properties:EnvProperties):any { let url = properties.searchResourcesAPIURL; var basicQuery = "(oaftype exact datasource) " @@ -222,66 +93,6 @@ export class SearchDataprovidersService { //.map(res => res.json()) .pipe(map(res => [res['meta'].total, this.parseResults(res['results'])])); } -/* - searchDataprovidersCSV (params: string, refineParams:string, page: number, size: number):any { - - let link = OpenaireProperties. getSearchAPIURLLast()+"datasources"; - - let url = link+"?"; - if(params!= null && params != '' ) { - url += params; - } - if(refineParams!= null && refineParams != '' ) { - url += refineParams; - } - url += "&page="+(page-1)+"&size="+size+"&format=json"; - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - .map(res => res.json()) - //.do(res => console.info(res)) - - .map(res => this.parseResultsCSV(res['results'])); - } -*/ -/* - searchEntityRegistriesCSV (params: string,refineParams:string, page: number, size: number):any { - let url = properties.searchAPIURLLAst; - url += "?query=((oaftype exact datasource) and(datasourcetypeuiid = other))" - if(params!= null && params != '' ) { - url += params; - } - if(refineParams!= null && refineParams != '' ) { - url += refineParams; - } - url += "&page="+(page - 1)+"&size="+size+"&format=json"; - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - .map(res => res.json()) - //.do(res => console.info(res)) - - .map(res => this.parseResultsCSV(res['results'])); - } -*/ -/* - searchCompatibleDataprovidersCSV (params: string,refineParams:string, page: number, size: number):any { - let url = properties.searchAPIURLLAst; - url += "?query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other))" - if(params!= null && params != '' ) { - url += params; - } - if(refineParams!= null && refineParams != '' ) { - url += refineParams; - } - url += "&page="+(page - 1)+"&size="+size+"&format=json"; - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - .map(res => res.json()) - //.do(res => console.info(res)) - - .map(res => this.parseResultsCSV(res['results'])); - } -*/ - parseResults(data: any): SearchResult[] { let results: SearchResult[] = []; @@ -319,7 +130,6 @@ export class SearchDataprovidersService { } let typeid: string = resData['datasourcetype'].classid; - //console.info(typeid); if(typeid != "entityregistry" && typeid != "entityregistry::projects" && typeid != "entityregistry::repositories") { if(resData.hasOwnProperty('accessinfopackage')) { @@ -349,7 +159,6 @@ export class SearchDataprovidersService { result['organizations'] = res[1]; result['countries'] = res[0]; result['subjects'] = this.getDataproviderSubjects(resData); - //console.log(result['subjects']); if(resData['pid']) { result.identifiers = this.parsingFunctions.parseIdentifiers(resData['pid']); @@ -432,30 +241,9 @@ export class SearchDataprovidersService { } return [countries, organizations]; } -/* - parseResultsCSV(data: any): any { - let results: any = []; - let length = Array.isArray(data) ? data.length : 1; - for(let i=0; i res.json()) .pipe(map(res => res['total'])); } @@ -491,29 +279,4 @@ export class SearchDataprovidersService { return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) .pipe(map(res => res['meta']['total'])); } -/* - private quote(word: any): string { - return '"'+word+'"'; - } -*/ -getDataprovidersTableResults (queryType:string, properties:EnvProperties):any { - let size: number = 0; - let url: string= properties.searchAPIURLLAst; - if(queryType == "compatible"){ - url += '?query=((oaftype exact datasource) not (datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other) not(datasourcetypeuiid exact "pubsrepository::journal") not(datasourcetypeuiid exact "aggregator::pubsrepository::journals"))'; - }else if(queryType=="registries"){ - url += "?query=((oaftype exact datasource) and(datasourcetypeuiid = other))"; - }else if(queryType=="journals"){ - url += '?query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ))'; - - } - - url += "&page=0&size=0&format=json"; - - - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - //.map(res => res.json()) - .pipe(map(res => res['meta'].total)); -} } diff --git a/utils/configuration/configuration.service.ts b/utils/configuration/configuration.service.ts index dcfea1dd..7096ed49 100644 --- a/utils/configuration/configuration.service.ts +++ b/utils/configuration/configuration.service.ts @@ -91,7 +91,7 @@ export class ConfigurationService { } async isPageEnabledByStateAsync(properties: EnvProperties, portal: string, page_route: string) { - if (!this.promise || portal !== this.communityInformation.getValue().pid) { + if (!this.promise || (this.communityInformation && this.communityInformation.getValue() && portal !== this.communityInformation.getValue().pid)) { this.initCommunityInformation(properties, portal); } diff --git a/utils/fetchEntitiesClasses/fetchDataproviders.class.ts b/utils/fetchEntitiesClasses/fetchDataproviders.class.ts index f137fa35..64441825 100644 --- a/utils/fetchEntitiesClasses/fetchDataproviders.class.ts +++ b/utils/fetchEntitiesClasses/fetchDataproviders.class.ts @@ -249,64 +249,6 @@ export class FetchDataproviders { } } - public getResultsBySubjectsForDeposit(subject: string, type: string, page: number, size: number, properties: EnvProperties) { - //var errorCodes:ErrorCodes = new ErrorCodes(); - - this.searchUtils.status = this.errorCodes.LOADING; - this.results = []; - this.searchUtils.totalResults = 0; - this.loadPaging = false; - - this.subscriptions.push(this._searchDataprovidersService.searchDataProvidersBySubjects(subject, type, page, size, properties).subscribe( - data => { - this.searchUtils.totalResults = data[0]; - //console.info("search Dataproviders forDeposit: [subject:"+subject+", type:"+type+" ] [total results:"+this.searchUtils.totalResults+"]"); - this.results = data[1]; - - //var errorCodes:ErrorCodes = new ErrorCodes(); - this.searchUtils.status = this.errorCodes.DONE; - if (this.searchUtils.totalResults == 0) { - this.searchUtils.status = this.errorCodes.NONE; - } - if (this.searchUtils.status == this.errorCodes.DONE) { - // Page out of limit!!! - let totalPages: any = this.searchUtils.totalResults / (this.searchUtils.size); - if (!(Number.isInteger(totalPages))) { - totalPages = (parseInt(totalPages, 10) + 1); - } - if (totalPages < page) { - this.searchUtils.totalResults = 0; - this.searchUtils.status = this.errorCodes.OUT_OF_BOUND; - } - } - this.loadPaging = true; - this.oldTotalResults = this.searchUtils.totalResults; - }, - err => { - /*console.log(err); - //TODO check erros (service not available, bad request) - // if( ){ - // this.searchUtils.status = ErrorCodes.ERROR; - // } - //var errorCodes:ErrorCodes = new ErrorCodes(); - //this.searchUtils.status = errorCodes.ERROR; - if(err.status == '404') { - this.searchUtils.status = this.errorCodes.NOT_FOUND; - } else if(err.status == '500') { - this.searchUtils.status = this.errorCodes.ERROR; - } else { - this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; - }*/ - this.handleError("Error getting "+OpenaireEntities.DATASOURCES+" in share " + type + " by subject: " + subject, err); - this.searchUtils.status = this.errorMessages.getErrorCode(err.status); - - this.loadPaging = true; - this.oldTotalResults = 0; - } - )); - - } - public getResultsForEntity(entity: string, id: string, page: number, size: number, properties: EnvProperties) { //var errorCodes:ErrorCodes = new ErrorCodes(); this.searchUtils.status = this.errorCodes.LOADING; diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index 2d2727c4..e720bf08 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -106,9 +106,7 @@ export interface EnvProperties { searchLinkToOrganizations?: string; searchLinkToCompatibleDataProviders?: string; searchLinkToEntityRegistriesDataProviders?: string; - searchLinkToEntityRegistriesDataProvidersTable?: string; searchLinkToJournals?: string; - searchLinkToJournalsTable?: string; searchLinkToResults?: string; //Advanced Search for pages searchLinkToAdvancedPublications?: string; diff --git a/utils/properties/searchFields.ts b/utils/properties/searchFields.ts index 3f1e9d60..b767570b 100644 --- a/utils/properties/searchFields.ts +++ b/utils/properties/searchFields.ts @@ -607,9 +607,19 @@ export class SearchFields { }, }; - public COMPATIBLE_DATAPROVIDER_FIELDS: string[] = ["datasourcetypename", "datasourcecompatibilityname"]; - public ENTITY_REGISTRIES_FIELDS: string[] = ["datasourcetypename", "datasourcecompatibilityname"]; - public JOURNAL_FIELDS: string[] = ["datasourcetypename", "datasourcecompatibilityname"]; + // public COMPATIBLE_DATAPROVIDER_FIELDS: string[] = ["datasourcetypename", "datasourcecompatibilityname"]; + public COMPATIBLE_DATAPROVIDER_FIELDS: string[] = ["datasourcetypename", "datasourceodlanguages", "datasourceodcontenttypes", + "datasourcecompatibilityname", "country", "collectedfromname","datasourcethematic", + "datasourcejurisdiction"]; + // public ENTITY_REGISTRIES_FIELDS: string[] = ["datasourcetypename", "datasourcecompatibilityname"]; + public ENTITY_REGISTRIES_FIELDS: string[] = ["datasourcetypename", "datasourceodlanguages", "datasourceodcontenttypes", + "datasourcecompatibilityname", "country", "collectedfromname","datasourcethematic", + "datasourcejurisdiction"]; + // public JOURNAL_FIELDS: string[] = ["datasourcetypename", "datasourcecompatibilityname"]; + public JOURNAL_FIELDS: string[] = ["datasourcetypename", "datasourceodlanguages", "datasourceodcontenttypes", + "datasourcecompatibilityname", "country", "collectedfromname","datasourcethematic", + "datasourcejurisdiction"]; + //ORGANIZATION diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index b683ad2e..806a4771 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -37,8 +37,7 @@

    -
    @@ -52,8 +51,7 @@ [no title available]
    - @@ -68,8 +66,7 @@ -
    +
    {{result.acronym}} @@ -139,7 +136,7 @@ + class="uk-label" [class.uk-label-danger]="deposit" title="OpenAIRE Compatibility"> Not yet registered in OpenAIRE {{' '}}
    diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index 121c4bd7..d8d66880 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -32,6 +32,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges { public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0]; @Input() showOrcid: boolean = true; @Input() showEnermaps: boolean = false; + @Input() deposit: boolean = false; ngOnInit(): void { if(this.hasLink) { diff --git a/utils/staticAutoComplete/ISVocabularies.service.ts b/utils/staticAutoComplete/ISVocabularies.service.ts index 127dcbd1..833d6ea9 100644 --- a/utils/staticAutoComplete/ISVocabularies.service.ts +++ b/utils/staticAutoComplete/ISVocabularies.service.ts @@ -11,6 +11,7 @@ export class ISVocabulariesService { private vocabularies: Map> = new Map>(); private provenanceActionVocabulary: BehaviorSubject<{}> = new BehaviorSubject(null); private subjectsVocabulary: BehaviorSubject = new BehaviorSubject(null); + private relationsVocabulary: BehaviorSubject = new BehaviorSubject(null); private subscriptions = []; private vocabulariesPromises: Map> = new Map>(); constructor(private http: HttpClient) {} @@ -259,6 +260,47 @@ export class ISVocabulariesService { return subjectsVocabulary; } + getRelationsVocabulary(properties: EnvProperties): Observable { + let vocabulary = "dnet:relation_relClass.json"; + return from(this.getRelationsVocabularyFromServiceAsync(vocabulary, properties)); + } + + async getRelationsVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> { + if(!this.relationsVocabulary || !this.relationsVocabulary.getValue()) { + await new Promise(resolve => { + this.subscriptions.push(this.getRelationsVocabularyFromService(vocabularyName, properties).subscribe( + vocabularyRes => { + this.relationsVocabulary.next(vocabularyRes); + resolve(); + }, + error => { + this.relationsVocabulary.next(null); + resolve(); + } + )); + }); + } + return this.relationsVocabulary.getValue(); + } + + getRelationsVocabularyFromService (vocabularyName: string, properties: EnvProperties): any { + let url = properties.vocabulariesAPI+vocabularyName; + + return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) + .pipe(map(res => res['terms'])) + .pipe(map(res => this.parseRelationsVocabulary(res))); + } + + parseRelationsVocabulary(terms: any) { + var relationsVocabulary: {} = {}; + for(let term of terms) { + if(term.code != "keyword") { + relationsVocabulary[term.code] = term.englishName; + } + } + return relationsVocabulary; + } + private handleError(error: HttpErrorResponse) { // in a real world app, we may send the error to some remote logging infrastructure