Project

General

Profile

1 50169 argiro.kok
//Classes used in linking / inlinelinking when selecting an entity
2 55581 argiro.kok
import {HelperFunctions} from "../../utils/HelperFunctions.class";
3 52837 argiro.kok
4 55581 argiro.kok
export class ClaimResult {
5
  public source: string;
6
  public url: string;
7
  public record: any;
8
  public accessRights: string = "OPEN";
9
  public embargoEndDate: string = "";
10
  public date: string;
11
  public authors: string[] = [];
12
  public publisher: string;
13
  public description: string;
14
  DOI: string;
15
  editors = [];
16
  journal: string;
17 55503 argiro.kok
18 55581 argiro.kok
  constructor() {
19
    let today = new Date();
20 55613 argiro.kok
    this.embargoEndDate = "" + (today.getFullYear()) + "-" + (today.getMonth() + 1) + "-" + (today.getDate());
21 55581 argiro.kok
    this.authors = [];
22
    this.accessRights = "OPEN";
23
    this.editors = [];
24
  }
25
26 50169 argiro.kok
}
27 55581 argiro.kok
28
export class ClaimProject {
29
  public funderId: string;
30
  public funderName: string;
31
  public acronym: string;
32
  public startDate: string;
33
  public endDate: string;
34
  public code: string;
35
  public jurisdiction: string;
36
  public fundingLevel0: string;
37 57384 argiro.kok
  public url: string;
38 50169 argiro.kok
}
39
40 55581 argiro.kok
export class ClaimContext {
41
  public community: string;
42
  public category: string;
43
  public concept: any;
44 50169 argiro.kok
}
45 55581 argiro.kok
46
export class Message {
47
  public type: string;
48
  public resultId: string;
49
  public resultTitle: string;
50
  projectId: string;
51
  projectInfo: { title: string, startDate: string, endDate: string };
52 55403 argiro.kok
}
53 55581 argiro.kok
export class ClaimsErrorMessage {
54
  public type: string;
55
  inserted:number;
56
  failed:number;
57
  constructor(){
58
    this.inserted = 0;
59
    this.failed = 0;
60
  }
61 55403 argiro.kok
62 55581 argiro.kok
}
63
64
export class ClaimEntity {
65 55403 argiro.kok
  public id: string;
66
  public type: string;
67
  public title: string;
68 55581 argiro.kok
  warningMessages: Message[];
69
  errorMessages: Message[];
70
  result: ClaimResult;
71
  project: ClaimProject;
72
  context: ClaimContext;
73
74
  constructor() {
75 55503 argiro.kok
    this.warningMessages = [];
76 55581 argiro.kok
    this.errorMessages = [];
77 55503 argiro.kok
  }
78 55403 argiro.kok
79
}
80 55581 argiro.kok
81
export class ClaimRecord2Insert {
82
  claimedBy: string;
83
  sourceId: string;
84
  sourceType: string;
85
  sourceCollectedFrom: string;
86
  sourceAccessRights: string;
87
  sourceEmbargoEndDate: string;
88
  targetId: string;
89
  targetType: string;
90
  targetCollectedFrom: string;
91
  targetAccessRights: string;
92
  targetEmbargoEndDate: string;
93 57385 argiro.kok
  claimedInDashboard: string;
94 55581 argiro.kok
95
  constructor() {
96
97
  }
98
}
99
100
export class ClaimDBRecord {
101
  id: string;
102
  userMail: string;
103
  date: string;
104
  sourceType: string;
105
  targetType: string;
106
  semantics: string;
107
  approved: string;
108
  source: ClaimDBResult | ClaimProject | ClaimContext;
109
  target: ClaimDBResult;
110
  indexed:boolean;
111
}
112
113
export class ClaimDBContext {
114
  title: string;
115
  openaireId: string;
116
}
117
118
export class ClaimDBProject {
119
  openaireId: string;
120
  name: string;
121
  funderName: string;
122
  funderId: string;
123
}
124
125
export class ClaimDBResult {
126
  title: string;
127
  authors: string[];
128
  externalUrl: string;
129
  openaireId: string;
130
  doi: string;
131
  accessRights: string;
132
  collectedFrom: string;
133
  resultType: string;
134
}
135
136
export class DirectIndexRecord {
137
  public id: string;
138
  record: any;
139
}
140
141
export class ShowOptions {
142
  show: string;   //show values: source, result, project, context, claim
143
  linkTo: string;   // linkTo /values: result, project, context
144
  linkToEntities: string[];   // show linkToEntities /values: result, project, context
145
  basketShowSources: boolean;
146
  basketShowLinksTo: boolean;
147
148
  constructor() {
149
    this.show = "source";
150
    this.linkTo = "project";
151
    this.linkToEntities = ["project", "context", "result"];
152
    this.basketShowSources = true;
153
    this.basketShowLinksTo = false;
154
  }
155
156
  showSource() {
157
    this.show = "source";
158
    this.basketShowLinksTo = false;
159
    this.basketShowSources = true;
160
    HelperFunctions.scroll();
161
162
  }
163
164
  showLinkTo() {
165
    this.show = this.linkTo;
166
    this.basketShowLinksTo = true;
167
    this.basketShowSources = false;
168
    HelperFunctions.scroll();
169
170
  }
171
172
  showBasketSources() {
173
    if (this.show != 'source') {
174
      this.basketShowSources = !this.basketShowSources;
175
      this.basketShowLinksTo = !this.basketShowSources;
176
    }
177
  }
178
}