more layout changes for linking - simplify linking - easy switch between bulk and search mode

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@46561 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2017-04-03 09:09:58 +00:00
parent f52ff453bd
commit cdbe4543f7
35 changed files with 807 additions and 539 deletions

View File

@ -116,13 +116,13 @@ export function getClaimsAdminModule() {
.then(mod => mod[(process.env.AOT ? 'ClaimsAdminModuleNgFactory' : 'ClaimsAdminModule')]);
}
export function getLinkingModule() {
return System.import('./claims/linking/linking.module' + (process.env.AOT ? '.ngfactory' : ''))
.then(mod => mod[(process.env.AOT ? 'LinkingModuleNgFactory' : 'LinkingModule')]);
}
export function getBulkLinkingModule() {
return System.import('./claims/linking/bulkLinking.module' + (process.env.AOT ? '.ngfactory' : ''))
.then(mod => mod[(process.env.AOT ? 'BulkLinkingModuleNgFactory' : 'BulkLinkingModule')]);
return System.import('./claims/linking/linkingGeneric.module' + (process.env.AOT ? '.ngfactory' : ''))
.then(mod => mod[(process.env.AOT ? 'LinkingGenericModuleNgFactory' : 'LinkingGenericModule')]);
}
// export function getBulkLinkingModule() {
// return System.import('./claims/linking/bulkLinking.module' + (process.env.AOT ? '.ngfactory' : ''))
// .then(mod => mod[(process.env.AOT ? 'BulkLinkingModuleNgFactory' : 'BulkLinkingModule')]);
// }
export function getDirectLinkingModule() {
return System.import('./claims/directLinking/directLinking.module' + (process.env.AOT ? '.ngfactory' : ''))
.then(mod => mod[(process.env.AOT ? 'DirectLinkingModuleNgFactory' : 'DirectLinkingModule')]);
@ -168,11 +168,11 @@ export function getDirectLinkingModule() {
{ path: 'search/advanced/projects', loadChildren: getAdvancedSearchProjectsModule },
{ path: 'search/advanced/people', loadChildren: getAdvancedSearchPeopleModule },
{ path: 'project-report', loadChildren: gethtmlProjectReportModule },
/*{ path: 'myclaims', loadChildren: getMyClaimsModule },
{ path: 'myclaims', loadChildren: getMyClaimsModule },
{ path: 'claims', loadChildren: getClaimsAdminModule },
{ path: 'participate/bulk-claim', loadChildren: getBulkLinkingModule },
// { path: 'participate/bulk-claim', loadChildren: getBulkLinkingModule },
{ path: 'participate/claim', loadChildren: getLinkingModule },
{ path: 'participate/direct-claim', loadChildren: getDirectLinkingModule },*/
{ path: 'participate/direct-claim', loadChildren: getDirectLinkingModule },
])
],
})

View File

@ -20,8 +20,8 @@ declare var UIkit:any;
<option *ngIf="communities" (click)="communityChanged(communities.id, communities.label)" [value]="communities.id" >{{communities.label}}</option>
</select>
</td>
<td><select class="custom-select-mini" name="select_funder" >
<option value="0" (click)="categoryChanged('0','Category:')">Select Community:</option>
<td *ngIf="selectedCommunityId != 0 && categories.length > 0"><select class="custom-select-mini" name="select_funder" >
<option value="0" (click)="categoryChanged('0','Category:')">Select Category:</option>
<option *ngFor="let category of categories" (click)="categoryChanged(category.id, category.label)" [value]="category.id" >{{category.label}}</option>
</select>
</td><td >
@ -29,8 +29,9 @@ declare var UIkit:any;
</td></tr>
</table>
<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 *ngIf="loading" class="uk-alert uk-alert-info" role="alert">Loading...</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-info" role="alert">{{infoMessage}}</div>
</div>
`
@ -56,7 +57,7 @@ public selectedCategoryLabel:string ="Category:";
public concepts = [];
public warningMessage = "";
public infoMessage = "";
public loading:boolean = false;
ngOnInit() {
this.getCommunities();
}
@ -101,16 +102,21 @@ select($event){
}
getCommunities () {
this.loading = true;
this._contextService.getCommunities().subscribe(
data => {
this.communities = data.communities;
this.loading = false;
},
err => console.log(err)
err => {
console.log(err);
this.loading = false;
}
);
}
getCategories () {
console.log(" Getting Categories... ");
this.loading = true;
this.categories=[];
if(this.selectedCommunityId != '0'){
this._contextService.getCategories(this.selectedCommunityId).subscribe(
@ -122,13 +128,17 @@ getCommunities () {
var event = {value: ""};
event.value = this.query;
}
this.loading = false;
},
err => console.log(err)
err => {
console.log(err);
this.loading = false;
}
);
}
}
getConcepts () {
this.loading = true;
if(this.selectedCategoryId != '0'){
this._contextService.getConcepts(this.selectedCategoryId, "").subscribe(
data => {
@ -139,11 +149,16 @@ getCommunities () {
event.value = this.query;
// this.filter(event);
}
this.loading = false;
},
err => console.log(err)
err => {
console.log(err);
this.loading = false;
}
);
}else{
this.concepts=[];
this.loading = false;
}
}
communityChanged(communityId:string, communityLabel:string){

View File

@ -16,8 +16,8 @@ declare var UIkit:any;
<table ><tr>
<td >
Search for projects:
</td>
<td >
</td></tr>
<tr><td >
<select class="custom-select-mini" [(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}}</option>
@ -53,10 +53,10 @@ export class ClaimProjectsSearchFormComponent {
public warningMessage = "";
public infoMessage = "";
public searchTermStream = new Subject<string>();
filtered: Observable<{}> = this.searchTermStream
.debounceTime(300).distinctUntilChanged()
.switchMap((term: string) => this._projectService.searchForProjectsObs(term, this.selectedFunderId));
// 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;
@ -65,34 +65,34 @@ constructor(private _service: ProjectService, private _projectService: SearchPro
}
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);
}
}
// 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){
this.query = "";
this.searchTermStream.next(this.query); //clear
// this.searchTermStream.next(this.query); //clear
item = item.value;
var project: ClaimProject = { funderId: this.selectedFunderId,funderName: this.selectedFunderName, projectId: item.id, projectName: item.projectName , projectAcronym: item.projectAcronym, startDate: item.startDate, endDate: item.endDate };
var project: ClaimProject = { funderId: (this.selectedFunderId=="0")?item.funderId:this.selectedFunderId,funderName: (this.selectedFunderId=="0")?item.funderName:this.selectedFunderName, projectId: item.id, projectName: item.projectName , projectAcronym: item.projectAcronym, startDate: item.startDate, endDate: item.endDate };
console.log(item);

View File

@ -1,4 +1,5 @@
<form class="uk-form uk-panel uk-panel-box uk-panel-box-default">
<form class="uk-form uk-panel uk-margin-top uk-panel-box uk-panel-box-default uk-animation">
Search for research results:
<div class="input-group">
<input class=" form-control" [(ngModel)]="keyword" name="keyword" placeholder="Type keywords..."/>
<span class="input-group-btn">
@ -7,7 +8,7 @@
</div>
</form>
<div *ngIf="keyword && keyword.length > 0 " class="uk-margin-top ">
<div *ngIf="showSearchResults" class="uk-margin-top uk-animation">
<ul class="uk-tab" data-uk-switcher="{connect:'#claimsearchtabs'}">
<li class="active"><a data-toggle="tab" >Crossref ({{(crossrefResultsNum)?crossrefResultsNum:0}})</a></li>
<li><a data-toggle="tab" >Openaire ({{ (openairePubsNum)?openairePubsNum:0 }})</a></li>

View File

@ -36,6 +36,7 @@ export class ClaimResultSearchFormComponent {
navigateTo: string = "Search";
source: string = "datacite";
type : string = "dataset";
showSearchResults:boolean=false;
// searchType ="publication";
@Input() public select:boolean = true ;
@Input() public keyword:string = '';
@ -105,6 +106,7 @@ export class ClaimResultSearchFormComponent {
this.searchOpenairePubs(this.keyword, this.size, 1);
this.searchDatacite(this.keyword,10,1);
this.searchOpenaireData(this.keyword,10,1);
this.showSearchResults = true;
}

View File

@ -16,8 +16,11 @@ import {SearchDatasetsService} from '../../services/searchDatasets.service';
<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">
<div class="uk-text-large">
{{(type=="project")?'Project':' Research result'}}:
Link {{(type=="project")?'Project':' Research result'}}:
</div>
<div class="uk-clearfix">
<start-over [results]="results" [contexts]="contexts" [projects]="projects" [linkTo]="linkTo" [type]="type" ></start-over>
</div>
<!-- inline result -->
<div *ngIf="displayedResult != null && (type =='publication' || type =='dataset' )" class="uk-panel uk-panel-box uk-panel-box-default">
<div class="uk-width-1-1" >
@ -40,14 +43,14 @@ import {SearchDatasetsService} from '../../services/searchDatasets.service';
<div class = "uk-margin-top">
<div *ngIf=" linkTo =='context' " >
<claim-selected-contexts [contexts]="contexts" [show]="show" [linkType]=linkType
<claim-selected-contexts title="with Communities" [contexts]="contexts" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" > </claim-selected-contexts>
</div>
<div *ngIf=" linkTo =='project' " >
<claim-selected-projects [projects]="projects" [show]="show" [linkType]=linkType
<claim-selected-projects title="with Projects" [projects]="projects" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" > </claim-selected-projects>
</div>
<claim-selected-results *ngIf=" linkTo =='result' " title="to link with Research Results" [results]="results" [showSearch]="show=='claim'? false: true" [showAccessRights]="show=='claim'? true: false"
<claim-selected-results *ngIf=" linkTo =='result' " title="with other Research Results" [results]="results" [showSearch]="show=='claim'? false: true" [showAccessRights]="show=='claim'? true: false"
bulkMode=false>
</claim-selected-results>

View File

@ -8,6 +8,7 @@ import {SelectedProjectsModule} from '../linking/selected/selectedProjects.modul
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';
@ -19,7 +20,7 @@ import {DatasetsServiceModule} from '../../services/datasetsService.module';
imports: [
SharedModule,
DirectLinkingRoutingModule,SelectedProjectsModule, SelectedContextsModule, SelectedPublicationsModule, InsertClaimsModule,
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, StartOverModule
],

View File

@ -8,39 +8,54 @@ import {Dates, DOI} from '../../../utils/string-utils.class';
@Component({
selector: 'bulk-claim',
template: `
<form class="uk-form">
<label for="exampleInputFile">Select a file</label>
<input id="exampleInputFile" type="file" (change)="fileChangeEvent($event)" placeholder="Upload file..." />
<button class="uk-button uk-button-success" [class.disabled]="!enableUpload" type="button" (click)="upload()">Upload</button>
</form>
<div class="uk-panel uk-panel-box uk-margin-top uk-margin-bottom">
<div class="uk-panel-badge uk-badge"><i class="uk-icon-info"></i></div>
<div class="uk-text-bold">Upload information:</div>
Upload a csv file containing a list of DOIs. For each DOI found in the file, metadata will be fetched from CrossRef.
Available results will be linked with the selected Projects and Contexts.
<div class="uk-animation uk-margin-top">
<form class="uk-form uk-panel uk-panel-box uk-panel-box-default ">
<div for="exampleInputFile">Upload a DOI csv file:</div>
<label for="exampleInputFile">Select a file</label>
<input id="exampleInputFile" type="file" (change)="fileChangeEvent($event)" placeholder="Upload file..." />
<button class="uk-button uk-button-success" [class.disabled]="!enableUpload" type="button" (click)="upload()">Upload</button>
<button class="uk-button uk-button-primary" data-uk-toggle="{target:'#uploadInfo', animation:'uk-animation-fade, uk-animation-fade'}"><i class="uk-icon-info-circle"></i> </button>
<div *ngIf="showReport" class="uk-alert uk-alert-info" role="alert" >
<div>Uploaded file contains {{allIds.length}} rows. {{foundIds.length}} results were sucefully fetched from CrossRef.</div>
<div *ngIf ="duplicateIds.length > 0" >{{duplicateIds.length}} duplicate DOIs.</div>
<div *ngIf = "notFoundIds.length > 0" >Couldn't be fetched from crossref:
<ul class="">
<li *ngFor="let id of notFoundIds">"{{id}}"</li>
</ul>
</div>
<div *ngIf = "noValidIds.length > 0" >No valid DOIs:
<ul class="">
<li *ngFor="let id of noValidIds">"{{id}}"</li>
</ul>
</div>
<div *ngIf = "allIds.length == 0 || foundIds.length == 0" > Please make sure you are using the right format for the csv file... </div>
<div class="uk-article-meta">
CSV format:
<ul class="uk-list">
<li>The format of CSV file should be "DOI","ACCESS_MODE","DATE".</li>
<li>The value "DOI" is required </li>
<li>Access mode column should have values: "OPEN","CLOSED" or "EMBARGO".</li>
<li>Date column valid format is YYYY-MM-DD and is required when access mode has value EMBARGO.</li>
<li>In case access mode is not available default value is "OPEN".</li>
</ul>
</div>
</div>
</div>
<div *ngIf="errorMessage.length > 0 " class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
<modal-loading [message]= "'Please wait...'"></modal-loading>
</form>
<div *ngIf="showReport" class="uk-alert uk-alert-info" role="alert" >
<span>{{all}} rows found in file.</span>
<span>{{found}} results fetched from CrossRef.</span>
<span *ngIf ="duplicate > 0" [title] = "'Duplicate DOIs: '+ duplicateIds.join()">{{duplicate}} DOIs were duplicates.</span>
<span *ngIf = "notFound > 0" [title] = "'Not found DOIs: '+ notFoundIds.join()" >{{notFound}} DOIs not found in crossref. ({{notFoundIds.join()}}) </span>
<span *ngIf = "all == 0 || found == 0" > Please make sure you are using the right format for the csv file... </span>
</div>
<div *ngIf="errorMessage.length > 0 " class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
<modal-loading [message]= "'Please wait...'"></modal-loading>
<div id="uploadInfo" class="uk-hidden uk-panel uk-panel-box uk-margin-top uk-margin-bottom">
<div class="uk-panel-badge uk-badge"><i class="uk-icon-info-circle"></i></div>
<div class="uk-text-bold">Upload information:</div>
Upload a csv file containing a list of DOIs. For each DOI found in the file, metadata will be fetched from CrossRef.
Available results will be linked with the selected Projects and Contexts.
<div class="uk-article-meta">
CSV format:
<ul class="uk-list">
<li>The format of CSV file should be "DOI","ACCESS_MODE","DATE".</li>
<li>The value "DOI" is required </li>
<li>Access mode column should have values: "OPEN","CLOSED" or "EMBARGO".</li>
<li>Date column valid format is YYYY-MM-DD and is required when access mode has value EMBARGO.</li>
<li>In case access mode is not available default value is "OPEN".</li>
</ul>
</div>
</div>
</div>
`
})
@ -53,14 +68,12 @@ export class BulkClaimComponent {
resultsFromSearch:number;
@Input() public select:boolean = true ;
@Input() public publications;
all:number = 0;
allIds:string[] = [];
found:number = 0;
foundIds:string[] = [];
duplicate:number = 0;
duplicateIds:string[] = [];
notFound:number = 0;
notFoundIds:string[] = [];
noValidIds:string[] = [];
showReport:boolean = false;
showInfo :boolean = false;
@ViewChild (ModalLoading) loading : ModalLoading ;
@ -85,21 +98,17 @@ export class BulkClaimComponent {
this.makeFileRequest("http://localhost:8000/upload", [], this.filesToUpload).then((result) => {
var rows = (result as any).split('\n'); // I have used space, you can use any thing.
var i = 0;
this.all = 0;
this.duplicate = 0;
this.duplicateIds = [];
this.allIds = [];
this.found = 0;
this.foundIds = [];
this.noValidIds = [];
this.publications.slice(0,this.publications.length);
this.notFound = 0;
this.notFoundIds = [];
for(i=0;i<rows.length;i++){
if(rows[i] && rows[i] != null ){
var values = rows[i].split(',');
this.all++;
var id=this.removeDoubleQuotes(values[0]);
if(DOI.isValidDOI(id)){
var accessMode = (values[1] != undefined) ? this.removeDoubleQuotes(values[1]):"OPEN";
@ -107,12 +116,13 @@ export class BulkClaimComponent {
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.duplicate++;
this.duplicateIds.push(id);
}else{
this.allIds.push(id);
this.fetchResult(id,accessMode,embargoDate);
}
}else{
this.noValidIds.push(id);
}
}
@ -175,7 +185,6 @@ export class BulkClaimComponent {
var crossrefResult = data.items[0];
if(data.items.length > 0){
this.found++;
this.foundIds.push(id);
var result = {id: id, type :'publication', source : 'crossref',
title: crossrefResult.title,url: crossrefResult.URL, result: crossrefResult, accessRights: accessMode, embargoEndDate: date, date : crossrefResult.created['date-time']};
@ -183,14 +192,12 @@ export class BulkClaimComponent {
}else{
this.notFound++;
this.notFoundIds.push(id);
}
this.endOfFetching();
},
err => {
console.log(err);
this.notFound++;
this.notFoundIds.push(id);
this.endOfFetching();
}
@ -198,7 +205,7 @@ export class BulkClaimComponent {
}
endOfFetching(){
if(this.all == this.found+this.notFound+ this.duplicate ){
if(this.allIds.length == this.foundIds.length+this.notFoundIds.length+ this.duplicateIds.length+this.noValidIds.length ){
this.showReport = true;
this.enableUpload = true;
}

View File

@ -1,14 +1,14 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { BulkLinkingComponent } from './bulkLinking.component';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: BulkLinkingComponent},
])
]
})
export class BulkLinkingRoutingModule { }
// import { NgModule } from '@angular/core';
// import { RouterModule } from '@angular/router';
//
// import { BulkLinkingComponent } from './bulkLinking.component';
//
// @NgModule({
// imports: [
// RouterModule.forChild([
// { path: '', component: BulkLinkingComponent},
//
// ])
// ]
// })
// export class BulkLinkingRoutingModule { }

View File

@ -1,16 +1,16 @@
import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable';
@Component({
selector: 'bulk-linking',
//providers: [MdRadioDispatcher],
template: `
<linking-generic [bulkMode]=true> </linking-generic>
`
})
//[(ngModel)]="date"
export class BulkLinkingComponent {
constructor () {
}
}
// import {Component, Input} from '@angular/core';
// import {Observable} from 'rxjs/Observable';
//
// @Component({
// selector: 'bulk-linking',
// //providers: [MdRadioDispatcher],
// template: `
// <linking-generic [bulkMode]=true> </linking-generic>
// `
//
// })
// //[(ngModel)]="date"
// export class BulkLinkingComponent {
// constructor () {
// }
// }

View File

@ -1,20 +1,20 @@
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 { }
// 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

@ -200,7 +200,68 @@ private errorsInClaimsInsertion(insertedIds, errorInClaims){
var claim = { claimedBy : user, sourceId : result.id, sourceType : result.type, sourceCollectedFrom: result.source, sourceAccessRights: result.accessRights, sourceEmbargoEndDate: 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 = {};
entity["originalId"]="";
entity["title"]="";
entity["authors"]=[];
entity["publisher"]="";
entity["description"]="";
entity["language"]="";
entity["type"]=result.type;
entity["pids"]= [];//{type:string, value:string}[];
entity["licenseCode"]=result.accessRights;
if(result.accessRights == "EMBARGO"){
entity["embargoEndDate"]=result.embargoEndDate;
}
entity["resourceType"]="";
entity["url"]="";
entity["collectedFromId"]="";
entity["linksToProjects"]=[];
entity["contexts"]=[];
for(var i =0; i < contexts.length; i++){
entity["contexts"].push(contexts[i].concept.id);
}
/*
{
"originalId": "ORIG_ID_12345",
"title": "TEST TITLE",
"authors": [
"Michele Artini",
"Claudio Atzori",
"Alessia Bardi"
],
"publisher": "Test publisher",
"description": "DESCRIPTION DESCRIPTION DESCRIPTION DESCRIPTION DESCRIPTION DESCRIPTION",
"language": "ita",
"pids": [
{
"type": "doi",
"value": "10.000/xyz-123"
},
{
"type": "oai",
"value": "oai:1234"
}
],
"licenseCode": "OPEN",
"resourceType": "0001",
"url": "http://test.it/xyz",
"collectedFromId": "opendoar____::2659",
"hostedById": "opendoar____::2367",
"linksToProjects": [
"info:eu-repo/grantAgreement/EC/FP7/283595/EU//OpenAIREplus",
"info:eu-repo/grantAgreement/EC/FP7/244909/EU/Making Capabilities Work/WorkAble"
],
"contexts": [
"egi::classification::natsc::math::pure",
"egi::classification::natsc::math::stats"
]
}
*/
}
confirmOpen(){
this.alert.cancelButton = true;
this.alert.okButton = true;

View File

@ -1,12 +1,12 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { LinkingComponent } from './linking.component';
import { LinkingGenericComponent } from './linkingGeneric.component';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: LinkingComponent},
{ path: '', component: LinkingGenericComponent},
])
]

View File

@ -1,16 +1,16 @@
import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {LinkingGenericComponent} from './linkingGeneric.component';
@Component({
selector: 'linking',
template: `
<linking-generic [bulkMode]=false> </linking-generic>
`
})
export class LinkingComponent {
constructor () {
}
}
// import {Component, Input} from '@angular/core';
// import {Observable} from 'rxjs/Observable';
// import {LinkingGenericComponent} from './linkingGeneric.component';
//
// @Component({
// selector: 'linking',
// template: `
// <linking-generic [bulkMode]=false> </linking-generic>
// `
//
// })
// export class LinkingComponent {
// constructor () {
// }
//
// }

View File

@ -1,19 +1,19 @@
import { NgModule } from '@angular/core';
import { SharedModule } from '../../shared/shared.module';
import { LinkingComponent } from './linking.component';
import { LinkingRoutingModule } from './linking-routing.module';
import {LinkingGenericModule} from './linkingGeneric.module';
@NgModule({
imports: [
SharedModule,
LinkingRoutingModule,
LinkingGenericModule
],
declarations: [
LinkingComponent
], exports:[LinkingComponent]
})
export class LinkingModule { }
// import { NgModule } from '@angular/core';
//
// import { SharedModule } from '../../shared/shared.module';
// import { LinkingComponent } from './linking.component';
// import { LinkingRoutingModule } from './linking-routing.module';
// import {LinkingGenericModule} from './linkingGeneric.module';
//
// @NgModule({
// imports: [
// SharedModule,
// LinkingRoutingModule,
// LinkingGenericModule
//
// ],
// declarations: [
// LinkingComponent
// ], exports:[LinkingComponent]
// })
// export class LinkingModule { }

View File

@ -11,56 +11,48 @@ import {SearchDatasetsService} from '../../services/searchDatasets.service';
template: `
<div class="container uk-margin-top">
<div class="page-header">
<div *ngIf=" bulkMode " class="uk-float-right uk-badge uk-badge-notification">
<span class="uk-text-center uk-margin-top uk-text-medium"> <i class="uk-icon-upload"></i> Bulk mode</span>
</div>
<h1>Linking</h1>
</div>
<linking-home *ngIf=" show == 'home' " [bulkMode]="bulkMode" (linkTypeChange)="linkTypeChange($event)" ></linking-home>
<start-over [results]="results" [contexts]="contexts" [projects]="projects" ></start-over>
<ul class="uk-pagination">
<li class="uk-pagination-previous" *ngIf="show != 'result' " (click)="prev()"><a><i class="uk-icon-angle-left"></i> Previous</a></li>
<li class="uk-pagination-next" *ngIf="show != 'claim' " (click)="next()"><a>Next <i class="uk-icon-angle-right"></i></a></li>
<li class="uk-pagination-next" *ngIf="show == 'claim' " (click)="next()">
<claim-insert [contexts]="contexts" [results]="results" [projects]="projects" [show] = "show"
(showChange)="showChange($event)" ></claim-insert>
<div *ngIf=" show != 'home' && show != 'myclaims' " >
<ul *ngIf=" show != 'myclaims' " class="uk-breadcrumb">
<li *ngIf="linkType == 'project'" [class]="(show == 'project' )?'uk-active':''"><a *ngIf="show != 'project'" (click)="showChangedType('project')" >Project</a><span *ngIf="show == 'project'">Project</span></li>
<li *ngIf="linkType == 'context'" [class]="(show == 'context' )?'uk-active':''"><a *ngIf="show != 'context'" (click)="showChangedType('context')" >Context</a><span *ngIf="show == 'context'">Context</span></li>
<li *ngIf="linkType == 'software'" [class]="(show == 'software' )?'uk-active':''"><a *ngIf="show != 'software'" (click)="showChangedType('software')" >Software</a><span *ngIf="show == 'software'">Software</span> </li>
<li *ngIf="!bulkMode " [class]="(show == 'result' || show == 'publication' || show == 'dataset')?'uk-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 *ngIf="!bulkMode " [class]="(show == 'claim')?'uk-active':''"><span *ngIf="show == 'claim'">Link</span><a *ngIf="show != 'claim'" (click)="showChangedType('claim')">Link</a> </li>
<li *ngIf="bulkMode " [class]="(show == 'claim' )?'uk-active':''"><span *ngIf="show == 'claim'">Upload & Link</span><a *ngIf="show != 'claim'" (click)="showChangedType('claim')">Upload & Link</a> </li>
</li>
</ul>
<!--div *ngIf=" show != 'claim' && show != 'myclaims' " class="uk-grid" -->
<!-- link with Projects & Contexts -->
<div class="uk-width-small-1-1 uk-width-medium-1-1 uk-width-large-1-1 uk-grid">
<div class="uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 uk-width-xlarge-1-2 ">
<claim-selected-contexts title="link Communities" [contexts]="contexts" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" > </claim-selected-contexts>
</div>
<div class="uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 uk-width-xlarge-1-2 ">
<claim-selected-projects title="link Projects" [projects]="projects" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" > </claim-selected-projects>
</div>
</div>
<!-- Research Results -->
<div class="uk-width-small-1-1 uk-width-medium-1-1 uk-width-large-1-1">
<claim-selected-results title= "Research Results" [results]="results" [bulkMode]="bulkMode" [showSearch]="show=='claim'|| bulkMode? false: true" [showAccessRights]="show=='claim' || bulkMode? true: false">
<claim-selected-results title= "with Research Results" [results]="results" [bulkMode]="bulkMode" [showSearch]="show=='claim'|| bulkMode? false: true" [showAccessRights]="show=='claim' || bulkMode? true: false">
</claim-selected-results>
</div>
<bulk-claim *ngIf=" bulkMode " [publications]="results" > </bulk-claim>
<!-- link with Projects & Contexts -->
<div class="uk-width-small-1-1 uk-width-medium-1-1 uk-width-large-1-1 uk-grid">
<div class="uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 uk-width-xlarge-1-2 ">
<claim-selected-contexts [contexts]="contexts" [show]="show"[linkType]=linkType
(showChange)="showChange($event)" > </claim-selected-contexts>
</div>
<div class="uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 uk-width-xlarge-1-2 ">
<claim-selected-projects [projects]="projects" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" > </claim-selected-projects>
</div>
</div>
<div *ngIf=" show == 'claim' " class="uk-width-small-1-1 uk-width-medium-1-1 uk-width-large-1-1 uk-grid">
<div class="uk-width-1-1 ">
<claim-insert [contexts]="contexts" [results]="results" [projects]="projects" [show] = "show"
(showChange)="showChange($event)" ></claim-insert>
</div>
</div>
<ul *ngIf="show != 'home'" class="uk-pagination">
<li class="uk-pagination-previous" (click)="prev()"><a><i class="uk-icon-angle-left"></i> Previous</a></li>
<ul class="uk-pagination">
<li class="uk-pagination-previous" *ngIf="show != 'result' " (click)="prev()"><a><i class="uk-icon-angle-left"></i> Previous</a></li>
<li class="uk-pagination-next" *ngIf="show != 'claim' " (click)="next()"><a>Next <i class="uk-icon-angle-right"></i></a></li>
<li class="uk-pagination-next" *ngIf="show == 'claim' " (click)="next()">
<claim-insert [contexts]="contexts" [results]="results" [projects]="projects" [show] = "show"
(showChange)="showChange($event)" ></claim-insert>
</li>
</ul>
</div>
</div>
</div>
`
@ -75,7 +67,7 @@ export class LinkingGenericComponent {
contexts=[];
projects=[];
results = [];
show = "home";
show = "result";
date='8-6-2016';
keyword: string = "";
linkType:string ="project"; // link type (selected in home page) : project, context, software, etc
@ -101,19 +93,12 @@ export class LinkingGenericComponent {
}
}
prev(){
if(this.show == 'result'){
this.show = 'home'//this.linkType;
} else if(this.show == 'claim'){
if(!this.bulkMode){
this.show='result';
}else{
this.show = "home";
}
if(this.show == 'claim'){
this.show='result';
}
}
resultsChange($event) {
this.results=$event.value;
}

View File

@ -4,25 +4,23 @@ import { SharedModule } from '../../shared/shared.module';
import {SelectedProjectsModule} from './selected/selectedProjects.module';
import {SelectedContextsModule} from './selected/selectedContexts.module';
import {SelectedPublicationsModule} from './selected/selectedResults.module';
import {InsertClaimsModule} from './insertClaim/insertClaim.module';
import {BulkClaimModule} from './bulkClaim/bulkClaim.module';
import {LinkingHomeComponent} from './linkingHome.component';
import {LinkingGenericComponent} from './linkingGeneric.component';
import {EntitySearchServiceModule} from '../../utils/entitiesAutoComplete/entitySearchService.module';
import {PublicationsServiceModule} from '../../services/publicationsService.module';
import {DatasetsServiceModule} from '../../services/datasetsService.module';
import { LinkingRoutingModule } from './linking-routing.module';
import {StartOverModule} from '../claim-utils/startOver.module';
@NgModule({
imports: [
SharedModule, SelectedProjectsModule, SelectedContextsModule,
SelectedPublicationsModule,
InsertClaimsModule, BulkClaimModule,
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule
SelectedPublicationsModule,
InsertClaimsModule,
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, LinkingRoutingModule, StartOverModule
],
declarations: [
LinkingHomeComponent, LinkingGenericComponent
LinkingGenericComponent
], exports:[
LinkingGenericComponent ]
})

View File

@ -1,57 +1,57 @@
import {Component, Output, EventEmitter, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable';
@Component({
selector: 'linking-home',
template: `
<div class="uk-grid">
<div class="uk-width-1-2"> <div class="uk-panel uk-panel-box uk-text-center uk-margin-top ">
<a (click)="select('project')"><span class="uk-text-large">Link with project</span></a>
<p class="card-text">Link your research result with funded projects.</p>
</div></div>
<div class="uk-width-1-2"> <div class="uk-panel uk-panel-box uk-text-center uk-margin-top ">
<a (click)="select('context')" ><span class="uk-text-large">Link with Community</span> </a>
<p class="card-text">Link your research result with research communities.</p>
</div> </div>
<!--div class="uk-width-1-2"> <div class="uk-panel uk-panel-box uk-text-center uk-margin-top ">
<a (click)="select('software')" >
<h4 class="card-title">Link with Software</h4>
<p class="card-text">Link your research result with software.</p>
</a>
</div> </div-->
<div class="uk-width-1-2" *ngIf=" !bulkMode ">
<div class="uk-panel uk-panel-box uk-text-center uk-margin-top ">
<a href="/participate/bulk-claim" > <span class="uk-text-large"><i class="uk-icon-upload"> </i> Bulk mode linking</span></a>
<p class="card-text">Link Research Results to projects & communities, providing a CSV file with research results' DOIs</p>
</div>
</div>
<div class="uk-width-1-2" *ngIf=" bulkMode ">
<div class="uk-panel uk-panel-box uk-text-center uk-margin-top ">
<a href="/participate/claim" > <span class="uk-text-large"><i class="uk-icon-search"></i>Linking</span></a>
<p class="card-text">Search for Research Results and link them to projects & communities</p>
</div>
</div>
</div>
`
})
export class LinkingHomeComponent {
@Output() linkTypeChange = new EventEmitter();
@Input() bulkMode:boolean = false;
linkType:string = "project";
select(type:string){
this.linkType = type;
this.linkTypeChange.emit({
value: this.linkType
});
}
}
// import {Component, Output, EventEmitter, Input} from '@angular/core';
// import {Observable} from 'rxjs/Observable';
//
// @Component({
// selector: 'linking-home',
// template: `
//
//
// <div class="uk-grid">
// <div class="uk-width-1-2"> <div class="uk-panel uk-panel-box uk-text-center uk-margin-top ">
// <a (click)="select('project')"><span class="uk-text-large">Link with project</span></a>
// <p class="card-text">Link your research result with funded projects.</p>
// </div></div>
//
// <div class="uk-width-1-2"> <div class="uk-panel uk-panel-box uk-text-center uk-margin-top ">
// <a (click)="select('context')" ><span class="uk-text-large">Link with Community</span> </a>
// <p class="card-text">Link your research result with research communities.</p>
// </div> </div>
// <!--div class="uk-width-1-2"> <div class="uk-panel uk-panel-box uk-text-center uk-margin-top ">
// <a (click)="select('software')" >
// <h4 class="card-title">Link with Software</h4>
// <p class="card-text">Link your research result with software.</p>
// </a>
// </div> </div-->
// <div class="uk-width-1-2" *ngIf=" !bulkMode ">
// <div class="uk-panel uk-panel-box uk-text-center uk-margin-top ">
// <a href="/participate/bulk-claim" > <span class="uk-text-large"><i class="uk-icon-upload"> </i> Bulk mode linking</span></a>
// <p class="card-text">Link Research Results to projects & communities, providing a CSV file with research results' DOIs</p>
//
// </div>
// </div>
// <div class="uk-width-1-2" *ngIf=" bulkMode ">
// <div class="uk-panel uk-panel-box uk-text-center uk-margin-top ">
// <a href="/participate/claim" > <span class="uk-text-large"><i class="uk-icon-search"></i>Linking</span></a>
// <p class="card-text">Search for Research Results and link them to projects & communities</p>
//
// </div>
// </div>
//
// </div>
//
// `
//
// })
//
// export class LinkingHomeComponent {
// @Output() linkTypeChange = new EventEmitter();
// @Input() bulkMode:boolean = false;
// linkType:string = "project";
// select(type:string){
// this.linkType = type;
// this.linkTypeChange.emit({
// value: this.linkType
// });
// }
//
// }

View File

@ -6,8 +6,8 @@ import {ClaimContext} from '../../claim-utils/claimEntities.class';
<!-- Contexts -->
<div *ngIf="this.linkType == 'context'" class="uk-accordion" data-uk-accordion="{showfirst:true}">
<h3 class="uk-accordion-title"><i class="uk-icon-caret-square-o-right"></i> to link with Communities ({{(contexts.length)}})</h3>
<div class="uk-accordion" data-uk-accordion="{showfirst:true}">
<h3 class="uk-accordion-title"><i class="uk-icon-caret-square-o-right"></i> {{title}} ({{(contexts.length)}})</h3>
<div class="uk-accordion-content" >
<div class="uk-clearfix"><button *ngIf=" !showsearch " (click)="showsearch = true;" class="uk-button uk-animation uk-float-right">Add more <i class="uk-icon-plus"></i></button></div>
<claim-contexts-search-form *ngIf=" showsearch " [selectedList]="contexts" (contextSelected)="contextSelected($event)" > </claim-contexts-search-form>
@ -18,11 +18,11 @@ import {ClaimContext} from '../../claim-utils/claimEntities.class';
</li>
</ul>
<span *ngIf="contexts.length == 0 " class="uk-alert uk-alert-primary">There are no contexts</span>
<div *ngIf="contexts.length == 0 " class="uk-alert uk-alert-primary">There are no communities</div>
</div>
</div>
<div *ngIf="this.linkType != 'context'" class="uk-accordion" data-uk-accordion="{showfirst:false}">
<h3 class="uk-accordion-title"><i class="uk-icon-caret-square-o-right"></i> Concepts ({{(contexts.length)}})</h3>
<!--div *ngIf="this.linkType != 'context'" class="uk-accordion" data-uk-accordion="{showfirst:false}">
<h3 class="uk-accordion-title"><i class="uk-icon-caret-square-o-right"></i>{{title}} ({{(contexts.length)}})</h3>
<div class="uk-accordion-content" >
<div class="uk-clearfix"><button *ngIf=" !showsearch " (click)="showsearch = true;" class="uk-button uk-float-right">Add more <i class="uk-icon-plus"></i></button></div>
<claim-contexts-search-form *ngIf=" showsearch " [selectedList]="contexts" (contextSelected)="contextSelected($event)" > </claim-contexts-search-form>
@ -33,9 +33,9 @@ import {ClaimContext} from '../../claim-utils/claimEntities.class';
</li>
</ul>
<div *ngIf="contexts.length == 0 " class="uk-alert uk-alert-primary">There are no communities to link with.</div>
<div *ngIf="contexts.length == 0 " class="uk-alert uk-alert-primary">There are no communities.</div>
</div>
</div>
</div-->
`
@ -46,17 +46,18 @@ export class ClaimSelectedContextsComponent {
this.todayDate=( myDate.getFullYear()+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ;
this.nextDate= ( (myDate.getFullYear()+100)+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ;
//2015-05-01
if(this.linkType == "context"){
// if(this.linkType == "context"){
this.showsearch = true
}else{
this.showsearch = false;
}
// }else{
// this.showsearch = false;
// }
}
@Input() contexts:ClaimContext[];
@Input() componentClass:string = ""; //"" or "col-sm-6" for horizontal display (besides projects)
@Input() show='home';
@Input() title='Communities';
@Input() linkType:string = "project";
@Input() hideType;
@ -85,7 +86,7 @@ export class ClaimSelectedContextsComponent {
}
contextSelected($event) {
this.showsearch = false;
// this.showsearch = false;
}
}

View File

@ -6,8 +6,8 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
selector: 'claim-selected-projects',
template: `
<div *ngIf="this.linkType == 'project'" class="uk-accordion" data-uk-accordion="{showfirst:true}">
<h3 class="uk-accordion-title"><i class="uk-icon-caret-square-o-right"></i> to link with Projects ({{(projects.length)}})
<div class="uk-accordion" data-uk-accordion="{showfirst:true}">
<h3 class="uk-accordion-title"><i class="uk-icon-caret-square-o-right"></i> {{title}} ({{(projects.length)}})
</h3>
@ -20,11 +20,11 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
<span (click)="removeProject(project)" aria-hidden="true" class="uk-button "><i class="uk-icon-remove"></i></span>
</li>
</ul>
<span *ngIf="projects.length == 0 " class="uk-alert uk-alert-primary">There are no projects</span>
<div *ngIf="projects.length == 0 " class="uk-alert uk-alert-primary">There are no projects</div>
</div>
</div>
<div *ngIf="this.linkType != 'project'" class="uk-accordion" data-uk-accordion="{showfirst:false}">
<h3 class="uk-accordion-title"><i class="uk-icon-caret-square-o-right"></i> Projects ({{(projects.length)}})
<!--div *ngIf="this.linkType != 'project'" class="uk-accordion" data-uk-accordion="{showfirst:false}">
<h3 class="uk-accordion-title"><i class="uk-icon-caret-square-o-right"></i> {{title}} ({{(projects.length)}})
</h3>
@ -33,13 +33,13 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
<claim-projects-search-form *ngIf=" showsearch " [selectedProjects]="projects" (projectSelected)="projectSelected($event)" > </claim-projects-search-form>
<ul class="uk-list uk-list-line">
<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>
<a [queryParams]="routerHelper.createQueryParam('projectId',project.projectId)" routerLinkActive="router-link-active" routerLink="/search/project" >{{project.funderName}} | {{project.projectName}} {{(project.projectAcronym)?'('+project.projectAcronym+')':''}} </a>
<span (click)="removeProject(project)" aria-hidden="true" class="uk-button "><i class="uk-icon-remove"></i></span>
</li>
</ul>
<div *ngIf="projects.length == 0 " class="uk-alert uk-alert-primary">There are no projects to link with.</div>
</div>
</div>
</div-->
`
})
@ -50,17 +50,18 @@ ngOnInit() {
var myDate = new Date();
this.todayDate=( myDate.getFullYear()+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ;
this.nextDate= ( (myDate.getFullYear()+100)+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ;
if(this.linkType == "project"){
// if(this.linkType == "project"){
this.showsearch = true
}else{
this.showsearch = false;
}
// }else{
// this.showsearch = false;
// }
//2015-05-01
}
@Input() projects: ClaimProject[];
@Input() show='home';
@Input() title='Projects';
@Input() linkType:string = "project";
@Input() hideType;
@Input() bulkMode:boolean = false;
@ -91,7 +92,7 @@ if(type != this.show){
}
}
projectSelected($event) {
this.showsearch = false;
// this.showsearch = false;
}

View File

@ -13,12 +13,17 @@ import {Dates} from '../../../utils/string-utils.class';
<h3 class="uk-accordion-title" ><i class="uk-icon-caret-square-o-right"></i> {{title}} ({{results.length}}) </h3>
<div class="uk-accordion-content uk-grid uk-width-1-1" >
<div *ngIf="showSearch " class="uk-width-1-2">
<claim-result-search-form [selectedResults]="results" (resultsChange)="resultsChanged($event)" > </claim-result-search-form>
<div *ngIf="showSearch " class="uk-width-1-2 ">
<div class="uk-clearfix"><button (click)="bulkMode = !bulkMode;" class="uk-button uk-animation uk-float-right">
<span *ngIf="!bulkMode">Bulk mode <i class="uk-icon-upload"></i></span>
<span *ngIf="bulkMode">Search mode <i class="uk-icon-search"></i></span>
</button></div>
<claim-result-search-form *ngIf="!bulkMode" [selectedResults]="results" (resultsChange)="resultsChanged($event)" > </claim-result-search-form>
<bulk-claim *ngIf="bulkMode" [publications]="results" > </bulk-claim>
</div>
<div [ngClass]="showAccessRights && !showSearch?'uk-width-1-1':'uk-width-1-2'">
<!--div class="uk-clearfix"><button *ngIf=" !showSearch " (click)="showSearch = true;" class="uk-button uk-float-right uk-animation ">Add more <i class="uk-icon-plus"></i></button></div-->
<div *ngIf="results.length == 0 " class="uk-alert uk-alert-primary">There are no selected research results</div>
<div *ngIf="results.length == 0 " class="uk-alert uk-alert-primary">There are no research results</div>
<ul *ngIf="results.length > 0 " class="uk-list uk-list-line">
<li *ngFor="let pub of results" >

View File

@ -5,10 +5,11 @@ import {ClaimSelectedResultsComponent} from './selectedResults.component';
import {AlertModalModule} from '../../../utils/modal/alertModal.module';
import {ClaimResultSearchFormModule} from '../../claim-utils/claimResultSearchForm.module';
import { MyDatePickerModule } from '../../../utils/my-date-picker/my-date-picker.module';
import {BulkClaimModule} from '../bulkClaim/bulkClaim.module';
@NgModule({
imports: [
SharedModule, AlertModalModule, ClaimResultSearchFormModule, MyDatePickerModule
SharedModule, AlertModalModule, ClaimResultSearchFormModule, MyDatePickerModule, BulkClaimModule
],
declarations: [
ClaimSelectedResultsComponent

View File

@ -33,14 +33,116 @@
<dd *ngIf="dataProviderInfo.countries != undefined">{{dataProviderInfo.countries}}</dd>
</dl>
<tabs [id] = "datasourceId"
<!--tabs [id] = "datasourceId"
[name] = "dataProviderInfo.title['name']"
[resultsBy] = "dataProviderInfo.resultsBy"
[tabs]="dataProviderInfo.tabs"
[statistics]="dataProviderInfo.statistics"
[organizations]="dataProviderInfo.organizations"
[_dataproviderService]="_dataproviderService">
</tabs>
</tabs-->
<div *ngIf="showTabs">
<ul class="uk-tab" data-uk-switcher="{connect:'#tab-content'}">
<li *ngFor="let tab of dataProviderInfo.tabs; let i=index" id="{{dataProviderInfo.tabs[i].content}}">
<a
(click)="search(tab.content, 1, 10)">
{{tab.name}}
<i *ngIf="tab.content == 'metricsTab'" class="uk-icon-line-chart"></i>
<i *ngIf="tab.content == 'statisticsTab'" class="uk-icon-pie-chart"></i>
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='publicationsTab'">
{{fetchPublications.searchUtils.totalResults}}
</span>
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='datasetsTab'">
{{fetchDatasets.searchUtils.totalResults}}
</span>
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='projectsTab'">
{{fetchProjects.searchUtils.totalResults}}
</span>
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='datasourcesTab'">
{{fetchDataproviders.searchUtils.totalResults}}
</span>
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='organizationsTab'">
{{dataProviderInfo.organizations.length}}
</span>
</a>
</li>
</ul>
<ul *ngIf="dataProviderInfo.tabs != undefined" id="tab-content" class="uk-switcher uk-margin custom-tab-content">
<li class="uk-animation-fade" *ngFor="let tab of dataProviderInfo.tabs; let i=index">
<publicationsTab *ngIf=" tab.content=='publicationsTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchPublications] = "fetchPublications">
</publicationsTab>
<datasetsTab *ngIf=" tab.content=='datasetsTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchDatasets]="fetchDatasets">
</datasetsTab>
<projectsTab *ngIf=" tab.content=='projectsTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchProjects]="fetchProjects">
</projectsTab>
<datasourcesTab *ngIf=" tab.content=='datasourcesTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchDataproviders]="fetchDataproviders">
</datasourcesTab>
<organizationsTab *ngIf=" tab.content=='organizationsTab'"
[organizations]="dataProviderInfo.organizations">
</organizationsTab>
<relatedDatasourcesTab *ngIf=" tab.content=='relatedDatasourcesTab'"
[dataproviderId]="id"
[fetchResults]="fetchResultsAggregators"
[type]="relatedDataprovidersResultsType">
</relatedDatasourcesTab>
<div *ngIf=" tab.content=='statisticsTab' && statsClicked">
<div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert">
There are no statistics
</div>
<div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
<p>
The results below are discovered through our pilot algorithms.
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p>
<p class="uk-text-bold">Latest Documents Timeline</p>
<i-frame [url]=docsTimelineUrl width="800" height="350"></i-frame>
<p class="uk-text-bold">Documents Types</p>
<i-frame [url]=docsTypesUrl width="800" height="350"></i-frame>
</div>
<div *ngIf="(fetchPublications.searchUtils.totalResults > 0)">
<div>
<p class="uk-text-bold">Funders in Data Providers Publications</p>
<i-frame [url]=pubsFunderUrl width="800" height="350"></i-frame>
<p class="uk-text-bold">Projects with most Publications</p>
<i-frame [url]=pubsProjectsUrl width="800" height="350"></i-frame>
</div>
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)">
<div>
<p class="uk-text-bold">Projects with most Research Data</p>
<i-frame [url]=dataProjectsUrl width="800" height="350"></i-frame>
</div>
</div>
</div>
</div>
<metrics *ngIf=" tab.content=='metricsTab' && metricsClicked"
[id]="id" [type]="'datasources'" [name]="dataProviderInfo.title['name']" (metricsResults)="metricsResults($event)">
</metrics>
<i-frame *ngIf=" tab.content=='metricsTab' && metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf=" tab.content=='metricsTab' && metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</li>
</ul>
</div>
</div>

View File

@ -4,49 +4,23 @@ import {DataProviderService} from './dataProvider.service';
import {DataProviderInfo} from '../../utils/entities/dataProviderInfo';
import {ActivatedRoute} from '@angular/router';
import { Meta} from '../../../angular2-meta';
import{TabsComponent} from './tabs.component';
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class';
import { SearchPublicationsService } from '../../services/searchPublications.service';
import { FetchDatasets } from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
import { SearchDatasetsService } from '../../services/searchDatasets.service';
import { FetchProjects } from '../../utils/fetchEntitiesClasses/fetchProjects.class';
import { SearchProjectsService } from '../../services/searchProjects.service';
import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import { SearchDataprovidersService } from '../../services/searchDataproviders.service';
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
import {RouterHelper} from '../../utils/routerHelper.class';
@Component({
selector: 'dataprovider',
templateUrl: 'dataProvider.component.html',
//template: `Heeereee`,
// providers:[ DataProviderService],
})
export class DataProviderComponent {
constructor (private element: ElementRef,
private _dataproviderService: DataProviderService,
private route: ActivatedRoute,
private _meta: Meta) {
}
ngOnInit() {
this.sub = this.route.queryParams.subscribe(data => {
this.updateTitle("Data provider");
this.updateDescription("Data provider, search, repositories, open access");
this.datasourceId = data['datasourceId'];
// console.info("Datasource id is :"+this.datasourceId);
if(this.datasourceId){
this.getDataProviderInfo(this.datasourceId);
}else{
// console.info("Datasource id not found");
}
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
});
}
ngOnDestroy() {
this.sub.unsubscribe();
}
sub: any;
datasourceId: string;
public dataProviderInfo: DataProviderInfo;
@ -63,20 +37,87 @@ export class DataProviderComponent {
public warningMessage = "";
public errorMessage = "";
public relatedDataprovidersResultsType: string;
public paramsForSearchLink = {};//: string = "";
public reloadPublications: boolean = true;
public reloadDatasets: boolean = true;
public reloadProjects: boolean = true;
public reloadDataproviders: boolean = true;
public reloadRelatedDatasources: boolean = true;
public metricsClicked: boolean;
private viewsFrameUrl: string;
private downloadsFrameUrl: string;
private totalViews: number;
private totalDownloads: number;
public statsClicked: boolean = false;
private docsTimelineUrl: string;
private docsTypesUrl:string;
private pubsFunderUrl:string;
private dataProjectsUrl:string ;
private pubsProjectsUrl:string;
public fetchPublications : FetchPublications;
public fetchDatasets: FetchDatasets;
public fetchProjects: FetchProjects;
public fetchDataproviders: FetchDataproviders;
public fetchResultsAggregators: any;
private nativeElement : Node;
public routerHelper:RouterHelper = new RouterHelper();
showTabs:boolean = false;
constructor (private element: ElementRef,
private _dataproviderService: DataProviderService,
private route: ActivatedRoute,
private _meta: Meta,
private _searchPublicationsService: SearchPublicationsService,
private _searchDatasetsService: SearchDatasetsService,
private _searchProjectsService: SearchProjectsService,
private _searchDataprovidersService: SearchDataprovidersService) {
this.fetchPublications = new FetchPublications(this._searchPublicationsService);
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
this.fetchProjects = new FetchProjects(this._searchProjectsService);
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
}
ngOnInit() {
this.sub = this.route.queryParams.subscribe(data => {
this.updateTitle("Data provider");
this.updateDescription("Data provider, search, repositories, open access");
this.datasourceId = data['datasourceId'];
if(this.datasourceId){
this.getDataProviderInfo(this.datasourceId);
}else{
// console.info("Datasource id not found");
}
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
});
}
ngOnDestroy() {
this.sub.unsubscribe();
}
getDataProviderInfo(id:string) {
this.warningMessage = '';
this.errorMessage=""
this.showTabs = false ;
if(this.datasourceId==null || this.datasourceId==''){
this.warningMessage="No valid datasource id";
// console.info("novalid");
}else{
this._dataproviderService.getDataproviderInfo(this.datasourceId).subscribe(
data => {
this.dataProviderInfo = data;
this.initTabs();
this.showTabs = true ;
this.updateTitle(this.dataProviderInfo.title.name);
this.updateDescription("Data provider, search, repositories, open access,"+this.dataProviderInfo.title.name);
// console.info(this.dataProviderInfo.resultsBy);
},
err => {
console.log(err)
@ -96,4 +137,152 @@ export class DataProviderComponent {
this._meta.setTitle(_title );
this._meta.updateMeta("og:title",_title);
}
public initTabs(){
if(this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) {
this.reloadPublications = true;
this.reloadDatasets = true;
this.reloadProjects = true;
this.reloadDataproviders = true;
this.reloadRelatedDatasources = true;
this.statsClicked = false;
this.search(this.dataProviderInfo.tabs[0].content, 1, 10);
this.count(1, 0);
this.metricsClicked = false;
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"dtsrcOpenAIRETimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"dtsrcRepoTimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"dtsrcDownloadsTimeline","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"chart","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["spline"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
this.docsTimelineUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcYear","dtsrcName":"'+this.datasourceId+'","table": "result", "fields": [{"fld": "number", "agg": "count", "type": "line", "yaxis":1, "c":true}], "xaxis":{"name": "year", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Documents"], "in": [{"f":0, "text": "Yearly"}], "filters": [{"name":"year","max":"2016","min":"1997"},{"name": "result_datasources-datasource-name", "values":[""], "to": "-1"}],"having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": "Year"}&w=600&h=250';
this.docsTypesUrl = 'https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcPubs","dtsrcName":"'+this.datasourceId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Documents"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
this.pubsFunderUrl =' https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcPubsFund","dtsrcName":"'+this.datasourceId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Documents"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
this.dataProjectsUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcProjData","dtsrcName":"'+this.datasourceId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Datasets"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
this.pubsProjectsUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcProjPubs","dtsrcName":"'+this.datasourceId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Publications"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
//if({"name": "Publications", "content": "publicationsTab"} in this.dataProviderInfo.tabs) {
if(this.dataProviderInfo.tabs.some(function (tab) {
return tab.name === 'Publications';
})) {
this.relatedDataprovidersResultsType = 'publications';
this.fetchResultsAggregators = new FetchPublications(this._searchPublicationsService);
} else {
this.relatedDataprovidersResultsType = 'datasets';
this.fetchResultsAggregators = new FetchDatasets(this._searchDatasetsService);
}
}
if(this.dataProviderInfo.resultsBy == "collectedFrom") {
//this.paramsForSearchLink = "?collectedFrom="+this.datasourceId+"&co=and";
this.paramsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'co'], [this.datasourceId, 'and']);
} else if (this.dataProviderInfo.resultsBy == "hostedBy") {
//this.paramsForSearchLink = "?hostedBy="+this.datasourceId+"&ho=and";
this.paramsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'ho'], [this.datasourceId, 'and']);
}
}
private count(page: number, size: number) {
console.info("number of tabs: "+this.dataProviderInfo.tabs.length);
for(let i=1; i<this.dataProviderInfo.tabs.length; i++) {
let content: string = this.dataProviderInfo.tabs[i].content;
if(content=='publicationsTab') {
this.countPublications(page, size);
} else if(content=='datasetsTab') {
this.countDatasets(page, size);
} else if(content=='projectsTab') {
this.countProjects(page, size);
} else if(content=='datasourcesTab') {
this.countDatasources(page, size);
}// else if(content=='relatedDatasourcesTab') {
// this.countRelatedDatasources(page, size);
//}
}
}
private search(content: string, page: number, size: number) {
console.info(content);
if(content=='publicationsTab') {
this.searchPublications(page, size);
} else if(content=='datasetsTab') {
this.searchDatasets(page, size);
} else if(content=='projectsTab') {
this.searchProjects(page, size);
} else if(content=='datasourcesTab') {
this.searchDatasources(page, size);
} else if(content=='relatedDatasourcesTab') {
this.searchRelatedDatasources(1, 0);
} else if(content=='metricsTab') {
this.metricsClicked = true;
} else if(content=='statisticsTab') {
this.statsClicked = true;
}
}
private searchPublications(page: number, size: number) {
console.info("Search publications???");
if(this.reloadPublications) {
console.info("Search publications!");
this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size);
}
this.reloadPublications = false;
}
private countPublications(page: number, size: number) {
this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size);
}
private searchDatasets(page: number, size: number) {
if(this.reloadDatasets) {
this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size);
}
this.reloadDatasets = false;
}
private countDatasets(page: number, size: number) {
this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size);
}
private searchProjects(page: number, size: number) {
if(this.reloadProjects) {
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size);
}
this.reloadProjects = false;
}
private countProjects(page: number, size: number) {
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size);
}
private searchDatasources(page: number, size: number) {
console.info("search intro");
if(this.reloadDataproviders) {
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size);
}
this.reloadDataproviders = false;
}
private countDatasources(page: number, size: number) {
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size);
}
private searchRelatedDatasources(page: number, size: number) {
if(this.reloadRelatedDatasources) {
console.info("my id is: "+this.datasourceId);
this.fetchResultsAggregators.getAggregatorResults(this.datasourceId, page, size);
}
this.reloadRelatedDatasources = false;
}
private countRelatedDatasources(page: number, size: number) {
this.fetchResultsAggregators.getAggregatorResults(this.datasourceId, page, size);
}
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
}
}

View File

@ -16,7 +16,7 @@ import {ProjectsTabComponent} from './projectsTab.component';
import {DatasourcesTabComponent} from './datasourcesTab.component';
import {OrganizationsTabComponent} from './organizationsTab.component';
import {RelatedDatasourcesTabComponent} from './relatedDatasourcesTab.component';
import {TabsComponent} from './tabs.component';
// import {TabsComponent} from './tabs.component';
import {DataProviderComponent} from './dataProvider.component';
import { DataProviderService} from './dataProvider.service';
@ -31,15 +31,14 @@ import { DataProviderRoutingModule } from './dataProvider-routing.module';
@NgModule({
imports: [
CommonModule, FormsModule, RouterModule,
DataProviderRoutingModule,
CommonModule, FormsModule, RouterModule,DataProviderRoutingModule,
TabResultModule, IFrameModule, MetricsModule, LandingModule, DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule, PublicationsServiceModule
],
declarations: [
PublicationsTabComponent, DatasetsTabComponent, StatisticsTabComponent, ProjectsTabComponent, DatasourcesTabComponent, OrganizationsTabComponent, RelatedDatasourcesTabComponent, TabsComponent,
DataProviderComponent
PublicationsTabComponent, DatasetsTabComponent, StatisticsTabComponent, ProjectsTabComponent, DatasourcesTabComponent, OrganizationsTabComponent,
RelatedDatasourcesTabComponent, DataProviderComponent
],
providers:[
DataProviderService

View File

@ -17,33 +17,11 @@ import {RouterHelper} from '../../utils/routerHelper.class';
@Component({
selector: 'tabs',
template: `
<ul *ngIf="tabs != undefined" class="uk-tab" data-uk-switcher="{connect:'#tab-content'}">
<li *ngIf="tabs.length>0" class="uk-active" id="{{tabs[0].content}}">
<a>
{{tabs[0].name}}
<i *ngIf="tabs[0].content == 'metricsTab'" class="uk-icon-line-chart"></i>
<i *ngIf="tabs[0].content == 'statisticsTab'" class="uk-icon-pie-chart"></i>
<span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='publicationsTab'">
{{fetchPublications.searchUtils.totalResults}}
</span>
<span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='datasetsTab'">
{{fetchDatasets.searchUtils.totalResults}}
</span>
<span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='projectsTab'">
{{fetchProjects.searchUtils.totalResults}}
</span>
<span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='datasourcesTab'">
{{fetchDataproviders.searchUtils.totalResults}}
</span>
<span class="uk-badge uk-badge-notification" *ngIf="tabs[0].content=='organizationsTab'">
{{organizations.length}}
</span>
</a>
</li>
<li *ngFor="let tab of tabs; let i=index">
<a *ngIf="i>0"
Tabs_0_content:{{tabs[0].content}} & length: {{tabs.length}}
<div *ngIf="showTabs">
<ul class="uk-tab" data-uk-switcher="{connect:'#tab-content'}">
<li *ngFor="let tab of tabs; let i=index" id="{{tabs[i].content}}">
<a
(click)="search(tab.content, 1, 10)">
{{tab.name}}
<i *ngIf="tab.content == 'metricsTab'" class="uk-icon-line-chart"></i>
@ -69,132 +47,35 @@ import {RouterHelper} from '../../utils/routerHelper.class';
</ul>
<ul *ngIf="tabs != undefined" id="tab-content" class="uk-switcher uk-margin custom-tab-content">
<li class="uk-animation-fade" id="firstTab-content" *ngIf="tabs.length>0">
<publicationsTab *ngIf="tabs[0].content=='publicationsTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchPublications]="fetchPublications">
</publicationsTab>
<datasetsTab *ngIf="tabs[0].content=='datasetsTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchDatasets]="fetchDatasets">
</datasetsTab>
<projectsTab *ngIf="tabs[0].content=='projectsTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchProjects]="fetchProjects">
</projectsTab>
<datasourcesTab *ngIf="tabs[0].content=='datasourcesTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchDataproviders]="fetchDataproviders">
</datasourcesTab>
<organizationsTab *ngIf="tabs[0].content=='organizationsTab'"
[organizations]="organizations">
</organizationsTab>
<relatedDatasourcesTab *ngIf="tabs[0].content=='relatedDatasourcesTab'"
[fetchResults]="fetchResultsAggregators"
[type]="relatedDataprovidersResultsType">
</relatedDatasourcesTab>
<div *ngIf="tabs[0].content=='statisticsTab' && statsClicked">
<div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert">
There are no statistics
</div>
<div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
<p>
The results below are discovered through our pilot algorithms.
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p>
<p class="uk-text-bold">Latest Documents Timeline</p>
<i-frame [url]=docsTimelineUrl width="800" height="350"></i-frame>
<p class="uk-text-bold">Documents Types</p>
<i-frame [url]=docsTypesUrl width="800" height="350"></i-frame>
</div>
<div *ngIf="(fetchPublications.searchUtils.totalResults > 0)">
<div>
<p class="uk-text-bold">Funders in Data Providers Publications</p>
<i-frame [url]=pubsFunderUrl width="800" height="350"></i-frame>
<p class="uk-text-bold">Projects with most Publications</p>
<i-frame [url]=pubsProjectsUrl width="800" height="350"></i-frame>
</div>
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)">
<div>
<p class="uk-text-bold">Projects with most Research Data</p>
<i-frame [url]=dataProjectsUrl width="800" height="350"></i-frame>
</div>
</div>
</div>
</div>
<!--projectsTab *ngIf="tabs[0].content=='projectsTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchProjects]="fetchProjects">
</projectsTab>
<datasourcesTab *ngIf="tabs[0].content=='datasourcesTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchDataproviders]="fetchDataproviders">
</datasourcesTab>
<organizationsTab *ngIf="tabs[0].content=='organizationsTab'"
[organizations]="organizations">
</organizationsTab>
<relatedDatasourcesTab *ngIf="tabs[0].content=='relatedDatasourcesTab'"
[fetchPublications]="fetchPublicationsAggregators">
</relatedDatasourcesTab-->
<!--div *ngIf="tabs[0].content=='metricsTab' && metrics == undefined" class = "uk-alert uk-alert-warning">
Metrics are currently unavailable
</div>
<div *ngIf="tabs[0].content=='metricsTab' && metrics != undefined" class="uk-panel uk-panel-box">
<b>Views: </b>{{metrics}}
</div-->
<metrics *ngIf="tabs[0].content=='metricsTab' && metricsClicked"
[id]="id" [type]="'datasources'" [name]="name" (metricsResults)="metricsResults($event)">
</metrics>
<i-frame *ngIf="tabs[0].content=='metricsTab' && metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="tabs[0].content=='metricsTab' && metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</li>
<li class="uk-animation-fade" *ngFor="let tab of tabs; let i=index">
<publicationsTab *ngIf="i>0 && tab.content=='publicationsTab'"
<publicationsTab *ngIf=" tab.content=='publicationsTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchPublications] = "fetchPublications">
</publicationsTab>
<datasetsTab *ngIf="i>0 && tab.content=='datasetsTab'"
<datasetsTab *ngIf=" tab.content=='datasetsTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchDatasets]="fetchDatasets">
</datasetsTab>
<projectsTab *ngIf="i>0 && tab.content=='projectsTab'"
<projectsTab *ngIf=" tab.content=='projectsTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchProjects]="fetchProjects">
</projectsTab>
<datasourcesTab *ngIf="i>0 && tab.content=='datasourcesTab'"
<datasourcesTab *ngIf=" tab.content=='datasourcesTab'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchDataproviders]="fetchDataproviders">
</datasourcesTab>
<organizationsTab *ngIf="i>0 && tab.content=='organizationsTab'"
<organizationsTab *ngIf=" tab.content=='organizationsTab'"
[organizations]="organizations">
</organizationsTab>
<relatedDatasourcesTab *ngIf="i>0 && tab.content=='relatedDatasourcesTab'"
<relatedDatasourcesTab *ngIf=" tab.content=='relatedDatasourcesTab'"
[dataproviderId]="id"
[fetchResults]="fetchResultsAggregators"
[type]="relatedDataprovidersResultsType">
</relatedDatasourcesTab>
<!--statisticsTab *ngIf="i>0 && tab.content=='statisticsTab'"
[fetchPublications] = "fetchPublications"
[fetchDatasets]="fetchDatasets" [id]="id">
</statisticsTab-->
<div *ngIf="i>0 && tab.content=='statisticsTab' && statsClicked">
<div *ngIf=" tab.content=='statisticsTab' && statsClicked">
<div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert">
There are no statistics
</div>
@ -217,9 +98,6 @@ import {RouterHelper} from '../../utils/routerHelper.class';
<p class="uk-text-bold">Projects with most Publications</p>
<i-frame [url]=pubsProjectsUrl width="800" height="350"></i-frame>
</div>
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)">
<div>
@ -230,18 +108,18 @@ import {RouterHelper} from '../../utils/routerHelper.class';
</div>
</div>
<metrics *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked"
<metrics *ngIf=" tab.content=='metricsTab' && metricsClicked"
[id]="id" [type]="'datasources'" [name]="name" (metricsResults)="metricsResults($event)">
</metrics>
<i-frame *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked && totalViews > 0"
<i-frame *ngIf=" tab.content=='metricsTab' && metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250">
</i-frame>
<i-frame *ngIf="i>0 && tab.content=='metricsTab' && metricsClicked && totalDownloads > 0"
<i-frame *ngIf=" tab.content=='metricsTab' && metricsClicked && totalDownloads > 0"
[url]=downloadsFrameUrl width="100%" height="250">
</i-frame>
</li>
</ul>
</div>
`
})
@ -291,7 +169,7 @@ export class TabsComponent {
private nativeElement : Node;
public routerHelper:RouterHelper = new RouterHelper();
showTabs:boolean = false;
private sub: any;
constructor (private renderer : Renderer, private element : ElementRef,private route: ActivatedRoute,
@ -306,7 +184,16 @@ export class TabsComponent {
}
ngOnInit() {
this.sub = this.route.queryParams.subscribe(data => {
this.hideTabs(true);
this.initTabs("init");
this.hideTabs(false);
}
public hideTabs(hide:boolean){
this.showTabs = !hide;
}
public initTabs(from){
console.log("\nCALL init from "+from+" "+this.tabs.length+"\n ");
if(this.tabs != undefined && this.tabs.length > 0) {
this.reloadPublications = true;
this.reloadDatasets = true;
@ -339,7 +226,6 @@ export class TabsComponent {
this.fetchResultsAggregators = new FetchDatasets(this._searchDatasetsService);
}
}
if(this.resultsBy == "collectedFrom") {
//this.paramsForSearchLink = "?collectedFrom="+this.id+"&co=and";
this.paramsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'co'], [this.id, 'and']);
@ -347,7 +233,7 @@ export class TabsComponent {
//this.paramsForSearchLink = "?hostedBy="+this.id+"&ho=and";
this.paramsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'ho'], [this.id, 'and']);
}
});
}
ngOnDestroy() {

View File

@ -15,7 +15,7 @@
<dd *ngIf="personInfo.country != undefined && personInfo.country != ''">{{personInfo.country}}</dd>
</dl>
<ul class="uk-tab" data-uk-switcher="{connect:'#tab-content'}">
<ul *ngIf="showTabs" class="uk-tab" data-uk-switcher="{connect:'#tab-content'}">
<li class="uk-active">
<a>
Publications
@ -34,7 +34,7 @@
</li>
</ul>
<ul id="tab-content" class="uk-switcher uk-margin custom-tab-content">
<ul *ngIf="showTabs" id="tab-content" class="uk-switcher uk-margin custom-tab-content">
<li class="uk-animation-fade">
<div *ngIf="fetchPublications.searchUtils.totalResults == 0" class = "uk-alert">

View File

@ -1,6 +1,6 @@
import {Component, ElementRef} from '@angular/core';
import {Component, ElementRef} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, Route} from '@angular/router';
import {PersonService} from './person.service';
import { PersonInfo } from '../../utils/entities/personInfo';
@ -32,6 +32,7 @@ export class PersonComponent {
private personId: string;
public warningMessage = "";
public errorMessage = "";
public showTabs = false;
constructor (private element: ElementRef,
private _personService: PersonService,
@ -42,11 +43,18 @@ export class PersonComponent {
console.info('person constructor');
this.fetchPublications = new FetchPublications( this._searchPublicationsService);
this.fetchDatasets = new FetchDatasets( this._searchDatasetsService);
// this.scrollUp = this._route.events.subscribe((path) => {
// element.nativeElement.scrollIntoView();
// });
}
ngOnInit() {
console.info('person init');
this.sub = this.route.queryParams.subscribe(params => {
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
this.personInfo = null;
this.updateTitle("Person");
this.updateDescription("person, publication, research data, search, open access");
@ -55,7 +63,10 @@ export class PersonComponent {
console.info("Id is :"+this.personId);
if(this.personId){
this.showTabs = false;
this.fetchPersonInfo();
this.showTabs = true;
this.searchPublications();
}else{

View File

@ -236,8 +236,8 @@
<!--li>
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i>
Link to research results
</a-->
</li>
</a>
</li-->
<li>
<a routerLinkActive="router-link-active" routerLink="/participate/deposit-publications">
Deposit Publications

View File

@ -13,15 +13,11 @@ import {RouterModule} from '@angular/router';
],
declarations: [
TabResultComponent,
],
],
providers:[
],
exports: [
TabResultComponent
]
})
export class TabResultModule { }

View File

@ -21,7 +21,7 @@ import {EntitiesSearchService} from './entitySearch.service';
<span (click)="remove(item)" aria-hidden="true" title="Remove selection" > <i class="uk-icon-remove clickable"></i> </span>
</span>
</span>
<input *ngIf = "showInput" type="text" class="auto-complete-input validate filter-input input-sm form-control " [placeholder]=placeHolderMessage [(ngModel)]=keyword (keyup)=search() >
<input *ngIf = "showInput" type="text" class="auto-complete-input validate filter-input input-sm form-control uk-form-width-small " [placeholder]=placeHolderMessage [(ngModel)]=keyword (keyup)=search() >
<!--span *ngIf="showLoading" class="uk-alert uk-alert-primary" data-uk-alert=""> <i class="uk-icon-spinner"></i> Loading... </span>
<span *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" data-uk-alert=""> {{warningMessage}} <a href="" class="uk-alert-close uk-close"></a></span-->
<div *ngIf="focus && showInput" class="uk-dropdown" aria-expanded="true" style="display:block" >
@ -80,6 +80,7 @@ export class EntitiesAutocompleteComponent {
public focus:boolean = false;
constructor (public _search:EntitiesSearchService, private myElement: ElementRef) {
this.currentFieldId=this.fieldId;
this.initialize();
}
ngOnChanges(changes: {[propKey: string]: SimpleChange}) {
@ -89,6 +90,7 @@ export class EntitiesAutocompleteComponent {
}
}
private initialize(){
this.showInput = true;
if(this.entityType == "project" && this.funderId ){
this.filtered = this.searchTermStream

View File

@ -111,14 +111,12 @@ private fetch (link,id,oafEntityType,type){
// .do(res => console.info(res))
.map(request => {
this.ready = true;
this.parse(request,oafEntityType,type);
return this.parse(request,oafEntityType,type);
}).catch((ex) => {
console.error('An error occured', ex);
return [{id:'-2',label:'Error'}];;
});
}
private search (link,keyword,oafEntityType,type){
this.ready = false;

View File

@ -37,24 +37,24 @@ export class OpenaireProperties {
private static claimsAPIURL = "http://scoobydoo.di.uoa.gr:8080/dnet-openaire-connector-service-1.0.0-SNAPSHOT/rest/claimsService/";
// private static searchAPIURL = " http://beta.services.openaire.eu/search/v2/api/";
// private searchAPIURL = "http://beta.services.openaire.eu:8480/search/rest/v2.0/api/";
private static searchAPIURL = "http://beta.services.openaire.eu:8480/search/rest/v2/api/";
// private searchAPIURL = "http://beta.services.openaire.eu/search/v2.0/api/";
private static searchAPIURL = "http://beta.services.openaire.eu/search/v2/api/";
//"http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
// private static searchAPIURLLAst = " http://beta.services.openaire.eu/search/v2/api/";
private static searchAPIURLLAst = "http://beta.services.openaire.eu:8480/search/rest/v2/api/";
private static searchAPIURLLAst = "http://beta.services.openaire.eu/search/v2/api/";
//private static searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
//private static searchAPIURLLAst = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
// private static searchResourcesAPIURL = " http://beta.services.openaire.eu/search/v2/api/resources";
private static searchResourcesAPIURL = "http://beta.services.openaire.eu:8480/search/rest/v2/api/resources";
private static searchResourcesAPIURL = "http://beta.services.openaire.eu/search/v2/api/resources";
//private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/";
private static searchServiveURL = "http://beta.services.openaire.eu:8480/search/rest/";
// private static searchServiveURL = "http://services.openaire.eu:8380/search/";
// private static searchServiveURL = "http://beta.services.openaire.eu:8480/search/";
private static csvAPIURL = "http://beta.services.openaire.eu:8480/search/rest/v2/api/";//publications?format=csv
private static csvAPIURL = "http://beta.services.openaire.eu/search/v2/api/";//publications?format=csv
private static searchCrossrefAPIURL = "http://api.crossref.org/works";
private static searchDataciteAPIURL = "https://search.datacite.org/api";

View File

@ -18,7 +18,7 @@ import {RefineFieldResultsService} from '../../services/refineFieldResults.servi
<span (click)="remove(item)" aria-hidden="true" title="Remove selection" > <i class="uk-icon-remove clickable"></i> </span>
</span>
</span>
<input *ngIf = "showInput " type="text" class="auto-complete-input validate filter-input input-sm form-control " [placeholder]=placeHolderMessage [(ngModel)]=keyword (keyup)=filter() >
<input *ngIf = "showInput " type="text" class="auto-complete-input validate filter-input input-sm form-control uk-form-width-small " [placeholder]=placeHolderMessage [(ngModel)]=keyword (keyup)=filter() >
<!--span *ngIf="showLoading" class="uk-alert uk-alert-primary" data-uk-alert=""> <i class="uk-icon-spinner"></i> Loading... </span>
<span *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" data-uk-alert=""> {{warningMessage}} <a href="" class="uk-alert-close uk-close"></a></span-->
<div *ngIf="focus && showInput" class="uk-dropdown" aria-expanded="true" style="display:block" >

View File

@ -25,6 +25,8 @@
<!-- tabs/switcher -->
<script src="assets/uikit-2.27.2/js/core/tab.min.js" type="text/javascript"></script>
<script src="assets/uikit-2.27.2/js/core/switcher.min.js" type="text/javascript"></script>
<!-- toggle -->
<script src="assets/uikit-2.27.2/js/core/toggle.min.js" type="text/javascript"></script>
<!-- Progress Bar -->
<link href="assets/uikit-2.27.2/css/components/progress.almost-flat.min.css" rel="stylesheet" type="text/css" />
<!-- Notify -->
@ -143,7 +145,9 @@
max-width: none;
background: rgba(100, 100, 100, 1);
}
.custom-select-mini{
max-width:170px !important;
}
.custom-icon {
line-height: unset;
}