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.io.sdd;
|
11
|
|
12
|
import java.util.UUID;
|
13
|
|
14
|
import org.apache.log4j.Logger;
|
15
|
|
16
|
import eu.etaxonomy.cdm.common.CdmUtils;
|
17
|
import eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase;
|
18
|
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
|
19
|
import eu.etaxonomy.cdm.model.common.MarkerType;
|
20
|
import eu.etaxonomy.cdm.model.description.Feature;
|
21
|
|
22
|
/**
|
23
|
* @author a.mueller
|
24
|
* @since 01.03.2010
|
25
|
* @version 1.0
|
26
|
*/
|
27
|
public class SDDTransformer extends InputTransformerBase {
|
28
|
@SuppressWarnings("unused")
|
29
|
private static final Logger logger = Logger.getLogger(SDDTransformer.class);
|
30
|
|
31
|
|
32
|
|
33
|
// //feature uuids
|
34
|
// public static final UUID uuidNote = UUID.fromString("b9af1489-6b68-497f-8d4b-260a9f886827");
|
35
|
//
|
36
|
//marker type uuid
|
37
|
public static final UUID uuidMarkerEditor = UUID.fromString("9f06df5b-7b89-43d2-ac4a-8c57a173af8d");
|
38
|
public static final UUID uuidMarkerSDDGeographicArea = UUID.fromString("aa623fc8-bfb6-4bc9-b0d4-62f7a022d472");
|
39
|
public static final UUID uuidMarkerDescriptiveConcept = UUID.fromString("037e8126-334e-460c-bfb3-cee640dfa3a3");
|
40
|
|
41
|
|
42
|
/* (non-Javadoc)
|
43
|
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getFeatureByKey(java.lang.String)
|
44
|
*/
|
45
|
@Override
|
46
|
public Feature getFeatureByKey(String key) throws UndefinedTransformerMethodException {
|
47
|
if (CdmUtils.isEmpty(key)){return null;
|
48
|
// }else if (key.equalsIgnoreCase("distribution")){return Feature.DISTRIBUTION();
|
49
|
// }else if (key.equalsIgnoreCase("habitatecology")){return Feature.ECOLOGY();
|
50
|
}else{
|
51
|
return null;
|
52
|
}
|
53
|
}
|
54
|
|
55
|
/* (non-Javadoc)
|
56
|
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getFeatureUuid(java.lang.String)
|
57
|
*/
|
58
|
@Override
|
59
|
public UUID getFeatureUuid(String key) throws UndefinedTransformerMethodException {
|
60
|
if (CdmUtils.isEmpty(key)){return null;
|
61
|
|
62
|
// }else if (key.equalsIgnoreCase("lifeform")){return uuidNote;
|
63
|
|
64
|
}else{
|
65
|
return null;
|
66
|
}
|
67
|
|
68
|
}
|
69
|
|
70
|
|
71
|
|
72
|
/* (non-Javadoc)
|
73
|
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getMarkerTypeByKey(java.lang.String)
|
74
|
*/
|
75
|
@Override
|
76
|
public MarkerType getMarkerTypeByKey(String key) throws UndefinedTransformerMethodException {
|
77
|
if (CdmUtils.isEmpty(key)){return null;
|
78
|
// }else if (key.equalsIgnoreCase("distribution")){return MarkerType.;
|
79
|
// }else if (key.equalsIgnoreCase("habitatecology")){return Feature.ECOLOGY();
|
80
|
}else{
|
81
|
return null;
|
82
|
}
|
83
|
}
|
84
|
|
85
|
@Override
|
86
|
public UUID getMarkerTypeUuid(String key) throws UndefinedTransformerMethodException {
|
87
|
if (CdmUtils.isEmpty(key)){return null;
|
88
|
// }else if (key.equalsIgnoreCase("excluded")){return uuidExcludedTaxon;
|
89
|
// }else if (key.equalsIgnoreCase("EXCLUDED SPECIES, OF UNCERTAIN AFHNITIES PTELEOCARPA")){return uuidExcludedTaxon;
|
90
|
// }else if (key.equalsIgnoreCase("EXCLUDED GENUS, OF UNCERTAIN AFHNITIES PTELEOCARPA")){return uuidExcludedTaxon;
|
91
|
// }else if (key.equalsIgnoreCase("INCOMPLETELY KNOWN SPECIES")){return uuidNote;
|
92
|
}else{
|
93
|
return null;
|
94
|
}
|
95
|
|
96
|
}
|
97
|
|
98
|
|
99
|
|
100
|
|
101
|
|
102
|
}
|