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';
|
2018-11-29 12:40:38 +01:00
|
|
|
|
import {Session} 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-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 {
|
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-05-13 16:42:07 +02:00
|
|
|
|
showAll = 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
|
|
|
|
|
|
|
|
|
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,
|
2018-11-26 14:07:58 +01:00
|
|
|
|
private _ΖenodoCommunitieService: ZenodoCommunitiesService) {
|
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;
|
|
|
|
|
var url = data.envSpecific.baseLink + this._router.url;
|
|
|
|
|
this._meta.updateTag({content: url}, "property='og:url'");
|
|
|
|
|
|
|
|
|
|
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')) {
|
|
|
|
|
this.piwiksub = this._piwikService.trackView(this.properties, community.title, PiwikHelper.siteIDs[this.communityId]).subscribe();
|
|
|
|
|
}
|
|
|
|
|
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-06-05 15:39:02 +02:00
|
|
|
|
this._searchResearchResultsService.countTotalResults("publication", this.properties,"&fq=communityid=" + this.communityId).subscribe(
|
2019-04-24 14:02:11 +02:00
|
|
|
|
publicationTotal => {
|
|
|
|
|
this.publicationTotal = publicationTotal;
|
|
|
|
|
this.showLoading = true;
|
|
|
|
|
this.searchPublications();
|
|
|
|
|
},
|
|
|
|
|
error => {
|
|
|
|
|
this.handleError("Error getting number of publications for community with id: " + this.communityId, error);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this._searchResearchResultsService.countTotalResults("dataset", this.properties,"&fq=communityid=" + this.communityId).subscribe(
|
2019-04-24 14:02:11 +02:00
|
|
|
|
researchDataTotal => {
|
|
|
|
|
this.researchDataTotal = researchDataTotal;
|
|
|
|
|
},
|
|
|
|
|
error => {
|
|
|
|
|
this.handleError("Error getting number of research data for community with id: " + this.communityId, error);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this._searchResearchResultsService.countTotalResults("software", this.properties,"&fq=communityid=" + this.communityId).subscribe(
|
2019-04-24 14:02:11 +02:00
|
|
|
|
softwareTotal => {
|
|
|
|
|
this.softwareTotal = softwareTotal;
|
|
|
|
|
},
|
|
|
|
|
error => {
|
|
|
|
|
this.handleError("Error getting number of software for community with id: " + this.communityId, error);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this._searchResearchResultsService.countTotalResults("other", this.properties,"&fq=communityid=" + this.communityId).subscribe(
|
2019-04-24 14:02:11 +02:00
|
|
|
|
orpTotal => {
|
|
|
|
|
this.orpTotal = orpTotal;
|
|
|
|
|
},
|
|
|
|
|
error => {
|
|
|
|
|
this.handleError("Error getting number of other research products for community with id: " + this.communityId, error);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this._searchCommunityProjectsService.countTotalProjects(this.properties, this.communityId ).subscribe(
|
2019-04-24 14:02:11 +02:00
|
|
|
|
projectTotal => {
|
|
|
|
|
this.projectTotal = projectTotal;
|
|
|
|
|
//console.log(projectTotal);
|
|
|
|
|
},
|
|
|
|
|
error => {
|
|
|
|
|
this.handleError("Error getting number of projects for community with id: " + this.communityId, error);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this._searchCommunityDataprovidersService.countTotalDataproviders(this.properties, this.communityId ).subscribe(
|
2019-04-24 14:02:11 +02:00
|
|
|
|
contentProviderTotal => {
|
|
|
|
|
this.contentProviderTotal = contentProviderTotal;
|
|
|
|
|
//console.log(contentProviderTotal);
|
|
|
|
|
},
|
|
|
|
|
error => {
|
|
|
|
|
this.handleError("Error getting number of content providers for community with id: " + this.communityId, error);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
2018-10-16 14:52:51 +02:00
|
|
|
|
public searchPublications() {
|
2019-04-11 16:32:07 +02:00
|
|
|
|
this.activeTab = "publication";
|
2018-10-16 14:52:51 +02:00
|
|
|
|
if (this.publicationTotal > 0 && this.publicationResults == null) {
|
2019-06-05 15:39:02 +02:00
|
|
|
|
//this._searchEntriesService.getResults(this.properties.searchAPIURLLAst + 'publications?fq=communityid%20exact%20%22' + this.communityId + '%22&sortBy=resultdateofacceptance,descending&format=json&size=5')
|
|
|
|
|
this._searchResearchResultsService.search("publication","","&fq=communityid=" + this.communityId,1,5,"resultdateofacceptance,descending",[],this.properties)
|
|
|
|
|
.subscribe(
|
2018-10-16 14:52:51 +02:00
|
|
|
|
publicationResults => {
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this.publicationResults = publicationResults[1];
|
2019-04-24 14:02:11 +02:00
|
|
|
|
this.showLoading = false;
|
|
|
|
|
//console.log(publicationResults);
|
2019-06-05 15:39:02 +02:00
|
|
|
|
},
|
2019-02-19 13:17:53 +01:00
|
|
|
|
error => {
|
2019-04-24 14:02:11 +02:00
|
|
|
|
this.handleError("Error getting publications for community with id: " + this.communityId, error);
|
2019-02-19 13:17:53 +01:00
|
|
|
|
}
|
|
|
|
|
);
|
2018-10-16 14:52:51 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public searchResearchData() {
|
2019-04-11 16:32:07 +02:00
|
|
|
|
this.activeTab = "dataset";
|
2018-10-16 14:52:51 +02:00
|
|
|
|
if (this.researchDataTotal > 0 && this.researchDataResults == null) {
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this._searchResearchResultsService.search("dataset","","&fq=communityid=" + this.communityId,1,5,"resultdateofacceptance,descending",[],this.properties).subscribe(
|
2018-10-16 14:52:51 +02:00
|
|
|
|
researchDataResults => {
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this.researchDataResults = researchDataResults[1];
|
2019-04-24 14:02:11 +02:00
|
|
|
|
this.showLoading = false;
|
2019-02-19 13:17:53 +01:00
|
|
|
|
},
|
|
|
|
|
error => {
|
2019-04-24 14:02:11 +02:00
|
|
|
|
this.handleError("Error getting research data for community with id: " + this.communityId, error);
|
2019-02-19 13:17:53 +01:00
|
|
|
|
}
|
|
|
|
|
);
|
2018-10-16 14:52:51 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public searchSoftware() {
|
2019-04-11 16:32:07 +02:00
|
|
|
|
this.activeTab = "software";
|
2018-10-16 14:52:51 +02:00
|
|
|
|
if (this.softwareTotal > 0 && this.softwareResults == null) {
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this._searchResearchResultsService.search("software","","&fq=communityid=" + this.communityId,1,5,"resultdateofacceptance,descending",[],this.properties).subscribe(
|
2018-10-16 14:52:51 +02:00
|
|
|
|
softwareResults => {
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this.softwareResults = softwareResults[1];
|
2019-04-24 14:02:11 +02:00
|
|
|
|
this.showLoading = false;
|
2019-02-19 13:17:53 +01:00
|
|
|
|
},
|
|
|
|
|
error => {
|
2019-04-24 14:02:11 +02:00
|
|
|
|
this.handleError("Error getting software for community with id: " + this.communityId, error);
|
2019-02-19 13:17:53 +01:00
|
|
|
|
}
|
|
|
|
|
);
|
2018-10-16 14:52:51 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public searchOrps() {
|
2019-04-11 16:32:07 +02:00
|
|
|
|
this.activeTab = "orp";
|
2018-10-16 14:52:51 +02:00
|
|
|
|
if (this.orpTotal > 0 && this.orpResults == null) {
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this._searchResearchResultsService.search("other","","&fq=communityid=" + this.communityId,1,5,"resultdateofacceptance,descending",[],this.properties).subscribe(
|
2018-10-16 14:52:51 +02:00
|
|
|
|
orpResults => {
|
2019-06-05 15:39:02 +02:00
|
|
|
|
this.orpResults = orpResults[1];
|
2019-04-24 14:02:11 +02:00
|
|
|
|
this.showLoading = false;
|
2019-02-19 13:17:53 +01:00
|
|
|
|
},
|
|
|
|
|
error => {
|
2019-04-24 14:02:11 +02:00
|
|
|
|
this.handleError("Error getting other research products 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-04-12 13:05:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this.isManager();
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
|
isManager() {
|
2018-11-29 12:40:38 +01:00
|
|
|
|
var email = Session.getUserEmail();
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Session.isPortalAdministrator() || Session.isCommunityCurator() || index != -1;
|
|
|
|
|
}
|
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
|
|
|
|
|
2018-01-26 16:00:07 +01:00
|
|
|
|
}
|