2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.model
.common
;
13 import org
.apache
.log4j
.Logger
;
14 import org
.hibernate
.envers
.Audited
;
18 import javax
.persistence
.*;
19 import javax
.xml
.bind
.annotation
.XmlAccessType
;
20 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
21 import javax
.xml
.bind
.annotation
.XmlType
;
24 * Marker types similar to dynamically defined attributes. These content types
25 * like "IS_DOUBTFUL", "COMPLETE" or specific local flags.
28 * @created 08-Nov-2007 13:06:33
30 @XmlAccessorType(XmlAccessType
.FIELD
)
31 @XmlType(name
= "MarkerType")
34 public class MarkerType
extends DefinedTermBase
<MarkerType
> {
35 private static final long serialVersionUID
= -9117424749919907396L;
36 public static final Logger logger
= Logger
.getLogger(MarkerType
.class);
38 private static final UUID uuidImported
= UUID
.fromString("96878790-4ceb-42a2-9738-a2242079b679");
39 private static final UUID uuidToBeChecked
= UUID
.fromString("34204192-b41d-4857-a1d4-28992bef2a2a");
40 private static final UUID uuidIsDoubtful
= UUID
.fromString("b51325c8-05fe-421a-832b-d86fc249ef6e");
41 private static final UUID uuidComplete
= UUID
.fromString("b4b1b2ab-89a8-4ce6-8110-d60b8b1bc433");
42 private static final UUID uuidPublish
= UUID
.fromString("0522c2b3-b21c-400c-80fc-a251c3501dbc");
43 private static final UUID uuidInBibliography
= UUID
.fromString("2cdb492e-3b8b-4784-8c26-25159835231d");
45 protected static Map
<UUID
, MarkerType
> termMap
= null;
47 public static MarkerType
NewInstance(String term
, String label
, String labelAbbrev
){
48 return new MarkerType(term
, label
, labelAbbrev
);
51 protected static MarkerType
getTermByUuid(UUID uuid
){
53 DefaultTermInitializer vocabularyStore
= new DefaultTermInitializer();
54 vocabularyStore
.initialize();
56 return (MarkerType
)termMap
.get(uuid
);
74 protected MarkerType(String term
, String label
, String labelAbbrev
) {
75 super(term
, label
, labelAbbrev
);
79 public static final MarkerType
IMPORTED(){
80 return getTermByUuid(uuidImported
);
83 public static final MarkerType
TO_BE_CHECKED(){
84 return getTermByUuid(uuidToBeChecked
);
87 public static final MarkerType
IS_DOUBTFUL(){
88 return getTermByUuid(uuidIsDoubtful
);
91 public static final MarkerType
COMPLETE(){
92 return getTermByUuid(uuidComplete
);
95 public static final MarkerType
PUBLISH(){
96 return getTermByUuid(uuidPublish
);
99 public static final MarkerType
IN_BIBLIOGRAPHY(){
100 return getTermByUuid(uuidInBibliography
);
104 protected void setDefaultTerms(TermVocabulary
<MarkerType
> termVocabulary
) {
105 termMap
= new HashMap
<UUID
, MarkerType
>();
106 for (MarkerType term
: termVocabulary
.getTerms()){
107 termMap
.put(term
.getUuid(), (MarkerType
)term
);