Changes in claim componets to support ORP

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@52837 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2018-07-30 14:22:19 +00:00
parent 354c4eb835
commit deffcceed8
18 changed files with 189 additions and 91 deletions

View File

@ -7,7 +7,7 @@ export class ClaimResult{
public url: string;
public result: any;
public accessRights: string = "OPEN";
public embargoEndDate: string;
public embargoEndDate: string ="";
public date: string;
public authors: string[] =[];
public publisher: string;
@ -16,7 +16,7 @@ export class ClaimResult{
DOI: string;
editors=[];
journal: string;
}
export class ClaimProject{
public funderId: string;

View File

@ -2,7 +2,7 @@
<form class=" uk-padding uk-padding-medium uk-padding-remove-left uk-margin-left uk-margin-small-top" >
<div class="uk-grid">
<div class="uk-width-expand">
<div class="uk-text-lead">Search for research results <helper div="link-result-form" styleName="" tooltip=true></helper> :</div>
<div class="uk-text-lead">Search for research results <helper div="link-result-form" styleName="" tooltip=true></helper> </div>
<select [(ngModel)]="searchSource" name="select_source" (ngModelChange)="searchSourceChanged(searchSource)" class="uk-select uk-width-1-4">
<option value="openaire">in OpenAIRE </option>
<option value="crossref">in Crossref </option>
@ -43,6 +43,7 @@
<li *ngIf="searchSource == 'all' || searchSource == 'openaire'" (click)="clickTab('openairePub')" ><a>Publications <span class="uk-badge uk-badge-notification">{{ (openairePubsNum)?(openairePubsNum | number):0 }}</span></a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'openaire'" (click)="clickTab('openaireData')" ><a>Research Data <span class="uk-badge uk-badge-notification">{{(openaireDataNum==null)?'0':(openaireDataNum | number)}}</span></a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'openaire'" (click)="clickTab('openaireSoftware')" ><a>Software <span class="uk-badge uk-badge-notification">{{(openaireSoftwareNum==null)?'0':(openaireSoftwareNum | number)}}</span></a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'openaire'" (click)="clickTab('openaireORP')" ><a>Other research products <span class="uk-badge uk-badge-notification">{{(openaireORPNum==null)?'0':(openaireORPNum | number)}}</span></a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'crossref'" (click)="clickTab('crossref')" ><a>Crossref <span class="uk-badge uk-badge-notification">{{(crossrefResultsNum)?(crossrefResultsNum | number):0}}</span></a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'datacite'" (click)="clickTab('datacite')"><a>Datacite <span class="uk-badge uk-badge-notification">{{(dataciteResultsNum==null)?'0':(dataciteResultsNum | number)}}</span></a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'orcid'" (click)="clickTab('orcid')"><a>Orcid <span class="uk-badge uk-badge-notification">{{(orcidResultsNum)?(orcidResultsNum | number):0}}</span></a></li>
@ -162,6 +163,22 @@
<div>
<claim-results [localStoragePrefix]=localStoragePrefix [(results)]=openaireSoftware [(selectedResults)]=selectedResults > </claim-results>
</div>
</div>
</div>
</div>
</div>
<div *ngIf="activeTab == 'openaireORP'" id="openaireORP" class="uk-animation-fade">
<div *ngIf="openaireORPStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img class="loading-gif uk-align-center" ></div>
<div *ngIf="openaireORPStatus == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="openaireORPStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="openaireORPStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div class = "uk-margin-top">
<div *ngIf="openaireORPNum != null && openaireORPNum > 0" class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="openaireORPPage" [totalResults]="openaireORPNum" [term]="keyword" [size]="size" (pageChange)="openaireORPPageChange($event)"> </paging-no-load>
</div>
</div>
<div>
<claim-results [localStoragePrefix]=localStoragePrefix [(results)]=openaireORP [(selectedResults)]=selectedResults > </claim-results>
</div>
</div>
</div>
</div>

View File

@ -6,6 +6,7 @@ import {SearchPublicationsService} from '../../services/searchPublications.servi
import { SearchDataciteService } from '../claim-utils/service/searchDatacite.service';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {SearchSoftwareService} from '../../services/searchSoftware.service';
import {SearchOrpsService} from '../../services/searchOrps.service';
import { ErrorCodes} from '../../utils/properties/errorCodes';
import {ClaimResult} from '../claim-utils/claimEntities.class';
@ -22,6 +23,7 @@ declare var UIkit:any;
export class ClaimResultSearchFormComponent {
constructor (private _searchDataciteService: SearchDataciteService, private _searchDatasetsService:SearchDatasetsService, private _searchSoftwareService:SearchSoftwareService,
private _searchCrossrefService: SearchCrossrefService,private _searchOrcidService: SearchOrcidService, private _searchPublicationsService: SearchPublicationsService,
private _searchORPService:SearchOrpsService,
private route: ActivatedRoute) {
var myDate = new Date();
this.todayDate = myDate.getFullYear()+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ;
@ -71,6 +73,11 @@ export class ClaimResultSearchFormComponent {
openaireSoftwareStatus = this.errorCodes.NONE;
openaireSoftwarePage : number = 1;
openaireORP=[];
openaireORPNum:number = 0 ;
openaireORPStatus = this.errorCodes.NONE;
openaireORPPage : number = 1;
public warningMessage = "";
public infoMessage = "";
@ -130,9 +137,11 @@ export class ClaimResultSearchFormComponent {
this.openairePubs = [];
this.openaireData = [];
this.openaireSoftware = [];
this.openaireORP = [];
this.searchOpenairePubs(this.keyword, this.size, 1);
this.searchOpenaireData(this.keyword,this.size,1);
this.searchOpenaireSoftware(this.keyword,this.size,1);
this.searchOpenaireORP(this.keyword,this.size,1);
this.reloadOpenaire = false;
}
if((this.searchSource == "all" || this.searchSource == "crossref")&&this.reloadCrossref){
@ -501,7 +510,14 @@ openaireSoftwarePageChange($event) {
this.infoMessage = "";
}
openaireORPPageChange($event) {
this.openaireORPPage=$event.value;
this.openaireORP=[];
this.searchOpenaireORP(this.keyword,10,this.openaireORPPage);
this.warningMessage = "";
this.infoMessage = "";
}
private searchDatacite (term: string, size : number, page : number) {
this.getDataciteResults(term,size,page);
this.warningMessage = "";
@ -595,6 +611,50 @@ openaireSoftwarePageChange($event) {
this.infoMessage = "";
}
private searchOpenaireORP (term: string, size : number, page : number) {
if(this.DOIs.length > 0 ){
this.openaireORPStatus = this.errorCodes.LOADING;
this._searchORPService.searchOrpsByDois(this.DOIs, null, page, size, [], this.properties).subscribe(
data => {
if(data != null) {
this.openaireORPPage=page;
this.openaireORPNum = data[0];
this.openaireORP = this.openaire2ClaimResults(data[1],"other");
this.openaireORPStatus = this.errorCodes.DONE;
if(this.openaireORPNum == 0){
this.openaireORPStatus = this.errorCodes.NONE;
}
}
},
err => {
this.openaireORPStatus = this.errorCodes.ERROR;
console.log(err.status);
}
);
}else{
this._searchORPService.searchOrps('q='+term+'', null, page, size, [], this.properties).subscribe(
data => {
if(data != null) {
this.openaireORPPage=page;
this.openaireORPNum = data[0];
this.openaireORP = this.openaire2ClaimResults(data[1],"other");
this.openaireORPStatus = this.errorCodes.DONE;
if(this.openaireORPNum == 0){
this.openaireORPStatus = this.errorCodes.NONE;
}
}
},
err => {
this.openaireORPStatus = this.errorCodes.ERROR;
console.log(err.status);
}
);
}
this.warningMessage = "";
this.infoMessage = "";
}
private openaire2ClaimResults(data,type):ClaimResult[]{
var claimResults = [];

View File

@ -13,12 +13,13 @@ import {SearchOrcidService} from './service/searchOrcid.service';
import {PublicationsServiceModule} from '../../services/publicationsService.module';
import {DatasetsServiceModule} from '../../services/datasetsService.module';
import {SoftwareServiceModule} from '../../services/softwareService.module';
import {OrpsServiceModule} from '../../services/orpsService.module';
import {PagingModule } from '../../utils/paging.module';
import {HelperModule} from '../../utils/helper/helper.module';
@NgModule({
imports: [SharedModule, CommonModule, PublicationsServiceModule, DatasetsServiceModule, PagingModule, SearchCrossrefServiceModule,
SearchDataciteServiceModule,SoftwareServiceModule, HelperModule],
SearchDataciteServiceModule,SoftwareServiceModule, OrpsServiceModule, HelperModule],
providers:[
SearchOrcidService
],

View File

@ -21,11 +21,18 @@
<label class="uk-margin-small-right"> <input [(ngModel)]="datasetCB" type="checkbox" (ngModelChange)="changeType()" name="dataset" />
<span class="uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><ellipse fill="none" stroke="#000" cx="10" cy="4.64" rx="7.5" ry="3.14"></ellipse><path fill="none" stroke="#000" d="M17.5,8.11 C17.5,9.85 14.14,11.25 10,11.25 C5.86,11.25 2.5,9.84 2.5,8.11"></path><path fill="none" stroke="#000" d="M17.5,11.25 C17.5,12.99 14.14,14.39 10,14.39 C5.86,14.39 2.5,12.98 2.5,11.25"></path><path fill="none" stroke="#000" d="M17.49,4.64 L17.5,14.36 C17.5,16.1 14.14,17.5 10,17.5 C5.86,17.5 2.5,16.09 2.5,14.36 L2.5,4.64"></path></svg></span>
Research Data </label>
<label class="uk-margin-small-right"> <input [(ngModel)]="softwareCB" type="checkbox" (ngModelChange)="changeType()" name="software" />
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <circle fill="none" stroke="#000" cx="9.997" cy="10" r="3.31"></circle> <path fill="none" stroke="#000" d="M18.488,12.285 L16.205,16.237 C15.322,15.496 14.185,15.281 13.303,15.791 C12.428,16.289 12.047,17.373 12.246,18.5 L7.735,18.5 C7.938,17.374 7.553,16.299 6.684,15.791 C5.801,15.27 4.655,15.492 3.773,16.237 L1.5,12.285 C2.573,11.871 3.317,10.999 3.317,9.991 C3.305,8.98 2.573,8.121 1.5,7.716 L3.765,3.784 C4.645,4.516 5.794,4.738 6.687,4.232 C7.555,3.722 7.939,2.637 7.735,1.5 L12.263,1.5 C12.072,2.637 12.441,3.71 13.314,4.22 C14.206,4.73 15.343,4.516 16.225,3.794 L18.487,7.714 C17.404,8.117 16.661,8.988 16.67,10.009 C16.672,11.018 17.415,11.88 18.488,12.285 L18.488,12.285 Z"></path></svg>
</span>
Software </label>
<label class="uk-margin-small-right"> <input [(ngModel)]="softwareCB" type="checkbox" (ngModelChange)="changeType()" name="software" />
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <circle fill="none" stroke="#000" cx="9.997" cy="10" r="3.31"></circle> <path fill="none" stroke="#000" d="M18.488,12.285 L16.205,16.237 C15.322,15.496 14.185,15.281 13.303,15.791 C12.428,16.289 12.047,17.373 12.246,18.5 L7.735,18.5 C7.938,17.374 7.553,16.299 6.684,15.791 C5.801,15.27 4.655,15.492 3.773,16.237 L1.5,12.285 C2.573,11.871 3.317,10.999 3.317,9.991 C3.305,8.98 2.573,8.121 1.5,7.716 L3.765,3.784 C4.645,4.516 5.794,4.738 6.687,4.232 C7.555,3.722 7.939,2.637 7.735,1.5 L12.263,1.5 C12.072,2.637 12.441,3.71 13.314,4.22 C14.206,4.73 15.343,4.516 16.225,3.794 L18.487,7.714 C17.404,8.117 16.661,8.988 16.67,10.009 C16.672,11.018 17.415,11.88 18.488,12.285 L18.488,12.285 Z"></path></svg>
</span>
Software
</label>
<label class="uk-margin-small-right"> <input [(ngModel)]="otherCB" type="checkbox" (ngModelChange)="changeType()" name="other" />
<span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <polygon fill="none" stroke="#000" points="2.5,5.7 10,1.3 17.5,5.7 17.5,14.3 10,18.7 2.5,14.3"></polygon> <circle fill="none" stroke="#000" cx="10" cy="10" r="3.5"></circle></svg>
</span>
Other product
</label>
<label class="uk-margin-small-right"> <input [(ngModel)]="contextCB" type="checkbox" (ngModelChange)="changeType()" name="context" />
<span class="uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg></span>
Community </label>

View File

@ -92,6 +92,7 @@ export class DisplayClaimsComponent {
publicationCB = false;
datasetCB = false;
softwareCB = false;
otherCB = false;
contextCB = false;
projectCB = false;
entityTypes : string[] =[] ;
@ -246,6 +247,7 @@ handleErrors(err){
this.projectCB = false;
this.datasetCB = false;
this.softwareCB = false;
this.otherCB = false;
this.contextCB = false;
this.entityTypes = [];
this.goTo();
@ -306,6 +308,9 @@ handleErrors(err){
if(this.softwareCB){
this.entityTypes.push('software');
}
if(this.otherCB){
this.entityTypes.push('other');
}
if(this.projectCB){
this.entityTypes.push('project');
}
@ -333,6 +338,10 @@ handleErrors(err){
this.softwareCB = true;
this.entityTypes.push("software");
}
if(types.indexOf("other")!=-1){
this.otherCB = true;
this.entityTypes.push("other");
}
if(types.indexOf("project")!=-1){
this.projectCB = true;
this.entityTypes.push("project");
@ -342,7 +351,7 @@ handleErrors(err){
this.entityTypes.push("context");
}
}
if(this.publicationCB && this.datasetCB && this.softwareCB && this.contextCB && this.projectCB){
if(this.publicationCB && this.datasetCB && this.softwareCB && this.otherCB && this.contextCB && this.projectCB){
this.entityTypes=[];
}
}

View File

@ -21,6 +21,12 @@ import{EnvProperties} from '../../../utils/properties/env-properties';
</span>
<publication-title [title]="entity.title" [url]="entity.externalUrl" ></publication-title>
</div>
<div *ngIf="type == 'other'" title="Other reserch product">
<span class="uk-margin-small-right uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <polygon fill="none" stroke="#000" points="2.5,5.7 10,1.3 17.5,5.7 17.5,14.3 10,18.7 2.5,14.3"></polygon> <circle fill="none" stroke="#000" cx="10" cy="10" r="3.5"></circle></svg>
</span>
<publication-title [title]="entity.title" [url]="entity.externalUrl" ></publication-title>
</div>
<div *ngIf="type == 'project' " title="Project">
<span class="uk-margin-small-right uk-icon" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
<project-title [project]="entity" [(searchLink)]=properties.searchLinkToProject></project-title>

View File

@ -6,7 +6,13 @@ import {AlertModal} from '../../utils/modal/alert';
@Component({
selector: 'start-over',
template: `
<button (click)="confirmOpen()" class="uk-button uk-button-danger uk-align-left" > <span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="refresh" ratio="1"><path fill="none" stroke="#000" stroke-width="1.1" d="M17.08,11.15 C17.09,11.31 17.1,11.47 17.1,11.64 C17.1,15.53 13.94,18.69 10.05,18.69 C6.16,18.68 3,15.53 3,11.63 C3,7.74 6.16,4.58 10.05,4.58 C10.9,4.58 11.71,4.73 12.46,5"></path><polyline fill="none" stroke="#000" points="9.9 2 12.79 4.89 9.79 7.9"></polyline></svg></span> Clear All</button>
<!--button (click)="confirmOpen()" class="uk-button uk-button-danger uk-align-left" > <span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="refresh" ratio="1"><path fill="none" stroke="#000" stroke-width="1.1" d="M17.08,11.15 C17.09,11.31 17.1,11.47 17.1,11.64 C17.1,15.53 13.94,18.69 10.05,18.69 C6.16,18.68 3,15.53 3,11.63 C3,7.74 6.16,4.58 10.05,4.58 C10.9,4.58 11.71,4.73 12.46,5"></path><polyline fill="none" stroke="#000" points="9.9 2 12.79 4.89 9.79 7.9"></polyline></svg></span> Clear All</button-->
<span (click)="confirmOpen()" uk-tooltip="title:Remove selected" aria-expanded="false" class="uk-text-danger uk-width-small" [style]="'cursor: '+ ((results.length + projects.length + contexts.length > 0)?'pointer;':'not-allowed;')" [style.cursor]="((results.length + projects.length + contexts.length > 0)?'pointer':'not-allowed')">
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <polyline fill="none" stroke="#000" points="6.5 3 6.5 1.5 13.5 1.5 13.5 3"></polyline> <polyline fill="none" stroke="#000" points="4.5 4 4.5 18.5 15.5 18.5 15.5 4"></polyline> <rect x="8" y="7" width="1" height="9"></rect> <rect x="11" y="7" width="1" height="9"></rect> <rect x="2" y="3" width="16" height="1"></rect></svg>
</span>
</span>
<modal-alert (alertOutput)="confirmClose($event)">
</modal-alert>
`,
@ -14,13 +20,10 @@ import {AlertModal} from '../../utils/modal/alert';
})
export class StartOverComponent {
constructor () {
}
ngOnInit() {
}
}
// @Input() public inlineEntity = null;
@Input() public type:string;
@ -30,12 +33,16 @@ export class StartOverComponent {
@Input() public contexts;
@ViewChild(AlertModal) alertApplyAll;
@Input() localStoragePrefix:string = "";
confirmOpen(){
if(this.projects.length + this.results.length + this.contexts.length == 0 ){
return;
}
this.alertApplyAll.cancelButton = true;
this.alertApplyAll.okButton = true;
this.alertApplyAll.alertTitle = "Remove selected";
this.alertApplyAll.message = "This action will delete every selected entity (projects, communities, research results). Do you wish to continue?";
this.alertApplyAll.message = "Do you want to remove selected entities (projects, communities, research results)?";
this.alertApplyAll.okButtonText = "Yes";
this.alertApplyAll.cancelButtonText = "No";
this.alertApplyAll.open();
@ -59,6 +66,9 @@ export class StartOverComponent {
this.projects.splice(0, this.projects.length);
this.contexts.splice(0, this.contexts.length);
}
localStorage.removeItem(this.localStoragePrefix + "projects");
localStorage.removeItem(this.localStoragePrefix + "contexts");
localStorage.removeItem(this.localStoragePrefix + "results");
console.log("projects:"+this.projects.length +" contexts:"+this.contexts.length + " results:"+this.results.length );
}

View File

@ -18,9 +18,10 @@
<li>
<h3 class=" uk-text-right uk-margin-remove-vertical uk-width-small uk-margin-auto-left uk-accordion-title basket-title uk-text-danger" uk-tooltip="title:Click to see your selections">
<span class="uk-icon"><svg xml:space="preserve" xmlns:xlink="http://www.w3.org/1999/xlink" height="28px" id="my-box" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="28px" x="0px" xmlns="http://www.w3.org/2000/svg" y="0px"><g> <path d="M480,320v128H32V320h78.859l64.016,96h162.25l64-96H480 M384,32H128L0,288v192h512V288L384,32L384,32z M35.781,288l112-224 h216.438l112,224H384l-64,96H192l-64.016-96H35.781L35.781,288z" fill="#b5b5b5"></path></g> </svg> </span>
<span class="uk-badge basket-badge ">{{(projects.length + contexts.length + results.length) | number}}</span>
<span class="uk-badge basket-badge ">{{(projects.length + contexts.length + results.length - ((type =="project")?1:0)) | number}}</span>
</h3>
<div class="uk-accordion-content uk-margin-left uk-margin-right uk-background-muted uk-margin-remove-top dropbasket uk-padding-small uk-margin uk-grid-match uk-child-width-1-1 uk-child-width-1-1@m uk-grid uk-grid-stack">
<start-over [results]="results" [contexts]="contexts" [projects]="projects" [localStoragePrefix]=localStoragePrefix [linkTo]="linkTo" [type]="type"></start-over>
<claim-selected-projects *ngIf=" linkTo == 'project' " title="link Projects" [projects]="projects" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" [localStoragePrefix]=localStoragePrefix > </claim-selected-projects>
@ -33,16 +34,17 @@
</ul>
<div class="uk-card uk-card-default uk-padding-small">
<div class="">
Link your {{type}}
Link your {{((type=='orp')?'research product':type)}}
</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' || type=='software' )" class="uk-margin-top uk-margin-left uk-margin-right uk-background-muted uk-first-column uk-padding-small " >
<div *ngIf="displayedResult != null && (type =='publication' || type =='dataset' || type=='software' || type=='orp' )" class="uk-margin-top uk-margin-left uk-margin-right uk-background-muted uk-first-column uk-padding-small " >
<div>
<a *ngIf="displayedResult.url" target="_blank" href="{{displayedResult.url}}" > <span class="custom-external"></span> {{displayedResult.title}}</a>
<span *ngIf="!displayedResult.url" >{{displayedResult.title}}</span>
<a *ngIf="displayedResult.url" target="_blank" href="{{displayedResult.url}}" > <span class="custom-external"></span> {{((displayedResult.title == undefined || displayedResult.title == '')?'[no title available]':displayedResult.title)}}</a>
<span *ngIf="!displayedResult.url" > {{((displayedResult.title == undefined || displayedResult.title == '')?'[no title available]':displayedResult.title)}}</span>
</div>
<div *ngIf="displayedResult.result.authors && displayedResult.result.authors.length >0 " class="uk-article-meta">Authors: <span *ngFor="let author of displayedResult.result.authors.slice(0,10) let i = index">{{author}}{{(i < (displayedResult.result.authors.slice(0,10).length-1))?"; ":""}}{{(i == displayedResult.result.authors.slice(0,10).length-1 && displayedResult.result.authors.length > 10)?"...":""}}</span></div>

View File

@ -11,6 +11,7 @@ import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/ent
import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {SearchSoftwareService} from '../../services/searchSoftware.service';
import {SearchOrpsService} from '../../services/searchOrps.service';
@Component({
@ -29,7 +30,7 @@ export class DirectLinkingComponent {
type:string = null; // entity type (publication or dataset)
linkTo:string = null; // entity type (project or context or result)
entityTypes=["dataset", "publication","software", "project","context"];
entityTypes=["dataset", "publication","software","orp", "project","context"];
inlineResult:ClaimResult =null;
displayedResult:ClaimResult =null;
sub:any =null;
@ -41,7 +42,8 @@ export class DirectLinkingComponent {
constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService,
private softwareSearch:SearchSoftwareService, private _meta: Meta, private _title: Title) {
private softwareSearch:SearchSoftwareService,private ORPSearch:SearchOrpsService,
private _meta: Meta, private _title: Title) {
var title = "OpenAIRE | Direct Linking";
@ -65,7 +67,7 @@ export class DirectLinkingComponent {
this.show = (this.linkTo != "result")?"claim":"result";
this.linkType = this.linkTo;
var isInlineResult:boolean = false; // is a link result - result
if((this.type == "publication" || this.type == "dataset" || this.type == "software") && ((this.linkTo == "publication" || this.linkTo == "dataset" || this.linkTo == "software") || this.linkTo == "result" )){
if((this.type == "publication" || this.type == "dataset" || this.type == "software") && ((this.linkTo == "publication" || this.linkTo == "dataset" || this.linkTo == "software" || this.linkTo == "orp") || this.linkTo == "result" )){
isInlineResult = true;
}
this.localStoragePrefix = this.type.substr(0,3)+"_"+this.linkTo.substr(0,3)+"_";
@ -79,6 +81,7 @@ export class DirectLinkingComponent {
if(localStorage.getItem(this.localStoragePrefix + "results")){
this.results = JSON.parse(localStorage.getItem(this.localStoragePrefix + "results"));
}
console.log("\n\nGetting inline entity "+this.type+"\n\n");
if(this.type == "project"){
this.linkType = "project";
this.getProjectById(this.id);
@ -88,6 +91,8 @@ export class DirectLinkingComponent {
this.getDatasetById(this.id,true);
}else if(this.type == "software"){
this.getSoftwareById(this.id,true);
}else if(this.type == "orp"){
this.getOrpById(this.id,true);
}else{
this.validInput = this.isValidInput(null);
}
@ -104,9 +109,9 @@ export class DirectLinkingComponent {
return false;
}else if(this.type == "project" && this.linkTo != "result"){
return false;
}else if(["dataset","publication","software"].indexOf(this.type) != -1 && (["project","context","result"].indexOf(this.linkTo) == -1)){
}else if(["dataset","publication","software", "orp"].indexOf(this.type) != -1 && (["project","context","result"].indexOf(this.linkTo) == -1)){
return false;
}else if(["project","dataset","publication","software"].indexOf(this.type) == -1){
}else if(["project","dataset","publication","software","orp"].indexOf(this.type) == -1){
return false;
}else{
return true;
@ -177,6 +182,7 @@ export class DirectLinkingComponent {
result.url= item['title'].url;
result.result = item;
result.accessRights = item['title'].accessMode;
result.embargoEndDate ="";
result.date = item.year;
this.displayedResult = result;
if(isInlineResult){
@ -203,6 +209,7 @@ export class DirectLinkingComponent {
result.url= item['title'].url;
result.result = item;
result.accessRights = item['title'].accessMode;
result.embargoEndDate ="";
result.date = item.year;
this.displayedResult = result;
if(isInlineResult){
@ -217,4 +224,33 @@ export class DirectLinkingComponent {
console.log("An error occured")
});
}
getOrpById(id:string, isInlineResult:boolean){
this.sub = this.ORPSearch.searchOrpById(id,this.properties).subscribe(
data => {
console.log(data)
var item =data[0];
var result: ClaimResult = new ClaimResult();
result.id=id;
result.type="other";
result.source="openaire";
result.title = item['title'].name;
result.url= item['title'].url;
result.result = item;
result.accessRights = item['title'].accessMode;
result.embargoEndDate ="";
result.date = item.year;
this.displayedResult = result;
console.log(item)
if(isInlineResult){
this.inlineResult = result;
}else{
this.results.push( result);
}
this.validInput = this.isValidInput(result);
},
err => {
this.validInput = this.isValidInput(null);
console.log("An error occured")
});
}
}

View File

@ -20,6 +20,7 @@ import {ClaimContextSearchFormModule} from '../claim-utils/claimContextSearchFor
import {ClaimProjectsSearchFormModule} from '../claim-utils/claimProjectSearchForm.module';
import {ClaimResultSearchFormModule} from '../claim-utils/claimResultSearchForm.module';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {OrpsServiceModule} from '../../services/orpsService.module';
@NgModule({
@ -27,7 +28,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
SharedModule,
SelectedProjectsModule, SelectedContextsModule, SelectedPublicationsModule, InsertClaimsModule,
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, StartOverModule, HelperModule,
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, ClaimResultSearchFormModule
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, ClaimResultSearchFormModule, OrpsServiceModule
],

View File

@ -17,7 +17,7 @@ import{EnvProperties} from '../../../utils/properties/env-properties';
<div class="uk-grid">
<div class="uk-width-expand">
<div class="uk-text-lead">Upload a DOI csv file <helper div="link-result-bulk" tooltip=true ></helper>:</div>
<div class="uk-text-lead">Upload a DOI csv file <helper div="link-result-bulk" tooltip=true ></helper></div>
<!--h3 for="exampleInputFile">Or upload a DOI csv file:</h3-->
<label for="exampleInputFile">Select a file: </label>
<div class="js-upload" uk-form-custom>

View File

@ -317,7 +317,7 @@ private createClaim(inlineResult:any, result:any, user:any){
}
private createContextClaim(result:any, context:any, user:any){
var claim = { claimedBy : user, sourceId : context.concept.id, sourceType : "context", sourceCollectedFrom:"openaire", sourceAccessRights:"OPEN", sourceEmbargoEndDate:"no", targetId : result.id , targetType : result.type, targetCollectedFrom: result.source, targetAccessRights:result.accessRights, targetEmbargoEndDate: (result.embargoEndDate == null?"":result.embargoEndDate)};
var claim = { claimedBy : user, sourceId : context.concept.id, sourceType : "context", sourceCollectedFrom:"openaire", sourceAccessRights:"OPEN", sourceEmbargoEndDate:"", targetId : result.id , targetType : result.type, targetCollectedFrom: result.source, targetAccessRights:result.accessRights, targetEmbargoEndDate: (result.embargoEndDate == null?"":result.embargoEndDate)};
return claim;
}
private createProjectClaim(result:any, project:any, user:any){
@ -327,7 +327,7 @@ private createClaim(inlineResult:any, result:any, user:any){
return claim;
}
private createResultClaim(inlineResult:any, result:any, user:any){
var claim = { claimedBy : user, sourceId : result.id, sourceType : result.type, sourceCollectedFrom: result.source, sourceAccessRights: result.accessRights, sourceEmbargoEndDate: result.embargoEndDate, targetId : inlineResult.id , targetType : inlineResult.type, targetCollectedFrom: inlineResult.source, targetAccessRights: inlineResult.accessRights, targetEmbargoEndDate: (inlineResult.embargoEndDate == null?"":inlineResult.embargoEndDate)};
var claim = { claimedBy : user, sourceId : result.id, sourceType : result.type, sourceCollectedFrom: result.source, sourceAccessRights: result.accessRights, sourceEmbargoEndDate: (result.embargoEndDate == null?"":result.embargoEndDate), targetId : inlineResult.id , targetType : inlineResult.type, targetCollectedFrom: inlineResult.source, targetAccessRights: inlineResult.accessRights, targetEmbargoEndDate: (inlineResult.embargoEndDate == null?"":inlineResult.embargoEndDate)};
return claim;
}
createDirectClaim(result, projects, contexts){
@ -363,6 +363,8 @@ createDirectClaim(result, projects, contexts){
entity["resourceType"]="0021";
}else if(result.type =="software"){
entity["resourceType"]="0029";
}else if(result.type =="other"){
entity["resourceType"]="0020";
}
entity["url"]=result.url;
entity["hostedById"]="openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18";

View File

@ -64,6 +64,7 @@
<span class="uk-badge basket-badge ">{{(projects.length + contexts.length + results.length) | number}}</span>
</h3>
<div class="uk-accordion-content uk-background-muted uk-margin-remove-top uk-margin-left uk-margin-right dropbasket uk-padding-small uk-margin uk-grid-match uk-child-width-1-1 uk-child-width-1-1@m uk-grid uk-grid-stack">
<start-over [results]="results" [contexts]="contexts" [projects]="projects" [localStoragePrefix]=localStoragePrefix ></start-over>
<claim-selected-projects title="link Projects" [projects]="projects" [show]="show" [linkType]=linkType
(showChange)="showChange($event)" [localStoragePrefix]=localStoragePrefix > </claim-selected-projects>

View File

@ -6,9 +6,6 @@ import {SelectedContextsModule} from './selected/selectedContexts.module';
import {SelectedPublicationsModule} from './selected/selectedResults.module';
import {InsertClaimsModule} from './insertClaim/insertClaim.module';
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 {StartOverModule} from '../claim-utils/startOver.module';
import {LoginGuard} from'../../login/loginGuard.guard';
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
@ -23,8 +20,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
imports: [
SharedModule, SelectedProjectsModule, SelectedContextsModule,
SelectedPublicationsModule,
InsertClaimsModule,
EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, StartOverModule,
InsertClaimsModule, StartOverModule,
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule, HelperModule
],
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled],

View File

@ -55,8 +55,9 @@ import {Dates} from '../../../utils/string-utils.class';
<select [(ngModel)]="pub.type" name="{{'select_type_'+pub.id}}" >
<option [value]="'publication'" (click)="onTypeChanged('publication',pub)" >Publication</option>
<option [value]="'dataset'" (click)="onTypeChanged('dataset',pub)" >Research Data</option>
<option [value]="'dataset'" (click)="onTypeChanged('dataset',pub)" >Research data</option>
<option [value]="'software'" (click)="onTypeChanged('software',pub)" >Software</option>
<option [value]="'other'" (click)="onTypeChanged('other',pub)" >Other research product</option>
</select>
<select [(ngModel)]="pub.accessRights" name="{{'select_rights_'+pub.id}}" >

View File

@ -32,7 +32,7 @@ import{EnvProperties} from '../utils/properties/env-properties';
<ng-container *ngFor="let item of userMenuItems ">
<li *ngIf="item.needsAuthorization && isAuthorized || !item.needsAuthorization">
<a *ngIf="item.route.length > 0" routerLink="{{item.route}}" [queryParams]=item.params >{{item.title}}</a>
<a *ngIf="item.route.length == 0 && item.url.length > 0" href="{{item.url}}" >{{item.title}}</a>
<a *ngIf="item.route.length == 0 && item.url.length > 0" href="{{item.url}}" target="_blank" >{{item.title}}</a>
</li>
</ng-container>
<li><a (click)="logOut()" id="logout" >Log out</a></li>

View File

@ -163,58 +163,7 @@
</li>
</ng-container>
<!--li class="uk-parent">
<a routerLinkActive="uk-link" routerLink="/search/find" class="" aria-expanded="false">Search</a>
<div class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left" style="top: 80px; left: 0px;" id="searchMenu" (click)="onClick('searchMenu')">
<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
<div class="uk-first-column">
<ul class="uk-nav uk-navbar-dropdown-nav">
<li *ngIf="showPublications"><a routerLinkActive="uk-link" routerLink="/search/find/publications">Publications</a></li>
<li *ngIf="showDatasets"><a routerLinkActive="uk-link" routerLink="/search/find/datasets">Research Data</a></li>
<li *ngIf="showSoftware"><a routerLinkActive="uk-link" routerLink="/search/find/software">Software</a></li>
<li *ngIf="showProjects"><a routerLinkActive="uk-link" routerLink="/search/find/projects">Projects</a></li>
<li *ngIf="showDataProviders"><a routerLinkActive="uk-link" routerLink="/search/find/dataproviders">Content Providers</a></li>
<li *ngIf="showOrganizations"><a routerLinkActive="uk-link" routerLink="/search/find/organizations">Organizations</a></li>
</ul>
</div>
</div>
</div>
</li>
<li *ngIf="showDepositDatasets||showDepositPublications" class="uk-parent">
<a routerLinkActive="uk-link" routerLink="/participate/deposit-publications" class="" aria-expanded="false">Share</a>
<div class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left" style="top: 80px; left: 240px;" id="depositMenu" (click)="onClick('depositMenu')">
<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
<div class="uk-first-column">
<ul class="uk-nav uk-navbar-dropdown-nav">
<li *ngIf="showDepositPublications"><a routerLinkActive="uk-link" routerLink="/participate/deposit-publications">Publications</a></li>
<li *ngIf="showDepositDatasets"><a routerLinkActive="uk-link" routerLink="/participate/deposit-datasets">Research Data</a></li>
</ul>
</div>
</div>
</div>
</li>
<li *ngIf="showLinking" class="uk-parent">
<a routerLinkActive="uk-link" routerLink="/participate/claim" class="" aria-expanded="false">Link</a>
</li>
<li *ngIf="showDataProviders" class="uk-parent">
<a routerLinkActive="uk-link" routerLink="/search/content-providers" class="" aria-expanded="false">Content Providers</a>
<div class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left" style="top: 80px; left: 113px;" id="dpMenu" (click)="onClick('dpMenu')">
<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
<div class="uk-first-column">
<ul class="uk-nav uk-navbar-dropdown-nav">
<li><a href="https://beta.openaire.eu/oa-policies-mandates" class="uk-offcanvas-close custom-offcanvas-close" >Data policies</a></li>
<li><a routerLinkActive="uk-link" routerLink="/search/content-providers">Repositories</a></li>
<li><a routerLinkActive="uk-link" routerLink="/search/journals">Journals</a></li>
<li><a routerLinkActive="uk-link" routerLink="/search/entity-registries">Registries/ Databases</a></li>
<li><a routerLinkActive="uk-link" routerLink="/search/find/dataproviders">Browse all</a></li>
</ul>
</div>
</div>
</div>
</li-->
</ul>
</div>
<div *ngIf="userMenu" class="uk-navbar-right">