2019-07-22 11:16:50 +02:00
|
|
|
import {merge as observableMerge} from 'rxjs';
|
2020-03-16 14:09:46 +01:00
|
|
|
import {Component, Input, ViewChild} from '@angular/core';
|
2019-07-22 11:16:50 +02:00
|
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
|
|
|
import {Meta, Title} from '@angular/platform-browser';
|
|
|
|
|
|
|
|
|
|
|
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
|
|
|
|
|
|
|
import {DataProviderInfo} from '../../utils/entities/dataProviderInfo';
|
|
|
|
import {DataProviderService} from './dataProvider.service';
|
2019-09-11 11:45:54 +02:00
|
|
|
import {FetchResearchResults} from '../../utils/fetchEntitiesClasses/fetchResearchResults.class';
|
|
|
|
import {SearchResearchResultsService} from '../../services/searchResearchResults.service';
|
2019-07-22 11:16:50 +02:00
|
|
|
import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
|
|
|
import {SearchProjectsService} from '../../services/searchProjects.service';
|
|
|
|
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
|
|
|
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
|
|
|
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
|
|
|
import {RouterHelper} from '../../utils/routerHelper.class';
|
|
|
|
import {PiwikService} from '../../utils/piwik/piwik.service';
|
|
|
|
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
|
2019-04-24 14:31:01 +02:00
|
|
|
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
2019-07-22 11:16:50 +02:00
|
|
|
import {HelperService} from "../../utils/helper/helper.service";
|
2019-11-07 10:51:09 +01:00
|
|
|
import {Location} from "@angular/common";
|
Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
|
|
|
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
@Component({
|
2019-07-22 11:16:50 +02:00
|
|
|
selector: 'dataprovider',
|
|
|
|
templateUrl: 'dataProvider.component.html',
|
|
|
|
})
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
export class DataProviderComponent {
|
2018-04-11 10:59:01 +02:00
|
|
|
@Input() piwikSiteId = null;
|
2019-07-22 11:16:50 +02:00
|
|
|
@Input() communityId = null;
|
2017-12-19 13:53:46 +01:00
|
|
|
public dataProviderInfo: DataProviderInfo;
|
|
|
|
public datasourceId: string;
|
|
|
|
|
|
|
|
// Message variables
|
|
|
|
public warningMessage = "";
|
|
|
|
public errorMessage = "";
|
|
|
|
public showLoading: boolean = true;
|
|
|
|
|
|
|
|
// Variable to specify requests with either collectedFrom or hostedBy
|
|
|
|
public paramsForSearchLink = {};
|
2020-03-16 14:09:46 +01:00
|
|
|
public resultParamsForSearchLink = {};
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
// Metrics tab variables
|
|
|
|
public metricsClicked: boolean;
|
|
|
|
public viewsFrameUrl: string;
|
|
|
|
public downloadsFrameUrl: string;
|
|
|
|
public totalViews: number;
|
|
|
|
public totalDownloads: number;
|
|
|
|
public pageViews: number;
|
|
|
|
|
|
|
|
// Statistics tab variables
|
|
|
|
public statsClicked: boolean = false;
|
|
|
|
public docsTimelineUrl: string;
|
2019-07-22 11:16:50 +02:00
|
|
|
public docsTypesUrl: string;
|
|
|
|
public docsFunderUrl: string;
|
|
|
|
public dataProjectsUrl: string;
|
|
|
|
public pubsProjectsUrl: string;
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2020-03-16 14:09:46 +01:00
|
|
|
@ViewChild('statisticsModal') statisticsModal;
|
|
|
|
@ViewChild('relatedDatasourcesModal') relatedDatasourcesModal;
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
// Variables for publications, research data, projects, content providers, related content providers tabs
|
2019-09-11 11:45:54 +02:00
|
|
|
public fetchPublications: FetchResearchResults;
|
|
|
|
public fetchDatasets: FetchResearchResults;
|
|
|
|
public fetchSoftware: FetchResearchResults;
|
|
|
|
public fetchOrps: FetchResearchResults;
|
2017-12-19 13:53:46 +01:00
|
|
|
public fetchProjects: FetchProjects;
|
|
|
|
public fetchDataproviders: FetchDataproviders;
|
2019-09-11 11:45:54 +02:00
|
|
|
public fetchAggregatorsPublications: FetchResearchResults;
|
|
|
|
public fetchAggregatorsDatasets: FetchResearchResults;
|
|
|
|
public fetchAggregatorsSoftware: FetchResearchResults;
|
|
|
|
public fetchAggregatorsOrps: FetchResearchResults;
|
2020-03-16 14:09:46 +01:00
|
|
|
public fetchAggregatorsResults: FetchResearchResults;
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
public loadingRelatedDatasources: boolean = true;
|
|
|
|
|
|
|
|
// Active tab variable for responsiveness - show tabs only if main request is completed
|
|
|
|
public activeTab: string = "";
|
2019-07-22 11:16:50 +02:00
|
|
|
public showTabs: boolean = false;
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
public routerHelper: RouterHelper = new RouterHelper();
|
|
|
|
public errorCodes: ErrorCodes = new ErrorCodes();
|
|
|
|
public pageContents = null;
|
|
|
|
public divContents = null;
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
// Request results of each tab only the one time (first time tab is clicked)
|
|
|
|
private reloadPublications: boolean = true;
|
|
|
|
private reloadDatasets: boolean = true;
|
2018-05-08 14:59:30 +02:00
|
|
|
private reloadSoftware: boolean = true;
|
2018-07-26 18:38:59 +02:00
|
|
|
private reloadOrps: boolean = true;
|
2017-12-19 13:53:46 +01:00
|
|
|
private reloadProjects: boolean = true;
|
|
|
|
private reloadDataproviders: boolean = true;
|
|
|
|
private reloadRelatedDatasources: boolean = true;
|
|
|
|
|
2020-03-16 14:09:46 +01:00
|
|
|
// Organizations variables for view more/less functionality
|
2020-03-17 11:04:17 +01:00
|
|
|
public thresholdOrganizations: number = 20;
|
|
|
|
public showNumOrganizations: number = 20;
|
2020-03-16 14:09:46 +01:00
|
|
|
|
|
|
|
// Subjects variables for view more/less functionality
|
|
|
|
public thresholdSubjects: number = 20;
|
|
|
|
public showNumSubjects: number = 20;
|
|
|
|
|
|
|
|
// Description variables for view more/less functionality
|
|
|
|
public thresholdDescription: number = 670;
|
|
|
|
public showNumDescription: number = 670;
|
|
|
|
|
|
|
|
public indexUpdateDate: Date;
|
|
|
|
public showFeedback: boolean = false;
|
|
|
|
public feedbackFields: string [] = ['Name', 'Organizations','Country', 'Other'];
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
sub: any;
|
|
|
|
piwiksub: any;
|
|
|
|
subInfo: any;
|
|
|
|
relatedDatasourcesSub: any;
|
2019-07-22 11:16:50 +02:00
|
|
|
properties: EnvProperties;
|
|
|
|
|
|
|
|
constructor(private _dataproviderService: DataProviderService,
|
|
|
|
private _piwikService: PiwikService,
|
|
|
|
private route: ActivatedRoute,
|
|
|
|
private _meta: Meta,
|
|
|
|
private _title: Title,
|
|
|
|
private _router: Router,
|
2019-09-11 11:45:54 +02:00
|
|
|
private _searchResearchResultsService: SearchResearchResultsService,
|
2019-07-22 11:16:50 +02:00
|
|
|
private _searchProjectsService: SearchProjectsService,
|
|
|
|
private _searchDataprovidersService: SearchDataprovidersService,
|
|
|
|
private seoService: SEOService,
|
2019-11-07 10:51:09 +01:00
|
|
|
private helper: HelperService,
|
|
|
|
private _location: Location) {
|
2019-09-11 11:45:54 +02:00
|
|
|
this.fetchPublications = new FetchResearchResults(this._searchResearchResultsService);
|
|
|
|
this.fetchDatasets = new FetchResearchResults(this._searchResearchResultsService);
|
|
|
|
this.fetchSoftware = new FetchResearchResults(this._searchResearchResultsService);
|
|
|
|
this.fetchOrps = new FetchResearchResults(this._searchResearchResultsService);
|
2019-07-22 11:16:50 +02:00
|
|
|
this.fetchProjects = new FetchProjects(this._searchProjectsService);
|
|
|
|
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.route.data
|
|
|
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
2018-02-05 14:14:59 +01:00
|
|
|
this.properties = data.envSpecific;
|
2020-03-16 14:09:46 +01:00
|
|
|
if(this.properties.lastIndexUpdate) {
|
|
|
|
this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
|
|
|
|
}
|
2019-07-22 11:16:50 +02:00
|
|
|
//this.getDivContents();
|
|
|
|
this.getPageContents();
|
|
|
|
this.updateUrl(data.envSpecific.baseLink + this._router.url);
|
2018-02-05 14:14:59 +01:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
});
|
|
|
|
this.sub = this.route.queryParams.subscribe(data => {
|
2017-12-19 13:53:46 +01:00
|
|
|
this.updateTitle("Content provider");
|
2019-02-08 13:19:26 +01:00
|
|
|
this.updateDescription("");
|
2017-12-19 13:53:46 +01:00
|
|
|
this.datasourceId = data['datasourceId'];
|
2019-07-22 11:16:50 +02:00
|
|
|
if (this.datasourceId) {
|
|
|
|
this.getDataProviderInfo(this.datasourceId);
|
2019-10-31 12:39:23 +01:00
|
|
|
} else {
|
|
|
|
this.showLoading = false;
|
2019-11-07 10:51:09 +01:00
|
|
|
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": "dataprovider"}});
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
2019-04-24 14:31:01 +02:00
|
|
|
HelperFunctions.scroll();
|
2019-07-22 11:16:50 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
private getPageContents() {
|
|
|
|
this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
|
|
|
|
this.pageContents = contents;
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
private getDivContents() {
|
|
|
|
this.helper.getDivHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
|
|
|
|
this.divContents = contents;
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
if (this.sub) {
|
|
|
|
this.sub.unsubscribe();
|
|
|
|
}
|
|
|
|
if (this.piwiksub) {
|
|
|
|
this.piwiksub.unsubscribe();
|
|
|
|
}
|
|
|
|
if (this.subInfo) {
|
2017-12-19 13:53:46 +01:00
|
|
|
this.subInfo.unsubscribe();
|
2019-07-22 11:16:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (this.relatedDatasourcesSub) {
|
|
|
|
this.relatedDatasourcesSub.unsubscribe();
|
|
|
|
}
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private getDataProviderInfo(id: string) {
|
2017-12-19 13:53:46 +01:00
|
|
|
this.warningMessage = '';
|
2020-03-16 14:09:46 +01:00
|
|
|
this.errorMessage = "";
|
2017-12-19 13:53:46 +01:00
|
|
|
this.showLoading = true;
|
|
|
|
|
2018-06-28 16:52:45 +02:00
|
|
|
this.dataProviderInfo = null;
|
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
this.showTabs = false;
|
|
|
|
if (this.datasourceId == null || this.datasourceId == '') {
|
2017-12-19 13:53:46 +01:00
|
|
|
this.showLoading = false;
|
2019-07-22 11:16:50 +02:00
|
|
|
this.warningMessage = "No valid datasource id";
|
|
|
|
} else {
|
2018-02-05 14:14:59 +01:00
|
|
|
this.subInfo = this._dataproviderService.getDataproviderInfo(this.datasourceId, this.properties).subscribe(
|
2017-12-19 13:53:46 +01:00
|
|
|
data => {
|
2019-07-22 11:16:50 +02:00
|
|
|
this.dataProviderInfo = data;
|
|
|
|
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url);
|
|
|
|
if (typeof document !== 'undefined') {
|
|
|
|
this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId);
|
|
|
|
}
|
|
|
|
this.initTabs();
|
|
|
|
this.showTabs = true;
|
|
|
|
this.updateTitle(this.dataProviderInfo.title.name);
|
|
|
|
this.updateDescription("Content provider, " + this.dataProviderInfo.title.name);
|
|
|
|
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
|
|
|
this.piwiksub = this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe();
|
|
|
|
}
|
|
|
|
|
|
|
|
this.showLoading = false;
|
|
|
|
|
|
|
|
if (this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) {
|
|
|
|
this.activeTab = this.dataProviderInfo.tabs[0].name;
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
},
|
|
|
|
err => {
|
2019-02-15 13:50:24 +01:00
|
|
|
//console.log(err);
|
2019-07-22 11:16:50 +02:00
|
|
|
this.handleError("Error getting content provider for id: " + this.datasourceId, err);
|
2019-10-31 12:39:23 +01:00
|
|
|
if(err.status == 404) {
|
2019-11-07 10:51:09 +01:00
|
|
|
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": "dataprovider"}});
|
2019-10-31 12:39:23 +01:00
|
|
|
}
|
2020-03-17 16:19:25 +01:00
|
|
|
this.errorMessage = 'No dataProvider found';
|
2017-12-19 13:53:46 +01:00
|
|
|
this.showLoading = false;
|
2019-06-03 10:53:57 +02:00
|
|
|
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataProviders);
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
2019-07-22 11:16:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private getDataProviderAggregationStatus(originalId: string) {
|
|
|
|
this.subInfo = this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe(
|
|
|
|
data => {
|
|
|
|
this.dataProviderInfo.aggregationStatus = data;
|
|
|
|
},
|
|
|
|
err => {
|
|
|
|
//console.log(err);
|
|
|
|
this.handleError("Error getting content provider aggregation status for id: " + this.datasourceId, err);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
private updateDescription(description: string) {
|
2019-12-05 17:07:07 +01:00
|
|
|
this._meta.updateTag({content: description.substring(0, 160)}, "name='description'");
|
|
|
|
this._meta.updateTag({content: description.substring(0, 160)}, "property='og:description'");
|
2019-07-22 11:16:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private updateTitle(title: string) {
|
2019-08-02 16:55:32 +02:00
|
|
|
var _prefix = "";
|
2019-12-05 17:07:07 +01:00
|
|
|
// if(this.communityId) {
|
|
|
|
// _prefix = "OpenAIRE | ";
|
|
|
|
// }
|
|
|
|
// var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
|
|
|
|
this._title.setTitle(title);
|
|
|
|
this._meta.updateTag({content: title}, "property='og:title'");
|
2019-07-22 11:16:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private updateUrl(url: string) {
|
|
|
|
this._meta.updateTag({content: url}, "property='og:url'");
|
|
|
|
}
|
|
|
|
|
|
|
|
private initTabs() {
|
|
|
|
|
2020-03-17 11:04:17 +01:00
|
|
|
//if (this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) {
|
2019-07-22 11:16:50 +02:00
|
|
|
this.reloadPublications = true;
|
|
|
|
this.reloadDatasets = true;
|
|
|
|
this.reloadSoftware = true;
|
|
|
|
this.reloadOrps = true;
|
|
|
|
this.reloadProjects = true;
|
|
|
|
this.reloadDataproviders = true;
|
|
|
|
this.reloadRelatedDatasources = true;
|
|
|
|
this.statsClicked = false;
|
|
|
|
|
|
|
|
//this.search(this.dataProviderInfo.tabs[0].content, 1, 10);
|
|
|
|
this.count(1, 0);
|
|
|
|
|
|
|
|
this.metricsClicked = false;
|
|
|
|
|
2019-12-04 13:56:37 +01:00
|
|
|
this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"dtsrcRepoViews","dtsrcName":"' + this.datasourceId + '","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":80,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
2019-07-22 11:16:50 +02:00
|
|
|
/*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"dtsrcOpenAIRETimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"dtsrcRepoTimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
|
|
|
*/
|
|
|
|
|
2019-12-04 13:56:37 +01:00
|
|
|
this.downloadsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"dtsrcRepoDownloads","dtsrcName":"' + this.datasourceId + '","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":80,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
2019-07-22 11:16:50 +02:00
|
|
|
/*
|
|
|
|
this.downloadsFrameUrl = this.properties.framesAPIURL +'merge.php?com=query&data=[{"query":"dtsrcDownloadsTimeline","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"chart","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["spline"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
|
|
|
*/
|
|
|
|
|
2019-09-10 13:47:22 +02:00
|
|
|
this.docsTimelineUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcYear","dtsrcName":"' + this.datasourceId + '","table": "result", "fields": [{"fld": "number", "agg": "count", "type": "line", "yaxis":1, "c":true}], "xaxis":{"name": "year", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": -30, "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [{"f":0, "text": "Yearly"}], "filters": [{"name":"year","max":"2016","min":"1997"},{"name": "result_datasources-datasource-name", "values":[""], "to": "-1"}],"having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": "Year"}&w=90%&h=90%';
|
|
|
|
this.docsTypesUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcPubs","dtsrcName":"' + this.datasourceId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%';
|
|
|
|
this.docsFunderUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcPubsFund","dtsrcName":"' + this.datasourceId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%';
|
|
|
|
this.dataProjectsUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcProjData","dtsrcName":"' + this.datasourceId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Data"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%';
|
|
|
|
this.pubsProjectsUrl = this.properties.statisticsFrameAPIURL + 'chart.php?com=query&persistent=false&data={"query":"dtsrcProjPubs","dtsrcName":"' + this.datasourceId + '", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Publications"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%';
|
2019-07-22 11:16:50 +02:00
|
|
|
|
|
|
|
//if({"name": "Publications", "content": "publicationsTab"} in this.dataProviderInfo.tabs) {
|
|
|
|
//if(this.dataProviderInfo.tabs.some(function (tab) {
|
|
|
|
// return tab.name === 'Publications';
|
|
|
|
//})) {
|
|
|
|
// this.relatedDataprovidersResultsType = 'publications';
|
2020-03-16 14:09:46 +01:00
|
|
|
|
|
|
|
// this.fetchAggregatorsPublications = new FetchResearchResults(this._searchResearchResultsService);
|
|
|
|
// //} else {
|
|
|
|
// // this.relatedDataprovidersResultsType = 'datasets';
|
|
|
|
// this.fetchAggregatorsDatasets = new FetchResearchResults(this._searchResearchResultsService);
|
|
|
|
// //}
|
|
|
|
// this.fetchAggregatorsSoftware = new FetchResearchResults(this._searchResearchResultsService);
|
|
|
|
// this.fetchAggregatorsOrps = new FetchResearchResults(this._searchResearchResultsService);
|
|
|
|
this.fetchAggregatorsResults = new FetchResearchResults(this._searchResearchResultsService);
|
2020-03-17 11:04:17 +01:00
|
|
|
//}
|
2020-03-16 14:09:46 +01:00
|
|
|
// if (this.dataProviderInfo.resultsBy == "collectedFrom") {
|
|
|
|
// //this.paramsForSearchLink = "?collectedFrom="+this.datasourceId+"&co=and";
|
|
|
|
// this.paramsForSearchLink = this.routerHelper.createQueryParams(['f0', 'fv0'], ["collectedfromdatasourceid", this.datasourceId]);
|
|
|
|
// this.resultParamsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'cl', 'qf'], [this.datasourceId, 'and', 'false']);
|
|
|
|
// } else if (this.dataProviderInfo.resultsBy == "hostedBy") {
|
|
|
|
// //this.paramsForSearchLink = "?hostedBy="+this.datasourceId+"&ho=and";
|
|
|
|
// this.paramsForSearchLink = this.routerHelper.createQueryParams(['f0', 'fv0'], ["resulthostingdatasourceid", this.datasourceId]);
|
|
|
|
// this.resultParamsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'hs', 'qf'], [this.datasourceId, 'and', 'false']);
|
|
|
|
// }
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
}
|
|
|
|
|
2020-03-16 14:09:46 +01:00
|
|
|
public getParamsForSearchLink(type: string = "") {
|
|
|
|
let resultsBy: string = "";
|
|
|
|
// if(this.dataProviderInfo.resultsBy == "collectedFrom") {
|
|
|
|
// resultsBy = "collectedfromdatasourceid"
|
|
|
|
// } else if (this.dataProviderInfo.resultsBy == "hostedBy") {
|
|
|
|
// resultsBy = "resulthostingdatasourceid";
|
|
|
|
// }
|
|
|
|
|
|
|
|
if(type) {
|
|
|
|
return this.routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf'], ["collectedfromdatasourceid", this.datasourceId, "resulthostingdatasourceid,or", this.datasourceId, type, "false"]);
|
|
|
|
} else {
|
|
|
|
return this.routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1'], ["collectedfromdatasourceid", this.datasourceId, "resulthostingdatasourceid,or", this.datasourceId]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private count(page: number, size: number) {
|
2020-03-17 11:04:17 +01:00
|
|
|
//for (let i = 0; i < this.dataProviderInfo.tabs.length; i++) {
|
|
|
|
//let content: string = this.dataProviderInfo.tabs[i].content;
|
2019-07-22 11:16:50 +02:00
|
|
|
|
2020-03-17 11:04:17 +01:00
|
|
|
//if (content == 'publicationsTab') {
|
2019-07-22 11:16:50 +02:00
|
|
|
this.countPublications(page, size);
|
2020-03-17 11:04:17 +01:00
|
|
|
//} else if (content == 'datasetsTab') {
|
2019-07-22 11:16:50 +02:00
|
|
|
this.countDatasets(page, size);
|
2020-03-17 11:04:17 +01:00
|
|
|
//} else if (content == 'softwareTab') {
|
2019-07-22 11:16:50 +02:00
|
|
|
this.countSoftware(page, size);
|
2020-03-17 11:04:17 +01:00
|
|
|
//} else if (content == 'orpsTab') {
|
2019-07-22 11:16:50 +02:00
|
|
|
this.countOrps(page, size);
|
2020-03-17 11:04:17 +01:00
|
|
|
//} else if (content == 'projectsTab') {
|
2019-07-22 11:16:50 +02:00
|
|
|
this.countProjects(page, size);
|
2020-03-17 11:04:17 +01:00
|
|
|
//} else if (content == 'datasourcesTab') {
|
2019-07-22 11:16:50 +02:00
|
|
|
this.countDatasources(page, size);
|
2020-03-17 11:04:17 +01:00
|
|
|
//}// else if(content=='relatedDatasourcesTab') {
|
2019-07-22 11:16:50 +02:00
|
|
|
// this.countRelatedDatasources(page, size);
|
|
|
|
//}
|
2020-03-17 11:04:17 +01:00
|
|
|
//}
|
2019-07-22 11:16:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public search(content: string, page: number, size: number) {
|
|
|
|
if (content == 'publicationsTab') {
|
|
|
|
this.searchPublications(page, size);
|
|
|
|
} else if (content == 'datasetsTab') {
|
|
|
|
this.searchDatasets(page, size);
|
|
|
|
} else if (content == 'softwareTab') {
|
|
|
|
this.searchSoftware(page, size);
|
|
|
|
} else if (content == 'orpsTab') {
|
|
|
|
this.searchOrps(page, size);
|
|
|
|
} else if (content == 'projectsTab') {
|
|
|
|
this.searchProjects(page, size);
|
|
|
|
} else if (content == 'datasourcesTab') {
|
|
|
|
this.searchDatasources(page, size);
|
|
|
|
} else if (content == 'relatedDatasourcesTab') {
|
|
|
|
this.searchRelatedDatasources(1, 0);
|
|
|
|
} else if (content == 'metricsTab') {
|
|
|
|
this.metricsClicked = true;
|
|
|
|
} else if (content == 'statisticsTab') {
|
|
|
|
this.statsClicked = !this.statsClicked;
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2019-07-22 11:16:50 +02:00
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private searchPublications(page: number, size: number) {
|
|
|
|
if (this.reloadPublications &&
|
|
|
|
(this.fetchPublications.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
this.fetchPublications.searchUtils.status == this.errorCodes.DONE)) {
|
2019-09-11 11:45:54 +02:00
|
|
|
this.fetchPublications.getResultsForDataproviders("publication", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2019-07-22 11:16:50 +02:00
|
|
|
this.reloadPublications = false;
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private countPublications(page: number, size: number) {
|
2019-09-11 11:45:54 +02:00
|
|
|
this.fetchPublications.getResultsForDataproviders("publication", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
|
2019-07-22 11:16:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private searchDatasets(page: number, size: number) {
|
|
|
|
if (this.reloadDatasets &&
|
|
|
|
(this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
this.fetchDatasets.searchUtils.status == this.errorCodes.DONE)) {
|
2019-09-11 11:45:54 +02:00
|
|
|
this.fetchDatasets.getResultsForDataproviders("dataset", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2019-07-22 11:16:50 +02:00
|
|
|
this.reloadDatasets = false;
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private countDatasets(page: number, size: number) {
|
2019-09-11 11:45:54 +02:00
|
|
|
this.fetchDatasets.getResultsForDataproviders("dataset", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
|
2019-07-22 11:16:50 +02:00
|
|
|
}
|
2018-05-08 14:59:30 +02:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private searchSoftware(page: number, size: number) {
|
|
|
|
if (this.reloadSoftware &&
|
|
|
|
(this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
this.fetchSoftware.searchUtils.status == this.errorCodes.DONE)) {
|
2019-09-11 11:45:54 +02:00
|
|
|
this.fetchSoftware.getResultsForDataproviders("software", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
|
2018-05-08 14:59:30 +02:00
|
|
|
}
|
2019-07-22 11:16:50 +02:00
|
|
|
this.reloadSoftware = false;
|
|
|
|
}
|
2018-05-08 14:59:30 +02:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private countSoftware(page: number, size: number) {
|
2019-09-11 11:45:54 +02:00
|
|
|
this.fetchSoftware.getResultsForDataproviders("software", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
|
2019-07-22 11:16:50 +02:00
|
|
|
}
|
2018-07-26 18:38:59 +02:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private searchOrps(page: number, size: number) {
|
|
|
|
if (this.reloadOrps &&
|
|
|
|
(this.fetchOrps.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
this.fetchOrps.searchUtils.status == this.errorCodes.DONE)) {
|
2019-09-11 11:45:54 +02:00
|
|
|
this.fetchOrps.getResultsForDataproviders("other", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
|
2018-07-26 18:38:59 +02:00
|
|
|
}
|
2019-07-22 11:16:50 +02:00
|
|
|
this.reloadOrps = false;
|
|
|
|
}
|
2018-07-26 18:38:59 +02:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private countOrps(page: number, size: number) {
|
2019-09-11 11:45:54 +02:00
|
|
|
this.fetchOrps.getResultsForDataproviders("other", this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
|
2019-07-22 11:16:50 +02:00
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private searchProjects(page: number, size: number) {
|
|
|
|
if (this.reloadProjects &&
|
|
|
|
(this.fetchProjects.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
this.fetchProjects.searchUtils.status == this.errorCodes.DONE)) {
|
2018-02-05 14:14:59 +01:00
|
|
|
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2019-07-22 11:16:50 +02:00
|
|
|
this.reloadProjects = false;
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private countProjects(page: number, size: number) {
|
|
|
|
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private searchDatasources(page: number, size: number) {
|
|
|
|
if (this.reloadDataproviders &&
|
|
|
|
(this.fetchDataproviders.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
this.fetchDataproviders.searchUtils.status == this.errorCodes.DONE)) {
|
2018-02-05 14:14:59 +01:00
|
|
|
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2019-07-22 11:16:50 +02:00
|
|
|
this.reloadDataproviders = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
private countDatasources(page: number, size: number) {
|
|
|
|
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
|
|
|
|
}
|
|
|
|
|
|
|
|
private searchRelatedDatasources(page: number, size: number) {
|
|
|
|
// Currently no counting is done for this tab. Following condition is always false
|
|
|
|
|
2020-03-16 14:09:46 +01:00
|
|
|
// if (this.reloadRelatedDatasources &&
|
|
|
|
// (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
// this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE)
|
|
|
|
// &&
|
|
|
|
// (this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
// this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE)
|
|
|
|
// &&
|
|
|
|
// (this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
// this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE)
|
|
|
|
// &&
|
|
|
|
// (this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
// this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE)
|
|
|
|
// ) {
|
|
|
|
// this.relatedDatasourcesSub = observableMerge(this.fetchAggregatorsPublications.requestComplete, this.fetchAggregatorsDatasets.requestComplete, this.fetchAggregatorsSoftware.requestComplete, this.fetchAggregatorsOrps.requestComplete)
|
|
|
|
// .subscribe(
|
|
|
|
// data => {
|
|
|
|
// },
|
|
|
|
// err => {
|
|
|
|
// },
|
|
|
|
// () => {
|
|
|
|
// this.preprocessRelatedDatasources();
|
|
|
|
// }
|
|
|
|
// );
|
|
|
|
//
|
|
|
|
// this.fetchAggregatorsPublications.getAggregatorResults("publication", this.datasourceId, page, size, this.properties);
|
|
|
|
// this.fetchAggregatorsDatasets.getAggregatorResults("dataset", this.datasourceId, page, size, this.properties);
|
|
|
|
// this.fetchAggregatorsSoftware.getAggregatorResults("software", this.datasourceId, page, size, this.properties);
|
|
|
|
// this.fetchAggregatorsOrps.getAggregatorResults("other", this.datasourceId, page, size, this.properties);
|
2019-07-22 11:16:50 +02:00
|
|
|
if (this.reloadRelatedDatasources &&
|
2020-03-16 14:09:46 +01:00
|
|
|
(this.fetchAggregatorsResults.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
this.fetchAggregatorsResults.searchUtils.status == this.errorCodes.DONE)
|
|
|
|
) {
|
|
|
|
this.relatedDatasourcesSub = this.fetchAggregatorsResults.requestComplete.subscribe(
|
|
|
|
data => {},
|
|
|
|
err => {},
|
|
|
|
() => {
|
|
|
|
//this.preprocessRelatedDatasources();
|
|
|
|
this.dataProviderInfo.relatedDatasources = this.fetchAggregatorsResults.results;
|
|
|
|
this.loadingRelatedDatasources = false;
|
|
|
|
}
|
|
|
|
);
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2020-03-16 14:09:46 +01:00
|
|
|
this.fetchAggregatorsResults.getAggregatorResults("results", this.datasourceId, page, size, this.properties);
|
2019-07-22 11:16:50 +02:00
|
|
|
} else {
|
|
|
|
this.loadingRelatedDatasources = false;
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
this.reloadRelatedDatasources = false;
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private countRelatedDatasources(page: number, size: number) {
|
2020-03-16 14:09:46 +01:00
|
|
|
// this.fetchAggregatorsPublications.getAggregatorResults("publication", this.datasourceId, page, size, this.properties);
|
|
|
|
// this.fetchAggregatorsDatasets.getAggregatorResults("dataset", this.datasourceId, page, size, this.properties);
|
|
|
|
// this.fetchAggregatorsSoftware.getAggregatorResults("software", this.datasourceId, page, size, this.properties);
|
|
|
|
// this.fetchAggregatorsOrps.getAggregatorResults("other", this.datasourceId, page, size, this.properties);
|
|
|
|
this.fetchAggregatorsResults.getAggregatorResults("results", this.datasourceId, page, size, this.properties);
|
2019-07-22 11:16:50 +02:00
|
|
|
}
|
2018-07-05 17:50:43 +02:00
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
|
2020-03-16 14:09:46 +01:00
|
|
|
// private preprocessRelatedDatasources() {
|
|
|
|
// if (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE ||
|
|
|
|
// this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE ||
|
|
|
|
// this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE ||
|
|
|
|
// this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE) {
|
|
|
|
// this.dataProviderInfo.relatedDatasources = new Map<string, { "name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string }>();
|
|
|
|
// }
|
|
|
|
// for (let result of this.fetchAggregatorsPublications.results) {
|
|
|
|
// if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
|
|
|
|
// this.dataProviderInfo.relatedDatasources.set(result.id, {
|
|
|
|
// "name": result.name,
|
|
|
|
// "countPublications": result.count,
|
|
|
|
// "countDatasets": "0",
|
|
|
|
// "countSoftware": "0",
|
|
|
|
// "countOrps": "0"
|
|
|
|
// });
|
|
|
|
// } else {
|
|
|
|
// this.dataProviderInfo.relatedDatasources.get(result.id).countPublications = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countPublications + result.count) + "";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// for (let result of this.fetchAggregatorsDatasets.results) {
|
|
|
|
// if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
|
|
|
|
// this.dataProviderInfo.relatedDatasources.set(result.id, {
|
|
|
|
// "name": result.name,
|
|
|
|
// "countPublications": "0",
|
|
|
|
// "countDatasets": result.count,
|
|
|
|
// "countSoftware": "0",
|
|
|
|
// "countOrps": "0"
|
|
|
|
// });
|
|
|
|
// } else {
|
|
|
|
// this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets + result.count) + "";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// for (let result of this.fetchAggregatorsSoftware.results) {
|
|
|
|
// if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
|
|
|
|
// this.dataProviderInfo.relatedDatasources.set(result.id, {
|
|
|
|
// "name": result.name,
|
|
|
|
// "countPublications": "0",
|
|
|
|
// "countDatasets": "0",
|
|
|
|
// "countSoftware": result.count,
|
|
|
|
// "countOrps": "0"
|
|
|
|
// });
|
|
|
|
// } else {
|
|
|
|
// this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware + result.count) + "";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// for (let result of this.fetchAggregatorsOrps.results) {
|
|
|
|
// if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
|
|
|
|
// this.dataProviderInfo.relatedDatasources.set(result.id, {
|
|
|
|
// "name": result.name,
|
|
|
|
// "countPublications": "0",
|
|
|
|
// "countDatasets": "0",
|
|
|
|
// "countSoftware": "0",
|
|
|
|
// "countOrps": result.count
|
|
|
|
// });
|
|
|
|
// } else {
|
|
|
|
// this.dataProviderInfo.relatedDatasources.get(result.id).countOrps = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countOrps + result.count) + "";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// this.loadingRelatedDatasources = false;
|
|
|
|
// }
|
2019-07-22 11:16:50 +02:00
|
|
|
|
|
|
|
public metricsResults($event) {
|
|
|
|
this.totalViews = $event.totalViews;
|
|
|
|
this.totalDownloads = $event.totalDownloads;
|
|
|
|
this.pageViews = $event.pageViews;
|
|
|
|
}
|
|
|
|
|
2020-03-16 14:09:46 +01:00
|
|
|
public openStatistics() {
|
|
|
|
this.statsClicked = true;
|
|
|
|
this.statisticsModal.cancelButton = false;
|
|
|
|
this.statisticsModal.okButton = false;
|
|
|
|
this.statisticsModal.alertTitle = "Statistics of";
|
|
|
|
this.statisticsModal.open();
|
|
|
|
}
|
|
|
|
|
|
|
|
public openRelatedDatasources() {
|
|
|
|
this.searchRelatedDatasources(1, 0);
|
|
|
|
this.relatedDatasourcesModal.cancelButton = false;
|
|
|
|
this.relatedDatasourcesModal.okButton = false;
|
|
|
|
this.relatedDatasourcesModal.alertTitle = "Related content providers of";
|
|
|
|
this.relatedDatasourcesModal.open();
|
|
|
|
}
|
|
|
|
|
|
|
|
public removeUnknown(array: string[]): string[] {
|
|
|
|
return array.filter(value => value.toLowerCase() !== 'unknown');
|
|
|
|
}
|
|
|
|
|
2019-07-22 11:16:50 +02:00
|
|
|
private handleError(message: string, error) {
|
|
|
|
console.error("Content Provider Landing Page: " + message, error);
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|