diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 063adce6..c8ffed44 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -8,7 +8,6 @@ import {HomeComponent} from './home/home.component'; import {LinkingComponent} from './claimPages/linking/linking.component'; import {LinkingHomeComponent} from './claimPages/linking/linkingHome.component'; import {MyClaimsComponent} from './claimPages/myClaims/myClaims.component'; - import {ProjectComponent} from './landingPages/project/project.component'; import {PublicationComponent} from './landingPages/publication/publication.component'; @@ -66,11 +65,9 @@ import 'rxjs/Rx'; @RouteConfig([ { path: '/', component: HomeComponent, name: 'Home', useAsDefault: true }, { path: '/home', component: HomeComponent, name: 'Home' }, -// { path: '/demo', component: Demo, name: 'Demo' }, { path: '/claims', component: ClaimsAdminComponent, name: 'Claims' }, { path: '/claim', component: ClaimComponent, name: 'Claim' }, { path: '/search', component: SearchComponent, name: 'Search' }, - // { path: '/upload', component: BasicProgressbar, name: 'Upload' }, { path: '/linking', component: LinkingComponent, name: 'Linking' }, { path: '/my-claims', component: MyClaimsComponent, name: 'MyClaims' }, { path: '/project', component: ProjectComponent, name: 'Project' }, diff --git a/src/app/claimPages/claims/claims.component.html b/src/app/claimPages/claims/claims.component.html index 5035f830..12c487b3 100644 --- a/src/app/claimPages/claims/claims.component.html +++ b/src/app/claimPages/claims/claims.component.html @@ -11,9 +11,7 @@ --> - +
@@ -70,6 +68,7 @@
+
No entries found.
@@ -89,14 +88,11 @@ - - + - + - - + {{claim.userMail}} {{claim.date}} diff --git a/src/app/claimPages/inlineClaimContext/inlineClaimContext.component.ts b/src/app/claimPages/inlineClaimContext/inlineClaimContext.component.ts new file mode 100644 index 00000000..d4f7fc83 --- /dev/null +++ b/src/app/claimPages/inlineClaimContext/inlineClaimContext.component.ts @@ -0,0 +1,112 @@ +import {Component, Input} from '@angular/core'; +import {JSONP_PROVIDERS} from '@angular/http'; +import {Observable} from 'rxjs/Observable'; +import { RouteParams, RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated'; +import {ClaimContextComponent} from '../linking/claimContext/claimContext.component'; +import {ClaimSelectedComponent} from '../linking/selected/selected.component'; +import {ClaimInsertComponent} from '../linking/insertClaim/insertClaim.component'; + +@Component({ + selector: 'inline-claim-context', + directives: [ROUTER_DIRECTIVES, ClaimContextComponent, ClaimSelectedComponent, ClaimInsertComponent], + template: ` + + + +
+
Find Context:
+
+ + +
+
+ + +
+ + +
+ + + +` + +}) + export class InlineClaimContextComponent { + constructor ( private _router: Router ) { + + } + + @Input() public inlineEntity:any; + @Input() public inlineType:string; + + + contexts=[]; + publications; + datasets; + show = "context"; + keyword: string = ""; + + ngOnInit() { + + } + next(){ + if(this.inlineType === 'dataset'){ + this.datasets = []; + this.datasets.push(this.inlineEntity[0]); + }else if(this.inlineType === 'publication'){ + this.publications = []; + this.publications.push(this.inlineEntity[0]); + console.info(" result: :targetId: " +this.publications[0].id + "targetType :"+ this.publications[0].type+" targetCollectedFrom:"+ this.publications[0].source+ "targetAccessRights :"+this.publications[0].accessRights+ " targetEmbargoEndDate:"+this.publications[0].embargoEndDate); + } + if( this.show == 'context'){ + this.show='claim'; + } + } + prev(){ + if(this.show == 'claim'){ + this.show = 'context'; + } + } + + + contextsChange($event) { + this.contexts=$event.value; + console.log($event.value); + } + + showChange($event) { + this.show=$event.value; + if(this.show == "end"){ + this.contexts = []; + this.show = "context"; + } + } + +} diff --git a/src/app/claimPages/inlineClaimProject/inlineClaimProject.component.ts b/src/app/claimPages/inlineClaimProject/inlineClaimProject.component.ts new file mode 100644 index 00000000..614ba41e --- /dev/null +++ b/src/app/claimPages/inlineClaimProject/inlineClaimProject.component.ts @@ -0,0 +1,159 @@ +import {Component, Input, ViewChild, Output, EventEmitter} from '@angular/core'; +import {JSONP_PROVIDERS} from '@angular/http'; +import {Observable} from 'rxjs/Observable'; +import { RouteParams, RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated'; +import {ClaimProjectsComponent} from '../linking/claimProject/claimProject.component'; +import {ClaimSelectedComponent} from '../linking/selected/selected.component'; +import {ClaimInsertComponent} from '../linking/insertClaim/insertClaim.component'; + +@Component({ + selector: 'inline-claim-project', + directives: [ROUTER_DIRECTIVES, ClaimProjectsComponent, ClaimSelectedComponent, ClaimInsertComponent], + template: ` + + +
+
Search for Projects:
+
+ + + +
+ + + + +
+ + + +` + +}) + export class InlineClaimProjectComponent { + constructor ( private _router: Router ) { + + } + + @Input() public inlineEntity:any; + @Input() public inlineType:string; + + + projects=[]; + publications; + datasets; + private show = 'project'; + private showComp:boolean = false; + private enableButton:boolean=true; + keyword: string = ""; + + @Output() projectAdded = new EventEmitter(); + +@ViewChild (ClaimInsertComponent) claimInsert : ClaimInsertComponent ; + ngOnInit() { + + } + next(){ + if(this.inlineType === 'dataset'){ + this.datasets = []; + this.datasets.push(this.inlineEntity[0]); + }else if(this.inlineType === 'publication'){ + this.publications = []; + this.publications.push(this.inlineEntity[0]); + console.info(" result: :targetId: " +this.publications[0].id + "targetType :"+ this.publications[0].type+" targetCollectedFrom:"+ this.publications[0].source+ "targetAccessRights :"+this.publications[0].accessRights+ " targetEmbargoEndDate:"+this.publications[0].embargoEndDate); + } + if( this.show == 'context'){ + this.show='claim'; + } + } + prev(){ + if(this.show == 'claim'){ + this.show = 'context'; + } + } + + + projectsChange($event) { + this.projects=$event.value; + console.log($event.value); + } + + showChange($event) { + this.show=$event.value; + if(this.show == "end"){ + //TODO + this.projectAdded.emit({ + value: this.projects + }); + this.projects = []; + this.hideComponent(); + + }else if(this.show == "error"){ + this.showComponent(); + } + } + public toggle(){ + console.info("TOOGLE pr "); + if(!this.showComp){ + console.info("TOOGLE show "); + this.showComponent(); + }else{ + console.info("TOOGLE hide "); + this.hideComponent(); + } + } + private showComponent(){ + this.showComp=true; + this.enableButton = true; + + } + private hideComponent(){ + this.showComp=false; + } + private insert(){ + this.claimInsert.publications = []; + this.claimInsert.publications.push(this.inlineEntity[0]); + this.publications = []; + this.publications.push(this.inlineEntity[0]); + console.info(" result: :targetId: " +this.publications[0].id + "targetType :"+ this.publications[0].type+" targetCollectedFrom:"+ this.publications[0].source+ "targetAccessRights :"+this.publications[0].accessRights+ " targetEmbargoEndDate:"+this.publications[0].embargoEndDate); + this.enableButton = false; + this.claimInsert.insert(); + + } + private cancel(){ + this.projects = []; + + this.hideComponent(); + } +} diff --git a/src/app/claimPages/linking/claimProject/claimProject.component.ts b/src/app/claimPages/linking/claimProject/claimProject.component.ts index af9f4c1e..2aa35619 100644 --- a/src/app/claimPages/linking/claimProject/claimProject.component.ts +++ b/src/app/claimPages/linking/claimProject/claimProject.component.ts @@ -16,8 +16,8 @@ import {Loading} from '../../../common/modal/loading.component'; -->
-
-
+
+
@@ -28,7 +28,7 @@ import {Loading} from '../../../common/modal/loading.component';
- +
@@ -67,6 +67,7 @@ export class ClaimProjectsComponent { this.getFunders(); } +@Input() public inline= 'false' ; // for claimed started from landing pages public query = ''; public filteredList = []; @Input() public selectedProjects=[] ; @@ -82,7 +83,7 @@ public projects:string[]; public warningMessage = ""; public infoMessage = ""; -@ViewChild (Loading) loading : Loading ; +// @ViewChild (Loading) loading : Loading ; constructor(private _projectService: OpenaireProjectsService,myElement: ElementRef) { @@ -100,16 +101,16 @@ filter() { }else{ this.warningMessage = ""; this.infoMessage = ""; - this.loading.open(); + // this.loading.open(); this._projectService.searchForProjects(this.query, this.selectedFunderId).subscribe( data => { this.filteredList =(data == null)?[]:data; this.infoMessage = (data == null)?"No Results found":""; - this.loading.close(); + // this.loading.close(); }, err => { console.error(err); - this.loading.close(); + // this.loading.close(); this.warningMessage = "An error occured"; } diff --git a/src/app/claimPages/linking/insertClaim/insertClaim.component.ts b/src/app/claimPages/linking/insertClaim/insertClaim.component.ts index eadce319..17ac74c8 100644 --- a/src/app/claimPages/linking/insertClaim/insertClaim.component.ts +++ b/src/app/claimPages/linking/insertClaim/insertClaim.component.ts @@ -12,7 +12,7 @@ import {Loading} from '../../../common/modal/loading.component'; directives: [...ROUTER_DIRECTIVES, Loading], template: ` - +
@@ -30,12 +30,13 @@ export class ClaimInsertComponent { } - @Input() contexts=[]; - @Input() projects=[]; - @Input() publications=[]; - @Input() datasets=[]; - + @Input() public contexts; + @Input() public projects; + @Input() public publications; + @Input() public datasets; + @Input() public showButton:string = 'false'; @Input() show='claim'; + @Input() inline='false'; @Output() showChange = new EventEmitter(); @ViewChild (Loading) loading : Loading ; @@ -45,69 +46,112 @@ export class ClaimInsertComponent { errorMessage = ""; claimsTODO:number = 0; claims:number = 0; + errorclaims:number = 0; insert(){ this.claiming = true; var user="argirok@di.uoa.gr" - if( this.datasets.length == 0 && this.publications.length == 0){ - this.errorMessage = "There are no publications or datasets selected."; - this.error = true; - }else if(this.contexts.length == 0 && this.projects.length == 0){ - this.errorMessage = "There are no projects or concepts to link."; - this.error = true; + if( this.datasets && this.datasets.length == 0 && this.publications && this.publications.length == 0){ + this.showError("There are no publications or datasets selected."); + }else if((!this.contexts|| this.contexts.length==0 )&&(!this.projects|| this.projects.length==0 )){ + this.showError("There are no projects or concepts to link."); + }else if((!this.publications|| this.publications.length==0 )&&(!this.datasets|| this.datasets.length==0 )){ + this.showError("There are no publications or datasets to link."); }else{ this.loading.open(); - for (var i = 0; i < this.publications.length; i++) { - var result=this.publications[i]; + if(this.publications){ + + for (var i = 0; i < this.publications.length; i++) { + + var result=this.publications[i]; + this.insertClaim(result,user); + + } + } + if(this.datasets){ + for (var i = 0; i < this.datasets.length; i++) { + var result=this.datasets[i]; this.insertClaim(result,user); - } - for (var i = 0; i < this.datasets.length; i++) { - var result=this.datasets[i]; - this.insertClaim(result,user); - + } } } } - claimInserted(){ + private claimInserted(){ this.claims+=1; if(this.claims == this.claimsTODO){ - this.show = "myclaims"; + this.show = "context"; this.loading.close(); - // this.showChange.emit({ - // value: this.show - // }); - this._router.navigate( ['MyClaims'] ); + if(this.inline == "true"){ + this.show = "end"; + }else{ + this._router.navigate( ['MyClaims'] ); + } + this.showChange.emit({ + value: this.show + }); } } - insertClaim(result:any, user:any){ - for (var j = 0; j < this.contexts.length; j++) { - var context=this.contexts[j]; - - var claim = { claimedBy : user, sourceId : context.concept.id, sourceType : "context", sourceCollectedFrom:"openaire", sourceAccessRights:"OPEN", sourceEmbargoEndDate:"", targetId : result.id , targetType : result.type, - targetCollectedFrom: result.source, targetAccessRights:result.accessRights, targetEmbargoEndDate:result.embargoEndDate}; - console.info("Trying to insert context - result relation: contextId: "+claim.sourceId +" resultId : " + claim.targetId + " "+ claim.targetEmbargoEndDate ); - this.claimsTODO +=1; - this.claimService.insertClaim(claim).subscribe( - data => { - this.claimInserted(); - }, - err => console.error(err) - ); + private showError(error:string){ + this.errorMessage = error; + this.error = true; + if(this.inline == "true"){ + this.show = "error"; + this.showChange.emit({ + value: this.show + }); } - for (var j = 0; j < this.projects.length; j++) { - var project=this.projects[j]; + } + private claimFailed(){ + this.errorMessage = "An Error Occured."; + this.errorclaims++; + if((this.claims+this.errorclaims) == this.claimsTODO){ + this.show = "context"; + this.loading.close(); + if(this.inline == "true"){ + this.show = "end"; + }else{ + this._router.navigate( ['MyClaims'] ); + } + this.showChange.emit({ + value: this.show + }); + } + } + insertClaim(result:any, user:any){ + if(this.contexts){ + for (var j = 0; j < this.contexts.length; j++) { + var context=this.contexts[j]; + var claim = { claimedBy : user, sourceId : context.concept.id, sourceType : "context", sourceCollectedFrom:"openaire", sourceAccessRights:"OPEN", sourceEmbargoEndDate:"no", targetId : result.id , targetType : result.type, targetCollectedFrom: result.source, targetAccessRights:result.accessRights, targetEmbargoEndDate:result.embargoEndDate}; + this.claimsTODO +=1; + this.claimService.insertClaim(claim).subscribe( + data => { + this.claimInserted(); + }, + err => { + console.error(err); + this.claimFailed(); + } + ); + } + } + if(this.projects){ + for (var j = 0; j < this.projects.length; j++) { + var project=this.projects[j]; - var claim = { claimedBy : user, sourceId : project.projectId, sourceType : "project", sourceCollectedFrom:"openaire", sourceAccessRights:"OPEN", sourceEmbargoEndDate:"", targetId : result.id , targetType : result.type, - targetCollectedFrom: result.source, targetAccessRights:result.accessRights, targetEmbargoEndDate:result.embargoEndDate}; - console.info("Trying to insert project - result relation: projectId: "+claim.sourceId +" resultId : " + claim.targetId + " "+ claim.targetEmbargoEndDate ); - this.claimsTODO +=1; - this.claimService.insertClaim(claim).subscribe( - data => { - this.claimInserted(); - }, - err => console.error(err) - ); + var claim = { claimedBy : user, sourceId : project.projectId, sourceType : "project", sourceCollectedFrom:"openaire", sourceAccessRights:"OPEN", sourceEmbargoEndDate:"", targetId : result.id , targetType : result.type, targetCollectedFrom: result.source, targetAccessRights:result.accessRights, targetEmbargoEndDate:result.embargoEndDate}; + console.info("Trying to insert project - result relation: projectId: "+claim.sourceId +" resultId : " + claim.targetId + " "+ claim.targetEmbargoEndDate ); + this.claimsTODO +=1; + this.claimService.insertClaim(claim).subscribe( + data => { + this.claimInserted(); + }, + err => { + console.error(err); + this.claimFailed(); + } + ); + } } } } diff --git a/src/app/claimPages/linking/selected/selected.component.ts b/src/app/claimPages/linking/selected/selected.component.ts index 51dd6e11..f76cdfcd 100644 --- a/src/app/claimPages/linking/selected/selected.component.ts +++ b/src/app/claimPages/linking/selected/selected.component.ts @@ -5,12 +5,29 @@ import {Component, Input,Output, EventEmitter} from '@angular/core'; template: `
+
-
+
  • Selected Concepts ({{(contexts.length)}}) - +
  • {{context.community }} > {{context.category}} > {{context.concept.label}} @@ -24,15 +41,15 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
-
+
  • Selected Projects ({{(projects.length)}}) - +
  • {{project.funderName}} | {{project.projectName}} {{(project.projectAcronym)?'('+project.projectAcronym+')':''}} - +
  • There are no projects
@@ -40,41 +57,15 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
- - -
+
    -
  • There are no Research Results
  • -
  • {{publications. length }} Selected Publications: - +
  • There are no Research Results
  • +
  • {{publications. length }} Selected Publications: +
  • @@ -99,7 +90,7 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
  • {{datasets.length}} Selected Research Data: - +
  • @@ -141,12 +132,15 @@ export class ClaimSelectedComponent { } - @Input() contexts=[]; - @Input() projects=[]; - @Input() publications=[]; - @Input() datasets=[]; + @Input() contexts; + @Input() projects; + @Input() publications; + @Input() datasets; @Input() showAccessRights=false; @Input() show='home'; + @Input() inline='false'; + @Input() inlineEntity; + @Input() inlineType; @Output() projectsChange = new EventEmitter(); @Output()publicationsChange = new EventEmitter(); @Output() datasetsChange = new EventEmitter(); diff --git a/src/app/common/pagingFormatter.component.ts b/src/app/common/pagingFormatter.component.ts index ff8a71ef..d3e591c1 100644 --- a/src/app/common/pagingFormatter.component.ts +++ b/src/app/common/pagingFormatter.component.ts @@ -7,7 +7,7 @@ import {Router, ROUTER_DIRECTIVES} from '@angular/router-deprecated'; selector: 'paging', template: `
    -
      +
      • diff --git a/src/app/common/pagingFormatterNoLoad.component.ts b/src/app/common/pagingFormatterNoLoad.component.ts index 560c46b4..88b056e2 100644 --- a/src/app/common/pagingFormatterNoLoad.component.ts +++ b/src/app/common/pagingFormatterNoLoad.component.ts @@ -7,7 +7,7 @@ import {Router, ROUTER_DIRECTIVES} from '@angular/router-deprecated'; selector: 'paging-no-load', template: `
        -
          +
          • diff --git a/src/app/landingPages/publication/publication.component.ts b/src/app/landingPages/publication/publication.component.ts index 9888e1ec..ecacbb0e 100644 --- a/src/app/landingPages/publication/publication.component.ts +++ b/src/app/landingPages/publication/publication.component.ts @@ -1,11 +1,11 @@ -import {Component} from '@angular/core'; +import {Component, ViewChild} from '@angular/core'; import {JSONP_PROVIDERS} from '@angular/http'; import {Observable} from 'rxjs/Observable'; import {PublicationService} from '../../services/publication.service'; import {PublicationInfo} from '../../entities/publicationInfo'; - import { RouteParams} from '@angular/router-deprecated'; - +import { InlineClaimContextComponent} from '../../claimPages/inlineClaimContext/inlineClaimContext.component'; +import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/inlineClaimProject.component'; @Component({ selector: 'publication', //directives: [...ROUTER_DIRECTIVES], @@ -13,183 +13,221 @@ import { RouteParams} from '@angular/router-deprecated';
            -
            -

            {{publicationInfo.title}}

            +
            +
            +

            {{publicationInfo.title}}

            +
            +
            -

            - {{publicationInfo.authors}} ({{publicationInfo.date}}) -

            -
            -
            Publisher:
            - {{publicationInfo.publisher}} -
            -
            -
            Journal:
            - {{publicationInfo.journal}} -
            -
            -
            Languages:
            - {{publicationInfo.languages}} -
            -
            -
            Types:
            - {{publicationInfo.types}} -
            -
            -
            Subjects:
            - {{publicationInfo.subjects}} -
            -
            -
            Identifiers:
            - - {{key}}: {{publicationInfo.identifiers.get(key)}} - -
            -
            -
            - {{publicationInfo.description}} -
            -
            + - -
            -
            -

            Collected from

            -
            + + + +
          • +
            +
            Download from
            +
            + + {{key}} + +
            +
            +
          • + + +
          • +
            +
            Funded By
            +
            + + {{key}} + +
            +
            + Add more Projects + +
          • +
          • + Add more Contexts + +
          • + +
          +
        +
+ +
+ `, - providers:[JSONP_PROVIDERS, PublicationService] + providers:[JSONP_PROVIDERS, PublicationService], + directives:[InlineClaimContextComponent, InlineClaimProjectComponent] }) + export class PublicationComponent { constructor (private _publicationService: PublicationService, private _routeParams: RouteParams) { console.info('publication constructor'); @@ -197,25 +235,65 @@ export class PublicationComponent { } ngOnInit() { console.info('publication init'); + // let result_ = {id: this.params.get("articleId"), type :"publication", source : "openaire", title:"lalalla",url: null, result: null, accessRights:"OPEN", embargoEndDate: null}; + // this.result.push(result_); this.getPublicationInfo(); } - results : String[]; - orcidresults : String[]; - resultsNum : number ; publicationInfo: PublicationInfo; params: RouteParams; +//AK - For the claims + private result ; + private claimInline:string = "none" ; + + @ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ; + @ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ; + + getPublicationInfo() { console.info("inside getPublicationInfo of component"); this._publicationService.getPublicationInfo(this.params.get("articleId")).subscribe( data => { this.publicationInfo = data; + //AK - For the claims + this.result = [] + let result_ ={id: this.params.get("articleId"), type :"publication", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestlicense, embargoEndDate: ''}; + this.result.push(result_); }, err => console.error(err) ); } + toggleClaimProject(){ + console.info("TOOGLE "); + this.inlineClaimProject.toggle(); + } + projectAdded($event){ + var projects =$event.value; + if(projects){ + for(var i=0; i < projects.length; i++){ + if(this.publicationInfo.fundedByProjects == undefined) { + this.publicationInfo.fundedByProjects = new Map(); + } + var project =projects[i]; + // this.publicationInfo.fundedByProjects.set(mydata.code, new Array()); + // this.publicationInfo.fundedByProjects.get(mydata.code)[0] = mydata.acronym; + // this.publicationInfo.fundedByProjects.get(mydata.code)[1] = mydata.title; + // var project= { funderId: this.selectedFunderId,funderName: this.selectedFunderName, projectId: item.field[0]['@value'], projectName: item.field[3]['@value'] , projectAcronym: item.field[1]['@value'] }; + + this.publicationInfo.fundedByProjects.set(project.projectId, new Array()); + this.publicationInfo.fundedByProjects.get(project.projectId)[0] = project.projectAcronym; + this.publicationInfo.fundedByProjects.get(project.projectId)[1] = project.projectName; + + // this.publicationInfo.fundedByProjects.get(mydata.code)[2] = mydata['funding']['funder'].shortname; + // this.publicationInfo.fundedByProjects.get(mydata.code)[3] = mydata['funding']['funder'].name; + this.publicationInfo.fundedByProjects.get(project.projectId)[2] =project.selectedFunderId; + this.publicationInfo.fundedByProjects.get(project.projectId)[3] = project.selectedFunderName; + + } + } + } } diff --git a/src/app/services/publication.service.ts b/src/app/services/publication.service.ts index 5c71879b..6f1c5389 100644 --- a/src/app/services/publication.service.ts +++ b/src/app/services/publication.service.ts @@ -75,13 +75,18 @@ export class PublicationService { this.publicationInfo.fundedByProjects = new Map(); } - this.publicationInfo.fundedByProjects.set(mydata.code, new Array()); - this.publicationInfo.fundedByProjects.get(mydata.code)[0] = mydata.acronym; - this.publicationInfo.fundedByProjects.get(mydata.code)[1] = mydata.title; + // this.publicationInfo.fundedByProjects.set(mydata.code, new Array()); + // this.publicationInfo.fundedByProjects.get(mydata.code)[0] = mydata.acronym; + // this.publicationInfo.fundedByProjects.get(mydata.code)[1] = mydata.title; + this.publicationInfo.fundedByProjects.set(mydata['to'].content, new Array()); + this.publicationInfo.fundedByProjects.get(mydata['to'].content)[0] = mydata.acronym; + this.publicationInfo.fundedByProjects.get(mydata['to'].content)[1] = mydata.title; if(mydata.hasOwnProperty("funding")) { if(mydata['funding'].hasOwnProperty("funder")) { - this.publicationInfo.fundedByProjects.get(mydata.code)[2] = mydata['funding']['funder'].shortname; - this.publicationInfo.fundedByProjects.get(mydata.code)[3] = mydata['funding']['funder'].name; + // this.publicationInfo.fundedByProjects.get(mydata.code)[2] = mydata['funding']['funder'].shortname; + // this.publicationInfo.fundedByProjects.get(mydata.code)[3] = mydata['funding']['funder'].name; + this.publicationInfo.fundedByProjects.get(mydata['to'].content)[2] = mydata['funding']['funder'].shortname; + this.publicationInfo.fundedByProjects.get(mydata['to'].content)[3] = mydata['funding']['funder'].name; } if(mydata['funding'].hasOwnProperty("funding_level_2")) { funding = mydata['funding']['funding_level_2'].content; @@ -93,10 +98,11 @@ export class PublicationService { if(funding != undefined) { funding = funding.split("::"); - this.publicationInfo.fundedByProjects.get(mydata.code)[4] = funding[1]; - + // this.publicationInfo.fundedByProjects.get(mydata.code)[4] = funding[1]; + this.publicationInfo.fundedByProjects.get(mydata['to'].content)[4] = funding[1]; for(let i=2; i