1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.model.location;
|
11
|
|
12
|
import java.util.UUID;
|
13
|
|
14
|
import eu.etaxonomy.cdm.model.common.OrderedTermBase;
|
15
|
import eu.etaxonomy.cdm.model.common.TermVocabulary;
|
16
|
|
17
|
import org.apache.log4j.Logger;
|
18
|
import org.hibernate.envers.Audited;
|
19
|
|
20
|
import javax.persistence.*;
|
21
|
import javax.xml.bind.annotation.XmlAccessType;
|
22
|
import javax.xml.bind.annotation.XmlAccessorType;
|
23
|
import javax.xml.bind.annotation.XmlRootElement;
|
24
|
import javax.xml.bind.annotation.XmlType;
|
25
|
|
26
|
/**
|
27
|
* Controlled vocabulary to differentiate levels of areas such as province, state,
|
28
|
* etc.
|
29
|
* @author m.doering
|
30
|
* @version 1.0
|
31
|
* @created 08-Nov-2007 13:06:36
|
32
|
*/
|
33
|
@XmlAccessorType(XmlAccessType.FIELD)
|
34
|
@XmlType(name = "NamedAreaLevel")
|
35
|
@XmlRootElement(name = "NamedAreaLevel")
|
36
|
@Entity
|
37
|
@Audited
|
38
|
public class NamedAreaLevel extends OrderedTermBase<NamedAreaLevel> {
|
39
|
private static final long serialVersionUID = -7977901140330659208L;
|
40
|
@SuppressWarnings("unused")
|
41
|
private static final Logger logger = Logger.getLogger(NamedAreaLevel.class);
|
42
|
|
43
|
private static final UUID uuidTdwgLevel1 = UUID.fromString("cd7771b2-7427-4a01-9057-7d7a897dddaf");
|
44
|
private static final UUID uuidTdwgLevel2 = UUID.fromString("38efa5fd-d7f0-451c-9de9-e6cce41e2225");
|
45
|
private static final UUID uuidTdwgLevel3 = UUID.fromString("25b563b6-6a6c-401b-b090-c9498886c50b");
|
46
|
private static final UUID uuidTdwgLevel4 = UUID.fromString("160ff2c8-9bfc-49c2-9afd-049c21a91695");
|
47
|
private static final UUID uuidNatureReserve = UUID.fromString("340b9050-a65d-4dd4-9523-bc10f977bc68");
|
48
|
private static final UUID uuidState = UUID.fromString("08aa6127-8ebc-4120-8411-a468a7257e02");
|
49
|
private static final UUID uuidProvince = UUID.fromString("401d48b4-9f09-4354-be0f-c2138444f72d");
|
50
|
private static final UUID uuidTown = UUID.fromString("f127b4d2-f6bc-4019-9c87-ee3f4de1f094");
|
51
|
private static final UUID uuidCountry = UUID.fromString("79db63a4-1563-461e-8e41-48f5722feca4");
|
52
|
private static NamedAreaLevel COUNTRY;
|
53
|
private static NamedAreaLevel TOWN;
|
54
|
private static NamedAreaLevel PROVINCE;
|
55
|
private static NamedAreaLevel STATE;
|
56
|
private static NamedAreaLevel NATURE_RESERVE;
|
57
|
private static NamedAreaLevel TDWG_LEVEL4;
|
58
|
private static NamedAreaLevel TDWG_LEVEL3;
|
59
|
private static NamedAreaLevel TDWG_LEVEL2;
|
60
|
private static NamedAreaLevel TDWG_LEVEL1;
|
61
|
|
62
|
|
63
|
/**
|
64
|
* Factory method
|
65
|
* @return
|
66
|
*/
|
67
|
public static NamedAreaLevel NewInstance(){
|
68
|
return new NamedAreaLevel();
|
69
|
}
|
70
|
|
71
|
/**
|
72
|
* Factory method
|
73
|
* @return
|
74
|
*/
|
75
|
public static NamedAreaLevel NewInstance(String term, String label, String labelAbbrev){
|
76
|
return new NamedAreaLevel(term, label, labelAbbrev);
|
77
|
}
|
78
|
|
79
|
/**
|
80
|
* Constructor
|
81
|
*/
|
82
|
public NamedAreaLevel() {
|
83
|
super();
|
84
|
}
|
85
|
|
86
|
protected NamedAreaLevel(String term, String label, String labelAbbrev) {
|
87
|
super(term, label, labelAbbrev);
|
88
|
}
|
89
|
|
90
|
|
91
|
//******************** METHODS ***************************************/
|
92
|
|
93
|
/**
|
94
|
* continents
|
95
|
*/
|
96
|
public static final NamedAreaLevel TDWG_LEVEL1(){
|
97
|
return TDWG_LEVEL1;
|
98
|
}
|
99
|
|
100
|
/**
|
101
|
* larger regions
|
102
|
*/
|
103
|
public static final NamedAreaLevel TDWG_LEVEL2(){
|
104
|
return TDWG_LEVEL2;
|
105
|
}
|
106
|
|
107
|
/**
|
108
|
* mostly countries
|
109
|
*/
|
110
|
public static final NamedAreaLevel TDWG_LEVEL3(){
|
111
|
return TDWG_LEVEL3;
|
112
|
}
|
113
|
|
114
|
public static final NamedAreaLevel TDWG_LEVEL4(){
|
115
|
return TDWG_LEVEL4;
|
116
|
}
|
117
|
|
118
|
public static final NamedAreaLevel NATURE_RESERVE(){
|
119
|
return NATURE_RESERVE;
|
120
|
}
|
121
|
|
122
|
public static final NamedAreaLevel STATE(){
|
123
|
return STATE;
|
124
|
}
|
125
|
|
126
|
public static final NamedAreaLevel PROVINCE(){
|
127
|
return PROVINCE;
|
128
|
}
|
129
|
|
130
|
public static final NamedAreaLevel TOWN(){
|
131
|
return TOWN;
|
132
|
}
|
133
|
|
134
|
public static final NamedAreaLevel COUNTRY(){
|
135
|
return COUNTRY;
|
136
|
}
|
137
|
|
138
|
@Override
|
139
|
protected void setDefaultTerms(TermVocabulary<NamedAreaLevel> termVocabulary) {
|
140
|
NamedAreaLevel.COUNTRY = termVocabulary.findTermByUuid(NamedAreaLevel.uuidCountry);
|
141
|
NamedAreaLevel.NATURE_RESERVE = termVocabulary.findTermByUuid(NamedAreaLevel.uuidNatureReserve);
|
142
|
NamedAreaLevel.PROVINCE = termVocabulary.findTermByUuid(NamedAreaLevel.uuidProvince);
|
143
|
NamedAreaLevel.STATE = termVocabulary.findTermByUuid(NamedAreaLevel.uuidState);
|
144
|
NamedAreaLevel.TDWG_LEVEL1 = termVocabulary.findTermByUuid(NamedAreaLevel.uuidTdwgLevel1);
|
145
|
NamedAreaLevel.TDWG_LEVEL2 = termVocabulary.findTermByUuid(NamedAreaLevel.uuidTdwgLevel2);
|
146
|
NamedAreaLevel.TDWG_LEVEL3 = termVocabulary.findTermByUuid(NamedAreaLevel.uuidTdwgLevel3);
|
147
|
NamedAreaLevel.TDWG_LEVEL4 = termVocabulary.findTermByUuid(NamedAreaLevel.uuidTdwgLevel4);
|
148
|
NamedAreaLevel.TOWN = termVocabulary.findTermByUuid(NamedAreaLevel.uuidTown);
|
149
|
|
150
|
}
|
151
|
}
|