enable inline linking from landing pages pubs/data -> contexts/ projects, project -> pubs/data

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@46078 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2017-03-01 10:29:24 +00:00
parent 91c6b0ed47
commit 22f772851b
22 changed files with 187 additions and 87 deletions

View File

@ -65,7 +65,7 @@ import{DOI} from '../../utils/string-utils.class';
<button class="uk-button uk-align-right" *ngIf="!isSelected(result.id)"
(click)="add(result, result.id, 'dataset', 'openaire', result['title'].name, result['title'].url, result.year, result['title'].accessMode)"> <i aria-hidden="true" class= "uk-icon-plus clickable"></i></button>
</div>
<span *ngIf="result.publisher" class="uk-article-meta">Publisher: {{result.publisher}}</span><span *ngIf="(result.year)">({{result.year}})</span>
<span *ngIf="result.publisher" class="uk-article-meta">Publisher: {{result.publisher}}</span><span *ngIf="(result.year)" class="uk-article-meta">({{result.year}})</span>
<div *ngIf="result.authors" class="uk-article-meta">Authors: <span *ngFor="let author of result.authors let i = index">{{author.name}}{{(i < (result.authors.length-1))?"; ":""}}</span></div>
</li>

View File

@ -332,13 +332,13 @@ private getCrossrefResults (term: string, size : number, page : number) {
var result: ClaimResult ;
if(itemSource == 'crossref'){
date = (date == null) ? null : date.substring(0,10);
result = {id: id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate, date};
result = {id: id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate, date: date};
}else if (itemSource == 'orcid'){
date = (date == null) ? null : date + "-01.-01"
result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate, date};
result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate, date: date};
}else if (itemSource == 'openaire'){
//TODO put right access rights
result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: accessMode, embargoEndDate: null, date};
result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: accessMode, embargoEndDate: null, date: date};
}
console.info("Added result:"+result.date);

View File

@ -1,10 +1,13 @@
import {Component, Input} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import { Router } from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router';
import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySearch.service';
import {ClaimProject, ClaimResult} from '../claim-utils/claimEntities.class';
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
@Component({
selector: 'linking-generic',
//providers: [MdRadioDispatcher],
template: `
<div class="container uk-margin-top">
<div class="page-header">
@ -38,9 +41,7 @@ import { Router } from '@angular/router';
<div *ngIf=" show == 'context'" class="uk-width-1-1" >
<claim-contexts [selectedList]="contexts" > </claim-contexts>
</div>
<!-- <div *ngIf=" show == 'claim'" >
<claim-insert [contexts]="contexts" [publications]="publications" [datasets]="datasets" [projects]="projects" ></claim-insert>
</div>-->
<div [class]="( show=='result' && !bulkMode)?'uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 ':'uk-width-small-1-1 uk-width-medium-1-1 uk-width-large-1-1 uk-margin-top uk-grid'">
<div [class]="( show=='result' && !bulkMode)?'uk-width-small-1-1 uk-width-medium-1-1 uk-width-large-1-1 ':'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"
@ -50,8 +51,7 @@ import { Router } from '@angular/router';
<claim-selected-projects [projects]="projects" [show]="show"
(showChange)="showChange($event)" > </claim-selected-projects>
</div>
<!---claim-selected-results [datasets]="datasets" [publications]="publications" [show]="show"
(showChange)="showChange($event)" [linkToResults]="(bulkMode)?false:true" > </claim-selected-results-->
<div [class]="( show=='result' && !bulkMode)?'uk-width-small-1-1 uk-width-medium-1-1 uk-width-large-1-1 ':'uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 uk-width-xlarge-1-2'">
<claim-selected-publications [publications]="publications" [linkToResults]="(bulkMode)?false:true" [bulkMode]="bulkMode">
</claim-selected-publications>
@ -63,17 +63,14 @@ import { Router } from '@angular/router';
</div>
</div>
<div *ngIf=" show == 'claim' " class="uk-width-small-1-1 uk-width-medium-1-1 uk-width-large-1-1 uk-grid">
<!--claim-selected [contexts]="contexts" [publications]="publications" [datasets]="datasets" [projects]="projects" [show]="show"
(showChange)="showChange($event)" (publicationsChange)="publicationsChange($event)" [showAccessRights]="'true'" [bulkMode]="bulkMode"
[linkToResults]="(bulkMode)?false:true" > </claim-selected-->
<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" (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"
(showChange)="showChange($event)" > </claim-selected-projects>
<!-- Bulk Mode Results (publicationsChange)="publicationsChanged($event)" -->
</div>
</div>
<bulk-claim *ngIf=" bulkMode " [publications]="publications" > </bulk-claim>
<div class="uk-width-small-1-1 uk-width-medium-1-2 uk-width-large-1-2 uk-width-xlarge-1-2">
@ -86,20 +83,13 @@ import { Router } from '@angular/router';
[linkToResults]="(bulkMode)?false:true" [bulkMode]="bulkMode">
</claim-selected-datasets>
</div>
<!--claim-selected-results [datasets]="datasets" [publications]="publications" [show]="show"
(showChange)="showChange($event)" [linkToResults]="(bulkMode)?false:true" [showAccessRights]=true [bulkMode]="bulkMode" >
</claim-selected-results-->
<div class="uk-width-1-1 ">
<claim-insert [contexts]="contexts" [publications]="publications" [datasets]="datasets" [projects]="projects" [show] = "show"
(showChange)="showChange($event)" ></claim-insert>
</div>
</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-->
<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>
<li class="uk-pagination-next" *ngIf="show != 'claim'" (click)="next()"><a>Next <i class="uk-icon-angle-right"></i></a></li>
@ -111,10 +101,8 @@ import { Router } from '@angular/router';
`
})
//[(ngModel)]="date"
export class LinkingGenericComponent {
constructor ( private _router: Router) {
}
@Input() bulkMode: boolean = false;
sourceType:string;
targetType:string;
@ -124,11 +112,63 @@ export class LinkingGenericComponent {
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() {
/* Parameters for inline linking */
id:string = null; //entity id
type:string = null; // entity type (publication or dataset)
linkTo:string = null; // entity type (project or context)
entityTypes=["dataset", "publication", "project","context"];
sub:any =null;
constructor ( private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService, private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService) {
}
ngOnInit() {
this.sub = this.route.queryParams.subscribe(params => {
this.id = params['id'];
this.type = params['type'];
this.linkTo = params['linkTo'];
if(this.type!=null && this.linkTo!=null){
this.type = (this.entityTypes.indexOf(this.type) != -1)? this.type:'publication';
this.linkTo = (this.entityTypes.indexOf(this.linkTo) != -1 || this.linkTo == "result")? this.linkTo:'project';
this.show = this.linkTo;
this.linkType = (this.type == "project")?"project":this.linkTo;
this.addSelected(this.id,this.type);
}
});
}
addSelected(id:string,type:string){
if(type == "project"){
this.sub = this.entitySearch.fetchByType(id,type).subscribe(
data => {
console.log(data);
var item =data[0];
var project: ClaimProject = { funderId: item.funderId,funderName: item.funderName, projectId: id, projectName: item.projectName , projectAcronym: item.projectAcronym, startDate: item.startDate, endDate: item.endDate };
this.projects.push( project);
},
err => console.log("An error occured"));
}else if(type == "publication"){
this.sub = this.publicationsSearch.searchPublicationById(id).subscribe(
data => {
var item =data[0];
var result: ClaimResult = {id: id, type :type, source : "openaire", title: item['title'].name, url: item['title'].url, result: item, accessRights:item['title'].accessMode, embargoEndDate: null, date: item.year};
this.publications.push( result);
},
err => console.log("An error occured"));
}else if(type == "dataset"){
this.sub = this.datasetsSearch.searchDatasetById(id).subscribe(
data => {
var item =data[0];
console.log(item);
var result: ClaimResult = {id: id, type :type, source : "openaire", title: item['title'].name, url: item['title'].url, result: item, accessRights:item['title'].accessMode, embargoEndDate: null, date: item.year};
this.datasets.push( result);
},
err => console.log("An error occured"));
}
}
next(){
@ -150,7 +190,6 @@ export class LinkingGenericComponent {
}else if(this.show == 'context' || this.show == 'project' || this.show == 'software' ){
this.show='home';
} else if(this.show == 'claim'){
// this.show='result';
if(!this.bulkMode){
this.show='result';
}else{
@ -162,14 +201,6 @@ export class LinkingGenericComponent {
this._router.navigate( ['Search', { keyword: term }] );
}
search() {
if(this.searchType == 'publication' ){
this.show="publication";
}else{
this.show="dataset";
}
}
sourceTypeChange($event) {
this.sourceType=$event.value;
@ -179,10 +210,7 @@ export class LinkingGenericComponent {
this.targetType=$event.value;
console.log($event.value);
}
// contextsChange($event) {
// this.contexts=$event.value;
// console.log($event.value);
// }
publicationsChange($event) {
this.publications=$event.value;
}
@ -192,26 +220,22 @@ export class LinkingGenericComponent {
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

@ -16,14 +16,16 @@ 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';
@NgModule({
imports: [
SharedModule, SelectedProjectsModule, SelectedContextsModule,
SelectedPublicationsModule, SelectedDatasetsModule, // SelectedResultsModule,
ClaimProjectModule,
ClaimResultModule, ClaimContextModule, InsertClaimsModule, BulkClaimModule
SelectedPublicationsModule, SelectedDatasetsModule,
ClaimProjectModule, ClaimResultModule, ClaimContextModule, InsertClaimsModule, BulkClaimModule,
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule
],
declarations: [
LinkingHomeComponent, LinkingGenericComponent

View File

@ -20,11 +20,16 @@ import {ClaimResult} from '../../claim-utils/claimEntities.class';
<div class="row">
<div [ngClass]="showAccessRights?'col-md-8':'col-md-12'">
<span *ngIf="showAccessRights" (click)="removeDataset(dataset)" aria-hidden="true" class="btn "><i class="uk-icon-remove"></i></span>
<a *ngIf="dataset.url" target="_blank" class="uk-icon-external-link" href="{{dataset.url}}" >{{dataset.title}}</a>
<span *ngIf="!dataset.url" >{{dataset.title}}</span>
<span *ngIf="dataset.date" >({{dataset.date.substring(0,4)}})</span>
<span *ngIf="!showAccessRights" (click)="removeDataset(dataset)" aria-hidden="true" class="btn "><i class="uk-icon-remove"></i></span>
<div>
<span *ngIf="showAccessRights" (click)="removeDataset(dataset)" aria-hidden="true" class="btn "><i class="uk-icon-remove"></i></span>
<a *ngIf="dataset.url" target="_blank" href="{{dataset.url}}" >{{dataset.title}}</a>
<span *ngIf="!dataset.url" >{{dataset.title}}</span>
<span *ngIf="!showAccessRights" (click)="removeDataset(dataset)" aria-hidden="true" class="uk-button"><i class="uk-icon-remove"></i></span>
</div>
<span *ngIf="dataset.result.publisher" class="uk-article-meta">Publisher: {{dataset.result.publisher}}</span><span *ngIf="dataset.date" class="uk-article-meta">({{dataset.date.substring(0,4)}})</span>
<div *ngIf="dataset.result.authors" class="uk-article-meta">Authors: <span *ngFor="let author of dataset.result.authors let i = index">{{author.name}}{{(i < (dataset.result.authors.length-1))?"; ":""}}</span></div>
<div *ngIf="dataset.result.creator" class="uk-article-meta">Authors: <span *ngFor="let author of dataset.result.creator let i = index">{{author}}{{(i < (dataset.result.creator.length-1))?"; ":""}}</span></div>
</div>
<div class = "col-md-4">
<span *ngIf="showAccessRights && dataset.source != 'openaire'" class="dropdown">

View File

@ -18,11 +18,11 @@ import {ClaimResult} from '../../claim-utils/claimEntities.class';
<div>
<span *ngIf="showAccessRights" (click)="removePublication(pub)" aria-hidden="true" class="uk-button"><i class="uk-icon-remove"></i></span>
<a *ngIf="pub.url" target="_blank" href="{{pub.url}}" >{{pub.title}}</a>
<span *ngIf="!pub.url" >{{pub.title}}</span><span *ngIf="pub.date" class="uk-article-meta" >({{pub.date.substring(0,4)}})</span>
<span *ngIf="!pub.url" >{{pub.title}}</span>
<span *ngIf="!showAccessRights" (click)="removePublication(pub)" aria-hidden="true" class="uk-button "><i class="uk-icon-remove"></i></span>
</div>
<!-- Crossref -->
<span *ngIf="pub.result.publisher" class="uk-article-meta">Publisher: {{pub.result.publisher}}</span>
<span *ngIf="pub.result.publisher" class="uk-article-meta">Publisher: {{pub.result.publisher}}</span><span *ngIf="pub.date" class="uk-article-meta" >({{pub.date.substring(0,4)}})</span>
<div *ngIf="pub.result.author && pub.result.author.length > 0" class="uk-article-meta">Authors: <span *ngFor="let author of pub.result.author let i = index">{{author.family}} {{author.given}}{{(i < (pub.result.author.length-1))?"; ":""}}</span></div>
<div *ngIf="pub.result.editor && pub.result.editor.length" class="uk-article-meta">Editors: <span *ngFor="let author of pub.result.editor let i = index">{{author.family}} {{author.given}}{{(i < (pub.result.editor.length-1))?"; ":""}}</span></div>

View File

@ -1,6 +1,6 @@
<div class="uk-container uk-margin-top dataset">
<!--div class="container-header" -->
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
@ -157,7 +157,7 @@
</li>
<li *ngIf="datasetInfo.fundedByProjects != undefined">
<li >
<dl class="uk-description-list-line functionsSection" >
<dt class="title">Funded By</dt>
<dd
@ -178,13 +178,12 @@
</mark>
</a>
</dd>
</dl>
<dl class="uk-description-list-line functionsSection" *ngIf="datasetInfo.fundedByProjects == undefined">
<dt class="title">Funded By</dt>
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to projects</a></dd>
</dl>
</li>
<li *ngIf="datasetInfo.contexts != undefined">
<li >
<dl class="uk-description-list-line functionsSection" >
<dt class="title">Related to </dt>
<dd class="line" *ngFor="let item of datasetInfo.contexts">
@ -199,10 +198,9 @@
<span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span>
</mark>
</dd>
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to contexts</a></dd>
</dl>
<dl class="uk-description-list-line functionsSection" *ngIf="datasetInfo.contexts == undefined">
<dt class="title">Related to </dt>
</dl>
</li>
</ul>
</div>

View File

@ -4,6 +4,7 @@ import {DatasetService} from './dataset.service';
import {DatasetInfo} from '../../utils/entities/datasetInfo';
import {ActivatedRoute} from '@angular/router';
import {OpenaireProperties} from '../../utils/properties/openaireProperties'
import {RouterHelper} from '../../utils/routerHelper.class';
@Component({
selector: 'dataset',
@ -28,6 +29,7 @@ export class DatasetComponent {
public warningMessage = "";
public errorMessage = "";
public routerHelper:RouterHelper = new RouterHelper();
constructor (private _datasetService: DatasetService, private route: ActivatedRoute) {}

View File

@ -3,6 +3,7 @@ import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { SharedModule } from '../../shared/shared.module';
import { RouterModule } from '@angular/router';
import { DatasetService} from './dataset.service';
import { DatasetComponent } from './dataset.component';
@ -17,7 +18,7 @@ import { LandingModule } from '../landing.module';
@NgModule({
imports: [
//MaterialModule.forRoot(),
CommonModule, FormsModule,SharedModule, LandingModule,
CommonModule, FormsModule,SharedModule, RouterModule, LandingModule,
ResultLandingModule, DatasetRoutingModule, MetricsModule, IFrameModule, AltMetricsModule
],
declarations: [

View File

@ -191,7 +191,11 @@
<span class="uk-icon-download">{{projectInfo.funder}} progress report (CSV)</span>
</span>
</li>
<li>
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i>
Link to research results
</a>
</li>
<li>
<a href="/deposit-publications">
Deposit Publications

View File

@ -3,6 +3,7 @@ import {Observable} from 'rxjs/Observable';
import {ActivatedRoute, Params} from '@angular/router';
import {ProjectService} from './project.service';
import {ProjectInfo} from '../../utils/entities/projectInfo';
import {RouterHelper} from '../../utils/routerHelper.class';
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class';
@ -49,6 +50,7 @@ export class ProjectComponent{
public linkToSearchPublications = "";
public fetchDatasets : FetchDatasets;
public linkToSearchDatasets = "";
public routerHelper:RouterHelper = new RouterHelper();
constructor (private _projectService: ProjectService,
private route: ActivatedRoute,

View File

@ -2,6 +2,7 @@
import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { ProjectServiceModule} from './projectService.module';
// import {HtmlProgressReportService} from './htmlProgressReport.service';
@ -18,7 +19,7 @@ import { LandingModule } from '../landing.module';
@NgModule({
imports: [
CommonModule, FormsModule, LandingModule,
CommonModule, FormsModule, RouterModule, LandingModule,
ProjectRoutingModule,
SearchResultsModule, IFrameModule, MetricsModule, ReportsServiceModule, PublicationsServiceModule, DatasetsServiceModule, ProjectServiceModule
],

View File

@ -360,10 +360,11 @@
View more
</a>
</dd>
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to projects</a></dd>
</dl>
</li>
<li *ngIf="publicationInfo.contexts != undefined">
<li >
<dl class="uk-description-list-line" >
<dt class="title">Related to</dt>
<dd class="line" *ngFor="let item of publicationInfo.contexts">
@ -378,6 +379,7 @@
<span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span>
</mark>
</dd>
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to contexts</a></dd>
</dl>
</li>

View File

@ -4,6 +4,7 @@ import {PublicationService} from './publication.service';
import {PublicationInfo} from '../../utils/entities/publicationInfo';
import {ActivatedRoute} from '@angular/router';
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
import {RouterHelper} from '../../utils/routerHelper.class';
@Component({
selector: 'publication',
@ -40,7 +41,7 @@ export class PublicationComponent {
public warningMessage = "";
public errorMessage = "";
public routerHelper:RouterHelper = new RouterHelper();
constructor (private _publicationService: PublicationService,
private route: ActivatedRoute) {}

View File

@ -3,6 +3,7 @@ import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { SharedModule } from '../../shared/shared.module';
import { RouterModule } from '@angular/router';
import { PublicationService} from './publication.service';
import { PublicationComponent } from './publication.component';
@ -17,7 +18,7 @@ import { LandingModule } from '../landing.module';
@NgModule({
imports: [
CommonModule, FormsModule, LandingModule,SharedModule,
CommonModule, FormsModule, LandingModule,SharedModule, RouterModule,
ResultLandingModule, PublicationRoutingModule, IFrameModule, MetricsModule, AltMetricsModule
],
declarations: [

View File

@ -39,6 +39,21 @@ export class SearchDatasetsService {
})
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "dataset")]);
}
searchDatasetById (id: string ):any {
let url = OpenaireProperties.getSearchAPIURLLast()+"datasets/"+id+"?format=json";
let key = url+"-searchById";
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)).map(res => this.parseResults(res));
}
return this.http.get(url)
.map(res => <any> res.json())
.do(res => {
this._cache.set(key, res);
})
.map(res => this.parseResults(res));
}
searchDatasetsByDois (DOIs: string[], refineParams:string, page: number, size: number, refineFields:string[] ):any {
let link = OpenaireProperties.getSearchAPIURLLast()+"datasets";
let url = link+"?";

View File

@ -42,6 +42,20 @@ export class SearchPublicationsService {
})
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")]);
}
searchPublicationById (id: string ):any {
let url = OpenaireProperties.getSearchAPIURLLast()+"publications/"+id+"?format=json";
let key =url+"-searchById";
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)).map(res => this.parseResults(res));
}
return this.http.get(url)
.map(res => <any> res.json())
.do(res => {
this._cache.set(key, res);
})
.map(res => this.parseResults(res));
}
searchAggregators (params: string, refineParams:string, page: number, size: number ):any {

View File

@ -3,12 +3,12 @@ import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {EntitiesAutocompleteComponent} from './entitiesAutoComplete.component';
import {EntitiesSearchService} from './entitySearch.service';
import {EntitySearchServiceModule} from './entitySearchService.module';
@NgModule({
imports: [
CommonModule, FormsModule
CommonModule, FormsModule, EntitySearchServiceModule
],
declarations: [
EntitiesAutocompleteComponent
@ -16,6 +16,6 @@ import {EntitiesSearchService} from './entitySearch.service';
exports: [
EntitiesAutocompleteComponent
],
providers:[ EntitiesSearchService]
providers:[ ]
})
export class EntitiesAutocompleteModule { }

View File

@ -139,6 +139,10 @@ private fetch (link,id,oafEntityType,type){
} else {
value.label = resData['title'];
}
if(oafEntityType=="oaf:result"){
value.label = value.label.content;
value.result = resData;
}
}else if(resData["fullname"]){
if(Array.isArray(resData["fullname"])) {
value.label = resData["fullname"][0];
@ -169,6 +173,8 @@ private fetch (link,id,oafEntityType,type){
value.projectName = value.label;
value.endDate = null;
value.startDate = null;
value.funderId = resData['fundingtree']['funder']['id'];
value.funderName = resData['fundingtree']['funder']['shortname'];
if(resData.hasOwnProperty("startdate")) {
value.startDate = resData.startdate.split('-')[0];
}
@ -177,6 +183,8 @@ private fetch (link,id,oafEntityType,type){
}
}
console.info("add:"+value.label+" "+value.id);
array.push(value);
}
console.info("Parsing results.... Size:"+array.length);

View File

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

View File

@ -25,6 +25,7 @@ export class OpenaireProperties {
public static searchLinkToAdvancedPeople = "search/advanced/people";
//http://beta.services.openaire.eu:8480/search/
//http://rudie.di.uoa.gr:6081/dnet-functionality-services-2.0.0-SNAPSHOT
// Services - APIs
private static metricsAPIURL = "http://vatopedi.di.uoa.gr:8080/stats/";
@ -37,23 +38,23 @@ export class OpenaireProperties {
// 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://rudie.di.uoa.gr:6081/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
private static searchAPIURL = "http://beta.services.openaire.eu:8480/search/rest/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://rudie.di.uoa.gr:6081/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
private static searchAPIURLLAst = "http://beta.services.openaire.eu:8480/search/rest/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://rudie.di.uoa.gr:6081/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/resources";
private static searchResourcesAPIURL = "http://beta.services.openaire.eu:8480/search/rest/v2/api/resources";
//private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/";
private static searchServiveURL = "http://rudie.di.uoa.gr:6081/dnet-functionality-services-2.0.0-SNAPSHOT/rest/";
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://rudie.di.uoa.gr:6081/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";//publications?format=csv
private static csvAPIURL = "http://beta.services.openaire.eu:8480/search/rest/v2/api/";//publications?format=csv
private static searchCrossrefAPIURL = "http://api.crossref.org/works";
private static searchDataciteAPIURL = "https://search.datacite.org/api";

View File

@ -15,8 +15,9 @@ export const routes: string[] = [
'search/find/people','search/find/publications','search/find/projects','search/find/datasets','search/find/dataproviders','search/find/organizations',
'search/advanced/people','search/advanced/publications','search/advanced/projects','search/advanced/datasets','search/advanced/dataproviders','search/advanced/organizations',
'deposit-publications','deposit-datasets','deposit-publications-result','deposit-datasets-result',
'search/data-providers','search/entity-registries', 'login',
'search/data-providers','search/entity-registries',
'claims','myclaims','linking', 'bulk-linking',
'test',
'error'
'error', 'login'
];