move claim pages to folder claimPages, add myClaims page, loading/ waiting messages, after insert go to mypages, more layout changes in linking

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@43060 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2016-06-29 13:05:31 +00:00
parent ed65181226
commit 4fcfae8acb
23 changed files with 1059 additions and 270 deletions

View File

@ -2,12 +2,12 @@ import {Component, Directive, ElementRef, Renderer} from '@angular/core';
import {RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated';
import {Http} from '@angular/http';
import {SearchComponent} from './search/search.component';
import {ClaimComponent} from './claim/claim.component';
import {ClaimsComponent} from './claims/claims.component';
import {ClaimComponent} from './claimPages/claim/claim.component';
import {ClaimsAdminComponent} from './claimPages/claims/claimsAdmin.component';
import {HomeComponent} from './home/home.component';
//import {Demo} from './home/demo.component';
import {LinkingComponent} from './linking/linking.component';
import {LinkingHomeComponent} from './linking/linkingHome.component';
import {LinkingComponent} from './claimPages/linking/linking.component';
import {LinkingHomeComponent} from './claimPages/linking/linkingHome.component';
import {MyClaimsComponent} from './claimPages/myClaims/myClaims.component';
import 'rxjs/Rx';
@ -45,6 +45,7 @@ import 'rxjs/Rx';
<li><a [routerLink]=" ['/Claims']">Claims</a></li>
<li><a [routerLink]=" ['/Linking']">Linking</a></li>
<li><a [routerLink]=" ['/Home']">Home</a></li>
<li><a [routerLink]=" ['/MyClaims']">My claims</a></li>
</ul>
@ -56,7 +57,6 @@ import 'rxjs/Rx';
<router-outlet></router-outlet>
</main>
</div>
`
})
@ -64,19 +64,25 @@ import 'rxjs/Rx';
{ path: '/', component: HomeComponent, name: 'Home', useAsDefault: true },
{ path: '/home', component: HomeComponent, name: 'Home' },
// { path: '/demo', component: Demo, name: 'Demo' },
{ path: '/claims', component: ClaimsComponent, name: 'Claims' },
{ path: '/claims', component: ClaimsAdminComponent, name: 'Claims' },
{ path: '/claim', component: ClaimComponent, name: 'Claim' },
{ path: '/search', component: SearchComponent, name: 'Search' },
{ path: '/linking', component: LinkingComponent, name: 'Linking' }
// { path: '/upload', component: BasicProgressbar, name: 'Upload' },
{ path: '/linking', component: LinkingComponent, name: 'Linking' },
{ path: '/my-claims', component: MyClaimsComponent, name: 'MyClaims' }
])
export class App {
name: string = 'Angular 2';
data = {};
server;
constructor(public http: Http ) {
console.info('App constructor');
}
ngOnInit() {
console.info('App init');
setTimeout(() => {

View File

@ -0,0 +1,178 @@
import {Component, Input} from '@angular/core';
import {JSONP_PROVIDERS} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import { RouteParams, RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated';
// import {ClaimsComponent} from '../claims/claims.component';
@Component({
selector: 'linking',
directives: [ROUTER_DIRECTIVES ],
template: `
<div class="container">
<div class="page-header">
<h1>Bulk Claim Linking</h1>
</div>
<linking-home *ngIf=" show == 'home' " (linkTypeChange)="linkTypeChange($event)" ></linking-home>
<div *ngIf=" show != 'home' && show != 'myclaims' " >
<ol *ngIf=" show != 'myclaims' " class="breadcrumb">
<li *ngIf="linkType == 'project'" [class]="(show == 'project' )?'active':''"><a *ngIf="show != 'project'" (click)="showChangedType('project')" >Project</a><span *ngIf="show == 'project'">Project</span></li>
<li *ngIf="linkType == 'context'" [class]="(show == 'context' )?'active':''"><a *ngIf="show != 'context'" (click)="showChangedType('context')" >Context</a><span *ngIf="show == 'context'">Context</span></li>
<li *ngIf="linkType == 'software'" [class]="(show == 'software' )?'active':''"><a *ngIf="show != 'software'" (click)="showChangedType('software')" >Software</a><span *ngIf="show == 'software'">Software</span> </li>
<li [class]="(show == 'result' || show == 'publication' || show == 'dataset')?'active':''"><a *ngIf="show != 'result' && show != 'publication' && show != 'dataset'" (click)="showChangedType('result')" >Research Result</a><span *ngIf="show == 'result' || show == 'publication' || show == 'dataset'">Research Result</span></li>
<li [class]="(show == 'claim' )?'active':''"><span *ngIf="show == 'claim'">Link</span><a *ngIf="show != 'claim'" (click)="showChangedType('claim')">Link</a> </li>
</ol>
<div *ngIf=" show != 'claim' && show != 'myclaims'" class="row" >
<div class="col-sm-6">
<div *ngIf=" show=='result' " >
<claim-result [selectedDatasets]="datasets" [selectedPublications]="publications" (datasetsChange)="datasetsChange($event)" (publicationsChange)="publicationsChange($event)" > </claim-result>
</div>
<div *ngIf=" show=='project' " >
<claim-projects [selectedProjects]="projects" (projectsChange)="projectsChange($event)" > </claim-projects>
</div>
<div *ngIf=" show=='software' " >
<p>TODO software</p>
</div>
<div *ngIf=" show == 'context'" >
<claim-contexts [selectedList]="contexts" (contextsChange)="contextsChange($event)" > </claim-contexts>
</div>
</div>
<div class="col-sm-6">
<claim-selected [contexts]="contexts" [publications]="publications" [datasets]="datasets" [projects]="projects" [show]="show"
(projectsChange)="projectsChange($event)" (contextsChange)="contextsChange($event)" (datasetsChange)="datasetsChange($event)"
(publicationsChange)="publicationsChange($event)" (showChange)="showChange($event)" > </claim-selected>
</div>
</div>
<div *ngIf=" show == 'claim'" >
<claim-selected [contexts]="contexts" [publications]="publications" [datasets]="datasets" [projects]="projects" [show]="show" (showChange)="showChange($event)" [showAccessRights]="'true'" > </claim-selected>
<claim-insert [contexts]="contexts" [publications]="publications" [datasets]="datasets" [projects]="projects" [show] = "show" (showChange)="showChange($event)"></claim-insert>
</div>
<nav>
<ul *ngIf="show != 'home'" class="pager">
<li class="previous" (click)="prev()"><a ><span aria-hidden="true">&larr;</span> Previous</a></li>
<li class="next" *ngIf="show != 'claim'" (click)="next()" ><a >Next <span aria-hidden="true">&rarr;</span></a></li>
</ul>
</nav>
</div>
</div>
`
})
//[(ngModel)]="date"
export class LinkingComponent {
constructor ( private _router: Router ) {
}
sourceType:string;
targetType:string;
step:number = 1;
contexts=[];
projects=[];
publications=[];
datasets=[];
show = "home";
searchType="publication"; //publication or dataset
date='8-6-2016';
keyword: string = "";
linkType:string ="project"; // link type (selected in home page) : project, context, software, etc
ngOnInit() {
}
next(){
if((this.show == 'project' || this.show == 'context' || this.show == 'software')){
this.show='result';
}else if((this.show == 'result' && this.keyword == '')||(this.show == 'dataset' || this.show == 'publication')){
this.show='claim';
// }else if(this.show == 'result' ){
// if(this.searchType == 'publication' ){
// this.show="publication";
// }else{
// this.show="dataset";
// }
}
}
prev(){
if(this.show == 'result'){
this.show = this.linkType;
// if(this.linkType == 'project'){
// this.show='project';
// }else if(this.linkType == 'context'){
// this.show='context';
// }else if(this.linkType == 'software'){
// this.show='software';
// }else{
// this.show='home';
//
// }
}else if(this.show == 'context' || this.show == 'project' || this.show == 'software' ){
this.show='home';
// }else if(this.show == 'dataset' || this.show == 'publication'){
// this.show='result';
} else if(this.show == 'claim'){
this.show='result';
}
}
goto(term: string) {
this._router.navigate( ['Search', { keyword: term }] );
}
search() {
if(this.searchType == 'publication' ){
this.show="publication";
}else{
this.show="dataset";
}
}
sourceTypeChange($event) {
this.sourceType=$event.value;
console.log($event.value);
}
targetTypeChange($event) {
this.targetType=$event.value;
console.log($event.value);
}
contextsChange($event) {
this.contexts=$event.value;
console.log($event.value);
}
publicationsChange($event) {
this.publications=$event.value;
}
datasetsChange($event) {
this.datasets=$event.value;
}
projectsChange($event) {
this.projects=$event.value;
}
typeChanged(type:string) {
this.searchType = type;
}
linkTypeChange($event) {
this.linkType =$event.value;
this.show=$event.value;
}
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;
}
}
}

View File

@ -3,12 +3,12 @@ import {JSONP_PROVIDERS} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import { RouteParams, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
import {ClaimsService} from '../services/claims.service';
import {Claim} from '../entities/claim';
import {ClaimsService} from '../../services/claims.service';
import {Claim} from '../../entities/claim';
@Component({
selector: 'claim',
templateUrl: 'src/app/claim/claim.component.html',
templateUrl: 'src/app/claimPages/claim/claim.component.html',
providers:[ ClaimsService, JSONP_PROVIDERS, ...ROUTER_DIRECTIVES]
})

View File

@ -1,7 +1,5 @@
<div class="container">
<div class="page-header">
<h1>Claims Administration</h1>
</div>
<!-- KI
<h3>Filter claims by type:</h3>
@ -16,14 +14,8 @@
<!--<div class="col-md-4">
<input type="text" #listFilter (keyup)="0" />
</div>-->
<!-- KI
<div>
<div *ngIf="selected.length>0">
<p>You have selected {{selected.length}} claim(s)</p>
</div>
<button class="btn btn-default" (click)="selectAll()">Select All</button> <button class="btn btn-default" (click)="deselectAll()">Deselect All</button> <button class="btn btn-default" (click)="confirmOpen()">Delete</button>
</div>
-->
<!-- KI-->
<div class="row row-offcanvas row-offcanvas-right">
<div class="col-xs-12 col-sm-3">
<div class="panel panel-default">
@ -52,36 +44,46 @@
<div class="col-xs-6 col-sm-9 sidebar-offcanvas" id="sidebar">
<h4 *ngIf="resultsNum>0" >Showing {{(size*page - size +1)}} to {{(size*page>resultsNum)?resultsNum:(size*page)}} of {{resultsNum}} claims</h4>
<p class="text-right" *ngIf="resultsNum>size*page">Show
<select [(ngModel)]="size" (ngModelChange)="goTo()">
<option *ngIf="resultsNum > 10" [ngValue]="10">10</option>
<option *ngIf="resultsNum > 20" [ngValue]="20">20</option>
<option *ngIf="resultsNum > 30" [ngValue]="30">30</option>
<option *ngIf="resultsNum > 50" [ngValue]="50">50</option>
</select>
per page
</p>
<div *ngIf="resultsNum>size*page " class="text-right">
<span class="dropdown">
Show <button class="btn btn-default dropdown-toggle" type="button" id="pagingDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
{{size}}
</button>
<ul class="dropdown-menu" aria-labelledby="pagingDropdown">
<li *ngIf="resultsNum > 10" ><a (click)="size=10 " >10 </a></li>
<li *ngIf="resultsNum > 20" ><a (click)="size = 20 " >20 </a></li>
<li *ngIf="resultsNum > 30" ><a (click)="size = 30 " >30 </a></li>
<li *ngIf="resultsNum > 50" ><a (click)="size = 50 " >50 </a></li>
</ul>
</span>
</div>
<div class="text-right" *ngIf="resultsNum">
<paging [currentPage]="page" [totalResults]="resultsNum" [navigateTo]="navigateTo" [size]="size" [params]="getParameters()" > </paging>
<!--<paging [currentPage]="page" [totalResults]="resultsNum" [navigateTo]="navigateTo" [size]="size" [params]="getParameters()" > </paging>-->
<paging-no-load [currentPage]="page" [totalResults]="resultsNum" [navigateTo]="navigateTo" [params]="getParameters()" [size]="size" (pageChange)="pageChange($event)"> </paging-no-load>
</div>
<!-- Buttons for selecting and Delete Claims -->
<div *ngIf="enableDelete">
<div *ngIf="selected.length>0 && resultsNum > 0 ">
<div class = "alert alert-success " >
You have selected {{selected.length}} claim(s)
</div>
</div>
<button class="btn btn-default" (click)="selectAll()">Select All</button> <button class="btn btn-default" (click)="deselectAll()">Deselect All</button> <button class="btn btn-default" (click)="confirmOpen()">Delete</button>
</div>
<p *ngIf="resultsNum == 0" >No entries found.</p>
<div *ngIf=" claims && claims.length == 0" class = "alert alert-info " >No entries found.</div>
<div>
</div>
<div class="">
<table *ngIf="claims" class="table table-striped">
<table *ngIf="claims && claims.length > 0" class="table table-striped">
<thead>
<tr>
<th></th>
<th *ngIf="enableDelete"></th>
<!--<th>Id</th>
<th>Source type</th> -->
<th><a (click)="changeOrderby('source')" >Source</a> </th>
<!-- <th>Target Type</th> -->
<th><a (click)="changeOrderby('target')" >Target</a> </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>
<th><a (click)="changeOrderby('user')" >Claimed by</a> </th>
<th><a (click)="changeOrderby('date')"> Claimed Date</a></th>
</tr>
@ -89,12 +91,12 @@
<tbody>
<!--<tr *ngFor="let claim of claims | claimTextFilter:textFilter | claimTypeFilter:publicationCB:datasetCB:projectCB:contextCB " >-->
<tr *ngFor="let claim of claims " >
<td><input [id]="claim.id" type="checkbox" (click)="select(claim,$event)" [ngModel]="selectAllClaims"/></td>
<td *ngIf="enableDelete"><input [id]="claim.id" type="checkbox" (click)="select(claim,$event)" [ngModel]="selectAllClaims"/></td>
<!--<td><a (click)="goToClaim((claim.id))">{{claim.id}}</a></td>
<td>{{claim.sourceType}}</td> -->
<td><claim-entity [entity]="claim.source" [type]="claim.sourceType" > </claim-entity></td>
<!--<td>{{claim.targetType}}</td> -->
<td><claim-entity [entity]="claim.target" [type]="claim.targetType" > </claim-entity></td>
<!-- <td>{{claim.sourceType}}</td> -->
<td><claim-entity [entity]="claim.source" [type]="claim.sourceType" > </claim-entity></td>
<td>{{claim.userMail}}</td>
<td>{{claim.date}}</td>
</tr>
@ -105,3 +107,4 @@
</div>
<alert (alertOutput)="confirmClose($event)">
</alert>
<loading [message]= "'Please wait...'"></loading>

View File

@ -1,60 +1,79 @@
import {Component, ViewChild} from '@angular/core';
import {Component, ViewChild, Input} from '@angular/core';
import {JSONP_PROVIDERS} from '@angular/http';
import {Location} from '@angular/common';
import {Observable} from 'rxjs/Observable';
import { RouteParams, RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated';
import {ClaimsService} from '../services/claims.service';
import {Claim} from '../entities/claim';
import {ClaimTextFilterPipe} from '../pipes/claimTextFilter.pipe';
import {ClaimTypeFilterPipe} from '../pipes/claimTypeFilter.pipe';
import {PagingFormatter} from '../common/pagingFormatter.component';
import {ClaimEntityFormatter} from '../common/claimEntityFormatter.component';
import {Alert} from '../common/modal/alert';
import {ClaimsService} from '../../services/claims.service';
import {Claim} from '../../entities/claim';
import {ClaimTextFilterPipe} from '../../pipes/claimTextFilter.pipe';
import {ClaimTypeFilterPipe} from '../../pipes/claimTypeFilter.pipe';
import {PagingFormatter} from '../../common/pagingFormatter.component';
import {pagingFormatterNoLoad} from '../../common/pagingFormatterNoLoad.component';
import {ClaimEntityFormatter} from '../../common/claimEntityFormatter.component';
import {Alert} from '../../common/modal/alert';
import {Loading} from '../../common/modal/loading.component';
@Component({
selector: 'claims',
directives: [...ROUTER_DIRECTIVES, PagingFormatter, ClaimEntityFormatter, Alert],
templateUrl: 'src/app/claims/claims.component.html',
directives: [...ROUTER_DIRECTIVES, PagingFormatter, pagingFormatterNoLoad, ClaimEntityFormatter, Alert, Loading],
templateUrl: 'src/app/claimPages/claims/claims.component.html',
providers:[ ClaimsService, JSONP_PROVIDERS],
pipes: [ClaimTextFilterPipe, ClaimTypeFilterPipe]
})
export class ClaimsComponent {
constructor (private _claimService: ClaimsService, private _routeParams: RouteParams, private _router:Router) {}
constructor (private _claimService: ClaimsService, private _routeParams: RouteParams, private _router:Router, private location: Location) {
}
ngOnInit() {
console.info(this.isAdmin+" "+this.myClaims+" Fetch by: "+this.fetchBy+" Fetch id: "+this.fetchId);
if(this.isAdmin =='true' ){
console.info("Is admin");
console.info(this.isAdmin);
this.fetchBy = this._routeParams.get('fetchBy');
this.fetchBy = (this.types.indexOf(this.fetchBy) != -1)? this.fetchBy:'All';
this.fetchId = this._routeParams.get('fetchId');
console.info("Fetch by:"+this.fetchBy+"Fetch id:"+this.fetchId);
this.fetchId=this.fetchId?this.fetchId:'';
}else if( this.myClaims == 'true' ){
console.info("Is myclaims");
this.fetchBy = "User";
}
console.info(this.isAdmin+" "+this.myClaims+" Fetch by: "+this.fetchBy+" Fetch id: "+this.fetchId);
let page = +this._routeParams.get('page');
let size = +this._routeParams.get('size');
this.keyword = (this._routeParams.get('keyword')?this._routeParams.get('keyword'):"");
this.inputkeyword = this.keyword;
this.page = ( page <= 0 ) ? 1 : page;
this.size = ( size <= 0 ) ? 10 : size;
this.fetchBy = this._routeParams.get('fetchBy');
this.fetchBy = (this.types.indexOf(this.fetchBy) != -1)? this.fetchBy:'All';
this.fetchId = this._routeParams.get('fetchId');
console.info("Fetch by:"+this.fetchBy+"Fetch id:"+this.fetchId);
this.fetchId=this.fetchId?this.fetchId:'';
this.params= { page: this.page, size: this.size,fetchBy: this.fetchBy, fetchId:this.fetchId };
this.entityTypes = (this._routeParams.get('types')?this._routeParams.get('types'):'');
this.setTypes(); // check the appropriate checkboxes
this.setSortby(this._routeParams.get('sort'));
this.getClaims();
}
//string because comes as input from component directive
@Input() enableDelete: string = 'false';
@Input() myClaims: string= 'false' ;
@Input() isAdmin:string = 'false';
page : number;
size:number;
keyword:string; // the keyword string to give to the request as parameter
inputkeyword:string; // the string written in the input field (keyword=inputkeyword when its length is bigger than 3 and the user stops typing)
lengths = [10,20,30,50];
types = ["All","Project","Context","Result","User"];
fetchBy:string;
fetchId:string;
@Input() fetchBy:string;
@Input() fetchId:string;
navigateTo: string = "Claims";
resultsNum: number ;
claims: string[];
@ViewChild (Loading) loading : Loading ;
//checkboxes:
publicationCB = false;
@ -69,13 +88,17 @@ export class ClaimsComponent {
selected=[];
selectAllClaims:boolean = false;
//params for pagingFormatter to use when navigate to page
params;
@ViewChild(Alert) alert;
claimsDeleted:number = 0;
getClaims () {
this.selectAllClaims = false;
this.selected=[];
if(this.fetchBy =="Project" ){
this._claimService.getClaimsByProject(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, this.entityTypes).subscribe(
data => {
@ -126,17 +149,32 @@ export class ClaimsComponent {
goToClaim(claimId: number){
this._router.navigate( ['Claim', { id: claimId}] );
}
goTo(){
goTo(page:number = 1){
this.page = 1;
this.page = page;
this.location.go(location.pathname,this.getParametersString());
this.getClaims();
// console.info("In goto - params( page:"+params.page+", size: "+params.size+", fetchId:"+params.fetchId);
this._router.navigate( [this.navigateTo,this.getParameters()] );
//this._router.navigate( [this.navigateTo,this.getParameters()] );
}
getParameters(){
let params={ page: this.page, size: this.size, types: this.entityTypes, fetchBy: this.fetchBy, fetchId:this.fetchId, keyword : this.keyword, sort: this.getSortby() };
return params;
}
getParametersString(){
var params='';
params+=(this.page==1?"":(params.length>0?'&':'')+"page="+this.page);
params+=(this.size==10?"":(params.length>0?'&':'')+"size="+this.size);
params+=(this.entityTypes==''?"":(params.length>0?'&':'')+"types="+this.entityTypes);
if(this.isAdmin === 'true'){
params+=(this.fetchBy=='All'?"":(params.length>0?'&':'')+"fetchBy="+this.fetchBy);
params+=(this.fetchId==''?"":(params.length>0?'&':'')+"fetchId="+this.fetchId);
}
params+=(this. getSortby()=='datedesc'?"":(params.length>0?'&':'')+"sort="+this. getSortby());
params+=(this.keyword==''?"":(params.length>0?'&':'')+"keyword="+this.keyword);
return params;
}
changeLength(){
this.goTo();
}
@ -295,6 +333,8 @@ export class ClaimsComponent {
this.delete();
}
delete(){
this.loading.open();
this.claimsDeleted = 0;
for (var i = 0; i < this.selected.length; i++){
var id =this.selected[i].id;
var selected =this.selected[i].id;
@ -320,9 +360,17 @@ export class ClaimsComponent {
}
}
//TODO should call getClaims???
this.claimsDeleted++;
this.claims = newClaims;
if(this.claimsDeleted == this.selected.length){
this.loading.close();
}
});
}
pageChange($event) {
var page:number = +$event.value
this.goTo(page);
}
}

View File

@ -0,0 +1,49 @@
import {Component, ViewChild, Input} from '@angular/core';
import {JSONP_PROVIDERS} from '@angular/http';
import {Location} from '@angular/common';
import {Observable} from 'rxjs/Observable';
import { RouteParams, RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated';
import {ClaimsService} from '../../services/claims.service';
import {Claim} from '../../entities/claim';
import {ClaimTextFilterPipe} from '../../pipes/claimTextFilter.pipe';
import {ClaimTypeFilterPipe} from '../../pipes/claimTypeFilter.pipe';
import {PagingFormatter} from '../../common/pagingFormatter.component';
import {pagingFormatterNoLoad} from '../../common/pagingFormatterNoLoad.component';
import {ClaimEntityFormatter} from '../../common/claimEntityFormatter.component';
import {Alert} from '../../common/modal/alert';
import {Loading} from '../../common/modal/loading.component';
import {ClaimsComponent} from './claims.component';
@Component({
selector: 'claims',
directives: [...ROUTER_DIRECTIVES , ClaimsComponent],
template: `
<div *ngIf="user" class="container">
<div class="page-header">
<h1> Claims Administrator </h1>
</div>
<div>
<div class="text-right"><a [routerLink]=" ['/Linking']">Add more Links?</a></div>
<claims enableDelete="true" myClaims="false" isAdim="true"></claims>
</div>
</div>
<div *ngIf="!user" class="container">
TODO login
</div>
`,
})
export class ClaimsAdminComponent {
constructor ( ) {
}
user:string="argirok@di.uoa.gr";
ngOnInit() {
}
}

View File

@ -2,7 +2,7 @@ import {Component, Input,Output, ElementRef, EventEmitter} from '@angular/core';
import {JSONP_PROVIDERS} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import { RouteParams, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
import {ContextsService} from '../../services/contexts.service';
import {ContextsService} from '../../../services/contexts.service';
@Component({

View File

@ -0,0 +1,154 @@
import {Component, Input,Output, ElementRef, EventEmitter} from '@angular/core';
import {JSONP_PROVIDERS} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import { RouteParams, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
import {OpenaireProjectsService} from '../../services/openaireProjects.service';
// import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
/*
<div class="container" >
<div class="input-field col s12">
</div>
*/
@Component({
selector: 'claim-projects',
template: `
<div class="container" >
<div class="funder col s12">
<h3>Select Funder:</h3>
<!-- <select [(ngModel)]="selectedFunderId" (ngModelChange)="funderChanged()" >
<option [ngValue]="'0'">Funder:</option>
<option *ngFor="let funder of funders" [ngValue]="funder.field.field[1]['@value_original']">{{funder.field.field[1]['@value']}}</option>
</select> -->
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
{{selectedFunderName}}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li (click)="funderChanged('0','Select funder:')"><a >Select funder:</a></li>
<li *ngFor="let funder of funders" (click)="funderChanged(funder.field.field[1]['@value_original'],funder.field.field[1]['@value'])" ><a >{{funder.field.field[1]['@value']}}</a></li>
</ul>
</div>
</div>
<div class="projects col s12" *ngIf="this.selectedFunderId == '0'" >
Tessst
<h4>Select projects:</h4>
<input id="community" type="text" class="validate filter-input" [(ngModel)]=query (keyup)=filter() >
<!--<md-input class="demo-full-width" placeholder="Search for Project" ></md-input> -->
<div class="suggestions" *ngIf="filteredList.length > 0">
<ul class="list-group" >
<li *ngFor=" let item of filteredList" class="list-group-item" >
<a (click)="select(item)"> {{item.field[1]['@value']}}- {{item.field[3]['@value']}}</a>
</li>
</ul>
</div>
<div class="selections" *ngIf="selectedProjects.length > 0">
<label for="selecteditems">Selected: </label>
<ul id ="selecteditems" class="nav nav-pills" >
<li *ngFor="let item of selectedProjects" role="presentation" (click)="remove(item)">{{item.projectAcronym}} - {{item.projectName}} <span class="badge">X</span>
</li>
</ul>
</div>
</div>
</div>
`,
providers:[ OpenaireProjectsService ],
// directives: [MD_INPUT_DIRECTIVES]
})
export class ClaimProjectsComponent {
ngOnInit() {
console.info("Claim projects - init ....");
this.getFunders();
}
public query = '';
public filteredList = [];
@Input() public selectedProjects=[] ;
public elementRef;
@Output() projectsChange = new EventEmitter();
public funders:string[];
@Input() public selectedFunderId:string ="0";
selectedFunderName:string ="Select funder:";
public projects:string[];
constructor(private _projectService: OpenaireProjectsService,myElement: ElementRef) {
this.elementRef = myElement;
}
filter() {
if(this.selectedFunderId != '0' && this.query !== "" && this.query.length >= 3 ){
this._projectService.searchForProjects(this.query, this.selectedFunderId).subscribe(
data => {
this.filteredList = data;
},
err => console.error(err)
);
}
}
select(item){
this.query = "";
this.filteredList = [];
var index:number =this.selectedProjects.indexOf(item);
if (index == -1) {
var project= { funderId: this.selectedFunderId, projectId: item.field[0]['@value'], projectName: item.field[3]['@value'] , projectAcronym: item.field[1]['@value'] };
this.selectedProjects.push(project);
this.projectsChange.emit({
value: this.selectedProjects
});
}
}
remove(item){
var index:number =this.selectedProjects.indexOf(item);
if (index > -1) {
this.selectedProjects.splice(index, 1);
}
this.projectsChange.emit({
value: this.selectedProjects
});
}
handleClick(event){
var clickedComponent = event.target;
var inside = false;
do {
if (clickedComponent === this.elementRef.nativeElement) {
inside = true;
}
clickedComponent = clickedComponent.parentNode;
} while (clickedComponent);
if(!inside){
this.filteredList = [];
}
}
getFunders () {
console.info("Getting Funders....");
this._projectService.getFunders().subscribe(
data => {
this.funders = data;
},
err => console.error(err)
);
}
getProjects () {
if(this.selectedFunderId != '0'){
}
}
funderChanged(funderId:string, funderName:string){
this.selectedFunderId = funderId;
this.selectedFunderName = funderName;
console.info("Selected funder:"+this.selectedFunderId+ ' name:'+funderName );
this.selectedProjects = [];
}
}

View File

@ -1,9 +1,9 @@
import {Component, Input,Output, ElementRef, EventEmitter} from '@angular/core';
import {Component, Input,Output, ElementRef, EventEmitter, ViewChild} from '@angular/core';
import {JSONP_PROVIDERS} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import { RouteParams, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
import {OpenaireProjectsService} from '../../services/openaireProjects.service';
import {OpenaireProjectsService} from '../../../services/openaireProjects.service';
import {Loading} from '../../../common/modal/loading.component';
@Component({
selector: 'claim-projects',
@ -53,10 +53,12 @@ import {OpenaireProjectsService} from '../../services/openaireProjects.service';
-->
</div>
<loading [message]= "'Loading...'"></loading>
<div *ngIf="warningMessage.length > 0" class="alert alert-warning" role="alert">{{warningMessage}}</div>
<div *ngIf="infoMessage.length > 0" class="alert alert-info" role="alert">{{infoMessage}}</div>
`,
providers:[ OpenaireProjectsService ]
providers:[ OpenaireProjectsService ],
directives: [Loading]
})
export class ClaimProjectsComponent {
@ -80,6 +82,9 @@ public projects:string[];
public warningMessage = "";
public infoMessage = "";
@ViewChild (Loading) loading : Loading ;
constructor(private _projectService: OpenaireProjectsService,myElement: ElementRef) {
this.elementRef = myElement;
}
@ -95,12 +100,19 @@ filter() {
}else{
this.warningMessage = "";
this.infoMessage = "";
this.loading.open();
this._projectService.searchForProjects(this.query, this.selectedFunderId).subscribe(
data => {
this.filteredList =(data == null)?[]:data;
this.infoMessage = (data == null)?"No Results found":"";
this.loading.close();
},
err => console.error(err)
err => {
console.error(err);
this.loading.close();
this.warningMessage = "An error occured";
}
);
}
}

View File

@ -2,9 +2,9 @@ import {Component, Input, Output, EventEmitter} from '@angular/core';
import {JSONP_PROVIDERS} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import { RouteParams, RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated';
import {pagingFormatterNoLoad} from '../../common/pagingFormatterNoLoad.component';
import {PublicationTitleFormatter} from '../../common/publicationTitleFormatter.component';
import {SearchDataciteService} from '../../services/searchDatacite.service';
import {pagingFormatterNoLoad} from '../../../../common/pagingFormatterNoLoad.component';
import {PublicationTitleFormatter} from '../../../../common/publicationTitleFormatter.component';
import {SearchDataciteService} from '../../../../services/searchDatacite.service';
@Component({
@ -17,7 +17,7 @@ import {SearchDataciteService} from '../../services/searchDatacite.service';
<p *ngFor=" let item of selectedDatasets "> <publication-title [title]="item.result.title" [url]="'http://dx.doi.org/'+item.result.doi" > </publication-title> {{item.result.doi}} --{{item.result.publisher}}<button type="button" class="close" (click)="remove(item)" aria-label="Close"> <span aria-hidden="true">&times;</span></button> </p>
</div>
-->
<div class="panel">
<!-- <div class="panel">
<div class="">
<form>
<div class="input-group">
@ -29,7 +29,7 @@ import {SearchDataciteService} from '../../services/searchDatacite.service';
</div>
</form>
</div>
</div>
</div>-->
<div *ngIf="warningMessage.length > 0" class="alert alert-warning" role="alert">{{warningMessage}}</div>
<div *ngIf="infoMessage.length > 0" class="alert alert-info" role="alert">{{infoMessage}}</div>
@ -42,7 +42,7 @@ import {SearchDataciteService} from '../../services/searchDatacite.service';
</ul>
<div class="tab-content">
<div id="datacite" class="tab-pane fade in active">
<div>
<div class = "panel-body">
<div *ngIf="dataciteResultsNum != null && dataciteResultsNum > 0">
<p > {{dataciteResultsNum }} Total Results </p>
<paging-no-load [currentPage]="page" [totalResults]="dataciteResultsNum" [navigateTo]="navigateTo" [term]="keyword" [size]="size" (pageChange)="pageChange($event)"> </paging-no-load>
@ -55,7 +55,7 @@ import {SearchDataciteService} from '../../services/searchDatacite.service';
</p>
-->
<ul *ngIf="dataciteResults.length > 0 " class="list-group">
<li *ngFor=" let item of dataciteResults " [class]="(isSelected(item.doi))?'list-group-item disabled':'list-group-item'" >
<li *ngFor=" let item of dataciteResults " [class]="(isSelected(item.doi))?'list-group-item panel-footer':'list-group-item'" >
<span >
<a *ngIf="item.doi" target="_blank" href="{{'http://dx.doi.org/'+item.doi}}" >{{item.title}}</a>
<span *ngIf="!item.doi" >{{item.title}}</span>
@ -82,18 +82,23 @@ import {SearchDataciteService} from '../../services/searchDatacite.service';
})
export class ClaimDatasetComponent {
constructor (private _searchDataciteService: SearchDataciteService,
private _routeParams: RouteParams) {}
private _routeParams: RouteParams) {
var myDate = new Date();
this.todayDate = myDate.getFullYear()+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ;
this.nextDate = (myDate.getFullYear()+100)+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ;
}
ngOnInit() {
if(this.keyword !=null && this.keyword.length > 0){
this.searchDatacite(this.keyword,this.size,this.page);
}
}
page : number = 1;
size:number = 10;
navigateTo: string = "Search";
source: string = "datacite";
type : string = "dataset";
private page : number = 1;
private size:number = 10;
private navigateTo: string = "Search";
private source: string = "datacite";
private type : string = "dataset";
@Input() public select:boolean = true ;
@Input() public keyword:string = '';
@Input() public selectedDatasets = [] ;
@ -107,7 +112,13 @@ export class ClaimDatasetComponent {
public warningMessage = "";
public infoMessage = "";
searchDatacite (term: string, size : number, page : number) {
private todayDate = '';
private nextDate = '';
public search(term: string, size : number, page : number){
this.searchDatacite(term,10,1);
//TODO add openaire search
}
private searchDatacite (term: string, size : number, page : number) {
this.getDataciteResults(term,size,page);
this.warningMessage = "";
this.infoMessage = "";
@ -128,7 +139,7 @@ export class ClaimDatasetComponent {
add(item, itemId,itemType,itemSource,itemTitle, itemUrl){
var result ;
if(itemSource == 'datacite'){
result = {id: itemId, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate:''};
result = {id: itemId, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate};
}else if (itemSource == 'openaire'){
}

View File

@ -0,0 +1,92 @@
<!--<h3>Selected Results:</h3>
<div >
<p *ngFor=" let item of selectedPublications "> <publication-title [title]="item.result.title" [url]="item.result.URL" > </publication-title> {{item.result.DOI}} --{{item.result.publisher}} <button (click)="remove(item)" type="button" class="btn btn-default">Remove</button></p>
</div>
-->
<!-- (keyup)="searchCrossref(term.value)" -->
<div class="panel">
<form>
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Publication</span>
<input class=" form-control" #term [(ngModel)]="keyword"/>
<span class="input-group-btn">
<button type="submit" (click)="search(term.value,10,1)" class="btn btn-default">Search</button>
</span>
</div>
</form>
</div>
<div class="panel">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#crossref">Crossref ({{crossrefResultsNum}})</a></li>
<li><a data-toggle="tab" href="#openaire">Openaire ({{openaireResultsNum}})</a></li>
<li><a data-toggle="tab" href="#orcid">Orcid ({{orcidResultsNum}})</a></li>
</ul>
<div class="tab-content">
<div id="crossref" class="tab-pane fade in active">
<div>
<div *ngIf="crossrefResultsNum != null && crossrefResultsNum > 0">
<p > {{crossrefResultsNum }} Total Results </p>
<paging-no-load [currentPage]="page" [totalResults]="crossrefResultsNum" [navigateTo]="navigateTo" [term]="keyword" [size]="size" (pageChange)="pageChange($event)"> </paging-no-load>
</div>
<div class="panel panel-default">
<div *ngFor=" let item of crossrefResults " [class]=" isSelected(item)?'panel-heading':'panel-body' ">
<a *ngIf="item.URL" target="_blank" href="{{item.URL}}" >{{item.title}}</a>
<p *ngIf="!item.URL" target="_blank" >{{item.title}}</p>
<!--<publication-title [title]="item.title" [url]="item.URL" > </publication-title>-->
<button (click)="add(item,'crossref', 'publication', item.URL, item.title)" type="button" class="btn btn-default" style="float:right; ">Select</button> </div>
</div>
</div>
</div>
<div id="openaire" class="tab-pane fade">
<p>TODO put openaire results here...</p>
</div>
<div id="orcid" class="tab-pane fade">
<!--
<p *ngIf="orcidResultsNum == null"> No authors found for keyword: {{keyword}} </p>
<div *ngIf="orcidResultsNum != null">
<p> Not the right author? Choose one of these: </p>
<div class="dropdown">
<button class=" btn btn-default dropdown-toggle" type= "button" data-toggle="dropdown" id="orcidDropDown" role="button" aria-haspopup="true" aria-expanded="true">Selected: {{authorGivenName}} {{authorFamilyName}}<span class="caret"></span></button>
<ul class="dropdown-menu" aria-labelledby="orcidDropDown">
<li *ngFor=" let item of authorIds let i = index" (click)="getOrcidResultsById(i)" role="button">
{{authorGivenNames[i]}} {{authorFamilyNames[i]}} : {{item}}
</li>
</ul>
</div>
<div>
<br/>
<h4> {{orcidResultsNum }} Total Results for author
<a target="_blank" href="http://orcid.org/{{authorId}}"> {{authorGivenName}} {{authorFamilyName}} : {{authorId}} </a>
</h4>
<br/>
<div *ngIf=" ((orcidResultsNum >0) && (totalPages > 1) && ( 0 < page && page <= totalPages )) " >
<paging-no-load [currentPage]="page" [totalResults]="orcidResultsNum" [navigateTo]="navigateTo" [term]="keyword" [size]="size" (pageChange)="orcidPageChange($event)"> </paging-no-load>
</div>
<div *ngIf=" orcidResultsNum > 0" class="panel panel-default">
<!--<div [class]=" isSelected(item)?'panel-heading':'panel-body' " *ngFor=" let item of orcidResultsToShow ">
{{item['work-title']['title'].value}} ({{item['publication-date']['year'].value}}) </div>-->
<!--
<div [class]=" isSelected(item)?'panel-heading':'panel-body' " *ngFor=" let item of orcidResultsToShow ">
<!--<a *ngIf="url" target="_blank" href="{{item.URL}}" >{{item['work-title']['title'].value}}</a> -->
{{item['work-title']['title'].value}}
<!--<publication-title [title]="item.title" [url]="item.URL" > </publication-title>-->
<!-- <button (click)="add(item,'orcid', 'publication', '', {{item['work-title']['title'].value}} )" type="button" class="btn btn-default" style="float:right; ">Select</button>
</div>
</div>
</div>
</div>-->
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,76 @@
<div class="panel">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#crossref">Crossref ({{(crossrefResultsNum)?crossrefResultsNum:0}})</a></li>
<li><a data-toggle="tab" href="#openaire">Openaire ({{ (openaireResultsNum)?openaireResultsNum:0 }})</a></li>
<li><a data-toggle="tab" href="#orcid">Orcid ({{ (orcidResultsNum)?orcidResultsNum:0}})</a></li>
</ul>
<div class="tab-content">
<div id="crossref" class="tab-pane fade in active">
<div class="panel-body" >
<div *ngIf="crossrefResultsNum != null && crossrefResultsNum > 0">
<paging-no-load [currentPage]="page" [totalResults]="crossrefResultsNum" [navigateTo]="navigateTo" [term]="keyword" [size]="size" (pageChange)="pageChange($event)"> </paging-no-load>
</div>
<div >
<ul *ngIf="crossrefResults.length > 0 " class="list-group">
<li *ngFor=" let item of crossrefResults " [class]="(isSelected(item.DOI))?'list-group-item panel-footer':'list-group-item'">
<span >
<a *ngIf="item.URL" target="_blank" href="{{item.URL}}" >{{item.title}}</a>
<span *ngIf="!item.URL" >{{item.title}}</span>
</span>
<span *ngIf="!isSelected(item.DOI)" (click)="add(item, item.DOI, 'crossref', 'publication', item.URL, item.title)" aria-hidden="true" class= " btn glyphicon glyphicon-plus"></span>
</li>
</ul>
<div *ngIf="crossrefResults.length == 0" class = "alert alert-info " > No results found </div>
</div>
</div>
</div>
<div id="openaire" class="tab-pane fade">
<div class = "panel-body">
<div class = "alert alert-info " > Under Development....
</div>
</div>
</div>
<div id="orcid" class="tab-pane fade">
<div class="panel-body" >
<div *ngIf="orcidResultsNum == null" class = "alert alert-info " > No results found </div>
<div *ngIf="orcidResultsNum != null" class="panel-body">
<div class = "alert alert-warning " > Not the right author? Choose one of these:
<span class="dropdown">
<button class=" btn btn-default dropdown-toggle" type= "button" data-toggle="dropdown" id="orcidDropDown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Selected: {{authorGivenName}} {{authorFamilyName}}
</button>
<ul class="dropdown-menu" aria-labelledby="orcidDropDown">
<li *ngFor=" let item of authorIds let i = index" > <a (click)="getOrcidResultsById(i)" >
{{authorGivenNames[i]}} {{authorFamilyNames[i]}} : {{item}} </a>
</li>
</ul>
</span>
</div>
<span>Results for
<a target="_blank" href="http://orcid.org/{{authorId}}"> {{authorGivenName}} {{authorFamilyName}} - {{authorId}} </a> :
</span>
<div *ngIf=" ((orcidResultsNum >0) && (totalPages > 1) && ( 0 < page && page <= totalPages )) " >
<paging-no-load [currentPage]="page" [totalResults]="orcidResultsNum" [navigateTo]="navigateTo" [term]="keyword" [size]="size" (pageChange)="orcidPageChange($event)"> </paging-no-load>
</div>
<div >
<ul *ngIf="orcidResultsNum >0 && orcidResultsToShow.length > 0 " class="list-group">
<li *ngFor=" let item of orcidResultsToShow " [class]="(isSelected(authorId+'-'+item['put-code']))?'list-group-item panel-footer':'list-group-item'">
<span *ngIf="!item.URL" >{{item['work-title']['title'].value}}</span>
<span *ngIf="!isSelected(authorId+item['put-code'])" (click)="add(item,authorId+'-'+item['put-code'],'orcid', 'publication', '', item['work-title']['title'].value)" aria-hidden="true" class= " btn glyphicon glyphicon-plus"></span>
</li>
</ul>
<div *ngIf="orcidResultsNum == 0" class = "alert alert-info " > No results found </div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -2,22 +2,27 @@ import {Component, Input, Output, EventEmitter} from '@angular/core';
import {JSONP_PROVIDERS} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import { RouteParams, RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated';
import {SearchCrossrefService} from '../../services/searchCrossref.service';
import {SearchOrcidService} from '../../services/searchOrcid.service';
import {Publication} from '../../entities/publication';
import {pagingFormatterNoLoad} from '../../common/pagingFormatterNoLoad.component';
import {PublicationTitleFormatter} from '../../common/publicationTitleFormatter.component';
import {SearchCrossrefService} from '../../../../services/searchCrossref.service';
import {SearchOrcidService} from '../../../../services/searchOrcid.service';
import {Publication} from '../../../../entities/publication';
import {pagingFormatterNoLoad} from '../../../../common/pagingFormatterNoLoad.component';
import {PublicationTitleFormatter} from '../../../../common/publicationTitleFormatter.component';
@Component({
selector: 'claim-publication',
directives: [...ROUTER_DIRECTIVES,pagingFormatterNoLoad, PublicationTitleFormatter],
templateUrl: 'src/app/linking/claimPublication/claimPublication.component.html',
templateUrl: 'src/app/claimPages/linking/claimResult/claimPublication/claimPublication.component.html',
providers:[JSONP_PROVIDERS, SearchCrossrefService, SearchOrcidService]
})
export class ClaimPublicationComponent {
constructor (private _searchCrossrefService: SearchCrossrefService,private _searchOrcidService: SearchOrcidService,
private _routeParams: RouteParams) {}
private _routeParams: RouteParams) {
var myDate = new Date();
this.todayDate = myDate.getFullYear()+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ;
this.nextDate = (myDate.getFullYear()+100)+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ;
}
ngOnInit() {
let page = +this._routeParams.get('page');
let size = +this._routeParams.get('size');
@ -59,7 +64,10 @@ export class ClaimPublicationComponent {
public warningMessage = "";
public infoMessage = "";
searchOrcid (term: string) {
todayDate = '';
nextDate = '';
private searchOrcid (term: string) {
this.authorIds = new Array<string>();
this.authorGivenNames = new Array<string>();
this.authorFamilyNames = new Array<string>();
@ -69,7 +77,7 @@ export class ClaimPublicationComponent {
console.info('searchOrcid in searchOrcid file');
}
readData(data: any) {
private readData(data: any) {
this.authorIds.push(data[2].path);
if(data[0] != null) {
@ -84,7 +92,7 @@ export class ClaimPublicationComponent {
}
}
getOrcidAuthor (term: string) {
private getOrcidAuthor (term: string) {
this.orcidResultsNum = null;
this._searchOrcidService.searchOrcidAuthor(term).subscribe(
@ -99,7 +107,7 @@ export class ClaimPublicationComponent {
);
}
errorHandler(err: any, term: string) {
private errorHandler(err: any, term: string) {
if(err.status == 404){
this.getOrcidAuthors(term);
} else {
@ -107,7 +115,7 @@ export class ClaimPublicationComponent {
}
}
getOrcidAuthors (term: string) {
private getOrcidAuthors (term: string) {
this.orcidResultsNum = null;
this._searchOrcidService.searchOrcidAuthors(term).subscribe(
@ -122,7 +130,7 @@ export class ClaimPublicationComponent {
}
getOrcidResultsById (index:number) {
private getOrcidResultsById (index:number) {
let id = this.authorIds[index];
console.info("getOrcidResultsById: "+id);
@ -153,7 +161,7 @@ export class ClaimPublicationComponent {
console.info("totalPages = " +this.totalPages);
}
search(term: string, size : number, page : number){
public search(term: string, size : number, page : number){
this.warningMessage = "";
this.infoMessage = "";
this.getCrossrefResults(term,size,page);
@ -162,7 +170,7 @@ search(term: string, size : number, page : number){
}
getCrossrefResults (term: string, size : number, page : number) {
private getCrossrefResults (term: string, size : number, page : number) {
this._searchCrossrefService.searchCrossrefResults(term, size, page).subscribe(
data => {
this.crossrefResults = data.items;
@ -175,12 +183,12 @@ search(term: string, size : number, page : number){
}
add(item, id, itemSource, itemType, itemUrl, itemTitle){
private add(item, id, itemSource, itemType, itemUrl, itemTitle){
var result ;
if(itemSource == 'crossref'){
result = {id: id, type :itemType, source : 'openaire', title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate:''};
result = {id: id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate};
}else if (itemSource == 'orcid'){
result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate:''};
result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate};
}else if (itemSource == 'openaire'){
}
@ -196,7 +204,7 @@ search(term: string, size : number, page : number){
}
}
remove(item){
private remove(item){
this.warningMessage = "";
this.infoMessage = "";
var index:number =this.selectedPublications.indexOf(item);
@ -209,18 +217,18 @@ search(term: string, size : number, page : number){
}
}
pageChange($event) {
private pageChange($event) {
this.page=$event.value;
this.crossrefResults=[];
this.getCrossrefResults(this.keyword,this.size,this.page);
}
orcidPageChange($event) {
private orcidPageChange($event) {
this.page=$event.value;
this.orcidResultsToShow=[];
this.orcidResultsToShow = this.orcidResults.slice(($event.value-1)*this.size, $event.value*this.size);
}
isSelected(id:string){
private isSelected(id:string){
var found:boolean = false;
this.warningMessage = "";

View File

@ -0,0 +1,117 @@
import {Component, Input, Output, EventEmitter,ViewChild} from '@angular/core';
import {JSONP_PROVIDERS} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import { RouteParams, RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated';
import {pagingFormatterNoLoad} from '../../../common/pagingFormatterNoLoad.component';
import {PublicationTitleFormatter} from '../../../common/publicationTitleFormatter.component';
import {ClaimPublicationComponent} from './claimPublication/claimPublication.component';
import {ClaimDatasetComponent} from './claimDataset/claimDataset.component';
import {SearchDataciteService} from '../../../services/searchDatacite.service';
@Component({
selector: 'claim-result',
directives: [...ROUTER_DIRECTIVES,pagingFormatterNoLoad, PublicationTitleFormatter, ClaimPublicationComponent, ClaimDatasetComponent],
template: `
<div class="panel">
<div class="">
<form>
<!--<md-input class="demo-full-width default" placeholder="Search for Research Results" [(ngModel)]="keyword"></md-input>
<md-radio-group class="default" [(value)]="searchType">
<md-radio-button [value]="publication" [checked]="searchType === 'publication'" >Publication</md-radio-button>
<md-radio-button [value]="dataset" [checked]="searchType != 'publication'">Dataset</md-radio-button>
</md-radio-group> -->
<div class="input-group">
<span class="input-group-addon">
<input #publication name="searchType" type="radio" [checked]="searchType === 'publication'" value="publication" (click)="searchType = publication.value" />Publication
<input #dataset name="searchType" [checked]="searchType === 'dataset'" type="radio" value="dataset" (click)="searchType = dataset.value" />Dataset
</span>
<!--<div class="input-group-btn">
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{(searchType === 'publication')?"Publication":"Dataset"}} </button>
<ul class="dropdown-menu">
<li (click)="typeChanged('publication')" ><a >Publication</a></li>
<li (click)="typeChanged('dataset')" ><a >Dataset</a></li>
</ul>
</div> -->
<input class=" form-control" [(ngModel)]="keyword"/>
<span class="input-group-btn">
<button (click)="search()" type="submit" class="btn btn-default">Search</button>
</span>
</div>
</form>
</div>
</div>
<div class="panel ">
<div *ngIf=" searchType=='publication' ">
<claim-publication [(keyword)]="keyword" [selectedPublications]="selectedPublications" (publicationsChange)="publicationsChanged($event)" > </claim-publication>
</div>
<div *ngIf=" searchType=='dataset' " >
<claim-dataset [(keyword)]="keyword" [(selectedDatasets)]="selectedDatasets" (datasetsChange)="datasetsChanged($event)" > </claim-dataset>
</div>
</div>
`,
providers:[JSONP_PROVIDERS, SearchDataciteService]
})
export class ClaimResultComponent {
constructor (private _searchDataciteService: SearchDataciteService,
private _routeParams: RouteParams) {
var myDate = new Date();
this.todayDate = myDate.getFullYear()+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ;
this.nextDate = (myDate.getFullYear()+100)+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ;
}
ngOnInit() {
// if(this.keyword !=null && this.keyword.length > 0){
// this.searchDatacite(this.keyword,this.size,this.page);
// }
}
@ViewChild (ClaimPublicationComponent) claimPublicationComponent : ClaimPublicationComponent ;
@ViewChild (ClaimDatasetComponent) claimDatasetComponent : ClaimDatasetComponent ;
page : number = 1;
size:number = 10;
navigateTo: string = "Search";
source: string = "datacite";
type : string = "dataset";
searchType ="publication";
@Input() public select:boolean = true ;
@Input() public keyword:string = '';
@Input() public selectedDatasets = [] ;
@Input() public selectedPublications = [] ;
@Output() datasetsChange = new EventEmitter();
@Output() publicationsChange = new EventEmitter();
todayDate = '';
nextDate = '';
search(){
if(this.searchType=='dataset'){
this.claimDatasetComponent.search(this.keyword,10,1);
}else{
this.claimPublicationComponent.search(this.keyword,10,1);
}
}
typeChanged(type:string) {
this.searchType = type;
}
publicationsChanged($event) {
this.selectedPublications=$event.value;
this.publicationsChange.emit({
value: this.selectedPublications
});
}
datasetsChanged($event) {
this.selectedDatasets=$event.value;
this.datasetsChange.emit({
value: this.selectedDatasets
});
}
}

View File

@ -1,25 +1,30 @@
import {Component, Input, Output, EventEmitter} from '@angular/core';
import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core';
import {JSONP_PROVIDERS} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import { RouteParams, RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated';
import {ClaimsService} from '../../services/claims.service';
import {PublicationTitleFormatter} from '../../common/publicationTitleFormatter.component';
import {ClaimsService} from '../../../services/claims.service';
import {PublicationTitleFormatter} from '../../../common/publicationTitleFormatter.component';
import {Loading} from '../../../common/modal/loading.component';
@Component({
selector: 'claim-insert',
directives: [...ROUTER_DIRECTIVES],
directives: [...ROUTER_DIRECTIVES, Loading],
template: `
<button *ngIf="claiming == false" (click)="insert()" class="btn btn-primary" style="float:right">Finish</button>
<div *ngIf="error == true"> <div class="alert alert-warning" role="alert">{{errorMessage}}</div>
</div>
<div *ngIf="claiming == true && claimsTODO > 0 && claimsTODO == claims" >
Now show my claims
</div>
<loading [message]= "'Please wait...'"></loading>
`,
providers:[JSONP_PROVIDERS, ClaimsService]
})
export class ClaimInsertComponent {
constructor (private claimService: ClaimsService) {}
constructor (private claimService: ClaimsService, private _routeParams: RouteParams, private _router:Router) {}
ngOnInit() {
}
@ -30,10 +35,16 @@ export class ClaimInsertComponent {
@Input() publications=[];
@Input() datasets=[];
@Input() show='claim';
@Output() showChange = new EventEmitter();
@ViewChild (Loading) loading : Loading ;
claiming =false;
error = false;
errorMessage = "";
claimsTODO:number = 0;
claims:number = 0;
insert(){
this.claiming = true;
var user="argirok@di.uoa.gr"
@ -44,15 +55,13 @@ insert(){
this.errorMessage = "There are no projects or concepts to link.";
this.error = true;
}else{
this.loading.open();
for (var i = 0; i < this.publications.length; i++) {
var result=this.publications[i];
this.insertClaim(result,user);
}
for (var i = 0; i < this.datasets.length; i++) {
var result=this.datasets[i];
this.insertClaim(result,user);
@ -60,17 +69,28 @@ insert(){
}
}
claimInserted(){
this.claims+=1;
if(this.claims == this.claimsTODO){
this.show = "myclaims";
this.loading.close();
// this.showChange.emit({
// value: this.show
// });
this._router.navigate( ['MyClaims'] );
}
}
insertClaim(result:any, user:any){
for (var j = 0; j < this.contexts.length; j++) {
var context=this.contexts[j];
var claim = { claimedBy : user, sourceId : context.concept.id, sourceType : "context", sourceCollectedFrom:"openaire", sourceAccessRights:"OPEN", sourceEmbargoEndDate:"", targetId : result.id , targetType : result.type,
targetCollectedFrom: result.source, targetAccessRights:result.accessRights, targetEmbargoEndDate:result.embargoEndDate};
console.info("Trying to insert context - result relation: contextId: "+claim.sourceId +" resultId : " + claim.targetId );
console.info("Trying to insert context - result relation: contextId: "+claim.sourceId +" resultId : " + claim.targetId + " "+ claim.targetEmbargoEndDate );
this.claimsTODO +=1;
this.claimService.insertClaim(claim).subscribe(
data => {
this.claimInserted();
},
err => console.error(err)
);
@ -80,10 +100,12 @@ insert(){
var claim = { claimedBy : user, sourceId : project.projectId, sourceType : "project", sourceCollectedFrom:"openaire", sourceAccessRights:"OPEN", sourceEmbargoEndDate:"", targetId : result.id , targetType : result.type,
targetCollectedFrom: result.source, targetAccessRights:result.accessRights, targetEmbargoEndDate:result.embargoEndDate};
console.info("Trying to insert project - result relation: projectId: "+claim.sourceId +" resultId : " + claim.targetId );
console.info("Trying to insert project - result relation: projectId: "+claim.sourceId +" resultId : " + claim.targetId + " "+ claim.targetEmbargoEndDate );
this.claimsTODO +=1;
this.claimService.insertClaim(claim).subscribe(
data => {
},
this.claimInserted();
},
err => console.error(err)
);
}

View File

@ -3,47 +3,46 @@ import {JSONP_PROVIDERS} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import { RouteParams, RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated';
import {ClaimContextComponent} from './claimContext/claimContext.component';
import {ClaimPublicationComponent} from './claimPublication/claimPublication.component';
import {ClaimDatasetComponent} from './claimDataset/claimDataset.component';
import {ClaimResultComponent} from './claimResult/claimResult.component';
import {ClaimSelectedComponent} from './selected/selected.component';
import {ClaimInsertComponent} from './insertClaim/insertClaim.component';
import {ClaimProjectsComponent} from './claimProject/claimProject.component';
import {LinkingHomeComponent} from './linkingHome.component';
// import { MD_RADIO_DIRECTIVES, MdRadioDispatcher } from '@angular2-material/radio';
// import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
@Component({
selector: 'linking',
//providers: [MdRadioDispatcher],
directives: [ROUTER_DIRECTIVES, ClaimContextComponent, ClaimPublicationComponent, ClaimSelectedComponent, ClaimInsertComponent,ClaimDatasetComponent, ClaimProjectsComponent, LinkingHomeComponent],
directives: [ROUTER_DIRECTIVES, ClaimContextComponent, ClaimSelectedComponent, ClaimInsertComponent, ClaimProjectsComponent, LinkingHomeComponent, ClaimResultComponent],
template: `
<div class="container">
<div class="page-header">
<h1>Link research resutls</h1>
</div>
<linking-home *ngIf=" show == 'home' " (linkTypeChange)="linkTypeChange($event)" ></linking-home>
<div *ngIf=" show != 'home' " >
<ol class="breadcrumb">
<div *ngIf=" show != 'home' && show != 'myclaims' " >
<ol *ngIf=" show != 'myclaims' " class="breadcrumb">
<li *ngIf="linkType == 'project'" [class]="(show == 'project' )?'active':''"><a *ngIf="show != 'project'" (click)="showChangedType('project')" >Project</a><span *ngIf="show == 'project'">Project</span></li>
<li *ngIf="linkType == 'context'" [class]="(show == 'context' )?'active':''"><a *ngIf="show != 'context'" (click)="showChangedType('context')" >Context</a><span *ngIf="show == 'context'">Context</span></li>
<li *ngIf="linkType == 'software'" [class]="(show == 'software' )?'active':''"><a *ngIf="show != 'software'" (click)="showChangedType('software')" >Software</a><span *ngIf="show == 'software'">Software</span> </li>
<li [class]="(show == 'result' || show == 'publication' || show == 'dataset')?'active':''"><a *ngIf="show != 'result' && show != 'publication' && show != 'dataset'" (click)="showChangedType('result')" >Research Result</a><span *ngIf="show == 'result' || show == 'publication' || show == 'dataset'">Research Result</span></li>
<li [class]="(show == 'claim' )?'active':''"><a *ngIf="show != 'claim'">Link</a><span *ngIf="show == 'claim'" (click)="showChangedType('claim')">Link</span> </li>
<li [class]="(show == 'claim' )?'active':''"><span *ngIf="show == 'claim'">Link</span><a *ngIf="show != 'claim'" (click)="showChangedType('claim')">Link</a> </li>
</ol>
<div *ngIf=" show != 'claim'" class="row" >
<div *ngIf=" show != 'claim' && show != 'myclaims'" class="row" >
<div class="col-sm-6">
<div *ngIf=" show=='result' " >
<div *ngIf=" show=='result' " >
<claim-result [selectedDatasets]="datasets" [selectedPublications]="publications" (datasetsChange)="datasetsChange($event)" (publicationsChange)="publicationsChange($event)" > </claim-result>
</div>
<!--<div *ngIf=" show=='result' " >
<form>
<!--<md-input class="demo-full-width default" placeholder="Search for Research Results" [(ngModel)]="keyword"></md-input>
!--<md-input class="demo-full-width default" placeholder="Search for Research Results" [(ngModel)]="keyword"></md-input>
<md-radio-group class="default" [(value)]="searchType">
<md-radio-button [value]="publication" [checked]="searchType === 'publication'" >Publication</md-radio-button>
<md-radio-button [value]="dataset" [checked]="searchType != 'publication'">Dataset</md-radio-button>
</md-radio-group> -->
</md-radio-group> --
<div class="input-group">
<div class="input-group-btn">
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{(searchType === 'publication')?"Publication":"Dataset"}} </button>
@ -52,12 +51,12 @@ import {LinkingHomeComponent} from './linkingHome.component';
<li (click)="typeChanged('dataset')" ><a >Dataset</a></li>
</ul>
</div>
<!-- <div class="resultType">
!-- <div class="resultType">
<span class="input-group-addon">
<input #publication name="searchType" type="radio" [checked]="searchType === 'publication'" value="publication" (click)="searchType = publication.value" />Publication
<input #dataset name="searchType" [checked]="searchType === 'dataset'" type="radio" value="dataset" (click)="searchType = dataset.value" />Dataset
</div>
</span>-->
</span>--
<input class=" form-control" [(ngModel)]="keyword"/>
<span class="input-group-btn">
@ -65,13 +64,13 @@ import {LinkingHomeComponent} from './linkingHome.component';
</span>
</div>
</form>
</div>
<div *ngIf=" show=='publication' ">
</div> -->
<!-- <div *ngIf=" show=='publication' ">
<claim-publication [keyword]="keyword" [selectedPublications]="publications" (publicationsChange)="publicationsChange($event)" > </claim-publication>
</div>
<div *ngIf=" show=='dataset' " >
<claim-dataset [keyword]="keyword" [selectedDatasets]="datasets" (datasetsChange)="datasetsChange($event)" > </claim-dataset>
</div>
</div> -->
<div *ngIf=" show=='project' " >
<claim-projects [selectedProjects]="projects" (projectsChange)="projectsChange($event)" > </claim-projects>
</div>
@ -93,11 +92,16 @@ import {LinkingHomeComponent} from './linkingHome.component';
</div>
<div *ngIf=" show == 'claim'" >
<claim-selected [contexts]="contexts" [publications]="publications" [datasets]="datasets" [projects]="projects" [show]="show" (showChange)="showChange($event)" [showAccessRights]="'true'" > </claim-selected>
<claim-insert [contexts]="contexts" [publications]="publications" [datasets]="datasets" [projects]="projects"></claim-insert>
<claim-insert [contexts]="contexts" [publications]="publications" [datasets]="datasets" [projects]="projects" [show] = "show" (showChange)="showChange($event)"></claim-insert>
</div>
<button class="btn btn-primary" *ngIf="show != 'home'" (click)="prev()">Prev</button>
<button class="btn btn-primary" *ngIf="show != 'claim'" (click)="next()" >Next</button>
<nav>
<ul *ngIf="show != 'home'" class="pager">
<li class="previous" (click)="prev()"><a ><span aria-hidden="true">&larr;</span> Previous</a></li>
<li class="next" *ngIf="show != 'claim'" (click)="next()" ><a >Next <span aria-hidden="true">&rarr;</span></a></li>
</ul>
</nav>
<!--<button class="btn btn-primary" *ngIf="show != 'home'" (click)="prev()">Prev</button>
<button class="btn btn-primary" *ngIf="show != 'claim'" (click)="next()" >Next</button> -->
</div>
</div>
@ -130,30 +134,31 @@ export class LinkingComponent {
this.show='result';
}else if((this.show == 'result' && this.keyword == '')||(this.show == 'dataset' || this.show == 'publication')){
this.show='claim';
}else if(this.show == 'result' ){
if(this.searchType == 'publication' ){
this.show="publication";
}else{
this.show="dataset";
}
// }else if(this.show == 'result' ){
// if(this.searchType == 'publication' ){
// this.show="publication";
// }else{
// this.show="dataset";
// }
}
}
prev(){
if(this.show == 'result'){
if(this.linkType == 'project'){
this.show='project';
}else if(this.linkType == 'context'){
this.show='context';
}else if(this.linkType == 'software'){
this.show='software';
}else{
this.show='home';
}
this.show = this.linkType;
// if(this.linkType == 'project'){
// this.show='project';
// }else if(this.linkType == 'context'){
// this.show='context';
// }else if(this.linkType == 'software'){
// this.show='software';
// }else{
// this.show='home';
//
// }
}else if(this.show == 'context' || this.show == 'project' || this.show == 'software' ){
this.show='home';
}else if(this.show == 'dataset' || this.show == 'publication'){
this.show='result';
// }else if(this.show == 'dataset' || this.show == 'publication'){
// this.show='result';
} else if(this.show == 'claim'){
this.show='result';
}

View File

@ -1,5 +1,5 @@
import {Component, Input,Output, EventEmitter} from '@angular/core';
import {PublicationTitleFormatter} from '../../common/publicationTitleFormatter.component';
import {PublicationTitleFormatter} from '../../../common/publicationTitleFormatter.component';
@Component({
selector: 'claim-selected',
template: `
@ -31,7 +31,7 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
</li>
<li class="list-group-item" *ngFor="let project of projects">
<span >{{project.funderName}} | {{project.projectName}} {{(project.projectAcronym)?'()'+project.projectAcronym+')':''}}</span>
<span >{{project.funderName}} | {{project.projectName}} {{(project.projectAcronym)?'('+project.projectAcronym+')':''}}</span>
<span (click)="removeProject(project)" aria-hidden="true" class="btn glyphicon glyphicon-remove"></span>
</li>
<li *ngIf="projects.length == 0 " class="list-group-item">There are no projects</li>
@ -69,11 +69,11 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
<div class="publications" >
<ul class="list-group">
<li class="list-group-item disabled "> Research Results ({{(datasets.length+publications.length)}})
<li class="list-group-item panel-footer "> Research Results ({{(datasets.length+publications.length)}})
<span title="Add More Research Results" (click)="showType('result')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span>
</li>
<li *ngIf="publications.length == 0 && datasets.length == 0" class="list-group-item">There are no Research Results </li>
<li class="list-group-item list-group-item-warning ">{{publications. length }} Selected Publications:
<li *ngIf="publications.length > 0 || datasets.length > 0" class="list-group-item list-group-item-warning ">{{publications. length }} Selected Publications:
<span title="Add More Publications" (click)="showType('publication')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span>
</li>
<li *ngFor="let pub of publications" class="list-group-item">
@ -89,6 +89,7 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
<ul class="dropdown-menu" [attr.aria-labelledby]="'dropdown'+pub.id">
<li *ngFor="let type of accessTypes" ><a (click)="pub.accessRights = type " >{{type}} </a></li>
</ul>
<input *ngIf="pub.accessRights== 'EMBARGO'" type="date" id="{{'date'+pub.id}}" name="" [min]="todayDate" (keyup)="dateChanged($event, pub)" [value]="pub.embargoEndDate">
</span>
<span *ngIf="showAccessRights== 'true' && pub.source == 'openaire' " >
<button class="btn btn-default disabled " type="button" >
@ -97,7 +98,7 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
</span>
<span *ngIf="showAccessRights != 'true'" (click)="removePublication(pub)" aria-hidden="true" class="btn glyphicon glyphicon-remove"></span>
</li>
<li class="list-group-item list-group-item-warning "> {{datasets.length}} Selected Research Data:
<li *ngIf="publications.length > 0 || datasets.length > 0" class="list-group-item list-group-item-warning "> {{datasets.length}} Selected Research Data:
<span title="Add More Research Data" (click)="showType('dataset')" aria-hidden="true" class="glyphicon glyphicon-plus " style="float:right;cursor: pointer;"></span>
</li>
<li *ngFor="let dataset of datasets" class="list-group-item">
@ -113,6 +114,7 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
<ul class="dropdown-menu" [attr.aria-labelledby]="'dropdown'+dataset.id">
<li *ngFor="let type of accessTypes" ><a (click)="dataset.accessRights = type " >{{type}} </a></li>
</ul>
<input *ngIf="dataset.accessRights== 'EMBARGO'" type="date" id="{{'date'+dataset.id}}" name="" [min]="todayDate" (keyup)="dateChanged($event,dataset)" [value]="dataset.embargoEndDate">
</span>
<span *ngIf="showAccessRights== 'true' && dataset.source == 'openaire' " >
<button class="btn btn-default disabled " type="button" >
@ -132,6 +134,10 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
export class ClaimSelectedComponent {
ngOnInit() {
console.info("Show accessRights selection? :"+this.showAccessRights);
var myDate = new Date();
this.todayDate=( myDate.getFullYear()+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ;
this.nextDate= ( (myDate.getFullYear()+100)+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ;
//2015-05-01
}
@ -148,6 +154,8 @@ export class ClaimSelectedComponent {
@Output() showChange = new EventEmitter();
todayDate = '';
nextDate = '';
removeContext(item:any){
var index:number =this.contexts.indexOf(item);
if (index > -1) {
@ -194,7 +202,9 @@ export class ClaimSelectedComponent {
}
accessTypes = ["OPEN","CLOSED","EMBARGO","RESTRICTED"];
dateChanged (event:any, item:any) {
item.embargoEndDate = event.target.value ;
}
}

View File

@ -0,0 +1,38 @@
import {Component, Input} from '@angular/core';
import {JSONP_PROVIDERS} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import { RouteParams, RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated';
import {ClaimsComponent} from '../claims/claims.component';
@Component({
selector: 'my-claims',
directives: [ROUTER_DIRECTIVES, ClaimsComponent],
template: `
<div *ngIf="user" class="container">
<div class="page-header">
<h1> My Linked research resutls</h1>
</div>
<div>
<div class="text-right"><a [routerLink]=" ['/Linking']">Add more Links?</a></div>
<claims enableDelete="true" myClaims="true" isAdmin="false" [fetchId]="user" ></claims>
</div>
</div>
<div *ngIf="!user" class="container">
TODO login
</div>
`
})
export class MyClaimsComponent {
constructor ( private _router: Router ) {
}
user:string="argirok@di.uoa.gr";
ngOnInit() {
}
}

View File

@ -0,0 +1,53 @@
import {Component, ViewEncapsulation, ComponentRef, DynamicComponentLoader,ElementRef, Input, EventEmitter, Output} from '@angular/core';
import {Open} from './open.component';
@Component({
selector: 'loading',
template: `
<div class="modal fade" [open]="!isOpen" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="">
<div class="modal-content">
<div class="modal-body">
<div >
<h3 class="text-center" >{{message}}</h3>
</div>
</div>
</div>
</div>
</div>
`,
providers: [],
directives: [Open],
encapsulation: ViewEncapsulation.None,
pipes: []
})
/**
* API to an open alert window.
*/
export class Loading{
@Input() public message:string ="Loading";
/**
* if the value is true alert will be visible or else it will be hidden.
*/
public isOpen:boolean=false;
/**
* Emitted when a ok button was clicked
* or when Ok method is called.
*/
@Output() public alertOutput:EventEmitter<any> = new EventEmitter();
constructor(public dcl:DynamicComponentLoader, public _elementRef: ElementRef){}
/**
* Opens a alert window creating backdrop.
*/
open(){
this.isOpen= true;
}
close(){
this.isOpen = false;
}
}

View File

@ -1,92 +0,0 @@
<!--<h3>Selected Results:</h3>
<div >
<p *ngFor=" let item of selectedPublications "> <publication-title [title]="item.result.title" [url]="item.result.URL" > </publication-title> {{item.result.DOI}} --{{item.result.publisher}} <button (click)="remove(item)" type="button" class="btn btn-default">Remove</button></p>
</div>
-->
<!-- (keyup)="searchCrossref(term.value)" -->
<div class="panel">
<form>
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Publication</span>
<input class=" form-control" #term [(ngModel)]="keyword"/>
<span class="input-group-btn">
<button type="submit" (click)="search(term.value,10,1)" class="btn btn-default">Search</button>
</span>
</div>
</form>
</div>
<div *ngIf="warningMessage.length > 0" class="alert alert-warning" role="alert">{{warningMessage}}</div>
<div *ngIf="infoMessage.length > 0" class="alert alert-info" role="alert">{{infoMessage}}</div>
<div class="panel">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#crossref">Crossref ({{(crossrefResultsNum)?crossrefResultsNum:0}})</a></li>
<li><a data-toggle="tab" href="#openaire">Openaire ({{ (openaireResultsNum)?openaireResultsNum:0 }})</a></li>
<li><a data-toggle="tab" href="#orcid">Orcid ({{ (orcidResultsNum)?orcidResultsNum:0}})</a></li>
</ul>
<div class="tab-content">
<div id="crossref" class="tab-pane fade in active">
<div>
<div *ngIf="crossrefResultsNum != null && crossrefResultsNum > 0">
<paging-no-load [currentPage]="page" [totalResults]="crossrefResultsNum" [navigateTo]="navigateTo" [term]="keyword" [size]="size" (pageChange)="pageChange($event)"> </paging-no-load>
</div>
<div >
<ul *ngIf="crossrefResults.length > 0 " class="list-group">
<li *ngFor=" let item of crossrefResults " [class]="(isSelected(item.DOI))?'list-group-item disabled':'list-group-item'">
<span >
<a *ngIf="item.URL" target="_blank" href="{{item.URL}}" >{{item.title}}</a>
<span *ngIf="!item.URL" >{{item.title}}</span>
</span>
<span *ngIf="!isSelected(item.DOI)" (click)="add(item, item.DOI, 'crossref', 'publication', item.URL, item.title)" aria-hidden="true" class= " btn glyphicon glyphicon-plus"></span>
</li>
</ul>
<div *ngIf="crossrefResults.length == 0" class = "alert alert-info " > No results found </div>
</div>
</div>
</div>
<div id="openaire" class="tab-pane fade">
<div class = "panel-body">
<div class = "alert alert-info " > Under Development....
</div>
</div>
</div>
<div id="orcid" class="tab-pane fade">
<p *ngIf="orcidResultsNum == null"> No authors found for keyword: {{keyword}} </p>
<div *ngIf="orcidResultsNum != null" class="panel-body">
<div class = "alert alert-warning " > Not the right author? Choose one of these:
<span class="dropdown">
<button class=" btn btn-default dropdown-toggle" type= "button" data-toggle="dropdown" id="orcidDropDown" role="button" aria-haspopup="true" aria-expanded="true">Selected: {{authorGivenName}} {{authorFamilyName}}</button>
<ul class="dropdown-menu" aria-labelledby="orcidDropDown">
<li *ngFor=" let item of authorIds let i = index" (click)="getOrcidResultsById(i)" role="button">
{{authorGivenNames[i]}} {{authorFamilyNames[i]}} : {{item}}
</li>
</ul>
</span>
</div>
<span>Results for
<a target="_blank" href="http://orcid.org/{{authorId}}"> {{authorGivenName}} {{authorFamilyName}} - {{authorId}} </a> :
</span>
<div *ngIf=" ((orcidResultsNum >0) && (totalPages > 1) && ( 0 < page && page <= totalPages )) " >
<paging-no-load [currentPage]="page" [totalResults]="orcidResultsNum" [navigateTo]="navigateTo" [term]="keyword" [size]="size" (pageChange)="orcidPageChange($event)"> </paging-no-load>
</div>
<div >
<ul *ngIf="orcidResultsNum >0 && orcidResultsToShow.length > 0 " class="list-group">
<li *ngFor=" let item of orcidResultsToShow " [class]="(isSelected(authorId+item['put-code']))?'list-group-item disabled':'list-group-item'">
<span *ngIf="!item.URL" >{{item['work-title']['title'].value}}</span>
<span *ngIf="!isSelected(authorId+item['put-code'])" (click)="add(item,authorId+item['put-code'],'orcid', 'publication', '', item['work-title']['title'].value)" aria-hidden="true" class= " btn glyphicon glyphicon-plus"></span>
</li>
</ul>
<div *ngIf="orcidResultsNum == 0" class = "alert alert-info " > No results found </div>
</div>
</div>
</div>
</div>
</div>

View File

@ -4,7 +4,6 @@
<title>OpenAIRE</title>
<meta charset="UTF-8">
<meta name="description" content="Open Access Infrastructure for Europe ">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js" ></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">