1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2016 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
package eu.etaxonomy.cdm.ext.geo;
|
11
|
|
12
|
import java.util.Map;
|
13
|
import java.util.UUID;
|
14
|
|
15
|
import eu.etaxonomy.cdm.model.common.Language;
|
16
|
import eu.etaxonomy.cdm.model.common.Representation;
|
17
|
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
|
18
|
|
19
|
/**
|
20
|
* Base class for Distribution Composers
|
21
|
* @author a.mueller
|
22
|
* @date 02.06.2016
|
23
|
*
|
24
|
*/
|
25
|
public abstract class CondensedDistributionComposerBase implements ICondensedDistributionComposer{
|
26
|
|
27
|
protected static Map<UUID, String> statusSymbols;
|
28
|
|
29
|
|
30
|
|
31
|
protected String areaPreTag = "<b>";
|
32
|
|
33
|
protected String areaPostTag = "</b>";
|
34
|
|
35
|
|
36
|
|
37
|
/**
|
38
|
* @param status
|
39
|
* @return
|
40
|
*/
|
41
|
protected String statusSymbol(PresenceAbsenceTerm status) {
|
42
|
if(status == null) {
|
43
|
return "";
|
44
|
}
|
45
|
String symbol = statusSymbols.get(status.getUuid());
|
46
|
if(symbol != null) {
|
47
|
return symbol;
|
48
|
}else if (status.getSymbol() != null){
|
49
|
return status.getSymbol();
|
50
|
}else if (status.getIdInVocabulary() != null){
|
51
|
return status.getIdInVocabulary();
|
52
|
}else {
|
53
|
Representation r = status.getPreferredRepresentation((Language)null);
|
54
|
if (r != null){
|
55
|
String abbrevLabel = r.getAbbreviatedLabel();
|
56
|
if (abbrevLabel != null){
|
57
|
return abbrevLabel;
|
58
|
}
|
59
|
}
|
60
|
}
|
61
|
|
62
|
return "n.a.";
|
63
|
}
|
64
|
|
65
|
/**
|
66
|
* @param status
|
67
|
* @return
|
68
|
*/
|
69
|
private String statusSymbolEuroMedOld(PresenceAbsenceTerm status) {
|
70
|
if(status == null) {
|
71
|
return "";
|
72
|
}
|
73
|
String symbol = statusSymbols.get(status.getUuid());
|
74
|
if(symbol == null) {
|
75
|
symbol = "";
|
76
|
}
|
77
|
return symbol;
|
78
|
}
|
79
|
|
80
|
|
81
|
public String getAreaPreTag() {
|
82
|
return areaPreTag;
|
83
|
}
|
84
|
|
85
|
public void setAreaPreTag(String areaPreTag) {
|
86
|
this.areaPreTag = areaPreTag;
|
87
|
}
|
88
|
|
89
|
public String getAreaPostTag() {
|
90
|
return areaPostTag;
|
91
|
}
|
92
|
|
93
|
public void setAreaPostTag(String areaPostTag) {
|
94
|
this.areaPostTag = areaPostTag;
|
95
|
}
|
96
|
|
97
|
|
98
|
|
99
|
}
|