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 @@
-
+
0">
-
+
0 || fetchDatasets.searchUtils.totalResults > 0
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)">
@@ -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 @@
- 0" [type]="'research outcomes'"
+ 0" [type]="openaireEntities.RESULTS"
(pageChange)="pageChanged($event)"
[page]="currentPage" [pageSize]="resultsPerPage"
[totalResults]="totalResults">
@@ -33,7 +33,7 @@
- 0" [type]="'research outcomes'"
+ 0" [type]="openaireEntities.RESULTS"
(pageChange)="pageChanged($event)"
[page]="currentPage" [pageSize]="resultsPerPage"
[totalResults]="totalResults">
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}}