From bd6e14180158a86345ffdcd099e8031d4a092809 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 9 May 2022 13:13:44 +0300 Subject: [PATCH] [Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities. Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts --- .../claimEntitiesSelection.component.ts | 8 +++-- .../directLinking/directLinking.component.ts | 25 +++++++++------- claims/linking/linkingGeneric.component.html | 2 +- claims/linking/linkingGeneric.component.ts | 2 ++ .../approvedByCommunity/approved.component.ts | 8 +++-- .../searchDataprovidersToDeposit.component.ts | 12 ++------ error/errorPage.component.ts | 18 ++++++----- .../dataProvider/dataProvider.component.html | 4 +-- .../dataProvider/dataProvider.component.ts | 3 +- .../dataProvider/dataProvider.service.ts | 29 +++++++++--------- .../relatedDatasourcesTab.component.ts | 2 +- landingPages/project/project.component.ts | 2 +- .../my-orcid-links/myOrcidLinks.component.ts | 19 ++++++------ .../searchMyOrcidResults.component.html | 4 +-- .../searchMyOrcidResults.component.ts | 2 ++ searchPages/find/searchAll.component.html | 2 +- searchPages/find/searchAll.component.ts | 7 +++-- searchPages/searchDataProviders.component.ts | 6 ++-- .../advancedSearchForm.component.html | 8 ++--- .../advancedSearchForm.component.ts | 4 ++- .../searchUtils/newSearchPage.component.ts | 6 ++-- services/searchResearchResults.service.ts | 24 +++++++-------- sharedComponents/numbers/numbers.component.ts | 14 +++++---- .../other-portals.component.html | 8 ++--- .../other-portals/other-portals.component.ts | 2 ++ .../fetchDataproviders.class.ts | 21 +++++++------ .../fetchProjects.class.ts | 14 ++++----- .../fetchResearchResults.class.ts | 30 ++++++++++++------- utils/properties/searchFields.ts | 14 ++++----- .../result-preview.component.ts | 12 ++++++-- 30 files changed, 171 insertions(+), 141 deletions(-) diff --git a/claims/claim-utils/claimEntitiesSelection.component.ts b/claims/claim-utils/claimEntitiesSelection.component.ts index eb51e258..66c70f71 100644 --- a/claims/claim-utils/claimEntitiesSelection.component.ts +++ b/claims/claim-utils/claimEntitiesSelection.component.ts @@ -1,6 +1,7 @@ import {Component, Input, ViewChild} from '@angular/core'; import {ShowOptions} from './claimHelper.class'; import {MatSelect} from "@angular/material/select"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; @Component({ @@ -13,9 +14,9 @@ import {MatSelect} from "@angular/material/select"; - Research outcomes - Projects - Research communities + {{openaireEntities.RESULTS}} + {{openaireEntities.PROJECTS}} + {{openaireEntities.COMMUNITIES}} @@ -27,6 +28,7 @@ import {MatSelect} from "@angular/material/select"; export class ClaimEntitiesSelectionComponent{ @ViewChild(MatSelect) matSelect: MatSelect; @Input() showOptions:ShowOptions = new ShowOptions(); + public openaireEntities = OpenaireEntities; open() { if (this.matSelect && !this.matSelect.focused) { diff --git a/claims/directLinking/directLinking.component.ts b/claims/directLinking/directLinking.component.ts index 35a9f3dd..6ac64648 100644 --- a/claims/directLinking/directLinking.component.ts +++ b/claims/directLinking/directLinking.component.ts @@ -8,6 +8,7 @@ import {LinkingGenericComponent} from "../linking/linkingGeneric.component"; import {ClaimResultSearchFormComponent} from "../claim-utils/claimResultSearchForm.component"; import {Subscriber} from "rxjs"; import {properties} from "../../../../environments/environment"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; @Component({ @@ -137,7 +138,7 @@ export class DirectLinkingComponent { err => { this.validInput = this.isValidInput(null); //console.log("An error occured") - this.handleError("Error getting "+this.getEntityName(resultType, false, true)+" by id: " + id, err); + this.handleError("Error getting "+this.getEntityName(resultType, false)+" by id: " + id, err); })); } @@ -173,15 +174,19 @@ export class DirectLinkingComponent { console.error("Direct Linking Page: " + message, error); } - private getEntityName (entityType:string, plural:boolean, full:boolean): string { - if(entityType == "publication") { - return "publication" + (plural ? "s" : ""); - } else if(entityType == "dataset") { - return (full ? "research data" : ("dataset" + (plural ? "s" : ""))); - } else if(entityType == "software") { - return "software"; - } else if(entityType == "other") { - return (full ? ("other research product" + (plural ? "s" : "")) : "other"); + private getEntityName (entityType:string, plural:boolean) { + if (entityType == "publication") { + return plural ? OpenaireEntities.PUBLICATIONS : OpenaireEntities.PUBLICATION; + } else if (entityType == "dataset") { + return plural ? OpenaireEntities.DATASETS : OpenaireEntities.DATASET; + } else if (entityType == "software") { + return plural ? OpenaireEntities.SOFTWARE : OpenaireEntities.SOFTWARE_SINGULAR; + } else if (entityType == "other") { + return plural ? OpenaireEntities.OTHER : OpenaireEntities.OTHER_SINGULAR; + } else if (entityType == "result") { + return plural ? OpenaireEntities.RESULTS : OpenaireEntities.RESULT; + } else { + return entityType; } } } diff --git a/claims/linking/linkingGeneric.component.html b/claims/linking/linkingGeneric.component.html index 6f5fe6b8..045df0ec 100644 --- a/claims/linking/linkingGeneric.component.html +++ b/claims/linking/linkingGeneric.component.html @@ -24,7 +24,7 @@
- +
diff --git a/claims/linking/linkingGeneric.component.ts b/claims/linking/linkingGeneric.component.ts index b86fe413..a41c3125 100644 --- a/claims/linking/linkingGeneric.component.ts +++ b/claims/linking/linkingGeneric.component.ts @@ -13,6 +13,7 @@ import {Subscriber} from "rxjs"; import {properties} from "../../../../environments/environment"; import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component"; import {MetricsService} from "../../services/metrics.service"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; declare var UIkit:any; @@ -42,6 +43,7 @@ export class LinkingGenericComponent { @Input() sources:ClaimEntity[] =[]; properties:EnvProperties; + public openaireEntities = OpenaireEntities; @Input() localStoragePrefix:string = "linking_"; url=null; @ViewChild(AlertModal) alert; diff --git a/connect/approvedByCommunity/approved.component.ts b/connect/approvedByCommunity/approved.component.ts index d293dcca..710a8ef2 100644 --- a/connect/approvedByCommunity/approved.component.ts +++ b/connect/approvedByCommunity/approved.component.ts @@ -5,11 +5,12 @@ import { EnvProperties} from '../../utils/properties/env-properties'; import {ConnectHelper} from '../connectHelper'; import {SearchCommunityDataprovidersService} from '../contentProviders/searchDataproviders.service'; import {properties} from "../../../../environments/environment"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; @Component({ selector: 'approved-by-community', template: ` - Community Approved + {{openaireEntities.COMMUNITY}} Approved ` }) @@ -21,6 +22,7 @@ export class ApprovedByCommunityComponent { private communityContentProviders = []; properties:EnvProperties; + public openaireEntities = OpenaireEntities; constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchCommunityDataprovidersService) {} @@ -40,7 +42,7 @@ export class ApprovedByCommunityComponent { this.approved = this.checkApproval(); }, error => { - this.handleError("Error getting content providers for community with id: "+this.communityId, error); + this.handleError("Error getting "+OpenaireEntities.DATASOURCES+" for "+OpenaireEntities.COMMUNITY+" with id: "+this.communityId, error); } ); } @@ -58,6 +60,6 @@ export class ApprovedByCommunityComponent { } private handleError(message: string, error) { - console.error("Approved by Community (component): "+message, error); + console.error("Approved by "+OpenaireEntities.COMMUNITY+" (component): "+message, error); } } diff --git a/deposit/searchDataprovidersToDeposit.component.ts b/deposit/searchDataprovidersToDeposit.component.ts index 7d285f91..a86f3a18 100644 --- a/deposit/searchDataprovidersToDeposit.component.ts +++ b/deposit/searchDataprovidersToDeposit.component.ts @@ -4,7 +4,7 @@ import {Location} from '@angular/common'; import {SearchDataprovidersService} from '../services/searchDataproviders.service'; import {ErrorCodes} from '../utils/properties/errorCodes'; import {ErrorMessagesComponent} from '../utils/errorMessages.component'; -import {SearchFields} from '../utils/properties/searchFields'; +import {OpenaireEntities, SearchFields} from '../utils/properties/searchFields'; import {SearchCustomFilter, SearchUtilsClass} from '../searchPages/searchUtils/searchUtils.class'; import {EnvProperties} from '../utils/properties/env-properties'; @@ -20,13 +20,6 @@ import {properties} from "../../../environments/environment";
-
@@ -214,7 +207,6 @@ export class SearchDataprovidersToDepositComponent { } }, err => { - this.handleError("Error getting content providers", err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); this.disableForms = false; @@ -225,6 +217,6 @@ export class SearchDataprovidersToDepositComponent { */ private handleError(message: string, error) { - console.error("Content Providers simple Search Page: "+message, error); + console.error(OpenaireEntities.DATASOURCES+" simple Search Page: "+message, error); } } diff --git a/error/errorPage.component.ts b/error/errorPage.component.ts index bbbe85f3..a31edaf7 100644 --- a/error/errorPage.component.ts +++ b/error/errorPage.component.ts @@ -6,6 +6,7 @@ import {SEOService} from "../sharedComponents/SEO/SEO.service"; import {properties} from "../../../environments/environment"; import {RESPONSE} from '../utils/tokens'; import {Response} from 'express'; +import {OpenaireEntities} from "../utils/properties/searchFields"; @Component({ selector: 'error', @@ -77,25 +78,28 @@ export class ErrorPageComponent { if(this.page_type) { if (this.page_type == "publication") { this.searchPage = properties.searchLinkToPublications; - this.page_type_name = "publication"; + this.page_type_name = OpenaireEntities.PUBLICATION.toLowerCase(); } else if (this.page_type == "software") { this.searchPage = properties.searchLinkToSoftware; - this.page_type_name = "software"; + this.page_type_name = OpenaireEntities.SOFTWARE_SINGULAR.toLowerCase(); } else if (this.page_type == "dataset") { this.searchPage = properties.searchLinkToDatasets; - this.page_type_name = "dataset"; + this.page_type_name = OpenaireEntities.DATASET.toLowerCase(); } else if (this.page_type == "orp") { this.searchPage = properties.searchLinkToOrps; - this.page_type_name = "research product"; + this.page_type_name = OpenaireEntities.OTHER_SINGULAR.toLowerCase(); } else if (this.page_type == "organization") { this.searchPage = properties.searchLinkToOrganizations; - this.page_type_name = "organization"; + this.page_type_name = OpenaireEntities.ORGANIZATION.toLowerCase(); } else if (this.page_type == "project") { this.searchPage = properties.searchLinkToProjects; - this.page_type_name = "project"; + this.page_type_name = OpenaireEntities.PROJECT.toLowerCase(); } else if (this.page_type == "dataprovider") { this.searchPage = properties.searchLinkToDataProviders; - this.page_type_name = "content provider"; + this.page_type_name = OpenaireEntities.DATASOURCE.toLowerCase(); + } else { + this.searchPage = properties.searchLinkToResults; + this.page_type_name = OpenaireEntities.RESULT.toLowerCase(); } } }); diff --git a/landingPages/dataProvider/dataProvider.component.html b/landingPages/dataProvider/dataProvider.component.html index cf9d2319..f9d62a53 100644 --- a/landingPages/dataProvider/dataProvider.component.html +++ b/landingPages/dataProvider/dataProvider.component.html @@ -299,7 +299,7 @@
- +
- +
diff --git a/landingPages/dataProvider/dataProvider.component.ts b/landingPages/dataProvider/dataProvider.component.ts index a11923d1..4d86ab81 100644 --- a/landingPages/dataProvider/dataProvider.component.ts +++ b/landingPages/dataProvider/dataProvider.component.ts @@ -64,7 +64,7 @@ export class DataProviderComponent { @ViewChild('relatedDatasourcesModal') relatedDatasourcesModal; @ViewChild('addThisModal') addThisModal - // Variables for publications, research data, projects, content providers, related content providers tabs + // Variables for publications, research data, projects, datasources, related datasources tabs public fetchPublications: FetchResearchResults; public fetchDatasets: FetchResearchResults; public fetchSoftware: FetchResearchResults; @@ -311,7 +311,6 @@ export class DataProviderComponent { } this.showTabs = true; this.updateTitle(this.dataProviderInfo.title.name?this.dataProviderInfo.title.name:this.dataProviderInfo.officialName); - // this.updateDescription(this.dataProviderInfo.description?this.dataProviderInfo.description: "Content provider, " + (this.dataProviderInfo.title.name?this.dataProviderInfo.title.name:this.dataProviderInfo.officialName)); this.updateDescription((this.dataProviderInfo.description && this.dataProviderInfo.description[0] ? (this.dataProviderInfo.description[0].substr(0,157) + (this.dataProviderInfo.description[0].substr(0,157).length == 157?"...":"")) : (this.dataProviderInfo.title.name?this.dataProviderInfo.title.name:this.dataProviderInfo.officialName))); if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { this.subscriptions.push(this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe()); diff --git a/landingPages/dataProvider/dataProvider.service.ts b/landingPages/dataProvider/dataProvider.service.ts index 92ad7fcb..91bb5934 100644 --- a/landingPages/dataProvider/dataProvider.service.ts +++ b/landingPages/dataProvider/dataProvider.service.ts @@ -5,6 +5,7 @@ import {DataProviderInfo, DataproviderProvenance} from '../../utils/entities/dat import{EnvProperties} from '../../utils/properties/env-properties'; import {map} from "rxjs/operators"; import {ParsingFunctions} from "../landing-utils/parsingFunctions.class"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; @Injectable() @@ -184,26 +185,26 @@ export class DataProviderService { } this.dataProviderInfo.tabs = []; if(this.dataProviderInfo.tabsInTypes.publicationsTab.has(data[1].classid)) { - this.dataProviderInfo.tabs.push({"name": "Publications", "content": "publicationsTab"}); - this.dataProviderInfo.tabs2.push("Publications"); + this.dataProviderInfo.tabs.push({"name": OpenaireEntities.PUBLICATIONS, "content": "publicationsTab"}); + this.dataProviderInfo.tabs2.push(OpenaireEntities.PUBLICATIONS); } if(this.dataProviderInfo.tabsInTypes.datasetsTab.has(data[1].classid)) { - this.dataProviderInfo.tabs.push({"name": "Research Data", "content": "datasetsTab"}); - this.dataProviderInfo.tabs2.push("Research Data"); + this.dataProviderInfo.tabs.push({"name": OpenaireEntities.DATASETS, "content": "datasetsTab"}); + this.dataProviderInfo.tabs2.push(OpenaireEntities.DATASETS); } if(this.dataProviderInfo.tabsInTypes.projectsTab.has(data[1].classid)) { - this.dataProviderInfo.tabs.push({"name": "Projects", "content": "projectsTab"}); - this.dataProviderInfo.tabs2.push("Projects"); + this.dataProviderInfo.tabs.push({"name": OpenaireEntities.PROJECTS, "content": "projectsTab"}); + this.dataProviderInfo.tabs2.push(OpenaireEntities.PROJECTS); } if(this.dataProviderInfo.tabsInTypes.datasourcesTab.has(data[1].classid)) { - this.dataProviderInfo.tabs.push({"name": "Content Providers", "content": "datasourcesTab"}); - this.dataProviderInfo.tabs2.push("Content Providers"); + this.dataProviderInfo.tabs.push({"name": OpenaireEntities.DATASOURCES, "content": "datasourcesTab"}); + this.dataProviderInfo.tabs2.push(OpenaireEntities.DATASOURCES); } if(this.dataProviderInfo.tabsInTypes.relatedDatasourcesTab.has(data[1].classid)) { - this.dataProviderInfo.tabs.push({"name": "Related Content Providers", "content": "relatedDatasourcesTab"}); - this.dataProviderInfo.tabs2.push("Related Content Providers"); + this.dataProviderInfo.tabs.push({"name": "Related "+OpenaireEntities.DATASOURCES, "content": "relatedDatasourcesTab"}); + this.dataProviderInfo.tabs2.push("Related "+OpenaireEntities.DATASOURCES); } if(this.dataProviderInfo.tabsInTypes.statisticsTab.has(data[1].classid)) { @@ -212,13 +213,13 @@ export class DataProviderService { } if(this.dataProviderInfo.tabsInTypes.softwareTab.has(data[1].classid)) { - this.dataProviderInfo.tabs.push({"name": "Software", "content": "softwareTab"}); - this.dataProviderInfo.tabs2.push("Software"); + this.dataProviderInfo.tabs.push({"name": OpenaireEntities.SOFTWARE, "content": "softwareTab"}); + this.dataProviderInfo.tabs2.push(OpenaireEntities.SOFTWARE); } if(this.dataProviderInfo.tabsInTypes.orpsTab.has(data[1].classid)) { - this.dataProviderInfo.tabs.push({"name": "Other Research Products", "content": "orpsTab"}); - this.dataProviderInfo.tabs2.push("Other Research Products"); + this.dataProviderInfo.tabs.push({"name": OpenaireEntities.OTHER, "content": "orpsTab"}); + this.dataProviderInfo.tabs2.push(OpenaireEntities.OTHER); } if(this.dataProviderInfo.tabsInTypes.metricsTab.has(data[1].classid)) { diff --git a/landingPages/dataProvider/relatedDatasourcesTab.component.ts b/landingPages/dataProvider/relatedDatasourcesTab.component.ts index 1d41cf1f..5142c1cc 100644 --- a/landingPages/dataProvider/relatedDatasourcesTab.component.ts +++ b/landingPages/dataProvider/relatedDatasourcesTab.component.ts @@ -78,7 +78,7 @@ export class RelatedDatasourcesTabComponent { // true: preprocessing is not over @Input() loading: boolean = true; - // Εvery content provider's id is a single key of a map + // Εvery datasource's id is a single key of a map //@Input() results: Map; @Input() results: {"id": string, "name": string, "count": number}[]; @Input() properties:EnvProperties ; diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index a8056d8b..78fbded9 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -200,7 +200,7 @@ export class ProjectComponent { this.fetchSoftware = new FetchResearchResults(this._searchResearchResultsService); this.fetchOrps = new FetchResearchResults(this._searchResearchResultsService); this.fetchDmps = new FetchResearchResults(this._searchResearchResultsService); - var title = "Project"; + var title = OpenaireEntities.PROJECT; var description = ""; this.header1 = ""; diff --git a/orcid/my-orcid-links/myOrcidLinks.component.ts b/orcid/my-orcid-links/myOrcidLinks.component.ts index d66b6c21..f270af41 100644 --- a/orcid/my-orcid-links/myOrcidLinks.component.ts +++ b/orcid/my-orcid-links/myOrcidLinks.component.ts @@ -16,6 +16,7 @@ import {Meta, Title} from "@angular/platform-browser"; import {UserManagementService} from "../../services/user-management.service"; import {PiwikService} from "../../utils/piwik/piwik.service"; import {IndexInfoService} from "../../utils/indexInfo.service"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; declare var UIkit: any; @@ -33,7 +34,7 @@ declare var UIkit: any; - Discover research results related to you + Discover {{openaireEntities.RESULTS | lowercase}} related to you
@@ -118,6 +119,7 @@ export class MyOrcidLinksComponent { pagingLimit = 0; properties:EnvProperties; + public openaireEntities = OpenaireEntities; public lastOrcidUpdateDate: string = ""; @Input() public communityId: string = null; @@ -318,7 +320,7 @@ export class MyOrcidLinksComponent { this.resultsReturned(results, totalResults, works); }, err => { - console.error("Error getting " + this.getEntityName(this.resultType, true, true)); + console.error("Error getting " + this.getEntityName(this.resultType, true)); this.showLoading = false; this.searchUtils.status = this.errorMessages.getErrorCode(err.status); this.disableForms = false; @@ -412,18 +414,17 @@ export class MyOrcidLinksComponent { return ResultPreview.searchResultConvert(result, (result.entityType)?result.entityType:this.resultType); } - public getEntityName(entityType: string, plural: boolean, full: boolean): string { + public getEntityName(entityType: string, plural: boolean): string { if (entityType == "publication") { - return "publication" + (plural ? "s" : ""); + return plural ? this.openaireEntities.PUBLICATIONS : this.openaireEntities.PUBLICATION; } else if (entityType == "dataset") { - return (full ? "research data" : ("dataset" + (plural ? "s" : ""))); + return plural ? this.openaireEntities.DATASETS : this.openaireEntities.DATASET; } else if (entityType == "software") { - return "software"; + return plural ? this.openaireEntities.SOFTWARE : this.openaireEntities.SOFTWARE_SINGULAR; } else if (entityType == "other") { - return (full ? ("other research product" + (plural ? "s" : "")) : "other"); - } else if (entityType == "result") { - return (full ? ("research outcome" + (plural ? "s" : "")) : "result"); + return plural ? this.openaireEntities.OTHER : this.openaireEntities.OTHER_SINGULAR; } + return plural ? this.openaireEntities.RESULTS : this.openaireEntities.RESULT; } public pageChanged($event) { diff --git a/orcid/my-orcid-links/searchMyOrcidResults.component.html b/orcid/my-orcid-links/searchMyOrcidResults.component.html index c17f990e..9a8bf6b0 100644 --- a/orcid/my-orcid-links/searchMyOrcidResults.component.html +++ b/orcid/my-orcid-links/searchMyOrcidResults.component.html @@ -1,5 +1,5 @@
- @@ -33,7 +33,7 @@ - diff --git a/orcid/my-orcid-links/searchMyOrcidResults.component.ts b/orcid/my-orcid-links/searchMyOrcidResults.component.ts index a54db823..503df21e 100644 --- a/orcid/my-orcid-links/searchMyOrcidResults.component.ts +++ b/orcid/my-orcid-links/searchMyOrcidResults.component.ts @@ -9,6 +9,7 @@ import {ResultPreview} from "../../utils/result-preview/result-preview"; import {properties} from "../../../../environments/environment"; import {Session} from "../../login/utils/helper.class"; import {OrcidService} from "../orcid.service"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; @Component({ selector: 'my-orcid-result', @@ -20,6 +21,7 @@ export class searcMyOrcidResultsComponent { @Input() status: number; @Input() type: string; @Input() properties:EnvProperties; + public openaireEntities = OpenaireEntities; @Input() previewResults:ResultPreview[]; diff --git a/searchPages/find/searchAll.component.html b/searchPages/find/searchAll.component.html index 9d0c5b67..abf6e745 100644 --- a/searchPages/find/searchAll.component.html +++ b/searchPages/find/searchAll.component.html @@ -27,7 +27,7 @@
+ description="Search for {{openaireEntities.RESULTS}} ({{openaireEntities.PUBLICATIONS}}, {{openaireEntities.DATASETS}}, {{openaireEntities.SOFTWARE}}, {{openaireEntities.OTHER}}), {{openaireEntities.PROJECTS}}, {{openaireEntities.ORGANIZATIONS}}, {{openaireEntities.DATASOURCES}} in the OpenAIRE Research Graph. ">
  • { this.filters = this.searchPage.prepareFiltersToShow([], 0); - this.handleError("Error getting refine filters for content providers: ", err); + this.handleError("Error getting refine filters for "+OpenaireEntities.DATASOURCES+": ", err); this.searchUtils.refineStatus = this.errorMessages.getErrorCode(err.status); this.disableRefineForms = false; @@ -248,7 +248,7 @@ export class SearchDataProvidersComponent { }, err => { //console.log(err); - this.handleError("Error getting content providers", err); + this.handleError("Error getting "+OpenaireEntities.DATASOURCES, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); //TODO check erros (service not available, bad request) @@ -312,6 +312,6 @@ export class SearchDataProvidersComponent { } private handleError(message: string, error) { - console.error("Content Providers advanced Search Page: "+message, error); + console.error(OpenaireEntities.DATASOURCES+" advanced Search Page: "+message, error); } } diff --git a/searchPages/searchUtils/advancedSearchForm.component.html b/searchPages/searchUtils/advancedSearchForm.component.html index b237d346..c7e3e291 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.html +++ b/searchPages/searchUtils/advancedSearchForm.component.html @@ -141,16 +141,16 @@ diff --git a/searchPages/searchUtils/advancedSearchForm.component.ts b/searchPages/searchUtils/advancedSearchForm.component.ts index 29031ba8..d865ddcc 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.ts +++ b/searchPages/searchUtils/advancedSearchForm.component.ts @@ -2,12 +2,13 @@ import {ChangeDetectorRef, Component, EventEmitter, Input, Output} from '@angula import {ActivatedRoute, Router} from '@angular/router'; import {AdvancedField, Filter} from './searchHelperClasses.class'; -import {SearchFields} from '../../utils/properties/searchFields'; +import {OpenaireEntities, SearchFields} from '../../utils/properties/searchFields'; import {Dates} from '../../utils/string-utils.class'; import {EnvProperties} from '../../utils/properties/env-properties'; import {SearchCustomFilter} from "./searchUtils.class"; import {Subscriber} from "rxjs"; import {properties} from "../../../../environments/environment"; +import {Open} from "../../utils/modal/open.component"; @Component({ selector: 'advanced-search-form', @@ -37,6 +38,7 @@ export class AdvancedSearchFormComponent { fieldList: { [id: string]: any[] } = {}; public searchFields: SearchFields = new SearchFields(); properties: EnvProperties; + public openaireEntities = OpenaireEntities; public operators: { name: string, id: string }[] = this.searchFields.ADVANCED_SEARCH_OPERATORS; selectedEntity; selectedEntitySimpleUrl; diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index a5202f80..45fc59da 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -173,11 +173,11 @@ export class NewSearchPageComponent { this.customFilterEnabled = params['cf'] && params['cf'] == "true"; if (this.basicMetaDescription.length == 0) { if (this.entityType == "result") { - this.basicMetaDescription = ["Research outcomes", "Discover" + (this.properties.adminToolsCommunity == 'openaire' ? " over 100 million of" : "") + " research outcomes ", "categorized by research type, year range, funder, languages, community and content providers."]; + this.basicMetaDescription = [OpenaireEntities.RESULTS, "Discover" + (this.properties.adminToolsCommunity == 'openaire' ? " over 100 million of" : "") + " "+OpenaireEntities.RESULTS+" ", "categorized by research type, year range, funder, languages, "+OpenaireEntities.COMMUNITY+" and "+OpenaireEntities.DATASOURCES+"."]; } else if (this.entityType == "project") { - this.basicMetaDescription = ["Research projects", "Discover research projects and correlated research categorized by Funder and active year. ", "Statistics data about produced research outcomes per year available."]; + this.basicMetaDescription = ["Research "+OpenaireEntities.PROJECTS, "Discover research "+OpenaireEntities.PROJECTS+" and correlated research categorized by Funder and active year. ", "Statistics data about produced "+OpenaireEntities.RESULTS+" per year available."]; } else if (this.entityType == "organization") { - this.basicMetaDescription = ["Research organization", "Discover worldwide research organizations from over 100 countries and correlated research. ", "Funding, content providers, research pubblications and research data available."]; + this.basicMetaDescription = ["Research "+OpenaireEntities.ORGANIZATIONS, "Discover worldwide research "+OpenaireEntities.ORGANIZATIONS+" from over 100 countries and correlated research. ", "Funding, "+OpenaireEntities.DATASOURCES+", research "+OpenaireEntities.PUBLICATIONS+" and "+OpenaireEntities.DATASETS+" available."]; } else { this.basicMetaDescription.push(this.pageTitle) } diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts index ea0aca9d..5246c1b1 100644 --- a/services/searchResearchResults.service.ts +++ b/services/searchResearchResults.service.ts @@ -19,7 +19,7 @@ export class SearchResearchResultsService { search(resultType: string, params: string, refineParams: string, page: number, size: number, sortBy: string, refineFields: string[], properties: EnvProperties): any { - let link = properties.searchAPIURLLAst + this.getEntityName(resultType, true); + let link = properties.searchAPIURLLAst + this.getEntityQueryName(resultType, true); let url = link + "?"; if (params != null && params != '') { @@ -38,14 +38,14 @@ export class SearchResearchResultsService { } searchById(resultType: string, id: string, properties: EnvProperties): any { - let url = properties.searchAPIURLLAst + this.getEntityName(resultType, true) + "/" + id + "?format=json"; + let url = properties.searchAPIURLLAst + this.getEntityQueryName(resultType, true) + "/" + id + "?format=json"; return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) .pipe(map(res => this.parseResults(resultType, res, properties))); } searchAggregators(resultType: string, id: string, params: string, refineParams: string, page: number, size: number, properties: EnvProperties): any { - let link = properties.searchAPIURLLAst + this.getEntityName(resultType, true); + let link = properties.searchAPIURLLAst + this.getEntityQueryName(resultType, true); let url = link + "?" + "&format=json"; if (params != null && params != '') { @@ -61,7 +61,7 @@ export class SearchResearchResultsService { } searchByListOfDOI(resultType: string, DOIs: string[], refineParams: string, page: number, size: number, refineFields: string[], properties: EnvProperties): any { - let link = properties.searchAPIURLLAst + this.getEntityName(resultType, true); + let link = properties.searchAPIURLLAst + this.getEntityQueryName(resultType, true); let url = link + "?" + "&format=json&"; var doisParams = ""; @@ -84,7 +84,7 @@ export class SearchResearchResultsService { advancedSearch(resultType: string, params: string, page: number, size: number, sortBy: string, properties: EnvProperties, refineParams: string = null, refineFields: string[] = null, refineQuery: string = null): any { let url = properties.searchResourcesAPIURL; - var basicQuery = "(oaftype exact result) and (resulttypeid exact " + this.getEntityName(resultType, false) + ") "; + var basicQuery = "(oaftype exact result) and (resulttypeid exact " + this.getEntityQueryName(resultType, false) + ") "; url += "?query="; if (params != null && params != '') { url += " ( " + basicQuery + " ) " + " and (" + params + ")"; @@ -134,13 +134,13 @@ export class SearchResearchResultsService { searchResultForEntity(resultType: string, params: string, page: number, size: number, properties: EnvProperties): any { let link = properties.searchAPIURLLAst; - //let url = link+params+"/"+this.getEntityName(resultType,true)+ "?format=json"; + //let url = link+params+"/"+this.getEntityQueryName(resultType,true)+ "?format=json"; //url += "&page="+(page-1)+"&size="+size; //url += "&sortBy=resultdateofacceptance,descending"; - //let url = link+"/resources2?format=json&query="+params+" sortBy resultdateofacceptance/sort.descending&type="+this.getEntityName(resultType,true); + //let url = link+"/resources2?format=json&query="+params+" sortBy resultdateofacceptance/sort.descending&type="+this.getEntityQueryName(resultType,true); - let url = link + "/" + this.getEntityName(resultType, true); + let url = link + "/" + this.getEntityQueryName(resultType, true); url += "?format=json"; url += "&fq=" + params; url += "&sortBy=resultdateofacceptance,descending"; @@ -455,7 +455,7 @@ export class SearchResearchResultsService { numOfEntityResults(resultType: string, id: string, entity: string, properties: EnvProperties): any { var parameters: string = ""; - parameters = this.getEntityName(entity, true) + "/" + id + "/" + this.getEntityName(resultType, true) + "/count"; + parameters = this.getEntityQueryName(entity, true) + "/" + id + "/" + this.getEntityQueryName(resultType, true) + "/count"; let url = properties.searchAPIURLLAst + parameters + "?format=json"; return this.numOfResults(url, properties); } @@ -485,7 +485,7 @@ export class SearchResearchResultsService { } numOfSearchResults(resultType: string, params: string, properties: EnvProperties, refineParams: string = null): any { - let url = properties.searchAPIURLLAst + this.getEntityName(resultType, true) + "/count?format=json"; + let url = properties.searchAPIURLLAst + this.getEntityQueryName(resultType, true) + "/count?format=json"; if (params.length > 0) { var DOIs: string[] = DOI.getDOIsFromString(params); var doisParams = ""; @@ -513,7 +513,7 @@ export class SearchResearchResultsService { } countTotalResults(resultType: string, properties: EnvProperties, refineParams: string = null): any { - let url = properties.searchAPIURLLAst + this.getEntityName(resultType, true) + "/count?format=json" + refineParams; + let url = properties.searchAPIURLLAst + this.getEntityQueryName(resultType, true) + "/count?format=json" + refineParams; return this.numOfResults(url, properties); } @@ -523,7 +523,7 @@ export class SearchResearchResultsService { } */ - private getEntityName(entityType: string, plural: boolean) { + private getEntityQueryName(entityType: string, plural: boolean) { if (entityType == "publication" || entityType == "dataset" || entityType == "organization" || entityType == "datasource" || entityType == "project") { if (plural) { return entityType + "s"; diff --git a/sharedComponents/numbers/numbers.component.ts b/sharedComponents/numbers/numbers.component.ts index ba94ba6a..859a73c3 100644 --- a/sharedComponents/numbers/numbers.component.ts +++ b/sharedComponents/numbers/numbers.component.ts @@ -8,6 +8,7 @@ import {NumberSize, NumberUtils} from '../../utils/number-utils.class'; import {BehaviorSubject, Observable, Subscription, zip} from 'rxjs'; import {RouterHelper} from "../../utils/routerHelper.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; export interface Numbers { publicationsSize?: NumberSize; @@ -58,7 +59,7 @@ interface Link { class="number-size">{{numbers.datasourcesSize.size}} - Content providers + {{openaireEntities.DATASOURCES}}

@@ -70,7 +71,7 @@ interface Link { {{numbers.projectsSize.number|number}}{{numbers.projectsSize.size}}

- Projects + {{openaireEntities.PROJECTS}}
@@ -86,7 +87,7 @@ interface Link { class="number uk-text-bold uk-margin-bottom uk-text-center uk-text-left@m">{{numbers.publicationsSize.count|number}}
- publications + {{openaireEntities.PUBLICATIONS}}
@@ -100,7 +101,7 @@ interface Link {
- research data + {{openaireEntities.DATASETS}}
@@ -113,7 +114,7 @@ interface Link { class="number uk-text-bold uk-margin-bottom uk-text-center uk-text-left@m">{{numbers.softwareSize.count|number}}
- software + {{openaireEntities.SOFTWARE}}
@@ -127,7 +128,7 @@ interface Link {
- other research products + {{openaireEntities.OTHER}}
@@ -153,6 +154,7 @@ export class NumbersComponent implements OnInit, OnDestroy { /** When numbers have been initialized this emitter will emitted */ @Output() results: EventEmitter = new EventEmitter(); public properties: EnvProperties = properties; + public openaireEntities = OpenaireEntities; public routerHelper: RouterHelper = new RouterHelper(); public numbers: Numbers = {}; public loading: boolean = true; diff --git a/sharedComponents/other-portals/other-portals.component.html b/sharedComponents/other-portals/other-portals.component.html index db9ef674..84ddcc2d 100644 --- a/sharedComponents/other-portals/other-portals.component.html +++ b/sharedComponents/other-portals/other-portals.component.html @@ -5,7 +5,7 @@ Researcher?
- Explore all OA research outcomes. Link all your research. Build your profile + Explore all OA {{openaireEntities.RESULTS | lowercase}}. Link all your research. Build your profile

@@ -17,7 +17,7 @@

- Content provider? + {{openaireEntities.DATASOURCE}}?

Join OpenAIRE, use our tools and make your content more visible around the world. @@ -32,7 +32,7 @@

- Research community? + {{openaireEntities.COMMUNITY}}?

Use a trusted partner to share, link, disseminate and monitor your research. @@ -51,7 +51,7 @@ Research manager?
- Use our monitoring services and easily track all relevant research outcomes. + Use our monitoring services and easily track all relevant {{openaireEntities.RESULTS | lowercase}}.

{ this.searchUtils.totalResults = data[0]; - //console.info("search Content Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]"); this.results = data[1]; //ar errorCodes:ErrorCodes = new ErrorCodes(); @@ -79,7 +79,7 @@ export class FetchDataproviders { this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; } */ - this.handleError("Error getting content providers for keyword: " + keyword, err); + this.handleError("Error getting "+OpenaireEntities.DATASOURCES+" for keyword: " + keyword, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); } )); @@ -94,7 +94,6 @@ export class FetchDataproviders { this.subscriptions.push(this._searchDataprovidersService.searchDataproviders(parameters, null, page, size, [], properties).subscribe( data => { this.searchUtils.totalResults = data[0]; - //console.info("search Content Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]"); this.results = data[1]; this.searchUtils.status = this.errorCodes.DONE; @@ -112,7 +111,7 @@ export class FetchDataproviders { } else { this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; }*/ - this.handleError("Error getting content providers with parameters: " + parameters + " for Home", err); + this.handleError("Error getting "+OpenaireEntities.DATASOURCES+" with parameters: " + parameters + " for Home", err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); } )); @@ -149,7 +148,7 @@ export class FetchDataproviders { } else { this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; }*/ - this.handleError("Error getting content providers for " + entity + " with id: " + id, err); + this.handleError("Error getting "+OpenaireEntities.DATASOURCES+" for " + entity + " with id: " + id, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); } )); @@ -184,7 +183,7 @@ export class FetchDataproviders { } else { this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; }*/ - this.handleError("Error getting number of content providers for keyword: " + keyword, err); + this.handleError("Error getting number of "+OpenaireEntities.DATASOURCES+" for keyword: " + keyword, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); } )); @@ -240,7 +239,7 @@ export class FetchDataproviders { } else { this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; }*/ - this.handleError("Error getting content providers in share " + type + " for organization with id: " + id, err); + this.handleError("Error getting "+OpenaireEntities.DATASOURCES+" in share " + type + " for "+OpenaireEntities.ORGANIZATION+" with id: " + id, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); this.loadPaging = true; @@ -298,7 +297,7 @@ export class FetchDataproviders { } else { this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; }*/ - this.handleError("Error getting content providers in share " + type + " by subject: " + subject, err); + this.handleError("Error getting "+OpenaireEntities.DATASOURCES+" in share " + type + " by subject: " + subject, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); this.loadPaging = true; @@ -347,7 +346,7 @@ export class FetchDataproviders { } else { this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; }*/ - this.handleError("Error getting content providers for " + entity + " with id: " + id, err); + this.handleError("Error getting "+OpenaireEntities.DATASOURCES+" for " + entity + " with id: " + id, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); } )); @@ -385,13 +384,13 @@ export class FetchDataproviders { } else { this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; }*/ - this.handleError("Error getting content providers for entity registry with id: " + id, err); + this.handleError("Error getting "+OpenaireEntities.DATASOURCES+" for entity registry with id: " + id, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); } )); } private handleError(message: string, error) { - console.error("Fetch Content Providers (class): " + message, error); + console.error("Fetch "+OpenaireEntities.DATASOURCES+" (class): " + message, error); } } diff --git a/utils/fetchEntitiesClasses/fetchProjects.class.ts b/utils/fetchEntitiesClasses/fetchProjects.class.ts index 6b228463..b637e820 100644 --- a/utils/fetchEntitiesClasses/fetchProjects.class.ts +++ b/utils/fetchEntitiesClasses/fetchProjects.class.ts @@ -6,6 +6,7 @@ import {EnvProperties} from '../../utils/properties/env-properties'; import {StringUtils} from '../../utils/string-utils.class'; import {SearchResult} from "../entities/searchResult"; import {Subscriber} from "rxjs"; +import {OpenaireEntities} from "../properties/searchFields"; export class FetchProjects { private errorCodes: ErrorCodes; @@ -50,7 +51,6 @@ export class FetchProjects { this.subscriptions.push(this._searchProjectsService.searchProjects(parameters, refineParams, page, size, [], properties).subscribe( data => { this.searchUtils.totalResults = data[0]; - //console.info("search Projects: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]"); this.results = data[1]; //var errorCodes:ErrorCodes = new ErrorCodes(); @@ -74,7 +74,7 @@ export class FetchProjects { } else { this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; }*/ - this.handleError("Error getting projects for keyword: " + keyword, err); + this.handleError("Error getting "+OpenaireEntities.PROJECTS+" for keyword: " + keyword, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); } )); @@ -87,7 +87,6 @@ export class FetchProjects { this.subscriptions.push(this._searchProjectsService.getProjectsforDataProvider(id, page, size, properties).subscribe( data => { this.searchUtils.totalResults = data[0]; - //console.info("search Projects for Dataproviders: [Id:"+id+" ] [total results:"+this.searchUtils.totalResults+"]"); this.results = data[1]; //var errorCodes:ErrorCodes = new ErrorCodes(); @@ -111,7 +110,7 @@ export class FetchProjects { } else { this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; }*/ - this.handleError("Error getting projects for content provider with id: " + id, err); + this.handleError("Error getting "+OpenaireEntities.PROJECTS+" for "+OpenaireEntities.DATASOURCE+" with id: " + id, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); } )); @@ -149,7 +148,7 @@ export class FetchProjects { } else { this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; }*/ - this.handleError("Error getting number of projects for " + entity + " with id: " + id, err); + this.handleError("Error getting number of "+OpenaireEntities.PROJECTS+" for " + entity + " with id: " + id, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); } )); @@ -162,7 +161,6 @@ export class FetchProjects { this.subscriptions.push(this._searchProjectsService.getProjectsForOrganizations(organizationId, filterquery, page, size, refineFields, properties).subscribe( data => { this.searchUtils.totalResults = data[0]; // the results can be filtered so this number can be no total results - //console.info("search Projects for Organization: [Id:"+organizationId+" ] [total results:"+this.searchUtils.totalResults+"]"); this.results = data[1]; if (refineFields && refineFields.length > 0) { this.filters = data[2]; @@ -199,13 +197,13 @@ export class FetchProjects { } }, err => { - this.handleError("Error getting projects for organization with id: " + organizationId, err); + this.handleError("Error getting "+OpenaireEntities.PROJECTS+" for "+OpenaireEntities.ORGANIZATION+" with id: " + organizationId, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); } )); } private handleError(message: string, error) { - console.error("Fetch Projects (class): " + message, error); + console.error("Fetch "+OpenaireEntities.PROJECTS+" (class): " + message, error); } } diff --git a/utils/fetchEntitiesClasses/fetchResearchResults.class.ts b/utils/fetchEntitiesClasses/fetchResearchResults.class.ts index cff53b97..1e69efc2 100644 --- a/utils/fetchEntitiesClasses/fetchResearchResults.class.ts +++ b/utils/fetchEntitiesClasses/fetchResearchResults.class.ts @@ -1,7 +1,7 @@ import {SearchResearchResultsService} from '../../services/searchResearchResults.service'; import {ErrorCodes} from '../../utils/properties/errorCodes'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; -import {SearchFields} from '../../utils/properties/searchFields'; +import {OpenaireEntities, SearchFields} from '../../utils/properties/searchFields'; import {SearchCustomFilter, SearchUtilsClass} from '../../searchPages/searchUtils/searchUtils.class'; import {DOI, StringUtils} from '../../utils/string-utils.class'; import {Subject, Subscriber} from 'rxjs'; @@ -315,7 +315,7 @@ export class FetchResearchResults { } else { this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; }*/ - this.handleError("Error getting "+this.getEntityName(resultType,true)+" for content provider ("+resultsFrom+") with id: "+id, err); + this.handleError("Error getting "+this.getEntityName(resultType,true)+" for "+OpenaireEntities.DATASOURCE+" ("+resultsFrom+") with id: "+id, err); this.searchUtils.status = this.errorMessages.getErrorCode(err.status); } )); @@ -362,17 +362,27 @@ export class FetchResearchResults { } private handleError(message: string, error) { - console.error("Fetch Research Results (class): "+message, error); + console.error("Fetch "+OpenaireEntities.RESULTS+" (class): "+message, error); } private getEntityName (entityType:string, plural:boolean){ - if(entityType == "publication" ||entityType == "dataset" || entityType == "organization" || entityType == "datasource" || entityType == "project" ){ - if(plural){ - return entityType+ "s"; - }else{ - return entityType; - } - }else{ + if(entityType == "publication") { + return plural ? OpenaireEntities.PUBLICATIONS : OpenaireEntities.PUBLICATION; + } else if (entityType == "dataset") { + return plural ? OpenaireEntities.DATASETS : OpenaireEntities.DATASET; + } else if (entityType == "software") { + return plural ? OpenaireEntities.SOFTWARE : OpenaireEntities.SOFTWARE_SINGULAR; + } else if (entityType == "other") { + return plural ? OpenaireEntities.OTHER : OpenaireEntities.OTHER_SINGULAR; + } else if (entityType == "organization") { + return plural ? OpenaireEntities.ORGANIZATIONS : OpenaireEntities.ORGANIZATION; + } else if (entityType == "datasource") { + return plural ? OpenaireEntities.DATASOURCES : OpenaireEntities.DATASOURCE; + } else if (entityType == "project" ) { + return plural ? OpenaireEntities.PROJECTS : OpenaireEntities.PROJECT; + } else if(entityType == "result") { + return plural ? OpenaireEntities.RESULTS : OpenaireEntities.RESULT; + } else { return entityType; } } diff --git a/utils/properties/searchFields.ts b/utils/properties/searchFields.ts index ebcbdfa7..893d0279 100644 --- a/utils/properties/searchFields.ts +++ b/utils/properties/searchFields.ts @@ -72,7 +72,7 @@ export class SearchFields { }, ["pid"]: {name: "PID", type: "keyword", param: "pid", operator: "pd", equalityOperator: " = ", filterType: null}, ["resulthostingdatasourceid"]: { - name: "Hosting Content Provider", + name: "Hosting "+OpenaireEntities.DATASOURCE, type: "entity", param: "hostedBy", operator: "hs", @@ -104,7 +104,7 @@ export class SearchFields { filterType: "checkbox" }, ["community"]: { - name: "Research Community", + name: OpenaireEntities.COMMUNITY, type: "refine", param: "community", operator: "cm", @@ -120,7 +120,7 @@ export class SearchFields { filterType: "checkbox" }, ["relprojectid"]: { - name: "Project", + name: OpenaireEntities.PROJECT, type: "entity", param: "project", operator: "po", @@ -208,7 +208,7 @@ export class SearchFields { filterType: null }, ["collectedfromdatasourceid"]: { - name: "Collected from Content Provider", + name: "Collected from "+OpenaireEntities.DATASOURCE, type: "entity", param: "collectedFrom", operator: "cl", @@ -383,7 +383,7 @@ export class SearchFields { filterType: null }, ["collectedfromdatasourceid"]: { - name: "Collected from Content Provider", + name: "Collected from "+OpenaireEntities.DATASOURCE, type: "entity", param: "collectedFrom", operator: "cl", @@ -500,7 +500,7 @@ export class SearchFields { filterType: "checkbox" }, ["collectedfromdatasourceid"]: { - name: "Collected from Content Provider", + name: "Collected from "+OpenaireEntities.DATASOURCE, type: "entity", param: "collectedFrom", operator: "cl", @@ -728,7 +728,7 @@ export class SearchFields { Compatibility Level: datasourcecompatibilityname Country: country Content: datasourceodcontenttypes - Content Provider: resulthostingdatasource + Datasource: resulthostingdatasource Collected From: collectedfrom BULLETS Access Mode: resultbestaccessright diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index ee9e3993..3f8e2bed 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -122,11 +122,17 @@ export class ResultPreviewComponent implements OnInit, OnChanges { public getTypeName(type: string): string { if (type === "dataset") { - return "research data"; + return this.openaireEntities.DATASET; } else if (type === "other") { - return "other research product"; + return this.openaireEntities.OTHER_SINGULAR; } else if (type === "dataprovider") { - return "content provider"; + return this.openaireEntities.DATASOURCE; + } else if (type === "publication") { + return this.openaireEntities.PUBLICATION; + } else if (type === "software") { + return this.openaireEntities.SOFTWARE_SINGULAR; + } else if (type === "result") { + return this.openaireEntities.RESULT; } else { return type; }