2019-07-23 14:23:12 +02:00
|
|
|
//Classes used in linking / inlinelinking when selecting an entity
|
|
|
|
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
2022-04-08 15:55:22 +02:00
|
|
|
import {OpenaireEntities} from "../../utils/properties/searchFields";
|
2019-07-23 14:23:12 +02:00
|
|
|
|
|
|
|
export class ClaimResult {
|
|
|
|
public source: string;
|
|
|
|
public url: string;
|
|
|
|
public record: any;
|
|
|
|
public accessRights: string = "OPEN";
|
|
|
|
public embargoEndDate: string = "";
|
|
|
|
public date: string;
|
|
|
|
public authors: string[] = [];
|
|
|
|
public publisher: string;
|
|
|
|
public description: string;
|
|
|
|
DOI: string;
|
|
|
|
editors = [];
|
|
|
|
journal: string;
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
let today = new Date();
|
|
|
|
this.embargoEndDate = "" + (today.getFullYear()) + "-" + (today.getMonth() + 1) + "-" + (today.getDate());
|
|
|
|
this.authors = [];
|
|
|
|
this.accessRights = "OPEN";
|
|
|
|
this.editors = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ClaimProject {
|
|
|
|
public funderId: string;
|
|
|
|
public funderName: string;
|
|
|
|
public acronym: string;
|
|
|
|
public startDate: string;
|
|
|
|
public endDate: string;
|
|
|
|
public code: string;
|
|
|
|
public jurisdiction: string;
|
|
|
|
public fundingLevel0: string;
|
2019-10-16 12:18:32 +02:00
|
|
|
public url: string;
|
2019-07-23 14:23:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export class ClaimContext {
|
|
|
|
public community: string;
|
|
|
|
public category: string;
|
|
|
|
public concept: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Message {
|
|
|
|
public type: string;
|
|
|
|
public resultId: string;
|
|
|
|
public resultTitle: string;
|
|
|
|
projectId: string;
|
|
|
|
projectInfo: { title: string, startDate: string, endDate: string };
|
|
|
|
}
|
|
|
|
export class ClaimsErrorMessage {
|
|
|
|
public type: string;
|
|
|
|
inserted:number;
|
|
|
|
failed:number;
|
|
|
|
constructor(){
|
|
|
|
this.inserted = 0;
|
|
|
|
this.failed = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ClaimEntity {
|
|
|
|
public id: string;
|
|
|
|
public type: string;
|
|
|
|
public title: string;
|
|
|
|
warningMessages: Message[];
|
|
|
|
errorMessages: Message[];
|
|
|
|
result: ClaimResult;
|
|
|
|
project: ClaimProject;
|
|
|
|
context: ClaimContext;
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
this.warningMessages = [];
|
|
|
|
this.errorMessages = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ClaimRecord2Insert {
|
|
|
|
claimedBy: string;
|
|
|
|
sourceId: string;
|
|
|
|
sourceType: string;
|
|
|
|
sourceCollectedFrom: string;
|
|
|
|
sourceAccessRights: string;
|
|
|
|
sourceEmbargoEndDate: string;
|
|
|
|
targetId: string;
|
|
|
|
targetType: string;
|
|
|
|
targetCollectedFrom: string;
|
|
|
|
targetAccessRights: string;
|
|
|
|
targetEmbargoEndDate: string;
|
2019-10-16 12:40:19 +02:00
|
|
|
claimedInDashboard: string;
|
2019-07-23 14:23:12 +02:00
|
|
|
|
|
|
|
constructor() {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ClaimDBRecord {
|
|
|
|
id: string;
|
|
|
|
userMail: string;
|
|
|
|
date: string;
|
|
|
|
sourceType: string;
|
|
|
|
targetType: string;
|
|
|
|
semantics: string;
|
|
|
|
approved: string;
|
2022-07-13 19:25:19 +02:00
|
|
|
source: ClaimDBResult | ClaimDBProject | ClaimDBContext;
|
2019-07-23 14:23:12 +02:00
|
|
|
target: ClaimDBResult;
|
|
|
|
indexed:boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ClaimDBContext {
|
|
|
|
title: string;
|
|
|
|
openaireId: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ClaimDBProject {
|
|
|
|
openaireId: string;
|
|
|
|
name: string;
|
|
|
|
funderName: string;
|
|
|
|
funderId: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ClaimDBResult {
|
|
|
|
title: string;
|
|
|
|
authors: string[];
|
|
|
|
externalUrl: string;
|
|
|
|
openaireId: string;
|
|
|
|
doi: string;
|
|
|
|
accessRights: string;
|
|
|
|
collectedFrom: string;
|
|
|
|
resultType: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class DirectIndexRecord {
|
|
|
|
public id: string;
|
|
|
|
record: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ShowOptions {
|
|
|
|
show: string; //show values: source, result, project, context, claim
|
|
|
|
linkTo: string; // linkTo /values: result, project, context
|
|
|
|
linkToEntities: string[]; // show linkToEntities /values: result, project, context
|
2022-03-16 17:54:22 +01:00
|
|
|
basketShowSources: boolean = true;
|
|
|
|
basketShowLinksTo: boolean = false;
|
2022-04-08 15:55:22 +02:00
|
|
|
selectOptions= [];
|
2019-07-23 14:23:12 +02:00
|
|
|
constructor() {
|
|
|
|
this.show = "source";
|
|
|
|
this.linkTo = "project";
|
|
|
|
this.linkToEntities = ["project", "context", "result"];
|
|
|
|
this.basketShowSources = true;
|
|
|
|
this.basketShowLinksTo = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
showSource() {
|
|
|
|
this.show = "source";
|
2022-03-16 17:54:22 +01:00
|
|
|
this.basketswitchToSources();
|
2019-07-23 14:23:12 +02:00
|
|
|
HelperFunctions.scroll();
|
|
|
|
}
|
2022-03-16 17:54:22 +01:00
|
|
|
basketswitchToSources() {
|
|
|
|
this.basketShowLinksTo = false;
|
|
|
|
this.basketShowSources = true;
|
|
|
|
}
|
|
|
|
basketswitchToLinkTo() {
|
|
|
|
this.basketShowLinksTo = true;
|
|
|
|
this.basketShowSources = false;
|
|
|
|
}
|
2019-07-23 14:23:12 +02:00
|
|
|
showLinkTo() {
|
2022-03-16 17:54:22 +01:00
|
|
|
console.log(this.linkTo, "showLinkTo")
|
2019-07-23 14:23:12 +02:00
|
|
|
this.show = this.linkTo;
|
2022-03-16 17:54:22 +01:00
|
|
|
this.basketswitchToLinkTo();
|
2019-07-23 14:23:12 +02:00
|
|
|
HelperFunctions.scroll();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-04-08 15:55:22 +02:00
|
|
|
initSelectOptions(){
|
|
|
|
let options =[];
|
|
|
|
if(this.linkToEntities.indexOf('result')!=-1){
|
|
|
|
options.push({value: 'result',label: OpenaireEntities.RESULTS})
|
|
|
|
}
|
|
|
|
if(this.linkToEntities.indexOf('project')!=-1){
|
|
|
|
options.push({value: 'project',label: OpenaireEntities.PROJECTS})
|
|
|
|
}
|
|
|
|
if(this.linkToEntities.indexOf('context')!=-1){
|
|
|
|
options.push({value: 'context',label: OpenaireEntities.COMMUNITIES})
|
|
|
|
}
|
|
|
|
this.selectOptions = options;
|
|
|
|
}
|
2019-07-23 14:23:12 +02:00
|
|
|
}
|