first draft for inline linking in publication landing page--- layout changes in publication landing page

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@43099 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2016-07-01 15:04:58 +00:00
parent eaa535e2a2
commit 1a04444e54
11 changed files with 667 additions and 280 deletions

View File

@ -8,7 +8,6 @@ import {HomeComponent} from './home/home.component';
import {LinkingComponent} from './claimPages/linking/linking.component'; import {LinkingComponent} from './claimPages/linking/linking.component';
import {LinkingHomeComponent} from './claimPages/linking/linkingHome.component'; import {LinkingHomeComponent} from './claimPages/linking/linkingHome.component';
import {MyClaimsComponent} from './claimPages/myClaims/myClaims.component'; import {MyClaimsComponent} from './claimPages/myClaims/myClaims.component';
import {ProjectComponent} from './landingPages/project/project.component'; import {ProjectComponent} from './landingPages/project/project.component';
import {PublicationComponent} from './landingPages/publication/publication.component'; import {PublicationComponent} from './landingPages/publication/publication.component';
@ -66,11 +65,9 @@ import 'rxjs/Rx';
@RouteConfig([ @RouteConfig([
{ path: '/', component: HomeComponent, name: 'Home', useAsDefault: true }, { path: '/', component: HomeComponent, name: 'Home', useAsDefault: true },
{ path: '/home', component: HomeComponent, name: 'Home' }, { path: '/home', component: HomeComponent, name: 'Home' },
// { path: '/demo', component: Demo, name: 'Demo' },
{ path: '/claims', component: ClaimsAdminComponent, name: 'Claims' }, { path: '/claims', component: ClaimsAdminComponent, name: 'Claims' },
{ path: '/claim', component: ClaimComponent, name: 'Claim' }, { path: '/claim', component: ClaimComponent, name: 'Claim' },
{ path: '/search', component: SearchComponent, name: 'Search' }, { path: '/search', component: SearchComponent, name: 'Search' },
// { path: '/upload', component: BasicProgressbar, name: 'Upload' },
{ path: '/linking', component: LinkingComponent, name: 'Linking' }, { path: '/linking', component: LinkingComponent, name: 'Linking' },
{ path: '/my-claims', component: MyClaimsComponent, name: 'MyClaims' }, { path: '/my-claims', component: MyClaimsComponent, name: 'MyClaims' },
{ path: '/project', component: ProjectComponent, name: 'Project' }, { path: '/project', component: ProjectComponent, name: 'Project' },

View File

@ -11,9 +11,7 @@
<button class="btn btn-default" type = "submit" (click)="goTo()">Fetch</button> <button class="btn btn-default" type = "submit" (click)="goTo()">Fetch</button>
</form> </form>
--> -->
<!--<div class="col-md-4">
<input type="text" #listFilter (keyup)="0" />
</div>-->
<!-- KI--> <!-- KI-->
<div class="row row-offcanvas row-offcanvas-right"> <div class="row row-offcanvas row-offcanvas-right">
@ -70,6 +68,7 @@
</div> </div>
<button class="btn btn-default" (click)="selectAll()">Select All</button> <button class="btn btn-default" (click)="deselectAll()">Deselect All</button> <button class="btn btn-default" (click)="confirmOpen()">Delete</button> <button class="btn btn-default" (click)="selectAll()">Select All</button> <button class="btn btn-default" (click)="deselectAll()">Deselect All</button> <button class="btn btn-default" (click)="confirmOpen()">Delete</button>
</div> </div>
<input type="text" #listFilter (keyup)="0" />
<div *ngIf=" claims && claims.length == 0" class = "alert alert-info " >No entries found.</div> <div *ngIf=" claims && claims.length == 0" class = "alert alert-info " >No entries found.</div>
@ -89,13 +88,10 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!--<tr *ngFor="let claim of claims | claimTextFilter:textFilter | claimTypeFilter:publicationCB:datasetCB:projectCB:contextCB " >-->
<tr *ngFor="let claim of claims " > <tr *ngFor="let claim of claims " >
<td *ngIf="enableDelete"><input [id]="claim.id" type="checkbox" (click)="select(claim,$event)" [ngModel]="selectAllClaims"/></td> <td *ngIf="enableDelete"><input [id]="claim.id" type="checkbox" (click)="select(claim,$event)" [ngModel]="selectAllClaims"/></td>
<!--<td><a (click)="goToClaim((claim.id))">{{claim.id}}</a></td>
<!--<td>{{claim.targetType}}</td> -->
<td><claim-entity [entity]="claim.target" [type]="claim.targetType" > </claim-entity></td> <td><claim-entity [entity]="claim.target" [type]="claim.targetType" > </claim-entity></td>
<!-- <td>{{claim.sourceType}}</td> -->
<td><claim-entity [entity]="claim.source" [type]="claim.sourceType" > </claim-entity></td> <td><claim-entity [entity]="claim.source" [type]="claim.sourceType" > </claim-entity></td>
<td>{{claim.userMail}}</td> <td>{{claim.userMail}}</td>
<td>{{claim.date}}</td> <td>{{claim.date}}</td>

View File

@ -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: `
<div class="panel-body" >
<h6>Find Context:</h6>
<div *ngIf=" show == 'context' " class="row" >
<claim-contexts [selectedList]="contexts" (contextsChange)="contextsChange($event)" > </claim-contexts>
<claim-selected [contexts]="contexts"
(contextsChange)="contextsChange($event)"
(showChange)="showChange($event)" [inlineEntity]="inlineEntity" inline="true" [inlineType]="inlineType" > </claim-selected>
</div>
<div *ngIf=" show == 'claim'" >
<claim-selected [contexts]="contexts" [inlineEntity]="inlineEntity" inline="true" [inlineType]="inlineType" > </claim-selected>
<claim-insert (showChange)="showChange($event)" inline="true" [contexts]="contexts" [publications]="publications" [datasets]="datasets" ></claim-insert>
</div>
<nav>
<ul class="pager">
<li *ngIf="show != 'context'" class="previous" (click)="prev()"><a ><span aria-hidden="true">&larr;</span> Previous</a></li>
<li class="next" *ngIf="show != 'claim'" (click)="next()" ><a >Next <span aria-hidden="true">&rarr;</span></a></li>
</ul>
</nav>
</div>
<!-- <h3>Find Context</h3>
<div *ngIf="show=='context'" >
<claim-contexts [selectedList]="contexts" (contextsChange)="contextsChange($event)" > </claim-contexts>
<h3>Link to</h3>
<claim-selected [contexts]="contexts"
(contextsChange)="contextsChange($event)"
(showChange)="showChange($event)" [inlineEntity]="inlineEntity" inline="true" [inlineType]="inlineType" > </claim-selected>
<button (click)="claim()" class="btn btn-primary" style="float:right">Finish</button>
</div>
<div *ngIf="show=='claim'" >
<claim-insert showAccessRights="true" [contexts]="contexts" [publications]="publications" [datasets]="datasets" ></claim-insert>
</div>-->
`
})
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";
}
}
}

View File

@ -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: `
<div *ngIf="showComp" class="panel-body well well-lg">
<h6>Search for Projects:</h6>
<div class="row" >
<claim-projects [selectedProjects]="projects" (projectsChange)="projectsChange($event)" inline="true" > </claim-projects>
<claim-selected [projects]="projects"
(projectsChange)="projectsChange($event)"
(showChange)="showChange($event)" [inlineEntity]="inlineEntity" inline="true" [inlineType]="inlineType" > </claim-selected>
</div>
<claim-insert (showChange)="showChange($event)" inline="true" [projects]="projects" [publications]="publications" [datasets]="datasets" showButtton="false" ></claim-insert>
<button (click)="insert()" [class]="(enableButton)?'btn btn-primary':'btn btn-primary disabled'" style="float:right">Finish </button>
<button (click)="cancel()" [class]="(enableButton)?'btn ':'btn disabled'" style="float:left">Cancel </button>
<!-- <div *ngIf=" show == 'claim'" >
<claim-selected [projects]="projects" [inlineEntity]="inlineEntity" inline="true" [inlineType]="inlineType" > </claim-selected>
<claim-insert (showChange)="showChange($event)" inline="true" [projects]="projects" [publications]="publications" [datasets]="datasets" showButtton="false" ></claim-insert>
</div>
<nav>
<ul class="pager">
<li *ngIf="show != 'context'" class="previous" (click)="prev()"><a ><span aria-hidden="true">&larr;</span> Previous</a></li>
<li class="next" *ngIf="show != 'claim'" (click)="next()" ><a >Next <span aria-hidden="true">&rarr;</span></a></li>
</ul>
</nav>
-->
</div>
<!-- <h3>Find Context</h3>
<div *ngIf="show=='context'" >
<claim-projects [selectedList]="contexts" (contextsChange)="contextsChange($event)" > </claim-contexts>
<h3>Link to</h3>
<claim-selected [contexts]="contexts"
(contextsChange)="contextsChange($event)"
(showChange)="showChange($event)" [inlineEntity]="inlineEntity" inline="true" [inlineType]="inlineType" > </claim-selected>
<button (click)="claim()" class="btn btn-primary" style="float:right">Finish</button>
</div>
<div *ngIf="show=='claim'" >
<claim-insert showAccessRights="true" [contexts]="contexts" [publications]="publications" [datasets]="datasets" ></claim-insert>
</div>-->
`
})
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();
}
}

View File

@ -16,8 +16,8 @@ import {Loading} from '../../../common/modal/loading.component';
</select> --> </select> -->
<form> <form>
<div class="input-group"> <div [class]="(inline =='false')?'input-group':''">
<div class="input-group-btn"> <div [class]="(inline =='false')?'input-group-btn':''" >
<button type="button" class="btn btn-info dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> <button type="button" class="btn btn-info dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
{{selectedFunderName}} {{selectedFunderName}}
</button> </button>
@ -28,7 +28,7 @@ import {Loading} from '../../../common/modal/loading.component';
</ul> </ul>
</div><!-- (keyup)=filter() *ngIf="selectedFunderId != '0'" --> </div><!-- (keyup)=filter() *ngIf="selectedFunderId != '0'" -->
<input id="community" type="text" class="form-control" placeholder="Search for Projects" [(ngModel)]=query > <input id="community" type="text" class="form-control" placeholder="Search for Projects" [(ngModel)]=query >
<span class="input-group-btn"> <span [class]="(inline =='false')?'input-group-btn':''" >
<button type="submit" (click)="filter()" class="btn btn-default">Search</button> <button type="submit" (click)="filter()" class="btn btn-default">Search</button>
</span> </span>
</div> </div>
@ -67,6 +67,7 @@ export class ClaimProjectsComponent {
this.getFunders(); this.getFunders();
} }
@Input() public inline= 'false' ; // for claimed started from landing pages
public query = ''; public query = '';
public filteredList = []; public filteredList = [];
@Input() public selectedProjects=[] ; @Input() public selectedProjects=[] ;
@ -82,7 +83,7 @@ public projects:string[];
public warningMessage = ""; public warningMessage = "";
public infoMessage = ""; public infoMessage = "";
@ViewChild (Loading) loading : Loading ; // @ViewChild (Loading) loading : Loading ;
constructor(private _projectService: OpenaireProjectsService,myElement: ElementRef) { constructor(private _projectService: OpenaireProjectsService,myElement: ElementRef) {
@ -100,16 +101,16 @@ filter() {
}else{ }else{
this.warningMessage = ""; this.warningMessage = "";
this.infoMessage = ""; this.infoMessage = "";
this.loading.open(); // this.loading.open();
this._projectService.searchForProjects(this.query, this.selectedFunderId).subscribe( this._projectService.searchForProjects(this.query, this.selectedFunderId).subscribe(
data => { data => {
this.filteredList =(data == null)?[]:data; this.filteredList =(data == null)?[]:data;
this.infoMessage = (data == null)?"No Results found":""; this.infoMessage = (data == null)?"No Results found":"";
this.loading.close(); // this.loading.close();
}, },
err => { err => {
console.error(err); console.error(err);
this.loading.close(); // this.loading.close();
this.warningMessage = "An error occured"; this.warningMessage = "An error occured";
} }

View File

@ -12,7 +12,7 @@ import {Loading} from '../../../common/modal/loading.component';
directives: [...ROUTER_DIRECTIVES, Loading], directives: [...ROUTER_DIRECTIVES, Loading],
template: ` template: `
<button *ngIf="claiming == false" (click)="insert()" class="btn btn-primary" style="float:right">Finish</button> <button *ngIf="claiming == false && showButton == 'true' " (click)="insert()" class="btn btn-primary" style="float:right">Finish</button>
<div *ngIf="error == true"> <div class="alert alert-warning" role="alert">{{errorMessage}}</div> <div *ngIf="error == true"> <div class="alert alert-warning" role="alert">{{errorMessage}}</div>
</div> </div>
<div *ngIf="claiming == true && claimsTODO > 0 && claimsTODO == claims" > <div *ngIf="claiming == true && claimsTODO > 0 && claimsTODO == claims" >
@ -30,12 +30,13 @@ export class ClaimInsertComponent {
} }
@Input() contexts=[]; @Input() public contexts;
@Input() projects=[]; @Input() public projects;
@Input() publications=[]; @Input() public publications;
@Input() datasets=[]; @Input() public datasets;
@Input() public showButton:string = 'false';
@Input() show='claim'; @Input() show='claim';
@Input() inline='false';
@Output() showChange = new EventEmitter(); @Output() showChange = new EventEmitter();
@ViewChild (Loading) loading : Loading ; @ViewChild (Loading) loading : Loading ;
@ -45,69 +46,112 @@ export class ClaimInsertComponent {
errorMessage = ""; errorMessage = "";
claimsTODO:number = 0; claimsTODO:number = 0;
claims:number = 0; claims:number = 0;
errorclaims:number = 0;
insert(){ insert(){
this.claiming = true; this.claiming = true;
var user="argirok@di.uoa.gr" var user="argirok@di.uoa.gr"
if( this.datasets.length == 0 && this.publications.length == 0){ if( this.datasets && this.datasets.length == 0 && this.publications && this.publications.length == 0){
this.errorMessage = "There are no publications or datasets selected."; this.showError("There are no publications or datasets selected.");
this.error = true; }else if((!this.contexts|| this.contexts.length==0 )&&(!this.projects|| this.projects.length==0 )){
}else if(this.contexts.length == 0 && this.projects.length == 0){ this.showError("There are no projects or concepts to link.");
this.errorMessage = "There are no projects or concepts to link."; }else if((!this.publications|| this.publications.length==0 )&&(!this.datasets|| this.datasets.length==0 )){
this.error = true; this.showError("There are no publications or datasets to link.");
}else{ }else{
this.loading.open(); this.loading.open();
if(this.publications){
for (var i = 0; i < this.publications.length; i++) { for (var i = 0; i < this.publications.length; i++) {
var result=this.publications[i]; var result=this.publications[i];
this.insertClaim(result,user); this.insertClaim(result,user);
} }
}
if(this.datasets){
for (var i = 0; i < this.datasets.length; i++) { for (var i = 0; i < this.datasets.length; i++) {
var result=this.datasets[i]; var result=this.datasets[i];
this.insertClaim(result,user); this.insertClaim(result,user);
} }
} }
}
} }
claimInserted(){ private claimInserted(){
this.claims+=1; this.claims+=1;
if(this.claims == this.claimsTODO){ if(this.claims == this.claimsTODO){
this.show = "myclaims"; this.show = "context";
this.loading.close(); this.loading.close();
// this.showChange.emit({ if(this.inline == "true"){
// value: this.show this.show = "end";
// }); }else{
this._router.navigate( ['MyClaims'] ); this._router.navigate( ['MyClaims'] );
} }
this.showChange.emit({
value: this.show
});
}
}
private showError(error:string){
this.errorMessage = error;
this.error = true;
if(this.inline == "true"){
this.show = "error";
this.showChange.emit({
value: this.show
});
}
}
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){ insertClaim(result:any, user:any){
if(this.contexts){
for (var j = 0; j < this.contexts.length; j++) { for (var j = 0; j < this.contexts.length; j++) {
var context=this.contexts[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};
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.claimsTODO +=1;
this.claimService.insertClaim(claim).subscribe( this.claimService.insertClaim(claim).subscribe(
data => { data => {
this.claimInserted(); this.claimInserted();
}, },
err => console.error(err) err => {
console.error(err);
this.claimFailed();
}
); );
} }
}
if(this.projects){
for (var j = 0; j < this.projects.length; j++) { for (var j = 0; j < this.projects.length; j++) {
var project=this.projects[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, 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};
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 ); console.info("Trying to insert project - result relation: projectId: "+claim.sourceId +" resultId : " + claim.targetId + " "+ claim.targetEmbargoEndDate );
this.claimsTODO +=1; this.claimsTODO +=1;
this.claimService.insertClaim(claim).subscribe( this.claimService.insertClaim(claim).subscribe(
data => { data => {
this.claimInserted(); this.claimInserted();
}, },
err => console.error(err) err => {
console.error(err);
this.claimFailed();
}
); );
} }
} }
}
} }

View File

@ -5,12 +5,29 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
template: ` template: `
<div [class]="(showAccessRights== 'true' )?'row':''" > <div [class]="(showAccessRights== 'true' )?'row':''" >
<!-- <div *ngIf=" inline == 'true'">
<div *ngIf=" inlineType == 'publication' " class="publication" >
<a *ngIf="inlineEntity[0].url" target="_blank" href="{{inlineEntity[0].url}}" >{{inlineEntity[0].title}}</a>
<span *ngIf="!inlineEntity[0].url" >{{inlineEntity[0].title}}</span>
</div>
<div *ngIf=" inlineType == 'dataset' " class="dataset" >
<a *ngIf="inlineEntity[0].url" target="_blank" href="{{inlineEntity[0].url}}" >{{inlineEntity[0].title}}</a>
<span *ngIf="!inlineEntity[0].url" >{{inlineEntity[0].title}}</span>
</div>
<div *ngIf=" inlineType == 'project' " class="project" >
<a *ngIf="inlineEntity[0].url" target="_blank" href="{{inlineEntity[0].url}}" >{{inlineEntity[0].title}}</a>
<span *ngIf="!inlineEntity[0].url" >{{inlineEntity[0].title}}</span>
<span >{{inlineEntity[0].funderName}} | {{inlineEntity[0].projectName}} {{(inlineEntity[0].projectAcronym)?'('+inlineEntity[0].projectAcronym+')':''}}</span>
</div>
<div>Link to </div>
</div> -->
<div [class]="(showAccessRights== 'true' )?'col-sm-6':''" > <div [class]="(showAccessRights== 'true' )?'col-sm-6':''" >
<div class="concepts" > <div *ngIf=" !(inline == 'true' && inlineType == 'context') && contexts" class="concepts" >
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item list-group-item-success">Selected Concepts ({{(contexts.length)}}) <li class="list-group-item list-group-item-success">Selected Concepts ({{(contexts.length)}})
<span title="Add More Concepts" (click)="showType('context')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span> <span *ngIf=" inline == 'false'" title="Add More Concepts" (click)="showType('context')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span>
</li> </li>
<li class="list-group-item" *ngFor="let context of contexts" > <li class="list-group-item" *ngFor="let context of contexts" >
<span >{{context.community }} > {{context.category}} > {{context.concept.label}} </span> <span >{{context.community }} > {{context.category}} > {{context.concept.label}} </span>
@ -24,10 +41,10 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
</div> </div>
<div [class]="(showAccessRights== 'true' )?'col-sm-6':''" > <div [class]="(showAccessRights== 'true' )?'col-sm-6':''" >
<div class="projects" > <div *ngIf=" !(inline == 'true' && inlineType == 'project') && projects " class="projects" >
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item list-group-item-info">Selected Projects ({{(projects.length)}}) <li class="list-group-item list-group-item-info">Selected Projects ({{(projects.length)}})
<span title="Add More Projects" (click)="showType('project')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span> <span *ngIf=" inline == 'false'" title="Add More Projects" (click)="showType('project')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span>
</li> </li>
<li class="list-group-item" *ngFor="let project of projects"> <li class="list-group-item" *ngFor="let project of projects">
@ -40,41 +57,15 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
</div> </div>
</div> </div>
<!--<div *ngIf="contexts.length == 0 " class="concepts" >
<ul class="list-group">
<li class="list-group-item list-group-item-success">Selected Concepts
<span title="Add More Concepts" (click)="showType('context')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span>
</li>
<li class="list-group-item">There are no contexts</li>
</ul>
</div>
<div *ngIf="projects.length == 0 " class="projects" >
<ul class="list-group">
<li class="list-group-item list-group-item-info">Selected Projects
<span title="Add More Projects" (click)="showType('project')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span>
</li>
<li class="list-group-item">There are no projects</li>
</ul>
</div>
<div *ngIf="publications.length == 0 && datasets.length == 0" class="results" > <div *ngIf=" !(inline == 'true' && (inlineType == 'publication' || inlineType == 'dataset' )) && (datasets || publications)" class="publications" >
<ul class="list-group">
<li class="list-group-item disabled">Selected Research Results
<span title="Add More Research Results" (click)="showType('result')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span>
</li>
<li class="list-group-item">There are no Research Results </li>
</ul>
</div>
-->
<div class="publications" >
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item panel-footer "> Research Results ({{(datasets.length+publications.length)}}) <li class="list-group-item panel-footer "> Research Results ({{(datasets.length+publications.length)}})
<span title="Add More Research Results" (click)="showType('result')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span> <span *ngIf=" inline == 'false'" title="Add More Research Results" (click)="showType('result')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span>
</li> </li>
<li *ngIf="publications.length == 0 && datasets.length == 0" class="list-group-item">There are no Research Results </li> <li *ngIf="publications && datasets && publications.length == 0 && datasets.length == 0" class="list-group-item">There are no Research Results </li>
<li *ngIf="publications.length > 0 || datasets.length > 0" class="list-group-item list-group-item-warning ">{{publications. length }} Selected Publications: <li *ngIf="(publications && publications.length > 0) ||(datasets && datasets.length > 0 ) " class="list-group-item list-group-item-warning ">{{publications. length }} Selected Publications:
<span title="Add More Publications" (click)="showType('publication')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span> <span *ngIf=" inline == 'false'" title="Add More Publications" (click)="showType('publication')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span>
</li> </li>
<li *ngFor="let pub of publications" class="list-group-item"> <li *ngFor="let pub of publications" class="list-group-item">
<span *ngIf="showAccessRights == 'true'" (click)="removePublication(pub)" aria-hidden="true" class="btn glyphicon glyphicon-remove"></span> <span *ngIf="showAccessRights == 'true'" (click)="removePublication(pub)" aria-hidden="true" class="btn glyphicon glyphicon-remove"></span>
@ -99,7 +90,7 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
<span *ngIf="showAccessRights != 'true'" (click)="removePublication(pub)" aria-hidden="true" class="btn glyphicon glyphicon-remove"></span> <span *ngIf="showAccessRights != 'true'" (click)="removePublication(pub)" aria-hidden="true" class="btn glyphicon glyphicon-remove"></span>
</li> </li>
<li *ngIf="publications.length > 0 || datasets.length > 0" class="list-group-item list-group-item-warning "> {{datasets.length}} Selected Research Data: <li *ngIf="publications.length > 0 || datasets.length > 0" class="list-group-item list-group-item-warning "> {{datasets.length}} Selected Research Data:
<span title="Add More Research Data" (click)="showType('dataset')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span> <span *ngIf=" inline == 'false'" title="Add More Research Data" (click)="showType('dataset')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span>
</li> </li>
<li *ngFor="let dataset of datasets" class="list-group-item"> <li *ngFor="let dataset of datasets" class="list-group-item">
<span *ngIf="showAccessRights == 'true'" (click)="removeDataset(dataset)" aria-hidden="true" class="btn glyphicon glyphicon-remove"></span> <span *ngIf="showAccessRights == 'true'" (click)="removeDataset(dataset)" aria-hidden="true" class="btn glyphicon glyphicon-remove"></span>
@ -141,12 +132,15 @@ export class ClaimSelectedComponent {
} }
@Input() contexts=[]; @Input() contexts;
@Input() projects=[]; @Input() projects;
@Input() publications=[]; @Input() publications;
@Input() datasets=[]; @Input() datasets;
@Input() showAccessRights=false; @Input() showAccessRights=false;
@Input() show='home'; @Input() show='home';
@Input() inline='false';
@Input() inlineEntity;
@Input() inlineType;
@Output() projectsChange = new EventEmitter(); @Output() projectsChange = new EventEmitter();
@Output()publicationsChange = new EventEmitter(); @Output()publicationsChange = new EventEmitter();
@Output() datasetsChange = new EventEmitter(); @Output() datasetsChange = new EventEmitter();

View File

@ -7,7 +7,7 @@ import {Router, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
selector: 'paging', selector: 'paging',
template: ` template: `
<div *ngIf=" ( getTotalPages() > 0 ) && (getTotalPages() > 1) && ( 0 < currentPage && currentPage <= getTotalPages() ) " > <div *ngIf=" ( getTotalPages() > 0 ) && (getTotalPages() > 1) && ( 0 < currentPage && currentPage <= getTotalPages() ) " >
<ul class="pagination"> <ul class="pagination pagination-sm">
<li *ngIf=" currentPage > 1" ><a (click)="onPage((1))" aria-label="Previous"> <li *ngIf=" currentPage > 1" ><a (click)="onPage((1))" aria-label="Previous">
<span aria-hidden="true">&laquo;</span></a></li> <span aria-hidden="true">&laquo;</span></a></li>

View File

@ -7,7 +7,7 @@ import {Router, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
selector: 'paging-no-load', selector: 'paging-no-load',
template: ` template: `
<div *ngIf=" ( getTotalPages() > 0 ) && (getTotalPages() > 1) && ( 0 < currentPage && currentPage <= getTotalPages() ) " > <div *ngIf=" ( getTotalPages() > 0 ) && (getTotalPages() > 1) && ( 0 < currentPage && currentPage <= getTotalPages() ) " >
<ul class="pagination"> <ul class="pagination pagination-sm">
<li *ngIf=" currentPage > 1" ><a (click)="onPage((1))" aria-label="Previous"> <li *ngIf=" currentPage > 1" ><a (click)="onPage((1))" aria-label="Previous">
<span aria-hidden="true">&laquo;</span></a></li> <span aria-hidden="true">&laquo;</span></a></li>

View File

@ -1,11 +1,11 @@
import {Component} from '@angular/core'; import {Component, ViewChild} from '@angular/core';
import {JSONP_PROVIDERS} from '@angular/http'; import {JSONP_PROVIDERS} from '@angular/http';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import {PublicationService} from '../../services/publication.service'; import {PublicationService} from '../../services/publication.service';
import {PublicationInfo} from '../../entities/publicationInfo'; import {PublicationInfo} from '../../entities/publicationInfo';
import { RouteParams} from '@angular/router-deprecated'; import { RouteParams} from '@angular/router-deprecated';
import { InlineClaimContextComponent} from '../../claimPages/inlineClaimContext/inlineClaimContext.component';
import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/inlineClaimProject.component';
@Component({ @Component({
selector: 'publication', selector: 'publication',
//directives: [...ROUTER_DIRECTIVES], //directives: [...ROUTER_DIRECTIVES],
@ -13,61 +13,59 @@ import { RouteParams} from '@angular/router-deprecated';
<div *ngIf="publicationInfo != null"> <div *ngIf="publicationInfo != null">
<div class="publication"> <div class="container publication">
<div class="container-header">
<h2>{{publicationInfo.title}}</h2> <h2>{{publicationInfo.title}}</h2>
</div>
<div class="row row-offcanvas row-offcanvas-right">
<div class="col-xs-6 col-sm-9 sidebar-offcanvas">
<p> <p>
{{publicationInfo.authors}} ({{publicationInfo.date}}) {{publicationInfo.authors}} ({{publicationInfo.date}})
</p> </p>
<div class="row" *ngIf="publicationInfo.publisher != undefined && publicationInfo.publisher != ''">
<div class="col-md-1"> Publisher: </div> <dl class="dl-horizontal">
<span>{{publicationInfo.publisher}}</span> <dt *ngIf="publicationInfo.publisher != undefined && publicationInfo.publisher != ''">Publisher: </dt>
</div> <dd *ngIf="publicationInfo.publisher != undefined && publicationInfo.publisher != ''">{{publicationInfo.publisher}}</dd>
<div class="row" *ngIf="publicationInfo.journal != undefined && publicationInfo.journal != ''"> <dt *ngIf="publicationInfo.journal != undefined && publicationInfo.journal != ''">Journal: </dt>
<div class="col-md-1"> Journal: </div> <dd *ngIf="publicationInfo.journal != undefined && publicationInfo.journal != ''">{{publicationInfo.journal}}</dd>
<span>{{publicationInfo.journal}}</span> <dt *ngIf="publicationInfo.languages != undefined && publicationInfo.languages != 'Undetermined' && publicationInfo.languages != ''"> Languages: </dt>
</div> <dd *ngIf="publicationInfo.languages != undefined && publicationInfo.languages != 'Undetermined' && publicationInfo.languages != ''">{{publicationInfo.languages}}</dd>
<div class="row" *ngIf="publicationInfo.languages != undefined && publicationInfo.languages != 'Undetermined' && publicationInfo.languages != ''"> <dt *ngIf="publicationInfo.types != undefined"> Types: </dt>
<div class="col-md-1"> Languages: </div> <dd *ngIf="publicationInfo.types != undefined">{{publicationInfo.types}}</dd>
<span>{{publicationInfo.languages}}</span>
</div> <dt *ngIf="publicationInfo.subjects != undefined"> Subjects: </dt>
<div class="row" *ngIf="publicationInfo.types != undefined"> <dd *ngIf="publicationInfo.subjects != undefined"> {{publicationInfo.subjects}} </dd>
<div class="col-md-1"> Types: </div> <dt *ngIf="publicationInfo.identifiers != undefined">Identifiers:</dt>
<span>{{publicationInfo.types}}</span> <dd>
</div> <ul class="list-inline">
<div class="row" *ngIf="publicationInfo.subjects != undefined"> <li *ngFor="let key of publicationInfo.identifiers.keys()">
<div class="col-md-1"> Subjects: </div> {{key}}: {{publicationInfo.identifiers.get(key)}} </li>
<span> {{publicationInfo.subjects}} </span> </ul>
</div> </dd>
<div class="row" *ngIf="publicationInfo.identifiers != undefined"> </dl>
<div class="col-md-1">Identifiers:</div>
<span *ngFor="let key of publicationInfo.identifiers.keys()">
{{key}}: {{publicationInfo.identifiers.get(key)}}
</span>
</div>
<div >
<blockquote> <blockquote>
{{publicationInfo.description}} {{publicationInfo.description}}
</blockquote> </blockquote>
</div>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#citationsTab">References</a></li> <li class="active"><a data-toggle="tab" href="#citationsTab">References</a></li>
<li><a data-toggle="tab" href="#dataTab">Related Research Data</a></li> <li role="presentation"><a data-toggle="tab" href="#dataTab">Related Research Data</a></li>
<li><a data-toggle="tab" href="#similarTab">Similar Publications</a></li> <li role="presentation"><a data-toggle="tab" href="#similarTab">Similar Publications</a></li>
<li><a data-toggle="tab" href="#bioentitiesTab">Bioentities</a></li> <li role="presentation" *ngIf="publicationInfo.bioentities != undefined"><a data-toggle="tab" href="#bioentitiesTab">Bioentities</a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div id="citationsTab" class="tab-pane fade in active panel-body">
<div id="citationsTab" class="tab-pane fade in active"> <div *ngIf="publicationInfo.references == undefined" class = "alert alert-info " >
<h3>REFERENCES</h3> There are no references
</div>
<div *ngIf="publicationInfo.references != undefined"> <div *ngIf="publicationInfo.references != undefined" >
<div *ngFor="let item of publicationInfo.references"> <div *ngFor="let item of publicationInfo.references">
<div *ngIf="item != undefined"> <p *ngIf=" item != undefined &&item['url'] != undefined">
<p *ngIf="item['url'] != undefined">
<a class="custom-external" href="{{item['url']}}" target="_blank"> <a class="custom-external" href="{{item['url']}}" target="_blank">
{{item['text']}} {{item['text']}}
</a> </a>
@ -77,20 +75,20 @@ import { RouteParams} from '@angular/router-deprecated';
</p> </p>
</div> </div>
</div> </div>
</div>
</div> </div>
<div id="dataTab" class="tab-pane fade"> <div id="dataTab" class="tab-pane fade panel-body">
<h3>RELATED RESEARCH DATA</h3> <div *ngIf="publicationInfo.relatedResearchData == undefined" class = "alert alert-info " >
There are no related research data
<table id="inferredTable"> </div>
<table *ngIf="publicationInfo.relatedResearchData != undefined" id="inferredTable" class="table table-striped">
<thead> <thead>
<tr role="row"> <tr role="row">
<th>Title</th> <th>Title</th>
<th>Trust</th> <th>Trust</th>
</tr> </tr>
</thead> </thead>
<tbody *ngIf="publicationInfo.relatedResearchData != undefined"> <tbody>
<tr *ngFor="let key of publicationInfo.relatedResearchData.keys()"> <tr *ngFor="let key of publicationInfo.relatedResearchData.keys()">
<td *ngIf="key != undefined"> <td *ngIf="key != undefined">
<a class="custom-external" href="{{key}}" target="_blank"> <a class="custom-external" href="{{key}}" target="_blank">
@ -111,16 +109,19 @@ import { RouteParams} from '@angular/router-deprecated';
</table> </table>
</div> </div>
<div id="similarTab" class="tab-pane fade">
<h3>SIMILAR PUBLICATIONS</h3> <div id="similarTab" class="tab-pane fade panel-body">
<table id="similarTable"> <div *ngIf="publicationInfo.similarPublications == undefined" class = "alert alert-info " >
There are no similar publications
</div>
<table *ngIf="publicationInfo.similarPublications != undefined" id="similarTable" class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>Title</th> <th>Title</th>
<th>Trust</th> <th>Trust</th>
</tr> </tr>
</thead> </thead>
<tbody *ngIf="publicationInfo.similarPublications != undefined"> <tbody >
<tr *ngFor="let key of publicationInfo.similarPublications.keys()"> <tr *ngFor="let key of publicationInfo.similarPublications.keys()">
<td *ngIf="key != undefined"> <td *ngIf="key != undefined">
<a class="custom-external" href="{{key}}" target="_blank"> <a class="custom-external" href="{{key}}" target="_blank">
@ -135,12 +136,12 @@ import { RouteParams} from '@angular/router-deprecated';
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<div id="bioentitiesTab" class="tab-pane fade"> <div *ngIf="publicationInfo.bioentities != undefined" id="bioentitiesTab" class="tab-pane fade panel-body">
<h3>BIOENTITIES</h3> <table id="bioentitiesTable" class="table table-striped">
<table id="bioentitiesTable">
<thead> <thead>
<tr> <tr>
<th>Bio Entity</th> <th>Bio Entity</th>
@ -169,27 +170,64 @@ import { RouteParams} from '@angular/router-deprecated';
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-12 col-sm-3">
<div class="mainFunctionsBlock"> <ul class="list-group mainFunctionsBlock">
<div class="functionsSection" *ngIf="publicationInfo.collectedFrom != undefined"> <li class="list-group-item">
<h3 class="title">Collected from</h3> <dl class="functionsSection" *ngIf="publicationInfo.collectedFrom != undefined">
<ul class="line" *ngFor="let key of publicationInfo.collectedFrom.keys()"> <dt >Collected from</dt>
<li class="collectedFrom"> <dd *ngFor="let key of publicationInfo.collectedFrom.keys()">
<a href="{{publicationInfo.collectedFrom.get(key)}}"> <a href="{{publicationInfo.collectedFrom.get(key)}}">
{{key}} {{key}}
</a> </a>
</dd>
</dl>
</li> </li>
<li class="list-group-item">
<dl class="functionsSection" *ngIf="publicationInfo.collectedFrom != undefined">
<dt class="title">Download from</dt>
<dd class="line" *ngFor="let key of publicationInfo.collectedFrom.keys()">
<a href="{{publicationInfo.collectedFrom.get(key)}}">
{{key}}
</a>
</dd>
</dl>
</li>
<li class="list-group-item">
<dl class="functionsSection" *ngIf="publicationInfo.fundedByProjects != undefined">
<dt class="title">Funded By</dt>
<dd class="line" *ngFor="let key of publicationInfo.fundedByProjects.values()">
<a href="{{publicationInfo.fundedByProjects.get(key)}}">
{{key}}
</a>
</dd>
</dl>
<a (click)="toggleClaimProject()">Add more Projects</a>
<inline-claim-project *ngIf="result " inline="true" inlineType ="publication" [inlineEntity]="result" (projectAdded)="projectAdded($event)" ></inline-claim-project>
</li>
<li class="list-group-item">
<a (click)=" claimInline=(claimInline=='context')?'none':'context'" >Add more Contexts</a>
<inline-claim-context *ngIf="result " inline="true" inlineType ="publication" [inlineEntity]="result" ></inline-claim-context>
</li>
</ul> </ul>
</div> </div>
</div> </div>
</div>
</div> </div>
`, `,
providers:[JSONP_PROVIDERS, PublicationService] providers:[JSONP_PROVIDERS, PublicationService],
directives:[InlineClaimContextComponent, InlineClaimProjectComponent]
}) })
export class PublicationComponent { export class PublicationComponent {
constructor (private _publicationService: PublicationService, private _routeParams: RouteParams) { constructor (private _publicationService: PublicationService, private _routeParams: RouteParams) {
console.info('publication constructor'); console.info('publication constructor');
@ -197,25 +235,65 @@ export class PublicationComponent {
} }
ngOnInit() { ngOnInit() {
console.info('publication init'); 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(); this.getPublicationInfo();
} }
results : String[];
orcidresults : String[];
resultsNum : number ;
publicationInfo: PublicationInfo; publicationInfo: PublicationInfo;
params: RouteParams; params: RouteParams;
//AK - For the claims
private result ;
private claimInline:string = "none" ;
@ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ;
@ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ;
getPublicationInfo() { getPublicationInfo() {
console.info("inside getPublicationInfo of component"); console.info("inside getPublicationInfo of component");
this._publicationService.getPublicationInfo(this.params.get("articleId")).subscribe( this._publicationService.getPublicationInfo(this.params.get("articleId")).subscribe(
data => { data => {
this.publicationInfo = 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) 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<string, string[]>();
}
var project =projects[i];
// this.publicationInfo.fundedByProjects.set(mydata.code, new Array<string>());
// 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<string>());
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;
}
}
}
} }

View File

@ -75,13 +75,18 @@ export class PublicationService {
this.publicationInfo.fundedByProjects = new Map<string, string[]>(); this.publicationInfo.fundedByProjects = new Map<string, string[]>();
} }
this.publicationInfo.fundedByProjects.set(mydata.code, new Array<string>()); // this.publicationInfo.fundedByProjects.set(mydata.code, new Array<string>());
this.publicationInfo.fundedByProjects.get(mydata.code)[0] = mydata.acronym; // this.publicationInfo.fundedByProjects.get(mydata.code)[0] = mydata.acronym;
this.publicationInfo.fundedByProjects.get(mydata.code)[1] = mydata.title; // this.publicationInfo.fundedByProjects.get(mydata.code)[1] = mydata.title;
this.publicationInfo.fundedByProjects.set(mydata['to'].content, new Array<string>());
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.hasOwnProperty("funding")) {
if(mydata['funding'].hasOwnProperty("funder")) { if(mydata['funding'].hasOwnProperty("funder")) {
this.publicationInfo.fundedByProjects.get(mydata.code)[2] = mydata['funding']['funder'].shortname; // 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)[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")) { if(mydata['funding'].hasOwnProperty("funding_level_2")) {
funding = mydata['funding']['funding_level_2'].content; funding = mydata['funding']['funding_level_2'].content;
@ -93,10 +98,11 @@ export class PublicationService {
if(funding != undefined) { if(funding != undefined) {
funding = funding.split("::"); 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<funding.length; i++) { for(let i=2; i<funding.length; i++) {
this.publicationInfo.fundedByProjects.get(mydata.code)[4] += " | " + funding[i]; // this.publicationInfo.fundedByProjects.get(mydata.code)[4] += " | " + funding[i];
this.publicationInfo.fundedByProjects.get(mydata['to'].content)[4] += " | " + funding[i];
} }
} }
} }
@ -293,7 +299,7 @@ export class PublicationService {
} }
} }
this.printPublicationInfo(); //this.printPublicationInfo();
return this.publicationInfo; return this.publicationInfo;
} }