Project

General

Profile

1
//Classes used in linking / inlinelinking when selecting an entity
2
import {HelperFunctions} from "../../utils/HelperFunctions.class";
3

    
4
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

    
18
  constructor() {
19
    let today = new Date();
20
    this.embargoEndDate = "" + (today.getFullYear()) + "-" + (today.getMonth() + 1) + "-" + (today.getDate());
21
    this.authors = [];
22
    this.accessRights = "OPEN";
23
    this.editors = [];
24
  }
25

    
26
}
27

    
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
  public url: string;
38
}
39

    
40
export class ClaimContext {
41
  public community: string;
42
  public category: string;
43
  public concept: any;
44
}
45

    
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
}
53
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

    
62
}
63

    
64
export class ClaimEntity {
65
  public id: string;
66
  public type: string;
67
  public title: string;
68
  warningMessages: Message[];
69
  errorMessages: Message[];
70
  result: ClaimResult;
71
  project: ClaimProject;
72
  context: ClaimContext;
73

    
74
  constructor() {
75
    this.warningMessages = [];
76
    this.errorMessages = [];
77
  }
78

    
79
}
80

    
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
  claimedInDashboard: string;
94

    
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
  showLinkTo() {
164
    this.show = this.linkTo;
165
    this.basketShowLinksTo = true;
166
    this.basketShowSources = false;
167
    HelperFunctions.scroll();
168

    
169
  }
170

    
171
  showBasketSources() {
172
    if (this.show != 'source') {
173
      this.basketShowSources = !this.basketShowSources;
174
      this.basketShowLinksTo = !this.basketShowSources;
175
    }
176
  }
177
}
(5-5/15)