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 java
.util
.HashMap
;
15 import java
.util
.UUID
;
17 import javax
.persistence
.Entity
;
18 import javax
.xml
.bind
.annotation
.XmlAccessType
;
19 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
20 import javax
.xml
.bind
.annotation
.XmlType
;
22 import org
.apache
.log4j
.Logger
;
23 import org
.hibernate
.envers
.Audited
;
26 * Extension types similar to dynamically defined attributes. These are not data
27 * types, but rather content types like "DOI", "2nd nomenclatural reference", "3rd
28 * hybrid parent" or specific local identifiers.
31 * @created 08-Nov-2007 13:06:23
33 @XmlAccessorType(XmlAccessType
.FIELD
)
34 @XmlType(name
= "ExtensionType")
37 public class ExtensionType
extends DefinedTermBase
<ExtensionType
> {
38 private static final long serialVersionUID
= -7761963794004133427L;
39 @SuppressWarnings("unused")
40 private static final Logger logger
= Logger
.getLogger(ExtensionType
.class);
42 private static final UUID uuidXmlFragment
= UUID
.fromString("ea109c1c-e69b-4e6d-9079-1941b9ee2991");
43 private static final UUID uuidRdfFragment
= UUID
.fromString("f3684e25-dcad-4c1e-a5d8-16cddf1c4f5b");
44 private static final UUID uuidDoi
= UUID
.fromString("f079aacc-ab08-4cc4-90a0-6d3958fb0dbf");
45 private static final UUID uuid2ndNomRef
= UUID
.fromString("46a98bfa-f11a-47fe-a6c5-50c7e8289b3d");
46 private static final UUID uuid3rdHybridParent
= UUID
.fromString("5e552b24-5a2d-498d-a4f4-ccd8e5bc2bae");
47 private static final UUID uuidAreaOfInterest
= UUID
.fromString("cefa478e-604f-4db4-8afc-25e06c28ec69");
48 private static final UUID uuidNomStandard
= UUID
.fromString("4a6cbbe9-8d79-4d15-b316-2ff1adeff526");
49 private static final UUID uuidAbbreviation
= UUID
.fromString("5837e34e-b0f5-4736-8083-ff5eaecd8c43");
50 private static final UUID uuidOrder
= UUID
.fromString("ecb7770d-a295-49ee-a88f-e9e137a7cabb");
51 private static final UUID uuidInformalCategory
= UUID
.fromString("11bbc52f-a085-43d3-9f9b-cbe0d1eb9a91");
53 protected static Map
<UUID
, ExtensionType
> termMap
= null;
55 public ExtensionType() {
57 public ExtensionType(String term
, String label
, String labelAbbrev
) {
58 super(term
, label
, labelAbbrev
);
61 protected static ExtensionType
getTermByUuid(UUID uuid
){
63 DefaultTermInitializer vocabularyStore
= new DefaultTermInitializer();
64 vocabularyStore
.initialize();
66 return (ExtensionType
)termMap
.get(uuid
);
70 public static final ExtensionType
XML_FRAGMENT(){
71 return getTermByUuid(uuidXmlFragment
);
74 public static final ExtensionType
RDF_FRAGMENT(){
75 return getTermByUuid(uuidRdfFragment
);
78 public static final ExtensionType
DOI(){
79 return getTermByUuid(uuidDoi
);
83 public static final ExtensionType
SECOND_NOM_REF(){
84 return getTermByUuid(uuid2ndNomRef
);
88 public static final ExtensionType
THIRD_HYBRID_PARENT(){
89 return getTermByUuid(uuid3rdHybridParent
);
92 public static final ExtensionType
AREA_OF_INTREREST(){
93 return getTermByUuid(uuidAreaOfInterest
);
96 public static final ExtensionType
NOMENCLATURAL_STANDARD(){
97 return getTermByUuid(uuidNomStandard
);
100 public static final ExtensionType
ABBREVIATION(){
101 return getTermByUuid(uuidAbbreviation
);
104 public static final ExtensionType
ORDER(){
105 return getTermByUuid(uuidOrder
);
108 public static final ExtensionType
INFORMAL_CATEGORY(){
109 return getTermByUuid(uuidInformalCategory
);
114 protected void setDefaultTerms(TermVocabulary
<ExtensionType
> termVocabulary
) {
115 termMap
= new HashMap
<UUID
, ExtensionType
>();
116 for (ExtensionType term
: termVocabulary
.getTerms()){
117 termMap
.put(term
.getUuid(), term
);