[Library|Trunk]

Merging branch newlinking into Trunk 55132:56708



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@56714 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2019-07-23 12:23:12 +00:00
parent e5459be2d3
commit e422f5fe77
59 changed files with 6238 additions and 4607 deletions

View File

@ -6,7 +6,7 @@ export class Claim {
targetId: string;
date: string;
DOI: string;
project: Project
project: Project;
userMail: string;
}

View File

@ -0,0 +1,313 @@
<div>
<div>
<div class="uk-grid uk-margin-top uk-animation-fade">
<div class="uk-width-expand">
<div class="uk-grid">
<div class="uk-width-1-2">
Select communities to link to
</div>
<div class="uk-width-1-2">
<div class="uk-margin">
<div class="uk-inline">
<span class="uk-form-icon uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="search" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg></span>
<input class=" uk-input uk-width-medium" [(ngModel)]="keyword" name="keyword"
placeholder="Search communities..."/>
<span *ngIf="keyword.length > 0" class="uk-margin-small-right uk-icon" style="cursor: pointer;"
(click)="keyword='';">
<svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" data-svg="close"><path fill="none" stroke="#000"
stroke-width="1.06"
d="M16,16 L4,4"></path><path
fill="none"
stroke="#000"
stroke-width="1.06"
d="M16,4 L4,16"></path></svg>
</span>
</div>
</div>
</div>
</div>
<div class="uk-margin-right uk-padding">
<span *ngFor="let community of communities">
<span [class]="' uk-margin-small-bottom uk-margin-small-right '+getCommunityClass(community)"
(click)="select(community)" style="cursor:pointer;">
<a href="#modal-categories" uk-toggle>
{{community.label}}
</a>
</span>
</span>
</div>
<!-- Categories modal-->
<div id="modal-categories" uk-modal="bg-close:false;">
<div class="uk-modal-dialog uk-modal-body uk-height-min-medium">
<a class="uk-modal-close uk-position-right uk-margin-right uk-margin-top" type="button">
<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg" data-svg="close-icon">
<line fill="none" stroke="#000" stroke-width="1.1" x1="1" y1="1" x2="13" y2="13"></line>
<line fill="none" stroke="#000" stroke-width="1.1" x1="13" y1="1" x2="1" y2="13"></line>
</svg>
</a>
<div class="portal-color uk-margin-top">
<span class="uk-icon-button icon-button-small portal-icon-button uk-icon">
<svg height="20" icon="check" ratio="1" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" points="4,10 8,15 17,4" stroke="#000" stroke-width="1.1"></polyline></svg>
</span>
<span
class="uk-text-bold">{{selectedCommunityLabel}}</span> community is now in your Links Basket
</div>
<div *ngIf="loading" class="uk-alert uk-alert-primary" role="alert">Loading communities information...</div>
<div *ngIf="error" class="uk-alert uk-alert-warning"
role="alert">An error occured while loading communities...
</div>
<!-- *ngIf="categories[selectedCommunityId] && categories[selectedCommunityId].length > 0 " -->
<div class="uk-margin-small-top uk-text-small" *ngIf="categories[selectedCommunityId] &&
categories[selectedCommunityId].length > 0 ">
Optionally, you can specify additional Community's paths to link your sources.
</div>
<div *ngIf="categories[selectedCommunityId] && categories[selectedCommunityId].length == 0 "
class=" uk-margin-small-top uk-text-small uk-text-muted">
No aditional community paths found for this community.
</div>
<ul *ngIf="categories[selectedCommunityId] && categories[selectedCommunityId].length > 0 "
class=" uk-list uk-margin-top uk-animation-fade">
<li *ngFor="let category of categories[selectedCommunityId]">
<span (click)="browseConcepts(category.id)">
<span *ngIf="!conceptsClassDisplay[category.id]" class="uk-icon"><svg width="20" height="20"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
ratio="1"> <polygon
points="8 5 13 10 8 15"></polygon></svg></span>
<span *ngIf="conceptsClassDisplay[category.id]" class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon
points="5 7 15 7 10 12"></polygon></svg>
</span>
{{category.label}} - {{category.id}}</span>
<a *ngIf="!isSelected(category.id)"
(click)="addNewContext(selectedCommunityLabel,category.label,{'id':category.id, 'label':category.label})"
class="uk-icon-button icon-button-small">
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus"
ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17"
height="1"></rect></svg>
</span>
</a>
<span *ngIf="isSelected(category.id)"
class="uk-icon-button icon-button-small portal-icon-button uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="check"
ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.1"
points="4,10 8,15 17,4"></polyline></svg>
</span>
<div *ngIf="conceptsCategoryLoading[category.id]" class="uk-alert uk-alert-primary"
role="alert">Loading category information...
</div>
<div
[class]="(conceptsClassDisplay[category.id] && conceptsClass[category.id] && conceptsClass[category.id].length>5)?'uk-panel-scrollable':''">
<div
*ngIf="conceptsClass[category.id] && conceptsClass[category.id].length == 0 && conceptsClassDisplay[category.id]">No more paths found
</div>
<ul *ngIf="conceptsClass[category.id] && conceptsClassDisplay[category.id]"
class="uk-list uk-animation-fade" id="ul_{{category.id}}">
<li *ngFor="let concept1 of conceptsClass[category.id]">
<span (click)="displaySubcategory(concept1.id)">
<span *ngIf="!conceptsClassDisplay[concept1.id] && concept1.concepts" class="uk-icon"><svg
width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon
points="8 5 13 10 8 15"></polygon></svg></span>
<span *ngIf="conceptsClassDisplay[concept1.id] && concept1.concepts" class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon
points="5 7 15 7 10 12"></polygon></svg></span>
{{concept1.label}}
</span>
<a *ngIf="!isSelected(concept1.id)"
(click)="addNewContext(selectedCommunityLabel,category.label,concept1)"
class="uk-icon-button icon-button-small"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect
x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a>
<span *ngIf="isSelected(concept1.id)"
class="uk-icon-button icon-button-small portal-icon-button uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="check"
ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.1"
points="4,10 8,15 17,4"></polyline></svg>
</span>
<div
[class]="(conceptsClassDisplay[concept1.id] && concept1.concepts && concept1.concepts.length>5)?'uk-panel-scrollable':''">
<div
*ngIf="concept1.concepts && concept1.concepts.length==0 && conceptsClassDisplay[concept1.id]">No more paths found
</div>
<ul *ngIf="concept1.concepts && conceptsClassDisplay[concept1.id] " class="uk-animation-fade">
<li *ngFor="let concept2 of concept1.concepts"><span
(click)="displaySubcategory(concept2.id)">
<span *ngIf="!conceptsClassDisplay[concept2.id] && concept2.concepts" class="uk-icon"><svg
width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon
points="8 5 13 10 8 15"></polygon></svg></span>
<span *ngIf="conceptsClassDisplay[concept2.id] && concept2.concepts" class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon
points="5 7 15 7 10 12"></polygon></svg></span>
{{concept2.label}}</span>
<a *ngIf="!isSelected(concept2.id)"
(click)="addNewContext(selectedCommunityLabel,category.label,concept2)"
class="uk-icon-button icon-button-small"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect
x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a>
<span *ngIf="isSelected(concept2.id)"
class="uk-icon-button icon-button-small portal-icon-button uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="check" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.1"
points="4,10 8,15 17,4"></polyline></svg>
</span>
<ul *ngIf="concept2.concepts && conceptsClassDisplay[concept2.id] "
class="uk-animation-fade">
<li *ngFor="let concept3 of concept2.concepts">{{concept3.label}}
<a *ngIf="!isSelected(concept3.id)"
(click)="addNewContext(selectedCommunityLabel,category.label,concept3)"
class="uk-icon-button icon-button-small"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect
x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a>
<span *ngIf="isSelected(concept3.id)"
class="uk-icon-button icon-button-small portal-icon-button uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="check" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.1"
points="4,10 8,15 17,4"></polyline></svg>
</span>
</li>
</ul>
</li>
</ul>
</div>
</li>
</ul>
</div>
</li>
</ul>
<!-- </li>
</ul> -->
<p class="">
<button class="uk-button uk-button-default uk-modal-close uk-margin-right uk-margin-top uk-align-right"
type="button">Close
</button>
</p>
</div>
</div>
<!-- <div class="uk-text-large">Select a community <helper div="link-context-form" tooltip=true></helper> </div>
<select [(ngModel)]="selectedCommunityId" (ngModelChange)="communityChanged()" class="uk-margin-large-bottom uk-select uk-width-medium " name="select_funder" >
<option value="0" >Select community</option>
<option *ngFor="let community of communities" [value]="community.id" >{{community.label}}</option>
</select> -->
<!--div class="uk-text-large">and then</div>
<div class=" uk-margin-left uk-margin-left">
<div class=" uk-text-bold">search for community concepts</div>
<table class="uk-margin-remove uk-width-1-1 uk-table uk-table-responsive" ><tr>
<tr>
<td *ngIf="selectedCommunityId != '0' && categories.length > 0" class="uk-width-medium">
<select [(ngModel)]="selectedCategoryId" (ngModelChange)="categoryChanged()" class="uk-select uk-width-medium " name="select_funder" >
<option value="0" >Select category</option>
<option *ngFor="let category of categories" [value]="category.id" >{{category.label}}</option>
</select>
</td><td >
<static-autocomplete [(properties)]=properties [(list)] = concepts [allowDuplicates]=true [showSelected]=false [placeHolderMessage] = "'Concept name'" title = "Concepts" [multipleSelections]=true (addItem) = "select($event)" > </static-autocomplete>
</td></tr>
</table>
</div-->
<!-- <div *ngIf="loading" class="uk-alert uk-alert-primary" role="alert">Loading communities information...</div>
<div *ngIf="error" class="uk-alert uk-alert-warning" role="alert">An error occured while loading communities...</div>
<div class="uk-text-large ">or</div>
<div class=" uk-text-bold uk-margin-bottom uk-margin-left">browse through community categories:
<button uk-toggle="target: #browse; animation: uk-animation-fade" class="uk-button portal-button"> Browse </button>
</div> -->
<div class="uk-margin-left">
<!-- <div id="browse" class=" uk-margin-small">
<div *ngIf="selectedCommunityId =='0'" class="uk-alert uk-alert-warning" >Please select community first...</div>
<div *ngIf="selectedCommunityId !='0'" class="uk-panel uk-panel-scrollable">
<ul class="uk-list ">
<li>
<span (click)="displaySubcategory(selectedCommunityId)" >
<span *ngIf="!conceptsClassDisplay[selectedCommunityId]" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="8 5 13 10 8 15"></polygon></svg></span>
<span *ngIf="conceptsClassDisplay[selectedCommunityId]" class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="5 7 15 7 10 12"></polygon></svg></span>{{selectedCommunityLabel}}
</span>
<a *ngIf="!isSelected(selectedCommunityId)" (click)="addNewContext(selectedCommunityLabel,null,{'id':selectedCommunityId, 'label':selectedCommunityLabel})" class="uk-icon-button icon-button-small uk-icon">
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span> </a>
<span *ngIf="isSelected(selectedCommunityId)" class="uk-label uk-label-success uk-margin-small-top">Added</span>
<ul *ngIf="conceptsClassDisplay[selectedCommunityId]" class="uk-animation-fade" >
<li *ngFor="let category of categories" >
<span (click)="browseConcepts(category.id)" >
<span *ngIf="!conceptsClassDisplay[category.id]" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="8 5 13 10 8 15"></polygon></svg></span>
<span *ngIf="conceptsClassDisplay[category.id]" class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="5 7 15 7 10 12"></polygon></svg></span>
{{category.label}}</span><a *ngIf="!isSelected(category.id)" (click)="addNewContext(selectedCommunityLabel,category.label,{'id':category.id, 'label':category.label})" class="uk-icon-button icon-button-small" >
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a>
<span *ngIf="isSelected(category.id)" class="uk-label uk-label-success uk-margin-small-top">Added</span>
<div *ngIf="conceptsCategoryLoading[category.id]" class="uk-alert uk-alert-primary" role="alert">Loading category information...</div>
<ul *ngIf="conceptsClass[category.id] && conceptsClassDisplay[category.id]" class="uk-list uk-animation-fade" id="ul_{{category.id}}" >
<li *ngFor="let concept1 of conceptsClass[category.id]" >
<span (click)="displaySubcategory(concept1.id)" >
<span *ngIf="!conceptsClassDisplay[concept1.id] && concept1.concepts" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="8 5 13 10 8 15"></polygon></svg></span>
<span *ngIf="conceptsClassDisplay[concept1.id] && concept1.concepts" class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="5 7 15 7 10 12"></polygon></svg></span>
{{concept1.label}}
</span>
<a *ngIf="!isSelected(concept1.id)" (click)="addNewContext(selectedCommunityLabel,category.label,concept1)" class="uk-icon-button icon-button-small"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a>
<span *ngIf="isSelected(concept1.id)" class="uk-label uk-label-success uk-margin-small-top">Added</span>
<ul *ngIf="concept1.concepts && conceptsClassDisplay[concept1.id] " class="uk-animation-fade" >
<li *ngFor="let concept2 of concept1.concepts"><span (click)="displaySubcategory(concept2.id)" >
<span *ngIf="!conceptsClassDisplay[concept2.id] && concept2.concepts" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="8 5 13 10 8 15"></polygon></svg></span>
<span *ngIf="conceptsClassDisplay[concept2.id] && concept2.concepts" class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="5 7 15 7 10 12"></polygon></svg></span>
{{concept2.label}}</span>
<a *ngIf="!isSelected(concept2.id)" (click)="addNewContext(selectedCommunityLabel,category.label,concept2)" class="uk-icon-button icon-button-small"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a>
<span *ngIf="isSelected(concept2.id)" class="uk-label uk-label-success uk-margin-small-top">Added</span>
<ul *ngIf="concept2.concepts && conceptsClassDisplay[concept2.id] " class="uk-animation-fade" >
<li *ngFor="let concept3 of concept2.concepts">{{concept3.label}}
<a *ngIf="!isSelected(concept3.id)" (click)="addNewContext(selectedCommunityLabel,category.label,concept3)" class="uk-icon-button icon-button-small"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a>
<span *ngIf="isSelected(concept3.id)" class="uk-label uk-label-success uk-margin-small-top">Added</span>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</ul>
</div>
</div> -->
</div>
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div>
<div *ngIf="infoMessage.length > 0" class="uk-alert uk-alert-primary" role="alert">{{infoMessage}}</div>
</div>
</div>
</div>

View File

@ -1,513 +1,372 @@
import {Component, Input,Output, EventEmitter, ViewChild} from '@angular/core';
import {Observable} from 'rxjs';
import { Router} from '@angular/router';
import {Component, Input} from '@angular/core';
import {Router} from '@angular/router';
import {ContextsService} from './service/contexts.service';
import {ClaimContext} from './claimEntities.class';
import { StaticAutoCompleteComponent } from '../../utils/staticAutoComplete/staticAutoComplete.component';
declare var UIkit:any;
import {ClaimContext, ClaimEntity} from './claimHelper.class';
import {Session} from '../../login/utils/helper.class';
import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
import{EnvProperties} from '../../utils/properties/env-properties';
import {EnvProperties} from '../../utils/properties/env-properties';
declare var UIkit: any;
@Component({
// moduleId: module.id,
selector: 'claim-contexts-search-form',
template: `
<div [class]="((inlineClaim)?'':' uk-card uk-card-default uk-padding uk-padding-medium ')+ 'uk-animation' " >
<!--div class="uk-text-lead">Select community:</div>
<div clas="uk-margin-left">
<div *ngIf="selectedCommunityId" >
<div class="uk-text-bold">My community:</div>
<div class="uk-margin-left">
<span>
{{selectedCommunityLabel}}
</span>
<a *ngIf="!isSelected(selectedCommunityId)" (click)="addNewContext(selectedCommunityLabel,null,{'id':selectedCommunityId, 'label':selectedCommunityLabel})" class="uk-icon-button icon-button-small uk-icon">
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span> </a>
<span *ngIf="isSelected(selectedCommunityId)" class="uk-label uk-label-success uk-margin-small-top">Added</span>
</div>
</div>
<hr *ngIf="selectedCommunityId">
<div *ngIf="selectedCommunityId" class="uk-text-bold">Other communities:</div>
<div class="uk-child-width-1-3@m uk-margin-left uk-grid-match uk-grid">
<ng-container *ngFor="let community of communities">
<div *ngIf="community.id != selectedCommunityId">
<div>
<span>
{{community.label}}
</span>
<a *ngIf="!isSelected(community.id)" (click)="addNewContext(community.label,null,{'id':community.id, 'label':community.label})" class="uk-icon-button icon-button-small uk-icon">
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span> </a>
<span *ngIf="isSelected(community.id)" class="uk-label uk-label-success uk-margin-small-top">Added</span>
</div>
</div>
</ng-container >
</div>
</div-->
<div class="uk-grid uk-margin-top uk-animation-fade">
<div class="uk-width-expand">
<!--div class="uk-text-lead">More options:</div-->
<div class="uk-text-large">Select a community <helper div="link-context-form" tooltip=true></helper> </div>
<select [(ngModel)]="selectedCommunityId" (ngModelChange)="communityChanged()" class="uk-margin-large-bottom uk-select uk-width-medium " name="select_funder" >
<option value="0" >Select community</option>
<option *ngFor="let community of communities" [value]="community.id" >{{community.label}}</option>
</select>
<div class="uk-text-large">and then</div>
<div class=" uk-margin-left uk-margin-left">
<div class=" uk-text-bold">search for community concepts</div>
<table class="uk-margin-remove uk-width-1-1 uk-table uk-table-responsive" ><tr>
<tr>
<td *ngIf="selectedCommunityId != '0' && categories.length > 0" class="uk-width-medium">
<select [(ngModel)]="selectedCategoryId" (ngModelChange)="categoryChanged()" class="uk-select uk-width-medium " name="select_funder" >
<option value="0" >Select category</option>
<option *ngFor="let category of categories" [value]="category.id" >{{category.label}}</option>
</select>
</td><td >
<static-autocomplete [(properties)]=properties [(list)] = concepts [allowDuplicates]=true [showSelected]=false [placeHolderMessage] = "'Concept name'" title = "Concepts" [multipleSelections]=true (addItem) = "select($event)" > </static-autocomplete>
</td></tr>
</table>
</div>
<div *ngIf="loading" class="uk-alert uk-alert-primary" role="alert">Loading communities information...</div>
<div *ngIf="error" class="uk-alert uk-alert-warning" role="alert">An error occured while loading communities...</div>
<div class="uk-text-large ">or</div>
<div class=" uk-text-bold uk-margin-bottom uk-margin-left">browse through community categories:
<button uk-toggle="target: #browse; animation: uk-animation-fade" class="uk-button portal-button"> Browse </button>
</div>
<div class="uk-margin-left">
<div id="browse" class=" uk-margin-small">
<!--a uk-toggle="target: #browse; animation: uk-animation-fade" class="uk-float-right"><span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="1"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg>
</span></a-->
<div *ngIf="selectedCommunityId =='0'" class="uk-alert uk-alert-warning" >Please select community first...</div>
<div *ngIf="selectedCommunityId !='0'" class="uk-panel uk-panel-scrollable">
<ul class="uk-list ">
<li>
<span (click)="displaySubcategory(selectedCommunityId)" >
<span *ngIf="!conceptsClassDisplay[selectedCommunityId]" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="8 5 13 10 8 15"></polygon></svg></span>
<span *ngIf="conceptsClassDisplay[selectedCommunityId]" class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="5 7 15 7 10 12"></polygon></svg></span>{{selectedCommunityLabel}}
</span>
<a *ngIf="!isSelected(selectedCommunityId)" (click)="addNewContext(selectedCommunityLabel,null,{'id':selectedCommunityId, 'label':selectedCommunityLabel})" class="uk-icon-button icon-button-small uk-icon">
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span> </a>
<span *ngIf="isSelected(selectedCommunityId)" class="uk-label uk-label-success uk-margin-small-top">Added</span>
<ul *ngIf="conceptsClassDisplay[selectedCommunityId]" class="uk-animation-fade" >
<li *ngFor="let category of categories" >
<span (click)="browseConcepts(category.id)" >
<span *ngIf="!conceptsClassDisplay[category.id]" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="8 5 13 10 8 15"></polygon></svg></span>
<span *ngIf="conceptsClassDisplay[category.id]" class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="5 7 15 7 10 12"></polygon></svg></span>
{{category.label}}</span><a *ngIf="!isSelected(category.id)" (click)="addNewContext(selectedCommunityLabel,category.label,{'id':category.id, 'label':category.label})" class="uk-icon-button icon-button-small" >
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a>
<span *ngIf="isSelected(category.id)" class="uk-label uk-label-success uk-margin-small-top">Added</span>
<div *ngIf="conceptsCategoryLoading[category.id]" class="uk-alert uk-alert-primary" role="alert">Loading category information...</div>
<ul *ngIf="conceptsClass[category.id] && conceptsClassDisplay[category.id]" class="uk-list uk-animation-fade" id="ul_{{category.id}}" >
<li *ngFor="let concept1 of conceptsClass[category.id]" >
<span (click)="displaySubcategory(concept1.id)" >
<span *ngIf="!conceptsClassDisplay[concept1.id] && concept1.concepts" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="8 5 13 10 8 15"></polygon></svg></span>
<span *ngIf="conceptsClassDisplay[concept1.id] && concept1.concepts" class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="5 7 15 7 10 12"></polygon></svg></span>
{{concept1.label}}
</span>
<a *ngIf="!isSelected(concept1.id)" (click)="addNewContext(selectedCommunityLabel,category.label,concept1)" class="uk-icon-button icon-button-small"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a>
<span *ngIf="isSelected(concept1.id)" class="uk-label uk-label-success uk-margin-small-top">Added</span>
<ul *ngIf="concept1.concepts && conceptsClassDisplay[concept1.id] " class="uk-animation-fade" >
<li *ngFor="let concept2 of concept1.concepts"><span (click)="displaySubcategory(concept2.id)" >
<span *ngIf="!conceptsClassDisplay[concept2.id] && concept2.concepts" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="8 5 13 10 8 15"></polygon></svg></span>
<span *ngIf="conceptsClassDisplay[concept2.id] && concept2.concepts" class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <polygon points="5 7 15 7 10 12"></polygon></svg></span>
{{concept2.label}}</span>
<a *ngIf="!isSelected(concept2.id)" (click)="addNewContext(selectedCommunityLabel,category.label,concept2)" class="uk-icon-button icon-button-small"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a>
<span *ngIf="isSelected(concept2.id)" class="uk-label uk-label-success uk-margin-small-top">Added</span>
<ul *ngIf="concept2.concepts && conceptsClassDisplay[concept2.id] " class="uk-animation-fade" >
<li *ngFor="let concept3 of concept2.concepts">{{concept3.label}}
<a *ngIf="!isSelected(concept3.id)" (click)="addNewContext(selectedCommunityLabel,category.label,concept3)" class="uk-icon-button icon-button-small"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a>
<span *ngIf="isSelected(concept3.id)" class="uk-label uk-label-success uk-margin-small-top">Added</span>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</ul>
</div>
</div>
</div>
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div>
<div *ngIf="infoMessage.length > 0" class="uk-alert uk-alert-primary" role="alert">{{infoMessage}}</div>
</div>
</div>
<!--a *ngIf="simpleView" class="uk-float-right " (click)="simpleView=!simpleView">More options <span class="uk-icon">
<svg height="20" icon="chevron-right" ratio="1" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" points="7 4 13 10 7 16" stroke="#000" stroke-width="1.03"></polyline></svg>
</span>
</a>
<a *ngIf="!simpleView" class="uk-float-right " (click)="simpleView=!simpleView">Less options <span class="uk-icon">
<svg height="20" icon="chevron-right" ratio="1" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" points="7 4 13 10 7 16" stroke="#000" stroke-width="1.03"></polyline></svg>
</span>
</a-->
</div>
`
selector: 'claim-contexts-search-form',
templateUrl: 'claimContextSearchForm.component.html'
})
export class ClaimContextSearchFormComponent {
// @Input() public inline:boolean = false ; // for claimed started from landing pages
public showComponent:boolean = true ; // for claimed started from landing pages
@Input() public selectedList;
//The following need to be kept in case we have to save the current state
@Input() public projects;
@Input() public results;
@Input() public inlineEntity;
@Input() public properties:EnvProperties;
@Input() communityId:string= null;
@Input() public inlineClaim:boolean=false;
@Input() public results:ClaimEntity[];
@Input() public sources;
@Input() public properties: EnvProperties;
@Input() communityId: string = null;
@Input() public inlineClaim: boolean = false;
public selectedCommunityId:string = "0";
public selectedCategoryId:string ="0";
// @Output() contextSelected = new EventEmitter();
public selectedCommunityId: string = "0";
public selectedCategoryId: string = "0";
public query = '';
public communities: any;
public selectedCommunityLabel: string = "Community:";
@ViewChild (StaticAutoCompleteComponent) autocomplete : StaticAutoCompleteComponent ;
public categories: any = [];
public concepts = [];
public conceptsClass = [];
public conceptsClassDisplay = [];
public conceptsCategoryLoading = [];
public warningMessage = "";
public infoMessage = "";
public loading: boolean = false;
public error: boolean = false;
@Input() localStoragePrefix: string = "";
public query = '';
public filteredList = [];
public communities:any;
public selectedCommunityLabel:string = "Community:";
keyword = "";
public categories:any;
public selectedCategoryLabel:string ="Category:";
public concepts = [];
public conceptsClass = [];
public conceptsClassDisplay = [];
public conceptsCategoryLoading = [];
public warningMessage = "";
public infoMessage = "";
public loading:boolean = false;
public error:boolean = false;
public simpleView:boolean = true;
@Input() localStoragePrefix:string = "";
ngOnInit() {
this.getCommunities();
}
constructor(private _contextService: ContextsService,private router: Router) {
}
select($event){
var item = $event.value;
this.addNewContext( this.selectedCommunityLabel, this.selectedCategoryLabel, item);
ngOnInit() {
this.getCommunities();
}
isSelected(id):boolean{
for (var _i = 0; _i < this.selectedList.length; _i++) {
let item = this.selectedList[_i];
if(item.concept.id == id){
return true;
// this.warningMessage = "Concept already in selected list";
constructor(private _contextService: ContextsService, private router: Router) {
}
getCommunityClass(community) {
let addclass = "";
if (this.isSelected(community.id)) {
addclass += " contextlabelSelected ";
} else {
addclass += " contextlabelNotSelected ";
}
if (this.keyword.length > 0) {
if (community.label.toLowerCase().indexOf(this.keyword.toLowerCase()) == -1) {
addclass += " fadeOut "
}
}
return false;
}
addNewContext(community,category,concept, notify=true){
if(this.selectedList.length > 50){
}
return addclass + 'uk-label';
}
select(community) {
this.selectedCommunityId = community.id;
this.selectedCommunityLabel = community.label;
this.getCategories();
if (this.isSelected(community.id)) {
} else {
this.addNewContext(community.label, null, {'id': community.id, 'label': community.label});
}
}
isSelected(id): boolean {
for (let _i = 0; _i < this.results.length; _i++) {
let item = this.results[_i];
if (item.id == id) {
return true;
// this.warningMessage = "Concept already in selected list";
}
}
return false;
}
addNewContext(community, category, concept, notify = true) {
if (this.results.length > 50) {
UIkit.notification({
message : 'Your basket exceeds the number of allowed concepts (50)',
status : 'warning',
timeout : 1500,
pos : 'top-center'
message: 'Your basket exceeds the number of allowed concepts (50)',
status: 'warning',
timeout: 1500,
pos: 'top-center'
});
return;
}
var context: ClaimContext= { community: community, category: category, concept: concept };
var found:boolean = false;
const entity: ClaimEntity = new ClaimEntity() ;
entity.type = "community";
entity.context = {community: community, category: category, concept: concept};
entity.id = entity.context.concept.id;
this.warningMessage = "";
if (!this.isSelected(context.concept.id)) {
this.selectedList.push(context);
if(notify){
UIkit.notification({
message : 'A new concept added in your basket.',
status : 'primary',
timeout : 1500,
pos : 'top-center'
});
}
localStorage.setItem(this.localStoragePrefix + "contexts", JSON.stringify(this.selectedList));
}else{
if(notify){
UIkit.notification({
message : 'The concept is already in your basket.',
status : 'warning',
timeout : 1500,
pos : 'top-center'
});
}
if (!this.isSelected(entity.id)) {
this.results.push(entity);
localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.results));
}
}
getCommunities () {
if(!Session.isLoggedIn()){
this.saveStateAndRedirectLogin();
}else{
this.loading = true;
this._contextService.getPublicCommunities(this.properties.contextsAPI).subscribe(
data => {
this.communities = data;
if(this.communities.length > 0){
this.communities.sort((n1,n2)=> n1.label > n2.label);
}
this.loading = false;
if(this.communityId != null){
//preselect community
this.selectedCommunityId = this.communityId;
this.communityChanged()
this.addNewContext(this.selectedCommunityLabel,null,{'id':this.selectedCommunityId, 'label':this.selectedCommunityLabel}, false)
}
},
err => {
//console.log(err);
this.handleError("Error getting communities", err);
this.loading = false;
this.error = true;
}
);
}
}
getCategories () {
this.loading = true;
this.categories=[];
if(this.selectedCommunityId != '0'){
if(!Session.isLoggedIn()){
this.saveStateAndRedirectLogin();
}else{
this._contextService.getCategories(this.selectedCommunityId,this.properties.contextsAPI).subscribe(
data => {
getCommunities() {
if (!Session.isLoggedIn()) {
this.saveStateAndRedirectLogin();
this.categories =data;
this.concepts = [];
this.addCommunityInConcepts();
this.filteredList = [];
if (this.query !== ""){
var event = {value: ""};
event.value = this.query;
}
this.loading = false;
},
err => {
//console.log(err);
this.handleError("Error getting categories for community with id: "+this.selectedCommunityId, err);
this.loading = false;
}
);
}
}
} else {
this.loading = true;
this._contextService.getPublicCommunities(this.properties.contextsAPI).subscribe(
data => {
this.communities = data;
if (this.communities.length > 0) {
this.communities.sort((n1, n2) => n1.label > n2.label);
}
this.loading = false;
if (this.communityId != null) {
//preselect community
this.selectedCommunityId = this.communityId;
for (let i = 0; i < this.communities.length; i++) {
if (this.communities[i].id == this.selectedCommunityId) {
this.selectedCommunityLabel = this.communities[i].label;
break;
}
}
this.addNewContext(this.selectedCommunityLabel, null, {
'id': this.selectedCommunityId,
'label': this.selectedCommunityLabel
}, false)
}
},
err => {
//console.log(err);
ClaimContextSearchFormComponent.handleError("Error getting communities", err);
this.loading = false;
this.error = true;
}
);
}
}
getConcepts () {
getCategories() {
this.loading = true;
if(this.selectedCategoryId != '0'){
if(!Session.isLoggedIn()){
// this.categories=[];
if (this.selectedCommunityId != '0') {
if (!Session.isLoggedIn()) {
this.saveStateAndRedirectLogin();
}else{
this.concepts = [];
this._contextService.getConcepts(this.selectedCategoryId, "",true, this.properties.contextsAPI).subscribe(
} else {
if (this.categories[this.selectedCommunityId]) {
this.loading = false;
return;
}
this._contextService.getCategories(this.selectedCommunityId, this.properties.contextsAPI).subscribe(
data => {
this.concepts =data;
for(var i =0 ; i<data.length; i++){
if(data[i].hasSubConcept == true){
this.getSubConcepts(data[i].id);
}
}
this.addCommunityInConcepts();
if (this.query !== ""){
var event = {value: ""};
this.categories[this.selectedCommunityId] = data;
this.concepts = [];
if (this.query !== "") {
const event = {value: ""};
event.value = this.query;
// this.filter(event);
}
this.loading = false;
},
}
this.loading = false;
},
err => {
//console.log(err);
this.handleError("Error getting concepts for category with id: "+this.selectedCategoryId, err);
ClaimContextSearchFormComponent.handleError("Error getting categories for community with id: " + this.selectedCommunityId, err);
this.loading = false;
}
);
}
}else{
this.concepts=[];
}
}
/*
getConcepts() {
this.loading = true;
if (this.selectedCategoryId != '0') {
if (!Session.isLoggedIn()) {
this.saveStateAndRedirectLogin();
} else {
this.concepts = [];
this._contextService.getConcepts(this.selectedCategoryId, "", true, this.properties.contextsAPI).subscribe(
data => {
this.concepts = data;
for (var i = 0; i < data.length; i++) {
if (data[i].hasSubConcept == true) {
this.getSubConcepts(data[i].id);
}
}
this.addCommunityInConcepts();
if (this.query !== "") {
var event = {value: ""};
event.value = this.query;
// this.filter(event);
}
this.loading = false;
},
err => {
//console.log(err);
this.handleError("Error getting concepts for category with id: " + this.selectedCategoryId, err);
this.loading = false;
}
);
}
} else {
this.concepts = [];
this.loading = false;
}
}
getSubConcepts (conceptId) {
this.loading = true;
if(this.selectedCategoryId != '0'){
if(!Session.isLoggedIn()){
this.saveStateAndRedirectLogin();
}else{
this._contextService.getSubConcepts(conceptId, "",true, this.properties.contextsAPI).subscribe(
data => {
for(var i =0 ; i<data.length; i++){
this.concepts.push(data[i]);
}
if (this.query !== ""){
var event = {value: ""};
event.value = this.query;
// this.filter(event);
}
this.loading = false;
},
err => {
//console.log(err);
this.handleError("Error getting subconcepts for concept with id: "+conceptId, err);
this.loading = false;
}
);
}
}else{
this.concepts=[];
this.loading = false;
}
}
displaySubcategory(id) {
if(this.conceptsClassDisplay[id] != null){
this.conceptsClassDisplay[id] = !this.conceptsClassDisplay[id];
}else{
this.conceptsClassDisplay[id] = true;
}
}
browseConcepts (categoryId) {
if(!Session.isLoggedIn()){
this.saveStateAndRedirectLogin();
}else{
if(this.conceptsClass[categoryId] != null){
this.conceptsClassDisplay[categoryId] = !this.conceptsClassDisplay[categoryId];
return;
}else{
this.conceptsClassDisplay[categoryId] = true;
}
this.conceptsClass[categoryId] = [];
this.conceptsCategoryLoading[categoryId] = true;
this._contextService.getConcepts(categoryId, "",false, this.properties.contextsAPI).subscribe(
data => {
var concepts = data;
this.conceptsClass[categoryId] = [];
for(var i =0 ; i<data.length; i++){
if(data[i].hasSubConcept == true){
this.browseSubConcepts(categoryId, data[i].id);
}else{
this.conceptsClass[categoryId].push(data[i]);
}
}
this.conceptsCategoryLoading[categoryId] = false;
},
err => {
//console.log(err);
this.handleError("Error getting concepts for category with id: "+this.selectedCategoryId, err);
this.conceptsCategoryLoading[categoryId] = false;
}
);
}
}
browseSubConcepts (categoryId, conceptId) {
this.conceptsCategoryLoading[categoryId] = true;
this._contextService.getSubConcepts(conceptId, "",false, this.properties.contextsAPI).subscribe(
data => {
var concepts = data[0];
this.conceptsClass[categoryId].push(concepts)
this.conceptsCategoryLoading[categoryId] = false;
},
err => {
//console.log(err);
this.handleError("Error getting subconcepts for concept with id: "+conceptId, err);
this.conceptsCategoryLoading[categoryId] = false;
}*/
/*
getSubConcepts(conceptId) {
this.loading = true;
if (this.selectedCategoryId != '0') {
if (!Session.isLoggedIn()) {
this.saveStateAndRedirectLogin();
} else {
this._contextService.getSubConcepts(conceptId, "", true, this.properties.contextsAPI).subscribe(
data => {
for (var i = 0; i < data.length; i++) {
this.concepts.push(data[i]);
}
);
}
communityChanged(){
this.warningMessage = "";
this.infoMessage = "";
for(var i = 0; i< this.communities.length; i++){
if(this.communities[i].id==this.selectedCommunityId){
this.selectedCommunityLabel = this.communities[i].label;
break;
if (this.query !== "") {
var event = {value: ""};
event.value = this.query;
// this.filter(event);
}
this.loading = false;
},
err => {
//console.log(err);
this.handleError("Error getting subconcepts for concept with id: " + conceptId, err);
this.loading = false;
}
);
}
} else {
this.concepts = [];
this.loading = false;
}
this.selectedCategoryId = "0";
this.selectedCategoryLabel="Select Category:";
if(this.selectedCommunityId != "0"){
this.getCategories();
}*/
displaySubcategory(id) {
if (this.conceptsClassDisplay[id] != null) {
this.conceptsClassDisplay[id] = !this.conceptsClassDisplay[id];
} else {
this.conceptsClassDisplay[id] = true;
}
}
categoryChanged(){
this.warningMessage = "";
this.infoMessage = "";
for(var i = 0; i< this.categories.length; i++){
if(this.categories[i].id==this.selectedCategoryId){
this.selectedCategoryLabel = this.categories[i].label;
break;
browseConcepts(categoryId) {
if (!Session.isLoggedIn()) {
this.saveStateAndRedirectLogin();
} else {
if (this.conceptsClass[categoryId] != null) {
this.conceptsClassDisplay[categoryId] = !this.conceptsClassDisplay[categoryId];
return;
} else {
this.conceptsClassDisplay[categoryId] = true;
}
this.conceptsClass[categoryId] = [];
this.conceptsCategoryLoading[categoryId] = true;
this._contextService.getConcepts(categoryId, "", false, this.properties.contextsAPI).subscribe(
data => {
// var concepts = data;
this.conceptsClass[categoryId] = [];
for (let i = 0; i < data.length; i++) {
if (data[i].hasSubConcept == true) {
this.browseSubConcepts(categoryId, data[i].id);
} else {
this.conceptsClass[categoryId].push(data[i]);
}
}
this.conceptsCategoryLoading[categoryId] = false;
},
err => {
//console.log(err);
ClaimContextSearchFormComponent.handleError("Error getting concepts for category with id: " + this.selectedCategoryId, err);
this.conceptsCategoryLoading[categoryId] = false;
}
);
}
this.getConcepts();
}
addCommunityInConcepts(){
this.concepts.push({"id":this.selectedCommunityId, "label":this.selectedCommunityLabel});
if(this.autocomplete){
this.autocomplete.updateList(this.concepts);
}
}
saveStateAndRedirectLogin(){
if(this.projects != null){
localStorage.setItem(this.localStoragePrefix + "projects", JSON.stringify(this.projects));
}
localStorage.setItem(this.localStoragePrefix + "contexts", JSON.stringify(this.selectedList));
if(this.results != null){
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.results));
}
if(this.inlineEntity != null){
localStorage.setItem(this.localStoragePrefix + "inlineEntity", JSON.stringify(this.inlineEntity));
}
this.router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this.router.url } });
}
}
private handleError(message: string, error) {
console.error("Claim context search form (component): "+message, error);
browseSubConcepts(categoryId, conceptId) {
this.conceptsCategoryLoading[categoryId] = true;
this._contextService.getSubConcepts(conceptId, "", false, this.properties.contextsAPI).subscribe(
data => {
const concepts = data[0];
this.conceptsClass[categoryId].push(concepts);
this.conceptsCategoryLoading[categoryId] = false;
},
err => {
//console.log(err);
ClaimContextSearchFormComponent.handleError("Error getting subconcepts for concept with id: " + conceptId, err);
this.conceptsCategoryLoading[categoryId] = false;
}
);
}
// communityChanged(){
// this.warningMessage = "";
// this.infoMessage = "";
// for(var i = 0; i< this.communities.length; i++){
// if(this.communities[i].id==this.selectedCommunityId){
// this.selectedCommunityLabel = this.communities[i].label;
// break;
// }
// }
// this.selectedCategoryId = "0";
// this.selectedCategoryLabel="Select Category:";
// if(this.selectedCommunityId != "0"){
// this.getCategories();
// }
// }
// categoryChanged(){
// this.warningMessage = "";
// this.infoMessage = "";
// for(var i = 0; i< this.categories.length; i++){
// if(this.categories[i].id==this.selectedCategoryId){
// this.selectedCategoryLabel = this.categories[i].label;
// break;
// }
// }
// this.getConcepts();
// }
/* addCommunityInConcepts() {
this.concepts.push({"id": this.selectedCommunityId, "label": this.selectedCommunityLabel});
// if(this.autocomplete){
// this.autocomplete.updateList(this.concepts);
// }
}*/
saveStateAndRedirectLogin() {
// if(this.projects != null){
// localStorage.setItem(this.localStoragePrefix + "projects", JSON.stringify(this.projects));
// }
// localStorage.setItem(this.localStoragePrefix + "contexts", JSON.stringify(this.selectedList));
if (this.results != null) {
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.results));
}
if (this.sources != null) {
localStorage.setItem(this.localStoragePrefix + "sources", JSON.stringify(this.sources));
}
this.router.navigate(['/user-info'], {
queryParams: {
"errorCode": LoginErrorCodes.NOT_VALID,
"redirectUrl": this.router.url
}
});
}
private static handleError(message: string, error) {
console.error("Claim context search form (component): " + message, error);
}
}

View File

@ -1,41 +0,0 @@
//Classes used in linking / inlinelinking when selecting an entity
export class ClaimResult{
public id: string;
public type: string;
public source: string;
public title: string;
public url: string;
public result: any;
public accessRights: string = "OPEN";
public embargoEndDate: string ="";
public date: string;
public authors: string[] =[];
public publisher: string;
public description: string;
public resourceType:string;
DOI: string;
editors=[];
journal: string;
}
export class ClaimProject{
public funderId: string;
public funderName: string;
public projectId: string;
public projectName: string;
public projectAcronym: string;
public startDate: string;
public endDate: string;
public code: string;
public jurisdiction: string;
public fundingLevel0: string;
}
export class ClaimContext{
public community: string;
public category: string;
public concept:any;
}

View File

@ -0,0 +1,176 @@
//Classes used in linking / inlinelinking when selecting an entity
import {HelperFunctions} from "../../utils/HelperFunctions.class";
export class ClaimResult {
public source: string;
public url: string;
public record: any;
public accessRights: string = "OPEN";
public embargoEndDate: string = "";
public date: string;
public authors: string[] = [];
public publisher: string;
public description: string;
DOI: string;
editors = [];
journal: string;
constructor() {
let today = new Date();
this.embargoEndDate = "" + (today.getFullYear()) + "-" + (today.getMonth() + 1) + "-" + (today.getDate());
this.authors = [];
this.accessRights = "OPEN";
this.editors = [];
}
}
export class ClaimProject {
public funderId: string;
public funderName: string;
public acronym: string;
public startDate: string;
public endDate: string;
public code: string;
public jurisdiction: string;
public fundingLevel0: string;
}
export class ClaimContext {
public community: string;
public category: string;
public concept: any;
}
export class Message {
public type: string;
public resultId: string;
public resultTitle: string;
projectId: string;
projectInfo: { title: string, startDate: string, endDate: string };
}
export class ClaimsErrorMessage {
public type: string;
inserted:number;
failed:number;
constructor(){
this.inserted = 0;
this.failed = 0;
}
}
export class ClaimEntity {
public id: string;
public type: string;
public title: string;
warningMessages: Message[];
errorMessages: Message[];
result: ClaimResult;
project: ClaimProject;
context: ClaimContext;
constructor() {
this.warningMessages = [];
this.errorMessages = [];
}
}
export class ClaimRecord2Insert {
claimedBy: string;
sourceId: string;
sourceType: string;
sourceCollectedFrom: string;
sourceAccessRights: string;
sourceEmbargoEndDate: string;
targetId: string;
targetType: string;
targetCollectedFrom: string;
targetAccessRights: string;
targetEmbargoEndDate: string;
constructor() {
}
}
export class ClaimDBRecord {
id: string;
userMail: string;
date: string;
sourceType: string;
targetType: string;
semantics: string;
approved: string;
source: ClaimDBResult | ClaimProject | ClaimContext;
target: ClaimDBResult;
indexed:boolean;
}
export class ClaimDBContext {
title: string;
openaireId: string;
}
export class ClaimDBProject {
openaireId: string;
name: string;
funderName: string;
funderId: string;
}
export class ClaimDBResult {
title: string;
authors: string[];
externalUrl: string;
openaireId: string;
doi: string;
accessRights: string;
collectedFrom: string;
resultType: string;
}
export class DirectIndexRecord {
public id: string;
record: any;
}
export class ShowOptions {
show: string; //show values: source, result, project, context, claim
linkTo: string; // linkTo /values: result, project, context
linkToEntities: string[]; // show linkToEntities /values: result, project, context
basketShowSources: boolean;
basketShowLinksTo: boolean;
constructor() {
this.show = "source";
this.linkTo = "project";
this.linkToEntities = ["project", "context", "result"];
this.basketShowSources = true;
this.basketShowLinksTo = false;
}
showSource() {
this.show = "source";
this.basketShowLinksTo = false;
this.basketShowSources = true;
HelperFunctions.scroll();
}
showLinkTo() {
this.show = this.linkTo;
this.basketShowLinksTo = true;
this.basketShowSources = false;
HelperFunctions.scroll();
}
showBasketSources() {
if (this.show != 'source') {
this.basketShowSources = !this.basketShowSources;
this.basketShowLinksTo = !this.basketShowSources;
}
}
}

View File

@ -0,0 +1,112 @@
<form class=" uk-margin-top uk-animation ">
<div class="">Start searching for projects and add them to the basket to link them to your sources
<!-- <helper div="link-project-form" tooltip=true></helper> -->
</div>
<input class=" uk-input uk-width-large" [(ngModel)]="keyword" name="keyword" placeholder="Search for projects..."/>
<span class="input-group-btn">
<button (click)="search(page,size)" type="submit" class=" uk-button portal-button">Search</button>
</span>
</form>
<div *ngIf="!showResults">
<div class="uk-text-center uk-text-large uk-text-muted uk-margin-large-top">No project results yet... <br>Start
searching for projects to add them in the Basket
</div>
</div>
<div *ngIf="showResults" class="uk-margin-top">
<div *ngIf="openaireResultsStatus == errorCodes.NONE" class="uk-alert uk-alert-primary"
role="alert">No Results found
</div>
<div *ngIf="openaireResultsStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning"
role="alert">An Error Occured
</div>
<div *ngIf="openaireResultsStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger"
role="alert">Service not available
</div>
<div class="uk-grid">
<div class="search-filters uk-width-medium">
<!-- <div class="uk-width-1-1 uk-margin-small-bottom ">
<div *ngIf="countFilters()>0" class="uk-margin-small-bottom">
<span *ngIf = "searchUtils.keyword.length > 0"><span class="uk-text-bold">Keywords:</span>
<a (click) = "clearKeywords() " title="Remove keywords" [class]="((disableForms)?' uk-disabled':' ')+' portal-color '"><span class=" clickable " aria-hidden="true"><span class="uk-icon ">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="0.8"><path fill="none" stroke="#000" stroke-width="1.6" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span></span></a>
<span [innerHtml]="searchUtils.keyword"></span>
</span>
<div *ngFor="let filter of filters " >
<span *ngIf = "filter.countSelectedValues > 0"> <span class="uk-text-bold">{{filter.title}}:</span>
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; " >
<a [title]="'Remove '+value.name"(click) = "removeFilter(value, filter) " [class]="((disableForms)?' uk-disabled':' ')+' portal-color '"><span class=" clickable" aria-hidden="true"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="0.8"><path fill="none" stroke="#000" stroke-width="1.6" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span></span></a>
<span [innerHtml]="(value.name.length > 25)?value.name.substring(0,25)+'...':value.name" [title]="value.name"></span><span *ngIf="!end" class=" ">, </span>
</span>
</span>
</div>
</div>
<div class="uk-margin-small-bottom uk-margin-small-top uk-grid">
<a *ngIf="countFilters()>1" (click)="clearFilters()" [class]="((disableForms)?'uk-disabled uk-link-muted':'')+' portal-link ' + 'uk-width-1-2'">
Clear All
</a>
</div>
</div> -->
<ul class="uk-list">
<li class="uk-open">
<h5 class="uk-margin-bottom-remove searchFilterTitle">Years range
</h5>
<div aria-expanded="false">
<div class="searchFilterBoxValues ">
<form class="uk-inline">
<input class=" uk-input uk-width-2-5" [(ngModel)]="startYear" name="keyword"
placeholder="Start year"/>
<input class=" uk-input uk-width-2-5" [(ngModel)]="endYear" name="keyword"
placeholder="End year"/>
<button type="submit" (click)="yearChanged()" style="cursor: pointer;" class="uk-icon"><svg width="20"
height="20"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-right"
ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline></svg></button>
</form>
</div>
</div>
</li>
</ul>
<search-filter *ngFor="let filter of filters " [isDisabled]="false" [filter]="filter" [showResultCount]=true
(onFilterChange)="filterChanged($event)"></search-filter>
</div>
<div class="uk-width-expand@m uk-width-1-1@s uk-first-column">
<div *ngIf="openaireResultsNum != null && openaireResultsNum > 0" class="uk-clearfix portal-hr ">
<div class="uk-grid">
<div *ngIf="openaireResultsNum>0" class="uk-width-1-2">
<span class="portal-color">{{openaireResultsNum|number}}</span> projects, page <span
class="portal-color">{{openaireResultsPage | number}}</span> of <span
class="portal-color">{{totalPages(openaireResultsNum)|number}}</span>
</div>
<div class="uk-width-1-2 uk-padding-remove">
<paging-no-load class="uk-float-right" [currentPage]="openaireResultsPage"
[totalResults]="openaireResultsNum" [term]="keyword" [size]="size"
(pageChange)="openaireResultsPageChange($event)"></paging-no-load>
</div>
</div>
</div>
<div *ngIf="openaireResultsStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1"
role="alert"><span class="loading-gif uk-align-center"></span></div>
<claim-results [localStoragePrefix]="localStoragePrefix" [results]=openaireResults
[selectedResults]=selectedProjects></claim-results>
</div>
</div>
</div>

View File

@ -1,211 +1,277 @@
import {Component, Input,Output, ElementRef, EventEmitter, ViewChild} from '@angular/core';
import {Observable, Subject } from 'rxjs';
import {Component, ElementRef, EventEmitter, Input, Output} from '@angular/core';
import {SearchProjectsService} from '../../services/searchProjects.service';
import {ProjectService} from '../../landingPages/project/project.service';
import {ClaimProject} from './claimEntities.class';
import {ClaimEntity, ClaimProject} from './claimHelper.class';
import {EnvProperties} from '../../utils/properties/env-properties';
import {ErrorCodes} from '../../utils/properties/errorCodes';
import {StringUtils} from "../../utils/string-utils.class";
import {Filter} from "../../searchPages/searchUtils/searchHelperClasses.class";
declare var UIkit:any;
import{EnvProperties} from '../../utils/properties/env-properties';
@Component({
selector: 'claim-projects-search-form',
template: `
<form [class]="((inlineClaim)?'':' uk-card uk-card-default uk-padding uk-padding-medium ')+ 'uk-animation' " >
<div class="uk-text-lead">Search for projects <helper div="link-project-form" tooltip=true></helper></div>
<div class="uk-grid">
<div class="uk-grid uk-width-expand">
<div class="uk-width-auto@m uk-first-column">
<select class="uk-select uk-width-large" [(ngModel)]="selectedFunderId" name="select_funder" >
<option value="0" (click)="funderChanged('0','Select funder:')">Select funder:</option>
<option *ngFor="let funder of funders" [value]="funder.id" (click)="funderChanged(funder.id,funder.name)">{{(funder.name.split("||").length > 0)?(funder.name.split("||")[0]+" ("+funder.name.split("||")[1]+")"):(funder.name)}}</option>
</select>
</div>
<div class="uk-width-expand@m">
<entities-autocomplete [(properties)]=properties entityType="project" [funderId]="selectedFunderId" [allowDuplicates]=true [showSelected]=false [placeHolderMessage] = "'Project name or ID'" title = "Projects" [multipleSelections]=true (addItem) = "select($event)" ></entities-autocomplete>
</div>
</div>
</div>
</form>
`
templateUrl:'claimProjectSearchForm.component.html',
})
export class ClaimProjectsSearchFormComponent {
ngOnInit() {
this.getFunders();
// this.getFunders();
// this.search(this.page, this.size);
}
// @ViewChild (ModalLoading) loading : ModalLoading ;
// @Input() public inline: boolean = false ; // for claimed started from landing pages
public query = '';
@Input() public selectedProjects=[] ;
@Input() public selectedProjects:ClaimEntity[]=[] ;
public elementRef;
public funders:string[];
public selectedFunderId:string ="0";
selectedFunderName:string ="Select funder:";
// public funders:string[];
// public selectedFunderId:string ="0";
// selectedFunderName:string ="Select funder:";
@Output() projectSelected = new EventEmitter();
@Input() public properties:EnvProperties;
@Input() public inlineClaim:boolean=false;
@Input() localStoragePrefix:string = "";
public errorCodes:ErrorCodes = new ErrorCodes();
public projects:string[];
public warningMessage = "";
public infoMessage = "";
openaireResults:ClaimEntity[] = [];
openaireResultsNum: number ;
openaireResultsPage : number = 1;
openaireResultsStatus:number = this.errorCodes.NONE;
page : number = 1;
size:number = 5;
keyword:string = '';
showResults = false;
// public searchTermStream = new Subject<string>();
// filtered: Observable<{}> = this.searchTermStream
// .debounceTime(300).distinctUntilChanged()
// .switchMap((term: string) => this._projectService.searchForProjectsObs(term, this.selectedFunderId));
public tries:number = 0 ;
public keywordlimit = 3;
// public openaireRefineFields: string[] = ["relfunder", "relproject", "resultbestaccessright", "instancetypename", "resultlanguagename", "community"];
// public openaireRefineFieldsQuery: string = "&refine=true&fields=funder&fields=projectstartyear&fields=projectendyear&fields=projectecsc39";
public refineFields: string[] = ["funder"];
public refineFieldsQuery: string = "&refine=true&fields=funder";
filters = [];
prevFilters = [];
startYear = "";
endYear = "";
constructor(private _service: ProjectService, private _projectService: SearchProjectsService, myElement: ElementRef) {
this.elementRef = myElement;
constructor(private _service: ProjectService, private _projectService: SearchProjectsService, myElement: ElementRef) {
this.elementRef = myElement;
}
// search() {
// console.info("heeere "+this.query );
// this.infoMessage = "";
// // this.filtered = [];
// if(this.query == ""){
// this.tries = 0;
// this.warningMessage = "";
// } else if(this.query && this.query.length < this.keywordlimit){
// this.tries++;
// if(this.tries == this.keywordlimit -1 ){
// this.warningMessage = "Type at least " + this.keywordlimit + " characters";
// this.tries = 0;
// }
// }else{
// console.info("doo the search "+this.query );
//
// this.tries = 0;
// this.warningMessage = "";
// this.searchTermStream.next(this.query);
//
// }
//
// }
select(item){
if(this.selectedProjects.length > 50){
UIkit.notification({
message : 'Your basket exceeds the number of allowed projects (50)',
status : 'warning',
timeout : 1500,
pos : 'top-center'
});
return;
}
this.query = "";
// this.searchTermStream.next(this.query); //clear
item = item.value;
var project: ClaimProject = new ClaimProject();
project.funderId = item.funderId;
project.funderName = item.funderName;
project.projectId = item.id;
project.projectName = item.projectName;
project.projectAcronym = item.projectAcronym;
project.startDate = item.startDate;
project.endDate = item.endDate;
project.code = item.code;
project.jurisdiction = item.jurisdiction;
project.fundingLevel0 = item.fundingLevel0;
search(page,size) {
if(this.keyword.length == 0){
this.showResults =false;
return;
}
this.showResults =true;
this.openaireResults = [];
this.openaireResultsStatus = this.errorCodes.LOADING;
this.prevFilters = this.filters;
// this._service.getProjectDates(project.projectId).subscribe(
// data => {
// project.startDate = data.startDate;
// project.endDate = data.endDate;
// },
// err => console.log(err)
// );
var index:number =this.selectedProjects.indexOf(project);
var found:boolean = false;
this.warningMessage = "";
//searchProjects (params: string, refineParams:string, page: number, size: number, refineFields:string[] , properties:EnvProperties ):any {
this._projectService.searchProjects(this.createOpenaireQueryParams(),(page==1)? this.refineFieldsQuery:null, page, size, (page==1)?this.refineFields:[], this.properties).subscribe(
data => {
if(data != null) {
this.openaireResultsPage=page;
this.openaireResultsNum = data[0];
this.openaireResults =ClaimProjectsSearchFormComponent.openaire2ClaimEntity(data[1]);
if(data[2] && data[2].length > 0){
this.filters = this.checkSelectedFilters( data[2], this.prevFilters);
}
for (var _i = 0; _i < this.selectedProjects.length; _i++) {
let item = this.selectedProjects[_i];
if(item.projectId == project.projectId){
found=true;
this.warningMessage = "Project already in your basket";
}
}
if (!found) {
this.selectedProjects.push(project);
if(this.selectedProjects != null){
localStorage.setItem(this.localStoragePrefix + "projects", JSON.stringify(this.selectedProjects));
this.openaireResultsStatus = this.errorCodes.DONE;
if(this.openaireResultsNum == 0){
this.openaireResultsStatus = this.errorCodes.NONE;
}
}else {
this.openaireResultsStatus = this.errorCodes.ERROR;
}
},
err => {
this.openaireResultsStatus = this.errorCodes.ERROR;
//console.log(err.status);
ClaimProjectsSearchFormComponent.handleError("Error getting projects by keyword: "+this.keyword, err);
}
this.projectSelected.emit({
value: true
});
UIkit.notification({
message : 'A new project added in the basket.',
status : 'primary',
timeout : 1500,
pos : 'top-center'
});
}else{
UIkit.notification({
message : 'The project is already in your basket.',
status : 'warning',
timeout : 1500,
pos : 'top-center'
});
}
}
showItem(item):string{
return ((item.field[1]['@value'])?item.field[1]['@value']+" - ":"" ) + item.field[3]['@value'];
}
remove(item){
var index:number =this.selectedProjects.indexOf(item);
if (index > -1) {
this.selectedProjects.splice(index, 1);
);
}
}
handleClick(event){
var clickedComponent = event.target;
var inside = false;
do {
if (clickedComponent === this.elementRef.nativeElement) {
inside = true;
}
clickedComponent = clickedComponent.parentNode;
} while (clickedComponent);
}
getFunders () {
this._projectService.getFunders(this.properties).subscribe(
data => {
this.funders = data[1];
},
err => {
this.handleError("Error getting funders", err);
//console.log(err)
// select(entity){
// if(this.selectedProjects.length > 50){
// UIkit.notification({
// message : 'Your basket exceeds the number of allowed projects (50)',
// status : 'warning',
// timeout : 1500,
// pos : 'top-center'
// });
// return;
// }
// this.query = "";
// // this.searchTermStream.next(this.query); //clear
// entity = entity.value;
// // var project: ClaimProject = new ClaimProject();
// // project.funderId = entity.funderId;
// // project.funderName = entity.funderName;
// // project.id = entity.id;
// // project.projectName = entity.projectName;
// // project.projectAcronym = entity.projectAcronym;
// // project.startDate = entity.startDate;
// // project.endDate = entity.endDate;
// // project.code = entity.code;
// // project.jurisdiction = entity.jurisdiction;
// // project.fundingLevel0 = entity.fundingLevel0;
//
//
// var index:number =this.selectedProjects.indexOf(entity);
// var found:boolean = false;
// this.warningMessage = "";
//
// for (var _i = 0; _i < this.selectedProjects.length; _i++) {
// let project = this.selectedProjects[_i];
// if(entity.id == project.id){
// found=true;
// this.warningMessage = "Project already in your basket";
// }
// }
//
// if (!found) {
// this.selectedProjects.push(entity);
// if(this.selectedProjects != null){
// localStorage.setItem(this.localStoragePrefix + "projects", JSON.stringify(this.selectedProjects));
// }
// this.projectSelected.emit({
// value: true
// });
//
// }
// }
/* static showItem(item):string{
return ((item.field[1]['@value'])?item.field[1]['@value']+" - ":"" ) + item.field[3]['@value'];
}*/
remove(item){
let index:number =this.selectedProjects.indexOf(item);
if (index > -1) {
this.selectedProjects.splice(index, 1);
}
);
}
getProjects () {
if(this.selectedFunderId != '0'){
}
/* handleClick(event){
var clickedComponent = event.target;
var inside = false;
do {
if (clickedComponent === this.elementRef.nativeElement) {
inside = true;
}
clickedComponent = clickedComponent.parentNode;
} while (clickedComponent);
}*/
static openaire2ClaimEntity(items){
const projects: ClaimEntity[] = [];
for(const item of items){
const entity: ClaimEntity = new ClaimEntity();
entity.project = new ClaimProject();
entity.project.funderId = item.funderId;
entity.project.funderName = item.funderShortname;
entity.id = item.id;
entity.title = item.title.name;
entity.project.acronym = item.acronym;
entity.project.startDate = item.startYear;
entity.project.endDate = item.endYear;
entity.project.code = item.code;
entity.project.jurisdiction = item.jurisdiction;
entity.project.fundingLevel0 = item.fundingLevel0;
entity.type="project";
projects.push(entity);
}
}
funderChanged(funderId:string, funderName:string){
this.selectedFunderId = funderId;
this.selectedFunderName = funderName;
//console.info("Selected funder:"+this.selectedFunderId+ ' name:'+funderName );
}
private handleError(message: string, error) {
return projects;
}
private openaireResultsPageChange($event) {
this.openaireResultsPage=$event.value;
this.openaireResults = [];
this.search(this.openaireResultsPage,this.size);
}
private static handleError(message: string, error) {
console.error("Claim project search form (component): "+message, error);
}
createOpenaireQueryParams():string {
let query = "";
if(this.keyword.length > 0){
query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword));
}
if(this.startYear.length > 0 ){
query+='&fq=projectstartyear exact \"'+this.startYear+'\"'
}
if(this.endYear.length > 0 ){
query+='&fq=projectendyear exact \"'+this.endYear+'\"'
}
let allFqs = "";
for (let filter of this.filters){
if(filter.countSelectedValues > 0){
let count_selected=0;
let fq = "";
for (let value of filter.values){
if(value.selected == true){
count_selected++;
fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + (StringUtils.quote(value.id));
}
}
if(count_selected > 0){
fq="&fq="+StringUtils.URIEncode(fq);
allFqs += fq;
}
}
}
return query+allFqs;
}
public yearChanged() {
this.search(this.page, this.size);
}
filterChanged($event) {
this.search(this.page, this.size);
}
public checkSelectedFilters(filters:Filter[], prevFilters:Filter[]){
for(let i=0; i< filters.length ; i++){
let filter:Filter = filters[i];
filter.countSelectedValues = 0;
let prevFilterSelectedValues:string[] = [];
for(let j=0; j< prevFilters.length ; j++){
if(filters[i].filterId == prevFilters[j].filterId){
if(prevFilters[j].countSelectedValues >0){
for(let filterValue of prevFilters[j].values) {
if(filterValue.selected){
prevFilterSelectedValues.push(filterValue.id);
}
}
}
break;
}
}
for(let filterValue of filter.values) {
if(prevFilterSelectedValues.indexOf(filterValue.id) > -1) {
filterValue.selected = true;
filter.countSelectedValues++;
}
}
}
return filters;
}
totalPages(totalResults: number): number {
let totalPages:any = totalResults/(this.size);
if(!(Number.isInteger(totalPages))) {
totalPages = (parseInt(totalPages, 10) + 1);
}
return totalPages;
}
}

View File

@ -11,11 +11,17 @@ import {ProjectsServiceModule} from '../../services/projectsService.module';
import {EntitiesAutocompleteModule} from '../../utils/entitiesAutoComplete/entitiesAutoComplete.module';
import {HelperModule} from '../../utils/helper/helper.module';
import {ClaimResultsModule} from './claimResults.module';
import {PagingModule } from '../../utils/paging.module';
import {SearchFilterModule} from '../../searchPages/searchUtils/searchFilter.module';
@NgModule({
imports: [
SharedModule, CommonModule,
// LoadingModalModule,
ProjectServiceModule, ProjectsServiceModule, EntitiesAutocompleteModule, HelperModule
ProjectServiceModule, ProjectsServiceModule, EntitiesAutocompleteModule, HelperModule,
PagingModule, SearchFilterModule, ClaimResultsModule
],
providers:[
],

View File

@ -1,184 +1,276 @@
<form class=" uk-padding uk-padding-medium uk-padding-remove-left uk-margin-left uk-margin-small-top" >
<div class="uk-grid">
<div class="uk-width-expand">
<div class="uk-text-lead">Search for research results <helper div="link-result-form" styleName="" tooltip=true></helper> </div>
<select [(ngModel)]="searchSource" name="select_source" (ngModelChange)="searchSourceChanged(searchSource)" class="uk-select uk-width-1-4">
<option value="openaire">in OpenAIRE </option>
<option value="crossref">in Crossref </option>
<option value="datacite">in Datacite </option>
<option value="orcid">in ORCID </option>
<option value="all">Search all</option>
</select>
<!--div class="uk-grid">
<div class="uk-width-1-4">
<div>
<label><input class="uk-radio" type="radio" name="searchsource" value="openaire" [checked]="searchSource === 'openaire'" (change)="searchSource='openaire'; searchSourceChanged(searchSource)" > in OpenAIRE</label>
</div>
<div>
<label><input class="uk-radio" type="radio" name="searchsource" value="crossref" [checked]="searchSource === 'crossref'" (change)="searchSource='crossref'; searchSourceChanged(searchSource)" > in Crossref</label>
</div>
<div>
<label><input class="uk-radio" type="radio" name="searchsource" value="datacite" [checked]="searchSource === 'datacite'" (change)="searchSource='datacite'; searchSourceChanged(searchSource)" > in Datacite</label>
</div>
<div>
<label><input class="uk-radio" type="radio" name="searchsource" value="orcid" [checked]="searchSource === 'orcid'" (change)="searchSource='orcid'; searchSourceChanged(searchSource)" > in ORCID</label>
</div>
<div>
<label><input class="uk-radio" type="radio" name="searchsource" value="all" [checked]="searchSource === 'all'" (change)="searchSource='all'; searchSourceChanged(searchSource)" > Search all</label>
</div>
</div-->
<input class=" uk-input uk-width-1-2 form-control" [(ngModel)]="keyword" name="keyword" placeholder="Title, doi, author, orcid..."/>
<span class="input-group-btn">
<button (click)="search(false)" type="submit" class=" uk-button portal-button">Search</button>
</span>
<!--/div-->
</div>
<!--helper div="link-result-form" styleName="uk-width-medium"></helper-->
<form class=" uk-margin-top">
<div class="">Start searching Research Results and add them to the Basket to Link
<!-- <helper div="link-entity-form" styleName="" tooltip=true></helper> -->
</div>
<input class=" uk-input uk-width-large form-control" [(ngModel)]="keyword" name="keyword"
placeholder="Search for research results..."/>
<span class="input-group-btn">
<button (click)="search(true)" type="submit" class=" uk-button portal-button">Search</button>
</span>
<!--helper div="link-entity-form" styleName="uk-width-medium"></helper-->
</form>
<div *ngIf="showSearchResults" class="uk-margin-top uk-animation">
<ul class="uk-tab" uk-tab="animation: uk-animation-fade">
<li *ngIf="searchSource == 'all' || searchSource == 'openaire'" (click)="clickTab('openairePub')" ><a>Publications ({{ (openairePubsNum)?(openairePubsNum | number):0 }})</a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'openaire'" (click)="clickTab('openaireData')" ><a>Research Data ({{(openaireDataNum==null)?'0':(openaireDataNum | number)}})</a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'openaire'" (click)="clickTab('openaireSoftware')" ><a>Software ({{(openaireSoftwareNum==null)?'0':(openaireSoftwareNum | number)}})</a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'openaire'" (click)="clickTab('openaireORP')" ><a>Other research products ({{(openaireORPNum==null)?'0':(openaireORPNum | number)}})</a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'crossref'" (click)="clickTab('crossref')" ><a>Crossref ({{(crossrefResultsNum)?(crossrefResultsNum | number):0}})</a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'datacite'" (click)="clickTab('datacite')"><a>Datacite ({{(dataciteResultsNum==null)?'0':(dataciteResultsNum | number)}})</a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'orcid'" (click)="clickTab('orcid')"><a>Orcid ({{(orcidResultsNum)?(orcidResultsNum | number):0}})</a></li>
</ul>
<div *ngIf="!showSearchResults">
<div class="uk-text-center uk-text-large uk-text-muted uk-margin-large-top">
No research results yet...<br>Start searching for research results to add them in the Basket
</div>
</div>
<div *ngIf="showSearchResults" class="uk-margin-top uk-animation">
<ul class="uk-tab" uk-tab="animation: uk-animation-fade">
<li (click)="clickTab('openaire')" [class]="(activeTab == 'openaire')?'uk-active':''"><a>Openaire <span
*ngIf="!(totalOpenaireCount==0 && openaireResultsStatus === errorCodes.LOADING)">
({{totalOpenaireCount| number}})</span></a>
</li>
<li (click)="clickTab('crossref')" [class]="(activeTab == 'crossref')?'uk-active':''"><a>Crossref
<span
*ngIf="crossrefResultsNum != null && crossrefResultsNum >= 0 ">({{crossrefResultsNum | number}})</span>
</a></li>
<li (click)="clickTab('datacite')" [class]="(activeTab == 'datacite')?'uk-active':''"><a>Datacite <span
*ngIf="dataciteResultsNum!=null && dataciteResultsNum >= 0">({{dataciteResultsNum | number}})</span></a>
</li>
<li (click)="clickTab('orcid')" [class]="(activeTab == 'orcid')?'uk-active':''"><a>Orcid <span
*ngIf="orcidResultsNum !=null">({{(orcidResultsNum > 0) ? (orcidResultsNum | number) : 0}})</span></a></li>
</ul>
<div *ngIf="activeTab == 'crossref'" id="crossref" >
<div class="uk-margin-top" >
<div *ngIf="crossrefStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"></div>
<div *ngIf="crossrefStatus != errorCodes.LOADING && crossrefResults.length == 0" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="crossrefStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="crossrefStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div *ngIf="crossrefResultsNum != null && crossrefResultsNum > 0" class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="crossrefPage" [totalResults]="crossrefResultsNum" [term]="keyword" [size]="size" (pageChange)="crossrefPageChange($event)"> </paging-no-load>
</div>
</div>
<div >
<div *ngIf="activeTab == 'crossref'" id="crossref">
<div class="uk-margin-top">
<div *ngIf="crossrefStatus == errorCodes.NONE" class="uk-alert uk-alert-primary"
role="alert">No Results found
</div>
<div *ngIf="crossrefStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured
</div>
<div *ngIf="crossrefStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger"
role="alert">Service not available
</div>
<div *ngIf="crossrefResultsNum != null && crossrefResultsNum > 0" class="uk-clearfix portal-hr">
<div class="uk-grid">
<div *ngIf="crossrefResultsNum>0" class="uk-width-1-2">
<span class="portal-color">{{crossrefResultsNum|number}}</span> results, page <span
class="portal-color">{{crossrefPage | number}}</span> of <span
class="portal-color">{{countTotalPages(crossrefResultsNum)|number}}</span>
<claim-results [localStoragePrefix]=localStoragePrefix [(results)]=crossrefResults [(selectedResults)]=selectedResults> </claim-results>
</div>
</div>
<div class="uk-width-1-2">
<paging-no-load class="uk-float-right" [currentPage]="crossrefPage" [totalResults]="crossrefResultsNum"
[term]="keyword"
[size]="size" (pageChange)="crossrefPageChange($event)"></paging-no-load>
</div>
</div>
<div *ngIf="activeTab == 'openairePub'" id="openairePubs" class="uk-animation-fade" >
<div class = "uk-margin-top">
<div *ngIf="openairePubsStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div>
<div *ngIf="openairePubsStatus == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="openairePubsStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="openairePubsStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div *ngIf="openairePubsNum != null && openairePubsNum > 0" class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="openairePubsPage" [totalResults]="openairePubsNum" [term]="keyword" [size]="size" (pageChange)="openairePubsPageChange($event)"> </paging-no-load>
</div>
</div>
<div >
<claim-results [localStoragePrefix]=localStoragePrefix [localStoragePrefix]=localStoragePrefix [(results)]=openairePubs [(selectedResults)]=selectedResults > </claim-results>
</div>
</div>
</div>
<div *ngIf="activeTab == 'orcid'" id="orcid" class="uk-animation-fade">
<div class="uk-margin-top" >
<div *ngIf="orcidStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div>
<div *ngIf="orcidStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="orcidStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div *ngIf="orcidStatus == errorCodes.NONE && (!authorIds ||authorIds.length == 0)" class = "uk-alert uk-alert-primary " > No results found </div>
<div *ngIf="orcidResultsNum != null" class="panel-body">
<span>Results for
<a target="_blank" href="http://orcid.org/{{authorId}}"> <span class="custom-external"></span> {{authorGivenName}} {{authorFamilyName}} - {{authorId}} </a> :
</span>
<div *ngIf="authors.length > 1" class = "uk-alert uk-alert-warning " > Not the author you are looking for?
<span class="dropdown">
<select [(ngModel)]="selectAuthorId" name="select_author" (ngModelChange)="getOrcidResultsById(selectAuthorId)" >
<option [value]="0">Choose another one: </option>
<option *ngFor=" let item of authors let i = index" [value]="authors[i].id">{{authors[i].authorGivenName}} {{authors[i].authorFamilyName}} : {{authors[i].id}} </option>
</select>
</span>
</div>
<div *ngIf=" ((orcidResultsNum >0) && (totalPages > 1) && ( 0 < page && page <= totalPages )) " class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="orcidPage" [totalResults]="orcidResultsNum" [term]="keyword" [size]="size" (pageChange)="orcidPageChange($event)"> </paging-no-load>
</div>
</div>
<div >
<claim-results [localStoragePrefix]=localStoragePrefix [localStoragePrefix]=localStoragePrefix *ngIf="orcidResultsNum >0 && orcidResultsToShow.length > 0 " [(results)]=orcidResultsToShow [(selectedResults)]=selectedResults > </claim-results>
<div *ngIf="orcidResultsNum == 0" class = "uk-alert uk-alert-primary " > No results found </div>
</div>
</div>
</div>
</div>
<div *ngIf="activeTab == 'datacite'" id="datacite" class="uk-animation-fade">
<div *ngIf="dataciteStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div>
<div *ngIf="dataciteStatus == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="dataciteStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="dataciteStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div class = "uk-margin-top">
<div *ngIf="dataciteResultsNum != null && dataciteResultsNum > 0" class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="datacitePage" [totalResults]="dataciteResultsNum" [term]="keyword" [size]="size" (pageChange)="datacitePageChange($event)"> </paging-no-load>
</div>
</div>
<div >
<claim-results [localStoragePrefix]=localStoragePrefix *ngIf="dataciteResults.length > 0 " [(results)]=dataciteResults [(selectedResults)]=selectedResults > </claim-results>
</div>
</div>
</div>
<div *ngIf="activeTab == 'openaireData'" id="openaireData" class="uk-animation-fade">
<div *ngIf="openaireDataStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div>
<div *ngIf="openaireDataStatus == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="openaireDataStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="openaireDataStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div class = "uk-margin-top">
<div *ngIf="openaireDataNum != null && openaireDataNum > 0" class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="openaireDataPage" [totalResults]="openaireDataNum" [term]="keyword" [size]="size" (pageChange)="openaireDataPageChange($event)"> </paging-no-load>
</div>
</div>
<div >
<claim-results [localStoragePrefix]=localStoragePrefix [(results)]=openaireData [(selectedResults)]=selectedResults > </claim-results>
</div>
</div>
</div>
<div *ngIf="activeTab == 'openaireSoftware'" id="openaireSoftware" class="uk-animation-fade">
<div *ngIf="openaireSoftwareStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div>
<div *ngIf="openaireSoftwareStatus == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="openaireSoftwareStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="openaireSoftwareStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div class = "uk-margin-top">
<div *ngIf="openaireSoftwareNum != null && openaireSoftwareNum > 0" class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="openaireSoftwarePage" [totalResults]="openaireSoftwareNum" [term]="keyword" [size]="size" (pageChange)="openaireSoftwarePageChange($event)"> </paging-no-load>
</div>
</div>
<div>
<claim-results [localStoragePrefix]=localStoragePrefix [(results)]=openaireSoftware [(selectedResults)]=selectedResults > </claim-results>
</div>
</div>
</div>
<div *ngIf="activeTab == 'openaireORP'" id="openaireORP" class="uk-animation-fade">
<div *ngIf="openaireORPStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><span class="loading-gif uk-align-center" ></span></div>
<div *ngIf="openaireORPStatus == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="openaireORPStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="openaireORPStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div class = "uk-margin-top">
<div *ngIf="openaireORPNum != null && openaireORPNum > 0" class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="openaireORPPage" [totalResults]="openaireORPNum" [term]="keyword" [size]="size" (pageChange)="openaireORPPageChange($event)"> </paging-no-load>
</div>
</div>
<div>
<claim-results [localStoragePrefix]=localStoragePrefix [(results)]=openaireORP [(selectedResults)]=selectedResults > </claim-results>
</div>
</div>
<div *ngIf="crossrefStatus === errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1"
role="alert"><span class="loading-gif uk-align-center"></span></div>
<div>
<claim-results [localStoragePrefix]=localStoragePrefix [results]=crossrefResults
[selectedResults]=selectedResults></claim-results>
</div>
</div>
</div>
<div *ngIf="activeTab == 'openaire'" id="openaire" class="uk-animation-fade">
<div class="uk-grid">
<div class="search-filters uk-width-medium">
<!-- <div class="uk-width-1-1 uk-margin-small-bottom ">
<div *ngIf="countFilters()>0" class="uk-margin-small-bottom">
&lt;!&ndash;<span *ngIf = "searchUtils.keyword.length > 0"><span class="uk-text-bold">Keywords:</span>
<a (click) = "clearKeywords() " title="Remove keywords" [class]="((disableForms)?' uk-disabled':' ')+' portal-color '"><span class=" clickable " aria-hidden="true"><span class="uk-icon ">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="0.8"><path fill="none" stroke="#000" stroke-width="1.6" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span></span></a>
<span [innerHtml]="searchUtils.keyword"></span>
</span>&ndash;&gt;
<div *ngFor="let filter of openaireResultsfilters " >
<span *ngIf = "filter.countSelectedValues > 0"> <span class="uk-text-bold">{{filter.title}}:</span>
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; " >
<a [title]="'Remove '+value.name"(click) = "removeFilter(value, filter) "
[class]="((openaireResultsStatus === errorCodes.LOADING)?' uk-disabled':' ')+' portal-color '"><span class=" clickable" aria-hidden="true"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="0.8"><path fill="none" stroke="#000" stroke-width="1.6" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span></span></a>
<span [innerHtml]="(value.name.length > 25)?value.name.substring(0,25)+'...':value.name" [title]="value.name"></span><span *ngIf="!end" class=" ">, </span>
</span>
</span>
</div>
</div>
<div class="uk-margin-small-bottom uk-margin-small-top uk-grid">
<a *ngIf="countFilters()>1" (click)="clearFilters()" [class]="((openaireResultsStatus ===
errorCodes.LOADING)?'uk-disabled uk-link-muted':'')+' portal-link ' + 'uk-width-1-2'">
Clear All
</a>
</div>
</div>-->
<!-- Type filter-->
<ul class="uk-list">
<li class="uk-open">
<h5 class="uk-margin-bottom-remove searchFilterTitle">Type (4)
</h5>
<div aria-expanded="false">
<div class="searchFilterBoxValues ">
<div *ngFor="let type of openaireTypeValues" class="uk-animation-fade filterItem">
<span class="filterName"><div title="{{type.title}}">
<input [value]="type.value" [(ngModel)]="openaireResultsType" [name]=type.value
type="radio" (ngModelChange)="openaireTypeChanged(type.value)"/>
{{type.title}}</div></span>
<span *ngIf="type.count!=null">({{type.count|number}})</span>
</div>
</div>
</div>
</li>
<li class="uk-open">
<h5 class="uk-margin-bottom-remove searchFilterTitle">Published in
</h5>
<div aria-expanded="false">
<div class="searchFilterBoxValues ">
<form class="uk-inline">
<input class=" uk-input uk-width-small" [(ngModel)]="openaireYear" name="keyword"
placeholder="Year (e.g. 2010)"/>
<button type="submit" (click)="yearChanged()" style="cursor: pointer;" class="uk-icon"><svg width="20" height="20"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-right"
ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline></svg></button>
</form>
</div>
</div>
</li>
</ul>
<search-filter *ngFor="let filter of openaireResultsfilters " [isDisabled]="false" [filter]="filter"
[showResultCount]=true
(onFilterChange)="filterChanged($event)"></search-filter>
</div>
<div class="uk-width-expand@m uk-width-1-1@s uk-first-column">
<div class="uk-margin-top">
<div *ngIf="openaireResultsStatus == errorCodes.NONE" class="uk-alert uk-alert-primary"
role="alert">No Results found
</div>
<div *ngIf="openaireResultsStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning"
role="alert">An Error Occured
</div>
<div *ngIf="openaireResultsStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger"
role="alert">Service not available
</div>
<div *ngIf="openaireResultsNum != null && openaireResultsNum > 0" class="uk-clearfix portal-hr ">
<div class="uk-grid">
<div *ngIf="openaireResultsNum>0" class="uk-width-1-2">
<span class="portal-color">{{openaireResultsNum|number}}</span> results, page <span
class="portal-color">{{openaireResultsPage | number}}</span> of <span
class="portal-color">{{countTotalPages(openaireResultsNum)|number}}</span>
</div>
<div class="uk-width-1-2 uk-padding-remove">
<paging-no-load class="uk-float-right" [currentPage]="openaireResultsPage"
[totalResults]="openaireResultsNum" [term]="keyword"
[size]="size" (pageChange)="openaireResultsPageChange($event)"></paging-no-load>
</div>
</div>
</div>
<div *ngIf="openaireResultsStatus === errorCodes.LOADING"
class="uk-animation-fade uk-margin-top uk-width-1-1"
role="alert"><span class="loading-gif uk-align-center"></span></div>
<claim-results [localStoragePrefix]=localStoragePrefix
[results]=openaireResults [selectedResults]=selectedResults></claim-results>
</div>
</div>
</div>
</div>
<div *ngIf="activeTab == 'orcid'" id="orcid" class="uk-animation-fade">
<div class="uk-margin-top">
<div *ngIf="orcidStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="orcidStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger"
role="alert">Service not available
</div>
<div *ngIf="orcidStatus == errorCodes.NONE && orcidResultsNum == -1"
class="uk-alert uk-alert-primary "> No results found
</div>
<div *ngIf=" ((orcidResultsNum >0) && (totalPages > 1) && ( 0 < page && page <= totalPages )) "
class="uk-clearfix portal-hr">
<div class="uk-grid">
<div *ngIf="orcidResultsNum>0" class="uk-width-1-2">
<span class="portal-color">{{orcidResultsNum|number}}</span> results, page <span
class="portal-color">{{orcidPage | number}}</span> of <span
class="portal-color">{{countTotalPages(orcidResultsNum)|number}}</span>
</div>
<div class="uk-width-1-2">
<paging-no-load class="uk-float-right" [currentPage]="orcidPage" [totalResults]="orcidResultsNum"
[term]="keyword" [size]="size"
(pageChange)="orcidPageChange($event)"></paging-no-load>
</div>
</div>
</div>
<div *ngIf="orcidResultsNum >= 0" class="panel-body">
<span><span class="uk-text-bold">Showing results for</span>
<a target="_blank" href="http://orcid.org/{{authorId}}"> <span
class="custom-external"></span> {{authorGivenName}} {{authorFamilyName}} - {{authorId}} </a> :
</span>
<div *ngIf="authors.length > 1" class=""> In Orcid you can search only by Author. Not the
author you are looking for?
<div class="dropdown">
<select [(ngModel)]="selectAuthorId" name="select_author"
(ngModelChange)="getOrcidResultsById(selectAuthorId)" class="uk-select">
<option [value]="0">Choose another one:</option>
<option *ngFor=" let item of authors let i = index"
[value]="authors[i].id">{{authors[i].authorGivenName}} {{authors[i].authorFamilyName}} : {{authors[i].id}} </option>
</select>
</div>
</div>
<div>
<claim-results [localStoragePrefix]=localStoragePrefix
*ngIf="orcidResultsNum >0 && orcidResultsToShow.length > 0 " [results]=orcidResultsToShow
[selectedResults]=selectedResults></claim-results>
<div *ngIf="orcidResultsNum == 0" class="uk-alert uk-alert-primary uk-margin-top"> No results found</div>
</div>
</div>
<div *ngIf="orcidStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert">
<span class="loading-gif uk-align-center"></span></div>
</div>
</div>
<div *ngIf="activeTab == 'datacite'" id="datacite" class="uk-animation-fade">
<div *ngIf="dataciteStatus == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="dataciteStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured
</div>
<div *ngIf="dataciteStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger"
role="alert">Service not available
</div>
<div class="uk-margin-top">
<div *ngIf="dataciteResultsNum != null && dataciteResultsNum > 0" class="uk-clearfix portal-hr">
<div class="uk-grid">
<div *ngIf="dataciteResultsNum>0" class="uk-width-1-2">
<span class="portal-color">{{dataciteResultsNum|number}}</span> results, page <span
class="portal-color">{{datacitePage | number}}</span> of <span
class="portal-color">{{countTotalPages(dataciteResultsNum)|number}}</span>
</div>
<div class="uk-width-1-2 ">
<paging-no-load class="uk-float-right" [currentPage]="datacitePage" [totalResults]="dataciteResultsNum" [term]="keyword"
[size]="size" (pageChange)="datacitePageChange($event)"></paging-no-load>
</div>
</div>
</div>
<div *ngIf="dataciteStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1"
role="alert"><span class="loading-gif uk-align-center"></span></div>
<div>
<claim-results [localStoragePrefix]=localStoragePrefix *ngIf="dataciteResults.length > 0 "
[results]=dataciteResults [selectedResults]=selectedResults></claim-results>
</div>
</div>
</div>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../../shared/shared.module';
import { CommonModule } from '@angular/common';
import {ClaimResultSearchFormComponent} from './claimResultSearchForm.component';
import {ClaimResultsComponent} from './claimResults.component';
import {ClaimResultsModule} from './claimResults.module';
import {SearchDataciteServiceModule} from './service/searchDataciteService.module';
@ -16,17 +16,18 @@ import {SoftwareServiceModule} from '../../services/softwareService.module';
import {OrpsServiceModule} from '../../services/orpsService.module';
import {PagingModule } from '../../utils/paging.module';
import {HelperModule} from '../../utils/helper/helper.module';
import {SearchFilterModule} from '../../searchPages/searchUtils/searchFilter.module';
@NgModule({
imports: [SharedModule, CommonModule, PublicationsServiceModule, DatasetsServiceModule, PagingModule, SearchCrossrefServiceModule,
SearchDataciteServiceModule,SoftwareServiceModule, OrpsServiceModule, HelperModule],
SearchDataciteServiceModule,SoftwareServiceModule, OrpsServiceModule, HelperModule, SearchFilterModule, ClaimResultsModule],
providers:[
SearchOrcidService
],
declarations: [
ClaimResultSearchFormComponent, ClaimResultsComponent
ClaimResultSearchFormComponent
],
exports: [ClaimResultSearchFormComponent, ClaimResultsComponent ]
exports: [ClaimResultSearchFormComponent ]
})
export class ClaimResultSearchFormModule { }

View File

@ -1,84 +1,84 @@
import {Component, Input, Output, EventEmitter} from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import {Component, Input} from '@angular/core';
import {ClaimEntity} from './claimHelper.class';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {ClaimResult} from '../claim-utils/claimEntities.class';
declare var UIkit:any;
declare var UIkit: any;
@Component({
selector: 'claim-results',
template:`
selector: 'claim-results',
template: `
<ul *ngIf="results.length > 0 " class="uk-list uk-list-divider">
<li *ngFor=" let result of results " [class]="(isSelected(result.id))?'uk-block-muted':''">
<div >
<a *ngIf="result.url" target="_blank" [href]="result.url" >{{result.title?result.title:'[No title available]'}}</a>
<span *ngIf="!result.url" >{{result.title?result.title:'[No title available]'}}</span>
<a class="uk-button-default uk-align-right" *ngIf="!isSelected(result.id)"
(click)="add(result)" class="uk-icon-button icon-button-small">
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span>
<ul *ngIf="results.length > 0 " class="uk-list uk-list-divider">
<li *ngFor=" let entity of results " [class]="(isSelected(entity))?'uk-block-muted':''">
<div>
<div class="uk-text-muted">
{{(!entity.result) ? entity.type : ((entity.result && entity.result.source == 'openaire') ? entity.type : (entity.result && entity.result.source + ' result'))}}
</div>
<div class="uk-grid">
<div class="uk-width-expand">
<claim-title [entity]="entity"></claim-title>
<claim-result-metadata [entity]="entity"></claim-result-metadata>
<claim-project-metadata [entity]="entity"></claim-project-metadata>
</div>
<div class="uk-margin-auto-vertical">
<a class="uk-icon-button" *ngIf="!isSelected(entity)"
(click)="add(entity)">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus"
ratio="1"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17"
height="1"></rect></svg>
</span>
</a>
<span *ngIf="isSelected(entity)" class="uk-icon-button portal-icon-button">
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="check" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.1" points="4,10 8,15 17,4"></polyline></svg>
</span>
</span>
</div>
</div>
</a>
<span *ngIf="isSelected(result.id)" class="uk-label uk-label-success">Added</span>
</div>
<span *ngIf="result.publisher!=null" class="uk-article-meta">Publisher: {{result.publisher}}</span>
<span *ngIf="result.journal!=null" class="uk-article-meta">Journal: {{result.journal}}</span><span *ngIf="(result.date)" class="uk-article-meta"> ({{result.date}})</span>
<div *ngIf="result.authors && result.authors.length >0 " class="uk-article-meta">Authors: <span *ngFor="let author of result.authors.slice(0,10) let i = index">{{author}}{{(i < (result.authors.slice(0,10).length-1))?"; ":""}}{{(i == result.authors.slice(0,10).length-1 && result.authors.length > 10)?"...":""}}</span></div>
<div *ngIf="result.editors && result.editors.length > 0" class="uk-article-meta">Editors: <span *ngFor="let author of result.editors.slice(0,10) let i = index">{{author}}{{(i < (result.authors.slice(0,10).length-1))?"; ":""}}{{(i == result.authors.slice(0,10).length-1 && result.authors.length > 10)?"...":""}}</span></div>
</div>
</li>
</ul>`,
</ul>`,
})
export class ClaimResultsComponent {
@Input() results;
@Input() selectedResults;
@Input() localStoragePrefix:string = "";
private isSelected(id:string){
@Input() results: ClaimEntity[];
@Input() selectedResults: ClaimEntity[];
@Input() localStoragePrefix: string = "";
var found:boolean = false;
for (var _i = 0; _i < this.selectedResults.length; _i++) {
let item = this.selectedResults[_i];
if(item.id == id){
found=true;
}
}
return found;
}
add(item){
if(this.selectedResults.length > 150){
UIkit.notification({
message : 'Your basket exceeds the number of allowed results (150)',
status : 'warning',
timeout : 1500,
pos : 'top-center'
});
return;
}
var found:boolean = this.isSelected( item.id);
if (!found) {
this.selectedResults.push(item);
UIkit.notification({
message : 'A new research result added in your basket.',
status : 'primary',
timeout : 1500,
pos : 'top-center'
});
if(this.results != null){
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.selectedResults));
}
}else{
UIkit.notification({
message : 'The research result is already in your basket.',
status : 'warning',
timeout : 1500,
pos : 'top-center'
});
}
private isSelected(result: ClaimEntity) {
let found: boolean = false;
const id = result.id;
for (let _i = 0; _i < this.selectedResults.length; _i++) {
let item = this.selectedResults[_i];
if (item.id && item.id == id) {
found = true;
break;
}
}
return found;
// indexOf doesn't work when results came from
// return this.selectedResults.indexOf(entity)!=-1;
}
add(item: ClaimEntity) {
if (this.selectedResults.length > 150) {
UIkit.notification({
message: 'Your basket exceeds the number of allowed results (150)',
status: 'warning',
timeout: 1500,
pos: 'top-center'
});
return;
}
let found: boolean = this.isSelected(item);
if (!found) {
this.selectedResults.push(item);
if (this.selectedResults != null) {
localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.selectedResults));
}
}
}
}

View File

@ -0,0 +1,22 @@
import { NgModule } from '@angular/core';
import { SharedModule } from '../../shared/shared.module';
import { CommonModule } from '@angular/common';
import {ClaimResultsComponent} from './claimResults.component';
import {ClaimEntitiesMetadataModule} from "../linking/selected/ClaimEntitiesMetadata.module";
@NgModule({
imports: [
SharedModule, CommonModule, ClaimEntitiesMetadataModule
],
providers:[
],
declarations: [
ClaimResultsComponent
],
exports: [ClaimResultsComponent ]
})
export class ClaimResultsModule { }

View File

@ -1,192 +1,249 @@
<schema2jsonld *ngIf="url" [URL]="url" name="Manage links" type="other"></schema2jsonld>
<schema2jsonld *ngIf="url" [URL]="url" name="Manage links" type="other"></schema2jsonld>
<div class="uk-width-1-1">
<helper position="top"></helper>
</div>
<div class="uk-grid helper-grid">
<helper position="left" styleName=" uk-width-1-5 uk-padding-left"></helper>
<div class="uk-width-expand">
<!-- <div *ngIf="claims && claims.length > 0" class="uk-alert uk-alert-primary">
<span class="uk-margin-small-right uk-icon" uk-icon="warning"></span>
Newly added links for OpenAIRE research results will be available on the next run of our algorithms.
<div class="uk-margin-left">Links to external results (Crossref, Datacite, Orcid) are automatically added in OpenAIRE information space.</div>
</div> -->
<!-- <div *ngIf="showLatestClaims && recentClaims.length > 0" class="uk-section uk-section-muted uk-padding-small uk-padding-right uk-padding-left">
<div *ngIf="showLatestClaims && recentClaims.length > 0" class="uk-h5">
<span uk-tooltip="title:<div class='uk-margin-small'> Claims created during the last 24 hours</div>">
Recent links
</span>
</div>
<table *ngIf="showLatestClaims && recentClaims.length > 0" class="uk-table uk-table-small uk-table-striped">
<thead>
<tr>
<th><a (click)="changeOrderby('target')" >Research Result</a> </th>
<th><a (click)="changeOrderby('source')" >Link to</a> </th>
<th *ngIf="showUserEmail"><a (click)="changeOrderby('user')" >Claimed by</a> </th>
<th><a (click)="changeOrderby('date')"> Claimed Date</a></th>
<th *ngIf="showLatestClaims">Status</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let claim of recentClaims " >
<td><claim-entity [entity]="claim.target" [type]="claim.targetType" [(properties)]=properties> </claim-entity></td>
<td><claim-entity [entity]="claim.source" [type]="claim.sourceType" [(properties)]=properties> </claim-entity></td>
<td *ngIf="showUserEmail">{{claim.userMail}}</td>
<td>{{claim.date}}</td>
<td *ngIf="showLatestClaims">
<span class="uk-icon" [attr.uk-tooltip]="'title:<div class=\'uk-margin-small\'>'+getclaimStatus(claim)+'</div>'">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="question" ratio="1">
<circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle><circle cx="10.44" cy="14.42" r="1.05"></circle><path fill="none" stroke="#000" stroke-width="1.2" d="M8.17,7.79 C8.17,4.75 12.72,4.73 12.72,7.72 C12.72,8.67 11.81,9.15 11.23,9.75 C10.75,10.24 10.51,10.73 10.45,11.4 C10.44,11.53 10.43,11.64 10.43,11.75"></path></svg>
</span>
</td>
</tr>
</tbody>
</table>
</div> -->
<div class="uk-width-expand uk-margin-large-top">
<form class="">
<div class="-row">
<span class="uk-text-bold">Filter By:</span>
<input type="text" class=" uk-input form-control" placeholder="Search for keywords in titles ..." aria-describedby="sizing-addon2" [(ngModel)]="inputkeyword" (keyup)="changekeyword()" name="claims-keyword" ></div>
<div class="uk-margin-small-top">
<label class="uk-margin-small-right"> <input [(ngModel)]="projectCB" type="checkbox" (ngModelChange)="changeType()" name="project" />
<span class="uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
Project </label>
<label class="uk-margin-small-right"> <input [(ngModel)]="publicationCB" type="checkbox" (ngModelChange)="changeType()" name="publication" />
<span class="uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
Publication </label>
<label class="uk-margin-small-right"> <input [(ngModel)]="datasetCB" type="checkbox" (ngModelChange)="changeType()" name="dataset" />
<span class="uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><ellipse fill="none" stroke="#000" cx="10" cy="4.64" rx="7.5" ry="3.14"></ellipse><path fill="none" stroke="#000" d="M17.5,8.11 C17.5,9.85 14.14,11.25 10,11.25 C5.86,11.25 2.5,9.84 2.5,8.11"></path><path fill="none" stroke="#000" d="M17.5,11.25 C17.5,12.99 14.14,14.39 10,14.39 C5.86,14.39 2.5,12.98 2.5,11.25"></path><path fill="none" stroke="#000" d="M17.49,4.64 L17.5,14.36 C17.5,16.1 14.14,17.5 10,17.5 C5.86,17.5 2.5,16.09 2.5,14.36 L2.5,4.64"></path></svg></span>
Research Data </label>
<label class="uk-margin-small-right"> <input [(ngModel)]="softwareCB" type="checkbox" (ngModelChange)="changeType()" name="software" />
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <circle fill="none" stroke="#000" cx="9.997" cy="10" r="3.31"></circle> <path fill="none" stroke="#000" d="M18.488,12.285 L16.205,16.237 C15.322,15.496 14.185,15.281 13.303,15.791 C12.428,16.289 12.047,17.373 12.246,18.5 L7.735,18.5 C7.938,17.374 7.553,16.299 6.684,15.791 C5.801,15.27 4.655,15.492 3.773,16.237 L1.5,12.285 C2.573,11.871 3.317,10.999 3.317,9.991 C3.305,8.98 2.573,8.121 1.5,7.716 L3.765,3.784 C4.645,4.516 5.794,4.738 6.687,4.232 C7.555,3.722 7.939,2.637 7.735,1.5 L12.263,1.5 C12.072,2.637 12.441,3.71 13.314,4.22 C14.206,4.73 15.343,4.516 16.225,3.794 L18.487,7.714 C17.404,8.117 16.661,8.988 16.67,10.009 C16.672,11.018 17.415,11.88 18.488,12.285 L18.488,12.285 Z"></path></svg>
</span>
Software
</label>
<label class="uk-margin-small-right"> <input [(ngModel)]="otherCB" type="checkbox" (ngModelChange)="changeType()" name="other" />
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <polygon fill="none" stroke="#000" points="2.5,5.7 10,1.3 17.5,5.7 17.5,14.3 10,18.7 2.5,14.3"></polygon> <circle fill="none" stroke="#000" cx="10" cy="10" r="3.5"></circle></svg>
</span>
Other product
</label>
<label class="uk-margin-small-right"> <input [(ngModel)]="contextCB" type="checkbox" (ngModelChange)="changeType()" name="context" />
<span class="uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg></span>
Community </label>
<div class=" ">
<span class="uk-text-muted">Filter by</span>
</div>
<div class="uk-margin-small-top ">
<label class="uk-margin-small-right"> <input [(ngModel)]="projectCB" type="checkbox"
(ngModelChange)="changeType()" name="project"/>
Projects </label>
<label class="uk-margin-small-right"> <input [(ngModel)]="publicationCB" type="checkbox"
(ngModelChange)="changeType()" name="publication"/>
Publications </label>
<label class="uk-margin-small-right"> <input [(ngModel)]="datasetCB" type="checkbox"
(ngModelChange)="changeType()" name="dataset"/>
Research Data </label>
<label class="uk-margin-small-right"> <input [(ngModel)]="softwareCB" type="checkbox"
(ngModelChange)="changeType()" name="software"/>
Software
</label>
<label class="uk-margin-small-right"> <input [(ngModel)]="otherCB" type="checkbox"
(ngModelChange)="changeType()" name="other"/>
Other products
</label>
<label class="uk-margin-small-right"> <input [(ngModel)]="contextCB" type="checkbox"
(ngModelChange)="changeType()" name="context"/>
Communities </label>
<div class="uk-inline">
<span class="uk-form-icon uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="search" ratio="1"><circle
fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000"
stroke-width="1.1"
d="M14,14 L18,18 L14,14 Z"></path></svg>
</span>
<input type="text" class=" uk-input uk-width-medium form-control" placeholder="Search links"
aria-describedby="sizing-addon2" [(ngModel)]="inputkeyword" (keyup)="changekeyword()"
name="claims-keyword">
<span *ngIf="inputkeyword.length > 0" class="uk-margin-small-right uk-icon" style="cursor: pointer;"
(click)="inputkeyword=''; changekeyword();">
<svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" data-svg="close"><path fill="none" stroke="#000"
stroke-width="1.06"
d="M16,16 L4,4"></path><path
fill="none"
stroke="#000"
stroke-width="1.06"
d="M16,4 L4,16"></path></svg>
</span>
</div>
</div>
</form>
<div class="searchPaging uk-panel uk-margin-top" data-uk-grid-margin="">
<div *ngIf="resultsNum" class="uk-float-right">
<paging-no-load [currentPage]="page" [totalResults]="resultsNum" [size]="size" (pageChange)="pageChange($event)"> </paging-no-load>
</div>
<div *ngIf="resultsNum>0" class="uk-width-1-2">
<span > Show
<select *ngIf="resultsNum>10" class="uk-width-small uk-select" [(ngModel)]="size" name="select_size" (ngModelChange)="changeSize(size)" >
<option *ngFor="let size of sizes" [value]="size">{{size}}</option>
<div *ngIf="resultsNum>0 && selected.length == 0"
class="searchPaging uk-panel uk-margin-top portal-hr uk-margin-small-bottom"
data-uk-grid-margin="">
<div class="uk-width-1-2 uk-margin-top uk-margin-bottom">
<span> Results per page
<select *ngIf="resultsNum>10" class="uk-width-1-5 uk-select" [(ngModel)]="size" name="select_size"
(ngModelChange)="changeSize()">
<option *ngFor="let size of sizes" [value]="size">{{size}}</option>
</select>
</span>
<span >Showing {{(size*page - size +1) | number}} to {{(size*page>resultsNum)?(resultsNum | number):((size*page) | number)}} of {{resultsNum | number}} claims </span>
</div>
</div>
<div class="uk-grid">
<div *ngIf="resultsNum>0" class="uk-width-1-2">
<span class="portal-color">{{resultsNum|number}}</span> links, page <span
class="portal-color">{{page | number}}</span> of <span
class="portal-color">{{totalPages(resultsNum)|number}}</span>
<div *ngIf="showErrorMessage " class = "uk-alert uk-alert-danger " >
An Error occured.
</div>
<div *ngIf="showForbiddenMessage " class = "uk-alert uk-alert-danger " >
You are not allowed to access this page.
</div>
<div *ngIf="userValidMessage.length > 0 " class = "uk-alert uk-alert-danger " >
User session is not valid. Please login again.
</div>
<!-- Buttons for selecting and Delete Claims -->
<div *ngIf="enableDelete">
<div *ngIf="selected.length>0 && resultsNum > 0 ">
<div class = "uk-alert uk-alert-primary " >
You have selected {{selected.length | number}} claim(s)
</div>
<div *ngIf="resultsNum" class="uk-width-1-2 ">
<paging-no-load [currentPage]="page" [totalResults]="resultsNum" [size]="size"
(pageChange)="pageChange($event)" class="uk-float-right"></paging-no-load>
</div>
</div>
<div *ngIf="deleteMessage.length>0 " [innerHTML]="deleteMessage">
</div>
<!--button *ngIf="claims && claims.length > 0" class=" uk-button uk-button-default" (click)="confirmOpen()"> <span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="trash" ratio="1"><polyline fill="none" stroke="#000" points="6.5 3 6.5 1.5 13.5 1.5 13.5 3"></polyline><polyline fill="none" stroke="#000" points="4.5 4 4.5 18.5 15.5 18.5 15.5 4"></polyline><rect x="8" y="7" width="1" height="9"></rect><rect x="11" y="7" width="1" height="9"></rect><rect x="2" y="3" width="16" height="1"></rect></svg></span> Delete</button-->
</div>
<br>
<!-- Buttons for selecting and Delete Claims -->
<div *ngIf="enableDelete && selected.length>0 && resultsNum > 0 "
class="uk-margin-top portal-hr uk-margin-small-bottom uk-grid uk-margin-small-left">
<div class=" uk-width-1-2 uk-padding-remove-left">
{{selected.length | number}} link{{(selected.length > 1) ? 's' : ''}} selected
</div>
<div class=" uk-width-1-2">
<a [class]=" 'uk-text-danger uk-float-right '+(selected.length > 0?'':'uk-disabled')" (click)="confirmOpen()">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="trash" ratio="1"><polyline fill="none" stroke="#000"
points="6.5 3 6.5 1.5 13.5 1.5 13.5 3"></polyline><polyline
fill="none" stroke="#000" points="4.5 4 4.5 18.5 15.5 18.5 15.5 4"></polyline><rect x="8" y="7"
width="1"
height="9"></rect><rect
x="11" y="7" width="1" height="9"></rect><rect x="2" y="3" width="16" height="1"></rect></svg></span>
delete links
</a>
</div>
</div>
<div *ngIf="deleteMessage.length>0 " [innerHTML]="deleteMessage">
<div *ngIf=" claims && claims.length == 0" >
<div class = "uk-alert uk-alert-primary " >No entries found.</div>
<!--button *ngIf="claims && claims.length > 0" class=" uk-button uk-button-default" (click)="confirmOpen()"> <span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="trash" ratio="1"><polyline fill="none" stroke="#000" points="6.5 3 6.5 1.5 13.5 1.5 13.5 3"></polyline><polyline fill="none" stroke="#000" points="4.5 4 4.5 18.5 15.5 18.5 15.5 4"></polyline><rect x="8" y="7" width="1" height="9"></rect><rect x="11" y="7" width="1" height="9"></rect><rect x="2" y="3" width="16" height="1"></rect></svg></span> Delete</button-->
</div>
<div *ngIf="showErrorMessage " class="uk-alert uk-alert-danger ">
An Error occured.
</div>
<div *ngIf="showForbiddenMessage " class="uk-alert uk-alert-danger ">
You are not allowed to access this page.
</div>
<div *ngIf="userValidMessage.length > 0 " class="uk-alert uk-alert-danger ">
User session is not valid. Please login again.
</div>
<div *ngIf=" claims && claims.length == 0">
<div class="uk-alert uk-alert-primary ">No entries found.</div>
</div>
<div class="">
<table *ngIf="claims && claims.length > 0" class="uk-table uk-table-small uk-table-striped">
<thead>
<tr>
<th *ngIf="enableDelete" class="uk-padding-remove-right" title="Select all">
<input id="checkAll" type="checkbox" (click)="selectAll($event)" [ngModel]="selected.length==claims.length" />
</th>
<th class="uk-padding-remove-right uk-padding-remove-left" title="Delete selected">
<a [class]=" 'uk-text-danger '+(selected.length > 0?'':'uk-disabled')" (click)="confirmOpen()" >
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="trash" ratio="1"><polyline fill="none" stroke="#000" points="6.5 3 6.5 1.5 13.5 1.5 13.5 3"></polyline><polyline fill="none" stroke="#000" points="4.5 4 4.5 18.5 15.5 18.5 15.5 4"></polyline><rect x="8" y="7" width="1" height="9"></rect><rect x="11" y="7" width="1" height="9"></rect><rect x="2" y="3" width="16" height="1"></rect></svg></span>
</a>
</th>
<!--<th>Id</th>
<!-- <th>Target Type</th> -->
<th><a (click)="changeOrderby('target')" >Research Result</a> </th>
<!--<th>Source type</th> -->
<th><a (click)="changeOrderby('source')" >Link to</a> </th>
<table *ngIf="claims && claims.length > 0" class="uk-table uk-table-small uk-table-striped dataTable">
<thead class="uk-text-capitalize">
<tr>
<th *ngIf="enableDelete" class="uk-padding-remove-right" title="Select all">
<input id="checkAll" type="checkbox" (click)="selectAll($event)"
[ngModel]="selected.length==claims.length"/>
</th>
<th [class]="'uk-width-1-3 '+(sortby != 'target'?'sorting':(descending?'sorting_desc':'sorting_asc'))"
(click)="changeOrderby('target')"> Source
</th>
<th *ngIf="showUserEmail"><a (click)="changeOrderby('user')" >Claimed by</a> </th>
<th><a (click)="changeOrderby('date')"> Claimed Date</a></th>
<th *ngIf="showLatestClaims">Status</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let claim of claims " >
<td *ngIf="enableDelete"><input [id]="claim.id" type="checkbox" (click)="select(claim,$event)" [ngModel]="isSelected(claim.id)"/></td>
<td></td>
<td><claim-entity [entity]="claim.target" [type]="claim.targetType" [(properties)]=properties [externalPortalUrl]=externalPortalUrl> </claim-entity></td>
<td><claim-entity [entity]="claim.source" [type]="claim.sourceType" [(properties)]=properties [externalPortalUrl]=externalPortalUrl> </claim-entity></td>
<td *ngIf="showUserEmail">{{claim.userMail}}</td>
<td>{{claim.date}}</td>
<td>
<th [class]="'uk-width-1-3 '+(sortby != 'source'?'sorting':(descending?'sorting_desc':'sorting_asc'))"
(click)="changeOrderby('source')">
Link to
</th>
<th *ngIf=" showUserEmail
" [class]="sortby != 'user'?'sorting':(descending?'sorting_desc':'sorting_asc')"
(click)="changeOrderby('user')">
Claimed by
</th>
<th [class]="sortby != 'date'?'sorting':(descending?'sorting_desc':'sorting_asc')"
(click)="changeOrderby('date')">
Claim Date
</th>
<th *ngIf="showLatestClaims">Status
<!-- <span class="uk-icon"-->
<!-- [attr.uk-tooltip]="'title:<div class=\'uk-margin-small\'>Status declared if the link information is available in the portal and the APIs<br><br> If it is pending, the information will be added in the next content provision workflow</div>'">-->
<!-- <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="question"-->
<!-- ratio="1">-->
<!-- <circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle><circle cx="10.44"-->
<!-- cy="14.42"-->
<!-- r="1.05"></circle><path-->
<!-- fill="none" stroke="#000" stroke-width="1.2"-->
<!-- d="M8.17,7.79 C8.17,4.75 12.72,4.73 12.72,7.72 C12.72,8.67 11.81,9.15 11.23,9.75 C10.75,10.24 10.51,10.73 10.45,11.4 C10.44,11.53 10.43,11.64 10.43,11.75"></path></svg>-->
<!-- </span>-->
<span class="uk-icon"
[attr.uk-tooltip]="'title:<div class=\'uk-margin\'>Status declares if the link information is available in the portal and the APIs<br> If it is pending, the information will be added in the next content provision workflow</div>'" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="info" ratio="1"><path d="M12.13,11.59 C11.97,12.84 10.35,14.12 9.1,14.16 C6.17,14.2 9.89,9.46 8.74,8.37 C9.3,8.16 10.62,7.83 10.62,8.81 C10.62,9.63 10.12,10.55 9.88,11.32 C8.66,15.16 12.13,11.15 12.14,11.18 C12.16,11.21 12.16,11.35 12.13,11.59 C12.08,11.95 12.16,11.35 12.13,11.59 L12.13,11.59 Z M11.56,5.67 C11.56,6.67 9.36,7.15 9.36,6.03 C9.36,5 11.56,4.54 11.56,5.67 L11.56,5.67 Z"></path><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle></svg>
</span>
</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let claim of claims ">
<td *ngIf="enableDelete"><input [id]="claim.id" type="checkbox" (click)="select(claim,$event)"
[ngModel]="isSelected(claim.id)"/></td>
<!-- <td></td>-->
<td>
<claim-entity [entity]="claim.target" [type]="claim.targetType" [properties]=properties
[externalPortalUrl]=externalPortalUrl></claim-entity>
</td>
<td>
<claim-entity [entity]="claim.source" [type]="claim.sourceType" [properties]=properties
[externalPortalUrl]=externalPortalUrl></claim-entity>
</td>
<td *ngIf="showUserEmail">{{claim.userMail}}</td>
<td>{{claim.date}}</td>
<td>
<span class="uk-icon" [attr.uk-tooltip]="'title:<div class=\'uk-margin-small\'>'+getclaimStatus(claim)+'</div>'">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="question" ratio="1">
<circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle><circle cx="10.44" cy="14.42" r="1.05"></circle><path fill="none" stroke="#000" stroke-width="1.2" d="M8.17,7.79 C8.17,4.75 12.72,4.73 12.72,7.72 C12.72,8.67 11.81,9.15 11.23,9.75 C10.75,10.24 10.51,10.73 10.45,11.4 C10.44,11.53 10.43,11.64 10.43,11.75"></path></svg>
</span>
</td>
</tr>
</tbody>
</table>
<span *ngIf="isClaimAvailable(claim) else notAvailable" class="uk-label uk-label-success">available</span>
<ng-template #notAvailable> <span class="uk-label uk-label-warning">pending</span></ng-template>
<!-- <span class="uk-icon"-->
<!-- [attr.uk-tooltip]="'title:<div class=\'uk-margin-small\'>'+isClaimAvailable(claim)+'</div>'">-->
<!-- <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="question"-->
<!-- ratio="1">-->
<!-- <circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle><circle cx="10.44"-->
<!-- cy="14.42"-->
<!-- r="1.05"></circle><path-->
<!-- fill="none" stroke="#000" stroke-width="1.2"-->
<!-- d="M8.17,7.79 C8.17,4.75 12.72,4.73 12.72,7.72 C12.72,8.67 11.81,9.15 11.23,9.75 C10.75,10.24 10.51,10.73 10.45,11.4 C10.44,11.53 10.43,11.64 10.43,11.75"></path></svg>-->
<!-- </span>-->
</td>
</tr>
</tbody>
</table>
</div>
<div class="portal-hr uk-grid">
<div *ngIf="resultsNum>0" class="uk-width-1-2 uk-padding-remove-left">
<span class="portal-color">{{resultsNum|number}}</span> links, page <span
class="portal-color">{{page | number}}</span> of <span
class="portal-color">{{totalPages(resultsNum)|number}}</span>
</div>
<div *ngIf="resultsNum" class="uk-width-1-2 ">
<paging-no-load [currentPage]="page" [totalResults]="resultsNum" [size]="size"
(pageChange)="pageChange($event)" class="uk-float-right"></paging-no-load>
</div>
</div>
<helper position="bottom"></helper>
</div>
<div class="uk-width-1-5">
<div class="uk-card portal-card uk-padding" *ngIf="externalPortalUrl || claimsInfoURL">
<h6 *ngIf="!externalPortalUrl || externalPortalUrl.indexOf('http')==-1" class="uk-h6">
<a class="el-content uk-link-text" routerLink="/participate/claim">Claim more links?</a>
</h6>
<h6 *ngIf="externalPortalUrl && externalPortalUrl.indexOf('http')!=-1" class="uk-h6">
<a class="el-content uk-link-text" [href]="externalPortalUrl+'/participate/claim'" target="_blank">Claim more links?</a>
</h6>
<h6 *ngIf="claimsInfoURL" class="uk-h6 uk-margin-small-top">
<a class="el-content uk-link-text" [href]="claimsInfoURL" target="_blank">Learn more</a>
</h6>
</div>
<helper position="right" styleName=" uk-width-1-5"></helper>
<!-- <div class="uk-width-1-5">
<div class="uk-card portal-card uk-padding" *ngIf="externalPortalUrl || claimsInfoURL">
<h6 *ngIf="!externalPortalUrl || externalPortalUrl.indexOf('http')==-1" class="uk-h6">
<a class="el-content uk-link-text" routerLink="/participate/claim">Claim more links?</a>
</h6>
<h6 *ngIf="externalPortalUrl && externalPortalUrl.indexOf('http')!=-1" class="uk-h6">
<a class="el-content uk-link-text" [href]="externalPortalUrl+'/participate/claim'"
target="_blank">Claim more links?</a>
</h6>
<h6 *ngIf="claimsInfoURL" class="uk-h6 uk-margin-small-top">
<a class="el-content uk-link-text" [href]="claimsInfoURL" target="_blank">Learn more</a>
</h6>
</div>
<helper position="right" styleName=" uk-width-1-5"></helper>
</div>-->
</div>
</div>
<modal-alert (alertOutput)="confirmClose($event)">
<modal-alert (alertOutput)="confirmClose()">
<h4 class="modal-title uk-text-bold " id="myModalLabel">Are you sure?</h4>
<p>
You are about to delete {{this.selected.length}} link(s) you selected. <br>
<span class="uk-text-bold">
Usually it takes 2-4 weeks for the links to permanently disappear from the Openaire platfrom.
</span>
</p>
<p>Do you want to delete the link(s)?</p>
</modal-alert>
<modal-loading [message]= "'Please wait...'"></modal-loading>
<modal-loading [message]="'Please wait...'"></modal-loading>

File diff suppressed because it is too large Load Diff

View File

@ -11,11 +11,12 @@ import {PagingModule } from '../../../utils/paging.module';
import {HelperModule} from '../../../utils/helper/helper.module';
import {Schema2jsonldModule} from '../../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../../sharedComponents/SEO/SEOService.module';
import {IndexInfoServiceModule} from "../../../utils/indexInfoService.module";
@NgModule({
@NgModule({
imports: [
CommonModule, FormsModule, RouterModule, ClaimServiceModule, LoadingModalModule, AlertModalModule,
ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule
ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule, IndexInfoServiceModule
],
declarations: [

View File

@ -1,5 +1,6 @@
import {Component, Input} from '@angular/core';
import{EnvProperties} from '../../../utils/properties/env-properties';
import {EnvProperties} from '../../../utils/properties/env-properties';
import {ClaimDBContext, ClaimDBProject, ClaimDBResult} from "../claimHelper.class";
//Usage Example "<claim-entity [entity]="" [type]="" > </claim-entity>"
@ -7,47 +8,98 @@ import{EnvProperties} from '../../../utils/properties/env-properties';
@Component({
selector: 'claim-entity',
template: `
<div *ngIf="type == 'publication'" title="Publication">
<span class="uk-margin-small-right uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
<publication-title [title]="entity.title" [url]="entity.externalUrl" [id]="entity.openaireId" param="articleId" path="/search/publication" [externalPortalUrl]=externalPortalUrl></publication-title>
</div>
<div *ngIf="type == 'dataset'" title="Dataset">
<span class="uk-margin-small-right uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><ellipse fill="none" stroke="#000" cx="10" cy="4.64" rx="7.5" ry="3.14"></ellipse><path fill="none" stroke="#000" d="M17.5,8.11 C17.5,9.85 14.14,11.25 10,11.25 C5.86,11.25 2.5,9.84 2.5,8.11"></path><path fill="none" stroke="#000" d="M17.5,11.25 C17.5,12.99 14.14,14.39 10,14.39 C5.86,14.39 2.5,12.98 2.5,11.25"></path><path fill="none" stroke="#000" d="M17.49,4.64 L17.5,14.36 C17.5,16.1 14.14,17.5 10,17.5 C5.86,17.5 2.5,16.09 2.5,14.36 L2.5,4.64"></path></svg></span>
<publication-title [title]="entity.title" [url]="entity.externalUrl" [id]="entity.openaireId" param="datasetId" path="/search/dataset" [externalPortalUrl]=externalPortalUrl></publication-title>
</div>
<div *ngIf="type == 'software'" title="Software">
<span class="uk-margin-small-right uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <circle fill="none" stroke="#000" cx="9.997" cy="10" r="3.31"></circle> <path fill="none" stroke="#000" d="M18.488,12.285 L16.205,16.237 C15.322,15.496 14.185,15.281 13.303,15.791 C12.428,16.289 12.047,17.373 12.246,18.5 L7.735,18.5 C7.938,17.374 7.553,16.299 6.684,15.791 C5.801,15.27 4.655,15.492 3.773,16.237 L1.5,12.285 C2.573,11.871 3.317,10.999 3.317,9.991 C3.305,8.98 2.573,8.121 1.5,7.716 L3.765,3.784 C4.645,4.516 5.794,4.738 6.687,4.232 C7.555,3.722 7.939,2.637 7.735,1.5 L12.263,1.5 C12.072,2.637 12.441,3.71 13.314,4.22 C14.206,4.73 15.343,4.516 16.225,3.794 L18.487,7.714 C17.404,8.117 16.661,8.988 16.67,10.009 C16.672,11.018 17.415,11.88 18.488,12.285 L18.488,12.285 Z"></path></svg>
</span>
<publication-title [title]="entity.title" [url]="entity.externalUrl" [id]="entity.openaireId" param="softwareId" path="/search/software" [externalPortalUrl]=externalPortalUrl></publication-title>
</div>
<div *ngIf="type == 'other'" title="Other reserch product">
<span class="uk-margin-small-right uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <polygon fill="none" stroke="#000" points="2.5,5.7 10,1.3 17.5,5.7 17.5,14.3 10,18.7 2.5,14.3"></polygon> <circle fill="none" stroke="#000" cx="10" cy="10" r="3.5"></circle></svg>
</span>
<publication-title [title]="entity.title" [url]="entity.externalUrl" [id]="entity.openaireId" param="orpId" path="/search/other" [externalPortalUrl]=externalPortalUrl ></publication-title>
</div>
<div *ngIf="type == 'project' " title="Project">
<span class="uk-margin-small-right uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
<project-title [project]="entity" [(searchLink)]=properties.searchLinkToProject [externalPortalUrl]=externalPortalUrl></project-title>
</div>
<div *ngIf="type == 'context' " title="Concept">
<span class="uk-margin-small-right uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg></span>
<span>{{entity.title}}</span>
</div>
<div *ngIf="type == 'publication'" title="Publication">
<div class="uk-text-muted">publication</div>
<!-- <span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" ratio="1"><rect fill="none"
stroke="#000"
x="3.5"
y="2.5"
width="12"
height="16"></rect><polyline
fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>-->
<publication-title [entity]="entity" param="articleId"
path="/search/publication" [externalPortalUrl]=externalPortalUrl></publication-title>
</div>
<div *ngIf="type == 'dataset'" title="Dataset">
<div class="uk-text-muted">research data</div>
<!--<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" ratio="1"><ellipse fill="none"
stroke="#000"
cx="10"
cy="4.64"
rx="7.5"
ry="3.14"></ellipse><path
fill="none" stroke="#000" d="M17.5,8.11 C17.5,9.85 14.14,11.25 10,11.25 C5.86,11.25 2.5,9.84 2.5,8.11"></path><path
fill="none" stroke="#000"
d="M17.5,11.25 C17.5,12.99 14.14,14.39 10,14.39 C5.86,14.39 2.5,12.98 2.5,11.25"></path><path fill="none"
stroke="#000"
d="M17.49,4.64 L17.5,14.36 C17.5,16.1 14.14,17.5 10,17.5 C5.86,17.5 2.5,16.09 2.5,14.36 L2.5,4.64"></path></svg></span>-->
<publication-title [entity]="entity" param="datasetId"
path="/search/dataset" [externalPortalUrl]=externalPortalUrl></publication-title>
</div>
<div *ngIf="type == 'software'" title="Software">
<div class="uk-text-muted">software</div>
<!-- <span class="uk-margin-small-right uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <circle
fill="none" stroke="#000" cx="9.997" cy="10" r="3.31"></circle> <path fill="none" stroke="#000"
d="M18.488,12.285 L16.205,16.237 C15.322,15.496 14.185,15.281 13.303,15.791 C12.428,16.289 12.047,17.373 12.246,18.5 L7.735,18.5 C7.938,17.374 7.553,16.299 6.684,15.791 C5.801,15.27 4.655,15.492 3.773,16.237 L1.5,12.285 C2.573,11.871 3.317,10.999 3.317,9.991 C3.305,8.98 2.573,8.121 1.5,7.716 L3.765,3.784 C4.645,4.516 5.794,4.738 6.687,4.232 C7.555,3.722 7.939,2.637 7.735,1.5 L12.263,1.5 C12.072,2.637 12.441,3.71 13.314,4.22 C14.206,4.73 15.343,4.516 16.225,3.794 L18.487,7.714 C17.404,8.117 16.661,8.988 16.67,10.009 C16.672,11.018 17.415,11.88 18.488,12.285 L18.488,12.285 Z"></path></svg>
</span>-->
<publication-title [entity]="entity" param="softwareId"
path="/search/software" [externalPortalUrl]=externalPortalUrl></publication-title>
</div>
<div *ngIf="type == 'other'" title="Other reserch product">
<div class="uk-text-muted">other</div>
<!--<span class="uk-margin-small-right uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <polygon fill="none"
stroke="#000"
points="2.5,5.7 10,1.3 17.5,5.7 17.5,14.3 10,18.7 2.5,14.3"></polygon> <circle
fill="none" stroke="#000" cx="10" cy="10" r="3.5"></circle></svg>
</span>-->
<publication-title [entity]="entity" param="orpId"
path="/search/other" [externalPortalUrl]=externalPortalUrl></publication-title>
</div>
<div *ngIf="type == 'project' " title="Project">
<div class="uk-text-muted">project</div>
<!--<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="5" y="2"
width="10"
height="1"></rect><rect
x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17"
height="11"></rect></svg></span>-->
<project-title [project]="entity" [searchLink]=properties.searchLinkToProject
[externalPortalUrl]=externalPortalUrl></project-title>
</div>
<div *ngIf="type == 'context' " title="Concept">
<div class="uk-text-muted">community</div>
<!--<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" ratio="1"><circle fill="none"
stroke="#000"
stroke-width="1.1"
cx="7.7"
cy="8.6"
r="3.5"></circle><path
fill="none" stroke="#000" stroke-width="1.1"
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path fill="none" stroke="#000"
stroke-width="1.1"
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg></span>-->
<span>{{entity.title}}</span>
</div>
`
})
export class ClaimEntityFormatter {
@Input() entity: string[];
@Input() entity: ClaimDBResult | ClaimDBContext | ClaimDBProject;
@Input() type: string;
@Input() properties: EnvProperties;
@Input() externalPortalUrl:string = null;
@Input() externalPortalUrl: string = null;
constructor () {}
constructor() {
}
ngOnInit() {
}
}

View File

@ -6,24 +6,33 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
@Component({
selector: 'project-title',
template: `
<span *ngIf="externalPortalUrl" class="project-title">
<span ><a [href] = "externalPortalUrl + '/search/project?projectId='+project['openaireId']" >{{project['name']}} ({{project['funderName']}})</a></span>
<span *ngIf="externalPortalUrl" class="project-title">
<span><a
[href]="externalPortalUrl + '/search/project?projectId='+project['openaireId']">{{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}}</a></span>
</span>
<span *ngIf="!externalPortalUrl" class="project-title">
<span ><a [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])" routerLinkActive="router-link-active" routerLink="/search/project" >{{project['name']}} ({{project['funderName']}})</a></span>
<span *ngIf="!externalPortalUrl" class="project-title">
<span><a [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])"
routerLinkActive="router-link-active"
routerLink="/search/project">{{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}} </a></span>
</span>
<div *ngIf="project['funderName']">
<span class="uk-text-muted">Funder </span>{{project['funderName']}}
</div>
`
})
export class ProjectTitleFormatter {
@Input() project: string[];
@Input() searchLink: string;
@Input() externalPortalUrl:string = null;
public url:string;
public routerHelper:RouterHelper = new RouterHelper();
constructor () {}
@Input() externalPortalUrl: string = null;
public url: string;
public routerHelper: RouterHelper = new RouterHelper();
constructor() {
}
ngOnInit() {
this.url =this.searchLink+ "?projectId=" + this.project["openaireId"];
this.url = this.searchLink + "?projectId=" + this.project["openaireId"];
}
}

View File

@ -6,28 +6,37 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
@Component({
selector: 'publication-title',
template: `
<span *ngIf="!externalPortalUrl" class="publication-title">
<span *ngIf="!externalPortalUrl" class="publication-title">
<span *ngIf="id" ><a [queryParams]="routerHelper.createQueryParam(param,id)" routerLinkActive="router-link-active" [routerLink]="path" > {{title}}</a></span>
<!--span *ngIf="url" class="uk-margin-small-left" ><a target="_blank" href="{{url}}" >
(<span class="custom-external custom-icon" ></span>link)</a></span-->
<span *ngIf="entity.openaireId"><a [queryParams]="routerHelper.createQueryParam(param,entity.openaireId)" routerLinkActive="router-link-active"
[routerLink]="path"> {{entity.title}}</a></span>
<!--span *ngIf="url" class="uk-margin-small-left" ><a target="_blank" href="{{url}}" >
(<span class="custom-external custom-icon" ></span>link)</a></span-->
</span>
<span *ngIf="externalPortalUrl" class="publication-title">
<span *ngIf="externalPortalUrl" class="publication-title">
<span *ngIf="id" ><a [href] = "externalPortalUrl + path+'?'+param+'='+id" > {{title}}</a></span>
<span *ngIf="entity.openaireId"><a [href]="externalPortalUrl + path+'?'+param+'='+entity.openaireId"> {{entity.title}}</a></span>
</span>
<!-- <div *ngIf="entity.accessRights || entity.bestLicense">-->
<!-- <span class="uk-text-muted">Access mode </span>{{entity.accessRights}} {{entity.bestLicense}}-->
<!-- <span class=" " *ngIf="entity.accessRights == 'EMBARGO' && entity.embargoEndDate"> {{entity.embargoEndDate}}</span>-->
<!-- </div>-->
`
})
export class PublicationTitleFormatter {
@Input() title: string;
@Input() url: string;
@Input() id: string;
// @Input() title: string;
// @Input() url: string;
// @Input() id: string;
@Input() param: string;
@Input() path: string;
@Input() externalPortalUrl:string = null;
public routerHelper:RouterHelper = new RouterHelper();
constructor () {}
@Input() entity: any;
@Input() externalPortalUrl: string = null;
public routerHelper: RouterHelper = new RouterHelper();
constructor() {
}
ngOnInit() {

View File

@ -1,27 +1,16 @@
import {throwError as observableThrowError, Observable} from 'rxjs';
import {throwError as observableThrowError} from 'rxjs';
import {Injectable} from '@angular/core';
import {URLSearchParams } from '@angular/http';
import {Http, Response} from '@angular/http';
import { HttpClient } from '@angular/common/http';
// import {Claim} from '../claim';
import {HttpClient} from '@angular/common/http';
import {catchError} from 'rxjs/operators';
import {CustomOptions} from '../../../services/servicesUtils/customOptions.class';
import { catchError } from 'rxjs/operators';
import { CustomOptions } from '../../../services/servicesUtils/customOptions.class';
@Injectable()
export class ClaimsService {
constructor(private http: HttpClient ) {
}
private getClaimRequest(size : number, page : number, url :string, fromCache:boolean):any {
//console.info('ClaimsService: Claims request: '+url);
let key = url;
return this.http.get(url, CustomOptions.getAuthOptions())
//.map(request => <any> request.json())
//.do(request => console.info("Get claims: offset = "+(size*(page-1)) + " limit ="+size ))
.pipe(catchError(this.handleError));
}
getClaims( size : number, page : number, keyword:string, sortby: string, descending: boolean, types: string, apiUrl:string):any {
@ -42,7 +31,7 @@ export class ClaimsService {
}
getClaimsByResult( size : number, page : number, resultId:string, keyword:string, sortby: string, descending: boolean, types: string, apiUrl:string ):any {
//console.info('ClaimsService: getClaims for result : '+resultId);
//console.info('ClaimsService: getClaims for entity : '+resultId);
let url = apiUrl +"results/"+resultId+"/claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+"&"+types;
return this.getClaimRequest(size,page,url,true);
@ -125,22 +114,22 @@ export class ClaimsService {
return observableThrowError(error || 'Server error');
}
getClaim(id:string, apiUrl:string):any {
let url = apiUrl+"claims/"+id;
return new Promise((resolve, reject) => {
this.http.get(url)
//.map(res => res.json())
.subscribe(
data => {
resolve(data['data']);
},
err => {
reject(err);
}
)
;
});
}
// getClaim(id:string, apiUrl:string):any {
// let url = apiUrl+"claims/"+id;
// return new Promise((resolve, reject) => {
// this.http.get(url)
// //.map(res => res.json())
// .subscribe(
// data => {
// resolve(data['data']);
// },
// err => {
// reject(err);
// }
// )
// ;
// });
// }
}

View File

@ -1,13 +1,8 @@
import {throwError as observableThrowError, Observable} from 'rxjs';
import {throwError as observableThrowError} from 'rxjs';
import {Injectable} from '@angular/core';
import {Jsonp, URLSearchParams, RequestOptions, Headers} from '@angular/http';
import {Http, Response} from '@angular/http';
import { HttpClient } from '@angular/common/http';
import {Claim} from '../claim';
import {AutoCompleteValue} from '../../../searchPages/searchUtils/searchHelperClasses.class';
import {Response} from '@angular/http';
import {HttpClient} from '@angular/common/http';
import {catchError, map} from "rxjs/operators";
import { COOKIE } from '../../../login/utils/helper.class';
@Injectable()
export class ContextsService {
constructor(private http: HttpClient ) {
@ -15,20 +10,13 @@ export class ContextsService {
public getCommunities( apiUrl:string):any {
let url = apiUrl + 's/';
let key = url;
//console.info('ContextsService: request communities '+url);
return this.http.get(url)
//.map(res => <any> res.json())
.pipe(map(res => this.parseCommunities(res, true) ))
// .do(request => console.info("Get claims: offset = "))
.pipe(catchError(this.handleError));
}
public getPublicCommunities( apiUrl:string):any {
let url = apiUrl + 's/';
let key = url;
//console.info('ContextsService: request communities '+url);
return this.http.get(url)
.pipe(map(res => this.parseCommunities(res, true) ));
}
@ -47,9 +35,6 @@ export class ContextsService {
public getCategories(communityId :string, apiUrl:string):any {
//console.info('ContextsService: request categories for community with id '+communityId);
let url= apiUrl + '/' + communityId ;
let key = url;
return this.http.get(url)
//.map(request => <any> request.json())
// .do(request => console.info("Get claims: offset = " ))
@ -58,14 +43,11 @@ export class ContextsService {
public getConcepts(categoryId :string, keyword: string, parsing:boolean, apiUrl:string):any {
//console.info('ContextsService: request concept for category with id '+categoryId + ' and keyword '+ keyword);
let url= apiUrl + '/category/' + categoryId;
let key = url+"_parsing="+parsing;
return this.http.get(url )
//.map(request => <any> request.json())
.pipe(catchError(this.handleError))
.pipe(map(res => (parsing)?this.parse(res):res));
// .do(res => console.info("Result is "+ res.length ));
}
public getSubConcepts(subConceptID :string, keyword: string, parsing:boolean, apiUrl:string):any {
//console.info('ContextsService: request sub concept for concept with id '+subConceptID + ' and keyword '+ keyword);
@ -74,10 +56,8 @@ export class ContextsService {
return this.http.get(url )
//.map(request => <any> request.json())
.pipe(catchError(this.handleError))
.pipe(map(res => (parsing)?this.parseSubConcepts(res):res));
// .do(res => console.info("Result is "+ res.length ));
}
parse (data: any):any {
var array =[]
@ -131,10 +111,4 @@ export class ContextsService {
console.log(error);
return observableThrowError(error || 'Server error');
}
private getAuthOptions():RequestOptions{
let headers = new Headers();
headers.append('X-XSRF-TOKEN', COOKIE.getCookie(COOKIE.cookieName_id));
let options = new RequestOptions({ headers: headers, withCredentials:true });
return options;
}
}

View File

@ -1,101 +1,92 @@
import {throwError as observableThrowError, Observable} from 'rxjs';
import {throwError as observableThrowError} from 'rxjs';
import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http';
import { HttpClient } from '@angular/common/http';
import { ClaimResult} from '../claimEntities.class';
import {Response} from '@angular/http';
import {HttpClient} from '@angular/common/http';
import {ClaimEntity, ClaimResult} from '../claimHelper.class';
import {map} from "rxjs/operators";
@Injectable()
export class SearchCrossrefService {
constructor( private http: HttpClient ) {}
searchCrossrefResults (term: string, size : number, page : number, apiUrl:string, parse:boolean = false):any {
let url = apiUrl+'?query='+term+'&rows='+size+'&offset='+(size*(page-1));
let key = url;
searchCrossrefResults(term: string, size: number, page: number, apiUrl: string, parse: boolean = false): any {
let url = apiUrl + '?query=' + term + '&rows=' + size + '&offset=' + (size * (page - 1));
return this.http.get(url)
//.map(request => <any> request.json().message)
.pipe(map(request => request['message']))
.pipe(map(request => (parse?this.parse(request.items):request)))
.pipe(map(request => [request["total-results"], parse ? this.parse(request.items) : request]))
//.catch(this.handleError);
}
searchCrossrefByDOIs(DOIs: string[], apiUrl: string, parse: boolean = false): any {
var doisParams = "";
for (var i = 0; i < DOIs.length; i++) {
doisParams += (doisParams.length > 0 ? "," : "") + 'doi:' + DOIs[i];
}
searchCrossrefByDOIs(DOIs: string[], apiUrl:string, parse:boolean = false):any {
var doisParams = "";
for(var i =0 ;i < DOIs.length; i++){
doisParams+=(doisParams.length > 0?",":"")+'doi:'+DOIs[i];
}
let url = apiUrl+'?filter='+doisParams;
let key = url;
return this.http.get(url)
let url = apiUrl + '?filter=' + doisParams;
return this.http.get(url)
//.map(request => <any> request.json().message)
.pipe(map(request => request['message']))
.pipe(map(request => (parse?this.parse(request.items):request)))
.pipe(map(request => [request["total-results"], parse ? this.parse(request['items']) : request]))
//.catch(this.handleError);
}
searchCrossrefByMultipleDOIs(dois: string[], apiUrl:string, parse:boolean = false):any {
let url = apiUrl+'?filter=doi:';
for(var i=0; i<dois.length; i++){
url=url+(url.length==0?'':',')+'doi:'+dois[i];
}
url = apiUrl+'?filter='+url;
let key = url;
}
searchCrossrefByMultipleDOIs(dois: string[], apiUrl: string, parse: boolean = false): any {
let url = apiUrl + '?filter=doi:';
for (var i = 0; i < dois.length; i++) {
url = url + (url.length == 0 ? '' : ',') + 'doi:' + dois[i];
}
url = apiUrl + '?filter=' + url;
return this.http.get(url)
//.map(request => <any> request.json().message)
.pipe(map(request => request['message']))
.pipe(map(request => (parse?this.parse(request.items):request)))
.pipe(map( request => [request["total-results"], parse ? this.parse(request.items) : request]))
//.catch(this.handleError);
}
}
private handleError (error: Response) {
private handleError(error: Response) {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console
console.log(error);
return observableThrowError(error || 'Server error');
}
parse(response):ClaimResult[]{
var results:ClaimResult[] = [];
for(var i=0; i<response.length; i++){
var item=response[i];
var result:ClaimResult = new ClaimResult();
result.publisher = null;
result.journal = null;
result.DOI = item.DOI;
result.id = item.DOI;
result.title = item.title;
result.url = item.URL;
result.source = 'crossref';
result.type = 'publication';
if(item['published-print']){
result.date = item['published-print']['date-parts'][0];
parse(response): ClaimEntity[] {
const results: ClaimEntity[] = [];
for (let i = 0; i < response.length; i++) {
const item = response[i];
const entity: ClaimEntity = new ClaimEntity();
entity.result = new ClaimResult();
entity.result.publisher = null;
entity.result.journal = null;
entity.result.DOI = item.DOI;
entity.id = item.DOI;
entity.title = item.title;
entity.result.url = item.URL;
entity.result.source = 'crossref';
entity.type = 'publication';
if (item['published-print']) {
entity.result.date = item['published-print']['date-parts'][0][0];
}
result.accessRights = "OPEN";
result.publisher = item.publisher;
result.journal = null;
result.result = item;
if(item.author){
for(var j=0; j<item.author.length; j++){
result.authors.push(item.author[j].family+", "+item.author[j].given);
entity.result.accessRights = "OPEN";
entity.result.publisher = item.publisher;
entity.result.journal = null;
entity.result.record = item;
if (item.author) {
entity.result.authors = [];
for (let j = 0; j < item.author.length; j++) {
entity.result.authors.push(item.author[j].family + ", " + item.author[j].given);
}
}
if(item.editor){
for(var j=0; j<item.editor.length; j++){
result.editors.push(item.editor[j].family+", "+item.editor[j].given);
if (item.editor) {
for (let j = 0; j < item.editor.length; j++) {
entity.result.editors.push(item.editor[j].family + ", " + item.editor[j].given);
}
}
results.push(result);
results.push(entity);
}
return results;

View File

@ -1,81 +1,77 @@
import {throwError as observableThrowError, Observable} from 'rxjs';
import {throwError as observableThrowError} from 'rxjs';
import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http';
import { HttpClient } from '@angular/common/http';
import{EnvProperties} from '../../../utils/properties/env-properties';
import { ClaimResult} from '../claimEntities.class';
import {Response} from '@angular/http';
import {HttpClient} from '@angular/common/http';
import {EnvProperties} from '../../../utils/properties/env-properties';
import {ClaimEntity, ClaimResult} from '../claimHelper.class';
import {map} from "rxjs/operators";
@Injectable()
export class SearchDataciteService {
constructor(private http: HttpClient ) {}
searchDataciteResults (term: string, size : number, page : number, properties:EnvProperties, parse:boolean = false):any {
searchDataciteResults(term: string, size: number, page: number, properties: EnvProperties, parse: boolean = false): any {
//console.info("In search datacite results "+term+ " "+properties.searchDataciteAPIURL);
let url = properties.searchDataciteAPIURL+'?query='+term+'&rows='+size+'&start='+(size*(page-1));
let url = properties.searchDataciteAPIURL + '?query=' + term + '&page[size]=' + size + '&page[number]=' + page;
let key = url;
return this.http.get( ( properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
//.map(request => <any> request.json())
.pipe(map(request => (parse?this.parse(request['data']):request)))
//.catch(this.handleError);
}
getDataciteResultByDOI (doi: string, properties:EnvProperties, parse:boolean = false):any {
let url = properties.searchDataciteAPIURL+'/'+doi;
let key = url;
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
.pipe(map(request => [request["meta"]["total"], (parse ? SearchDataciteService.parse(request["data"]) : request)]));
//.catch(this.handleError);
}
return this.http.get( (properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
//.map(request => <any> request.json())
.pipe(map(request => (parse?this.parse(request['data']):request)))
getDataciteResultByDOI(doi: string, properties: EnvProperties, parse: boolean = false): any {
let url = properties.searchDataciteAPIURL + '/' + doi;
let key = url;
// .do(items => console.log("Datacite Results: total results = "+items.meta.total+" doi = "+doi))
//.catch(this.handleError);
}
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
.pipe(map(request => [1, (parse ? SearchDataciteService.parse(request["data"]) : request)]));
}
private handleError (error: Response) {
private handleError(error: Response) {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console
console.log(error);
return observableThrowError(error || 'Server error');
}
private extractData(res: Response) {
if (res.status < 200 || res.status >= 300) {
throw new Error('Bad response status: ' + res.status);
}
let body = res.json();
return body.data || { };
return body.data || {};
}
parse(response):ClaimResult[]{
var results:ClaimResult[] = [];
for(var i=0; i<response.length; i++){
var item=response[i];
var result:ClaimResult = new ClaimResult();
result.publisher = null;
result.journal = null;
result.DOI = item.attributes.doi;
result.id = item.attributes.doi;
result.title = item.attributes.title;
result.url = 'http://dx.doi.org/'+item.attributes.doi;
result.source = 'datacite';
result.type = 'dataset';
result.date = item.attributes.published;
result.accessRights = "OPEN";
result.publisher =item.attributes['container-title']
result.journal = null;
result.result = item;
if(item.attributes.author){
for(var j=0; j<item.attributes.author.length; j++){
var author = item.attributes.author[j];
result.authors.push((author.family)?author.family+', '+author.given:author.literal);
static parse(response): ClaimEntity[] {
const results: ClaimEntity[] = [];
console.log(response);
for (let i = 0; i < response.length; i++) {
const item = response[i];
const entity: ClaimEntity = new ClaimEntity();
entity.result = new ClaimResult();
entity.result.publisher = null;
entity.result.journal = null;
entity.result.DOI = item.attributes.doi;
entity.id = item.attributes.doi;
entity.title = item.attributes.title;
entity.result.url = 'http://dx.doi.org/' + item.attributes.doi;
entity.result.source = 'datacite';
entity.type = 'dataset';
entity.result.date = item.attributes.published;
entity.result.accessRights = "OPEN";
entity.result.publisher = item.attributes['container-title'];
entity.result.journal = null;
entity.result.record = item;
if (item.attributes.author) {
entity.result.authors = [];
for (let j = 0; j < item.attributes.author.length; j++) {
const author = item.attributes.author[j];
entity.result.authors.push((author.family) ? author.family + ', ' + author.given : author.literal);
}
}
results.push(result);
results.push(entity);
}
return results;

View File

@ -1,30 +1,23 @@
import {Injectable} from '@angular/core';
import {URLSearchParams} from '@angular/http';
import {Http, Response} from '@angular/http';
import { Headers, RequestOptions } from '@angular/http';
import {HttpClient, HttpHeaders} from '@angular/common/http';
import {Observable} from 'rxjs';
import{EnvProperties} from '../../../utils/properties/env-properties';
import { ClaimResult} from '../claimEntities.class';
import {EnvProperties} from '../../../utils/properties/env-properties';
import {ClaimEntity, ClaimResult} from '../claimHelper.class';
import {map} from "rxjs/operators";
import {StringUtils} from "../../../utils/string-utils.class";
@Injectable()
export class SearchOrcidService {
constructor( private http: HttpClient ) {}
searchOrcidAuthor (term: string, authorIds: string[], authors, properties:EnvProperties, addId):any {
searchOrcidAuthor(term: string, authorIds: string[], authors, properties: EnvProperties, addId): any {
//var headers = new Headers();
//headers.append('Accept', 'application/orcid+json');
let headers = new HttpHeaders({'Accept': 'application/orcid+json'});
let url = properties.searchOrcidURL + term+'/record';
let key = url;
let url = properties.searchOrcidURL + term + '/record';
return this.http.get(url, { headers: headers })
//.map(res => res.json()['person'])
@ -32,14 +25,12 @@ export class SearchOrcidService {
.pipe(map(res => [res['name']['given-names'],
res['name']['family-name'],
res['name']]))
.pipe(map(res => this.parseOrcidAuthor(res, authorIds, authors, addId)));
.pipe(map(res => SearchOrcidService.parseOrcidAuthor(res, authorIds, authors, addId)));
}
searchOrcidAuthors (term: string, authorIds: string[],
properties:EnvProperties):any {
searchOrcidAuthors(term: string,
properties: EnvProperties): any {
//var headers = new Headers();
//headers.append('Accept', 'application/orcid+json');
let headers = new HttpHeaders({'Accept': 'application/orcid+json'});
// let url = properties.searchOrcidURL+'search?defType=edismax&q='+term+'&qf=given-name^1.0+family-name^2.0+other-names^1.0+credit-name^1.0&start=0&rows=10';
@ -47,141 +38,112 @@ export class SearchOrcidService {
//q={!edismax qf="given-and-family-names^50.0 family-name^10.0 given-names^5.0 credit-name^10.0 other-names^5.0 text^1.0" pf="given-and-family-names^50.0" mm=1}alessia bardi&start=0&rows=10
let key = url;
return this.http.get(url, { headers: headers })
//.map(res => res.json()['result'])
return this.http.get(url, {headers: headers})
.pipe(map(res => res['result']))
.pipe(map(res => this.parseOrcidAuthors(res, authorIds)));
.pipe(map(res => SearchOrcidService.parseOrcidAuthors(res)));
}
}
searchOrcidPublications (id: string, properties:EnvProperties, parse:boolean = false):any {
//var headers = new Headers();
//headers.append('Accept', 'application/orcid+json');
let headers = new HttpHeaders({'Accept': 'application/orcid+json'});
let url =properties.searchOrcidURL+id+'/works';
let key = url;
searchOrcidPublications(id: string, properties: EnvProperties, parse: boolean = false): any {
let headers = new HttpHeaders({'Accept': 'application/orcid+json'});
let url = properties.searchOrcidURL + id + '/works';
return this.http.get(url, { headers: headers })
//.map(res => res.json()['group'])
.pipe(map(res => res['group']))
.pipe(map(request => (parse?this.parse(id, request):request)));
//.map(res => res['orcid-work']);
.pipe(map(request => (parse ? SearchOrcidService.parse(id, request) : request)));
}
parseOrcidAuthor (data: any, authorIds: string[],authors, addId):any {
if(data[2] != null) {
if(addId){
authorIds.push(data[2].path);
}
var author ={};
author['id']=data[2].path;
if(data[0] != null) {
author['authorGivenName']=data[0].value;
} else {
author['authorGivenName']="";
}
if(data[1] != null) {
author['authorFamilyName']=data[1].value;
} else {
author['authorFamilyName']="";
}
authors.push(author);
return true;
}
return false;
static parseOrcidAuthor(data: any, authorIds: string[], authors, addId): any {
if (data[2] != null) {
if (addId) {
authorIds.push(data[2].path);
}
parseOrcidAuthors (data: any, authorIds: string[]):any {
let ret: boolean = false;
let mydata: any;
let length: number;
if(data != null) {
length = data.length!=undefined ? data.length : 1;
for(let i=0; i<length; i++) {
mydata = data.length!=undefined ? data[i] : data;
if(mydata.hasOwnProperty("orcid-identifier")) {
authorIds.push(mydata['orcid-identifier'].path);
// if(mydata.hasOwnProperty("orcid-bio")) {
// if(mydata['orcid-bio'].hasOwnProperty("personal-details")) {
// if(mydata['orcid-bio']['personal-details'].hasOwnProperty("given-names")) {
// authorGivenNames.push(mydata['orcid-bio']['personal-details']['given-names'].value);
// } else {
// authorGivenNames.push("");
// }
//
// if(mydata['orcid-bio']['personal-details'].hasOwnProperty("family-name")) {
// authorFamilyNames.push(mydata['orcid-bio']['personal-details']['family-name'].value);
// } else {
// authorFamilyNames.push("");
// }
// }
// }
ret = true;
}
}
}
return ret;
const author = {};
author['id'] = data[2].path;
if (data[0] != null) {
author['authorGivenName'] = data[0].value;
} else {
author['authorGivenName'] = "";
}
parse(authorId, response):ClaimResult[]{
var results:ClaimResult[] = [];
for(var i=0; i<response.length; i++){
var item=response[i];
var result:ClaimResult = new ClaimResult();
result.DOI = null;
result.url = null;
result.publisher = null;
result.journal = null;
if(item['work-summary'] && item['work-summary'].length > 0){
item = item['work-summary'][0];
}else{
item['work-summary'];
}
if(item['external-ids'] && item['external-ids']['external-id']){
for(var j =0; j< item['external-ids']['external-id'].length; j++){
var id = item['external-ids']['external-id'][j];
if(id['external-id-type'] == "doi"){
result.DOI = id['external-id-value'];
result.url = "http://dx.doi.org/" + result.DOI;
break;
}
}
}
result.id = authorId+"-"+item['put-code'];
if(item.title && item.title.title){
result.title = item['title']['title'].value;
}
result.journal = item['journal-title'];
result.source = 'orcid';
result.type = 'publication';
if(item['publication-date'] && item['publication-date']['year']){
result.date = item['publication-date']['year'].value
}
if (data[1] != null) {
author['authorFamilyName'] = data[1].value;
} else {
author['authorFamilyName'] = "";
}
authors.push(author);
return true;
}
return false;
}
result.accessRights = "OPEN";
if(item.publisher){
result.publisher = item.publisher;
}
result.result = item;
results.push(result);
static parseOrcidAuthors(data: any): any {
let mydata: any;
let length: number;
let authorIds: string[] = [];
if (data != null) {
length = data.length != undefined ? data.length : 1;
for (let i = 0; i < length; i++) {
mydata = data.length != undefined ? data[i] : data;
if (mydata.hasOwnProperty("orcid-identifier")) {
authorIds.push(mydata['orcid-identifier'].path);
}
}
}
return authorIds;
}
return results;
static parse(authorId, response): ClaimEntity[] {
const results: ClaimEntity[] = [];
for (let i = 0; i < response.length; i++) {
let item = response[i];
const entity: ClaimEntity = new ClaimEntity();
entity.result = new ClaimResult();
entity.result.DOI = null;
entity.result.url = null;
entity.result.publisher = null;
entity.result.journal = null;
if (item['work-summary'] && item['work-summary'].length > 0) {
item = item['work-summary'][0];
} else {
item = item['work-summary'];
}
let handleId = null;
if (item['external-ids'] && item['external-ids']['external-id']) {
for (let j = 0; j < item['external-ids']['external-id'].length; j++) {
const id = item['external-ids']['external-id'][j];
if (id['external-id-type'] == "doi") {
entity.result.DOI = id['external-id-value'];
entity.result.url = "http://dx.doi.org/" + entity.result.DOI;
break;
}else if (id['external-id-type'] == "handle" && !handleId) {
handleId= id['external-id-value'];
break;
}
}
}
if(!entity.result.url && handleId){
entity.result.url = handleId;
}
entity.id = authorId + "-" + item['put-code'];
if (item.title && item.title.title) {
entity.title = item['title']['title'].value;
}
entity.result.journal = item['journal-title'];
entity.result.source = 'orcid';
entity.type = 'publication';
if (item['publication-date'] && item['publication-date']['year']) {
entity.result.date = item['publication-date']['year'].value
}
entity.result.accessRights = "OPEN";
if (item.publisher) {
entity.result.publisher = item.publisher;
}
entity.result.authors = [];
entity.result.record = item;
results.push(entity);
}
return results;
}
}

View File

@ -1,16 +1,16 @@
import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core';
import {ClaimResult} from '../claim-utils/claimEntities.class';
import {AlertModal} from '../../utils/modal/alert';
@Component({
selector: 'start-over',
template: `
<!--button (click)="confirmOpen()" class="uk-button portal-button uk-align-left" > <span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="refresh" ratio="1"><path fill="none" stroke="#000" stroke-width="1.1" d="M17.08,11.15 C17.09,11.31 17.1,11.47 17.1,11.64 C17.1,15.53 13.94,18.69 10.05,18.69 C6.16,18.68 3,15.53 3,11.63 C3,7.74 6.16,4.58 10.05,4.58 C10.9,4.58 11.71,4.73 12.46,5"></path><polyline fill="none" stroke="#000" points="9.9 2 12.79 4.89 9.79 7.9"></polyline></svg></span> Clear All</button-->
<span (click)="confirmOpen()" uk-tooltip="title:Remove selected" aria-expanded="false" class="uk-text-danger uk-width-small" [style]="'cursor: '+ ((results.length + projects.length + contexts.length > 0)?'pointer;':'not-allowed;')" [style.cursor]="((results.length + projects.length + contexts.length > 0)?'pointer':'not-allowed')">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <polyline fill="none" stroke="#000" points="6.5 3 6.5 1.5 13.5 1.5 13.5 3"></polyline> <polyline fill="none" stroke="#000" points="4.5 4 4.5 18.5 15.5 18.5 15.5 4"></polyline> <rect x="8" y="7" width="1" height="9"></rect> <rect x="11" y="7" width="1" height="9"></rect> <rect x="2" y="3" width="16" height="1"></rect></svg>
</span>
<span (click)="confirmOpen()" [attr.uk-tooltip]="'title:<div >Remove '+message+'</div>'" aria-expanded="false" class="uk-width-small" [style]="'cursor: '+ ((results.length > 0)?'pointer;':'not-allowed;')" [style.cursor]="((results.length> 0)?'pointer':'not-allowed')">
<span class="uk-icon" >
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="trash" ratio="0.8"><polyline fill="none" stroke="#000" points="6.5 3 6.5 1.5 13.5 1.5 13.5 3"></polyline><polyline fill="none" stroke="#000" points="4.5 4 4.5 18.5 15.5 18.5 15.5 4"></polyline><rect x="8" y="7" width="1" height="9"></rect><rect x="11" y="7" width="1" height="9"></rect><rect x="2" y="3" width="16" height="1"></rect></svg>
</span> Remove all
</span>
<modal-alert (alertOutput)="confirmClose($event)">
@ -25,27 +25,26 @@ export class StartOverComponent {
}
// @Input() public inlineEntity = null;
@Input() public type:string;
@Input() public linkTo:string;
@Input() public results;
@Input() public projects;
@Input() public contexts;
@Input() public message = "selected entities";
@ViewChild(AlertModal) alertApplyAll;
@Input() localStoragePrefix:string = "";
confirmOpen(){
if(this.projects.length + this.results.length + this.contexts.length == 0 ){
if( this.results.length == 0 ){
return;
}
this.alertApplyAll.cancelButton = true;
this.alertApplyAll.okButton = true;
this.alertApplyAll.alertTitle = "Remove selected";
this.alertApplyAll.message = "Do you want to remove selected entities (projects, communities, research results)?";
this.alertApplyAll.alertTitle = "Remove entities";
this.alertApplyAll.message = "Do you want to remove " + this.message + "?";
this.alertApplyAll.okButtonText = "Yes";
this.alertApplyAll.cancelButtonText = "No";
this.alertApplyAll.open();
this.alertApplyAll.okButtonLeft = false;
}
confirmClose(data){
this.startOver();
@ -53,23 +52,18 @@ export class StartOverComponent {
startOver(){
if(this.type != null && this.linkTo != null){
//console.log("inline");
if(this.linkTo == "project"){
this.projects.splice(0, this.projects.length);
}else if(this.linkTo == "context"){
this.contexts.splice(0, this.contexts.length);
}else if(this.linkTo == "result"){
this.results.splice(0, this.results.length);
}
//TODO
// if(this.linkTo == "project"){
// this.projects.splice(0, this.projects.length);
// }else if(this.linkTo == "context"){
// this.contexts.splice(0, this.contexts.length);
// }else if(this.linkTo == "entity"){
// this.results.splice(0, this.results.length);
// }
}else{
//console.log("generic");
this.results.splice(0, this.results.length);
this.projects.splice(0, this.projects.length);
this.contexts.splice(0, this.contexts.length);
}
localStorage.removeItem(this.localStoragePrefix + "projects");
localStorage.removeItem(this.localStoragePrefix + "contexts");
localStorage.removeItem(this.localStoragePrefix + "results");
//console.log("projects:"+this.projects.length +" contexts:"+this.contexts.length + " results:"+this.results.length );
localStorage.removeItem(this.localStoragePrefix);
}
}

View File

@ -1,100 +1,26 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
<div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<schema2jsonld *ngIf="url" [URL]="url" name="Linking" type="other"></schema2jsonld>
<linking-generic *ngIf="validInput" [localStoragePrefix]="localStoragePrefix" [results]="results" [sources]="sources"
[communityId]="communityId" [inlineEntity]="inlineEntity" [showOptions]="showOptions">
</linking-generic>
<div class="uk-container uk-margin-top">
<div class="uk-article-title custom-article-title">
Link
</div>
<div class="uk-width-1-1">
<helper position="top"></helper>
</div>
<div class="uk-grid helper-grid">
<helper position="left" styleName=" uk-width-1-5 uk-padding-left"></helper>
<div class="uk-width-expand">
<div *ngIf="validInput != null && !validInput" class="uk-alert uk-alert-warning" role="alert">No valid arguments provided in order to start linking openAIRE entities. </div>
<div *ngIf="validInput != null && validInput">
<ul uk-accordion *ngIf=" ! (linkTo =='result' && show=='claim') " uk-accordion class="uk-padding-small uk-margin-remove-bottom basket-accordion">
<li>
<h3 class=" uk-text-right uk-margin-remove-vertical uk-width-small uk-margin-auto-left uk-accordion-title basket-title portal-color" uk-tooltip="title:Click to see your selections">
<span class="uk-icon"><svg xml:space="preserve" xmlns:xlink="http://www.w3.org/1999/xlink" height="28px" id="my-box" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="28px" x="0px" xmlns="http://www.w3.org/2000/svg" y="0px"><g> <path d="M480,320v128H32V320h78.859l64.016,96h162.25l64-96H480 M384,32H128L0,288v192h512V288L384,32L384,32z M35.781,288l112-224 h216.438l112,224H384l-64,96H192l-64.016-96H35.781L35.781,288z" fill="#b5b5b5"></path></g> </svg> </span>
<span class="uk-badge basket-badge ">{{(projects.length + contexts.length + results.length - ((type =="project")?1:0)) | number}}</span>
</h3>
<div class="uk-accordion-content uk-margin-left uk-margin-right uk-background-muted uk-margin-remove-top dropbasket uk-padding-small uk-margin uk-grid-match uk-child-width-1-1 uk-child-width-1-1@m uk-grid uk-grid-stack">
<start-over [results]="results" [contexts]="contexts" [projects]="projects" [localStoragePrefix]=localStoragePrefix [linkTo]="linkTo" [type]="type"></start-over>
<claim-selected-projects *ngIf=" linkTo == 'project' " title="link Projects" [projects]="projects" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" [localStoragePrefix]=localStoragePrefix > </claim-selected-projects>
<claim-selected-contexts *ngIf=" linkTo == 'context' " title="link Communities" [contexts]="contexts" [projects]="projects" [results]="results" [inlineEntity] = "inlineResult" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" [localStoragePrefix]=localStoragePrefix > </claim-selected-contexts>
<claim-selected-results *ngIf=" linkTo == 'result' " title= "Selected Research Results" [results]="results" [bulkMode]="bulkMode" showSearch=false
showAccessRights=false [localStoragePrefix]=localStoragePrefix></claim-selected-results>
</div>
</li>
</ul>
<div class="uk-card uk-card-default uk-padding-small">
<div class="">
Link your {{((type=='orp')?'research product':type)}}
<div *ngIf="!validInput" id="tm-main" class=" uk-section uk-margin-small-top tm-middle">
<div class="uk-grid">
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-margin-top">
<div class="uk-article-title custom-article-title">
Link
</div>
<div class="uk-clearfix">
<!--start-over [results]="results" [contexts]="contexts" [projects]="projects" [linkTo]="linkTo" [type]="type" ></start-over-->
<div class="uk-width-1-1">
</div>
<div class="uk-grid helper-grid">
<div class="uk-width-expand">
<div *ngIf="validInput != null && !validInput" class="uk-alert uk-alert-warning"
role="alert">No valid arguments provided in order to start linking openAIRE entities.
</div>
</div>
<!-- inline result -->
<div *ngIf="displayedResult != null && (type =='publication' || type =='dataset' || type=='software' || type=='orp' )" class="uk-margin-top uk-margin-left uk-margin-right uk-background-muted uk-first-column uk-padding-small " >
<div>
<a *ngIf="displayedResult.url" target="_blank" href="{{displayedResult.url}}" > <span class="custom-external"></span> {{((displayedResult.title == undefined || displayedResult.title == '')?'[no title available]':displayedResult.title)}}</a>
<span *ngIf="!displayedResult.url" > {{((displayedResult.title == undefined || displayedResult.title == '')?'[no title available]':displayedResult.title)}}</span>
</div>
<div *ngIf="displayedResult.result.authors && displayedResult.result.authors.length >0 " class="uk-article-meta">Authors: <span *ngFor="let author of displayedResult.result.authors.slice(0,10) let i = index">{{author.fullName}}{{(i < (displayedResult.result.authors.slice(0,10).length-1))?"; ":""}}{{(i == displayedResult.result.authors.slice(0,10).length-1 && displayedResult.result.authors.length > 10)?"...":""}}</span></div>
</div>
<!-- inline project -->
<div *ngIf=" type == 'project' && projects.length > 0 " class="uk-margin-top uk-margin-left uk-margin-right uk-background-muted uk-first-column uk-padding-small" uk-grid="">
{{projects[0].funderName}} | {{projects[0].projectName}} {{(projects[0].projectAcronym)?'('+projects[0].projectAcronym+')':''}}
</div>
<!-- search for entity -->
<div class="uk-margin-top ">
to one or more {{(linkTo =='project')?'projects':''}} {{(linkTo =='context')?'communities':''}} {{(linkTo =='result')?((type !='project'?' other':'')+' research results'):''}}
</div>
</div>
<div class = "uk-margin-top uk-margin-left uk-margin-right uk-margin-bottom">
<claim-projects-search-form *ngIf=" linkTo =='project' " [(selectedProjects)]="projects" [(properties)] = properties inlineClaim=false [localStoragePrefix]=localStoragePrefix> </claim-projects-search-form>
<claim-contexts-search-form *ngIf=" linkTo =='context' " [communityId]=communityId [(selectedList)]="contexts" [projects]="projects" [results]="results" [inlineEntity]="inlineResult" [(properties)]=properties inlineClaim=false [localStoragePrefix]=localStoragePrefix> </claim-contexts-search-form>
<claim-result-search-form *ngIf=" linkTo =='result' && show!='claim' " [selectedResults]="results" [(properties)]=properties [localStoragePrefix]=localStoragePrefix > </claim-result-search-form>
</div>
</div>
<div *ngIf=" show == 'claim' " class="uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l ">
<claim-selected-results *ngIf=" linkTo =='result' " title= "Selected Research Results" [results]="results" [bulkMode]=false showSearch = false showAccessRights = true
[localStoragePrefix]=localStoragePrefix></claim-selected-results>
<div class="uk-width-1-1 uk-margin-small-top">
<claim-insert class="uk-float-right" [contexts]="contexts" [results]="results" [projects]="projects" [inlineEntity] = inlineResult [show] = "show"
[(properties)]=properties [localStoragePrefix]=localStoragePrefix ></claim-insert>
</div>
</div>
<ul *ngIf="linkTo == 'result'" class=" uk-pagination uk-flex-center uk-margin-auto uk-text-center">
<li *ngIf="show == 'claim'" (click)="show='result';"><a><span class="uk-margin-small-right" uk-pagination-previous></span> Previous</a></li>
<li *ngIf="show != 'claim'"(click)="show='claim';" >
<a>Next <span uk-pagination-next></span></a>
</li>
</ul>
</div>
</div>
<helper position="right" styleName=" uk-width-1-5"></helper>
</div>
<helper position="bottom"></helper>
</div>
</div>
</div>
</div>

View File

@ -1,267 +1,228 @@
import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import {Component, Input, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../../utils/properties/env-properties';
import {ClaimProject, ClaimResult} from '../claim-utils/claimEntities.class';
import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySearch.service';
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {SearchSoftwareService} from '../../services/searchSoftware.service';
import {SearchOrpsService} from '../../services/searchOrps.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {EnvProperties} from '../../utils/properties/env-properties';
import {ClaimEntity, ClaimProject, ShowOptions} from '../claim-utils/claimHelper.class';
import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySearch.service';
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {SearchSoftwareService} from '../../services/searchSoftware.service';
import {SearchOrpsService} from '../../services/searchOrps.service';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {LinkingGenericComponent} from "../linking/linkingGeneric.component";
import {ClaimResultSearchFormComponent} from "../claim-utils/claimResultSearchForm.component";
@Component({
selector: 'directLinking',
templateUrl: 'directLinking.component.html'
selector: 'directLinking',
templateUrl: 'directLinking.component.html'
})
export class DirectLinkingComponent {
contexts=[];
projects=[];
@ViewChild(LinkingGenericComponent) linking: LinkingGenericComponent;
results = [];
results: ClaimEntity[] = [];
linkType:string ="project"; // link type (selected in home page) : project, context, software, etc
// linkType: string = "project"; // link type (selected in home page) : project, context, software, etc
/* url Parameters for inline linking */
id:string = null; //entity id
type:string = null; // entity type (publication or dataset)
linkTo:string = null; // entity type (project or context or result)
id: string = null; //entity id
type: string = null; // entity type (publication or dataset)
// linkTo: string = null; // entity type (project or context or entity)
// linkToEntities: string[] = [];
showOptions:ShowOptions = new ShowOptions();
validEntityTypes = ["dataset", "publication", "software", "orp", "project", "context"];
sources: ClaimEntity[] = [];
inlineEntity: ClaimEntity = null;
sub: any = null;
validInput: boolean = null;//'true;
properties: EnvProperties;
@Input() communityId: string = null;
localStoragePrefix: string = "";
constructor(private _router: Router, private route: ActivatedRoute,private entitySearch:EntitiesSearchService,
private publicationsSearch: SearchPublicationsService, private datasetsSearch: SearchDatasetsService,
private softwareSearch: SearchSoftwareService, private ORPSearch: SearchOrpsService,
private _meta: Meta, private _title: Title, private seoService: SEOService) {
entityTypes=["dataset", "publication","software","orp", "project","context"];
inlineResult:ClaimResult =null;
displayedResult:ClaimResult =null;
sub:any =null;
show:string="claim"; //{claim,result}
validInput:boolean = null;//'true;
properties:EnvProperties;
@Input() communityId:string= null;
localStoragePrefix:string = "";
url=null;
constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService,
private softwareSearch:SearchSoftwareService,private ORPSearch:SearchOrpsService,
private _meta: Meta, private _title: Title, private seoService: SEOService ) {
var title = "OpenAIRE | Direct Linking";
this._meta.updateTag({content:title},"property='og:title'");
this._title.setTitle(title);
let title = "OpenAIRE | Direct Linking";
this._meta.updateTag({content: title}, "property='og:title'");
this._title.setTitle(title);
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.url = data.envSpecific.baseLink+this._router.url;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url, false);
this.properties = data.envSpecific;
let url = data.envSpecific.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url, false);
});
this.sub = this.route.queryParams.subscribe(params => {
this.id = params['id'];
this.type = params['type'];
this.linkTo = params['linkTo'];
if(this.type!=null && this.linkTo!=null){
this.type = (this.entityTypes.indexOf(this.type) != -1)? this.type:'publication';
this.linkTo = (this.entityTypes.indexOf(this.linkTo) != -1 || this.linkTo == "result")? this.linkTo:'project';
this.show = (this.linkTo != "result")?"claim":"result";
this.linkType = this.linkTo;
var isInlineResult:boolean = false; // is a link result - result
if((this.type == "publication" || this.type == "dataset" || this.type == "software") && ((this.linkTo == "publication" || this.linkTo == "dataset" || this.linkTo == "software" || this.linkTo == "orp") || this.linkTo == "result" )){
isInlineResult = true;
}
this.localStoragePrefix = this.type.substr(0,3)+"_"+this.linkTo.substr(0,3)+"_";
//console.log("\n\n"+this.localStoragePrefix+"\n\n");
if(localStorage.getItem(this.localStoragePrefix + "projects")){
this.projects = JSON.parse(localStorage.getItem(this.localStoragePrefix + "projects"));
}
if(localStorage.getItem(this.localStoragePrefix + "contexts")){
this.contexts = JSON.parse(localStorage.getItem(this.localStoragePrefix + "contexts"));
}
if(localStorage.getItem(this.localStoragePrefix + "results")){
this.results = JSON.parse(localStorage.getItem(this.localStoragePrefix + "results"));
}
//console.log("\n\nGetting inline entity "+this.type+"\n\n");
if(this.type == "project"){
this.linkType = "project";
this.getProjectById(this.id);
}else if(this.type == "publication"){
this.getPublicationById(this.id,true);
}else if(this.type == "dataset"){
this.getDatasetById(this.id,true);
}else if(this.type == "software"){
this.getSoftwareById(this.id,true);
}else if(this.type == "orp"){
this.getOrpById(this.id,true);
}else{
this.validInput = this.isValidInput(null);
this.id = params['id'];
this.type = params['type'];
this.showOptions.linkTo = params['linkTo'];
if (this.type != null && this.showOptions.linkTo != null) {
this.type = (this.validEntityTypes.indexOf(this.type) != -1) ? this.type : 'publication';
this.showOptions.linkTo = (this.validEntityTypes.indexOf(this.showOptions.linkTo) != -1 || this.showOptions.linkTo == "result") ? this.showOptions.linkTo : 'project';
// this.show = (this.linkTo != "entity") ? "claim" : "entity";
// this.linkType = this.linkTo;
// let isInlineResult: boolean = false; // is a link entity - entity
// if ((this.type == "publication" || this.type == "dataset" || this.type == "software") && ((this.linkTo == "publication" || this.linkTo == "dataset" || this.linkTo == "software" || this.linkTo == "orp") || this.linkTo == "entity")) {
// isInlineResult = true;
// }
this.localStoragePrefix = (this.communityId ? (this.communityId + "_") : '') + this.type.substr(0, 3) + "_" + this.showOptions.linkTo.substr(0, 3) + "_";
if (localStorage.getItem(this.localStoragePrefix + "results")) {
this.results = JSON.parse(localStorage.getItem(this.localStoragePrefix + "results"));
}
if (localStorage.getItem(this.localStoragePrefix + "sources")) {
this.sources = JSON.parse(localStorage.getItem(this.localStoragePrefix + "sources"));
}
//console.log("\n\nGetting inline entity "+this.type+"\n\n");
if (this.type == "project") {
// this.linkType = "project";
this.getProjectById(this.id);
} else if (this.type == "publication") {
this.getPublicationById(this.id);
} else if (this.type == "dataset") {
this.getDatasetById(this.id);
} else if (this.type == "software") {
this.getSoftwareById(this.id);
} else if (this.type == "orp") {
this.getOrpById(this.id);
} else {
this.validInput = this.isValidInput(null);
}
//set which entities it is allowed to link to.
// add first the
if(this.type == "project"){
this.showOptions.linkToEntities = ["result"];
this.showOptions.linkTo = "result";
}else{
// entity type (project or context or entity)
if(this.showOptions.linkTo == "project"){
this.showOptions.linkToEntities = ["project","context" ,"result"];
}else if(this.showOptions.linkTo == "context"){
this.showOptions.linkToEntities = ["context","project", "result" ];
}else{
this.showOptions.linkTo = "result";
this.showOptions.linkToEntities = ["result","project","context" ];
}
}else{
this.validInput = this.isValidInput(null);
}
}
} else {
this.validInput = this.isValidInput(null);
});
}
});
}
isValidInput(result){
if(result == null){
isValidInput(result: ClaimEntity) {
if (result == null) {
return false;
}else if(this.type == "project" && this.linkTo != "result"){
} else if (this.type == "project" && this.showOptions.linkTo != "result") {
return false;
}else if(["dataset","publication","software", "orp"].indexOf(this.type) != -1 && (["project","context","result"].indexOf(this.linkTo) == -1)){
} else if (["dataset", "publication", "software", "orp"].indexOf(this.type) != -1 && (["project", "context", "result"].indexOf(this.showOptions.linkTo) == -1)) {
return false;
}else if(["project","dataset","publication","software","orp"].indexOf(this.type) == -1){
} else if (["project", "dataset", "publication", "software", "orp"].indexOf(this.type) == -1) {
return false;
}else{
} else {
return true;
}
}
getProjectById(id:string){
this.sub = this.entitySearch.fetchByType(id,"project", this.properties).subscribe(
data => {
var item =data[0];
var project: ClaimProject = new ClaimProject();
project.funderId = item.funderId;
project.funderName = item.funderName;
project.projectId = id;
project.projectName = item.projectName;
project.projectAcronym = item.projectAcronym;
project.startDate = item.startDate;
project.endDate = item.endDate;
project.code = item.code;
project.jurisdiction = item.jurisdiction;
project.fundingLevel0 = item.fundingLevel0;
this.projects.push( project);
this.validInput = this.isValidInput(project);
},
err => {
this.validInput = this.isValidInput(null);
//console.log("An error occured")
this.handleError("Error getting project by id: "+id, err);
});
}
getPublicationById(id:string, isInlineResult:boolean){
this.sub = this.publicationsSearch.searchPublicationById(id,this.properties).subscribe(
data => {
var item =data[0];
var result: ClaimResult = new ClaimResult();
result.id=id;
result.type="publication";
result.source="openaire";
result.title = item['title'].name;
result.url= item['title'].url;
result.result = item;
result.accessRights = item['title'].accessMode;
result.date = item.year;
this.displayedResult = result;
if(isInlineResult){
this.inlineResult = result;
}else{
this.results.push( result);
}
this.validInput = this.isValidInput(result);
},
err => {
getProjectById(id: string) {
this.sub = this.entitySearch.fetchByType(id,"project", this.properties).subscribe(
data => {
this.createClaimEntity(data, "project");
},
err => {
this.validInput = this.isValidInput(null);
//console.log("An error occured")
this.handleError("Error getting publication by id: "+id, err);
});
}
getDatasetById(id:string, isInlineResult:boolean){
this.sub = this.datasetsSearch.searchDatasetById(id,this.properties).subscribe(
data => {
var item =data[0];
var result: ClaimResult = new ClaimResult();
result.id=id;
result.type="dataset";
result.source="openaire";
result.title = item['title'].name;
result.url= item['title'].url;
result.result = item;
result.accessRights = item['title'].accessMode;
result.embargoEndDate ="";
result.date = item.year;
this.displayedResult = result;
if(isInlineResult){
this.inlineResult = result;
}else{
this.results.push( result);
}
this.validInput = this.isValidInput(result);
},
err => {
this.validInput = this.isValidInput(null);
//console.log("An error occured")
this.handleError("Error getting research data by id: "+id, err);
this.handleError("Error getting project by id: " + id, err);
});
}
getSoftwareById(id:string, isInlineResult:boolean){
this.sub = this.softwareSearch.searchSoftwareById(id,this.properties).subscribe(
data => {
var item =data[0];
var result: ClaimResult = new ClaimResult();
result.id=id;
result.type="software";
result.source="openaire";
result.title = item['title'].name;
result.url= item['title'].url;
result.result = item;
result.accessRights = item['title'].accessMode;
result.embargoEndDate ="";
result.date = item.year;
this.displayedResult = result;
if(isInlineResult){
this.inlineResult = result;
}else{
this.results.push( result);
}
this.validInput = this.isValidInput(result);
getPublicationById(id: string) {
this.sub = this.publicationsSearch.searchPublicationById(id, this.properties).subscribe(data => {
this.createClaimEntity(data, "publication");
},
err => {
this.validInput = this.isValidInput(null);
//console.log("An error occured")
this.handleError("Error getting software by id: "+id, err);
});
}
getOrpById(id:string, isInlineResult:boolean){
this.sub = this.ORPSearch.searchOrpById(id,this.properties).subscribe(
err => {
this.validInput = this.isValidInput(null);
//console.log("An error occured")
this.handleError("Error getting publication by id: " + id, err);
});
}
getDatasetById(id: string) {
this.sub = this.datasetsSearch.searchDatasetById(id, this.properties).subscribe(
data => {
var item =data[0];
var result: ClaimResult = new ClaimResult();
result.id=id;
result.type="other";
result.source="openaire";
result.title = item['title'].name;
result.url= item['title'].url;
result.result = item;
result.accessRights = item['title'].accessMode;
result.embargoEndDate ="";
result.date = item.year;
this.displayedResult = result;
if(isInlineResult){
this.inlineResult = result;
}else{
this.results.push( result);
}
this.validInput = this.isValidInput(result);
},
err => {
this.validInput = this.isValidInput(null);
//console.log("An error occured")
this.handleError("Error getting other research product by id: "+id, err);
});
}
this.createClaimEntity(data, "dataset");
},
err => {
this.validInput = this.isValidInput(null);
//console.log("An error occured")
this.handleError("Error getting research data by id: " + id, err);
});
}
getSoftwareById(id: string) {
this.sub = this.softwareSearch.searchSoftwareById(id, this.properties).subscribe(
data => {
this.createClaimEntity(data, "software");
},
err => {
this.validInput = this.isValidInput(null);
//console.log("An error occured")
this.handleError("Error getting software by id: " + id, err);
});
}
getOrpById(id: string) {
this.sub = this.ORPSearch.searchOrpById(id, this.properties).subscribe(
data => {
this.createClaimEntity(data, "other");
},
err => {
this.validInput = this.isValidInput(null);
//console.log("An error occured")
this.handleError("Error getting other research product by id: " + id, err);
});
}
createClaimEntity(data, type: string) {
let results: ClaimEntity[] =[] ;
if(type =="project"){
let project = data[0];
let entity:ClaimEntity = new ClaimEntity();
entity.id = project.id;
entity.type = "project";
entity.title = project.projectName;
entity.project = new ClaimProject();
entity.project.acronym = project.projectAcronym;
entity.project.code = project.code;
entity.project.endDate = project.endDate;
entity.project.funderId = project.funderId;
entity.project.funderName = project.funderName;
entity.project.fundingLevel0 = project.fundingLevel0;
entity.project.jurisdiction = project.jurisdiction;
entity.project.startDate = project.startDate;
this.inlineEntity = entity;
}else{
results = ClaimResultSearchFormComponent.openaire2ClaimResults(data, type);
}
if (results.length > 0) {
this.inlineEntity = results[0]
}
this.validInput = this.isValidInput(this.inlineEntity);
}
private handleError(message: string, error) {
console.error("Direct Linking Page: "+message, error);
console.error("Direct Linking Page: " + message, error);
}
}

View File

@ -3,36 +3,23 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../../shared/shared.module';
import { DirectLinkingComponent } from './directLinking.component';
import {SelectedProjectsModule} from '../linking/selected/selectedProjects.module';
import {SelectedContextsModule} from '../linking/selected/selectedContexts.module';
import {SelectedPublicationsModule} from '../linking/selected/selectedResults.module';
import {InsertClaimsModule} from '../linking/insertClaim/insertClaim.module';
import {StartOverModule} from '../claim-utils/startOver.module';
import {EntitySearchServiceModule} from '../../utils/entitiesAutoComplete/entitySearchService.module';
import {PublicationsServiceModule} from '../../services/publicationsService.module';
import {DatasetsServiceModule} from '../../services/datasetsService.module';
import {SoftwareServiceModule} from '../../services/softwareService.module';
import {LoginGuard} from'../../login/loginGuard.guard';
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
import {HelperModule} from '../../utils/helper/helper.module';
import {ClaimContextSearchFormModule} from '../claim-utils/claimContextSearchForm.module';
import {ClaimProjectsSearchFormModule} from '../claim-utils/claimProjectSearchForm.module';
import {ClaimResultSearchFormModule} from '../claim-utils/claimResultSearchForm.module';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {OrpsServiceModule} from '../../services/orpsService.module';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {LinkingGenericModule} from '../linking/linkingGeneric.module';
@NgModule({
imports: [
SharedModule,
SelectedProjectsModule, SelectedContextsModule, SelectedPublicationsModule, InsertClaimsModule,
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, StartOverModule, HelperModule,
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, ClaimResultSearchFormModule, OrpsServiceModule, Schema2jsonldModule, SEOServiceModule
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, SoftwareServiceModule,
OrpsServiceModule, Schema2jsonldModule, SEOServiceModule, LinkingGenericModule
],
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled],
declarations: [

View File

@ -1,285 +1,314 @@
import {Component, Input, Output, EventEmitter,ViewChild} from '@angular/core';
import {Observable} from 'rxjs';
import {Component, Input, ViewChild} from '@angular/core';
import {SearchCrossrefService} from '../../claim-utils/service/searchCrossref.service';
import {SearchDataciteService} from '../../claim-utils/service/searchDatacite.service';
import {ModalLoading} from '../../../utils/modal/loading.component';
import {Dates, DOI} from '../../../utils/string-utils.class';
import {ClaimResult} from '../../claim-utils/claimEntities.class';
import{EnvProperties} from '../../../utils/properties/env-properties';
declare var UIkit:any;
import {EnvProperties} from '../../../utils/properties/env-properties';
import {ClaimEntity} from "../../claim-utils/claimHelper.class";
declare var UIkit: any;
@Component({
selector: 'bulk-claim',
template: `
<div class="uk-animation " style=" ">
<form class=" uk-padding uk-padding-medium uk-padding-remove-left uk-margin-left uk-margin-small-top ">
selector: 'bulk-claim',
template: `
<div class="uk-animation uk-text-center" style=" ">
<form class=" ">
<div class="uk-grid">
<div class="uk-width-expand">
<div class="uk-text-lead">Upload a DOI csv file <helper div="link-result-bulk" tooltip=true ></helper></div>
<!--h3 for="exampleInputFile">Or upload a DOI csv file:</h3-->
<label for="exampleInputFile">Select a file: </label>
<div class="js-upload" uk-form-custom>
<input id="exampleInputFile" class="uk-width-medium" type="file" (change)="fileChangeEvent($event)"/>
<button class="uk-button portal-button" type="button" tabindex="-1" [class.disabled]="!enableUpload" ><span class="uk-margin-small-right uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline> <rect x="3" y="17" width="13" height="1"></rect>
<line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg></span> Select</button>
<!--button class="uk-button uk-button-small" [class.disabled]="!enableUpload" type="button" (click)="upload()">Upload</button-->
</div>
<div *ngIf="showReport" uk-alert class="uk-alert uk-alert-primary" role="alert" >
<a class="uk-alert-close" uk-close></a>
<div>Uploaded file contains {{allIds.length}} {{((allIds.length==1)?'DOI':'DOIs')}}.
<span *ngIf="allIds.length > 0">{{foundIds.length}} {{((foundIds.length==1)?'result was':'results were')}} succefully fetched from CrossRef and Datacite.</span>
<div class="uk-grid">
<div class="uk-width-expand">
<!--div class="uk-text-lead">Upload a DOI csv file <helper div="link-result-bulk" tooltip=true ></helper></div>
<label for="exampleInputFile">Select a file: </label-->
<div class="js-upload" uk-form-custom>
<input id="exampleInputFile" class="uk-width-medium" type="file" (change)="fileChangeEvent($event)"/>
<span class="uk-link " style="text-decoration: underline;">Upload a DOI's CSV file </span>
<!--button class="uk-button portal-button" type="button" tabindex="-1" [class.disabled]="!enableUpload" ><span class="uk-margin-small-right uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline> <rect x="3" y="17" width="13" height="1"></rect>
<line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg></span> Select</button-->
<!--helper div="link-result-bulk" tooltip=true ></helper-->
</div>
<div *ngIf ="duplicateIds.length > 0" >{{duplicateIds.length | number}} duplicate DOIs in {{((duplicateIds.length==1)?'line':'lines')}} {{duplicateIdsRow}}.</div>
<div *ngIf = "notFoundIds.length > 0" >Couldn't be found:
<ul class="">
<li *ngFor="let id of notFoundIds; let i = index">"{{id}}" in line {{notFoundIdsRow[i]}}</li>
</ul>
<div *ngIf="showReport" uk-alert class="uk-alert uk-alert-primary" role="alert">
<a class="uk-alert-close uk-icon uk-close" ><svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg" data-svg="close-icon"><line fill="none" stroke="#000" stroke-width="1.1" x1="1" y1="1" x2="13" y2="13"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="13" y1="1" x2="1" y2="13"></line></svg></a>
<div>Uploaded file contains {{allIds.length}} {{((allIds.length == 1) ? 'DOI' : 'DOIs')}}.
<span
*ngIf="allIds.length > 0">{{foundIds.length}} {{((foundIds.length == 1) ? 'result was' : 'results were')}} succefully fetched from CrossRef and Datacite.</span>
</div>
<div
*ngIf="duplicateIds.length > 0">{{duplicateIds.length | number}} duplicate DOIs in {{((duplicateIds.length == 1) ? 'line' : 'lines')}} {{duplicateIdsRow}}.
</div>
<div *ngIf="notFoundIds.length > 0">Couldn't be found:
<ul class="">
<li *ngFor="let id of notFoundIds; let i = index">"{{id}}" in line {{notFoundIdsRow[i]}}</li>
</ul>
</div>
<div *ngIf="noValidIds.length > 0">No valid DOIs:
<ul class="">
<li *ngFor="let id of noValidIds; let i = index">"{{id}}" in line {{noValidIdsRow[i]}}</li>
</ul>
</div>
<div
*ngIf="allIds.length == 0 || foundIds.length == 0"> Please make sure that the uploaded file, is a csv file with the proper format.
</div>
</div>
<div *ngIf = "noValidIds.length > 0" >No valid DOIs:
<ul class="">
<li *ngFor="let id of noValidIds; let i = index">"{{id}}" in line {{noValidIdsRow[i]}}</li>
</ul>
</div>
<div *ngIf = "allIds.length == 0 || foundIds.length == 0" > Please make sure that the uploaded file, is a csv file with the proper format. </div>
<div *ngIf="errorMessage.length > 0 " class="uk-alert uk-alert-danger" role="alert">
<a class="uk-alert-close uk-icon uk-close" ><svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg" data-svg="close-icon"><line fill="none" stroke="#000" stroke-width="1.1" x1="1" y1="1" x2="13" y2="13"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="13" y1="1" x2="1" y2="13"></line></svg></a>
{{errorMessage}}</div>
</div>
<div *ngIf="errorMessage.length > 0 " class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
<modal-loading [message]= "'Uploading, reading your documet and fetching results. Please give us a moment..'"></modal-loading>
<!--helper div="link-result-bulk" ></helper-->
</div>
<!--helper div="link-result-bulk" ></helper-->
</div>
</form>
</form>
</div>
`
</div>
<div class="uk-width-1-1">
<modal-loading
[message]="'Uploading, reading your documet and fetching results. Please give us a moment..'"></modal-loading>
</div>
`
})
//[(ngModel)]="date"
export class BulkClaimComponent {
filesToUpload: Array<File>;
navigateTo: string = "Search";
source: string = "crossref";
type : string = "publication";
resultsFromSearch:number;
@Input() public select:boolean = true ;
type: string = "publication";
@Input() public select: boolean = true;
@Input() public results;
@Input() public properties:EnvProperties;
@Input() public properties: EnvProperties;
allIds:string[] = [];
foundIds:string[] = [];
duplicateIds:string[] = [];
duplicateIdsRow:number[] = [];
notFoundIds:string[] = [];
notFoundIdsRow:number[] = [];
noValidIds:string[] = [];
noValidIdsRow:number[] = [];
showReport:boolean = false;
showInfo :boolean = false;
@ViewChild (ModalLoading) loading : ModalLoading ;
allIds: string[] = [];
foundIds: string[] = [];
duplicateIds: string[] = [];
duplicateIdsRow: number[] = [];
notFoundIds: string[] = [];
notFoundIdsRow: number[] = [];
noValidIds: string[] = [];
noValidIdsRow: number[] = [];
showReport: boolean = false;
@ViewChild(ModalLoading) loading: ModalLoading;
errorMessage = "";
infoMEssage = "";
enableUpload:boolean = true;
@Input() localStoragePrefix:string="";
enableUpload: boolean = true;
@Input() localStoragePrefix: string = "";
exceedsLimit = false;
limit =150;
limit = 150;
constructor(private _searchCrossrefService: SearchCrossrefService, private _searchDataciteService: SearchDataciteService) {
this.filesToUpload = [];
this.filesToUpload = [];
}
ngOnInit() {
}
ngOnInit() {}
upload() {
this.enableUpload = false;
this.showReport = false;
this.errorMessage = "";
if(this.filesToUpload.length == 0){
if (this.filesToUpload.length == 0) {
this.errorMessage = "There is no selected file to upload.";
return ;
}else{
if(this.filesToUpload[0].name.indexOf(".csv") == -1 || this.filesToUpload[0].type != "text/csv"){
return;
} else {
if (this.filesToUpload[0].name.indexOf(".csv") == -1 || this.filesToUpload[0].type != "text/csv") {
this.errorMessage = "No valid file type. The required type is CSV";
return ;
return;
}
}
this.loading.open();
this.makeFileRequest(this.properties.utilsService + '/upload', [], this.filesToUpload).then((result) => {
var rows = (result as any).split('\n'); // I have used space, you can use any thing.
this.exceedsLimit = false;
var i = 0;
var invalid_rows = 0;
this.duplicateIds = [];
this.allIds = [];
this.foundIds = [];
this.noValidIds = [];
this.results.slice(0,this.results.length);
this.notFoundIds = [];
const rows = (result as any).split('\n'); // I have used space, you can use any thing.
this.exceedsLimit = false;
let invalid_rows = 0;
this.duplicateIds = [];
this.allIds = [];
this.foundIds = [];
this.noValidIds = [];
this.results.slice(0, this.results.length);
this.notFoundIds = [];
if(rows.length + this.results.length > this.limit){
this.exceedsLimit = true;
UIkit.notification({
message : 'Your basket exceeds the number of allowed results (150)',
status : 'warning',
timeout : 1500,
pos : 'top-center'
});
if (rows.length + this.results.length > this.limit) {
this.exceedsLimit = true;
UIkit.notification({
message: 'Your basket exceeds the number of allowed results (150)',
status: 'warning',
timeout: 1500,
pos: 'top-center'
});
}
for (let i = 0; i < ((rows.length > this.limit - this.results.length) ? (this.limit - this.results.length) : rows.length); i++) {
if (rows[i] && rows[i] != null) {
const values = rows[i].split(',');
const id = BulkClaimComponent.removeDoubleQuotes(values[0]);
if (DOI.isValidDOI(id)) {
let accessMode = (values[1] != undefined) ? BulkClaimComponent.removeDoubleQuotes(values[1]) : "OPEN";
accessMode = (BulkClaimComponent.validateAccessMode(accessMode) ? accessMode : "OPEN");
let embargoDate = (values[2] != undefined) ? BulkClaimComponent.removeDoubleQuotes(values[2]) : Dates.getDateToday();
embargoDate = (Dates.isValidDate(embargoDate) ? embargoDate : Dates.getDateToday());
if (this.allIds.indexOf(id) > -1) {
this.duplicateIds.push(id);
this.duplicateIdsRow.push(i + 1);
} else {
this.allIds.push(id);
this.fetchResult(id, accessMode, embargoDate, i + 1);
}
} else {
this.noValidIds.push(id);
this.noValidIdsRow.push(i + 1);
}
for(i=0;i<((rows.length>this.limit-this.results.length)?(this.limit-this.results.length):rows.length);i++){
if(rows[i] && rows[i] != null ){
var values = rows[i].split(',');
} else {
invalid_rows++;
}
var id=this.removeDoubleQuotes(values[0]);
if(DOI.isValidDOI(id)){
var accessMode = (values[1] != undefined) ? this.removeDoubleQuotes(values[1]):"OPEN";
accessMode = (this.validateAccessMode(accessMode)?accessMode:"OPEN");
var embargoDate =(values[2] != undefined) ? this.removeDoubleQuotes(values[2]):Dates.getDateToday();
embargoDate = (Dates.isValidDate(embargoDate)?embargoDate:Dates.getDateToday());
if(this.allIds.indexOf(id)>-1){
this.duplicateIds.push(id);
this.duplicateIdsRow.push(i+1);
}else{
this.allIds.push(id);
this.fetchResult(id,accessMode,embargoDate,i+1);
}
}else{
this.noValidIds.push(id);
this.noValidIdsRow.push(i+1);
}
}else{
invalid_rows++;
}
}
if(rows.length == 0 || rows.length == invalid_rows || rows.length == (invalid_rows + this.noValidIds.length) || this.limit == this.results.length ){
this.endOfFetching();
}
}, (error) => {
this.enableUpload = true;
console.log(error);
this.loading.close();
//this.errorMessage = "An error occured while uploading...";
this.handleError("Error uploading file", error);
});
}
private removeDoubleQuotes(value){
if(value.indexOf('"')== 0){
value = value.substring(1,value.length);
}
var index =+value.indexOf('"');
if(index == (value.length - 1) || index == (value.length - 2) ){
value = value.substring(0,index);
}
return value;
}
private validateAccessMode(value){
var accessModes = ["OPEN", "CLOSED", "EMBARGO"];
if(accessModes.indexOf(value) > -1){
return true;
if (rows.length == 0 || rows.length == invalid_rows || rows.length == (invalid_rows + this.noValidIds.length) || this.limit == this.results.length) {
this.endOfFetching();
}
return false;
}, (error) => {
this.enableUpload = true;
console.log(error);
this.loading.close();
//this.errorMessage = "An error occured while uploading...";
BulkClaimComponent.handleError("Error uploading file", error);
});
}
fileChangeEvent(fileInput: any){
this.filesToUpload = <Array<File>> fileInput.target.files;
this.upload();
private static removeDoubleQuotes(value) {
if (value.indexOf('"') == 0) {
value = value.substring(1, value.length);
}
const index = +value.indexOf('"');
if (index == (value.length - 1) || index == (value.length - 2)) {
value = value.substring(0, index);
}
return value;
}
private static validateAccessMode(value) {
const accessModes = ["OPEN", "CLOSED", "EMBARGO"];
return accessModes.indexOf(value) > -1;
}
fileChangeEvent(fileInput: any) {
this.filesToUpload = <Array<File>>fileInput.target.files;
this.upload();
}
makeFileRequest(url: string, params: Array<string>, files: Array<File>) {
return new Promise((resolve, reject) => {
var formData: any = new FormData();
var xhr = new XMLHttpRequest();
for(var i = 0; i < files.length; i++) {
formData.append("uploads[]", files[i], files[i].name);
return new Promise((resolve, reject) => {
const formData: any = new FormData();
const xhr = new XMLHttpRequest();
for (let i = 0; i < files.length; i++) {
formData.append("uploads[]", files[i], files[i].name);
}
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
resolve(xhr.response);
} else {
reject(xhr.response);
}
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
resolve(xhr.response);
} else {
reject(xhr.response);
}
}
}
xhr.open("POST", url, true);
xhr.send(formData);
});
}
}
xhr.open("POST", url, true);
xhr.send(formData);
});
}
fetchResult(id:string,accessMode:string,date:string, row:number){
this._searchCrossrefService.searchCrossrefByDOIs([id], this.properties.searchCrossrefAPIURL, true).subscribe(
data => {
fetchResult(id: string, accessMode: string, date: string, row: number) {
this._searchCrossrefService.searchCrossrefByDOIs([id], this.properties.searchCrossrefAPIURL, true).subscribe(
data => {
var result = data[0];
if(data.length > 0){
this.foundIds.push(id);
result.embargoEndDate = date;
this.results.push(result);
this.endOfFetching();
}else{
this.searchInDatacite(id,accessMode,date, row);
// this.notFoundIds.push(id);
}
},
err => {
//console.log(err);
this.handleError("Error getting crossref by DOIs: "+id, err);
this.notFoundIds.push(id);
this.notFoundIdsRow.push(row);
this.endOfFetching();
const result = data[1][0];
if (data[1].length > 0) {
this.foundIds.push(id);
result["embargoEndDate"] = date;
if(!this.isSelected(result)){
this.results.push(result);
}
);
this.endOfFetching();
} else {
this.searchInDatacite(id, accessMode, date, row);
// this.notFoundIds.push(id);
}
},
err => {
//console.log(err);
BulkClaimComponent.handleError("Error getting crossref by DOIs: " + id, err);
this.notFoundIds.push(id);
this.notFoundIdsRow.push(row);
this.endOfFetching();
}
);
}
searchInDatacite(id:string,accessMode:string,date:string, row:number){
this._searchDataciteService.getDataciteResultByDOI(id,this.properties,true).subscribe(
items => {
if(items.length > 0){
var result = items[0];
searchInDatacite(id: string, accessMode: string, date: string, row: number) {
this._searchDataciteService.getDataciteResultByDOI(id, this.properties, true).subscribe(
items => {
this.foundIds.push(id);
result.embargoEndDate = date;
this.results.push(result);
}else{
this.notFoundIds.push(id);
this.notFoundIdsRow.push(row);
}
this.endOfFetching();
},
err => {
//console.log(err);
this.handleError("Error getting datacite result by DOI: "+id, err);
this.notFoundIds.push(id);
this.notFoundIdsRow.push(row);
this.endOfFetching();
if (items[1].length > 0) {
var result = items[1][0];
this.foundIds.push(id);
result["embargoEndDate"] = date;
if(!this.isSelected(result)){
this.results.push(result);
}
);
} else {
this.notFoundIds.push(id);
this.notFoundIdsRow.push(row);
}
this.endOfFetching();
},
err => {
//console.log(err);
BulkClaimComponent.handleError("Error getting datacite resultentityI: " + id, err);
this.notFoundIds.push(id);
this.notFoundIdsRow.push(row);
this.endOfFetching();
}
);
}
endOfFetching(){
if(this.limit == this.results.length){
endOfFetching() {
if (this.limit == this.results.length) {
this.enableUpload = true;
this.loading.close();
return;
}
if(this.allIds.length == this.foundIds.length+this.notFoundIds.length ){
if (this.allIds.length == this.foundIds.length + this.notFoundIds.length) {
this.showReport = true;
this.enableUpload = true;
this.loading.close();
if(this.results != null){
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.results));
}
if (this.results != null) {
localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.results));
}
}
}
private handleError(message: string, error) {
console.error("Bulk Claim (component): "+message, error);
private static handleError(message: string, error) {
console.error("Bulk Claim (component): " + message, error);
}
private isSelected(result: ClaimEntity) {
let found: boolean = false;
const id = result.id;
for (let _i = 0; _i < this.results.length; _i++) {
let item = this.results[_i];
if (item.id && item.id == id) {
found = true;
break;
}
}
return found;
// indexOf doesn't work when results came from
// return this.selectedResults.indexOf(entity)!=-1;
}
}

View File

@ -1,20 +0,0 @@
// import { NgModule } from '@angular/core';
//
// import { SharedModule } from '../../shared/shared.module';
// import { BulkLinkingComponent } from './bulkLinking.component';
// import { BulkLinkingRoutingModule } from './bulkLinking-routing.module';
// import {LinkingGenericModule} from './linkingGeneric.module';
// import {BulkClaimModule} from './bulkClaim/bulkClaim.module';
// @NgModule({
// imports: [
// SharedModule,
// BulkLinkingRoutingModule,
// LinkingGenericModule,
// BulkClaimModule
//
// ],
// declarations: [
// BulkLinkingComponent
// ], exports:[BulkLinkingComponent]
// })
// export class BulkLinkingModule { }

View File

@ -1,415 +1,494 @@
import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core';
import {Observable} from 'rxjs';
import {Router, ActivatedRoute} from '@angular/router';
import {ClaimsService} from '../../claim-utils/service/claims.service';
import {ModalLoading} from '../../../utils/modal/loading.component';
import {AlertModal} from '../../../utils/modal/alert';
import {Md5} from 'ts-md5/dist/md5';
import {Session} from '../../../login/utils/helper.class';
import {LoginErrorCodes} from '../../../login/utils/guardHelper.class';
import{EnvProperties} from '../../../utils/properties/env-properties';
import {EnvProperties} from '../../../utils/properties/env-properties';
import {
ClaimEntity,
ClaimRecord2Insert,
ClaimsErrorMessage,
DirectIndexRecord,
Message
} from "../../claim-utils/claimHelper.class";
@Component({
selector: 'claim-insert',
template: `
selector: 'claim-insert',
template: `
<div class="uk-width-1-1">
<modal-loading [message]= "'Please wait...'"></modal-loading>
<modal-alert (alertOutput)="confirmClose($event)">
</modal-alert>
<div class="uk-clearfix">
<div *ngIf="errorMessage.length > 0">
<div class="uk-alert uk-alert-danger uk-margin-top" role="alert" [innerHTML]="errorMessage"></div>
<div *ngIf="insertedClaims.length>0">{{insertedClaims.length | number}} claims created, follow <a routerLinkActive="router-link-active" routerLink="/myclaims">the link</a> to manage your claims</div>
<div class="uk-width-1-1">
<modal-loading [message]="'Please wait...'"></modal-loading>
<modal-alert (alertOutput)="confirmClose()">
<h4 class="modal-title uk-text-bold " id="myModalLabel">Confirmation notice</h4>
<p>All the links you provided will be published in the OpenAIRE platform. <br>
Please make sure that the information is valid.<br>
<span class="uk-text-bold">In some cases, links take some time to be published.</span><br>
For more information please check the linking status in My-Links page.
</p>
<p>
Do you confirm the information you provide is valid?
</p>
</modal-alert>
<div class="uk-clearfix">
<div>
<div *ngIf="!claiming " (click)="insert()" style="width: 350px;"
[class]="(((sources.length>0||inlineEntity) && results.length > 0 && (!claiming && errors.length == 0))?'linksbaskettitlesPortalColor ':'uk-disabled')+ ' linksbaskettitles uk-padding-small uk-text-center'">CONFIRM LINKING
<span class="uk-icon uk-float-right uk-text-bold uk-margin-small-right">
<svg width="30" height="30" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="chevron-right" ratio="1.5"><polyline fill="none" stroke="#000" stroke-width="1.03"
points="7 4 13 10 7 16"></polyline></svg>
</span>
</div>
</div>
</div>
<div *ngIf="warningMessage.length > 0">
<div class="uk-alert uk-alert-warning uk-margin-top" role="alert">{{warningMessage}}</div>
</div>
<div>
<button *ngIf="!claiming && showButton" (click)="validateInsertions()" class="uk-button portal-button uk-float-right" >Finish</button>
</div>
`
</div>
`
})
export class ClaimInsertComponent {
constructor (private claimService: ClaimsService, private _router:Router, private route: ActivatedRoute,) {}
constructor(private claimService: ClaimsService, private _router: Router, private route: ActivatedRoute,) {
}
ngOnInit() {
this.route.queryParams.subscribe(params => {
this.params = params;
});
// console.info("Inlineentity:" +(this.inlineEntity)?this.inlineEntity+(this.inlineEntity.id)?this.inlineEntity.id:"no id":"null"+ + " show "+ (!this.claiming && this.showButton) );
}
params= {};
@Input() public contexts;
@Input() public projects;
@Input() public results;
@Input() public showButton:boolean = true;
@Input() show='claim';
@Input() inlineEntity = null; // the entity from the landing page
@Input() public properties:EnvProperties;
@Output() showChange = new EventEmitter();
@Input() localStoragePrefix:string="";
@ViewChild (ModalLoading) loading : ModalLoading ;
params = {};
@Input() public results: ClaimEntity[];
@Input() inlineEntity: ClaimEntity = null;
@Input() sources: ClaimEntity[] = null;
@Input() public properties: EnvProperties;
@Input() localStoragePrefix: string;
@ViewChild(ModalLoading) loading: ModalLoading;
@ViewChild(AlertModal) alert;
@Input() errors: ClaimsErrorMessage[];
@Output() insertFinished = new EventEmitter();
public claiming =false;
public error = false;
public errorMessage = "";
public warningMessage = "";
public claimsTODO:number = 0;
public claims:number = 0;
public claiming = false;
private servicesRespond:number = 0;
private insertedClaims=[];
private errorInClaims=[];
private insertedRecords=[];
private errorInRecords=[];
public validateInsertions(){
// console.info("Inlineentity:" +(this.inlineEntity)?this.inlineEntity+(this.inlineEntity.id)?this.inlineEntity.id:"no id":"null"+ + " show "+ (!this.claiming && this.showButton) );
if(this.validate()){
if(this.validateDates()){
this.insertActions();
return true;
public claims: number = 0;
private servicesRespond: number = 0;
private insertedClaims = [];
private errorInClaims: ClaimRecord2Insert[] = [];
private insertedRecords = [];
private errorInRecords = [];
public insert() {
this.confirmOpen();
}
private insertActions() {
this.servicesRespond = 0;
this.insertedClaims = [];
this.errorInClaims = [];
this.insertedRecords = [];
this.errorInRecords = [];
if (!Session.isLoggedIn()) {
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.results));
if (this.sources != null) {
localStorage.setItem(this.localStoragePrefix + "sources", JSON.stringify(this.sources));
}
}
return false;
}
private insertActions(){
this.servicesRespond = 0;
this.insertedClaims=[];
this.errorInClaims=[];
this.insertedRecords=[];
this.errorInRecords=[];
if(!Session.isLoggedIn()){
this.showButton = false;
localStorage.setItem(this.localStoragePrefix + "projects", JSON.stringify(this.projects));
localStorage.setItem(this.localStoragePrefix + "contexts", JSON.stringify(this.contexts));
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.results));
if(this.inlineEntity != null){
localStorage.setItem(this.localStoragePrefix + "inlineEntity", JSON.stringify(this.inlineEntity));
}
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
this._router.navigate(['/user-info'], {
queryParams: {
"errorCode": LoginErrorCodes.NOT_VALID,
"redirectUrl": this._router.url
}
});
}else{
} else {
this.claiming = true;
var user=Session.getUserEmail();
this.loading.open();
var claims = [];
var directclaims = [];
if(this.results ){
const user = Session.getUserEmail();
this.loading.open();
let claims: ClaimRecord2Insert[] = [];
let directclaims: DirectIndexRecord[] = [];
for (let j = 0; j < this.sources.length; j++) { // if an external result -> direct insert in the index
const result: ClaimEntity = this.sources[j];
if (result.result && ["crossref", "datacite", "orcid"].indexOf(result.result.source) != -1) {
directclaims.push({"id": result.id, "record": ClaimInsertComponent.createDirectClaim(result, this.results)});
}
}
for (let i = 0; i < this.results.length; i++) {
const entity: ClaimEntity = this.results[i]; // this is a research result, a project or a context
for (var i = 0; i < this.results.length; i++) {
var result=this.results[i];
if(["crossref","datacite","orcid"].indexOf(result.source) != -1){
directclaims.push({"id":result.id, "record":this.createDirectClaim(result,this.projects,this.contexts)});
}
if(this.contexts){
for (var j = 0; j < this.contexts.length; j++) {
var context = this.contexts[j];
var claim = this.createContextClaim(result, context, user);
claims.push(claim);
}
}
if(this.projects){
for (var k = 0; k < this.projects.length; k++) {
var project = this.projects[k];
var projectClaim = this.createProjectClaim(result, project, user);
claims.push(projectClaim);
}
}
if(this.inlineEntity != null){
var resultClaim = this.createResultClaim(this.inlineEntity, result, user);
claims.push(resultClaim);
}
if (entity.result && ["crossref", "datacite", "orcid"].indexOf(entity.result.source) != -1) { // if an external result -> direct insert in the index
if (this.sources.length > 0) {
directclaims.push({
"id": entity.id,
"record": ClaimInsertComponent.createDirectClaim(entity, this.sources)
});
} else if (this.inlineEntity) {
directclaims.push({
"id": entity.id,
"record": ClaimInsertComponent.createDirectClaim(entity, [this.inlineEntity])
});
}
}
for (let j = 0; j < this.sources.length; j++) {
const result: ClaimEntity = this.sources[j]; // this is a research result
if (entity.result) {
claims.push(ClaimInsertComponent.createResultClaim(result, entity, user));
} else if (entity.context) {
claims.push(ClaimInsertComponent.createContextClaim(result, entity, user));
} else if (entity.project) {
claims.push(ClaimInsertComponent.createProjectClaim(result, entity, user));
}
}
if (this.inlineEntity) {
if (this.inlineEntity.result) {
if (entity.result) {
claims.push(ClaimInsertComponent.createResultClaim(this.inlineEntity, entity, user));
} else if (entity.context) {
claims.push(ClaimInsertComponent.createContextClaim(this.inlineEntity, entity, user));
} else if (entity.project) {
claims.push(ClaimInsertComponent.createProjectClaim(this.inlineEntity, entity, user));
}
} else if (this.inlineEntity.project) {
if (entity.result) {
claims.push(ClaimInsertComponent.createProjectClaim(entity, this.inlineEntity, user));
}
}
}
if(this.inlineEntity ){
if(this.contexts){
for (var j = 0; j < this.contexts.length; j++) {
var context = this.contexts[j];
var claim = this.createContextClaim(this.inlineEntity, context, user);
claims.push(claim);
}
}
if(this.projects){
for (var k = 0; k < this.projects.length; k++) {
var project = this.projects[k];
var projectClaim = this.createProjectClaim(this.inlineEntity, project, user);
claims.push(projectClaim);
}
}
}
//first call direct index service - when call is done (success or error) call isertBulkClaims method to insert claims in DB
if(directclaims.length > 0){
this.claimService.insertDirectRecords(directclaims,this.properties.claimsAPIURL).subscribe(
data => {
this.insertedRecords = data.insertedIds;
this.errorInRecords = data.errorInClaims;
this.isertBulkClaims(claims);
},
err => {
err=err.json();
if(err.insertedIds && err.insertedIds.length >0){
this.insertedRecords = err.insertedIds;
}
if(err.errorInClaims && err.errorInClaims.length >0){
this.errorInRecords = err.errorInClaims;
}
this.isertBulkClaims(claims);
}
this.handleError("Error inserting direct records: "+JSON.stringify(directclaims), err);
//first call direct index service - when call is done (success or error) call isertBulkClaims method to insert claims in DB
console.log("directclaims");
console.log(directclaims);
if (directclaims.length > 0) {
this.claimService.insertDirectRecords(directclaims, this.properties.claimsAPIURL).subscribe(
data => {
this.insertedRecords = data.insertedIds;
this.errorInRecords = data.errorInClaims;
this.isertBulkClaims(claims);
},
err => {
try {
err = err.json();
} catch (error) {
console.log(error);
}
);
}else{
if (err.insertedIds && err.insertedIds.length > 0) {
this.insertedRecords = err.insertedIds;
}
if (err.errorInClaims && err.errorInClaims.length > 0) {
this.errorInRecords = err.errorInClaims;
}
this.isertBulkClaims(claims);
ClaimInsertComponent.handleError("Error inserting direct records: " + JSON.stringify(directclaims), err);
}
);
} else {
this.isertBulkClaims(claims);
}
}
}
}
private isertBulkClaims(claims: ClaimRecord2Insert[]) {
console.log("claims");
console.log(claims);
this.errors.splice(0, this.errors.length);
this.claimService.insertBulkClaims(claims, this.properties.claimsAPIURL).subscribe(
data => {
this.insertedClaims = data.insertedIds;
this.errorInClaims = data.errorInClaims;
//TODO remove - testing having errors in claims
// this.insertedClaims.pop();
// this.insertedClaims.pop();
// this.errorInClaims.push(claims[1]);
// this.insertedClaims.splice(0,this.insertedClaims.length);
// this.errorInClaims = claims;
//remove till here
private isertBulkClaims(claims){
this.claimService.insertBulkClaims(claims,this.properties.claimsAPIURL).subscribe(
data => {
this.insertedClaims = data.insertedIds;
this.errorInClaims = data.errorInClaims;
this.afterclaimsInsertion();
},
err => {
err=err.json();
if(err.insertedIds && err.insertedIds.length >0){
this.insertedClaims = err.insertedIds;
}
if(err.errorInClaims && err.errorInClaims.length >0){
this.errorInClaims = err.errorInClaims;
}
if(this.projects != null){
localStorage.setItem(this.localStoragePrefix + "projects", JSON.stringify(this.projects));
}
localStorage.setItem(this.localStoragePrefix + "contexts", JSON.stringify(this.contexts));
if(this.results != null){
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.results));
}
if(this.inlineEntity != null){
localStorage.setItem(this.localStoragePrefix + "inlineEntity", JSON.stringify(this.inlineEntity));
}
this.afterclaimsInsertion();
if (claims.length != this.insertedClaims.length) {
let error: ClaimsErrorMessage = new ClaimsErrorMessage();
error.type = "claimServiceFail2Insert";
error.inserted = this.insertedClaims.length;
error.failed = this.errorInClaims.length;
this.createErrorMessagesPerEntity((this.insertedClaims.length == 0));
this.errors.push(error);
}
this.afterclaimsInsertion();
},
err => {
try {
err = err.json();
} catch (e) {
this.handleError("Error inserting bulk claims: "+JSON.stringify(claims), err);
}
let error: ClaimsErrorMessage = new ClaimsErrorMessage();
error.type = "claimServiceFail";
if (err.insertedIds && err.insertedIds.length > 0) {
this.insertedClaims = err.insertedIds;
error.inserted = err.insertedIds.length;
}
if (err.errorInClaims && err.errorInClaims.length > 0) {
this.errorInClaims = err.errorInClaims;
error.failed = err.errorInClaims.length;
} else {
error.failed = claims.length;
}
if (this.results != null) {
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.results));
}
if (this.sources != null) {
localStorage.setItem(this.localStoragePrefix + "sources", JSON.stringify(this.sources));
}
console.log(error);
this.createErrorMessagesPerEntity((this.insertedClaims.length == 0));
this.errors.push(error);
this.afterclaimsInsertion();
ClaimInsertComponent.handleError("Error inserting bulk claims: " + JSON.stringify(claims), err);
}
);
}
createErrorMessagesPerEntity(applyToAll: boolean) {
let errorsInIds: string[] = [];
let savedIds: string[] = [];
if (!applyToAll) {
for (let claim of this.errorInClaims) {
errorsInIds.push(claim.sourceId);
errorsInIds.push(claim.targetId);
}
}
);
}
private validate(){
this.warningMessage = "";
this.errorMessage = "";
if( this.results && this.results.length == 0 && ( this.inlineEntity == null)){
this.warningMessage = "There are no research results selected.";
}else if((!this.contexts|| this.contexts.length==0 )&&(!this.projects|| this.projects.length==0 )&& ( this.inlineEntity == null)){
this.warningMessage = "There are no projects or communities to link.";
// }else if (this.inline && !this.inlineEntity){
// this.errorMessage = "No inline entity";
// console.log(this.inline + " "+ this.inlineEntity);
}else{
return true;
}
return false;
}
private validateDates(){
if(this.projects){
for (var k = 0; k < this.projects.length; k++) {
var project = this.projects[k];
if(this.results){
for (var i = 0; i < this.results.length; i++) {
var result = this.results[i];
if(result.date && result.date != null){
if((project.startDate && result.date < project.startDate) || ( project.endDate && result.date > (project.endDate+5)) ){
this.confirmOpen();
return false;
}
for (let i = 0; i < this.sources.length; i++) {
let entity: ClaimEntity = this.sources[i];
if (errorsInIds.indexOf(entity.id) != -1 || applyToAll) {
let error: Message = new Message();
error.type = "fail2Insert";
entity.errorMessages.push(error);
} else {
savedIds.push(entity.id);
}
}
for (let entity of this.results) {
if (errorsInIds.indexOf(entity.id) != -1 || applyToAll) {
let error: Message = new Message();
error.type = "fail2Insert";
entity.errorMessages.push(error);
} else {
savedIds.push(entity.id);
}
}
if (this.inlineEntity && (errorsInIds.indexOf(this.inlineEntity.id) != -1 || applyToAll)) {
let error: Message = new Message();
error.type = "fail2Insert";
this.inlineEntity.errorMessages.push(error);
}
//remove entities that have been saved
for (let id of savedIds) {
//remove sources
let sourceIndex = -1;
for (let i = 0; i < this.sources.length; i++) {
if (this.sources[i].id == id) {
sourceIndex = i;
break;
}
}
if (sourceIndex != -1) {
this.sources.splice(sourceIndex, 1);
} else {
//remove results
let resutsIndex = -1;
for (let i = 0; i < this.results.length; i++) {
if (this.results[i].id == id) {
resutsIndex = i;
break;
}
}
}
}
}
if(this.results){
for (var i = 0; i < this.results.length; i++) {
var result = this.results[i];
if(result.date && result.date != null){
if((result.embargoEndDate && result.embargoEndDate != null) && result.date >result.embargoEndDate ){
this.confirmOpen();
return false;
if (resutsIndex != -1) {
this.results.splice(resutsIndex, 1);
}
}
}
this.insertFinished.emit();
}
return true;
}
private afterclaimsInsertion(){
private afterclaimsInsertion() {
this.loading.close();
this.claiming = false;
if(this.errorInClaims.length == 0 && this.insertedClaims.length > 0 && this.errorInRecords.length == 0){
localStorage.removeItem(this.localStoragePrefix + "projects");
localStorage.removeItem(this.localStoragePrefix + "contexts");
if (this.errorInClaims.length == 0 && this.insertedClaims.length > 0) {
localStorage.removeItem(this.localStoragePrefix + "sources");
localStorage.removeItem(this.localStoragePrefix + "results");
this._router.navigate( ['/myclaims'],{ queryParams: this.params } );
this.showChange.emit({
value: this.show
});
}else{
this.errorsInClaimsInsertion();
this._router.navigate(['/myclaims'], {queryParams: this.params});
}
}
private errorsInClaimsInsertion(){
this.errorMessage = "";
this.loading.close();
this.error = true;
this.claiming = false;
this.showButton = false;
var text =""
//console.log("Errors: this.errorInRecords.length: "+this.errorInRecords.length+" - this.errorInClaims.length: "+this.errorInClaims.length);
if(this.errorInRecords.length>0){
text+="<div>The following results couldn't automatically inserted to the Openaire Info space: <ul>";
for(var i=0; i< this.errorInRecords.length ; i++){
for(var k=0; k< this.results.length ; k++){
if(this.results[k].id == this.errorInRecords[i]){
text+="<li>Title: \""+this.results[i].title+"\" ("+this.results[i].source+")</li>";
}
private static createContextClaim(resultEntity: ClaimEntity, contextEntity: ClaimEntity, user: any): ClaimRecord2Insert {
return {
claimedBy: user,
sourceId: contextEntity.context.concept.id,
sourceType: "context",
sourceCollectedFrom: "openaire",
sourceAccessRights: "OPEN",
sourceEmbargoEndDate: "",
targetId: resultEntity.id,
targetType: resultEntity.type,
targetCollectedFrom: resultEntity.result.source,
targetAccessRights: resultEntity.result.accessRights,
targetEmbargoEndDate: ClaimInsertComponent.getEmbargoEndDate(resultEntity)
};
}
private static createProjectClaim(resultEntity: ClaimEntity, projectEntity: ClaimEntity, user: any): ClaimRecord2Insert {
return {
claimedBy: user,
sourceId: projectEntity.id,
sourceType: "project",
sourceCollectedFrom: "openaire",
sourceAccessRights: "OPEN",
sourceEmbargoEndDate: "",
targetId: resultEntity.id,
targetType: resultEntity.type,
targetCollectedFrom: resultEntity.result.source,
targetAccessRights: resultEntity.result.accessRights,
targetEmbargoEndDate: ClaimInsertComponent.getEmbargoEndDate(resultEntity)
};
}
private static createResultClaim(inlineResult: ClaimEntity, resultEntity: ClaimEntity, user: string): ClaimRecord2Insert {
return {
claimedBy: user,
sourceId: resultEntity.id,
sourceType: resultEntity.type,
sourceCollectedFrom: resultEntity.result.source,
sourceAccessRights: resultEntity.result.accessRights,
sourceEmbargoEndDate: ClaimInsertComponent.getEmbargoEndDate(resultEntity),
targetId: inlineResult.id,
targetType: inlineResult.type,
targetCollectedFrom: inlineResult.result.source,
targetAccessRights: inlineResult.result.accessRights,
targetEmbargoEndDate: ClaimInsertComponent.getEmbargoEndDate(inlineResult)
};
}
static getEmbargoEndDate(resultEntity: ClaimEntity): string {
if (resultEntity.result && resultEntity.result.accessRights == "EMBARGO" && resultEntity.result.embargoEndDate != null) {
return resultEntity.result.embargoEndDate;
}
return ""
}
static createDirectClaim(resultEntity: ClaimEntity, results: ClaimEntity[]) {
let entity = {};
const md5_id = Md5.hashStr(resultEntity.id);
entity["originalId"] = "userclaim___::" + md5_id;
entity["openaireId"] = "userclaim___::" + md5_id;
entity["title"] = resultEntity.title;
entity["title"] = (Array.isArray(resultEntity.title) && resultEntity.title.length > 0) ? resultEntity.title[0] : resultEntity.title;
if (resultEntity.result.authors && resultEntity.result.authors.length > 0) {
entity["authors"] = resultEntity.result.authors;
}
if (resultEntity.result.publisher) {
entity["publisher"] = resultEntity.result.publisher;
}
if (resultEntity.result.description) {
entity["description"] = resultEntity.result.description;
}
// entity["language"]=""; no info
entity["type"] = resultEntity.type;
if (resultEntity.result.source == "crossref" || resultEntity.result.source == "datacite") {
entity["pids"] = [];//{type:string, value:string}[];
entity["pids"].push({type: "doi", value: resultEntity.id})
}
entity["licenseCode"] = resultEntity.result.accessRights;
if (resultEntity.result.accessRights == "EMBARGO") {
entity["embargoEndDate"] = resultEntity.result.embargoEndDate;
}
if (resultEntity.type == "publication") {
entity["resourceType"] = "0001";
} else if (resultEntity.type == "dataset") {
entity["resourceType"] = "0021";
} else if (resultEntity.type == "software") {
entity["resourceType"] = "0029";
} else if (resultEntity.type == "other") {
entity["resourceType"] = "0020";
}
entity["url"] = resultEntity.result.url;
entity["hostedById"] = "openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18";
if (resultEntity.result.source == "crossref") {
entity["collectedFromId"] = "openaire____::crossref";
} else if (resultEntity.result.source == "datacite") {
entity["collectedFromId"] = "openaire____::datacite";
} else if (resultEntity.result.source == "orcid") {
entity["collectedFromId"] = "openaire____::orcid";
} else if (resultEntity.result.source == "orpenaire") {
entity["collectedFromId"] = "openaire____::driver";
}
for (let i = 0; i < results.length; i++) {
if (results[i].project) {
if (!entity["linksToProjects"]) {
entity["linksToProjects"] = [];
}
let project: ClaimEntity = results[i];
entity["linksToProjects"].push("info:eu-repo/grantAgreement/" + project.project.funderName + "/" + project.project.fundingLevel0 + "/" + project.project.code + "/" + project.project.jurisdiction + "/" + project.title + "/" + project.project.acronym);
} else if (results[i].context) {
if (!entity["contexts"]) {
entity["contexts"] = [];
}
let context: ClaimEntity = results[i];
entity["contexts"].push(context.context.concept.id);
}
}
text+="</ul></div>";
}
if(this.errorInClaims.length > 0){
text+="<div>The following links couldn't be saved: <ul>";
for(var i=0; i< this.errorInClaims.length ; i++){
// 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 == null?"":result.embargoEndDate)};
text+="<li>"+this.errorInClaims[i].sourceType+": "+this.errorInClaims[i].sourceId +" ("+this.errorInClaims[i].sourceCollectedFrom+") link to "+this.errorInClaims[i].targetType+": "+this.errorInClaims[i].targetId +" ("+this.errorInClaims[i].targetCollectedFrom+") </li>";
}
text+="</ul></div>";
}
this.errorMessage+="<div>An error occured:</div>"+text;
//console.log(text);
// if(this.inline){
// this.show = "error";
// this.showChange.emit({
// value: this.show
// });
// }
}
// var json = JSON.stringify(entity);
//console.log("\nJSON:\n"+json);
return entity;
private createClaim(inlineResult:any, result:any, user:any){
}
private createContextClaim(result:any, context:any, user:any){
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 == null?"":result.embargoEndDate)};
return claim;
}
private createProjectClaim(result:any, project:any, user:any){
//project.projectId
// var dummyID = "dummyID";
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 == null?"":result.embargoEndDate)};
return claim;
}
private createResultClaim(inlineResult:any, result:any, user:any){
var claim = { claimedBy : user, sourceId : result.id, sourceType : result.type, sourceCollectedFrom: result.source, sourceAccessRights: result.accessRights, sourceEmbargoEndDate: (result.embargoEndDate == null?"":result.embargoEndDate), targetId : inlineResult.id , targetType : inlineResult.type, targetCollectedFrom: inlineResult.source, targetAccessRights: inlineResult.accessRights, targetEmbargoEndDate: (inlineResult.embargoEndDate == null?"":inlineResult.embargoEndDate)};
return claim;
}
createDirectClaim(result, projects, contexts){
var entity = {};
var md5_id = Md5.hashStr(result.id);
entity["originalId"]="userclaim___::"+md5_id;
entity["openaireId"]="userclaim___::"+md5_id;
entity["title"]=result.title;
entity["title"] =(Array.isArray(result.title) && result.title.length > 0 )?result.title[0]:result.title;
if(result.authors && result.authors.length > 0){
entity["authors"]=result.authors;
}
if(result.publisher){
entity["publisher"]=result.publisher;
}
if(result.description){
entity["description"]=result.description;
}
// entity["language"]=""; no info
entity["type"]=result.type;
if(result.source == "crossref" || result.source == "datacite"){
entity["pids"]= [];//{type:string, value:string}[];
entity["pids"].push({type:"doi",value:result.id})
}
entity["licenseCode"]=result.accessRights;
if(result.accessRights == "EMBARGO"){
entity["embargoEndDate"]=result.embargoEndDate;
}
if(result.type =="publication"){
entity["resourceType"]="0001";
}else if(result.type =="dataset"){
entity["resourceType"]="0021";
}else if(result.type =="software"){
entity["resourceType"]="0029";
}else if(result.type =="other"){
entity["resourceType"]="0020";
}
entity["url"]=result.url;
entity["hostedById"]="openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18";
if(result.source == "crossref"){
entity["collectedFromId"]="openaire____::crossref";
}else if(result.source == "datacite"){
entity["collectedFromId"]="openaire____::datacite";
}else if(result.source == "orcid"){
entity["collectedFromId"]="openaire____::orcid";
}else if(result.source == "orpenaire"){
entity["collectedFromId"]="openaire____::driver";
}
if(projects.length>0){
entity["linksToProjects"]=[];
for(var i =0; i < projects.length; i++){
// "info:eu-repo/grantAgreement/EC/FP7/283595/EU//OpenAIREplus",
entity["linksToProjects"].push("info:eu-repo/grantAgreement/"+projects[i].funderName+"/"+projects[i].fundingLevel0+"/"+projects[i].code+"/"+projects[i].jurisdiction+"/"+projects[i].projectName+"/"+projects[i].projectAcronym);
}
}
if(contexts.length > 0){
entity["contexts"]=[];
for(var i =0; i < contexts.length; i++){
entity["contexts"].push(contexts[i].concept.id);
}
}
var json = JSON.stringify(entity);
//console.log("\nJSON:\n"+json);
return entity;
}
confirmOpen(){
confirmOpen() {
this.alert.cancelButton = true;
this.alert.okButton = true;
this.alert.alertTitle = "Invalid dates";
this.alert.message = "There is a research result whose publication date is after project end date or before project start date. Or embargo end date of a research result is before research result's publication date.";
this.alert.okButtonText = "Proceed anyway";
this.alert.cancelButtonText = "Cancel";
this.alert.alertTitle = "";//"Final Confirmation notice";
this.alert.okButtonLeft = false;
// this.alert.message = "<div>All the links you provided will be published in the OpenAIRE platform. " +
// "<br>Make sure you have checked all the information you provided. In some cases some links take more time to be published. " +
// "<br>For more information please check the linking status in My-Links page. " +
// "<br><br>Do you confirm the information you provide are valid?</div>";
this.alert.okButtonText = "CONFIRM";
this.alert.cancelButtonText = "CANCEL";
this.alert.open();
}
confirmClose(data){
confirmClose() {
this.insertActions();
}
private handleError(message: string, error) {
console.error("Insert Claim (component): "+message, error);
private static handleError(message: string, error) {
console.error("Insert Claim (component): " + message, error);
}
}

View File

@ -1,203 +1,306 @@
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
<div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<schema2jsonld *ngIf="url" [URL]="url" name="Link your research results" type="other"></schema2jsonld>
<metadata-preview *ngIf="showOptions.show=='claim' && properties" class="uk-margin-top"
[results]="results" [sources]="sources"
[localStoragePrefix]="localStoragePrefix" [inlineEntity]="inlineEntity"
[showOptions]="showOptions" [properties]=properties>
</metadata-preview>
<div id="tm-main" class="uk-section uk-padding-remove-top tm-middle" *ngIf="showOptions.show != 'claim'">
<div class="uk-grid">
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<schema2jsonld *ngIf="url" [URL]="url" name="Link your research results" type="other"></schema2jsonld>
<div [class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '">
<div>
<!-- <div class="uk-width-1-1">
<helper position="top"></helper>
</div> -->
<div class="uk-grid helper-grid">
<helper position="left" styleName=" uk-width-1-5 uk-padding-left"></helper>
<div class="uk-width-expand">
<div class="uk-container uk-margin-top">
<div class="uk-article-title custom-article-title">
Link your research results
</div>
<!--div *ngIf="step==0">
<div class="uk-child-width-1-3@m uk-grid-small uk-grid-match uk-margin-top" uk-grid>
<div>
<div class="uk-card uk-card-default uk-card-body">
<h3 style="color: #4687E6 !important" class="uk-card-title uk-text-center">1 Select communities and projects</h3>
<p>Select a community or search for community concepts to link</p>
<p>Search for OpenAIRE projects to link</p>
</div>
</div>
<div>
<div class="uk-card uk-card-default uk-card-body">
<h3 style="color: #4687E6 !important" class="uk-card-title uk-text-center">2 Select research results</h3>
<p>
Search for publications, research data & software
</p>
<div>Search in
<ul>
<li>Openaire</li>
<li>Crossref</li>
<li>Datacite</li>
<li>Orcid</li>
</ul>
</div>
</div>
</div>
<div>
<div class="uk-card uk-card-default uk-card-body">
<h3 style="color: #4687E6 !important" class="uk-card-title uk-text-center">3 Review metadata</h3>
<p>Confirm your selections</p>
<p>Review results metadata if needed</p>
</div>
</div>
</div>
<ul class=" uk-pagination uk-flex-center uk-margin-auto uk-float-right">
<div *ngIf="properties" class="uk-section uk-section-default uk-padding-remove-top">
<li (click)="step=1;" >
<a>Start <span uk-pagination-next></span></a>
</li>
<div style=""
[class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '">
<div class="uk-grid" *ngIf="showOptions.show!='claim'">
<div class="uk-width-2-3">
<div class="uk-h5">
<span *ngIf="showOptions.show!='source' && showOptions.show != 'claim'">
<span>LINK TO </span>
<select [(ngModel)]="showOptions.show" class="uk-select uk-width-auto uk-text-bold "
*ngIf="showOptions.linkToEntities.length > 1">
<option *ngIf="showOptions.linkToEntities.indexOf('project')!=-1 "
value="project">PROJECTS</option>
<option *ngIf="showOptions.linkToEntities.indexOf('result')!=-1 " value="result">RESEARCH
RESULTS</option>
<option *ngIf="showOptions.linkToEntities.indexOf('context')!=-1 " value="context">COMMUNITIES
</option>
</select>
<span class=" uk-width-auto uk-text-bold "
*ngIf="showOptions.linkToEntities.length ==1">
<span *ngIf="showOptions.linkToEntities.indexOf('project')!=-1 "
value="project">PROJECTS</span>
<span *ngIf="showOptions.linkToEntities.indexOf('result')!=-1 " value="result">RESEARCH
RESULTS</span>
<span *ngIf="showOptions.linkToEntities.indexOf('context')!=-1 " value="context">COMMUNITIES
</span>
</span>
</span>
<span *ngIf="showOptions.show=='source'" class="uk-text-bold">
ADD LINKING SOURCES
</span>
</ul>
</div-->
<div >
<div class="uk-width-1-1">
<helper position="top"></helper>
</div>
<div class="uk-grid helper-grid">
</div>
<div *ngIf="showOptions.show=='source'">
<claim-result-search-form [selectedResults]="sources" [properties]=properties
[localStoragePrefix]="localStoragePrefix+'sources'"></claim-result-search-form>
</div>
<div *ngIf="showOptions.show=='project'">
<claim-projects-search-form [selectedProjects]="results" [properties]=properties
[localStoragePrefix]="localStoragePrefix+'results'"></claim-projects-search-form>
</div>
<div *ngIf="showOptions.show=='context'">
<claim-contexts-search-form [communityId]=communityId [results]="results" [sources]="sources"
[properties]=properties
[localStoragePrefix]="localStoragePrefix+'results'"></claim-contexts-search-form>
</div>
<div *ngIf="showOptions.show=='result'">
<claim-result-search-form [selectedResults]="results" [properties]=properties
[localStoragePrefix]="localStoragePrefix+'results'"></claim-result-search-form>
</div>
<helper position="left" styleName=" uk-width-1-5 uk-padding-left"></helper>
<div class="uk-width-expand">
<ul uk-accordion class="uk-padding-small uk-margin-remove-bottom basket-accordion">
<li>
<h3 class=" uk-text-right uk-margin-remove-vertical uk-width-small uk-margin-auto-left uk-accordion-title basket-title uk-text-danger" uk-tooltip="title:Click to see your selections">
</div>
<!-- Basket-->
<div *ngIf="showOptions.show != 'claim'" class="uk-width-1-3" style="">
<div class="linksbasketheader uk-margin-bottom uk-text-bold uk-h5">
LINKS BASKET
</div>
<div class="linksbasket uk-inline uk-width-1-1" style="">
<div *ngIf="inlineEntity == null">
<div class="linksbaskettitles uk-padding-small uk-animation-toggle" (click)="showOptions.showBasketSources()">
<div class="uk-h6 uk-margin-remove portal-color" >
SOURCES ({{(sources.length) | number}})
<span *ngIf="showOptions.show!='source' && !showOptions.basketShowSources"
class="uk-icon"><svg width="20"
height="20"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-left"
ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="13 16 7 10 13 4"></polyline></svg></span>
<span *ngIf="showOptions.show!='source' && showOptions.basketShowSources"
class="uk-icon"><svg width="20"
height="20"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-down"
ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="16 7 10 13 4 7"></polyline></svg></span>
</div>
Research results to link
</div>
<span class="uk-icon"><svg xml:space="preserve" xmlns:xlink="http://www.w3.org/1999/xlink" height="28px" id="my-box" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="28px" x="0px" xmlns="http://www.w3.org/2000/svg" y="0px"><g> <path d="M480,320v128H32V320h78.859l64.016,96h162.25l64-96H480 M384,32H128L0,288v192h512V288L384,32L384,32z M35.781,288l112-224 h216.438l112,224H384l-64,96H192l-64.016-96H35.781L35.781,288z" fill="#b5b5b5"></path></g> </svg> </span>
<span class="uk-badge basket-badge ">{{(projects.length + contexts.length + results.length) | number}}</span>
</h3>
<div class="uk-accordion-content uk-background-muted uk-margin-remove-top uk-margin-left uk-margin-right dropbasket uk-padding-small uk-margin uk-grid-match uk-child-width-1-1 uk-child-width-1-1@m uk-grid uk-grid-stack">
<start-over [results]="results" [contexts]="contexts" [projects]="projects" [localStoragePrefix]=localStoragePrefix ></start-over>
<claim-selected-projects title="link Projects" [projects]="projects" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" [localStoragePrefix]=localStoragePrefix > </claim-selected-projects>
<div *ngIf="showOptions.basketShowSources"
class=" uk-margin-remove-top uk-height-medium uk-overflow-auto ">
<div class="uk-background-muted uk-padding-small " style="min-height: 17px;">
<div *ngIf="showOptions.show != 'source'" class="uk-text-center">
<a (click)="showOptions.showSource()">
<!--span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="1"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg></span-->
Edit sources</a>
</div>
<start-over *ngIf="showOptions.show == 'source' && (sources.length)> 0"
[results]="sources"
[localStoragePrefix]="localStoragePrefix+'sources'"
message="all sources" class="uk-float-right"></start-over>
<bulk-claim *ngIf="showOptions.show == 'source'" [results]="sources"
[properties]=properties
[localStoragePrefix]="localStoragePrefix+'sources'"
>
</bulk-claim>
<claim-selected-contexts title="link Communities" [contexts]="contexts" [projects]="projects" [results]="results" [inlineEntity] = "inlineResult" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" [localStoragePrefix]=localStoragePrefix> </claim-selected-contexts>
<claim-selected-results *ngIf="step!=3" title= "Selected Research Results" [results]="results" [bulkMode]="bulkMode" showSearch=false showAccessRights=false [localStoragePrefix]=localStoragePrefix>
</claim-selected-results>
</div>
</li>
</ul>
<!--start-over [results]="results" [contexts]="contexts" [projects]="projects" ></start-over-->
<!-- add here pagination to be visible when results list is long -->
</div>
<div class="uk-animation-slide-top-small uk-padding-small">
<ul class="uk-subnav uk-margin-remove-bottom uk-subnav-pill linkingSteps" uk-margin="">
<li [class]="(step==1)?'uk-active':' '" ><a (click)="step=1;"> 1 Select Projects <span >or Communities </span></a></li>
<li [class]="(step==2)?'uk-active':' '" ><a (click)="step=2;">2 Select Research Results </a></li>
<li [class]="(step==3)?'uk-active':' '" (click)="step=3;"><a [class]="(results.length == 0)?'uk-disabled':''" (click)="show='claim';" >3 Review metadata</a></li>
</ul>
<ul class=" uk-pagination uk-flex-center uk-margin-auto uk-text-center">
<li *ngIf="step !=1 " (click)="step=step-1;" ><a><span class=" " uk-pagination-previous></span> Previous</a></li>
<li *ngIf="step !=3 " (click)="step=step + 1;" >
<a>Next <span uk-pagination-next></span></a>
</li>
<!--li *ngIf=" step == 3 " (click)="next()" >
<claim-insert [contexts]="contexts" [results]="results" [projects]="projects" [show] = "show"
(showChange)="showChange($event)" [(properties)] = properties></claim-insert>
<div *ngIf="(sources.length) == 0 " class="uk-alert no-selected-message uk-text-center">
No Sources added yet. Start adding sources from the left panel. Or upload a DOI's CSV file.
</div>
<claim-selected-results [results]="sources"
[localStoragePrefix]="localStoragePrefix+'sources'" class=""
[enableRemove]="showOptions.show == 'source'">
</claim-selected-results>
<div id="test1"></div>
</div>
</div>
</div>
<div *ngIf="inlineEntity"
class="linkInlineEntity uk-padding-small">
<div class="uk-h6 linkInlineEntity uk-margin-small-bottom ">
SOURCE
</li-->
</ul>
<div class="uk-section uk-section-default uk-padding-remove-top">
<div style="border: 1px solid #eee;" class="uk-container uk-margin-top">
</div>
<claim-title [entity]="inlineEntity" [slice]="true" [sliceSize]="45"
[shortVersion]="true"></claim-title>
<div class="uk-margin-small-top">
<span class="uk-label custom-label linkInlineEntityLabel"
title="Type">{{inlineEntity.type}}</span>
<span *ngIf="inlineEntity.project">
<span class="uk-label custom-label linkInlineEntityLabel"
title="Funder">{{inlineEntity.project.funderName}}</span>
<!-- <span class="uk-label custom-label " title="Type">{{inlineEntity.type}}</span>-->
</span>
<span *ngIf="inlineEntity.result">
<span class="uk-label custom-label linkInlineEntityLabel "
title="Access mode">{{inlineEntity.result.accessRights}}</span>
</span>
</div>
<!--ul uk-accordion class="uk-background-muted uk-padding-small uk-margin-remove-bottom basket-accordion">
<li>
<h3 class=" uk-text-right uk-margin-remove-vertical uk-width-small uk-margin-auto-left uk-accordion-title basket-title uk-text-danger">
<span class="uk-icon"><svg xml:space="preserve" xmlns:xlink="http://www.w3.org/1999/xlink" height="28px" id="my-box" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="28px" x="0px" xmlns="http://www.w3.org/2000/svg" y="0px"><g> <path d="M480,320v128H32V320h78.859l64.016,96h162.25l64-96H480 M384,32H128L0,288v192h512V288L384,32L384,32z M35.781,288l112-224 h216.438l112,224H384l-64,96H192l-64.016-96H35.781L35.781,288z" fill="#b5b5b5"></path></g> </svg> </span>
<span *ngIf="(projects.length + contexts.length + results.length)> 0" class="uk-badge basket-badge ">{{(projects.length + contexts.length + results.length) | number}}</span>
</h3>
<div class="uk-accordion-content dropbasket uk-padding-small uk-margin uk-grid-match uk-child-width-1-1 uk-child-width-1-1@m uk-grid uk-grid-stack">
<claim-selected-projects title="link Projects" [projects]="projects" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" > </claim-selected-projects>
<claim-selected-contexts title="link Communities" [contexts]="contexts" [projects]="projects" [results]="results" [inlineEntity] = "inlineResult" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" > </claim-selected-contexts>
<claim-selected-results *ngIf="step!=3" title= "Selected Research Results" [results]="results" [bulkMode]="bulkMode" showSearch=false showAccessRights=false>
</claim-selected-results>
</div>
</li>
</ul-->
<div *ngIf="step==1">
<ul class=" uk-tab uk-margin-remove-bottom" uk-tab="connect: #tabs; animation: uk-animation-fade">
<li>
<a>Projects ({{projects.length | number}})</a>
</li>
<li>
<a>Communities ({{contexts.length | number}})</a>
</li>
</ul>
<ul id="tabs" class="uk-switcher uk-width-1-1">
<li>
<claim-projects-search-form [(selectedProjects)]="projects" [(properties)] = properties [localStoragePrefix]=localStoragePrefix> </claim-projects-search-form>
</li>
<li>
<claim-contexts-search-form [communityId]=communityId [(selectedList)]="contexts" [projects]="projects" [results]="results" [inlineEntity]="inlineResult" [(properties)]=properties [localStoragePrefix]=localStoragePrefix> </claim-contexts-search-form>
</li>
</ul>
</div>
</div>
<div *ngIf="showOptions.show !='source'">
<div class=" linksbaskettitles uk-padding-small uk-animation-toggle" (click)="showOptions.basketShowLinksTo=!showOptions.basketShowLinksTo;
showOptions.basketShowSources=!showOptions.basketShowLinksTo ">
<div *ngIf="!inlineEntity"> <!--Enable toggle -->
<span class="uk-h6 uk-margin-remove portal-color" >
LINK TO ({{(results.length) | number}})
<span *ngIf="!showOptions.basketShowLinksTo" class="uk-icon"><svg width="20"
height="20"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-left"
ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03"
points="13 16 7 10 13 4"></polyline></svg></span>
<span *ngIf="showOptions.basketShowLinksTo" class="uk-icon"><svg width="20"
height="20"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-down"
ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03"
points="16 7 10 13 4 7"></polyline></svg></span>
</span>
</div>
<div *ngIf="inlineEntity"> <!--Inline Entity - no toggle -->
<span class="uk-h6 uk-margin-remove portal-color">
LINK TO ({{(results.length) | number}})
</span>
</div>
<div *ngIf="step==2 ">
<div class="linksBasketSubtitles">
Entities to link with the sources
</div>
</div>
<div *ngIf="showOptions.basketShowLinksTo"
class="uk-height-medium uk-overflow-auto">
<div *ngIf=" (results.length)> 0 || showOptions.show=='result'"
class="uk-background-muted uk-padding-small " style="min-height: 17px;">
<start-over *ngIf=" (results.length)> 0"
[results]="results" [localStoragePrefix]="localStoragePrefix+'results'"
message="all results (projects, communities, research results)"
class="uk-float-right"></start-over>
<bulk-claim *ngIf="showOptions.show=='result'" [results]="results" [properties]=properties
[localStoragePrefix]="localStoragePrefix+'results'"></bulk-claim>
</div>
<div class="uk-padding-small uk-animation-slide-top-small">
<claim-selected-results title="Selected Results" [results]="results"
[localStoragePrefix]="localStoragePrefix+'results'">
</claim-selected-results>
<div *ngIf="(results.length) == 0 " class="uk-alert no-selected-message uk-text-center">
No entities to link with the sources. Start adding entities from the left panel.
</div>
</div>
</div>
</div>
<div class="uk-width-1-1 uk-card uk-card-default uk-padding ">
<div class=" uk-padding-small uk-padding-remove-bottom ">
<!--span *ngIf="bulkMode" class=" uk-animation uk-float-right">
<span title= "Bulk mode"> Upload DOIs in bulk mode <i class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="upload" ratio="1"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg></i></span>
<a title= "Switch to Search mode" (click)="bulkMode = !bulkMode;"> Search online for research results <span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="search" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg>
</span></a>
</span>
<span *ngIf="!bulkMode" class=" uk-animation uk-float-right">
<a title= "Upload DOIs in bulk mode" (click)="bulkMode = !bulkMode;">Upload DOIs in bulk mode <i class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="upload" ratio="1"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg></i></a>
<span title= "Search mode"> Search online for research results <span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="search" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg>
</span></span>
</span-->
</div>
<div *ngIf="showOptions.show=='source'"
[class]="((sources.length)>0?'linksbaskettitlesPortalColor ':'uk-disabled')+ ' linksbaskettitles uk-padding-small'"
(click)="openSelectionModal(); ">
<!--show = linkTo; basketShowSources=false;
basketShowLinksTo=true;-->
<div class="uk-h6 uk-margin-remove portal-color">CONTINUE TO - LINK TO <span
*ngIf="results.length > 0">({{(results.length) | number}})</span>
<span class="uk-icon uk-float-right uk-text-bold uk-margin-small-right">
<svg width="30" height="30" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="chevron-right" ratio="1.5"><polyline fill="none" stroke="#000" stroke-width="1.03"
points="7 4 13 10 7 16"></polyline></svg>
</span>
</div>
<div class="linksBasketSubtitles">
Entities to link with the sources
</div>
</div>
<div *ngIf="showOptions.show!='source'"
[class]="((results.length)>0?'linksbaskettitlesPortalColor ':'uk-disabled')+ ' linksbaskettitles uk-margin-small-top uk-padding-small'"
style="height:auto !important; " (click)="showOptions.show = 'claim'; scrollUp();">
<div class="uk-margin-remove portal-color uk-text-center">
FINISH LINKING
<span class="uk-icon uk-float-right uk-text-bold uk-margin-small-right">
<svg width="30" height="30" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="chevron-right" ratio="1.5"><polyline fill="none" stroke="#000" stroke-width="1.03"
points="7 4 13 10 7 16"></polyline></svg>
</span>
</div>
</div>
</div>
</div>
</div>
<helper position="right" styleName=" uk-width-1-5"></helper>
</div>
<claim-result-search-form [selectedResults]="results" [(properties)]=properties [localStoragePrefix]=localStoragePrefix> </claim-result-search-form>
<div class="uk-text-lead">Or </div>
<helper position="bottom"></helper>
</div>
<bulk-claim [results]="results" [(properties)] = properties [localStoragePrefix]=localStoragePrefix> </bulk-claim>
</div>
</div>
<div *ngIf="step==3" class="uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l">
<div class=" uk-grid uk-margin-small-top">
<div class="uk-width-expand uk-margin-left">
<claim-selected-results title= "Selected Research Results" [results]="results" [bulkMode]="bulkMode" showSearch = false showAccessRights = true [localStoragePrefix]=localStoragePrefix>
</claim-selected-results>
</div>
<helper div="link-metadata" styleName="uk-width-medium"></helper>
</div>
</div>
</div>
</div>
<ul class=" uk-pagination uk-flex-center uk-margin-auto uk-text-center">
<li *ngIf="step !=1 " (click)="step=step-1;" ><a><span class="uk-margin-small-right" uk-pagination-previous></span> Previous</a></li>
<li *ngIf="step !=3 " (click)="step=step + 1;" >
<a>Next <span uk-pagination-next></span></a>
</li>
<li *ngIf=" step == 3 " (click)="next()" >
<!--claim-insert [contexts]="contexts" [results]="results" [projects]="projects" [show] = "show"
(showChange)="showChange($event)" [(properties)] = properties></claim-insert-->
</li>
</ul>
<claim-insert *ngIf=" step == 3 " [contexts]="contexts" [results]="results" [projects]="projects" [show] = "show"
(showChange)="showChange($event)" [(properties)] = properties [localStoragePrefix]=localStoragePrefix></claim-insert>
</div>
<helper position="right" styleName=" uk-width-1-5"></helper>
</div>
<helper position="bottom"></helper>
</div>
</div>
</div>
</div>
</div>
<modal-alert (alertOutput)="closeSelectionModal($event)" (click)="closeSelectionModal()">
<div class="uk-grid uk-text-center uk-margin-expand uk-padding uk-child-width-1-3">
<div *ngIf="showOptions.linkToEntities.indexOf('project')!=-1 " (click)="closeSelectionModal('project')"
style="cursor:pointer;">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="album" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect height="1" width="10" x="5" y="2"></rect><rect
height="1" width="14" x="3" y="4"></rect><rect fill="none" height="11" stroke="#000"
width="17" x="1.5" y="6.5"></rect></svg></span>
</button>
<div>Projects</div>
</div>
<div *ngIf="showOptions.linkToEntities.indexOf('result')!=-1 " (click)="closeSelectionModal('result')"
style="cursor:pointer;">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="copy" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect fill="none" height="16" stroke="#000"
width="12" x="3.5" y="2.5"></rect><polyline
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
</button>
<div>Research results</div>
</div>
<div *ngIf="showOptions.linkToEntities.indexOf('context')!=-1 " (click)="closeSelectionModal('context')"
style="cursor:pointer;">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="users" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><circle cx="7.7" cy="8.6" fill="none" r="3.5"
stroke="#000" stroke-width="1.1"></circle><path
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3" fill="none"
stroke="#000" stroke-width="1.1"></path><path
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"
fill="none" stroke="#000" stroke-width="1.1"></path></svg></span>
</button>
<div>Communities</div>
</div>
</div>
</modal-alert>

View File

@ -1,16 +1,14 @@
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import {Observable} from 'rxjs';
import {EnvProperties} from '../../utils/properties/env-properties';
import {ClaimProject, ClaimResult} from '../claim-utils/claimEntities.class';
import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySearch.service';
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import {Component, Input, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../../utils/properties/env-properties';
import {ClaimEntity, ShowOptions} from '../claim-utils/claimHelper.class';
import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySearch.service';
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {AlertModal} from "../../utils/modal/alert";
import {HelperFunctions} from "../../utils/HelperFunctions.class";
declare var UIkit:any;
@ -20,43 +18,45 @@ declare var UIkit:any;
})
export class LinkingGenericComponent {
@Input() bulkMode: boolean = false;
@Input() communityId:string= null;
sourceType:string;
targetType:string;
step:number = 1;
contexts=[];
projects=[];
results = [];
show = "project";
date='8-6-2016';
keyword: string = "";
linkType:string ="project"; // link type (selected in home page) : project, context, software, etc
/* url Parameters for inline linking */
id:string = null; //entity id
type:string = null; // entity type (publication or research data)
linkTo:string = null; // entity type (project or context or result)
@Input() results:ClaimEntity[] = [];
@Input() inlineEntity:ClaimEntity = null;
entityTypes=["dataset", "publication", "project","context"];
inlineResult:ClaimResult =null;
@Input() showOptions:ShowOptions = new ShowOptions();
//show values: source, result, project, context, claim
// linkTo /values: result, project, context
// show linkToEntities /values: result, project, context
@Input() sources:ClaimEntity[] =[];
sub:any =null;
properties:EnvProperties;
localStoragePrefix:string = "linking_";
@Input() localStoragePrefix:string = "linking_";
url=null;
@ViewChild(AlertModal) alert;
constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService,
private _meta: Meta, private _title: Title,
private seoService: SEOService ) {
var title = "OpenAIRE | Linking";
let title = "OpenAIRE | Linking";
this._meta.updateTag({content:title},"property='og:title'");
this._title.setTitle(title);
}
ngOnInit() {
this.showOptions.show = 'source';
if(this.inlineEntity){
this.showOptions.basketShowSources = false;
this.showOptions.basketShowLinksTo = true;
this.showOptions.show = this.showOptions.linkTo;
}
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
@ -65,75 +65,41 @@ export class LinkingGenericComponent {
});
if( typeof localStorage !== 'undefined') {
if(localStorage.getItem(this.localStoragePrefix + "projects")){
this.projects = JSON.parse(localStorage.getItem(this.localStoragePrefix + "projects"));
}
if(localStorage.getItem(this.localStoragePrefix + "contexts")){
this.contexts = JSON.parse(localStorage.getItem(this.localStoragePrefix + "contexts"));
}
this.localStoragePrefix +=(this.communityId?this.communityId+"_":"");
if(localStorage.getItem(this.localStoragePrefix + "results")){
this.results = JSON.parse(localStorage.getItem(this.localStoragePrefix + "results"));
}
if(localStorage.getItem(this.localStoragePrefix + "sources")){
this.sources = JSON.parse(localStorage.getItem(this.localStoragePrefix + "sources"));
}
}
}
next(){
openSelectionModal() {
this.alert.cancelButton = false;
this.alert.okButton = false;
this.alert.alertTitle = "Select the type of Entity to Link to your sources";
// this.alert.message = "<div>All the links you provided will be published in the OpenAIRE platform. " +
// "<br>Make sure you have checked all the information you provided. In some cases some links take more time to be published. " +
// "<br>For more information please check the linking status in My-Links page. " +
// "<br><br>Do you confirm the information you provide are valid?</div>";
if((this.show == 'result' && this.keyword == '')||(this.show == 'dataset' || this.show == 'publication')){
this.show='claim';
this.alert.open();
}
closeSelectionModal(show:string=null) {
if(show){
this.showOptions.show = show;
this.showOptions.basketShowSources=false;
this.showOptions.basketShowLinksTo=true;
}
this.alert.cancel();
this.scrollUp();
}
prev(){
if(this.show == 'claim'){
this.show='result';
}
}
scrollUp(){
HelperFunctions.scroll();
resultsChange($event) {
this.results=$event.value;
}
projectsChange($event) {
this.projects=$event.value;
}
linkTypeChange($event) {
this.linkType =$event.value;
this.show="result";
if(this.bulkMode){
this.show="claim";
}
}
showChange($event) {
this.show=$event.value;
this.showChangedType($event.value);
}
showChangedType(type:string) {
this.show=type;
if(this.show == 'project' || this.show == 'context' || this.show == 'software'){
this.linkType = this.show;
}
}
canProceedToMetadata(){
if(this.results.length == 0){
UIkit.notification({
message : 'No research results selected!<br>Please select research results to link with projects and/ or ommunities.',
status : 'warning',
timeout : 1000,
pos : 'top-center'
});
}else{
this.show = 'claim';
this.step = 3;
}
}
}

View File

@ -17,14 +17,17 @@ import {HelperModule} from '../../utils/helper/helper.module';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {MetadataPreviewModule} from './selected/metadataPreview.module';
import {ClaimEntitiesMetadataModule} from "./selected/ClaimEntitiesMetadata.module";
import {AlertModalModule} from '../../utils/modal/alertModal.module';
@NgModule({
imports: [
SharedModule, SelectedProjectsModule, SelectedContextsModule,
SharedModule, SelectedProjectsModule, SelectedContextsModule,
SelectedPublicationsModule,
InsertClaimsModule, StartOverModule,
StartOverModule,
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule,
HelperModule, Schema2jsonldModule, SEOServiceModule
HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule
],
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled],
declarations: [

View File

@ -0,0 +1,15 @@
import {NgModule} from '@angular/core';
import {SharedModule} from '../../../shared/shared.module';
import {ClaimEntityTitleComponent} from "./ClaimEntityTitle.component";
import {ClaimEntityResultMetadataComponent} from "./ClaimEntityResultMetadata.component";
import {ClaimEntityProjectMetadataComponent} from "./ClaimEntityProjectMetadata.component";
@NgModule({
imports: [
SharedModule
],
declarations: [
ClaimEntityTitleComponent, ClaimEntityResultMetadataComponent, ClaimEntityProjectMetadataComponent
], exports:[ ClaimEntityTitleComponent, ClaimEntityResultMetadataComponent, ClaimEntityProjectMetadataComponent]
})
export class ClaimEntitiesMetadataModule { }

View File

@ -0,0 +1,71 @@
import {Component, Input} from '@angular/core';
import {ClaimEntity} from '../../claim-utils/claimHelper.class';
import {StringUtils} from "../../../utils/string-utils.class";
@Component({
selector: 'claim-project-metadata',
template:
`
<div *ngIf="entity.type == 'project' && entity.project" class="uk-grid uk-margin-remove-top uk-text-small">
<div class="uk-width-1-2">
<div *ngIf="entity.project.funderName">
<span class="uk-text-muted">Funder </span>{{entity.project.funderName}}
</div>
</div>
<div class="uk-width-1-2">
<div *ngIf="entity.project.code">
<span class="uk-text-muted">GrandId </span>{{entity.project.code}}
</div>
<div *ngIf=" !shortVersion && (entity.project.startDate || entity.project.endDate)">
<span
class="uk-text-muted">Duration </span>{{(entity.project.startDate) ? entity.project.startDate : 'Unknown'}}{{'-' + ((entity.project.endDate) ? entity.project.endDate : 'Unknown')}}
</div>
</div>
</div>
`
})
export class ClaimEntityProjectMetadataComponent {
@Input() entity: ClaimEntity;
@Input() slice: boolean = false;
@Input() sliceSize: number = 45;
@Input() shortVersion: boolean = false;
ngOnInit() {
}
sliceArray(array): string {
if (this.slice) {
let sliced = array.slice(0, this.sliceSize);
return sliced.join("; ") + (array.length>this.sliceSize ? "...":"");
}
return array.join("; ");
}
addStringToNumber(str: string, num: number) {
return (+str) + num;
}
getProjectDurationMessage(result: ClaimEntity) {
if(!result.warningMessages){
return null;
}
for (let message of result.warningMessages) {
if (message.type == "projectDuration") {
return "Should be from " + message.projectInfo.startDate + ((message.projectInfo.endDate) ? (" to " + ((5 + +message.projectInfo.endDate))) : "");
}
}
return null;
}
// getEmbargoEndDateMessage(result: ClaimEntity) {
// for (var message of result.warningMessages) {
// if (message.type == "embargoEndDate") {
// return "Embargo end date must be later than published date";
// }
// }
// return null;
// }
}

View File

@ -0,0 +1,79 @@
import {Component, Input} from '@angular/core';
import {ClaimEntity} from '../../claim-utils/claimHelper.class';
import {StringUtils} from "../../../utils/string-utils.class";
@Component({
selector: 'claim-result-metadata',
template:
`
<div *ngIf="entity.result">
<div *ngIf="entity.result.authors && entity.result.authors.length >0 " class="uk-text-small">
<span class="uk-text-muted">Authors </span>
{{sliceArray(entity.result.authors)}}
</div>
<div *ngIf="!shortVersion && entity.result.editors&& entity.result.editors.length > 0" class="uk-text-small">
<span class="uk-text-muted">Editors </span>
{{sliceArray(entity.result.editors)}}
</div>
<div *ngIf="!shortVersion" class="uk-grid uk-margin-remove uk-text-small">
<div class="uk-width-1-2 uk-padding-remove-left">
<span *ngIf="entity.result.publisher!=null"><span
class="uk-text-muted">Publisher</span> {{entity.result.publisher}}</span>
<span *ngIf="entity.result.journal!=null"><span
class="uk-text-muted">Journal</span> {{entity.result.journal}}</span>
</div>
<div class="uk-width-1-2">
<span *ngIf="entity.result.date"><span class="uk-text-muted">Published in </span> <span
[class]="(getProjectDurationMessage(entity)?'uk-text-warning':'')">{{entity.result.date}}</span></span>
<div [class]="(getProjectDurationMessage(entity)?'uk-text-warning':'')">{{getProjectDurationMessage(entity)}}
</div>
</div>
</div>
</div>
`
})
export class ClaimEntityResultMetadataComponent {
@Input() entity: ClaimEntity;
@Input() slice: boolean = false;
@Input() sliceSize: number = 45;
@Input() shortVersion: boolean = false;
ngOnInit() {
}
sliceArray(array): string {
if (this.slice) {
let sliced = array.slice(0, this.sliceSize);
return sliced.join("; ") + (array.length>this.sliceSize ? "...":"");
}
return array.join("; ");
}
addStringToNumber(str: string, num: number) {
return (+str) + num;
}
getProjectDurationMessage(result: ClaimEntity) {
if(!result.warningMessages){
return null;
}
for (let message of result.warningMessages) {
if (message.type == "projectDuration") {
return "Should be from " + message.projectInfo.startDate + ((message.projectInfo.endDate) ? (" to " + ((5 + +message.projectInfo.endDate))) : "");
}
}
return null;
}
// getEmbargoEndDateMessage(result: ClaimEntity) {
// for (var message of result.warningMessages) {
// if (message.type == "embargoEndDate") {
// return "Embargo end date must be later than published date";
// }
// }
// return null;
// }
}

View File

@ -0,0 +1,77 @@
import {Component, Input} from '@angular/core';
import {ClaimEntity} from '../../claim-utils/claimHelper.class';
import {StringUtils} from "../../../utils/string-utils.class";
@Component({
selector: 'claim-title',
template:
`
<span class="uk-text-bold">
<a *ngIf="entity.result && entity.result.url" target="_blank" [href]="entity.result.url"
class="uk-link">{{entity.title ? sliceString(entity.title) : '[No title available]'}}</a>
<span
*ngIf="(entity.result && !entity.result.url)">{{entity.title ? sliceString(entity.title) : '[No title available]'}}</span>
<span *ngIf="entity.type=='project' && entity.project">
<span *ngIf="!shortVersion">
{{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}}
</span>
<span *ngIf="shortVersion">
{{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}}
</span>
</span>
<span *ngIf="entity.type=='community' && entity.context">
<span *ngIf=" entity.context.community != entity.context.concept.label">
{{entity.context.community }} > {{entity.context.category}} >
</span>
<span> {{entity.context.concept.label}}</span>
</span>
</span>
`
})
export class ClaimEntityTitleComponent {
@Input() entity: ClaimEntity;
@Input() slice:boolean = false;
@Input() sliceSize:number = 45;
@Input() shortVersion: boolean = false;
ngOnInit() {
}
sliceString(mystr:string): string {
if(this.slice){
return StringUtils.sliceString(mystr,this.sliceSize);
}
return mystr;
}
addStringToNumber(str: string, num: number) {
return (+str) + num;
}
getProjectDurationMessage(result: ClaimEntity) {
for (let message of result.warningMessages) {
if (message.type == "projectDuration") {
return "Should be from " + message.projectInfo.startDate + ((message.projectInfo.endDate) ? (" to " + ((5 + +message.projectInfo.endDate))) : "");
}
}
return null;
}
getEmbargoEndDateMessage(result: ClaimEntity) {
for (var message of result.warningMessages) {
if (message.type == "embargoEndDate") {
return "Embargo end date must be later than published date";
}
}
return null;
}
}

View File

@ -0,0 +1,412 @@
<div class="uk-section uk-padding-remove-top uk-padding-remove-bottom communityToolBarSection">
<div class="linkingToolbar uk-padding-small uk-margin-small-top">
<div class="uk-container uk-container-large uk-margin-small-top uk-padding-small">
<div class="uk-grid">
<div class="uk-padding-remove-left uk-margin-auto-vertical back">
<span
(click)="showOptions.showLinkTo()"
style="cursor:pointer">
<span class="uk-icon">
<svg width="30" height="30" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="chevron-left"
ratio="1.5"><polyline fill="none" stroke="#000" stroke-width="1.03"
points="13 16 7 10 13 4"></polyline></svg></span>
BACK
</span>
</div>
<div class="uk-width-expand">
<div class="uk-h5 uk-text-bold">
LINKING CONFIRMATION
</div>
Confirm that the links you provided are all correct
</div>
<claim-insert [results]="results" [sources]="sources" [inlineEntity]="inlineEntity"
[properties]=properties [localStoragePrefix]=localStoragePrefix
class=" " [errors]="errors" (insertFinished)="runValidation(false); updateLocalStorage();">
</claim-insert>
</div>
</div>
</div>
</div>
<div id="tm-main" class="uk-section uk-margin-small-top tm-middle uk-padding-remove-top">
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-container-large">
<div *ngIf="properties" class="uk-section uk-section-default uk-padding-remove-top">
<div class="uk-margin-top">
<div class="uk-grid">
<div class="uk-width-expand">
<div>
<div class=" uk-margin uk-h6 uk-text-primary uk-animation-toggle"
(click)="showSources=!showSources; ">
SOURCES ({{sources.length + (inlineEntity ? 1 : 0) | number}})
<span *ngIf="!showSources" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="chevron-left"
ratio="1"><polyline fill="none" stroke="#000"
stroke-width="1.03"
points="13 16 7 10 13 4"></polyline></svg></span>
<span *ngIf="showSources" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="chevron-down"
ratio="1"><polyline fill="none" stroke="#000"
stroke-width="1.03"
points="16 7 10 13 4 7"></polyline></svg></span>
</div>
<ul *ngIf="inlineEntity && showSources" class="uk-list uk-animation-fade">
<li
[class]="((inlineEntity.warningMessages.length > 0)?' warningBorder ':'')+
+((inlineEntity.errorMessages.length > 0)?' dangerBorder ':'') +
' uk-alert'" >
<div class="uk-grid uk-text-small">
<div class="uk-text-muted uk-width-1-2">
{{(!inlineEntity.result) ? inlineEntity.type : ((inlineEntity.result && inlineEntity.result.source == 'openaire') ? inlineEntity.type : (inlineEntity.result && inlineEntity.result.source + ' result'))}}
</div>
<div *ngIf="inlineEntity.errorMessages.length > 0"
class="uk-text-danger uk-width-1-2"> Link couldn't be saved
</div>
</div>
<!-- <div class="uk-text-muted">-->
<!-- {{(!inlineEntity.result) ? inlineEntity.type : ((inlineEntity.result && inlineEntity.result.source == 'openaire') ? inlineEntity.type : (inlineEntity.result && inlineEntity.result.source + ' result'))}}-->
<!-- </div>-->
<div>
<claim-title [entity]="inlineEntity"></claim-title>
</div>
<claim-result-metadata [entity]="inlineEntity"></claim-result-metadata>
<claim-project-metadata [entity]="inlineEntity"></claim-project-metadata>
</li>
</ul>
<div *ngIf="!inlineEntity && sources.length == 0 && showSources">
<div class="uk-alert dangerBorder no-selected-message uk-text-center">
<span class="uk-text-bold uk-text-danger"> SOURCES cannot be empty.</span>
Start by adding your linking sources first, go to <a (click)="showOptions.showSource() " class="uk-link">
sources
page</a>.
</div>
</div>
<ul *ngIf="!inlineEntity && sources.length > 0 && showSources" class="uk-list uk-animation-fade">
<li *ngFor=" let entity of sources "
[class]="((entity.warningMessages.length > 0)?' warningBorder ':'')+
+((entity.errorMessages.length > 0)?' dangerBorder ':'') +
' uk-alert'">
<!-- <div class="uk-text-muted">-->
<!-- {{(!entity.result) ? entity.type : ((entity.result && entity.result.source == 'openaire') ? entity.type : (entity.result && entity.result.source + ' result'))}}-->
<!-- </div>-->
<div class="uk-grid uk-text-small">
<div class="uk-text-muted uk-width-1-2">
{{(!entity.result) ? entity.type : ((entity.result && entity.result.source == 'openaire') ? entity.type : (entity.result && entity.result.source + ' result'))}}
</div>
<div *ngIf="entity.errorMessages.length > 0"
class="uk-text-danger uk-width-1-2"> Link couldn't be saved
</div>
</div>
<div class="uk-grid uk-margin-remove-top">
<div class="uk-width-expand">
<claim-title [entity]="entity"></claim-title>
<claim-result-metadata [entity]="entity"></claim-result-metadata>
<claim-project-metadata [entity]="entity"></claim-project-metadata>
<div *ngIf="entity.result && entity.result.source && entity.result.source!='openaire' "
class="uk-grid uk-margin-remove-top uk-text-small">
<div class="uk-width-1-2">
<span class="uk-text-muted">Type </span>
<select [(ngModel)]="entity.type" name="{{'select_type_'+entity.id}}"
class="uk-select uk-width-small">
<option [value]="'publication'"
(click)="onTypeChanged('publication',entity, false)">Publication
</option>
<option [value]="'dataset'"
(click)="onTypeChanged('dataset',entity, false)">Research data
</option>
<option [value]="'software'" (click)="onTypeChanged('software',entity, false)">Software
</option>
<option [value]="'other'"
(click)="onTypeChanged('other',entity, false)">Other research product
</option>
</select>
</div>
<div class="uk-width-1-2 uk-padding-remove-left ">
<div class="uk-grid">
<span class="uk-text-muted uk-margin-small-top uk-padding-remove-left">Access mode</span>
<select [(ngModel)]="entity.result.accessRights" name="{{'select_rights_'+entity.id}}"
class="uk-select uk-width-small uk-padding-remove-left uk-margin-left">
<option *ngFor="let type of accessTypes" [value]="type"
(click)="accessRightsTypeChanged(type,entity, false)">{{type}}</option>
</select>
<mat-form-field *ngIf="entity.result.accessRights== 'EMBARGO'">
<input matInput [matDatepicker]="picker" placeholder="Choose embargo end date"
(click)="picker.open()" [ngModel]="embargoEndDates[entity.id+'_source']"
(dateInput)="onDateChanged($event, entity, false)" (dateChange)="onDateChanged($event, entity, false)">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker [startAt]="embargoEndDates[entity.id+'_source']" ng-model-options="{ timezone: 'utc' }"></mat-datepicker>
</mat-form-field>
</div>
<div *ngIf="entity.result.accessRights== 'EMBARGO' && getEmbargoEndDateMessage(entity)"
[class]="(getEmbargoEndDateMessage(entity)?'uk-text-warning':'')">{{getEmbargoEndDateMessage(entity)}}
</div>
</div>
</div>
</div>
<div class=" uk-margin-auto-vertical">
<a class=" uk-icon-button "
(click)="remove(entity, false)">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="minus"
ratio="1"><rect height="1" width="18" y="9" x="1"></rect></svg>
</span>
</a>
</div>
</div>
</li>
</ul>
</div>
<!-- Results-->
<div>
<div class=" uk-margin uk-h6 uk-text-primary "
(click)="showLinksTo=!showLinksTo; ">
LINK TO ({{results.length | number}})
<span *ngIf="!showLinksTo" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-left" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="13 16 7 10 13 4"></polyline></svg></span>
<span *ngIf="showLinksTo" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-down" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="16 7 10 13 4 7"></polyline></svg></span>
</div>
<div *ngIf="results.length == 0 && showLinksTo">
<div class="uk-alert dangerBorder no-selected-message uk-text-center">
<span class="uk-text-bold uk-text-danger"> LINK TO list cannot be empty.</span>
Select an entity type to link to:
<div class="uk-grid uk-text-center uk-margin-expand uk-padding-small uk-child-width-1-3 uk-width-large uk-margin-auto ">
<div *ngIf="showOptions.linkToEntities.indexOf('project')!=-1 "
(click)="goTo('project')"
style="cursor:pointer;">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="album" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect height="1" width="10" x="5" y="2"></rect><rect
height="1" width="14" x="3" y="4"></rect><rect fill="none" height="11" stroke="#000"
width="17" x="1.5" y="6.5"></rect></svg></span>
</button>
<div>Projects</div>
</div>
<div *ngIf="showOptions.linkToEntities.indexOf('result')!=-1 " (click)="goTo('result')"
style="cursor:pointer;">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="copy" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect fill="none" height="16" stroke="#000"
width="12" x="3.5" y="2.5"></rect><polyline
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
</button>
<div>Research results</div>
</div>
<div *ngIf="showOptions.linkToEntities.indexOf('context')!=-1 "
(click)="goTo('context')"
style="cursor:pointer;">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="users" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><circle cx="7.7" cy="8.6" fill="none" r="3.5"
stroke="#000" stroke-width="1.1"></circle><path
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3" fill="none"
stroke="#000" stroke-width="1.1"></path><path
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"
fill="none" stroke="#000" stroke-width="1.1"></path></svg></span>
</button>
<div>Communities</div>
</div>
</div>
</div>
</div>
<ul *ngIf="results.length > 0 && showLinksTo" class="uk-list uk-animation-fade">
<li *ngFor=" let entity of results "
[class]="((entity.warningMessages.length > 0)?' warningBorder ':'')+
+((entity.errorMessages.length > 0)?' dangerBorder ':'') +
' uk-alert'" style="z-index: 0 !important;">
<div class="uk-grid uk-text-small">
<div class="uk-text-muted uk-width-1-2">
{{(!entity.result) ? entity.type : ((entity.result && entity.result.source == 'openaire') ? entity.type : (entity.result && entity.result.source + ' result'))}}
</div>
<div *ngIf="entity.errorMessages.length > 0"
class="uk-text-danger uk-width-1-2"> Link couldn't be saved
</div>
</div>
<div class="uk-grid uk-margin-remove-top">
<div class="uk-width-expand">
<claim-title [entity]="entity"></claim-title>
<claim-result-metadata [entity]="entity"></claim-result-metadata>
<claim-project-metadata [entity]="entity"></claim-project-metadata>
<div *ngIf="entity.result && entity.result.source && entity.result.source!='openaire' "
class="uk-grid uk-text-small uk-margin-remove-top">
<div class="uk-width-1-2">
<span class="uk-text-muted">Type </span>
<select [(ngModel)]="entity.type" name="{{'select_type_'+entity.id}}"
class="uk-select uk-width-small">
<option [value]="'publication'"
(click)="onTypeChanged('publication',entity, false)">Publication
</option>
<option [value]="'dataset'"
(click)="onTypeChanged('dataset',entity, false)">Research data
</option>
<option [value]="'software'" (click)="onTypeChanged('software',entity, false)">Software
</option>
<option [value]="'other'"
(click)="onTypeChanged('other',entity, false)">Other research product
</option>
</select>
</div>
<div class="uk-width-1-2 uk-padding-remove-left ">
<div class="uk-grid">
<span class="uk-text-muted uk-margin-small-top uk-padding-remove-left">Access mode</span>
<select [(ngModel)]="entity.result.accessRights" name="{{'select_rights_'+entity.id}}"
class="uk-select uk-width-small uk-padding-remove-left uk-margin-left">
<option *ngFor="let type of accessTypes" [value]="type"
(click)="accessRightsTypeChanged(type,entity, true)">{{type}}</option>
</select>
<mat-form-field *ngIf="entity.result.accessRights== 'EMBARGO'">
<input matInput [matDatepicker]="picker" placeholder="Choose embargo end date"
(click)="picker.open()" [ngModel]="embargoEndDates[entity.id+'_result']"
(dateInput)="onDateChanged($event, entity, true)"
(dateChange)="onDateChanged($event, entity, true)">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker [startAt]="embargoEndDates[entity.id+'_result']" ng-model-options="{ timezone: 'utc' }"></mat-datepicker>
</mat-form-field>
</div>
<div *ngIf="entity.result.accessRights== 'EMBARGO' && getEmbargoEndDateMessage(entity)"
[class]="(getEmbargoEndDateMessage(entity)?'uk-text-warning':'')">{{getEmbargoEndDateMessage(entity)}}
</div>
</div>
</div>
</div>
<div class=" uk-margin-auto-vertical">
<a class="uk-icon-button "
(click)="remove(entity, true)">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="minus"
ratio="1"><rect height="1" width="18" y="9" x="1"></rect></svg>
</span>
</a>
</div>
</div>
</li>
</ul>
</div>
</div>
<div class="uk-width-1-3" *ngIf="errors.length > 0 || warnings.length > 0">
<!-- Errors and Warning -->
<div *ngIf="errors.length > 0" class=" uk-margin uk-h6 uk-text-primary uk-animation-toggle"
(click)="showErrors=!showErrors ">
ERRORS ({{errors.length | number}})
<span *ngIf="!showErrors" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-left" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="13 16 7 10 13 4"></polyline></svg></span>
<span *ngIf="showErrors" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-down" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="16 7 10 13 4 7"></polyline></svg></span>
</div>
<div *ngIf="errors.length > 0 && showErrors" class=" uk-animation-fade">
<div *ngFor=" let message of errors " class="uk-alert dangerBorder">
<div *ngIf="message.type == 'claimServiceFail2Insert'">
<div class="">
<span class="uk-text-danger uk-text-bold"> Fail to save {{message.failed|number}}
{{message.failed > 1 ? 'links.' : 'link.'}}</span>
<br>
<div
*ngIf="message.inserted>0">But {{message.inserted|number}} link{{message.inserted > 1 ? 's' : ''}} was
successfully inserted.
<div>
<a routerLinkActive="router-link-active" routerLink="/myclaims">Manage your links here</a>
</div>
</div>
</div>
</div>
<div *ngIf="message.type == 'claimServiceFail'">
<div class="">
<span class="uk-text-danger uk-text-bold"> An error occured while saving your links.</span>
<br>
None of the links saved.
</div>
</div>
</div>
</div>
<div *ngIf="warnings.length > 0"
class=" uk-margin uk-h6 uk-text-primary uk-animation-toggle"
(click)="showWarnings=!showWarnings "> WARNINGS
({{warnings.length
| number}})
<span *ngIf="!showWarnings" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-left" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="13 16 7 10 13 4"></polyline></svg></span>
<span *ngIf="showWarnings" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-down" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="16 7 10 13 4 7"></polyline></svg></span>
</div>
<div *ngIf="warnings.length > 0 && showWarnings " class=" uk-animation-fade">
<div *ngFor=" let message of warnings " class="uk-alert warningBorder">
<div *ngIf="message.type == 'embargoEndDate'">
<div class="uk-text-warning uk-text-bold">
Embargo date must be later than published date in
</div>
<div class="">
{{message.resultTitle}}
</div>
</div>
<div *ngIf="message.type == 'projectDuration'">
<div class="uk-text-warning uk-text-bold">
Published date must be in the project's date boundaries
(from {{message.projectInfo.startDate}}{{(message.projectInfo.endDate) ? (' to ' + (addStringToNumber(message.projectInfo.endDate, 5))) : ''}}) in
</div>
<div class="">
{{message.resultTitle}}
</div>
<div class="uk-text-muted uk-text-small">
with link to
</div>
<div class="">
{{message.projectInfo.title}}
</div>
<div><span class="uk-text-muted uk-text-small">
Project boundaries: </span>({{message.projectInfo.startDate}}{{(message.projectInfo.endDate) ? (' - ' + (message.projectInfo.endDate) + ') +5 years') : ')'}}
</div>
</div>
</div>
</div>
</div>
<modal-alert (alertOutput)="confirmClose()">
</modal-alert>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,333 @@
import {Component, Input, ViewChild} from '@angular/core';
import {AlertModal} from '../../../utils/modal/alert';
import {ClaimEntity, ClaimsErrorMessage, Message, ShowOptions} from '../../claim-utils/claimHelper.class';
import {EnvProperties} from "../../../utils/properties/env-properties";
import {Dates} from "../../../utils/string-utils.class";
import {HelperFunctions} from "../../../utils/HelperFunctions.class";
@Component({
selector: 'metadata-preview',
templateUrl: 'metadataPreview.component.html'
})
export class MetadataPreviewComponent {
showSources = true;
showLinksTo = true;
showErrors = true;
showWarnings = true;
@Input() results: ClaimEntity[];
@Input() sources: ClaimEntity[];
@Input() title: string = "Research Results";
@Input() bulkMode: boolean = false;
@Input() inlineEntity: ClaimEntity = null;
@Input() showOptions:ShowOptions;
@Input() public properties: EnvProperties;
@ViewChild(AlertModal) alertApplyAll;
@Input() localStoragePrefix: string = "";
errors:ClaimsErrorMessage[] = [];
warnings:Message[] = [];
public commonAccessRights = "OPEN"; // for access rights- changes when user apply a change to every entity
public commonEmbargoEndDate; // for access rights: embargoEndDate - changes when user apply a change to every entity
public commonType; // for research entity type - changes when user apply a change to every entity
public applyToResults: boolean; // true apply to results, false apply to sources
public typeChanged: boolean = true; //
accessTypes = ["OPEN", "CLOSED", "EMBARGO", "RESTRICTED"];
embargoEndDates = [];
ngOnInit() {
this.setEmbargoEndDates();
if (this.inlineEntity) {
this.showSources = true;
this.showLinksTo = true;
}
this.runValidation(true);
}
setEmbargoEndDates(){
for(let entity of this.sources){
if(entity.result){
this.embargoEndDates[entity.id+"_source"] = MetadataPreviewComponent.getDate(entity.result.embargoEndDate);
// entity.result.accessRights = "EMBARGO";
}
}
for(let entity of this.results){
if(entity.result){
this.embargoEndDates[entity.id+"_result"] = MetadataPreviewComponent.getDate(entity.result.embargoEndDate);
}
}
}
private static getDate(date:string){
let myDate = new Date();
if(date){
myDate = new Date(date);
}else{
myDate = new Date();
}
return myDate;
}
/* removePublication(item: ClaimEntity) {
var index: number = this.results.indexOf(item);
if (index > -1) {
this.results.splice(index, 1);
if (this.results != null) {
localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.results));
}
}
}*/
onDateChanged(event: any, item: ClaimEntity, applyToResults) {
item.result.embargoEndDate = Dates.getDateToString(event.value);
this.embargoEndDates [item.id+"_"+(applyToResults?'result':'source')] = event.value;
if ((applyToResults && this.results.length > 1) || (!applyToResults && this.sources.length > 1)) {
this.commonAccessRights = "EMBARGO";
this.commonEmbargoEndDate = item.result.embargoEndDate;
this.applyToResults = applyToResults;
this.confirmOpen(false);
}
this.updateLocalStorage();
this.runValidation(true);
}
onTypeChanged(event: any, item: ClaimEntity, applyToResults) {
item.type = (event);
if ((applyToResults && this.results.length > 1) || (!applyToResults && this.sources.length > 1)) {
this.commonType = item.type;
this.applyToResults = applyToResults;
this.confirmOpen(true );
}
this.updateLocalStorage();
}
// resultsChanged($event) {
// this.results=$event.value;
// this.resultsChange.emit({
// value: this.results
// });
// }
/* The following methods:
*typeChanged
*confirmOpen
*confirmClose
implement the functionality: change accessRights of a publication - apply to all if asked */
accessRightsTypeChanged(type: any, item: any, applyToResults) {
item.accessRights = type;
if ((applyToResults && this.results.length > 1) || (!applyToResults && this.sources.length > 1)) {
this.commonAccessRights = type;
this.applyToResults = applyToResults;
if (this.commonAccessRights != "EMBARGO") {
this.commonEmbargoEndDate = item.embargoEndDate;
this.confirmOpen(false );
}
}
this.runValidation(true);
this.updateLocalStorage();
}
confirmOpen(type: boolean) {
this.typeChanged = type;
this.alertApplyAll.cancelButton = true;
this.alertApplyAll.okButton = true;
this.alertApplyAll.alertTitle = "Change metadata";
this.alertApplyAll.message = "Do you wish to apply the change to every entity?";
this.alertApplyAll.okButtonText = "Yes";
this.alertApplyAll.cancelButtonText = "No";
this.alertApplyAll.open();
}
confirmClose() {
if (this.typeChanged) {
if (this.applyToResults) {
for (let i = 0; i < this.results.length; i++) {
if (this.results[i].result.source != 'openaire' && this.results[i].type != 'project' && this.results[i].type != 'community') {
this.results[i].type = this.commonType;
}
}
} else {
for (let i = 0; i < this.sources.length; i++) {
if (this.sources[i].result.source != 'openaire' && this.sources[i].type != 'project' && this.sources[i].type != 'community') {
this.sources[i].type = this.commonType;
}
}
}
} else {
if (this.applyToResults) {
for (let i = 0; i < this.results.length; i++) {
if (this.results[i].result.source != 'openaire' && this.results[i].type != 'project' && this.results[i].type != 'community') {
this.results[i].result.accessRights = this.commonAccessRights;
if (this.commonAccessRights == "EMBARGO") {
this.results[i].result.embargoEndDate = this.commonEmbargoEndDate;
}
}
}
} else {
for (let i = 0; i < this.sources.length; i++) {
if (this.sources[i].result.source != 'openaire' && this.sources[i].type != 'project' && this.sources[i].type != 'community') {
this.sources[i].result.accessRights = this.commonAccessRights;
if (this.commonAccessRights == "EMBARGO") {
this.sources[i].result.embargoEndDate = this.commonEmbargoEndDate;
}
}
}
}
this.setEmbargoEndDates();
}
this.updateLocalStorage();
this.runValidation(true)
}
remove(item: any, applyToResults: boolean) {
if (applyToResults) {
let index: number = this.results.indexOf(item);
item.warningMessages.splice(0, item.warningMessages.length);
if (index > -1) {
this.results.splice(index, 1);
localStorage.setItem(this.localStoragePrefix + 'results', JSON.stringify(this.results));
}
} else {
let index: number = this.sources.indexOf(item);
item.warningMessages.splice(0, item.warningMessages.length);
if (index > -1) {
this.sources.splice(index, 1);
localStorage.setItem(this.localStoragePrefix + 'sources', JSON.stringify(this.sources));
}
}
this.updateLocalStorage();
this.runValidation(true);
}
addStringToNumber(str: string, num: number) {
return (+str) + num;
}
runValidation(cleanErrors:boolean) {
this.warnings = [];
if(cleanErrors){
this.errors = [];
}
if (this.inlineEntity) {
this.inlineEntity.warningMessages = [];
if(cleanErrors){
this.inlineEntity.errorMessages = [];
}
}
this.validateEmbargoDate(this.sources, cleanErrors);
this.validateEmbargoDate(this.results, cleanErrors);
this.validateProjectDuration();
}
validateProjectDuration() {
for (let item of this.results) {
if (item.type == 'project' && item.project) {
for (let result of this.sources) {
if (result.result && result.result.date) {
if ((item.project.startDate && result.result.date < item.project.startDate) || (item.project.endDate && +result.result.date > (5 + +item.project.endDate))) {
const message: Message = {
type: 'projectDuration',
resultId: result.id,
resultTitle: result.title,
projectId: item.id,
projectInfo: {title: item.title, startDate: item.project.startDate, endDate: item.project.endDate}
};
result.warningMessages.push(message);
this.warnings.push(message);
}
}
}
if (this.inlineEntity && this.inlineEntity.result) {
if (this.inlineEntity.result.date) {
if ((item.project.startDate && this.inlineEntity.result.date < item.project.startDate) || (item.project.endDate && +this.inlineEntity.result.date > (5 + +item.project.endDate))) {
const message: Message = {
type: 'projectDuration',
resultId: this.inlineEntity.id,
resultTitle: this.inlineEntity.title,
projectId: item.id,
projectInfo: {title: item.title, startDate: item.project.startDate, endDate: item.project.endDate}
};
this.inlineEntity.warningMessages.push(message);
this.warnings.push(message);
}
}
}
}
}
if (this.inlineEntity && this.inlineEntity.project) {
for (let result of this.results) {
if (result.result && result.result.date) {
if ((this.inlineEntity.project.startDate && result.result.date < this.inlineEntity.project.startDate) || (this.inlineEntity.project.endDate && +result.result.date > (5 + +this.inlineEntity.project.endDate))) {
const message: Message = {
type: 'projectDuration',
resultId: result.id,
resultTitle: result.title,
projectId: this.inlineEntity.id,
projectInfo: {title: this.inlineEntity.title, startDate: this.inlineEntity.project.startDate, endDate: this.inlineEntity.project.endDate}
};
result.warningMessages.push(message);
this.warnings.push(message);
}
}
}
}
}
validateEmbargoDate(sources: ClaimEntity [],cleanErrors:boolean) {
for (let entity of sources) {
entity.warningMessages = [];
if(cleanErrors){
entity.errorMessages = [];
}
if(entity.result) {
// console.log(entity.result.accessRights + " " + entity.result.date + " " + entity.result.embargoEndDate);
if (entity.result.accessRights && entity.result.accessRights == 'EMBARGO' && entity.result.date && (entity.result.embargoEndDate) && entity.result.date > entity.result.embargoEndDate.substr(0, 4)) {
let message: Message = new Message();
message.type = "embargoEndDate";
message.resultId = entity.id;
message.resultTitle = entity.title;
entity.warningMessages.push(message);
this.warnings.push(message);
}
}
}
}
getEmbargoEndDateMessage(result: ClaimEntity) {
for (let message of result.warningMessages) {
if (message.type == "embargoEndDate") {
return "Embargo end date must be later than published date";
}
}
return null;
}
updateLocalStorage(){
if (this.sources != null) {
localStorage.setItem(this.localStoragePrefix+"sources", JSON.stringify(this.sources));
}
if (this.results != null) {
localStorage.setItem(this.localStoragePrefix+"results", JSON.stringify(this.results));
}
}
goTo(show:string=null) {
if(show && (['project','context', 'result']).indexOf(show)!=-1){
this.showOptions.show = show;
this.showOptions.basketShowSources=false;
this.showOptions.basketShowLinksTo=true;
}
HelperFunctions.scroll();
}
}

View File

@ -0,0 +1,20 @@
import {NgModule} from '@angular/core';
import {SharedModule} from '../../../shared/shared.module';
import {MetadataPreviewComponent} from './metadataPreview.component';
import {AlertModalModule} from '../../../utils/modal/alertModal.module';
import {ClaimEntitiesMetadataModule} from "./ClaimEntitiesMetadata.module";
import {InsertClaimsModule} from "../insertClaim/insertClaim.module";
import { MatDatepickerModule, MatNativeDateModule, MatFormFieldModule, MatInputModule} from '@angular/material';
@NgModule({
imports: [
SharedModule,
AlertModalModule,
ClaimEntitiesMetadataModule,
InsertClaimsModule,
MatDatepickerModule, MatNativeDateModule, MatFormFieldModule, MatInputModule
],
declarations: [MetadataPreviewComponent],
exports:[MetadataPreviewComponent]
})
export class MetadataPreviewModule { }

View File

@ -1,5 +1,5 @@
import {Component, Input,Output, EventEmitter} from '@angular/core';
import {ClaimContext} from '../../claim-utils/claimEntities.class';
import {ClaimContext} from '../../claim-utils/claimHelper.class';
@Component({
selector: 'claim-selected-contexts',
@ -7,11 +7,11 @@ import {ClaimContext} from '../../claim-utils/claimEntities.class';
<!-- Contexts -->
<div class="uk-placeholder uk-margin-top" >
<div class="" >
<div *ngIf="contexts.length > 0 " class=" ">
<h5 class=" uk-margin uk-h5 uk-text-primary">Selected Communities ({{contexts.length | number}}) </h5>
<!--h5 class=" uk-margin uk-h5 uk-text-primary">Selected Communities ({{contexts.length | number}}) </h5-->
<ul class="uk-list uk-list-divider">
<li class="list-group-item" *ngFor="let context of contexts" >
@ -25,7 +25,7 @@ import {ClaimContext} from '../../claim-utils/claimEntities.class';
</li>
</ul>
</div>
<div *ngIf="contexts.length == 0 " class="uk-alert no-selected-message uk-text-center">You have not selected any communities</div>
<!--div *ngIf="contexts.length == 0 " class="uk-alert no-selected-message uk-text-center">You have not selected any communities</div-->
</div>
@ -50,7 +50,7 @@ export class ClaimSelectedContextsComponent {
//The following need to be kept in case we have to save the current state
@Input() public projects;
@Input() public results;
@Input() public inlineEntity;
// @Input() public inlineEntity;
@Input() componentClass:string = ""; //"" or "col-sm-6" for horizontal display (besides projects)
@Input() show='home';
@Input() title='Communities';

View File

@ -1,5 +1,5 @@
import {Component, Input,Output, EventEmitter} from '@angular/core';
import {ClaimProject} from '../../claim-utils/claimEntities.class';
import {ClaimProject} from '../../claim-utils/claimHelper.class';
import {RouterHelper} from '../../../utils/routerHelper.class';
@Component({
@ -7,10 +7,10 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
template: `
<div class="uk-placeholder uk-margin-top" >
<div class="" >
<div>
<h5 class=" uk-margin uk-h5 uk-text-primary" *ngIf="projects.length > 0 "> Selected Projects ({{projects.length | number}}) </h5>
<!--h5 class=" uk-margin uk-h5 uk-text-primary" *ngIf="projects.length > 0 "> Selected Projects ({{projects.length | number}}) </h5-->
<ul class="uk-list uk-list-divider">
<li class="list-group-item" *ngFor="let project of projects">
<a [queryParams]="routerHelper.createQueryParam('projectId',project.projectId)" routerLinkActive="router-link-active" routerLink="/search/project" >{{project.funderName}} | {{project.projectName}} {{(project.projectAcronym)?'('+project.projectAcronym+')':''}} <!--[{{project.startDate}} - {{project.endDate}}]--></a>
@ -22,7 +22,7 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
</li>
</ul>
</div>
<div *ngIf="projects.length == 0 " class="uk-alert no-selected-message uk-text-center">You have not selected any projects</div>
<!--div *ngIf="projects.length == 0 " class="uk-alert no-selected-message uk-text-center">You have not selected any projects</div-->
</div>

View File

@ -0,0 +1,22 @@
<ul *ngIf="results.length > 0 " class="uk-list uk-list-divider">
<li *ngFor=" let entity of results " >
<div class="uk-text-muted">
{{(!entity.result) ? entity.type : ((entity.result && entity.result.source == 'openaire') ? entity.type : (entity.result && entity.result.source + ' result'))}}
</div>
<div class="uk-grid">
<div class="uk-width-expand">
<claim-title [entity]="entity" [slice]="true" [sliceSize]="45" [shortVersion]="true"></claim-title>
<claim-result-metadata [entity]="entity" [slice]="true" [sliceSize]="5" [shortVersion]="true"></claim-result-metadata>
<claim-project-metadata [entity]="entity" [slice]="true" [sliceSize]="5" [shortVersion]="true"></claim-project-metadata>
</div>
<div class="uk-margin-auto-vertical" *ngIf="enableRemove">
<a class=" uk-icon-button " (click)="remove(entity)" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="minus" ratio="1"><rect height="1" width="18" y="9" x="1"></rect></svg>
</span>
</a>
</div>
</div>
</li>
</ul>

View File

@ -1,209 +1,36 @@
import {Component, Input,Output, EventEmitter, ViewChild} from '@angular/core';
import {AlertModal} from '../../../utils/modal/alert';
import {ClaimResult} from '../../claim-utils/claimEntities.class';
import {IMyOptions, IMyDateModel} from '../../../utils/my-date-picker/interfaces/index';
import {Dates} from '../../../utils/string-utils.class';
import {Component, Input} from '@angular/core';
import {ClaimEntity} from '../../claim-utils/claimHelper.class';
@Component({
selector: 'claim-selected-results',
template: `
<div class="uk-placeholder uk-margin-top" >
<div *ngIf="results.length == 0 " class="uk-alert no-selected-message uk-text-center">You have not selected any research results</div>
<div *ngIf="results.length > 0 ">
<h5 class=" uk-margin uk-h5 uk-text-primary" > {{title}} ({{results.length | number}}) </h5>
<table class="uk-table uk-table-responsive">
<thead *ngIf="showAccessRights">
<tr>
<th> Research Result</th>
<th> Change type and access mode</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let pub of results" >
<td >
<div>
<span *ngIf="showAccessRights" (click)="removePublication(pub)" aria-hidden="true" class="uk-icon-button icon-button-small"><span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="1"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg>
</span></span>
<a *ngIf="pub.url" target="_blank" href="{{pub.url}}" > <span class="custom-external"></span> {{pub.title?pub.title:'[No title available]'}}</a>
<span *ngIf="!pub.url" >{{pub.title?pub.title:'[No title available]'}}</span>
<span *ngIf="!showAccessRights" (click)="removePublication(pub)" aria-hidden="true" class="uk-icon-button icon-button-small ">
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="0.8"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg>
</span>
</span>
</div>
<span *ngIf="pub.publisher" >Publisher: {{pub.publisher}}</span>
<span *ngIf="pub.journal " >Journal: {{pub.journal}}</span>
<span *ngIf="pub.date" >({{pub.date}})</span>
<div *ngIf="pub.authors && pub.authors.length > 0" >Authors: <span *ngFor="let author of pub.authors.slice(0,10) let i = index">{{author}}{{(i < (pub.authors.slice(0,10).length-1))?"; ":""}}{{(i == pub.authors.slice(0,10).length-1 && pub.authors.length > 10)?"...":""}}</span></div>
<div *ngIf="pub.editors && pub.editors.length > 0" >Editors: <span *ngFor="let author of pub.editors.slice(0,10) let i = index">{{author}} {{(i < (pub.editors.slice(0,10).length-1))?"; ":""}}{{(i == pub.editors.slice(0,10).length-1 && pub.editors.length > 10)?"...":""}}</span></div>
<div><span class="uk-label label-grey">{{pub.source}}</span>
<span *ngIf="pub.accessRights" [class]=" 'uk-label label-'+pub.accessRights" > {{pub.accessRights}}</span>
<span *ngIf="pub.type" [class]="'uk-label label-'+pub.type" > {{pub.type}}</span>
</div>
</td>
<td *ngIf="showAccessRights && pub.source != 'openaire' " >
<select [(ngModel)]="pub.type" name="{{'select_type_'+pub.id}}" >
<option [value]="'publication'" (click)="onTypeChanged('publication',pub)" >Publication</option>
<option [value]="'dataset'" (click)="onTypeChanged('dataset',pub)" >Research data</option>
<option [value]="'software'" (click)="onTypeChanged('software',pub)" >Software</option>
<option [value]="'other'" (click)="onTypeChanged('other',pub)" >Other research product</option>
</select>
<select [(ngModel)]="pub.accessRights" name="{{'select_rights_'+pub.id}}" >
<option *ngFor="let type of accessTypes" [value]="type" (click)="accessRightsTypeChanged(type,pub)">{{type}}</option>
</select>
<my-date-picker *ngIf="pub.accessRights== 'EMBARGO'" name="{{'date'+pub.id}}" [options]="myDatePickerOptions"
[(ngModel)]="nextDate" (dateChanged)="onDateChanged($event,pub)" ></my-date-picker>
</td>
<td *ngIf="showAccessRights && pub.source == 'openaire' " >
Currently you cannot change metadata from OpenAIRE
</td>
</tr>
</tbody>
</table>
<div>
<modal-alert (alertOutput)="confirmClose($event)">
</modal-alert>
</div>
</div>
</div>
`
selector: 'claim-selected-results',
templateUrl: 'selectedResults.component.html'
})
export class ClaimSelectedResultsComponent {
@Input() results: ClaimEntity[];
@Input() title: string = "Research Results";
@Input() localStoragePrefix: string = "";
@Input() enableRemove:boolean = true;
ngOnInit() {
var myDate = new Date();
this.nextDate = { date: { year: myDate.getFullYear()+10, month: (myDate.getMonth()+1), day: myDate.getDate() } };
//2015-05-01
}
}
@Input() results: ClaimResult[];
@Input() title:string = "Research Results";
@Input() showAccessRights:boolean = false;
@Input() bulkMode:boolean = false;
// @Output()resultsChange = new EventEmitter();
@Input() showSearch:boolean = false;
nextDate = {};
@ViewChild(AlertModal) alertApplyAll;
@Input() localStoragePrefix:string = "";
public commonAccessRights = "OPEN"; // for access rights- changes when user apply a change to every result
public commonEmbargoEndDate; // for access rights: embargoEndDate - changes when user apply a change to every result
public commonType; // for research result type - changes when user apply a change to every result
public typeChanged:boolean = true; //
accessTypes = ["OPEN","CLOSED","EMBARGO","RESTRICTED"];
private myDatePickerOptions: IMyOptions = {
// other options...
dateFormat: 'yyyy-mm-dd',
selectionTxtFontSize: '15px',
height:'28px',
width: '100%',
editableDateField: false,
showClearDateBtn: false
};
removePublication(item:any){
var index:number =this.results.indexOf(item);
remove(item: any) {
const index: number = this.results.indexOf(item);
if (index > -1) {
this.results.splice(index, 1);
if(this.results != null){
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.results));
}
}
// this.resultsChange.emit({
// value: this.results
// });
}
this.results.splice(index, 1);
if (this.results != null) {
localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.results));
}
}
}
sliceString(mystr, size: number): string {
const sliced = String(mystr).substr(0, size);
return sliced + (String(mystr).length > size ? '...' : '');
}
onDateChanged (event:any, item:any) {
item.embargoEndDate = Dates.getDateFromString(event.formatted);
if(this.results.length > 1 ){
this.commonAccessRights = "EMBARGO";
this.commonEmbargoEndDate = item.embargoEndDate;
this.confirmOpen(false,"Do you wish to apply the change to every result?");
}
}
onTypeChanged (event:any, item:any) {
item.type =(event);
if(this.results.length > 1 ){
this.commonType = item.type;
this.confirmOpen(true, "Do you wish to apply the change to every result?");
}
}
// resultsChanged($event) {
// this.results=$event.value;
// this.resultsChange.emit({
// value: this.results
// });
// }
/* The following methods:
*typeChanged
*confirmOpen
*confirmClose
implement the functionality: change accessRights of a publication - apply to all if asked */
accessRightsTypeChanged (type:any, item:any) {
item.accessRights = type;
if(this.results.length > 1 ){
this.commonAccessRights = type;
if(this.commonAccessRights != "EMBARGO"){
this.commonEmbargoEndDate = item.embargoEndDate;
this.confirmOpen(false, "Do you wish to apply the change to every result?");
}
}
}
confirmOpen(type: boolean, message: string){
this.typeChanged = type;
this.alertApplyAll.cancelButton = true;
this.alertApplyAll.okButton = true;
this.alertApplyAll.alertTitle = "Change metadata";
this.alertApplyAll.message = "Do you wish to apply the change to every result?";
this.alertApplyAll.okButtonText = "Yes";
this.alertApplyAll.cancelButtonText = "No";
this.alertApplyAll.open();
}
confirmClose(data){
if(this.typeChanged){
for (var i = 0; i < this.results.length; i++) {
if(this.results[i].source != 'openaire' ){
this.results[i].type = this.commonType;
}
}
}else{
for (var i = 0; i < this.results.length; i++) {
if(this.results[i].source != 'openaire' ){
this.results[i].accessRights = this.commonAccessRights;
if(this.commonAccessRights == "EMBARGO"){
this.results[i].embargoEndDate = this.commonEmbargoEndDate;
}
}
}
}
}
}

View File

@ -4,15 +4,14 @@ import { SharedModule } from '../../../shared/shared.module';
import {ClaimSelectedResultsComponent} from './selectedResults.component';
import {AlertModalModule} from '../../../utils/modal/alertModal.module';
import { MyDatePickerModule } from '../../../utils/my-date-picker/my-date-picker.module';
// import {BulkClaimModule} from '../bulkClaim/bulkClaim.module';
// import {ClaimResultSearchFormModule} from '../../claim-utils/claimResultSearchForm.module';
import {ClaimEntitiesMetadataModule} from "./ClaimEntitiesMetadata.module";
@NgModule({
imports: [
SharedModule,
AlertModalModule,
MyDatePickerModule,
// BulkClaimModule, ClaimResultSearchFormModule,
ClaimEntitiesMetadataModule
],
declarations: [
ClaimSelectedResultsComponent

View File

@ -1,40 +1,45 @@
import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs';
import {Title, Meta} from '@angular/platform-browser';
import {Component, Input} from '@angular/core';
import {Meta, Title} from '@angular/platform-browser';
@Component({
selector: 'my-claims',
template: `
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
<div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
selector: 'my-claims',
template: `
<div id="tm-main" class=" uk-section uk-padding-remove-top uk-margin-small-top tm-middle">
<div class="uk-grid" >
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-margin-top">
<div class="uk-article-title custom-article-title">
My links
</div>
<div>
<!--div class="uk-text-right"><a routerLink="/participate/claim">Claim more links?</a></div-->
<displayClaims [enableDelete]=true [myClaims]=true [isAdmin]=false [showUserEmail]=false showLatestClaims=true moreClaimsURL="/participate/claim" [claimsInfoURL]=claimsInfoURL [showLatestClaims]=showLatestClaims></displayClaims>
<div class="uk-container uk-margin-top">
<div class="uk-h5 uk-text-bold">
My links
</div>
<div class=" ">
Manage your links in OpenAIRE
</div>
<div>
<displayClaims [enableDelete]=true [myClaims]=true [isAdmin]=false [showUserEmail]=false
moreClaimsURL="/participate/claim" [claimsInfoURL]=claimsInfoURL
[showLatestClaims]=showLatestClaims></displayClaims>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
`
`
})
export class MyClaimsComponent {
@Input() claimsInfoURL:string;
@Input() showLatestClaims:boolean;
export class MyClaimsComponent {
@Input() claimsInfoURL: string;
@Input() showLatestClaims: boolean;
constructor (private _meta: Meta, private _title: Title) {
var title = "OpenAIRE | My links";
constructor(private _meta: Meta, private _title: Title) {
let title = "OpenAIRE | My links";
this._meta.updateTag({content:title},"property='og:title'");
this._meta.updateTag({content: title}, "property='og:title'");
this._title.setTitle(title);
}
ngOnInit() {
}
ngOnInit() {
}

View File

@ -1,4 +1,4 @@
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle" >
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle">
<div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
@ -10,9 +10,11 @@
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div *ngIf="datasetInfo != null" uk-grid>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="datasetInfo.record" [data]=datasetInfo.record
[URL]="properties.baseLink+'/search/dataset?datasetId='+datasetId"></schema2jsonld>
@ -87,28 +89,6 @@
</a>
</div>
<!-- <div class="uk-clearfix"><div class="uk-float-right uk-margin-top">
<div class="uk-inline">
<button class="uk-button uk-button-small uk-button-action" type="button">
<span class="uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="link" ratio="1"><path fill="none" stroke="#000" stroke-width="1.1" d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M7.925,11.875 L11.925,7.975"></path></svg></span>
Link this research data to
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="triangle-down" ratio="1"><polygon points="5 7 15 7 10 12"></polygon></svg></span>
</button>
<div uk-dropdown="mode: click; boundary: ! .uk-button-group; boundary-align: true;"
class="uk-dropdown uk-dropdown-boundary uk-dropdown-bottom-left" style="top: 40px; left: -236.5px;">
<ul class="uk-nav uk-dropdown-nav uk-padding-small" >
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Projects</a></li>
<li><a class="uk-width-1-1"[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Communities</a></li>
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Other research results</a></li>
</ul>
</div>
</div>
</div></div> -->
<ul class="custom-accordion" uk-accordion>
<li *ngIf="datasetInfo.references" (click)="activeTab='References'">
<a class="uk-accordion-title" href="#">
@ -161,9 +141,9 @@
<div *ngFor="let provenanceaction of getKeys(datasetInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust"
<tabTable percentageName="trust"
[info]="datasetInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
[properties]=properties></tabTable>
</div>
</div>
</div>
@ -187,8 +167,8 @@
<div *ngIf="datasetInfo.similarResearchResults"> -->
<div>
<tabTable [percentageName]="similarity" [info]="datasetInfo.similarResearchResults"
[(properties)]=properties></tabTable>
<tabTable percentageName="similarity" [info]="datasetInfo.similarResearchResults"
[properties]=properties></tabTable>
</div>
</div>
</li>
@ -200,7 +180,7 @@
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
[id]="datasetId" [entityType]="'results'" [entity]="'Research Data'"
(metricsResults)="metricsResults($event)" [(properties)]=properties>
(metricsResults)="metricsResults($event)" [properties]=properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
@ -227,64 +207,8 @@
</div>
<div class="uk-width-large@m uk-width-1-1@s">
<div class=" uk-padding-small">
<div>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis>
</div>
<altmetrics *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.get('doi')"
id="{{datasetInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list uk-margin-remove-bottom ">
<li *ngIf="datasetInfo.hostedBy_collectedFrom && datasetInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="datasetInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="datasetInfo.fundedByProjects != undefined && datasetInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="datasetInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="datasetInfo.contexts && datasetInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of datasetInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</li>
<!--li>
<metrics [pageViews]="pageViews" shortView=true
[id]="datasetId" [entityType]="'results'" [entity]="'Research Data'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics>
</li-->
<li>
<div class="sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this research data
</div>
<div class=" ">
<citeThis [result]="datasetInfo" [id]="datasetId" type="research data"></citeThis>
</div>
</li>
</ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') "
class=" uk-button portal-button uk-width-1-1 ">
<div class=" uk-padding-small" *ngIf="isRouteAvailable('participate/direct-claim') ">
<button class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
@ -296,56 +220,128 @@
stroke-width="1.1"></path></svg>
</span> Link this dataset to...
</button>
<div class=" uk-text-center uk-margin-expand uk-padding-small uk-margin-auto default-dropdown "
uk-dropdown="mode:click">
<div class="uk-grid uk-child-width-1-3 uk-width-large ">
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
>
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="album" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect height="1" width="10" x="5" y="2"></rect><rect
height="1" width="14" x="3" y="4"></rect><rect fill="none" height="11" stroke="#000"
width="17" x="1.5" y="6.5"></rect></svg></span>
</button>
<div>Projects</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="copy" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect fill="none" height="16" stroke="#000"
width="12" x="3.5" y="2.5"></rect><polyline
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
</button>
<div>Research results</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="users" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><circle cx="7.7" cy="8.6" fill="none" r="3.5"
stroke="#000" stroke-width="1.1"></circle><path
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3" fill="none"
stroke="#000" stroke-width="1.1"></path><path
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"
fill="none" stroke="#000" stroke-width="1.1"></path></svg></span>
</button>
<div>Communities</div>
</a></div>
</div>
</div>
<div>
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">Share - Bookmark</div>
<addThis></addThis>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click"
style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album"
ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14"
height="1"></rect><rect
fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7"
cy="8.6" r="3.5"></circle><path fill="none" stroke="#000"
stroke-width="1.1"
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path
fill="none" stroke="#000" stroke-width="1.1"
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;"
title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy"
ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline
fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
</div>
<div class="uk-width-large@m uk-width-1-1@s">
<div class=" uk-padding-small">
<div>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis>
</div>
<altmetrics *ngIf="datasetInfo.identifiers && datasetInfo.identifiers.get('doi')"
id="{{datasetInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list uk-margin-remove-bottom ">
<li *ngIf="datasetInfo.hostedBy_collectedFrom && datasetInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="datasetInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="datasetInfo.fundedByProjects != undefined && datasetInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="datasetInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="datasetInfo.contexts && datasetInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of datasetInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</li>
<!--li>
<metrics [pageViews]="pageViews" shortView=true
[id]="datasetId" [entityType]="'results'" [entity]="'Research Data'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics>
</li-->
<li>
<div class="sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this research data
</div>
<div class=" ">
<citeThis [result]="datasetInfo" [id]="datasetId" type="research data"></citeThis>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
</div>
</div>

View File

@ -9,7 +9,8 @@
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" class="uk-width-1-1"></helper>
<div *ngIf="orpInfo != null" uk-grid class="uk-grid-large">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
@ -119,8 +120,8 @@
<div>
<div *ngFor="let provenanceaction of getKeys(orpInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust" [info]="orpInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
<tabTable percentageName="trust" [info]="orpInfo.relatedResearchResults.get(provenanceaction)"
[properties]=properties></tabTable>
</div>
</div>
</div>
@ -135,8 +136,8 @@
</a>
<div class="uk-accordion-content">
<div>
<tabTable [percentageName]="similarity" [info]="orpInfo.similarResearchResults"
[(properties)]=properties></tabTable>
<tabTable percentageName="similarity" [info]="orpInfo.similarResearchResults"
[properties]=properties></tabTable>
</div>
</div>
</li>
@ -148,7 +149,7 @@
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
[id]="orpId" [entityType]="'results'" [entity]="'Other Research Product'"
(metricsResults)="metricsResults($event)" [(properties)]=properties>
(metricsResults)="metricsResults($event)" [properties]=properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
@ -174,6 +175,53 @@
<div class="uk-width-large@m uk-width-1-1@s">
<div class=" uk-padding-small">
<button *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span> Link this product to...
</button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-text-center uk-margin-expand uk-padding-small uk-margin-auto default-dropdown "
uk-dropdown="mode:click" >
<div class="uk-grid uk-child-width-1-3 uk-width-large ">
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
>
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="album" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect height="1" width="10" x="5" y="2"></rect><rect
height="1" width="14" x="3" y="4"></rect><rect fill="none" height="11" stroke="#000"
width="17" x="1.5" y="6.5"></rect></svg></span>
</button>
<div>Projects</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="copy" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect fill="none" height="16" stroke="#000"
width="12" x="3.5" y="2.5"></rect><polyline
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
</button>
<div>Research results</div>
</a></div>
<div> <a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="users" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><circle cx="7.7" cy="8.6" fill="none" r="3.5"
stroke="#000" stroke-width="1.1"></circle><path
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3" fill="none"
stroke="#000" stroke-width="1.1"></path><path
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"
fill="none" stroke="#000" stroke-width="1.1"></path></svg></span>
</button>
<div>Communities</div>
</a></div>
</div>
</div>
<div>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis>
@ -214,103 +262,19 @@
<citeThis [result]="orpInfo" [id]="orpId" type="other research product"></citeThis>
</div>
</li>
</ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') "
class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none"
stroke="#000"
stroke-width="1.1"></path></svg>
</span> Link this product to...
</button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click"
style="background: transparent
!important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album"
ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14"
height="1"></rect><rect
fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="users"
ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6"
r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1"
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path
fill="none" stroke="#000" stroke-width="1.1"
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;"
title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy"
ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline
fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
<!-- Claiming FAB -->
<!--div class="uk-inline">
<div class=" uk-float-right " style="z-index: 200; bottom: 55px; position: fixed; right: 45%;">
<button class=" uk-button uk-button-danger ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span> Link this product to
</button>
<div uk-dropdown="pos: top-right; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Projects</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a>
</li>
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Communities</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[orpId,'orp','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div-->
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" class="uk-width-1-1"></helper>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle" >
<div uk-grid uk-grid>
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle">
<div uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div id="project" class="uk-container project">
@ -10,10 +10,9 @@
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div *ngIf="projectInfo != null" uk-grid class="uk-grid-large">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="projectInfo" [data]=projectInfo
[URL]="properties.baseLink+'/search/project?projectId='+projectId"
@ -43,12 +42,14 @@
</span>{{" "}}
<span
*ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && (projectInfo.openAccessMandateDatasets == undefined || !projectInfo.openAccessMandateDatasets)"
class="uk-label custom-label label-openaccessmandate " title="Open Access mandate for Publications">Open Access mandate for Publications</span>{{" "}}
class="uk-label custom-label label-openaccessmandate "
title="Open Access mandate for Publications">Open Access mandate for Publications</span>{{" "}}
<span *ngIf="projectInfo.specialClause39" class="uk-label custom-label label-sc39 "
title="Special Clause 39">Special Clause 39</span>{{" "}}
<span
*ngIf="projectInfo.openAccessMandateDatasets != undefined && projectInfo.openAccessMandateDatasets && (projectInfo.openAccessMandatePublications == undefined || !projectInfo.openAccessMandatePublications)"
class="uk-label custom-label label-openaccessmandate " title="Open Access mandate for Research Data">Open Access mandate for Research Data</span>{{" "}}
class="uk-label custom-label label-openaccessmandate "
title="Open Access mandate for Research Data">Open Access mandate for Research Data</span>{{" "}}
</div>
<ul class="uk-list">
<li *ngIf="projectInfo.funding"><span class="uk-text-bold">Funding:</span> {{projectInfo.funding}}</li>
@ -62,7 +63,8 @@
<li *ngIf="projectInfo.openAccessMandateDatasets != undefined && !projectInfo.openAccessMandateDatasets ">
<span class="uk-text-bold">Open Access mandate for Research Data:</span> no
</li>
<li *ngIf="projectInfo.organizations && projectInfo.organizations.length > 0"><span class="uk-text-bold">Organization:</span>
<li *ngIf="projectInfo.organizations && projectInfo.organizations.length > 0"><span
class="uk-text-bold">Organization:</span>
<span class="list-horizontal-line">
<span *ngFor="let organization of projectInfo.organizations let i=index"
@ -89,28 +91,6 @@
</li>
</ul>
<!-- <div class="uk-clearfix"><div class="uk-button-group uk-float-right uk-margin-top">
<button class="uk-button uk-button-small uk-button-action">
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="link" ratio="1"><path fill="none" stroke="#000" stroke-width="1.1" d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M7.925,11.875 L11.925,7.975"></path></svg></span>
Link this project to
</button>
<div class="uk-inline">
<button class="uk-button uk-button-small uk-button-action" type="button">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="triangle-down" ratio="1"><polygon points="5 7 15 7 10 12"></polygon></svg></span>
</button>
<div uk-dropdown="mode: click; boundary: ! .uk-button-group; boundary-align: true;"
class="uk-dropdown uk-dropdown-boundary uk-dropdown-bottom-left" style="top: 40px; left: -236.5px;">
<ul class="uk-nav uk-dropdown-nav uk-padding-small" >
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Other research results</a></li>
</ul>
</div>
</div>
</div></div> -->
<ul class="custom-accordion" uk-accordion>
<li (click)="activeTab='Publications'; searchPublicationsInit()">
@ -438,13 +418,51 @@
</div> -->
</div>
<div class="uk-width-large@m uk-width-1-1@s">
<div class="uk-card uk-card-default uk-padding-small">
<div *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-margin-small-bottom">
<button class=" uk-button portal-button uk-margin-small-top uk-width-1-1">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975"
fill="none" stroke="#000"
stroke-width="1.1"></path></svg>
</span> Link this project to...
</button>
<div class=" uk-text-center uk-margin-expand uk-padding-small uk-margin-auto default-dropdown "
uk-dropdown="mode:click">
<div class="uk-grid uk-child-width-1-3 uk-width-large ">
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="copy" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect fill="none" height="16" stroke="#000"
width="12" x="3.5" y="2.5"></rect><polyline
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
</button>
<div>Research results</div>
</a></div>
</div>
</div>
</div>
<div>
Share - Bookmark
<addThis></addThis>
</div>
<div class="uk-margin-medium-top uk-margin-medium-bottom">
<div class="uk-margin-medium-top uk-margin-medium-bottom uk-margin-medium-top">
<div class="uk-text-center uk-text-large">
Application Box
</div>
@ -473,7 +491,8 @@
class="widget-box uk-padding-small uk-card uk-card-default ">
<div
class=" uk-alert uk-alert-primary uk-padding-small uk-margin-remove-bottom uk-margin-right">
For further information please contact us <a href="mailto:helpdesk@openaire.eu">helpdesk@openaire.eu</a>
For further information please contact us <a
href="mailto:helpdesk@openaire.eu">helpdesk@openaire.eu</a>
</div>
<div class="uk-grid">
<a
@ -539,7 +558,8 @@
class="widget-box uk-padding-small uk-card uk-card-default ">
<div
class=" uk-alert uk-alert-primary uk-padding-small uk-margin-remove-bottom uk-margin-right">
For further information please contact us <a href="mailto:helpdesk@openaire.eu">helpdesk@openaire.eu</a>
For further information please contact us <a
href="mailto:helpdesk@openaire.eu">helpdesk@openaire.eu</a>
</div>
<div class="uk-grid">
<a
@ -591,79 +611,25 @@
</li>
</ul>
</div>
<button *ngIf="isRouteAvailable('participate/direct-claim') "
class=" uk-button portal-button uk-margin-small-top uk-width-1-1">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975"
fill="none" stroke="#000"
stroke-width="1.1"></path></svg>
</span> Link this project to...
</button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click"
style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;"
class=" uk-margin-remove-top uk-padding-small">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;"
title="<div class='tooltip-custom-font-size uk-margin-small'>Research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy"
ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline
fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
</div>
<!--metrics [pageViews]="pageViews" shortView=true
[id]="projectId" [entityType]="'projects'" [entity]="'Project'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics-->
</div>
<!--metrics [pageViews]="pageViews" shortView=true
[id]="projectId" [entityType]="'projects'" [entity]="'Project'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics-->
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
<modal-loading></modal-loading>
<modal-alert #AlertModalCsvError></modal-alert>
<!-- Claiming FAB -->
<!--div class="uk-inline">
<div class=" uk-float-right " style="z-index: 200; bottom: 55px; position: fixed; right: 45%;">
< !--a style="padding: 30px; box-shadow: 0 1px 10px #444444" class=" uk-icon-button uk-button-primary shadowBox" uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Link this publication to</div>">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="40" viewBox="0 0 20 20" height="40"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span>
</a- ->
<button class=" uk-button uk-button-danger ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span> Link this project to
</button>
<div uk-dropdown="pos: top-right; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light uk-margin-small'>Research results</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
</div>
</div>
</div-->
</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle" >
<div uk-grid uk-grid>
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle">
<div uk-grid >
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container publication">
@ -10,10 +10,11 @@
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" class="uk-width-1-1"></helper>
<div *ngIf="publicationInfo != null" uk-grid class="uk-grid-large">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="publicationInfo.record" [data]=publicationInfo.record
[URL]="properties.baseLink+'/search/publication?articleId='+articleId"></schema2jsonld>
@ -154,9 +155,9 @@
<div *ngFor="let provenanceaction of getKeys(publicationInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust"
<tabTable percentageName="trust"
[info]="publicationInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
[properties]=properties></tabTable>
</div>
</div>
</div>
@ -180,8 +181,8 @@
<div *ngIf="publicationInfo.similarResearchResults"> -->
<div>
<tabTable [percentageName]="similarity" [info]="publicationInfo.similarResearchResults"
[(properties)]=properties></tabTable>
<tabTable percentageName="similarity" [info]="publicationInfo.similarResearchResults"
[properties]=properties></tabTable>
</div>
</div>
</li>
@ -408,7 +409,7 @@
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
[id]="articleId" [entityType]="'results'" [entity]="'Publication'"
(metricsResults)="metricsResults($event)" [(properties)]=properties>
(metricsResults)="metricsResults($event)" [properties]=properties>
</metrics>
<!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame-->
<i-frame *ngIf="metricsClicked && totalViews>0"
@ -436,60 +437,8 @@
</div>
<div class="uk-width-large@m uk-width-1-1@s">
<div class=" uk-padding-small">
<div>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis>
</div>
<altmetrics *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.get('doi')"
id="{{publicationInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list uk-margin-remove-bottom">
<li *ngIf="publicationInfo.hostedBy_collectedFrom && publicationInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="publicationInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li
*ngIf="publicationInfo.fundedByProjects != undefined && publicationInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="publicationInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="publicationInfo.contexts && publicationInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of publicationInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</li>
<li>
<!--metrics [pageViews]="pageViews" shortView=true
[id]="articleId" [entityType]="'results'" [entity]="'Publication'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics-->
</li>
<li>
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this publication
</div>
<div class=" ">
<citeThis [result]="publicationInfo" [id]="articleId" type="publication"></citeThis>
</div>
</li>
</ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') "
class=" uk-button portal-button uk-width-1-1 ">
<div *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-padding-small">
<button class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
@ -502,51 +451,104 @@
</span> Link this publication to...
</button>
<div *ngIf="isRouteAvailable('participate/direct-claim')" class=" uk-margin-remove-top uk-padding-small"
uk-dropdown="pos: bottom-left; mode:click"
style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album"
ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14"
height="1"></rect><rect
fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<div class=" uk-text-center uk-margin-expand uk-padding-small uk-margin-auto default-dropdown "
uk-dropdown="mode:click">
<div class="uk-grid uk-child-width-1-3 uk-width-large ">
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
>
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="album" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect height="1" width="10" x="5" y="2"></rect><rect
height="1" width="14" x="3" y="4"></rect><rect fill="none" height="11" stroke="#000"
width="17" x="1.5" y="6.5"></rect></svg></span>
</button>
<div>Projects</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7"
cy="8.6" r="3.5"></circle><path fill="none" stroke="#000"
stroke-width="1.1"
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path
fill="none" stroke="#000" stroke-width="1.1"
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;"
title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12"
height="16"></rect><polyline fill="none" stroke="#000"
points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
<svg height="20" icon="copy" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect fill="none" height="16" stroke="#000"
width="12" x="3.5" y="2.5"></rect><polyline
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
</button>
<div>Research results</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="users" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><circle cx="7.7" cy="8.6" fill="none" r="3.5"
stroke="#000" stroke-width="1.1"></circle><path
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3" fill="none"
stroke="#000" stroke-width="1.1"></path><path
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"
fill="none" stroke="#000" stroke-width="1.1"></path></svg></span>
</button>
<div>Communities</div>
</a></div>
</div>
</div>
</div>
<div>
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">Share - Bookmark</div>
<addThis></addThis>
</div>
<altmetrics *ngIf="publicationInfo.identifiers && publicationInfo.identifiers.get('doi')"
id="{{publicationInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list uk-margin-remove-bottom">
<li *ngIf="publicationInfo.hostedBy_collectedFrom && publicationInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="publicationInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li
*ngIf="publicationInfo.fundedByProjects != undefined && publicationInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="publicationInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="publicationInfo.contexts && publicationInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of publicationInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</li>
<li>
<!--metrics [pageViews]="pageViews" shortView=true
[id]="articleId" [entityType]="'results'" [entity]="'Publication'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics-->
</li>
<li>
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this publication
</div>
<div class=" ">
<citeThis [result]="publicationInfo" [id]="articleId" type="publication"></citeThis>
</div>
</li>
</ul>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
@ -554,6 +556,13 @@
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" class="uk-width-1-1"></helper>
</div>
</div>
</div>
</div>

View File

@ -1,8 +1,8 @@
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle" >
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle">
<div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container software">
<div class="uk-container software">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
role="alert">{{warningMessage}}</div>
@ -11,10 +11,11 @@
<div [style.display]="showLoading ? 'inline' : 'none'"
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
class="loading-gif uk-align-center"></span></div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" class="uk-width-1-1"></helper>
<div *ngIf="softwareInfo != null" uk-grid class="uk-grid-large">
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']" styleName="uk-width-1-1"></helper>
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="softwareInfo.record" [data]=softwareInfo.record
[URL]="properties.baseLink+'/search/software?softwareId='+softwareId"></schema2jsonld>
@ -137,9 +138,9 @@
<div *ngFor="let provenanceaction of getKeys(softwareInfo.relatedResearchResults)">
<div class="uk-text-large">{{provenanceaction}}</div>
<tabTable [percentageName]="trust"
<tabTable percentageName="trust"
[info]="softwareInfo.relatedResearchResults.get(provenanceaction)"
[(properties)]=properties></tabTable>
[properties]=properties></tabTable>
</div>
</div>
</div>
@ -163,8 +164,8 @@
<div *ngIf="softwareInfo.similarResearchResults"> -->
<div>
<tabTable [percentageName]="similarity" [info]="softwareInfo.similarResearchResults"
[(properties)]=properties></tabTable>
<tabTable percentageName="similarity" [info]="softwareInfo.similarResearchResults"
[properties]=properties></tabTable>
</div>
</div>
</li>
@ -176,7 +177,7 @@
<div class="uk-accordion-content">
<metrics [pageViews]="pageViews"
[id]="softwareId" [entityType]="'results'" [entity]="'Software'"
(metricsResults)="metricsResults($event)" [(properties)]=properties>
(metricsResults)="metricsResults($event)" [properties]=properties>
</metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
@ -203,84 +204,8 @@
</div>
<div class="uk-width-large@m uk-width-1-1@s">
<div class=" uk-padding-small">
<div>
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
<addThis></addThis>
</div>
<altmetrics *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.get('doi')"
id="{{softwareInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list uk-margin-remove-bottom">
<li *ngIf="softwareInfo.hostedBy_collectedFrom && softwareInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="softwareInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="softwareInfo.fundedByProjects != undefined && softwareInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="softwareInfo.fundedByProjects"></fundedBy>
</li>
<li *ngIf="softwareInfo.contexts && softwareInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of softwareInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</li>
<!--li>
<metrics [pageViews]="pageViews" shortView=true
[id]="softwareId" [entityType]="'results'" [entity]="'Software'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics>
</li-->
<li>
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this software
</div>
<div class="">
<citeThis [result]="softwareInfo" [id]="softwareId" type="software"></citeThis>
</div>
</li>
<!--li>
<ul uk-accordion class="uk-padding-remove">
<li>
<button class="uk-button uk-button-primary uk-accordion-title link-to-button uk-width-1-1" type="button">
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="link" ratio="1"><path fill="none" stroke="#000" stroke-width="1.1" d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M7.925,11.875 L11.925,7.975"></path></svg></span>
<span class="uk-margin-right">Link this software to</span>
</button>
<div class="uk-accordion-content">
<ul class="uk-nav uk-dropdown-nav uk-padding-small" >
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Projects</a></li>
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Communities</a></li>
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Other research results</a></li>
</ul>
</div>
</li>
</ul>
</li-->
</ul>
<button *ngIf="isRouteAvailable('participate/direct-claim') "
class=" uk-button portal-button uk-width-1-1 ">
<div *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-padding-small">
<button class=" uk-button portal-button uk-width-1-1 ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
height="25"><path
@ -292,95 +217,131 @@
stroke-width="1.1"></path></svg>
</span> Link this software to...
</button>
<div *ngIf="isRouteAvailable('participate/direct-claim') " uk-dropdown="pos: bottom-left; mode:click"
style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Projects</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album"
ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14"
height="1"></rect><rect
fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;" title="<div class='tooltip-custom-font-size '>Communities</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7"
cy="8.6" r="3.5"></circle><path fill="none" stroke="#000"
stroke-width="1.1"
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path
fill="none" stroke="#000" stroke-width="1.1"
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:right;"
title="<div class='tooltip-custom-font-size uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button portal-button shadowBox" style="padding: 6px;"
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy"
ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline
fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
</ul>
<div class=" uk-text-center uk-margin-expand uk-padding-small uk-margin-auto default-dropdown "
uk-dropdown="mode:click">
<div class="uk-grid uk-child-width-1-3 uk-width-large ">
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
>
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="album" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect height="1" width="10" x="5" y="2"></rect><rect
height="1" width="14" x="3" y="4"></rect><rect fill="none" height="11" stroke="#000"
width="17" x="1.5" y="6.5"></rect></svg></span>
</button>
<div>Projects</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="copy" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect fill="none" height="16" stroke="#000"
width="12" x="3.5" y="2.5"></rect><polyline
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
</button>
<div>Research results</div>
</a></div>
<div><a
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="users" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><circle cx="7.7" cy="8.6" fill="none" r="3.5"
stroke="#000" stroke-width="1.1"></circle><path
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3" fill="none"
stroke="#000" stroke-width="1.1"></path><path
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"
fill="none" stroke="#000" stroke-width="1.1"></path></svg></span>
</button>
<div>Communities</div>
</a></div>
</div>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
<!-- Claiming FAB -->
<div class="uk-inline">
<div class=" uk-float-right " style="z-index: 200; bottom: 55px; position: fixed; right: 45%;">
<!--a style="padding: 30px; box-shadow: 0 1px 10px #444444" class=" uk-icon-button uk-button-primary shadowBox" uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Link this publication to</div>">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="40" viewBox="0 0 20 20" height="40"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span>
</a-->
<!-- <button class=" uk-button uk-button-danger ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span> Link this software to
</button>
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">Share - Bookmark</div>
<addThis></addThis>
<div uk-dropdown="pos: top-right; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">
<ul class="uk-iconnav uk-iconnav-vertical">
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Projects</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="album" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
</a>
</li>
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light '>Communities</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="users" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg></span>
</a>
</li>
<li uk-tooltip="pos:left;" title="<div class='tooltip-custom-font-size uk-light uk-margin-small'>Other research results</div>">
<a class=" uk-icon-button uk-button-primary shadowBox" style="padding: 6px;" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>
</a>
</li>
<altmetrics *ngIf="softwareInfo.identifiers && softwareInfo.identifiers.get('doi')"
id="{{softwareInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list uk-margin-remove-bottom">
</ul>
</div> -->
<li *ngIf="softwareInfo.hostedBy_collectedFrom && softwareInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="softwareInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="softwareInfo.fundedByProjects != undefined && softwareInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="softwareInfo.fundedByProjects"></fundedBy>
</li>
</div>
<li *ngIf="softwareInfo.contexts && softwareInfo.contexts.length >0 ">
<dl class="uk-description-list-line">
<dt class="sideInfoTitle">Related to</dt>
<dd class="line" *ngFor="let item of softwareInfo.contexts">
<span *ngIf="!item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</span>
<mark *ngIf="item['inline']">
<span>{{item['labelContext']}}</span>
<span *ngIf="item['labelCategory']">-> {{item['labelCategory']}}</span>
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
</mark>
</dd>
</dl>
</li>
<!--li>
<metrics [pageViews]="pageViews" shortView=true
[id]="softwareId" [entityType]="'results'" [entity]="'Software'"
(metricsResults)="metricsResults($event)" [(properties)] = properties>
</metrics>
</li-->
<li>
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
Cite this software
</div>
<div class="">
<citeThis [result]="softwareInfo" [id]="softwareId" type="software"></citeThis>
</div>
</li>
<!--li>
<ul uk-accordion class="uk-padding-remove">
<li>
<button class="uk-button uk-button-primary uk-accordion-title link-to-button uk-width-1-1" type="button">
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="link" ratio="1"><path fill="none" stroke="#000" stroke-width="1.1" d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M7.925,11.875 L11.925,7.975"></path></svg></span>
<span class="uk-margin-right">Link this software to</span>
</button>
<div class="uk-accordion-content">
<ul class="uk-nav uk-dropdown-nav uk-padding-small" >
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Projects</a></li>
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Communities</a></li>
<li><a class="uk-width-1-1" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[softwareId,'software','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" >
Other research results</a></li>
</ul>
</div>
</li>
</ul>
</li-->
</ul>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div>
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
import {Component, ElementRef, Input} from '@angular/core';
import {Component, Input} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
@ -55,7 +55,7 @@ export class UserComponent {
this.loggedIn = Session.isLoggedIn();
this.user = Session.getUser();
this.errorMessage = "";
if(this.loggedIn){
if(this.loggedIn && this.errorCode == '1'){
this.redirect();
}
});

View File

@ -29,7 +29,7 @@ export class SearchProjectsService {
}
url += "&page="+(page-1)+"&size="+size + "&format=json";
console.log(url)
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
//.map(res => <any> res.json())
.pipe(map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "project")]));
@ -195,13 +195,28 @@ export class SearchProjectsService {
}
}
}*/
let fundingLength = Array.isArray(resData['fundingtree']) ? resData['fundingtree'].length : 1;
for(let z=0; z<fundingLength; z++) {
let fundingData = Array.isArray(resData['fundingtree']) ? resData['fundingtree'][z] : resData['fundingtree'];
if(fundingData.hasOwnProperty("funder")) {
result['funderShortname'] = fundingData['funder'].shortname;
result['funderId'] = fundingData['funder'].id;
result['jurisdiction'] = (fundingData['funder']['id']['jurisdiction'] )?fundingData['funder']['id']['jurisdiction']:"";
if(fundingData['funding_level_2']){
result['fundingLevel0'] = (fundingData['funding_level_2'] && fundingData['funding_level_2']['parent'] &&
fundingData['funding_level_2']['parent']['funding_level_1'] && fundingData['funding_level_2']['parent']['funding_level_1']['parent']
&& fundingData['funding_level_2']['parent']['funding_level_1']['parent']['funding_level_0'])?
fundingData['funding_level_2']['parent']['funding_level_1']['parent']['funding_level_0']['name']:"";
}else if(fundingData['funding_level_1']){
result['fundingLevel0'] = (fundingData['funding_level_1'] && fundingData['funding_level_1']['parent'] && fundingData['funding_level_1']['parent']['funding_level_0'])?
fundingData['funding_level_1']['parent']['funding_level_0']['name']:"";
}else if(fundingData['funding_level_0']){
result['fundingLevel0'] = (fundingData['funding_level_0'] )?fundingData['funding_level_0']['name']:"";
}else {
result['fundingLevel0']="";
}
break;
}
}

View File

@ -0,0 +1,22 @@
import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {EnvProperties} from './properties/env-properties';
@Injectable()
export class IndexInfoService {
constructor(private http: HttpClient) {
}
// http://beta.services.openaire.eu/openaire/info/lastLoadDate
// the date when the mining results currently in the public index have been generated: http://beta.services.openaire.eu/openaire/info/lastMiningDate
getLastIndexDate(properties: EnvProperties): any {
let url = properties.indexInfoAPI + "lastLoadDate";
return this.http.get(url);
}
}

View File

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {IndexInfoService} from './indexInfo.service';
@NgModule({
imports: [
CommonModule, FormsModule,
],
declarations: [
],
providers: [ IndexInfoService ],
exports: [
]
})
export class IndexInfoServiceModule{ }

View File

@ -10,7 +10,7 @@ import {Component, ViewEncapsulation, ComponentRef, ElementRef, Input, EventEmit
<div class="uk-modal-body">
<div >
<h3 class="text-center" >{{message}}</h3>
<h4 class="text-center" >{{message}}</h4>
<div class="uk-modal-spinner"></div>
</div>
</div>

View File

@ -148,4 +148,7 @@ export class EnvProperties {
// contact us recipients
admins;
lastIndexUpdate:string;
indexInfoAPI:string;
}

View File

@ -130,5 +130,9 @@ export class StringUtils{
else
return false;
}
public static sliceString(mystr, size: number): string {
const sliced = String(mystr).substr(0, size);
return sliced + (String(mystr).length > size ? '...' : '');
}
}