Revision 7abafd61
Added by Andreas Müller almost 8 years ago
cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/geo/FloraCubaCondensedDistributionComposer.java | ||
---|---|---|
26 | 26 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
27 | 27 |
import eu.etaxonomy.cdm.model.common.Language; |
28 | 28 |
import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary; |
29 |
import eu.etaxonomy.cdm.model.common.Representation; |
|
29 | 30 |
import eu.etaxonomy.cdm.model.description.Distribution; |
30 | 31 |
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm; |
31 | 32 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
... | ... | |
53 | 54 |
// Mapping as defined in ticket http://dev.e-taxonomy.eu/trac/ticket/5682 |
54 | 55 |
// ================================================== |
55 | 56 |
|
56 |
statusSymbols = new HashMap<UUID, String> (); |
|
57 |
// ● endemic (U+25CF BLACK CIRCLE) |
|
58 |
statusSymbols.put(PresenceAbsenceTerm.ENDEMIC_FOR_THE_RELEVANT_AREA().getUuid(), "\u25CF"); |
|
59 |
|
|
60 |
// Lu native (incl. archaeophytes) TODO status archaeophytes? |
|
61 |
statusSymbols.put(PresenceAbsenceTerm.NATIVE().getUuid(), ""); |
|
62 |
// statusSymbols.put(PresenceAbsenceTerm.NATIVE_FORMERLY_NATIVE().getUuid(), ""); |
|
63 |
|
|
64 |
// ?Lu doubtfully present (U+3F QUESTION MARK) |
|
65 |
// statusSymbols.put(PresenceAbsenceTerm.INTRODUCED_PRESENCE_QUESTIONABLE().getUuid(), "?"); |
|
66 |
statusSymbols.put(PresenceAbsenceTerm.NATIVE_PRESENCE_QUESTIONABLE().getUuid(), "?"); |
|
67 |
// statusSymbols.put(PresenceAbsenceTerm.PRESENT_DOUBTFULLY().getUuid(), "?"); |
|
68 |
|
|
69 |
// dLu doubtfully native |
|
70 |
statusSymbols.put(PresenceAbsenceTerm.NATIVE_DOUBTFULLY_NATIVE().getUuid(), "d"); |
|
71 |
|
|
72 |
// -Lu absent but reported in error (U+2D HYPHEN-MINUS) |
|
73 |
// statusSymbols.put(PresenceAbsenceTerm.INTRODUCED_REPORTED_IN_ERROR().getUuid(), "-"); |
|
74 |
statusSymbols.put(PresenceAbsenceTerm.NATIVE_REPORTED_IN_ERROR().getUuid(), "-"); |
|
75 |
statusSymbols.put(REPORTED_IN_ERROR_UUID, "-"); |
|
76 |
|
|
77 |
// [aLu] casual alien = introduced: adventitious (casual) |
|
78 |
statusSymbols.put(PresenceAbsenceTerm.INTRODUCED_ADVENTITIOUS().getUuid(), "a"); |
|
79 |
|
|
80 |
// [cLu] cultivated |
|
81 |
statusSymbols.put(PresenceAbsenceTerm.CULTIVATED() .getUuid(), "c"); |
|
82 |
// statusSymbols.put(PresenceAbsenceTerm.INTRODUCED_CULTIVATED().getUuid(), "c"); |
|
83 |
|
|
84 |
// [nLu] naturalized |
|
85 |
statusSymbols.put(PresenceAbsenceTerm.NATURALISED().getUuid(), "n"); |
|
86 |
// statusSymbols.put(PresenceAbsenceTerm.INTRODUCED_NATURALIZED().getUuid(), "n"); |
|
87 |
|
|
88 |
statusSymbols.put(PresenceAbsenceTerm.CULTIVATED_PRESENCE_QUESTIONABLE().getUuid(), "?c"); |
|
89 |
statusSymbols.put(PresenceAbsenceTerm.CULTIVATED_REPORTED_IN_ERROR().getUuid(), "-c"); |
|
90 |
|
|
91 |
|
|
92 |
//Cuba specific |
|
93 |
//occasionally cultivated |
|
94 |
statusSymbols.put(UUID.fromString("936c3f9a-6099-4322-9792-0a72c6c2ce25"), "(c)"); |
|
95 |
//endemic, doubtfully present |
|
96 |
statusSymbols.put(UUID.fromString("5f954f08-267a-4928-b073-12328f74c187"), "?e"); |
|
97 |
//non-native and doubtfully naturalised |
|
98 |
statusSymbols.put(UUID.fromString("a1e26234-831e-4190-9fe3-011aca09ddba"), "p"); |
|
99 |
//rare casual |
|
100 |
statusSymbols.put(UUID.fromString("8914ce0d-7d31-4c88-8317-985f2b3a493b"), "(a)"); |
|
101 |
//?non-native and doubtfully naturalised |
|
102 |
statusSymbols.put(UUID.fromString("9e0b413b-5a68-4e5b-91f2-227b4f832466"), "?p"); |
|
103 |
//?adventive (casual) alien |
|
104 |
statusSymbols.put(UUID.fromString("c42ca644-1773-4230-a2ee-328a5d4a21ab"), "?a"); |
|
105 |
//endemic, reported in error |
|
106 |
statusSymbols.put(UUID.fromString("679b215d-c231-4ee2-ae12-3ffc3dd528ad"), "-e"); |
|
107 |
//naturalised, reported in error |
|
108 |
statusSymbols.put(UUID.fromString("8d918a37-3add-4e1c-a233-c37dbee209aa"), "-n"); |
|
109 |
//non-native and doubtfully naturalised, reported in error |
|
110 |
statusSymbols.put(UUID.fromString("b9153d90-9e31-465a-a28c-79077a8ed4c2"), "-p"); |
|
111 |
//adventive alien , reported in error |
|
112 |
statusSymbols.put(UUID.fromString("9b910b7b-43e3-4260-961c-6063b11cb7dc"), "-a"); |
|
113 |
//doubtfully native: reported in error |
|
114 |
statusSymbols.put(UUID.fromString("71b72e24-c2b6-44a5-bdab-39f083bf0f06"), "-d"); |
|
115 |
|
|
57 |
statusSymbols = new HashMap<UUID, String> (); |
|
58 |
//no entries as we handle symbols now on model level |
|
116 | 59 |
|
117 | 60 |
} |
118 | 61 |
|
... | ... | |
203 | 146 |
return ""; |
204 | 147 |
} |
205 | 148 |
String symbol = statusSymbols.get(status.getUuid()); |
206 |
if(symbol == null) { |
|
207 |
symbol = ""; |
|
149 |
if(symbol != null) { |
|
150 |
return symbol; |
|
151 |
}else if (status.getSymbol() != null){ |
|
152 |
return status.getSymbol(); |
|
153 |
}else if (status.getIdInVocabulary() != null){ |
|
154 |
return status.getIdInVocabulary(); |
|
155 |
}else { |
|
156 |
Representation r = status.getPreferredRepresentation((Language)null); |
|
157 |
if (r != null){ |
|
158 |
String abbrevLabel = r.getAbbreviatedLabel(); |
|
159 |
if (abbrevLabel != null){ |
|
160 |
return abbrevLabel; |
|
161 |
} |
|
162 |
} |
|
208 | 163 |
} |
209 |
return symbol; |
|
164 |
|
|
165 |
return "n.a."; |
|
210 | 166 |
} |
211 | 167 |
|
212 | 168 |
// private boolean isForeignStatus(PresenceAbsenceTerm status) { |
... | ... | |
247 | 203 |
} |
248 | 204 |
|
249 | 205 |
String areaLabel = makeAreaLabel(langs, area); |
250 |
String cleanSubAreaLabel = StringUtils.replaceEach(areaLabel, new String[] {parentLabel, "(", ")"}, new String[] {"", "", ""}); |
|
206 |
// String cleanSubAreaLabel = StringUtils.replaceEach(areaLabel, new String[] {parentLabel, "(", ")"}, new String[] {"", "", ""}); |
|
207 |
String cleanSubAreaLabel = areaLabel; |
|
251 | 208 |
subAreaString.append(cleanSubAreaLabel); |
252 | 209 |
|
253 | 210 |
if(!area.getIncludes().isEmpty()) { |
Also available in: Unified diff
Update Cuba Condensed String handling