1
|
/**
|
2
|
* Copyright (C) 2017 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
|
package eu.etaxonomy.cdm.model.name;
|
10
|
|
11
|
import java.util.Set;
|
12
|
import java.util.UUID;
|
13
|
|
14
|
import javax.xml.bind.annotation.XmlEnum;
|
15
|
import javax.xml.bind.annotation.XmlEnumValue;
|
16
|
|
17
|
import org.apache.log4j.Logger;
|
18
|
|
19
|
import eu.etaxonomy.cdm.model.common.EnumeratedTermVoc;
|
20
|
import eu.etaxonomy.cdm.model.common.IEnumTerm;
|
21
|
import eu.etaxonomy.cdm.model.common.Language;
|
22
|
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
|
23
|
|
24
|
/**
|
25
|
*
|
26
|
* @author a.mueller
|
27
|
\* @since 13.03.2017
|
28
|
*
|
29
|
*/
|
30
|
@XmlEnum
|
31
|
public enum RegistrationStatus implements IEnumTerm<RegistrationStatus>{
|
32
|
|
33
|
/**
|
34
|
* A new record which is being edited by the Author
|
35
|
*/
|
36
|
@XmlEnumValue("Preparation")
|
37
|
PREPARATION(UUID.fromString("032c4f0c-af74-4f10-82f9-0652209bfeac"), "Preparation","PREP"),
|
38
|
|
39
|
/**
|
40
|
* A record ready for the curator to be validated.
|
41
|
*/
|
42
|
@XmlEnumValue("Curation")
|
43
|
CURATION(UUID.fromString("4b8f972e-06a2-423c-827e-6477a2a9d371"), "Curation","CUR"),
|
44
|
|
45
|
/**
|
46
|
* The record has passed the validation by the curator and is ready for publication.
|
47
|
*/
|
48
|
@XmlEnumValue("Ready")
|
49
|
READY(UUID.fromString("6fe00e6d-56fc-4150-a1ef-7a47ea764f18"), "Ready","RDY"),
|
50
|
|
51
|
/**
|
52
|
* The name or typification has finally been published.
|
53
|
*/
|
54
|
@XmlEnumValue("Published")
|
55
|
PUBLISHED(UUID.fromString("9bcc6bea-424a-4bfe-b901-2efeea116c2c"), "Unknown unit type","PUB"),
|
56
|
|
57
|
/**
|
58
|
* The registration has been rejected, the process is aborted and the record is preserved.
|
59
|
*/
|
60
|
@XmlEnumValue("Rejected")
|
61
|
REJECTED(UUID.fromString("0960e14a-a6b1-41b4-92a9-0d6d1b9e0159"), "Unknown unit type","REJ"),
|
62
|
;
|
63
|
|
64
|
@SuppressWarnings("unused")
|
65
|
private static final Logger logger = Logger.getLogger(RegistrationStatus.class);
|
66
|
|
67
|
|
68
|
private RegistrationStatus(UUID uuid, String defaultString, String key){
|
69
|
this(uuid, defaultString, key, null);
|
70
|
System.out.println("SpecimenOrObservationType hierarchie not yet fully implemented");
|
71
|
}
|
72
|
|
73
|
@SuppressWarnings("unchecked")
|
74
|
private RegistrationStatus(UUID uuid, String defaultString, String key, SpecimenOrObservationType parent){
|
75
|
delegateVocTerm = EnumeratedTermVoc.addTerm(getClass(), this, uuid, defaultString, key, parent);
|
76
|
}
|
77
|
|
78
|
// *************************** DELEGATE **************************************/
|
79
|
|
80
|
private static EnumeratedTermVoc<RegistrationStatus> delegateVoc;
|
81
|
private IEnumTerm<RegistrationStatus> delegateVocTerm;
|
82
|
|
83
|
static {
|
84
|
delegateVoc = EnumeratedTermVoc.getVoc(RegistrationStatus.class);
|
85
|
}
|
86
|
|
87
|
@Override
|
88
|
public String getKey(){return delegateVocTerm.getKey();}
|
89
|
|
90
|
@Override
|
91
|
public String getMessage(){return delegateVocTerm.getMessage();}
|
92
|
|
93
|
@Override
|
94
|
public String getMessage(Language language){return delegateVocTerm.getMessage(language);}
|
95
|
|
96
|
|
97
|
@Override
|
98
|
public UUID getUuid() {return delegateVocTerm.getUuid();}
|
99
|
|
100
|
@Override
|
101
|
public RegistrationStatus getKindOf() {return delegateVocTerm.getKindOf();}
|
102
|
|
103
|
@Override
|
104
|
public Set<RegistrationStatus> getGeneralizationOf() {return delegateVocTerm.getGeneralizationOf();}
|
105
|
|
106
|
@Override
|
107
|
public boolean isKindOf(RegistrationStatus ancestor) {return delegateVocTerm.isKindOf(ancestor); }
|
108
|
|
109
|
@Override
|
110
|
public Set<RegistrationStatus> getGeneralizationOf(boolean recursive) {return delegateVocTerm.getGeneralizationOf(recursive);}
|
111
|
|
112
|
public static RegistrationStatus getByKey(String key){return delegateVoc.getByKey(key);}
|
113
|
public static RegistrationStatus getByUuid(UUID uuid) {return delegateVoc.getByUuid(uuid);}
|
114
|
|
115
|
|
116
|
}
|