[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
This commit is contained in:
Konstantina Galouni 2022-05-09 13:13:44 +03:00
parent 150b26a5d5
commit bd6e141801
30 changed files with 171 additions and 141 deletions

View File

@ -1,6 +1,7 @@
import {Component, Input, ViewChild} from '@angular/core'; import {Component, Input, ViewChild} from '@angular/core';
import {ShowOptions} from './claimHelper.class'; import {ShowOptions} from './claimHelper.class';
import {MatSelect} from "@angular/material/select"; import {MatSelect} from "@angular/material/select";
import {OpenaireEntities} from "../../utils/properties/searchFields";
@Component({ @Component({
@ -13,9 +14,9 @@ import {MatSelect} from "@angular/material/select";
<mat-select [(value)]="showOptions.show" <mat-select [(value)]="showOptions.show"
[disableOptionCentering]="true" > [disableOptionCentering]="true" >
<mat-option *ngIf="showOptions.linkToEntities.indexOf('result')!=-1" value="result">Research outcomes</mat-option> <mat-option *ngIf="showOptions.linkToEntities.indexOf('result')!=-1" value="result">{{openaireEntities.RESULTS}}</mat-option>
<mat-option *ngIf="showOptions.linkToEntities.indexOf('project')!=-1" value="project">Projects</mat-option> <mat-option *ngIf="showOptions.linkToEntities.indexOf('project')!=-1" value="project">{{openaireEntities.PROJECTS}}</mat-option>
<mat-option *ngIf="showOptions.linkToEntities.indexOf('context')!=-1" value="context">Research communities</mat-option> <mat-option *ngIf="showOptions.linkToEntities.indexOf('context')!=-1" value="context">{{openaireEntities.COMMUNITIES}}</mat-option>
</mat-select> </mat-select>
@ -27,6 +28,7 @@ import {MatSelect} from "@angular/material/select";
export class ClaimEntitiesSelectionComponent{ export class ClaimEntitiesSelectionComponent{
@ViewChild(MatSelect) matSelect: MatSelect; @ViewChild(MatSelect) matSelect: MatSelect;
@Input() showOptions:ShowOptions = new ShowOptions(); @Input() showOptions:ShowOptions = new ShowOptions();
public openaireEntities = OpenaireEntities;
open() { open() {
if (this.matSelect && !this.matSelect.focused) { if (this.matSelect && !this.matSelect.focused) {

View File

@ -8,6 +8,7 @@ import {LinkingGenericComponent} from "../linking/linkingGeneric.component";
import {ClaimResultSearchFormComponent} from "../claim-utils/claimResultSearchForm.component"; import {ClaimResultSearchFormComponent} from "../claim-utils/claimResultSearchForm.component";
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {OpenaireEntities} from "../../utils/properties/searchFields";
@Component({ @Component({
@ -137,7 +138,7 @@ export class DirectLinkingComponent {
err => { err => {
this.validInput = this.isValidInput(null); this.validInput = this.isValidInput(null);
//console.log("An error occured") //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); console.error("Direct Linking Page: " + message, error);
} }
private getEntityName (entityType:string, plural:boolean, full:boolean): string { private getEntityName (entityType:string, plural:boolean) {
if(entityType == "publication") { if (entityType == "publication") {
return "publication" + (plural ? "s" : ""); return plural ? OpenaireEntities.PUBLICATIONS : OpenaireEntities.PUBLICATION;
} else if(entityType == "dataset") { } else if (entityType == "dataset") {
return (full ? "research data" : ("dataset" + (plural ? "s" : ""))); return plural ? OpenaireEntities.DATASETS : OpenaireEntities.DATASET;
} else if(entityType == "software") { } else if (entityType == "software") {
return "software"; return plural ? OpenaireEntities.SOFTWARE : OpenaireEntities.SOFTWARE_SINGULAR;
} else if(entityType == "other") { } else if (entityType == "other") {
return (full ? ("other research product" + (plural ? "s" : "")) : "other"); return plural ? OpenaireEntities.OTHER : OpenaireEntities.OTHER_SINGULAR;
} else if (entityType == "result") {
return plural ? OpenaireEntities.RESULTS : OpenaireEntities.RESULT;
} else {
return entityType;
} }
} }
} }

View File

@ -24,7 +24,7 @@
<div id="tm-main" class="uk-section uk-padding-remove-top tm-middle" *ngIf="showOptions.show != 'claim'"> <div id="tm-main" class="uk-section uk-padding-remove-top tm-middle" *ngIf="showOptions.show != 'claim'">
<div class="uk-grid"> <div class="uk-grid">
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<schema2jsonld *ngIf="url" [URL]="url" name="Link your research outcomes" type="other"></schema2jsonld> <schema2jsonld *ngIf="url" [URL]="url" name="Link your {{openaireEntities.RESULTS}}" type="other"></schema2jsonld>
<div [class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '"> <div [class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '">
<div> <div>

View File

@ -13,6 +13,7 @@ import {Subscriber} from "rxjs";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component"; import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
import {MetricsService} from "../../services/metrics.service"; import {MetricsService} from "../../services/metrics.service";
import {OpenaireEntities} from "../../utils/properties/searchFields";
declare var UIkit:any; declare var UIkit:any;
@ -42,6 +43,7 @@ export class LinkingGenericComponent {
@Input() sources:ClaimEntity[] =[]; @Input() sources:ClaimEntity[] =[];
properties:EnvProperties; properties:EnvProperties;
public openaireEntities = OpenaireEntities;
@Input() localStoragePrefix:string = "linking_"; @Input() localStoragePrefix:string = "linking_";
url=null; url=null;
@ViewChild(AlertModal) alert; @ViewChild(AlertModal) alert;

View File

@ -5,11 +5,12 @@ import { EnvProperties} from '../../utils/properties/env-properties';
import {ConnectHelper} from '../connectHelper'; import {ConnectHelper} from '../connectHelper';
import {SearchCommunityDataprovidersService} from '../contentProviders/searchDataproviders.service'; import {SearchCommunityDataprovidersService} from '../contentProviders/searchDataproviders.service';
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {OpenaireEntities} from "../../utils/properties/searchFields";
@Component({ @Component({
selector: 'approved-by-community', selector: 'approved-by-community',
template: ` template: `
<span *ngIf="approved" class="uk-align-right uk-label custom-label uk-label-success">Community Approved</span> <span *ngIf="approved" class="uk-align-right uk-label custom-label uk-label-success">{{openaireEntities.COMMUNITY}} Approved</span>
` `
}) })
@ -21,6 +22,7 @@ export class ApprovedByCommunityComponent {
private communityContentProviders = []; private communityContentProviders = [];
properties:EnvProperties; properties:EnvProperties;
public openaireEntities = OpenaireEntities;
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchCommunityDataprovidersService) {} constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchCommunityDataprovidersService) {}
@ -40,7 +42,7 @@ export class ApprovedByCommunityComponent {
this.approved = this.checkApproval(); this.approved = this.checkApproval();
}, },
error => { 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) { private handleError(message: string, error) {
console.error("Approved by Community (component): "+message, error); console.error("Approved by "+OpenaireEntities.COMMUNITY+" (component): "+message, error);
} }
} }

View File

@ -4,7 +4,7 @@ import {Location} from '@angular/common';
import {SearchDataprovidersService} from '../services/searchDataproviders.service'; import {SearchDataprovidersService} from '../services/searchDataproviders.service';
import {ErrorCodes} from '../utils/properties/errorCodes'; import {ErrorCodes} from '../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../utils/errorMessages.component'; 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 {SearchCustomFilter, SearchUtilsClass} from '../searchPages/searchUtils/searchUtils.class';
import {EnvProperties} from '../utils/properties/env-properties'; import {EnvProperties} from '../utils/properties/env-properties';
@ -20,13 +20,6 @@ import {properties} from "../../../environments/environment";
<div class="uk-section uk-padding-remove-bottom uk-padding-remove-top"> <div class="uk-section uk-padding-remove-bottom uk-padding-remove-top">
<div class="explorePanelBackground communityPanelBackground uk-padding-small"> <div class="explorePanelBackground communityPanelBackground uk-padding-small">
<div class="uk-container uk-container-large uk-margin-small-top uk-margin-small-bottom"> <div class="uk-container uk-container-large uk-margin-small-top uk-margin-small-bottom">
<!--<ul class="uk-breadcrumb">
<li><a class="breadcrumb" routerLinkActive="router-link-active" [routerLink]="depositLearnHowPage"
[queryParams]="properties.environment!='development'?{}:routerHelper.createQueryParam('communityId',communityId)">
Deposit
</a></li>
<li><span class="active uk-text-bold">Browse content providers</span></li>
</ul>-->
<breadcrumbs [light]="!!(this.communityId)" [breadcrumbs]="breadcrumbs"></breadcrumbs> <breadcrumbs [light]="!!(this.communityId)" [breadcrumbs]="breadcrumbs"></breadcrumbs>
</div> </div>
</div> </div>
@ -214,7 +207,6 @@ export class SearchDataprovidersToDepositComponent {
} }
}, },
err => { err => {
this.handleError("Error getting content providers", err);
this.searchUtils.status = this.errorMessages.getErrorCode(err.status); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
this.disableForms = false; this.disableForms = false;
@ -225,6 +217,6 @@ export class SearchDataprovidersToDepositComponent {
*/ */
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Content Providers simple Search Page: "+message, error); console.error(OpenaireEntities.DATASOURCES+" simple Search Page: "+message, error);
} }
} }

View File

@ -6,6 +6,7 @@ import {SEOService} from "../sharedComponents/SEO/SEO.service";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {RESPONSE} from '../utils/tokens'; import {RESPONSE} from '../utils/tokens';
import {Response} from 'express'; import {Response} from 'express';
import {OpenaireEntities} from "../utils/properties/searchFields";
@Component({ @Component({
selector: 'error', selector: 'error',
@ -77,25 +78,28 @@ export class ErrorPageComponent {
if(this.page_type) { if(this.page_type) {
if (this.page_type == "publication") { if (this.page_type == "publication") {
this.searchPage = properties.searchLinkToPublications; this.searchPage = properties.searchLinkToPublications;
this.page_type_name = "publication"; this.page_type_name = OpenaireEntities.PUBLICATION.toLowerCase();
} else if (this.page_type == "software") { } else if (this.page_type == "software") {
this.searchPage = properties.searchLinkToSoftware; this.searchPage = properties.searchLinkToSoftware;
this.page_type_name = "software"; this.page_type_name = OpenaireEntities.SOFTWARE_SINGULAR.toLowerCase();
} else if (this.page_type == "dataset") { } else if (this.page_type == "dataset") {
this.searchPage = properties.searchLinkToDatasets; this.searchPage = properties.searchLinkToDatasets;
this.page_type_name = "dataset"; this.page_type_name = OpenaireEntities.DATASET.toLowerCase();
} else if (this.page_type == "orp") { } else if (this.page_type == "orp") {
this.searchPage = properties.searchLinkToOrps; this.searchPage = properties.searchLinkToOrps;
this.page_type_name = "research product"; this.page_type_name = OpenaireEntities.OTHER_SINGULAR.toLowerCase();
} else if (this.page_type == "organization") { } else if (this.page_type == "organization") {
this.searchPage = properties.searchLinkToOrganizations; this.searchPage = properties.searchLinkToOrganizations;
this.page_type_name = "organization"; this.page_type_name = OpenaireEntities.ORGANIZATION.toLowerCase();
} else if (this.page_type == "project") { } else if (this.page_type == "project") {
this.searchPage = properties.searchLinkToProjects; this.searchPage = properties.searchLinkToProjects;
this.page_type_name = "project"; this.page_type_name = OpenaireEntities.PROJECT.toLowerCase();
} else if (this.page_type == "dataprovider") { } else if (this.page_type == "dataprovider") {
this.searchPage = properties.searchLinkToDataProviders; 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();
} }
} }
}); });

View File

@ -299,7 +299,7 @@
</search-tab> </search-tab>
</div> </div>
</ng-container> </ng-container>
<!-- Content Providers --> <!-- Datasources -->
<ng-container *ngIf="fetchDataproviders.searchUtils.totalResults > 0"> <ng-container *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
<div id="datasources" class="landing-section uk-padding uk-padding-remove-horizontal"> <div id="datasources" class="landing-section uk-padding uk-padding-remove-horizontal">
<search-tab [fetch]="fetchDataproviders" resultType="dataprovider" <search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
@ -349,7 +349,7 @@
</search-tab> </search-tab>
</div> </div>
</ng-container> </ng-container>
<!--Related Content Providers--> <!--Related Datasources-->
<ng-container *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0 <ng-container *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"> || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)">
<div id="relatedDatasources" class="landing-section uk-padding uk-padding-remove-horizontal"> <div id="relatedDatasources" class="landing-section uk-padding uk-padding-remove-horizontal">

View File

@ -64,7 +64,7 @@ export class DataProviderComponent {
@ViewChild('relatedDatasourcesModal') relatedDatasourcesModal; @ViewChild('relatedDatasourcesModal') relatedDatasourcesModal;
@ViewChild('addThisModal') addThisModal @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 fetchPublications: FetchResearchResults;
public fetchDatasets: FetchResearchResults; public fetchDatasets: FetchResearchResults;
public fetchSoftware: FetchResearchResults; public fetchSoftware: FetchResearchResults;
@ -311,7 +311,6 @@ export class DataProviderComponent {
} }
this.showTabs = true; this.showTabs = true;
this.updateTitle(this.dataProviderInfo.title.name?this.dataProviderInfo.title.name:this.dataProviderInfo.officialName); 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))); 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')) { if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.subscriptions.push(this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe()); this.subscriptions.push(this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe());

View File

@ -5,6 +5,7 @@ import {DataProviderInfo, DataproviderProvenance} from '../../utils/entities/dat
import{EnvProperties} from '../../utils/properties/env-properties'; import{EnvProperties} from '../../utils/properties/env-properties';
import {map} from "rxjs/operators"; import {map} from "rxjs/operators";
import {ParsingFunctions} from "../landing-utils/parsingFunctions.class"; import {ParsingFunctions} from "../landing-utils/parsingFunctions.class";
import {OpenaireEntities} from "../../utils/properties/searchFields";
@Injectable() @Injectable()
@ -184,26 +185,26 @@ export class DataProviderService {
} }
this.dataProviderInfo.tabs = []; this.dataProviderInfo.tabs = [];
if(this.dataProviderInfo.tabsInTypes.publicationsTab.has(data[1].classid)) { if(this.dataProviderInfo.tabsInTypes.publicationsTab.has(data[1].classid)) {
this.dataProviderInfo.tabs.push({"name": "Publications", "content": "publicationsTab"}); this.dataProviderInfo.tabs.push({"name": OpenaireEntities.PUBLICATIONS, "content": "publicationsTab"});
this.dataProviderInfo.tabs2.push("Publications"); this.dataProviderInfo.tabs2.push(OpenaireEntities.PUBLICATIONS);
} }
if(this.dataProviderInfo.tabsInTypes.datasetsTab.has(data[1].classid)) { if(this.dataProviderInfo.tabsInTypes.datasetsTab.has(data[1].classid)) {
this.dataProviderInfo.tabs.push({"name": "Research Data", "content": "datasetsTab"}); this.dataProviderInfo.tabs.push({"name": OpenaireEntities.DATASETS, "content": "datasetsTab"});
this.dataProviderInfo.tabs2.push("Research Data"); this.dataProviderInfo.tabs2.push(OpenaireEntities.DATASETS);
} }
if(this.dataProviderInfo.tabsInTypes.projectsTab.has(data[1].classid)) { if(this.dataProviderInfo.tabsInTypes.projectsTab.has(data[1].classid)) {
this.dataProviderInfo.tabs.push({"name": "Projects", "content": "projectsTab"}); this.dataProviderInfo.tabs.push({"name": OpenaireEntities.PROJECTS, "content": "projectsTab"});
this.dataProviderInfo.tabs2.push("Projects"); this.dataProviderInfo.tabs2.push(OpenaireEntities.PROJECTS);
} }
if(this.dataProviderInfo.tabsInTypes.datasourcesTab.has(data[1].classid)) { if(this.dataProviderInfo.tabsInTypes.datasourcesTab.has(data[1].classid)) {
this.dataProviderInfo.tabs.push({"name": "Content Providers", "content": "datasourcesTab"}); this.dataProviderInfo.tabs.push({"name": OpenaireEntities.DATASOURCES, "content": "datasourcesTab"});
this.dataProviderInfo.tabs2.push("Content Providers"); this.dataProviderInfo.tabs2.push(OpenaireEntities.DATASOURCES);
} }
if(this.dataProviderInfo.tabsInTypes.relatedDatasourcesTab.has(data[1].classid)) { if(this.dataProviderInfo.tabsInTypes.relatedDatasourcesTab.has(data[1].classid)) {
this.dataProviderInfo.tabs.push({"name": "Related Content Providers", "content": "relatedDatasourcesTab"}); this.dataProviderInfo.tabs.push({"name": "Related "+OpenaireEntities.DATASOURCES, "content": "relatedDatasourcesTab"});
this.dataProviderInfo.tabs2.push("Related Content Providers"); this.dataProviderInfo.tabs2.push("Related "+OpenaireEntities.DATASOURCES);
} }
if(this.dataProviderInfo.tabsInTypes.statisticsTab.has(data[1].classid)) { 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)) { if(this.dataProviderInfo.tabsInTypes.softwareTab.has(data[1].classid)) {
this.dataProviderInfo.tabs.push({"name": "Software", "content": "softwareTab"}); this.dataProviderInfo.tabs.push({"name": OpenaireEntities.SOFTWARE, "content": "softwareTab"});
this.dataProviderInfo.tabs2.push("Software"); this.dataProviderInfo.tabs2.push(OpenaireEntities.SOFTWARE);
} }
if(this.dataProviderInfo.tabsInTypes.orpsTab.has(data[1].classid)) { if(this.dataProviderInfo.tabsInTypes.orpsTab.has(data[1].classid)) {
this.dataProviderInfo.tabs.push({"name": "Other Research Products", "content": "orpsTab"}); this.dataProviderInfo.tabs.push({"name": OpenaireEntities.OTHER, "content": "orpsTab"});
this.dataProviderInfo.tabs2.push("Other Research Products"); this.dataProviderInfo.tabs2.push(OpenaireEntities.OTHER);
} }
if(this.dataProviderInfo.tabsInTypes.metricsTab.has(data[1].classid)) { if(this.dataProviderInfo.tabsInTypes.metricsTab.has(data[1].classid)) {

View File

@ -78,7 +78,7 @@ export class RelatedDatasourcesTabComponent {
// true: preprocessing is not over // true: preprocessing is not over
@Input() loading: boolean = true; @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<string, {"name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string}>; //@Input() results: Map<string, {"name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string}>;
@Input() results: {"id": string, "name": string, "count": number}[]; @Input() results: {"id": string, "name": string, "count": number}[];
@Input() properties:EnvProperties ; @Input() properties:EnvProperties ;

View File

@ -200,7 +200,7 @@ export class ProjectComponent {
this.fetchSoftware = new FetchResearchResults(this._searchResearchResultsService); this.fetchSoftware = new FetchResearchResults(this._searchResearchResultsService);
this.fetchOrps = new FetchResearchResults(this._searchResearchResultsService); this.fetchOrps = new FetchResearchResults(this._searchResearchResultsService);
this.fetchDmps = new FetchResearchResults(this._searchResearchResultsService); this.fetchDmps = new FetchResearchResults(this._searchResearchResultsService);
var title = "Project"; var title = OpenaireEntities.PROJECT;
var description = ""; var description = "";
this.header1 = ""; this.header1 = "";

View File

@ -16,6 +16,7 @@ import {Meta, Title} from "@angular/platform-browser";
import {UserManagementService} from "../../services/user-management.service"; import {UserManagementService} from "../../services/user-management.service";
import {PiwikService} from "../../utils/piwik/piwik.service"; import {PiwikService} from "../../utils/piwik/piwik.service";
import {IndexInfoService} from "../../utils/indexInfo.service"; import {IndexInfoService} from "../../utils/indexInfo.service";
import {OpenaireEntities} from "../../utils/properties/searchFields";
declare var UIkit: any; declare var UIkit: any;
@ -33,7 +34,7 @@ declare var UIkit: any;
<span *ngIf="authorNameParam" class="uk-width-1-1 uk-width-expand@m"> <span *ngIf="authorNameParam" class="uk-width-1-1 uk-width-expand@m">
<a class="uk-button-text uk-align-left uk-align-right@m" [queryParams]="authorNameParam" <a class="uk-button-text uk-align-left uk-align-right@m" [queryParams]="authorNameParam"
[routerLink]="properties.searchLinkToAdvancedResults" routerLinkActive="router-link-active"> [routerLink]="properties.searchLinkToAdvancedResults" routerLinkActive="router-link-active">
Discover research results related to you Discover {{openaireEntities.RESULTS | lowercase}} related to you
</a> </a>
</span> </span>
</div> </div>
@ -118,6 +119,7 @@ export class MyOrcidLinksComponent {
pagingLimit = 0; pagingLimit = 0;
properties:EnvProperties; properties:EnvProperties;
public openaireEntities = OpenaireEntities;
public lastOrcidUpdateDate: string = ""; public lastOrcidUpdateDate: string = "";
@Input() public communityId: string = null; @Input() public communityId: string = null;
@ -318,7 +320,7 @@ export class MyOrcidLinksComponent {
this.resultsReturned(results, totalResults, works); this.resultsReturned(results, totalResults, works);
}, },
err => { err => {
console.error("Error getting " + this.getEntityName(this.resultType, true, true)); console.error("Error getting " + this.getEntityName(this.resultType, true));
this.showLoading = false; this.showLoading = false;
this.searchUtils.status = this.errorMessages.getErrorCode(err.status); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
this.disableForms = false; this.disableForms = false;
@ -412,18 +414,17 @@ export class MyOrcidLinksComponent {
return ResultPreview.searchResultConvert(result, (result.entityType)?result.entityType:this.resultType); 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") { if (entityType == "publication") {
return "publication" + (plural ? "s" : ""); return plural ? this.openaireEntities.PUBLICATIONS : this.openaireEntities.PUBLICATION;
} else if (entityType == "dataset") { } else if (entityType == "dataset") {
return (full ? "research data" : ("dataset" + (plural ? "s" : ""))); return plural ? this.openaireEntities.DATASETS : this.openaireEntities.DATASET;
} else if (entityType == "software") { } else if (entityType == "software") {
return "software"; return plural ? this.openaireEntities.SOFTWARE : this.openaireEntities.SOFTWARE_SINGULAR;
} else if (entityType == "other") { } else if (entityType == "other") {
return (full ? ("other research product" + (plural ? "s" : "")) : "other"); return plural ? this.openaireEntities.OTHER : this.openaireEntities.OTHER_SINGULAR;
} else if (entityType == "result") {
return (full ? ("research outcome" + (plural ? "s" : "")) : "result");
} }
return plural ? this.openaireEntities.RESULTS : this.openaireEntities.RESULT;
} }
public pageChanged($event) { public pageChanged($event) {

View File

@ -1,5 +1,5 @@
<div class="uk-margin-medium-top uk-margin"> <div class="uk-margin-medium-top uk-margin">
<no-load-paging *ngIf="totalResults > 0" [type]="'research outcomes'" <no-load-paging *ngIf="totalResults > 0" [type]="openaireEntities.RESULTS"
(pageChange)="pageChanged($event)" (pageChange)="pageChanged($event)"
[page]="currentPage" [pageSize]="resultsPerPage" [page]="currentPage" [pageSize]="resultsPerPage"
[totalResults]="totalResults"> [totalResults]="totalResults">
@ -33,7 +33,7 @@
</li> </li>
</ul> </ul>
<no-load-paging *ngIf="totalResults > 0" [type]="'research outcomes'" <no-load-paging *ngIf="totalResults > 0" [type]="openaireEntities.RESULTS"
(pageChange)="pageChanged($event)" (pageChange)="pageChanged($event)"
[page]="currentPage" [pageSize]="resultsPerPage" [page]="currentPage" [pageSize]="resultsPerPage"
[totalResults]="totalResults"> [totalResults]="totalResults">

View File

@ -9,6 +9,7 @@ import {ResultPreview} from "../../utils/result-preview/result-preview";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {Session} from "../../login/utils/helper.class"; import {Session} from "../../login/utils/helper.class";
import {OrcidService} from "../orcid.service"; import {OrcidService} from "../orcid.service";
import {OpenaireEntities} from "../../utils/properties/searchFields";
@Component({ @Component({
selector: 'my-orcid-result', selector: 'my-orcid-result',
@ -20,6 +21,7 @@ export class searcMyOrcidResultsComponent {
@Input() status: number; @Input() status: number;
@Input() type: string; @Input() type: string;
@Input() properties:EnvProperties; @Input() properties:EnvProperties;
public openaireEntities = OpenaireEntities;
@Input() previewResults:ResultPreview[]; @Input() previewResults:ResultPreview[];

View File

@ -27,7 +27,7 @@
</div> </div>
<schema2jsonld *ngIf="name && logoURL" [URL]="properties.domain+ properties.baseLink +'/search/find'" <schema2jsonld *ngIf="name && logoURL" [URL]="properties.domain+ properties.baseLink +'/search/find'"
[logoURL]="properties.domain + properties.baseLink+logoURL" type="search" [name]=name [logoURL]="properties.domain + properties.baseLink+logoURL" type="search" [name]=name
description="Search for research outcomes (publications, datasets, software, other research products), projects, organizations, content providers in the OpenAIRE Research Graph. "></schema2jsonld> description="Search for {{openaireEntities.RESULTS}} ({{openaireEntities.PUBLICATIONS}}, {{openaireEntities.DATASETS}}, {{openaireEntities.SOFTWARE}}, {{openaireEntities.OTHER}}), {{openaireEntities.PROJECTS}}, {{openaireEntities.ORGANIZATIONS}}, {{openaireEntities.DATASOURCES}} in the OpenAIRE Research Graph. "></schema2jsonld>
<div class="uk-container-large uk-container uk-margin-large-top uk-flex uk-flex-center"> <div class="uk-container-large uk-container uk-margin-large-top uk-flex uk-flex-center">
<ul class="uk-tab" uk-tab="animation: uk-animation-fade"> <ul class="uk-tab" uk-tab="animation: uk-animation-fade">
<li *ngIf="showPublications || showDatasets || showOrps || showSoftware" (click)="entityChanged('result')" <li *ngIf="showPublications || showDatasets || showOrps || showSoftware" (click)="entityChanged('result')"

View File

@ -78,11 +78,12 @@ export class SearchAllComponent {
showOrganizations: boolean = false; showOrganizations: boolean = false;
advancedSearchLink: string = "/search/advanced/publications"; advancedSearchLink: string = "/search/advanced/publications";
properties: EnvProperties; properties: EnvProperties;
public openaireEntities = OpenaireEntities;
@Input() logoURL; @Input() logoURL;
@Input() name; @Input() name;
@Input() customFilter: SearchCustomFilter = null; @Input() customFilter: SearchCustomFilter = null;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() formPlaceholderText = "Search for research outcomes, projects, content providers & organizations in OpenAIRE"; @Input() formPlaceholderText = "Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS+" in OpenAIRE";
@Input() searchForm: SearchForm = {class: 'search-form', dark: true} @Input() searchForm: SearchForm = {class: 'search-form', dark: true}
@Input() breadcrumbs: Breadcrumb[] = []; @Input() breadcrumbs: Breadcrumb[] = [];
@ -136,8 +137,8 @@ export class SearchAllComponent {
public ngOnInit() { public ngOnInit() {
var description = "Search for research outcomes (publications, datasets, software, other research products), projects, organizations, content providers in the OpenAIRE Research Graph. "; var description = "Search for "+OpenaireEntities.RESULTS+" ("+OpenaireEntities.PUBLICATIONS+", "+OpenaireEntities.DATASETS+", "+OpenaireEntities.SOFTWARE+", "+OpenaireEntities.OTHER+"), "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.ORGANIZATIONS+", "+OpenaireEntities.DATASOURCES+" in the OpenAIRE Research Graph. ";
var title = "OpenAIRE |Search for research outcomes, projects, content providers & organizations"; var title = "OpenAIRE |Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS;
this.properties = properties; this.properties = properties;
var url = this.properties.domain + this.properties.baseLink + this._router.url; var url = this.properties.domain + this.properties.baseLink + this._router.url;
this._title.setTitle(title); this._title.setTitle(title);

View File

@ -181,7 +181,7 @@ export class SearchDataProvidersComponent {
err => { err => {
this.filters = this.searchPage.prepareFiltersToShow([], 0); 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.searchUtils.refineStatus = this.errorMessages.getErrorCode(err.status);
this.disableRefineForms = false; this.disableRefineForms = false;
@ -248,7 +248,7 @@ export class SearchDataProvidersComponent {
}, },
err => { err => {
//console.log(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); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
//TODO check erros (service not available, bad request) //TODO check erros (service not available, bad request)
@ -312,6 +312,6 @@ export class SearchDataProvidersComponent {
} }
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Content Providers advanced Search Page: "+message, error); console.error(OpenaireEntities.DATASOURCES+" advanced Search Page: "+message, error);
} }
} }

View File

@ -141,16 +141,16 @@
<div class="uk-dropdown" uk-dropdown="pos: bottom-left; offset: 5; delay-hide: 0;"> <div class="uk-dropdown" uk-dropdown="pos: bottom-left; offset: 5; delay-hide: 0;">
<ul class="uk-nav uk-dropdown-nav"> <ul class="uk-nav uk-dropdown-nav">
<li> <li>
<a [routerLink]="properties.searchLinkToAdvancedResults" [queryParams]="advancedSearchLinkParameters">Research outcomes</a> <a [routerLink]="properties.searchLinkToAdvancedResults" [queryParams]="advancedSearchLinkParameters">{{openaireEntities.RESULTS}}</a>
</li> </li>
<li> <li>
<a [routerLink]="properties.searchLinkToAdvancedProjects" [queryParams]="advancedSearchLinkParameters" >Projects</a> <a [routerLink]="properties.searchLinkToAdvancedProjects" [queryParams]="advancedSearchLinkParameters" >{{openaireEntities.PROJECTS}}</a>
</li> </li>
<li> <li>
<a [routerLink]="properties.searchLinkToAdvancedDataProviders" [queryParams]="advancedSearchLinkParameters">Content providers</a> <a [routerLink]="properties.searchLinkToAdvancedDataProviders" [queryParams]="advancedSearchLinkParameters">{{openaireEntities.DATASOURCES}}</a>
</li> </li>
<li> <li>
<a [routerLink]="properties.searchLinkToAdvancedOrganizations" [queryParams]="advancedSearchLinkParameters">Organizations</a> <a [routerLink]="properties.searchLinkToAdvancedOrganizations" [queryParams]="advancedSearchLinkParameters">{{openaireEntities.ORGANIZATIONS}}</a>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -2,12 +2,13 @@ import {ChangeDetectorRef, Component, EventEmitter, Input, Output} from '@angula
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {AdvancedField, Filter} from './searchHelperClasses.class'; 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 {Dates} from '../../utils/string-utils.class';
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import {SearchCustomFilter} from "./searchUtils.class"; import {SearchCustomFilter} from "./searchUtils.class";
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {Open} from "../../utils/modal/open.component";
@Component({ @Component({
selector: 'advanced-search-form', selector: 'advanced-search-form',
@ -37,6 +38,7 @@ export class AdvancedSearchFormComponent {
fieldList: { [id: string]: any[] } = {}; fieldList: { [id: string]: any[] } = {};
public searchFields: SearchFields = new SearchFields(); public searchFields: SearchFields = new SearchFields();
properties: EnvProperties; properties: EnvProperties;
public openaireEntities = OpenaireEntities;
public operators: { name: string, id: string }[] = this.searchFields.ADVANCED_SEARCH_OPERATORS; public operators: { name: string, id: string }[] = this.searchFields.ADVANCED_SEARCH_OPERATORS;
selectedEntity; selectedEntity;
selectedEntitySimpleUrl; selectedEntitySimpleUrl;

View File

@ -173,11 +173,11 @@ export class NewSearchPageComponent {
this.customFilterEnabled = params['cf'] && params['cf'] == "true"; this.customFilterEnabled = params['cf'] && params['cf'] == "true";
if (this.basicMetaDescription.length == 0) { if (this.basicMetaDescription.length == 0) {
if (this.entityType == "result") { 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") { } 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") { } 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 { } else {
this.basicMetaDescription.push(this.pageTitle) this.basicMetaDescription.push(this.pageTitle)
} }

View File

@ -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 { 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 + "?"; let url = link + "?";
if (params != null && params != '') { if (params != null && params != '') {
@ -38,14 +38,14 @@ export class SearchResearchResultsService {
} }
searchById(resultType: string, id: string, properties: EnvProperties): any { 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) return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
.pipe(map(res => this.parseResults(resultType, res, properties))); .pipe(map(res => this.parseResults(resultType, res, properties)));
} }
searchAggregators(resultType: string, id: string, params: string, refineParams: string, page: number, size: number, properties: EnvProperties): any { 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"; let url = link + "?" + "&format=json";
if (params != null && params != '') { 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 { 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&"; let url = link + "?" + "&format=json&";
var doisParams = ""; 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 { 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; 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="; url += "?query=";
if (params != null && params != '') { if (params != null && params != '') {
url += " ( " + basicQuery + " ) " + " and (" + params + ")"; url += " ( " + basicQuery + " ) " + " and (" + params + ")";
@ -134,13 +134,13 @@ export class SearchResearchResultsService {
searchResultForEntity(resultType: string, params: string, page: number, size: number, properties: EnvProperties): any { searchResultForEntity(resultType: string, params: string, page: number, size: number, properties: EnvProperties): any {
let link = properties.searchAPIURLLAst; 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 += "&page="+(page-1)+"&size="+size;
//url += "&sortBy=resultdateofacceptance,descending"; //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 += "?format=json";
url += "&fq=" + params; url += "&fq=" + params;
url += "&sortBy=resultdateofacceptance,descending"; url += "&sortBy=resultdateofacceptance,descending";
@ -455,7 +455,7 @@ export class SearchResearchResultsService {
numOfEntityResults(resultType: string, id: string, entity: string, properties: EnvProperties): any { numOfEntityResults(resultType: string, id: string, entity: string, properties: EnvProperties): any {
var parameters: string = ""; 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"; let url = properties.searchAPIURLLAst + parameters + "?format=json";
return this.numOfResults(url, properties); return this.numOfResults(url, properties);
} }
@ -485,7 +485,7 @@ export class SearchResearchResultsService {
} }
numOfSearchResults(resultType: string, params: string, properties: EnvProperties, refineParams: string = null): any { 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) { if (params.length > 0) {
var DOIs: string[] = DOI.getDOIsFromString(params); var DOIs: string[] = DOI.getDOIsFromString(params);
var doisParams = ""; var doisParams = "";
@ -513,7 +513,7 @@ export class SearchResearchResultsService {
} }
countTotalResults(resultType: string, properties: EnvProperties, refineParams: string = null): any { 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); 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 (entityType == "publication" || entityType == "dataset" || entityType == "organization" || entityType == "datasource" || entityType == "project") {
if (plural) { if (plural) {
return entityType + "s"; return entityType + "s";

View File

@ -8,6 +8,7 @@ import {NumberSize, NumberUtils} from '../../utils/number-utils.class';
import {BehaviorSubject, Observable, Subscription, zip} from 'rxjs'; import {BehaviorSubject, Observable, Subscription, zip} from 'rxjs';
import {RouterHelper} from "../../utils/routerHelper.class"; import {RouterHelper} from "../../utils/routerHelper.class";
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {OpenaireEntities} from "../../utils/properties/searchFields";
export interface Numbers { export interface Numbers {
publicationsSize?: NumberSize; publicationsSize?: NumberSize;
@ -58,7 +59,7 @@ interface Link {
class="number-size">{{numbers.datasourcesSize.size}}</span> class="number-size">{{numbers.datasourcesSize.size}}</span>
</a> </a>
</h3> </h3>
<span class="uk-text-uppercase uk-text-large">Content providers</span> <span class="uk-text-uppercase uk-text-large">{{openaireEntities.DATASOURCES}}</span>
</div> </div>
<div *ngIf="numbers.projectsSize"> <div *ngIf="numbers.projectsSize">
<h3> <h3>
@ -70,7 +71,7 @@ interface Link {
{{numbers.projectsSize.number|number}}<span class="number-size">{{numbers.projectsSize.size}}</span> {{numbers.projectsSize.number|number}}<span class="number-size">{{numbers.projectsSize.size}}</span>
</a> </a>
</h3> </h3>
<span class="uk-text-uppercase uk-text-large">Projects</span> <span class="uk-text-uppercase uk-text-large">{{openaireEntities.PROJECTS}}</span>
</div> </div>
</div> </div>
</div> </div>
@ -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}}</a> class="number uk-text-bold uk-margin-bottom uk-text-center uk-text-left@m">{{numbers.publicationsSize.count|number}}</a>
<div class="uk-text-uppercase uk-flex uk-flex-middle uk-flex-center uk-flex-left@m"> <div class="uk-text-uppercase uk-flex uk-flex-middle uk-flex-center uk-flex-left@m">
<icon name="book" ratio="1.5" [flex]="true" class="uk-margin-right" [customClass]="colorClass"></icon> <icon name="book" ratio="1.5" [flex]="true" class="uk-margin-right" [customClass]="colorClass"></icon>
<span>publications</span> <span>{{openaireEntities.PUBLICATIONS}}</span>
</div> </div>
</div> </div>
</div> </div>
@ -100,7 +101,7 @@ interface Link {
<div class="uk-text-uppercase uk-flex uk-flex-middle uk-flex-center uk-flex-left@m"> <div class="uk-text-uppercase uk-flex uk-flex-middle uk-flex-center uk-flex-left@m">
<icon name="database" ratio="1.5" [flex]="true" class="uk-margin-right" <icon name="database" ratio="1.5" [flex]="true" class="uk-margin-right"
[customClass]="colorClass"></icon> [customClass]="colorClass"></icon>
<span>research data</span> <span>{{openaireEntities.DATASETS}}</span>
</div> </div>
</div> </div>
</div> </div>
@ -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}}</a> class="number uk-text-bold uk-margin-bottom uk-text-center uk-text-left@m">{{numbers.softwareSize.count|number}}</a>
<div class="uk-text-uppercase uk-flex uk-flex-middle uk-flex-center uk-flex-left@m"> <div class="uk-text-uppercase uk-flex uk-flex-middle uk-flex-center uk-flex-left@m">
<icon name="cog" ratio="1.5" [flex]="true" class="uk-margin-right" [customClass]="colorClass"></icon> <icon name="cog" ratio="1.5" [flex]="true" class="uk-margin-right" [customClass]="colorClass"></icon>
<span>software</span> <span>{{openaireEntities.SOFTWARE}}</span>
</div> </div>
</div> </div>
</div> </div>
@ -127,7 +128,7 @@ interface Link {
<div class="uk-text-uppercase uk-flex uk-flex-middle uk-flex-center uk-flex-left@m"> <div class="uk-text-uppercase uk-flex uk-flex-middle uk-flex-center uk-flex-left@m">
<icon name="earth" ratio="1.5" [flex]="true" class="uk-margin-right" <icon name="earth" ratio="1.5" [flex]="true" class="uk-margin-right"
[customClass]="colorClass"></icon> [customClass]="colorClass"></icon>
<span>other research products</span> <span>{{openaireEntities.OTHER}}</span>
</div> </div>
</div> </div>
</div> </div>
@ -153,6 +154,7 @@ export class NumbersComponent implements OnInit, OnDestroy {
/** When numbers have been initialized this emitter will emitted */ /** When numbers have been initialized this emitter will emitted */
@Output() results: EventEmitter<Numbers> = new EventEmitter<Numbers>(); @Output() results: EventEmitter<Numbers> = new EventEmitter<Numbers>();
public properties: EnvProperties = properties; public properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public routerHelper: RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public numbers: Numbers = {}; public numbers: Numbers = {};
public loading: boolean = true; public loading: boolean = true;

View File

@ -5,7 +5,7 @@
Researcher? Researcher?
</h4> </h4>
<div class="el-content uk-margin"> <div class="el-content uk-margin">
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
</div> </div>
<p> <p>
<a target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'explore.openaire.eu'" class="el-link uk-button uk-button-default"> <a target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'explore.openaire.eu'" class="el-link uk-button uk-button-default">
@ -17,7 +17,7 @@
<div class="uk-width-expand@m uk-width-1-2@s uk-dark uk-grid-item-match uk-first-column provide"> <div class="uk-width-expand@m uk-width-1-2@s uk-dark uk-grid-item-match uk-first-column provide">
<div class="uk-margin uk-panel uk-scrollspy-inview uk-animation-fade" uk-scrollspy-class="" style=""> <div class="uk-margin uk-panel uk-scrollspy-inview uk-animation-fade" uk-scrollspy-class="" style="">
<h4 class="el-title uk-margin uk-h4"> <h4 class="el-title uk-margin uk-h4">
Content provider? {{openaireEntities.DATASOURCE}}?
</h4> </h4>
<div class="el-content uk-margin"> <div class="el-content uk-margin">
Join OpenAIRE, use our tools and make your content more visible around the world. Join OpenAIRE, use our tools and make your content more visible around the world.
@ -32,7 +32,7 @@
<div *ngIf="portal !== 'connect'" class="uk-width-expand@m uk-width-1-2@s uk-dark uk-grid-item-match connect"> <div *ngIf="portal !== 'connect'" class="uk-width-expand@m uk-width-1-2@s uk-dark uk-grid-item-match connect">
<div class="uk-margin uk-panel uk-scrollspy-inview uk-animation-fade" uk-scrollspy-class="" style=""> <div class="uk-margin uk-panel uk-scrollspy-inview uk-animation-fade" uk-scrollspy-class="" style="">
<h4 class="el-title uk-margin uk-h4"> <h4 class="el-title uk-margin uk-h4">
Research community? {{openaireEntities.COMMUNITY}}?
</h4> </h4>
<div class="el-content uk-margin"> <div class="el-content uk-margin">
Use a trusted partner to share, link, disseminate and monitor your research. Use a trusted partner to share, link, disseminate and monitor your research.
@ -51,7 +51,7 @@
Research manager? Research manager?
</h4> </h4>
<div class="el-content uk-margin"> <div class="el-content uk-margin">
Use our monitoring services and easily track all relevant research outcomes. Use our monitoring services and easily track all relevant {{openaireEntities.RESULTS | lowercase}}.
</div> </div>
<p> <p>
<a target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment <a target="_blank" [href]="'https://'+(properties.environment =='beta' || properties.environment

View File

@ -1,5 +1,6 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {EnvProperties} from "../../utils/properties/env-properties"; import {EnvProperties} from "../../utils/properties/env-properties";
import {OpenaireEntities} from "../../utils/properties/searchFields";
@Component({ @Component({
selector: 'other-portals', selector: 'other-portals',
@ -8,6 +9,7 @@ import {EnvProperties} from "../../utils/properties/env-properties";
export class OtherPortalsComponent { export class OtherPortalsComponent {
@Input() portal = 'connect'; @Input() portal = 'connect';
@Input() properties: EnvProperties = null; @Input() properties: EnvProperties = null;
openaireEntities = OpenaireEntities;
constructor() {} constructor() {}
} }

View File

@ -5,6 +5,7 @@ import {SearchCustomFilter, SearchUtilsClass} from '../../searchPages/searchUtil
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import {StringUtils} from '../../utils/string-utils.class'; import {StringUtils} from '../../utils/string-utils.class';
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
import {OpenaireEntities} from "../properties/searchFields";
export class FetchDataproviders { export class FetchDataproviders {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
@ -54,7 +55,6 @@ export class FetchDataproviders {
this.subscriptions.push(this._searchDataprovidersService.searchDataproviders(parameters, refineParams, page, size, [], properties).subscribe( this.subscriptions.push(this._searchDataprovidersService.searchDataproviders(parameters, refineParams, page, size, [], properties).subscribe(
data => { data => {
this.searchUtils.totalResults = data[0]; this.searchUtils.totalResults = data[0];
//console.info("search Content Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
this.results = data[1]; this.results = data[1];
//ar errorCodes:ErrorCodes = new ErrorCodes(); //ar errorCodes:ErrorCodes = new ErrorCodes();
@ -79,7 +79,7 @@ export class FetchDataproviders {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; 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); 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( this.subscriptions.push(this._searchDataprovidersService.searchDataproviders(parameters, null, page, size, [], properties).subscribe(
data => { data => {
this.searchUtils.totalResults = data[0]; this.searchUtils.totalResults = data[0];
//console.info("search Content Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
this.results = data[1]; this.results = data[1];
this.searchUtils.status = this.errorCodes.DONE; this.searchUtils.status = this.errorCodes.DONE;
@ -112,7 +111,7 @@ export class FetchDataproviders {
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; 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); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
} }
)); ));
@ -149,7 +148,7 @@ export class FetchDataproviders {
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; 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); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
} }
)); ));
@ -184,7 +183,7 @@ export class FetchDataproviders {
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; 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); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
} }
)); ));
@ -240,7 +239,7 @@ export class FetchDataproviders {
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; 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.searchUtils.status = this.errorMessages.getErrorCode(err.status);
this.loadPaging = true; this.loadPaging = true;
@ -298,7 +297,7 @@ export class FetchDataproviders {
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; 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.searchUtils.status = this.errorMessages.getErrorCode(err.status);
this.loadPaging = true; this.loadPaging = true;
@ -347,7 +346,7 @@ export class FetchDataproviders {
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; 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); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
} }
)); ));
@ -385,13 +384,13 @@ export class FetchDataproviders {
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; 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); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
} }
)); ));
} }
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Fetch Content Providers (class): " + message, error); console.error("Fetch "+OpenaireEntities.DATASOURCES+" (class): " + message, error);
} }
} }

View File

@ -6,6 +6,7 @@ import {EnvProperties} from '../../utils/properties/env-properties';
import {StringUtils} from '../../utils/string-utils.class'; import {StringUtils} from '../../utils/string-utils.class';
import {SearchResult} from "../entities/searchResult"; import {SearchResult} from "../entities/searchResult";
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
import {OpenaireEntities} from "../properties/searchFields";
export class FetchProjects { export class FetchProjects {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
@ -50,7 +51,6 @@ export class FetchProjects {
this.subscriptions.push(this._searchProjectsService.searchProjects(parameters, refineParams, page, size, [], properties).subscribe( this.subscriptions.push(this._searchProjectsService.searchProjects(parameters, refineParams, page, size, [], properties).subscribe(
data => { data => {
this.searchUtils.totalResults = data[0]; this.searchUtils.totalResults = data[0];
//console.info("search Projects: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
this.results = data[1]; this.results = data[1];
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
@ -74,7 +74,7 @@ export class FetchProjects {
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; 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); 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( this.subscriptions.push(this._searchProjectsService.getProjectsforDataProvider(id, page, size, properties).subscribe(
data => { data => {
this.searchUtils.totalResults = data[0]; this.searchUtils.totalResults = data[0];
//console.info("search Projects for Dataproviders: [Id:"+id+" ] [total results:"+this.searchUtils.totalResults+"]");
this.results = data[1]; this.results = data[1];
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
@ -111,7 +110,7 @@ export class FetchProjects {
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; 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); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
} }
)); ));
@ -149,7 +148,7 @@ export class FetchProjects {
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; 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); 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( this.subscriptions.push(this._searchProjectsService.getProjectsForOrganizations(organizationId, filterquery, page, size, refineFields, properties).subscribe(
data => { data => {
this.searchUtils.totalResults = data[0]; // the results can be filtered so this number can be no total results 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]; this.results = data[1];
if (refineFields && refineFields.length > 0) { if (refineFields && refineFields.length > 0) {
this.filters = data[2]; this.filters = data[2];
@ -199,13 +197,13 @@ export class FetchProjects {
} }
}, },
err => { 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); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
} }
)); ));
} }
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Fetch Projects (class): " + message, error); console.error("Fetch "+OpenaireEntities.PROJECTS+" (class): " + message, error);
} }
} }

View File

@ -1,7 +1,7 @@
import {SearchResearchResultsService} from '../../services/searchResearchResults.service'; import {SearchResearchResultsService} from '../../services/searchResearchResults.service';
import {ErrorCodes} from '../../utils/properties/errorCodes'; import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; 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 {SearchCustomFilter, SearchUtilsClass} from '../../searchPages/searchUtils/searchUtils.class';
import {DOI, StringUtils} from '../../utils/string-utils.class'; import {DOI, StringUtils} from '../../utils/string-utils.class';
import {Subject, Subscriber} from 'rxjs'; import {Subject, Subscriber} from 'rxjs';
@ -315,7 +315,7 @@ export class FetchResearchResults {
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; 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); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
} }
)); ));
@ -362,17 +362,27 @@ export class FetchResearchResults {
} }
private handleError(message: string, error) { 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){ private getEntityName (entityType:string, plural:boolean){
if(entityType == "publication" ||entityType == "dataset" || entityType == "organization" || entityType == "datasource" || entityType == "project" ){ if(entityType == "publication") {
if(plural){ return plural ? OpenaireEntities.PUBLICATIONS : OpenaireEntities.PUBLICATION;
return entityType+ "s"; } else if (entityType == "dataset") {
}else{ return plural ? OpenaireEntities.DATASETS : OpenaireEntities.DATASET;
return entityType; } else if (entityType == "software") {
} return plural ? OpenaireEntities.SOFTWARE : OpenaireEntities.SOFTWARE_SINGULAR;
}else{ } 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; return entityType;
} }
} }

View File

@ -72,7 +72,7 @@ export class SearchFields {
}, },
["pid"]: {name: "PID", type: "keyword", param: "pid", operator: "pd", equalityOperator: " = ", filterType: null}, ["pid"]: {name: "PID", type: "keyword", param: "pid", operator: "pd", equalityOperator: " = ", filterType: null},
["resulthostingdatasourceid"]: { ["resulthostingdatasourceid"]: {
name: "Hosting Content Provider", name: "Hosting "+OpenaireEntities.DATASOURCE,
type: "entity", type: "entity",
param: "hostedBy", param: "hostedBy",
operator: "hs", operator: "hs",
@ -104,7 +104,7 @@ export class SearchFields {
filterType: "checkbox" filterType: "checkbox"
}, },
["community"]: { ["community"]: {
name: "Research Community", name: OpenaireEntities.COMMUNITY,
type: "refine", type: "refine",
param: "community", param: "community",
operator: "cm", operator: "cm",
@ -120,7 +120,7 @@ export class SearchFields {
filterType: "checkbox" filterType: "checkbox"
}, },
["relprojectid"]: { ["relprojectid"]: {
name: "Project", name: OpenaireEntities.PROJECT,
type: "entity", type: "entity",
param: "project", param: "project",
operator: "po", operator: "po",
@ -208,7 +208,7 @@ export class SearchFields {
filterType: null filterType: null
}, },
["collectedfromdatasourceid"]: { ["collectedfromdatasourceid"]: {
name: "Collected from Content Provider", name: "Collected from "+OpenaireEntities.DATASOURCE,
type: "entity", type: "entity",
param: "collectedFrom", param: "collectedFrom",
operator: "cl", operator: "cl",
@ -383,7 +383,7 @@ export class SearchFields {
filterType: null filterType: null
}, },
["collectedfromdatasourceid"]: { ["collectedfromdatasourceid"]: {
name: "Collected from Content Provider", name: "Collected from "+OpenaireEntities.DATASOURCE,
type: "entity", type: "entity",
param: "collectedFrom", param: "collectedFrom",
operator: "cl", operator: "cl",
@ -500,7 +500,7 @@ export class SearchFields {
filterType: "checkbox" filterType: "checkbox"
}, },
["collectedfromdatasourceid"]: { ["collectedfromdatasourceid"]: {
name: "Collected from Content Provider", name: "Collected from "+OpenaireEntities.DATASOURCE,
type: "entity", type: "entity",
param: "collectedFrom", param: "collectedFrom",
operator: "cl", operator: "cl",
@ -728,7 +728,7 @@ export class SearchFields {
Compatibility Level: datasourcecompatibilityname Compatibility Level: datasourcecompatibilityname
Country: country Country: country
Content: datasourceodcontenttypes Content: datasourceodcontenttypes
Content Provider: resulthostingdatasource Datasource: resulthostingdatasource
Collected From: collectedfrom Collected From: collectedfrom
BULLETS BULLETS
Access Mode: resultbestaccessright Access Mode: resultbestaccessright

View File

@ -122,11 +122,17 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
public getTypeName(type: string): string { public getTypeName(type: string): string {
if (type === "dataset") { if (type === "dataset") {
return "research data"; return this.openaireEntities.DATASET;
} else if (type === "other") { } else if (type === "other") {
return "other research product"; return this.openaireEntities.OTHER_SINGULAR;
} else if (type === "dataprovider") { } 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 { } else {
return type; return type;
} }