2019-04-24 14:02:11 +02:00
|
|
|
|
import {Component, ElementRef, Input, ViewChild} from '@angular/core';
|
|
|
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
|
|
|
|
import {Location} from '@angular/common';
|
|
|
|
|
import {Meta, Title} from '@angular/platform-browser';
|
|
|
|
|
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
2018-03-06 14:54:17 +01:00
|
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
|
import {CommunityService} from "../openaireLibrary/connect/community/community.service";
|
|
|
|
|
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
|
|
|
|
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
2018-11-26 14:07:58 +01:00
|
|
|
|
import {SearchZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
|
|
|
|
|
import {ZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
|
2019-09-13 09:47:29 +02:00
|
|
|
|
import {Session, User} from '../openaireLibrary/login/utils/helper.class';
|
2019-04-11 11:39:46 +02:00
|
|
|
|
import {StatisticsForDashboardComponent} from '../statistics/statistics.component';
|
2019-04-24 14:02:11 +02:00
|
|
|
|
import {StringUtils} from '../openaireLibrary/utils/string-utils.class';
|
2018-04-11 13:24:57 +02:00
|
|
|
|
|
2018-04-11 12:40:29 +02:00
|
|
|
|
import {PiwikHelper} from '../utils/piwikHelper';
|
2019-04-24 14:02:11 +02:00
|
|
|
|
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
|
2019-06-05 15:39:02 +02:00
|
|
|
|
import {SearchCommunityDataprovidersService} from "../openaireLibrary/connect/contentProviders/searchDataproviders.service";
|
|
|
|
|
import {SearchCommunityProjectsService} from "../openaireLibrary/connect/projects/searchProjects.service";
|
|
|
|
|
import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service";
|
2019-07-31 12:42:45 +02:00
|
|
|
|
import {RouterHelper} from "../openaireLibrary/utils/routerHelper.class";
|
2019-08-02 16:56:03 +02:00
|
|
|
|
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
|
2019-09-13 09:47:29 +02:00
|
|
|
|
import {UserManagementService} from "../openaireLibrary/services/user-management.service";
|
2019-04-24 14:02:11 +02:00
|
|
|
|
|
2018-01-26 16:00:07 +01:00
|
|
|
|
@Component({
|
2019-04-24 14:02:11 +02:00
|
|
|
|
selector: 'community',
|
|
|
|
|
templateUrl: 'community.component.html',
|
2018-01-26 16:00:07 +01:00
|
|
|
|
})
|
2018-03-12 17:34:48 +01:00
|
|
|
|
|
2018-01-26 16:00:07 +01:00
|
|
|
|
export class CommunityComponent {
|
2019-08-02 16:56:03 +02:00
|
|
|
|
public url: string = null;
|
|
|
|
|
|
2018-10-16 14:52:51 +02:00
|
|
|
|
public sub: any;
|
2018-01-26 16:00:07 +01:00
|
|
|
|
public piwiksub: any;
|
|
|
|
|
public subfunders: any;
|
|
|
|
|
|
2018-02-20 12:13:44 +01:00
|
|
|
|
public publicationTotal = null;
|
|
|
|
|
public researchDataTotal = null;
|
|
|
|
|
public softwareTotal = null;
|
2018-07-27 16:45:08 +02:00
|
|
|
|
public orpTotal = null;
|
2018-02-28 17:44:33 +01:00
|
|
|
|
public projectTotal = null;
|
|
|
|
|
public contentProviderTotal = null;
|
|
|
|
|
public organizationTotal = null;
|
2018-02-20 12:13:44 +01:00
|
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
|
params: any = {};
|
|
|
|
|
properties: EnvProperties;
|
2018-02-02 13:02:04 +01:00
|
|
|
|
|
2018-02-20 12:13:44 +01:00
|
|
|
|
public publicationResults = null;
|
|
|
|
|
public researchDataResults = null;
|
|
|
|
|
public softwareResults = null;
|
2018-07-27 16:45:08 +02:00
|
|
|
|
public orpResults = null;
|
2018-01-26 16:00:07 +01:00
|
|
|
|
|
2018-03-22 16:38:42 +01:00
|
|
|
|
@Input() communityId = null;
|
2018-02-28 14:10:11 +01:00
|
|
|
|
public community = null;
|
2018-02-27 16:03:40 +01:00
|
|
|
|
|
2018-04-18 12:31:33 +02:00
|
|
|
|
public communityInfo = null;
|
|
|
|
|
|
2018-10-16 17:00:13 +02:00
|
|
|
|
public showLoading: boolean = true;
|
2018-11-26 14:07:58 +01:00
|
|
|
|
masterZenodoCommunity = null;
|
|
|
|
|
zenodoCommunityIdS = [];
|
2019-07-12 15:51:26 +02:00
|
|
|
|
showAllSubjects = false;
|
|
|
|
|
showAllDescription = false;
|
2018-10-16 14:52:51 +02:00
|
|
|
|
// TODO Unsubscribe
|
|
|
|
|
public subPublications;
|
|
|
|
|
public subResearchData;
|
|
|
|
|
public subSoftware;
|
|
|
|
|
public subOrps;
|
2019-04-24 14:02:11 +02:00
|
|
|
|
@ViewChild(StatisticsForDashboardComponent) statistics: StatisticsForDashboardComponent = null;
|
|
|
|
|
public activeTab = "publication";
|
2019-06-20 15:34:07 +02:00
|
|
|
|
public show: string = 'overview';
|
2019-04-24 14:02:11 +02:00
|
|
|
|
|
2019-07-31 12:42:45 +02:00
|
|
|
|
searchLinkToPublications: string = null;
|
|
|
|
|
searchLinkToDatasets: string = null;
|
|
|
|
|
searchLinkToSoftware: string = null;
|
|
|
|
|
searchLinkToOrps: string = null;
|
|
|
|
|
searchLinkToProjects: string = null;
|
|
|
|
|
searchLinkToDataProviders: string = null;
|
|
|
|
|
searchLinkToAdvancedPublications: string = null;
|
|
|
|
|
shareInZenodoPage: string = null;
|
|
|
|
|
public routerHelper:RouterHelper = new RouterHelper();
|
2019-09-13 09:47:29 +02:00
|
|
|
|
private user: User;
|
|
|
|
|
private loginCheck: boolean = false;
|
2019-07-31 12:42:45 +02:00
|
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
|
constructor(
|
2019-02-18 16:15:53 +01:00
|
|
|
|
private element: ElementRef,
|
2019-04-24 14:02:11 +02:00
|
|
|
|
private route: ActivatedRoute,
|
|
|
|
|
private _router: Router,
|
|
|
|
|
private location: Location,
|
|
|
|
|
private _meta: Meta,
|
|
|
|
|
private _title: Title,
|
|
|
|
|
private _piwikService: PiwikService,
|
|
|
|
|
private config: ConfigurationService,
|
|
|
|
|
private _communityService: CommunityService,
|
2019-06-05 15:39:02 +02:00
|
|
|
|
private _searchCommunityDataprovidersService:SearchCommunityDataprovidersService,
|
|
|
|
|
private _searchCommunityProjectsService: SearchCommunityProjectsService,
|
|
|
|
|
private _searchResearchResultsService: SearchResearchResultsService,
|
2019-04-24 14:02:11 +02:00
|
|
|
|
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService,
|
2019-08-02 16:56:03 +02:00
|
|
|
|
private _ΖenodoCommunitieService: ZenodoCommunitiesService,
|
2019-09-13 09:47:29 +02:00
|
|
|
|
private seoService: SEOService,
|
|
|
|
|
private userManagementService: UserManagementService) {
|
2018-03-12 17:34:48 +01:00
|
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
|
var description = "OpenAIRE - Connect, Community Dashboard, research community";
|
|
|
|
|
var title = "OpenAIRE - Connect";
|
|
|
|
|
this._meta.updateTag({content: description}, "name='description'");
|
|
|
|
|
this._meta.updateTag({content: description}, "property='og:description'");
|
|
|
|
|
this._meta.updateTag({content: title}, "property='og:title'");
|
|
|
|
|
this._title.setTitle(title);
|
2018-01-26 16:00:07 +01:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ngOnInit() {
|
2018-02-12 12:41:40 +01:00
|
|
|
|
this.route.data
|
2019-04-24 14:02:11 +02:00
|
|
|
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
|
|
|
|
this.properties = data.envSpecific;
|
2019-07-31 12:42:45 +02:00
|
|
|
|
this.searchLinkToPublications = this.properties.searchLinkToPublications;
|
|
|
|
|
this.searchLinkToDatasets = this.properties.searchLinkToDatasets;
|
|
|
|
|
this.searchLinkToSoftware = this.properties.searchLinkToSoftware;
|
|
|
|
|
this.searchLinkToOrps = this.properties.searchLinkToOrps;
|
|
|
|
|
this.searchLinkToProjects = this.properties.searchLinkToProjects;
|
|
|
|
|
this.searchLinkToDataProviders = this.properties.searchLinkToDataProviders;
|
|
|
|
|
this.searchLinkToAdvancedPublications = this.properties.searchLinkToAdvancedPublications;
|
|
|
|
|
this.shareInZenodoPage = this.properties.shareInZenodoPage;
|
2019-08-02 16:56:03 +02:00
|
|
|
|
this.url = data.envSpecific.baseLink + this._router.url;
|
|
|
|
|
this.seoService.createLinkForCanonicalURL(this.url, false);
|
|
|
|
|
this._meta.updateTag({content: this.url}, "property='og:url'");
|
2019-11-08 12:04:10 +01:00
|
|
|
|
if (typeof document !== 'undefined') {
|
|
|
|
|
this.userManagementService.getUserInfo(this.properties.userInfoUrl).subscribe(user => {
|
|
|
|
|
this.user = user;
|
|
|
|
|
this.loginCheck = true;
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.user = null;
|
2019-09-13 09:47:29 +02:00
|
|
|
|
this.loginCheck = true;
|
2019-11-08 12:04:10 +01:00
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
|
if (this.communityId != null && this.communityId != '') {
|
|
|
|
|
this._communityService.getCommunity(this.properties, this.properties.communityAPI + this.communityId).subscribe(
|
|
|
|
|
community => {
|
|
|
|
|
if (typeof document !== 'undefined') {
|
|
|
|
|
HelperFunctions.scroll();
|
|
|
|
|
}
|
|
|
|
|
this.community = community;
|
|
|
|
|
if (this.properties.environment == "development") {
|
|
|
|
|
this.params = {communityId: community.communityId};
|
|
|
|
|
}
|
|
|
|
|
this._meta.updateTag({content: community.description}, "name='description'");
|
|
|
|
|
this._meta.updateTag({content: community.description}, "property='og:description'");
|
|
|
|
|
this._meta.updateTag({content: community.title}, "property='og:title'");
|
|
|
|
|
this._title.setTitle(community.title);
|
|
|
|
|
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
2019-07-31 16:46:10 +02:00
|
|
|
|
this.piwiksub = this._piwikService.trackView(this.properties, community.title, PiwikHelper.getSiteId(this.communityId,this.properties.environment)).subscribe();
|
2019-04-24 14:02:11 +02:00
|
|
|
|
}
|
|
|
|
|
if (this.community.zenodoCommunity) {
|
|
|
|
|
this._ΖenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.community.zenodoCommunity, null).subscribe(
|
|
|
|
|
result => {
|
|
|
|
|
this.masterZenodoCommunity = result;
|
2018-03-15 17:14:49 +01:00
|
|
|
|
|
2019-02-19 13:17:53 +01:00
|
|
|
|
},
|
|
|
|
|
error => {
|
2019-04-24 14:02:11 +02:00
|
|
|
|
// var emptyCommunity:ZenodoCommunityInfo = new ZenodoCommunityInfo();
|
|
|
|
|
// emptyCommunity.id = this.masterZenodoCommunityId;
|
|
|
|
|
// emptyCommunity.title = this.masterZenodoCommunityId;
|
|
|
|
|
// this.masterZenodoCommunity = emptyCommunity;
|
|
|
|
|
//console.log("Master Zenodo community'" + this.community.zenodoCommunity + "' couldn't be loaded");
|
|
|
|
|
this.handleError("Error getting Master Zenodo community with id: " + this.community.zenodoCommunityId, error);
|
2018-03-15 17:14:49 +01:00
|
|
|
|
|
2019-02-19 13:17:53 +01:00
|
|
|
|
}
|
|
|
|
|
);
|
2019-04-24 14:02:11 +02:00
|
|
|
|
}
|
|
|
|
|
this._searchZenodoCommunitiesService.searchZCommunities(this.properties, this.communityId).subscribe(
|
|
|
|
|
result => {
|
|
|
|
|
this.zenodoCommunityIdS = result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
error => {
|
|
|
|
|
//console.error("list of zenodo communities couldn't be loaded");
|
|
|
|
|
this.handleError("Error getting list of zenodo communities for community with openaire id: " + this.communityId, error);
|
|
|
|
|
} //this.handleError('System error retrieving community profile', error)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
//console.log(community);
|
|
|
|
|
});
|
|
|
|
|
|
2019-09-16 11:35:50 +02:00
|
|
|
|
this.countResearchResults("publication");
|
|
|
|
|
this.countResearchResults("dataset");
|
|
|
|
|
this.countResearchResults("software");
|
|
|
|
|
this.countResearchResults("other");
|
|
|
|
|
|
|
|
|
|
this._searchCommunityProjectsService.countTotalProjects(this.properties, this.communityId ).subscribe(
|
|
|
|
|
projectTotal => {
|
|
|
|
|
this.projectTotal = projectTotal;
|
|
|
|
|
//console.log(projectTotal);
|
|
|
|
|
},
|
|
|
|
|
error => {
|
|
|
|
|
this.handleError("Error getting number of projects for community with id: " + this.communityId, error);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
this._searchCommunityDataprovidersService.countTotalDataproviders(this.properties, this.communityId ).subscribe(
|
|
|
|
|
contentProviderTotal => {
|
|
|
|
|
this.contentProviderTotal = contentProviderTotal;
|
|
|
|
|
//console.log(contentProviderTotal);
|
|
|
|
|
},
|
|
|
|
|
error => {
|
|
|
|
|
this.handleError("Error getting number of content providers for community with id: " + this.communityId, error);
|
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// this._searchEntriesService.countTotal(this.properties.communityAPI+this.communityId+'/organizations').subscribe(
|
|
|
|
|
// organizationTotal => {
|
|
|
|
|
// this.organizationTotal = organizationTotal;
|
|
|
|
|
// console.log(organizationTotal);
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**/
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this.config.getCommunityInformation(this.properties, this.communityId).subscribe(
|
2019-04-24 14:02:11 +02:00
|
|
|
|
res => {
|
|
|
|
|
this.communityInfo = res;
|
|
|
|
|
},
|
|
|
|
|
error => {
|
|
|
|
|
//console.log(error)
|
|
|
|
|
this.handleError("Error getting community with id: " + this.communityId, error);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
2018-01-26 16:00:07 +01:00
|
|
|
|
}
|
2018-02-27 12:37:18 +01:00
|
|
|
|
|
2019-09-16 11:35:50 +02:00
|
|
|
|
public countResearchResults(resultType: string) {
|
|
|
|
|
this._searchResearchResultsService.countTotalResults(resultType, this.properties,"&fq=communityid=" + this.communityId).subscribe(
|
|
|
|
|
researchResultsTotal => {
|
|
|
|
|
this.setTotal(resultType, researchResultsTotal);
|
|
|
|
|
if(resultType == "publication") {
|
|
|
|
|
this.searchResearchResults(resultType, this.publicationTotal, this.publicationResults);
|
2019-02-19 13:17:53 +01:00
|
|
|
|
}
|
2019-09-16 11:35:50 +02:00
|
|
|
|
},
|
|
|
|
|
error => {
|
|
|
|
|
this.handleError("Error getting number of "+this.getEntityName(resultType, true, true)+" for community with id: " + this.communityId, error);
|
|
|
|
|
}
|
|
|
|
|
);
|
2018-10-16 14:52:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-09-16 11:35:50 +02:00
|
|
|
|
public searchResearchResults(resultType: string, resultsTotal: number, results: Array<any>) {
|
|
|
|
|
this.setActiveTab(resultType);
|
2018-10-16 14:52:51 +02:00
|
|
|
|
|
2019-09-16 11:35:50 +02:00
|
|
|
|
if (resultsTotal > 0 && results == null) {
|
|
|
|
|
this.showLoading = true;
|
2018-10-16 14:52:51 +02:00
|
|
|
|
|
2019-09-16 11:35:50 +02:00
|
|
|
|
this._searchResearchResultsService.search(resultType, "", "&fq=communityid=" + this.communityId, 1, 5, "resultdateofacceptance,descending", [], this.properties).subscribe(
|
|
|
|
|
researchResults => {
|
|
|
|
|
this.setResults(resultType, researchResults[1]);
|
2019-04-24 14:02:11 +02:00
|
|
|
|
this.showLoading = false;
|
2019-02-19 13:17:53 +01:00
|
|
|
|
},
|
|
|
|
|
error => {
|
2019-09-16 11:35:50 +02:00
|
|
|
|
this.handleError("Error getting "+this.getEntityName(resultType, true, true)+" for community with id: " + this.communityId, error);
|
2019-02-19 13:17:53 +01:00
|
|
|
|
}
|
|
|
|
|
);
|
2018-10-16 14:52:51 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-26 16:00:07 +01:00
|
|
|
|
public ngOnDestroy() {
|
2019-04-24 14:02:11 +02:00
|
|
|
|
if (this.piwiksub) {
|
2018-01-26 16:00:07 +01:00
|
|
|
|
this.piwiksub.unsubscribe();
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-18 12:31:33 +02:00
|
|
|
|
|
2019-04-11 11:39:46 +02:00
|
|
|
|
isEntityEnabled(entity: string) {
|
2019-04-24 14:02:11 +02:00
|
|
|
|
return this.communityInfo.entities.some(x => x['pid'] == entity && x['isEnabled'] === true);
|
2018-04-18 12:31:33 +02:00
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
|
|
2019-04-11 11:39:46 +02:00
|
|
|
|
isRouteEnabled(route: string) {
|
2019-04-24 14:02:11 +02:00
|
|
|
|
return this.communityInfo.pages.some(x => x['route'] == route && x['isEnabled'] === true);
|
2018-11-26 14:07:58 +01:00
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
|
|
|
|
|
|
showInvite() {
|
2019-09-13 09:47:29 +02:00
|
|
|
|
return this.loginCheck && this.isManager();
|
2019-04-12 13:05:28 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
|
isManager() {
|
2019-09-13 09:47:29 +02:00
|
|
|
|
if(!this.user) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
var email = this.user.email;
|
2019-04-24 14:02:11 +02:00
|
|
|
|
var index = -1;
|
|
|
|
|
if (email && this.community != null && this.community.managers != null) {
|
|
|
|
|
index = this.community.managers.indexOf(email);
|
2018-11-29 12:40:38 +01:00
|
|
|
|
}
|
2019-09-13 09:47:29 +02:00
|
|
|
|
return Session.isPortalAdministrator(this.user) || Session.isCommunityCurator(this.user) || index != -1;
|
2018-11-29 12:40:38 +01:00
|
|
|
|
}
|
2019-02-19 13:17:53 +01:00
|
|
|
|
|
|
|
|
|
private handleError(message: string, error) {
|
2019-04-24 14:02:11 +02:00
|
|
|
|
console.error("Community (component): " + message, error);
|
2019-02-19 13:17:53 +01:00
|
|
|
|
}
|
2019-04-11 11:39:46 +02:00
|
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
|
getSearchPlaceHolder() {
|
2019-04-11 11:39:46 +02:00
|
|
|
|
var entities = [];
|
2019-04-24 14:02:11 +02:00
|
|
|
|
if (this.isEntityEnabled("publication")) {
|
2019-04-11 11:39:46 +02:00
|
|
|
|
entities.push("publications");
|
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
|
if (this.isEntityEnabled("dataset")) {
|
2019-04-11 11:39:46 +02:00
|
|
|
|
entities.push("research data");
|
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
|
if (this.isEntityEnabled("software")) {
|
2019-04-11 11:39:46 +02:00
|
|
|
|
entities.push("software");
|
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
|
if (this.isEntityEnabled("orp")) {
|
2019-04-11 11:39:46 +02:00
|
|
|
|
entities.push("other research products");
|
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
|
return "Search" + ((entities.length > 0) ? (" for " + entities.join(', ') + "...") : "");
|
2019-04-11 16:32:07 +02:00
|
|
|
|
}
|
2019-04-11 11:39:46 +02:00
|
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
|
countOtherGraphs() {
|
|
|
|
|
var count = 0;
|
|
|
|
|
if (this.statistics && this.statistics.allowedEntities) {
|
|
|
|
|
for (var entity of this.statistics.allowedEntities) {
|
|
|
|
|
if (this.statistics.statisticsSum[entity].total > 0 && this.statistics.allowedCharts[entity].length > 0 && this.activeTab != entity) {
|
|
|
|
|
count += this.statistics.allowedCharts[entity].length;
|
|
|
|
|
}
|
2019-04-11 16:32:07 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
|
return count;
|
2019-04-11 11:39:46 +02:00
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
|
|
|
|
|
|
createParams(param) {
|
2019-04-15 16:08:37 +02:00
|
|
|
|
return StringUtils.quote(StringUtils.URIEncode(param));
|
2019-04-24 14:02:11 +02:00
|
|
|
|
}
|
2019-04-11 16:32:07 +02:00
|
|
|
|
|
2019-09-16 11:35:50 +02:00
|
|
|
|
private setActiveTab(entityType: string) {
|
|
|
|
|
if(entityType == "other") {
|
|
|
|
|
this.activeTab = "orp";
|
|
|
|
|
} else {
|
|
|
|
|
this.activeTab = entityType;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private setResults(entityType: string, results: Array<any>) {
|
|
|
|
|
if(entityType == "publication") {
|
|
|
|
|
this.publicationResults = results;
|
|
|
|
|
} else if(entityType == "dataset") {
|
|
|
|
|
this.researchDataResults = results;
|
|
|
|
|
} else if(entityType == "software") {
|
|
|
|
|
this.softwareResults = results;
|
|
|
|
|
} else if(entityType == "other") {
|
|
|
|
|
this.orpResults = results;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private setTotal(entityType: string, total: number) {
|
|
|
|
|
if(entityType == "publication") {
|
|
|
|
|
this.publicationTotal = total;
|
|
|
|
|
} else if(entityType == "dataset") {
|
|
|
|
|
this.researchDataTotal = total;
|
|
|
|
|
} else if(entityType == "software") {
|
|
|
|
|
this.softwareTotal = total;
|
|
|
|
|
} else if(entityType == "other") {
|
|
|
|
|
this.orpTotal = total;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private getEntityName (entityType:string, plural:boolean, full:boolean): string {
|
|
|
|
|
if(entityType == "publication") {
|
|
|
|
|
return "publication" + (plural ? "s" : "");
|
|
|
|
|
} else if(entityType == "dataset") {
|
|
|
|
|
return (full ? "research data" : ("dataset" + (plural ? "s" : "")));
|
|
|
|
|
} else if(entityType == "software") {
|
|
|
|
|
return "software";
|
|
|
|
|
} else if(entityType == "other") {
|
|
|
|
|
return (full ? ("other research product" + (plural ? "s" : "")) : "other");
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-01-26 16:00:07 +01:00
|
|
|
|
}
|