Bug fixed: Lazy routing disabled in datasources tab of dataprovider landing page (parameter lazy=false in searchResults page) | Organization landing page: added publications report (csv) | Organization landing page: query updated (more restricted, using /resources instead of /organizations) | comment onChanges function in tabs component of dataprovider landing page
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@46223 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
7b42fc135b
commit
9afdb70b52
|
@ -296,26 +296,7 @@ private nativeElement : Node;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnChanges() {
|
|
||||||
console.info("on changes dataprovider tabs");
|
|
||||||
if(this.tabs != undefined && this.tabs.length > 0) {
|
if(this.tabs != undefined && this.tabs.length > 0) {
|
||||||
/*if(typeof document !== undefined) {
|
|
||||||
let element = document.getElementById(this.tabs[0].content);
|
|
||||||
if(element != null) {
|
|
||||||
element.className = "uk-active";
|
|
||||||
element.setAttribute("aria-expanded", "true");
|
|
||||||
}
|
|
||||||
|
|
||||||
let element2 = document.getElementById("firstTab-content");
|
|
||||||
if(element2 != null) {
|
|
||||||
element2.className = "uk-active";
|
|
||||||
element2.setAttribute("aria-hidden", "false");
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
this.reloadPublications = true;
|
this.reloadPublications = true;
|
||||||
this.reloadDatasets = true;
|
this.reloadDatasets = true;
|
||||||
this.reloadProjects = true;
|
this.reloadProjects = true;
|
||||||
|
@ -335,6 +316,7 @@ private nativeElement : Node;
|
||||||
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';
|
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';
|
||||||
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';
|
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';
|
||||||
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';
|
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';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.resultsBy == "collectedFrom") {
|
if(this.resultsBy == "collectedFrom") {
|
||||||
|
@ -344,6 +326,51 @@ private nativeElement : Node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ngOnChanges() {
|
||||||
|
// console.info("on changes dataprovider tabs");
|
||||||
|
// if(this.tabs != undefined && this.tabs.length > 0) {
|
||||||
|
// /*if(typeof document !== undefined) {
|
||||||
|
// let element = document.getElementById(this.tabs[0].content);
|
||||||
|
// if(element != null) {
|
||||||
|
// element.className = "uk-active";
|
||||||
|
// element.setAttribute("aria-expanded", "true");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// let element2 = document.getElementById("firstTab-content");
|
||||||
|
// if(element2 != null) {
|
||||||
|
// element2.className = "uk-active";
|
||||||
|
// element2.setAttribute("aria-hidden", "false");
|
||||||
|
// }
|
||||||
|
// }*/
|
||||||
|
//
|
||||||
|
// this.reloadPublications = true;
|
||||||
|
// this.reloadDatasets = true;
|
||||||
|
// this.reloadProjects = true;
|
||||||
|
// this.reloadDataproviders = true;
|
||||||
|
// this.reloadRelatedDatasources = true;
|
||||||
|
// this.statsClicked = false;
|
||||||
|
//
|
||||||
|
// this.search(this.tabs[0].content, 1, 10);
|
||||||
|
// this.count(1, 0);
|
||||||
|
//
|
||||||
|
// this.metricsClicked = false;
|
||||||
|
// 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';
|
||||||
|
// 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';
|
||||||
|
//
|
||||||
|
// 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';
|
||||||
|
// 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';
|
||||||
|
// 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';
|
||||||
|
// 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';
|
||||||
|
// 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';
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if(this.resultsBy == "collectedFrom") {
|
||||||
|
// this.paramsForSearchLink = "?collectedFrom="+this.id+"&co=and";
|
||||||
|
// } else if (this.resultsBy == "hostedBy") {
|
||||||
|
// this.paramsForSearchLink = "?hostedBy="+this.id+"&ho=and";
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
private count(page: number, size: number) {
|
private count(page: number, size: number) {
|
||||||
console.info("number of tabs: "+this.tabs.length);
|
console.info("number of tabs: "+this.tabs.length);
|
||||||
|
|
||||||
|
|
|
@ -156,24 +156,26 @@
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
|
||||||
<ul *ngIf="organizationInfo.projects != undefined" class="uk-list uk-list-striped">
|
|
||||||
<li *ngFor="let key of organizationInfo.projects.keys()">
|
|
||||||
<!--a href="{{downloadURLAPI}}resources?size={{organizationInfo.projects.get(key).length}}&{{csvProjectParamsHead}}{{organizationInfo.projects.get(key)[0]['funderId']}}{{csvParamsTail}}">
|
|
||||||
Download projects report (CSV) for {{key}}
|
|
||||||
</a-->
|
|
||||||
<span class="clickable" (click)="downloadfile(downloadURLAPI+'resources?size='+organizationInfo.projects.get(key).length+'&'+csvProjectParamsHead+organizationInfo.projects.get(key)[0]['funderId']+csvParamsTail)">
|
|
||||||
<span aria-hidden="true" class="glyphicon glyphicon-download"></span>
|
|
||||||
<span class="uk-icon-download"> Projects report(CSV) for {{key}}</span>
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<!--li *ngFor="let key of organizationInfo.projects.keys()">
|
<ng-container *ngIf="organizationInfo.projects != undefined">
|
||||||
<a>
|
<li *ngFor="let key of organizationInfo.projects.keys()">
|
||||||
Download publications report (CSV) for {{key}}
|
<!--a href="{{downloadURLAPI}}resources?size={{organizationInfo.projects.get(key).length}}&{{csvProjectParamsHead}}{{organizationInfo.projects.get(key)[0]['funderId']}}{{csvParamsTail}}">
|
||||||
</a>
|
Download projects report (CSV) for {{key}}
|
||||||
</li-->
|
</a-->
|
||||||
</ul>
|
<span class="clickable" (click)="downloadfile(downloadURLAPI+'resources?size='+organizationInfo.projects.get(key).length+'&'+csvProjectParamsHead+organizationInfo.projects.get(key)[0]['funderId']+csvParamsTail)">
|
||||||
|
<span aria-hidden="true" class="glyphicon glyphicon-download"></span>
|
||||||
|
<span class="uk-icon-download"> Projects report(CSV) for {{key}}</span>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li *ngFor="let key of organizationInfo.projects.keys()">
|
||||||
|
<span class="clickable" (click)="downloadPublicationsFile(key)">
|
||||||
|
<span aria-hidden="true" class="glyphicon glyphicon-download"></span>
|
||||||
|
<span class="uk-icon-download"> Publications report(CSV) for {{key}}</span>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
</ng-container>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,9 +4,10 @@ import {ActivatedRoute} from '@angular/router';
|
||||||
import {OrganizationService} from '../../services/organization.service';
|
import {OrganizationService} from '../../services/organization.service';
|
||||||
import {OrganizationInfo} from '../../utils/entities/organizationInfo';
|
import {OrganizationInfo} from '../../utils/entities/organizationInfo';
|
||||||
import {ReportsService} from '../../services/reports.service';
|
import {ReportsService} from '../../services/reports.service';
|
||||||
import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
||||||
|
import {SearchPublicationsService} from '../../services/searchPublications.service';
|
||||||
|
|
||||||
import { SearchDataprovidersService } from '../../services/searchDataproviders.service';
|
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||||
|
|
||||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||||
|
|
||||||
|
@ -39,9 +40,10 @@ export class OrganizationComponent {
|
||||||
private linkToSearchDataproviders = "";
|
private linkToSearchDataproviders = "";
|
||||||
|
|
||||||
constructor (private _organizationService: OrganizationService,
|
constructor (private _organizationService: OrganizationService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private _searchDataprovidersService: SearchDataprovidersService,
|
private _searchDataprovidersService: SearchDataprovidersService,
|
||||||
private _reportsService: ReportsService) {
|
private _reportsService: ReportsService,
|
||||||
|
private _searchPublicationsService: SearchPublicationsService) {
|
||||||
|
|
||||||
console.info('organization constructor');
|
console.info('organization constructor');
|
||||||
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
||||||
|
@ -93,8 +95,11 @@ export class OrganizationComponent {
|
||||||
this.warningMessage = '';
|
this.warningMessage = '';
|
||||||
this.errorMessage=""
|
this.errorMessage=""
|
||||||
|
|
||||||
this._organizationService.getOrganizationInfo(this.organizationId).subscribe(
|
this._organizationService.getOrganizationInfo(this.organizationId).subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
if(data == null) {
|
||||||
|
this.errorMessage = 'No organization found';
|
||||||
|
} else {
|
||||||
this.organizationInfo = data;
|
this.organizationInfo = data;
|
||||||
|
|
||||||
let projectsNum = 0;
|
let projectsNum = 0;
|
||||||
|
@ -106,70 +111,112 @@ export class OrganizationComponent {
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
this.projectsNum = projectsNum;
|
this.projectsNum = projectsNum;
|
||||||
},
|
|
||||||
err => {
|
|
||||||
console.log(err)
|
|
||||||
|
|
||||||
this.errorMessage = 'No organization found';
|
|
||||||
}
|
}
|
||||||
);
|
},
|
||||||
}
|
err => {
|
||||||
|
console.log(err)
|
||||||
|
|
||||||
|
this.errorMessage = 'No organization found';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
private getMetrics() {
|
private getMetrics() {
|
||||||
console.info("getOrganizationMetrics: component");
|
console.info("getOrganizationMetrics: component");
|
||||||
this._organizationService.getMetrics(this.organizationId).subscribe(
|
this._organizationService.getMetrics(this.organizationId).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.metrics = data;
|
this.metrics = data;
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
private handleClick(funder: string) {
|
private handleClick(funder: string) {
|
||||||
if(this.emptyFundersSet) {
|
if(this.emptyFundersSet) {
|
||||||
this.fundersSet.clear();
|
this.fundersSet.clear();
|
||||||
this.emptyFundersSet = false;
|
this.emptyFundersSet = false;
|
||||||
}
|
|
||||||
|
|
||||||
if(this.fundersSet.has(funder)) {
|
|
||||||
this.fundersSet.delete(funder);
|
|
||||||
|
|
||||||
if(this.fundersSet.size == 0) {
|
|
||||||
this.organizationInfo.projects.forEach(function (value, key, map) {
|
|
||||||
this.fundersSet.add(key);
|
|
||||||
}.bind(this));
|
|
||||||
this.emptyFundersSet = true;
|
|
||||||
}
|
|
||||||
console.info(funder+" funder deleted");
|
|
||||||
} else {
|
|
||||||
this.fundersSet.add(funder);
|
|
||||||
console.info(funder+" funder added");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//private getProjectsData(key: string): any {
|
if(this.fundersSet.has(funder)) {
|
||||||
//return this.projectsData;
|
this.fundersSet.delete(funder);
|
||||||
//}
|
|
||||||
|
|
||||||
private searchDataproviders() {
|
if(this.fundersSet.size == 0) {
|
||||||
this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, 10);
|
this.organizationInfo.projects.forEach(function (value, key, map) {
|
||||||
this.linkToSearchDataproviders = OpenaireProperties.getLinkToAdvancedSearchDataProviders() + "?organization=" + this.organizationId + "&or=and";;
|
this.fundersSet.add(key);
|
||||||
}
|
}.bind(this));
|
||||||
|
this.emptyFundersSet = true;
|
||||||
private searchDataprovidersInit() {
|
|
||||||
if(this.subDataproviders == undefined && this.fetchDataproviders.searchUtils.totalResults > 0) {
|
|
||||||
this.subDataproviders = this.route.queryParams.subscribe(params => {
|
|
||||||
this.searchDataproviders();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
console.info(funder+" funder deleted");
|
||||||
|
} else {
|
||||||
|
this.fundersSet.add(funder);
|
||||||
|
console.info(funder+" funder added");
|
||||||
}
|
}
|
||||||
downloadfile(url:string){
|
}
|
||||||
console.log("Downloading file: "+ url);
|
|
||||||
this._reportsService.downloadCSVFile(url)
|
//private getProjectsData(key: string): any {
|
||||||
.subscribe(data => window.open(window.URL.createObjectURL(data)),
|
//return this.projectsData;
|
||||||
error => console.log("Error downloading the file."),
|
//}
|
||||||
() => console.log('Completed file download.'));
|
|
||||||
}
|
private searchDataproviders() {
|
||||||
|
this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, 10);
|
||||||
|
this.linkToSearchDataproviders = OpenaireProperties.getLinkToAdvancedSearchDataProviders() + "?organization=" + this.organizationId + "&or=and";;
|
||||||
|
}
|
||||||
|
|
||||||
|
private searchDataprovidersInit() {
|
||||||
|
if(this.subDataproviders == undefined && this.fetchDataproviders.searchUtils.totalResults > 0) {
|
||||||
|
this.subDataproviders = this.route.queryParams.subscribe(params => {
|
||||||
|
this.searchDataproviders();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadfile(url:string){
|
||||||
|
console.log("Downloading file: "+ url);
|
||||||
|
this._reportsService.downloadCSVFile(url)
|
||||||
|
.subscribe(data => window.open(window.URL.createObjectURL(data)),
|
||||||
|
error => console.log("Error downloading the file."),
|
||||||
|
() => console.log('Completed file download.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadPublicationsFile(funder: string){
|
||||||
|
console.log("Downloading publications file");
|
||||||
|
let response: string[] = [];
|
||||||
|
let totalResponse: string = "";
|
||||||
|
let counter: number = this.organizationInfo.projects.get(funder).length;
|
||||||
|
|
||||||
|
for(let project of this.organizationInfo.projects.get(funder)) {
|
||||||
|
this._searchPublicationsService.numOfEntityPublications(project.id, "projects/").subscribe(
|
||||||
|
data =>
|
||||||
|
{
|
||||||
|
let index: number = this.organizationInfo.projects.get(funder).indexOf(project);
|
||||||
|
|
||||||
|
let url: string;
|
||||||
|
if(index == 0) {
|
||||||
|
url = this.downloadURLAPI+"projects/"+project.id+"/publications?format=csv&size="+data;
|
||||||
|
} else {
|
||||||
|
url = this.downloadURLAPI+"projects/"+project.id+"/publications?format=csv-notitle&size="+data;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._reportsService.getCSVResponse(url).subscribe(
|
||||||
|
data =>
|
||||||
|
{
|
||||||
|
counter--;
|
||||||
|
|
||||||
|
response[index] = data;
|
||||||
|
|
||||||
|
if(counter == 0) {
|
||||||
|
for(let i=0; i<this.organizationInfo.projects.get(funder).length; i++) {
|
||||||
|
totalResponse += response[i]+"\n";
|
||||||
|
}
|
||||||
|
window.open(window.URL.createObjectURL(new Blob([totalResponse], { type: 'text/csv' })));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error => console.log("Error downloading the file."),
|
||||||
|
() => console.log('Completed file download.'));
|
||||||
|
},
|
||||||
|
error => console.log("Error getting number of publications for project."));
|
||||||
|
}//);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { LandingModule } from '../landing.module';
|
||||||
import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.module';
|
import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.module';
|
||||||
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
|
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
|
||||||
import {ReportsServiceModule} from '../../services/reportsService.module';
|
import {ReportsServiceModule} from '../../services/reportsService.module';
|
||||||
|
import {PublicationsServiceModule} from '../../services/publicationsService.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -20,7 +21,8 @@ import {ReportsServiceModule} from '../../services/reportsService.module';
|
||||||
SearchResultsModule,
|
SearchResultsModule,
|
||||||
DataProvidersServiceModule,
|
DataProvidersServiceModule,
|
||||||
ReportsServiceModule,
|
ReportsServiceModule,
|
||||||
OrganizationServiceModule
|
OrganizationServiceModule,
|
||||||
|
PublicationsServiceModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
OrganizationComponent
|
OrganizationComponent
|
||||||
|
|
|
@ -193,8 +193,9 @@
|
||||||
<li>
|
<li>
|
||||||
<div class="clickable" data-uk-toggle="{target:'#datasets_dynamic', animation:'uk-animation-fade'}">Dynamically incorporate research data in your site (HTML)</div>
|
<div class="clickable" data-uk-toggle="{target:'#datasets_dynamic', animation:'uk-animation-fade'}">Dynamically incorporate research data in your site (HTML)</div>
|
||||||
<div class="uk-vertical-align uk-hidden" id="datasets_dynamic">
|
<div class="uk-vertical-align uk-hidden" id="datasets_dynamic">
|
||||||
<button class="uk-float-right uk-icon-clipboard uk-button datasets_clipboard_btn" data-clipboard-target="#datasets_clipboard">
|
<button class="uk-float-right uk-button datasets_clipboard_btn" data-clipboard-target="#datasets_clipboard">
|
||||||
Copy to clipboard
|
Copy to clipboard
|
||||||
|
<i class="uk-icon-clipboard"></i>
|
||||||
</button>
|
</button>
|
||||||
<pre><code id="datasets_clipboard">{{datasets_dynamic}}</code></pre>
|
<pre><code id="datasets_clipboard">{{datasets_dynamic}}</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
@ -214,18 +215,19 @@
|
||||||
</export-->
|
</export-->
|
||||||
<span class="clickable" (click)="downloadfile(downloadURLAPI+'resources?'+csvParams+fetchPublications.searchUtils.totalResults)">
|
<span class="clickable" (click)="downloadfile(downloadURLAPI+'resources?'+csvParams+fetchPublications.searchUtils.totalResults)">
|
||||||
<span aria-hidden="true" class="glyphicon glyphicon-download"></span>
|
<span aria-hidden="true" class="glyphicon glyphicon-download"></span>
|
||||||
<span class="uk-icon-download">{{projectInfo.funder}} progress report (CSV)</span>
|
<i class="uk-icon-download"></i>
|
||||||
|
<span>{{projectInfo.funder}} progress report (CSV)</span>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i>
|
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i>
|
||||||
Link to research results
|
Link to research results
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="/deposit-publications">
|
<a href="/deposit-publications">
|
||||||
Deposit Publications
|
Deposit Publications
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -121,7 +121,6 @@ export class ProjectComponent{
|
||||||
datasets_clipboard = new Clipboard('.datasets_clipboard_btn');
|
datasets_clipboard = new Clipboard('.datasets_clipboard_btn');
|
||||||
}
|
}
|
||||||
|
|
||||||
console.info(this.fetchPublications.searchUtils.totalResults + " just before csv");
|
|
||||||
this.csvParams = "format=csv-special&page=0&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "+this.projectId+"))&size=";
|
this.csvParams = "format=csv-special&page=0&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "+this.projectId+"))&size=";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,11 +194,13 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody *ngFor="let key of publicationInfo.bioentities.keys()">
|
<tbody *ngFor="let key of publicationInfo.bioentities.keys()">
|
||||||
<tr *ngFor="let keyIn of publicationInfo.bioentities.get(key).keys()">
|
<tr *ngFor="let keyIn of publicationInfo.bioentities.get(key).keys()">
|
||||||
<td class="uk-text-center uk-icon-external-link" *ngIf="keyIn != undefined">
|
<td class="uk-text-center" *ngIf="keyIn != undefined">
|
||||||
<a href="{{publicationInfo.bioentities.get(key).get(keyIn)}}"
|
<span class="uk-icon-external-link">
|
||||||
target="_blank">
|
<a href="{{publicationInfo.bioentities.get(key).get(keyIn)}}"
|
||||||
{{keyIn}}
|
target="_blank">
|
||||||
</a>
|
{{keyIn}}
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="uk-text-center">
|
<td class="uk-text-center">
|
||||||
{{key}}
|
{{key}}
|
||||||
|
@ -220,10 +222,12 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let item of publicationInfo.software" class="uk-text-center">
|
<tr *ngFor="let item of publicationInfo.software" class="uk-text-center">
|
||||||
<td class="uk-icon-external-link">
|
<td>
|
||||||
<a href="{{item.url}}" target="_blank">
|
<span class="uk-icon-external-link">
|
||||||
{{item.name}}
|
<a href="{{item.url}}" target="_blank">
|
||||||
</a>
|
{{item.name}}
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -16,7 +16,8 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
||||||
<h4 class = "{{result.title.accessMode}} {{result.title.sc39}}" [title] = result.title.accessMode >
|
<h4 class = "{{result.title.accessMode}} {{result.title.sc39}}" [title] = result.title.accessMode >
|
||||||
<!--a href="{{result['title'].url}}"-->
|
<!--a href="{{result['title'].url}}"-->
|
||||||
<!--a [queryParams]="{articleId: 'od_______908::3a5b2885656a91307156325644e73b92'}" routerLinkActive="router-link-active" routerLink="search/publication"-->
|
<!--a [queryParams]="{articleId: 'od_______908::3a5b2885656a91307156325644e73b92'}" routerLinkActive="router-link-active" routerLink="search/publication"-->
|
||||||
<a *ngIf="lazy" [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}">
|
|
||||||
|
<a *ngIf="lazy=='true'" [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}">
|
||||||
<p *ngIf="result['title'].name != undefined && result['title'].name != ''"
|
<p *ngIf="result['title'].name != undefined && result['title'].name != ''"
|
||||||
[innerHTML]="result['title'].name">
|
[innerHTML]="result['title'].name">
|
||||||
</p>
|
</p>
|
||||||
|
@ -24,7 +25,8 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
||||||
{{result['title'].url}}
|
{{result['title'].url}}
|
||||||
</p>
|
</p>
|
||||||
</a>
|
</a>
|
||||||
<a *ngIf="!lazy" href="/search/{{type}}?{{urlParam}}={{result.id}}">
|
|
||||||
|
<a *ngIf="lazy=='false'" href="/search/{{type}}?{{urlParam}}={{result.id}}">
|
||||||
<p *ngIf="result['title'].name != undefined && result['title'].name != ''"
|
<p *ngIf="result['title'].name != undefined && result['title'].name != ''"
|
||||||
[innerHTML]="result['title'].name">
|
[innerHTML]="result['title'].name">
|
||||||
</p>
|
</p>
|
||||||
|
@ -143,7 +145,7 @@ export class SearchResultComponent {
|
||||||
@Input() type: string;
|
@Input() type: string;
|
||||||
@Input() urlParam: string;
|
@Input() urlParam: string;
|
||||||
@Input() showLoading: boolean = false;
|
@Input() showLoading: boolean = false;
|
||||||
@Input() lazy: boolean = true;
|
@Input() lazy: string = "true";
|
||||||
|
|
||||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
public routerHelper:RouterHelper = new RouterHelper();
|
public routerHelper:RouterHelper = new RouterHelper();
|
||||||
|
|
|
@ -17,8 +17,9 @@ export class OrganizationService {
|
||||||
|
|
||||||
getOrganizationInfo (id: string):any {
|
getOrganizationInfo (id: string):any {
|
||||||
console.info("getOrganizationInfo in service");
|
console.info("getOrganizationInfo in service");
|
||||||
|
//let url = OpenaireProperties. getSearchAPIURLLast()+'organizations/'+id+"?format=json";
|
||||||
let url = OpenaireProperties. getSearchAPIURLLast()+'organizations/'+id+"?format=json";
|
let url = OpenaireProperties.getSearchAPIURLLast()+'resources?format=json&query=( (oaftype exact organization) and (reldatasourcecompatibilityid=driver or reldatasourcecompatibilityid=driver-openaire2.0 or reldatasourcecompatibilityid=openaire2.0 or reldatasourcecompatibilityid=openaire3.0 or reldatasourcecompatibilityid=openaire2.0_data or reldatasourcecompatibilityid=hostedBy or relprojectid=*)) and ( objIdentifier ='+id+')';
|
||||||
|
//let url = "http://beta.services.openaire.eu:8480/search/rest/v2/api/resources?format=json&query=(%20(oaftype%20exact%20organization)%20and%20(reldatasourcecompatibilityid=driver%20or%20reldatasourcecompatibilityid=driver-openaire2.0%20or%20reldatasourcecompatibilityid=openaire2.0%20or%20reldatasourcecompatibilityid=openaire3.0%20or%20reldatasourcecompatibilityid=openaire2.0_data%20or%20reldatasourcecompatibilityid=hostedBy%20or%20relprojectid=*))%20and%20(%20objIdentifier%20=dedup_wf_001%3A%3Af1e63493def7cedfa5b497cdbea26faa)";
|
||||||
let key = url;
|
let key = url;
|
||||||
if (this._cache.has(key)) {
|
if (this._cache.has(key)) {
|
||||||
return Observable.of(this._cache.get(key)).map(res => this.parseOrganizationInfo(res));
|
return Observable.of(this._cache.get(key)).map(res => this.parseOrganizationInfo(res));
|
||||||
|
@ -26,8 +27,9 @@ export class OrganizationService {
|
||||||
|
|
||||||
return this.http.get(url)
|
return this.http.get(url)
|
||||||
.map(res => <any> res.json())
|
.map(res => <any> res.json())
|
||||||
.map(res => res['result']['metadata']['oaf:entity']['oaf:organization'])
|
.map(res => res['results'][0])
|
||||||
.map(res => [res, res['rels']['rel']])
|
//.map(res => res[0]['result']['metadata']['oaf:entity']['oaf:organization'])
|
||||||
|
//.map(res => [res, res['rels']['rel']])
|
||||||
.do(res => {
|
.do(res => {
|
||||||
this._cache.set(key, res);
|
this._cache.set(key, res);
|
||||||
})
|
})
|
||||||
|
@ -63,38 +65,45 @@ export class OrganizationService {
|
||||||
console.info("parseOrganizationInfo");
|
console.info("parseOrganizationInfo");
|
||||||
this.organizationInfo = new OrganizationInfo();
|
this.organizationInfo = new OrganizationInfo();
|
||||||
|
|
||||||
let mydata;
|
let organization;
|
||||||
|
let relations;
|
||||||
|
|
||||||
if(data[0] != null) {
|
if(data != null) {
|
||||||
mydata = data[0];
|
organization = data['result']['metadata']['oaf:entity']['oaf:organization'];
|
||||||
|
relations = data['result']['metadata']['oaf:entity']['oaf:organization']['rels']['rel'];
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if(mydata.hasOwnProperty("websiteurl")) {
|
if(organization != null) {
|
||||||
this.organizationInfo.title = {"name": mydata.legalshortname, "url": mydata.websiteurl};
|
|
||||||
|
if(organization.hasOwnProperty("websiteurl")) {
|
||||||
|
this.organizationInfo.title = {"name": organization.legalshortname, "url": organization.websiteurl};
|
||||||
} else {
|
} else {
|
||||||
this.organizationInfo.title = {"name": mydata.legalshortname, "url": ''};
|
this.organizationInfo.title = {"name": organization.legalshortname, "url": ''};
|
||||||
}
|
}
|
||||||
|
|
||||||
this.organizationInfo.name = mydata.legalname;
|
this.organizationInfo.name = organization.legalname;
|
||||||
|
|
||||||
if(this.organizationInfo.title.name == '') {
|
if(this.organizationInfo.title.name == '') {
|
||||||
this.organizationInfo.title.name = this.organizationInfo.name;
|
this.organizationInfo.title.name = this.organizationInfo.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mydata.hasOwnProperty("country")) {
|
if(organization.hasOwnProperty("country")) {
|
||||||
this.organizationInfo.country = mydata['country'].classname;
|
this.organizationInfo.country = organization['country'].classname;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data[1] != null) {
|
if(relations != null) {
|
||||||
let counter;
|
let counter;
|
||||||
let length = data[1].length!=undefined ? data[1].length : 1;
|
let length = relations.length!=undefined ? relations.length : 1;
|
||||||
|
|
||||||
for(let i=0; i<length; i++) {
|
for(let i=0; i<length; i++) {
|
||||||
mydata = data[1].length!=undefined ? data[1][i] : data[1];
|
let relation = relations.length!=undefined ? relations[i] : relations;
|
||||||
if(mydata.hasOwnProperty("to")) {
|
if(relation.hasOwnProperty("to")) {
|
||||||
if(mydata['to'].class == "isParticipant") {
|
if(relation['to'].class == "isParticipant") {
|
||||||
if(mydata.hasOwnProperty("funding")) {
|
if(relation.hasOwnProperty("funding")) {
|
||||||
if(mydata['funding'].hasOwnProperty("funder")) {
|
if(relation['funding'].hasOwnProperty("funder")) {
|
||||||
if(this.organizationInfo.projects == undefined) {
|
if(this.organizationInfo.projects == undefined) {
|
||||||
this.organizationInfo.projects = new Map<string,
|
this.organizationInfo.projects = new Map<string,
|
||||||
{ "name": string, "id": string, "code": string,
|
{ "name": string, "id": string, "code": string,
|
||||||
|
@ -103,48 +112,48 @@ export class OrganizationService {
|
||||||
"sc39": string, "startDate": string, "endDate": string }[]>();
|
"sc39": string, "startDate": string, "endDate": string }[]>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.organizationInfo.projects.has(mydata['funding']['funder'].name)) {
|
if(!this.organizationInfo.projects.has(relation['funding']['funder'].name)) {
|
||||||
this.organizationInfo.projects.set(mydata['funding']['funder'].name,
|
this.organizationInfo.projects.set(relation['funding']['funder'].name,
|
||||||
new Array<{ "name": string, "id": string, "code": string,
|
new Array<{ "name": string, "id": string, "code": string,
|
||||||
"acronym": string, "funder": string, "funderId": string,
|
"acronym": string, "funder": string, "funderId": string,
|
||||||
"fundingStream": string, "fundingLevel1": string, "fundingLevel2": string,
|
"fundingStream": string, "fundingLevel1": string, "fundingLevel2": string,
|
||||||
"sc39": string, "startDate": string, "endDate": string }>());
|
"sc39": string, "startDate": string, "endDate": string }>());
|
||||||
}
|
}
|
||||||
|
|
||||||
counter = this.organizationInfo.projects.get(mydata['funding']['funder'].name).length;
|
counter = this.organizationInfo.projects.get(relation['funding']['funder'].name).length;
|
||||||
this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter] =
|
this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter] =
|
||||||
{ "name": "", "id": "", "code": "",
|
{ "name": "", "id": "", "code": "",
|
||||||
"acronym": "", "funder": "", "funderId": "",
|
"acronym": "", "funder": "", "funderId": "",
|
||||||
"fundingStream": "", "fundingLevel1": "", "fundingLevel2": "",
|
"fundingStream": "", "fundingLevel1": "", "fundingLevel2": "",
|
||||||
"sc39": "", "startDate": "", "endDate": "" };
|
"sc39": "", "startDate": "", "endDate": "" };
|
||||||
|
|
||||||
//let url = "";
|
//let url = "";
|
||||||
if(mydata['to'].content != null && mydata['to'].content != "") {
|
if(relation['to'].content != null && relation['to'].content != "") {
|
||||||
this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['id'] = mydata['to'].content;
|
this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['id'] = relation['to'].content;
|
||||||
//url = OpenaireProperties.getsearchLinkToProject()+mydata['to'].content;
|
//url = OpenaireProperties.getsearchLinkToProject()+relation['to'].content;
|
||||||
}
|
}
|
||||||
this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['name'] = mydata.title;
|
this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['name'] = relation.title;
|
||||||
//this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['url'] = url;
|
//this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['url'] = url;
|
||||||
this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['code'] = mydata.code;
|
this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['code'] = relation.code;
|
||||||
this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['acronym'] = mydata.acronym;
|
this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['acronym'] = relation.acronym;
|
||||||
|
|
||||||
this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['funder'] = mydata['funding']['funder'].shortname;
|
this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['funder'] = relation['funding']['funder'].shortname;
|
||||||
this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['funderId'] = mydata['funding']['funder'].id;
|
this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['funderId'] = relation['funding']['funder'].id;
|
||||||
if(mydata['funding'].hasOwnProperty("funding_level_0")) {
|
if(relation['funding'].hasOwnProperty("funding_level_0")) {
|
||||||
this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['fundingStream'] = mydata['funding']['funding_level_0'].name;
|
this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['fundingStream'] = relation['funding']['funding_level_0'].name;
|
||||||
}
|
}
|
||||||
if(mydata['funding'].hasOwnProperty("funding_level_1")) {
|
if(relation['funding'].hasOwnProperty("funding_level_1")) {
|
||||||
this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['fundingLevel1'] = mydata['funding']['funding_level_1'].name;
|
this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['fundingLevel1'] = relation['funding']['funding_level_1'].name;
|
||||||
}
|
}
|
||||||
if(mydata['funding'].hasOwnProperty("funding_level_2")) {
|
if(relation['funding'].hasOwnProperty("funding_level_2")) {
|
||||||
this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['fundingLevel2'] = mydata['funding']['funding_level_2'].name;
|
this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['fundingLevel2'] = relation['funding']['funding_level_2'].name;
|
||||||
}
|
}
|
||||||
//this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['sc39'] =
|
//this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['sc39'] =
|
||||||
//this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['startDate'] =
|
//this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['startDate'] =
|
||||||
//this.organizationInfo.projects.get(mydata['funding']['funder'].name)[counter]['endDate'] =
|
//this.organizationInfo.projects.get(relation['funding']['funder'].name)[counter]['endDate'] =
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} /*else if(mydata['to'].class == "isProvidedBy") {
|
} /*else if(relation['to'].class == "isProvidedBy") {
|
||||||
if(this.organizationInfo.dataProviders == undefined) {
|
if(this.organizationInfo.dataProviders == undefined) {
|
||||||
this.organizationInfo.dataProviders = new Array<{ "name": string, "url": string, "type": string, "websiteUrl": string , "organizations": {"name": string, "url": string}[]}>();
|
this.organizationInfo.dataProviders = new Array<{ "name": string, "url": string, "type": string, "websiteUrl": string , "organizations": {"name": string, "url": string}[]}>();
|
||||||
}
|
}
|
||||||
|
@ -153,15 +162,15 @@ export class OrganizationService {
|
||||||
this.organizationInfo.dataProviders[counter] = { "name": "", "url": "", "type": "", "websiteUrl": "", "organizations": [] }
|
this.organizationInfo.dataProviders[counter] = { "name": "", "url": "", "type": "", "websiteUrl": "", "organizations": [] }
|
||||||
|
|
||||||
let url="";
|
let url="";
|
||||||
if(mydata['to'].content != null && mydata['to'].content != "") {
|
if(relation['to'].content != null && relation['to'].content != "") {
|
||||||
url = OpenaireProperties.getsearchLinkToDataProvider()+mydata['to'].content;
|
url = OpenaireProperties.getsearchLinkToDataProvider()+relation['to'].content;
|
||||||
}
|
}
|
||||||
this.organizationInfo.dataProviders[counter]['name'] = mydata.officialname;
|
this.organizationInfo.dataProviders[counter]['name'] = relation.officialname;
|
||||||
this.organizationInfo.dataProviders[counter]['url'] = url;
|
this.organizationInfo.dataProviders[counter]['url'] = url;
|
||||||
if(mydata.hasOwnProperty("datasourcetype")) {
|
if(relation.hasOwnProperty("datasourcetype")) {
|
||||||
this.organizationInfo.dataProviders[counter]['type'] = mydata['datasourcetype'].classname;
|
this.organizationInfo.dataProviders[counter]['type'] = relation['datasourcetype'].classname;
|
||||||
}
|
}
|
||||||
this.organizationInfo.dataProviders[counter]['websiteUrl'] = mydata.websiteurl;
|
this.organizationInfo.dataProviders[counter]['websiteUrl'] = relation.websiteurl;
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,16 @@ export class ReportsService {
|
||||||
return this.http.get(url)
|
return this.http.get(url)
|
||||||
.map(res => new Blob([res['_body']], { type: 'text/csv' }));
|
.map(res => new Blob([res['_body']], { type: 'text/csv' }));
|
||||||
}
|
}
|
||||||
|
getCSVResponse(url: string){
|
||||||
|
var headers = new Headers();
|
||||||
|
headers.append('responseType', 'arraybuffer');
|
||||||
|
return this.http.get(url)
|
||||||
|
.map(res => res['_body']);
|
||||||
|
}
|
||||||
downloadHTMLFile(url: string, info: string){
|
downloadHTMLFile(url: string, info: string){
|
||||||
var headers = new Headers();
|
var headers = new Headers();
|
||||||
headers.append('responseType', 'arraybuffer');
|
headers.append('responseType', 'arraybuffer');
|
||||||
return this.http.get(url)//.do(res => console.log(res['_body']))
|
return this.http.get(url)
|
||||||
.map(res => this.addInfo(res, info))
|
.map(res => this.addInfo(res, info))
|
||||||
.map(res => new Blob([res['_body']], { type: 'text/html' }))
|
.map(res => new Blob([res['_body']], { type: 'text/html' }))
|
||||||
.do(res => console.log(res))
|
.do(res => console.log(res))
|
||||||
|
|
|
@ -426,7 +426,8 @@ export class SearchPublicationsService {
|
||||||
}
|
}
|
||||||
return this.http.get(url)
|
return this.http.get(url)
|
||||||
.map(res => <any> res.json())
|
.map(res => <any> res.json())
|
||||||
.map(res => res.total).do(res => {
|
.map(res => res.total)
|
||||||
|
.do(res => {
|
||||||
this._cache.set(key, res);
|
this._cache.set(key, res);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,7 +123,6 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number)
|
||||||
this._searchPublicationsService.searchPublicationsForEntity(parameters, page, size).subscribe(
|
this._searchPublicationsService.searchPublicationsForEntity(parameters, page, size).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.searchUtils.totalResults = data[0];
|
this.searchUtils.totalResults = data[0];
|
||||||
console.info(this.searchUtils.totalResults + " i think we got results");
|
|
||||||
|
|
||||||
console.info("search Publications for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Publications for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
Loading…
Reference in New Issue