1
|
import {Component, Input, Renderer, ElementRef} from '@angular/core';
|
2
|
import {ActivatedRoute, Params} from '@angular/router';
|
3
|
//import { DOCUMENT } from '@angular/platform-browser';
|
4
|
|
5
|
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class';
|
6
|
import { SearchPublicationsService } from '../../services/searchPublications.service';
|
7
|
import { FetchDatasets } from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
|
8
|
import { SearchDatasetsService } from '../../services/searchDatasets.service';
|
9
|
import { FetchProjects } from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
10
|
import { SearchProjectsService } from '../../services/searchProjects.service';
|
11
|
import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
12
|
import { SearchDataprovidersService } from '../../services/searchDataproviders.service';
|
13
|
|
14
|
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
15
|
import {RouterHelper} from '../../utils/routerHelper.class';
|
16
|
|
17
|
@Component({
|
18
|
selector: 'tabs',
|
19
|
template: `
|
20
|
<ul *ngIf="tabs != undefined" class="uk-tab" data-uk-switcher="{connect:'#tab-content'}">
|
21
|
<li *ngIf="tabs.length>0" class="uk-active" id="{{tabs[0].content}}">
|
22
|
<a>
|
23
|
{{tabs[0].name}}
|
24
|
<i *ngIf="tabs[0].content == 'metricsTab'" class="uk-icon-line-chart"></i>
|
25
|
<i *ngIf="tabs[0].content == 'statisticsTab'" class="uk-icon-pie-chart"></i>
|
26
|
|
27
|
<span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='publicationsTab'">
|
28
|
{{fetchPublications.searchUtils.totalResults}}
|
29
|
</span>
|
30
|
<span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='datasetsTab'">
|
31
|
{{fetchDatasets.searchUtils.totalResults}}
|
32
|
</span>
|
33
|
<span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='projectsTab'">
|
34
|
{{fetchProjects.searchUtils.totalResults}}
|
35
|
</span>
|
36
|
<span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='datasourcesTab'">
|
37
|
{{fetchDataproviders.searchUtils.totalResults}}
|
38
|
</span>
|
39
|
<span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='organizationsTab'">
|
40
|
{{organizations.length}}
|
41
|
</span>
|
42
|
</a>
|
43
|
</li>
|
44
|
|
45
|
<li *ngFor="let tab of tabs; let i=index">
|
46
|
<a *ngIf="i>0"
|
47
|
(click)="search(tab.content, 1, 10)">
|
48
|
{{tab.name}}
|
49
|
<i *ngIf="tab.content == 'metricsTab'" class="uk-icon-line-chart"></i>
|
50
|
<i *ngIf="tab.content == 'statisticsTab'" class="uk-icon-pie-chart"></i>
|
51
|
|
52
|
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='publicationsTab'">
|
53
|
{{fetchPublications.searchUtils.totalResults}}
|
54
|
</span>
|
55
|
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='datasetsTab'">
|
56
|
{{fetchDatasets.searchUtils.totalResults}}
|
57
|
</span>
|
58
|
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='projectsTab'">
|
59
|
{{fetchProjects.searchUtils.totalResults}}
|
60
|
</span>
|
61
|
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='datasourcesTab'">
|
62
|
{{fetchDataproviders.searchUtils.totalResults}}
|
63
|
</span>
|
64
|
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='organizationsTab'">
|
65
|
{{organizations.length}}
|
66
|
</span>
|
67
|
</a>
|
68
|
</li>
|
69
|
</ul>
|
70
|
|
71
|
<ul *ngIf="tabs != undefined" id="tab-content" class="uk-switcher uk-margin custom-tab-content">
|
72
|
<li class="uk-animation-fade" id="firstTab-content" *ngIf="tabs.length>0">
|
73
|
<publicationsTab *ngIf="tabs[0].content=='publicationsTab'"
|
74
|
[paramsForSearchLink]="paramsForSearchLink"
|
75
|
[fetchPublications]="fetchPublications">
|
76
|
</publicationsTab>
|
77
|
<datasetsTab *ngIf="tabs[0].content=='datasetsTab'"
|
78
|
[paramsForSearchLink]="paramsForSearchLink"
|
79
|
[fetchDatasets]="fetchDatasets">
|
80
|
</datasetsTab>
|
81
|
|
82
|
|
83
|
<projectsTab *ngIf="tabs[0].content=='projectsTab'"
|
84
|
[paramsForSearchLink]="paramsForSearchLink"
|
85
|
[fetchProjects]="fetchProjects">
|
86
|
</projectsTab>
|
87
|
|
88
|
<datasourcesTab *ngIf="tabs[0].content=='datasourcesTab'"
|
89
|
|
90
|
[paramsForSearchLink]="paramsForSearchLink"
|
91
|
[fetchDataproviders]="fetchDataproviders">
|
92
|
|
93
|
</datasourcesTab>
|
94
|
<organizationsTab *ngIf="tabs[0].content=='organizationsTab'"
|
95
|
[organizations]="organizations">
|
96
|
</organizationsTab>
|
97
|
<relatedDatasourcesTab *ngIf="tabs[0].content=='relatedDatasourcesTab'"
|
98
|
[fetchResults]="fetchResultsAggregators"
|
99
|
[type]="relatedDataprovidersResultsType">
|
100
|
</relatedDatasourcesTab>
|
101
|
|
102
|
<div *ngIf="tabs[0].content=='statisticsTab' && statsClicked">
|
103
|
<div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert">
|
104
|
There are no statistics
|
105
|
</div>
|
106
|
<div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
|
107
|
<p>
|
108
|
The results below are discovered through our pilot algorithms.
|
109
|
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
|
110
|
</p>
|
111
|
<p class="uk-text-bold">Latest Documents Timeline</p>
|
112
|
<i-frame [url]=docsTimelineUrl width="800" height="350"></i-frame>
|
113
|
<p class="uk-text-bold">Documents Types</p>
|
114
|
<i-frame [url]=docsTypesUrl width="800" height="350"></i-frame>
|
115
|
</div>
|
116
|
|
117
|
<div *ngIf="(fetchPublications.searchUtils.totalResults > 0)">
|
118
|
<div>
|
119
|
<p class="uk-text-bold">Funders in Data Providers Publications</p>
|
120
|
<i-frame [url]=pubsFunderUrl width="800" height="350"></i-frame>
|
121
|
<p class="uk-text-bold">Projects with most Publications</p>
|
122
|
<i-frame [url]=pubsProjectsUrl width="800" height="350"></i-frame>
|
123
|
|
124
|
|
125
|
</div>
|
126
|
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)">
|
127
|
<div>
|
128
|
<p class="uk-text-bold">Projects with most Research Data</p>
|
129
|
<i-frame [url]=dataProjectsUrl width="800" height="350"></i-frame>
|
130
|
|
131
|
</div>
|
132
|
</div>
|
133
|
</div>
|
134
|
</div>
|
135
|
<!--projectsTab *ngIf="tabs[0].content=='projectsTab'"
|
136
|
[paramsForSearchLink]="paramsForSearchLink"
|
137
|
[fetchProjects]="fetchProjects">
|
138
|
</projectsTab>
|
139
|
<datasourcesTab *ngIf="tabs[0].content=='datasourcesTab'"
|
140
|
[paramsForSearchLink]="paramsForSearchLink"
|
141
|
[fetchDataproviders]="fetchDataproviders">
|
142
|
</datasourcesTab>
|
143
|
<organizationsTab *ngIf="tabs[0].content=='organizationsTab'"
|
144
|
[organizations]="organizations">
|
145
|
</organizationsTab>
|
146
|
<relatedDatasourcesTab *ngIf="tabs[0].content=='relatedDatasourcesTab'"
|
147
|
[fetchPublications]="fetchPublicationsAggregators">
|
148
|
</relatedDatasourcesTab-->
|
149
|
<!--div *ngIf="tabs[0].content=='metricsTab' && metrics == undefined" class = "uk-alert uk-alert-warning">
|
150
|
Metrics are currently unavailable
|
151
|
</div>
|
152
|
<div *ngIf="tabs[0].content=='metricsTab' && metrics != undefined" class="uk-panel uk-panel-box">
|
153
|
<b>Views: </b>{{metrics}}
|
154
|
</div-->
|
155
|
<metrics *ngIf="tabs[0].content=='metricsTab' && metricsClicked"
|
156
|
[id]="id" [type]="'datasources'" [name]="name" (metricsResults)="metricsResults($event)">
|
157
|
</metrics>
|
158
|
<i-frame *ngIf="tabs[0].content=='metricsTab' && metricsClicked && totalViews > 0"
|
159
|
[url]=viewsFrameUrl width="100%" height="250">
|
160
|
</i-frame>
|
161
|
<i-frame *ngIf="tabs[0].content=='metricsTab' && metricsClicked && totalDownloads > 0"
|
162
|
[url]=downloadsFrameUrl width="100%" height="250">
|
163
|
</i-frame>
|
164
|
</li>
|
165
|
|
166
|
<li class="uk-animation-fade" *ngFor="let tab of tabs; let i=index">
|
167
|
<publicationsTab *ngIf="i>0 && tab.content=='publicationsTab'"
|
168
|
[paramsForSearchLink]="paramsForSearchLink"
|
169
|
[fetchPublications] = "fetchPublications">
|
170
|
</publicationsTab>
|
171
|
<datasetsTab *ngIf="i>0 && tab.content=='datasetsTab'"
|
172
|
[paramsForSearchLink]="paramsForSearchLink"
|
173
|
[fetchDatasets]="fetchDatasets">
|
174
|
</datasetsTab>
|
175
|
|
176
|
<projectsTab *ngIf="i>0 && tab.content=='projectsTab'"
|
177
|
[paramsForSearchLink]="paramsForSearchLink"
|
178
|
[fetchProjects]="fetchProjects">
|
179
|
</projectsTab>
|
180
|
<datasourcesTab *ngIf="i>0 && tab.content=='datasourcesTab'"
|
181
|
[paramsForSearchLink]="paramsForSearchLink"
|
182
|
[fetchDataproviders]="fetchDataproviders">
|
183
|
</datasourcesTab>
|
184
|
<organizationsTab *ngIf="i>0 && tab.content=='organizationsTab'"
|
185
|
[organizations]="organizations">
|
186
|
</organizationsTab>
|
187
|
<relatedDatasourcesTab *ngIf="i>0 && tab.content=='relatedDatasourcesTab'"
|
188
|
[dataproviderId]="id"
|
189
|
[fetchResults]="fetchResultsAggregators"
|
190
|
[type]="relatedDataprovidersResultsType">
|
191
|
</relatedDatasourcesTab>
|
192
|
|
193
|
<!--statisticsTab *ngIf="i>0 && tab.content=='statisticsTab'"
|
194
|
[fetchPublications] = "fetchPublications"
|
195
|
[fetchDatasets]="fetchDatasets" [id]="id">
|
196
|
</statisticsTab-->
|
197
|
<div *ngIf="i>0 && tab.content=='statisticsTab' && statsClicked">
|
198
|
<div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert">
|
199
|
There are no statistics
|
200
|
</div>
|
201
|
<div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
|
202
|
<p>
|
203
|
The results below are discovered through our pilot algorithms.
|
204
|
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
|
205
|
</p>
|
206
|
<p class="uk-text-bold">Latest Documents Timeline</p>
|
207
|
<i-frame [url]=docsTimelineUrl width="800" height="350"></i-frame>
|
208
|
<p class="uk-text-bold">Documents Types</p>
|
209
|
<i-frame [url]=docsTypesUrl width="800" height="350"></i-frame>
|
210
|
</div>
|
211
|
|
212
|
|
213
|
<div *ngIf="(fetchPublications.searchUtils.totalResults > 0)">
|
214
|
<div>
|
215
|
<p class="uk-text-bold">Funders in Data Providers Publications</p>
|
216
|
<i-frame [url]=pubsFunderUrl width="800" height="350"></i-frame>
|
217
|
<p class="uk-text-bold">Projects with most Publications</p>
|
218
|
<i-frame [url]=pubsProjectsUrl width="800" height="350"></i-frame>
|
219
|
|
220
|
|
221
|
|
222
|
|
223
|
</div>
|
224
|
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)">
|
225
|
<div>
|
226
|
<p class="uk-text-bold">Projects with most Research Data</p>
|
227
|
<i-frame [url]=dataProjectsUrl width="800" height="350"></i-frame>
|
228
|
</div>
|
229
|
</div>
|
230
|
</div>
|
231
|
</div>
|
232
|
|
233
|
|
234
|
<metrics *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked"
|
235
|
[id]="id" [type]="'datasources'" [name]="name" (metricsResults)="metricsResults($event)">
|
236
|
</metrics>
|
237
|
<i-frame *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked && totalViews > 0"
|
238
|
[url]=viewsFrameUrl width="100%" height="250">
|
239
|
</i-frame>
|
240
|
<i-frame *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked && totalDownloads > 0"
|
241
|
[url]=downloadsFrameUrl width="100%" height="250">
|
242
|
</i-frame>
|
243
|
</li>
|
244
|
</ul>
|
245
|
`
|
246
|
})
|
247
|
|
248
|
export class TabsComponent {
|
249
|
|
250
|
@Input() id: string;
|
251
|
@Input() name: string;
|
252
|
@Input() resultsBy: string;
|
253
|
@Input() tabs: {"name": string, "content": string}[];
|
254
|
//@Input() publications;
|
255
|
//@Input() datasets;
|
256
|
@Input() statistics;
|
257
|
//@Input() projects;
|
258
|
//@Input() datasources;
|
259
|
@Input() organizations: {"name": string, "url": string}[];
|
260
|
|
261
|
@Input() _dataproviderService;
|
262
|
|
263
|
public relatedDataprovidersResultsType: string;
|
264
|
|
265
|
public paramsForSearchLink = {};//: string = "";
|
266
|
|
267
|
public reloadPublications: boolean = true;
|
268
|
public reloadDatasets: boolean = true;
|
269
|
public reloadProjects: boolean = true;
|
270
|
public reloadDataproviders: boolean = true;
|
271
|
public reloadRelatedDatasources: boolean = true;
|
272
|
public metricsClicked: boolean;
|
273
|
private viewsFrameUrl: string;
|
274
|
private downloadsFrameUrl: string;
|
275
|
private totalViews: number;
|
276
|
private totalDownloads: number;
|
277
|
|
278
|
public statsClicked: boolean = false;
|
279
|
private docsTimelineUrl: string;
|
280
|
private docsTypesUrl:string;
|
281
|
private pubsFunderUrl:string;
|
282
|
private dataProjectsUrl:string ;
|
283
|
private pubsProjectsUrl:string;
|
284
|
|
285
|
public fetchPublications : FetchPublications;
|
286
|
public fetchDatasets: FetchDatasets;
|
287
|
public fetchProjects: FetchProjects;
|
288
|
public fetchDataproviders: FetchDataproviders;
|
289
|
public fetchResultsAggregators: any;
|
290
|
|
291
|
private nativeElement : Node;
|
292
|
|
293
|
public routerHelper:RouterHelper = new RouterHelper();
|
294
|
|
295
|
private sub: any;
|
296
|
|
297
|
constructor (private renderer : Renderer, private element : ElementRef,private route: ActivatedRoute,
|
298
|
private _searchPublicationsService: SearchPublicationsService,
|
299
|
private _searchDatasetsService: SearchDatasetsService,
|
300
|
private _searchProjectsService: SearchProjectsService,
|
301
|
private _searchDataprovidersService: SearchDataprovidersService) {
|
302
|
this.fetchPublications = new FetchPublications(this._searchPublicationsService);
|
303
|
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
|
304
|
this.fetchProjects = new FetchProjects(this._searchProjectsService);
|
305
|
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
306
|
}
|
307
|
|
308
|
ngOnInit() {
|
309
|
this.sub = this.route.queryParams.subscribe(data => {
|
310
|
if(this.tabs != undefined && this.tabs.length > 0) {
|
311
|
this.reloadPublications = true;
|
312
|
this.reloadDatasets = true;
|
313
|
this.reloadProjects = true;
|
314
|
this.reloadDataproviders = true;
|
315
|
this.reloadRelatedDatasources = true;
|
316
|
this.statsClicked = false;
|
317
|
|
318
|
this.search(this.tabs[0].content, 1, 10);
|
319
|
this.count(1, 0);
|
320
|
|
321
|
this.metricsClicked = false;
|
322
|
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"dtsrcOpenAIRETimeline", "dtsrcName":"'+this.id+'", "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.id+'", "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';
|
323
|
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"dtsrcDownloadsTimeline","dtsrcName":"'+this.id+'","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';
|
324
|
|
325
|
this.docsTimelineUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcYear","dtsrcName":"'+this.id+'","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": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Documents"], "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=600&h=250';
|
326
|
this.docsTypesUrl = 'https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcPubs","dtsrcName":"'+this.id+'", "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": ["Documents"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
|
327
|
this.pubsFunderUrl =' https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcPubsFund","dtsrcName":"'+this.id+'", "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": ["Documents"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
|
328
|
this.dataProjectsUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcProjData","dtsrcName":"'+this.id+'", "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": ["Datasets"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
|
329
|
this.pubsProjectsUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcProjPubs","dtsrcName":"'+this.id+'", "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=600&h=250';
|
330
|
|
331
|
//if({"name": "Publications", "content": "publicationsTab"} in this.tabs) {
|
332
|
if(this.tabs.some(function (tab) {
|
333
|
return tab.name === 'Publications';
|
334
|
})) {
|
335
|
this.relatedDataprovidersResultsType = 'publications';
|
336
|
this.fetchResultsAggregators = new FetchPublications(this._searchPublicationsService);
|
337
|
} else {
|
338
|
this.relatedDataprovidersResultsType = 'datasets';
|
339
|
this.fetchResultsAggregators = new FetchDatasets(this._searchDatasetsService);
|
340
|
}
|
341
|
}
|
342
|
|
343
|
if(this.resultsBy == "collectedFrom") {
|
344
|
//this.paramsForSearchLink = "?collectedFrom="+this.id+"&co=and";
|
345
|
this.paramsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'co'], [this.id, 'and']);
|
346
|
} else if (this.resultsBy == "hostedBy") {
|
347
|
//this.paramsForSearchLink = "?hostedBy="+this.id+"&ho=and";
|
348
|
this.paramsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'ho'], [this.id, 'and']);
|
349
|
}
|
350
|
});
|
351
|
}
|
352
|
|
353
|
ngOnDestroy() {
|
354
|
//this.sub.unsubscribe();
|
355
|
}
|
356
|
|
357
|
// ngOnChanges() {
|
358
|
// console.info("on changes dataprovider tabs");
|
359
|
// if(this.tabs != undefined && this.tabs.length > 0) {
|
360
|
// /*if(typeof document !== undefined) {
|
361
|
// let element = document.getElementById(this.tabs[0].content);
|
362
|
// if(element != null) {
|
363
|
// element.className = "uk-active";
|
364
|
// element.setAttribute("aria-expanded", "true");
|
365
|
// }
|
366
|
//
|
367
|
// let element2 = document.getElementById("firstTab-content");
|
368
|
// if(element2 != null) {
|
369
|
// element2.className = "uk-active";
|
370
|
// element2.setAttribute("aria-hidden", "false");
|
371
|
// }
|
372
|
// }*/
|
373
|
//
|
374
|
// this.reloadPublications = true;
|
375
|
// this.reloadDatasets = true;
|
376
|
// this.reloadProjects = true;
|
377
|
// this.reloadDataproviders = true;
|
378
|
// this.reloadRelatedDatasources = true;
|
379
|
// this.statsClicked = false;
|
380
|
//
|
381
|
// this.search(this.tabs[0].content, 1, 10);
|
382
|
// this.count(1, 0);
|
383
|
//
|
384
|
// this.metricsClicked = false;
|
385
|
// this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"dtsrcOpenAIRETimeline", "dtsrcName":"'+this.id+'", "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.id+'", "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';
|
386
|
// this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"dtsrcDownloadsTimeline","dtsrcName":"'+this.id+'","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';
|
387
|
//
|
388
|
// this.docsTimelineUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcYear","dtsrcName":"'+this.id+'","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": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Documents"], "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=600&h=250';
|
389
|
// this.docsTypesUrl = 'https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcPubs","dtsrcName":"'+this.id+'", "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": ["Documents"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
|
390
|
// this.pubsFunderUrl =' https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcPubsFund","dtsrcName":"'+this.id+'", "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": ["Documents"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
|
391
|
// this.dataProjectsUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcProjData","dtsrcName":"'+this.id+'", "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": ["Datasets"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
|
392
|
// this.pubsProjectsUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcProjPubs","dtsrcName":"'+this.id+'", "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=600&h=250';
|
393
|
// }
|
394
|
//
|
395
|
// if(this.resultsBy == "collectedFrom") {
|
396
|
// this.paramsForSearchLink = "?collectedFrom="+this.id+"&co=and";
|
397
|
// } else if (this.resultsBy == "hostedBy") {
|
398
|
// this.paramsForSearchLink = "?hostedBy="+this.id+"&ho=and";
|
399
|
// }
|
400
|
// }
|
401
|
|
402
|
private count(page: number, size: number) {
|
403
|
console.info("number of tabs: "+this.tabs.length);
|
404
|
|
405
|
for(let i=1; i<this.tabs.length; i++) {
|
406
|
let content: string = this.tabs[i].content;
|
407
|
if(content=='publicationsTab') {
|
408
|
this.countPublications(page, size);
|
409
|
} else if(content=='datasetsTab') {
|
410
|
this.countDatasets(page, size);
|
411
|
} else if(content=='projectsTab') {
|
412
|
this.countProjects(page, size);
|
413
|
} else if(content=='datasourcesTab') {
|
414
|
this.countDatasources(page, size);
|
415
|
}// else if(content=='relatedDatasourcesTab') {
|
416
|
// this.countRelatedDatasources(page, size);
|
417
|
//}
|
418
|
}
|
419
|
}
|
420
|
|
421
|
private search(content: string, page: number, size: number) {
|
422
|
console.info(content);
|
423
|
if(content=='publicationsTab') {
|
424
|
this.searchPublications(page, size);
|
425
|
} else if(content=='datasetsTab') {
|
426
|
this.searchDatasets(page, size);
|
427
|
} else if(content=='projectsTab') {
|
428
|
this.searchProjects(page, size);
|
429
|
} else if(content=='datasourcesTab') {
|
430
|
this.searchDatasources(page, size);
|
431
|
} else if(content=='relatedDatasourcesTab') {
|
432
|
this.searchRelatedDatasources(1, 0);
|
433
|
} else if(content=='metricsTab') {
|
434
|
this.metricsClicked = true;
|
435
|
} else if(content=='statisticsTab') {
|
436
|
this.statsClicked = true;
|
437
|
}
|
438
|
}
|
439
|
|
440
|
private searchPublications(page: number, size: number) {
|
441
|
console.info("Search publications???");
|
442
|
if(this.reloadPublications) {
|
443
|
console.info("Search publications!");
|
444
|
|
445
|
this.fetchPublications.getResultsForDataproviders(this.id, this.resultsBy, page, size);
|
446
|
}
|
447
|
this.reloadPublications = false;
|
448
|
}
|
449
|
|
450
|
private countPublications(page: number, size: number) {
|
451
|
this.fetchPublications.getResultsForDataproviders(this.id, this.resultsBy, page, size);
|
452
|
}
|
453
|
|
454
|
private searchDatasets(page: number, size: number) {
|
455
|
if(this.reloadDatasets) {
|
456
|
this.fetchDatasets.getResultsForDataproviders(this.id, this.resultsBy, page, size);
|
457
|
}
|
458
|
this.reloadDatasets = false;
|
459
|
}
|
460
|
|
461
|
private countDatasets(page: number, size: number) {
|
462
|
this.fetchDatasets.getResultsForDataproviders(this.id, this.resultsBy, page, size);
|
463
|
}
|
464
|
|
465
|
private searchProjects(page: number, size: number) {
|
466
|
if(this.reloadProjects) {
|
467
|
this.fetchProjects.getResultsForDataproviders(this.id, page, size);
|
468
|
}
|
469
|
this.reloadProjects = false;
|
470
|
}
|
471
|
|
472
|
private countProjects(page: number, size: number) {
|
473
|
this.fetchProjects.getResultsForDataproviders(this.id, page, size);
|
474
|
}
|
475
|
|
476
|
private searchDatasources(page: number, size: number) {
|
477
|
console.info("search intro");
|
478
|
if(this.reloadDataproviders) {
|
479
|
|
480
|
this.fetchDataproviders.getResultsForDataproviders(this.id, page, size);
|
481
|
|
482
|
}
|
483
|
this.reloadDataproviders = false;
|
484
|
}
|
485
|
|
486
|
private countDatasources(page: number, size: number) {
|
487
|
this.fetchDataproviders.getResultsForDataproviders(this.id, page, size);
|
488
|
}
|
489
|
|
490
|
private searchRelatedDatasources(page: number, size: number) {
|
491
|
if(this.reloadRelatedDatasources) {
|
492
|
console.info("my id is: "+this.id);
|
493
|
this.fetchResultsAggregators.getAggregatorResults(this.id, page, size);
|
494
|
}
|
495
|
this.reloadRelatedDatasources = false;
|
496
|
}
|
497
|
|
498
|
private countRelatedDatasources(page: number, size: number) {
|
499
|
this.fetchResultsAggregators.getAggregatorResults(this.id, page, size);
|
500
|
}
|
501
|
|
502
|
public metricsResults($event) {
|
503
|
this.totalViews = $event.totalViews;
|
504
|
this.totalDownloads = $event.totalDownloads;
|
505
|
}
|
506
|
}
|