-
Notifications
You must be signed in to change notification settings - Fork 1
/
entry.js
47 lines (42 loc) · 1.76 KB
/
entry.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* The Entry class provides structure for the data form OMEKA API. The values form the JSON are assigned to the
* corresponding attribute in correct format for easier access.
*
* Note that there are three different constructors for different purposes: generalInstance, personInstance and
* geoInstance.
*
* This class is required by generate-md-files and documentation script.
* A copy of this class can be found in indexScrip.js and postScript.js
*/
class Entry {
constructor(id, isPublic, title, created, description, language
, firstName, lastName, birthday, hasGeoLoc, locIn, isSubjOf, interviewCreated, creator) {
this.id = id;
this.isPublic = isPublic;
this.title = title;
this.created = created;
this.description = description;
this.language = language;
this.firstName = firstName;
this.lastName = lastName;
this.birthday = birthday;
this.hasGeoloc = hasGeoLoc;
this.locIn = locIn;
this.isSubjof = isSubjOf;
this.interviewCreated = interviewCreated;
this.creator = creator;
}
static generalInstance(id, isPublic, title, created, description, language, isSubjOf, interviewCreated, creator) {
return new Entry(id, isPublic, title, created, description, language, null, null, null, null,
null, isSubjOf, interviewCreated, creator)
}
static personInstance(firstName, lastName, birthday) {
return new Entry(null, null, null, null, null, null,
firstName, lastName, birthday, null, null, null, null, null)
}
static geoInstance(hasGeoLoc, locIn) {
return new Entry(null, null, null, null, null, null, null, null, null,
hasGeoLoc, locIn, null, null, null)
}
}
module.exports = Entry;