Project

General

Profile

Download (2.37 KB) Statistics
| Branch: | Tag: | Revision:
1
package eu.etaxonomy.cdm.vaadin.model;
2

    
3
import java.io.Serializable;
4
import java.util.Collection;
5
import java.util.List;
6
import java.util.Map;
7
import java.util.UUID;
8

    
9
import eu.etaxonomy.cdm.model.common.CdmBase;
10
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
11
import eu.etaxonomy.cdm.model.description.Distribution;
12
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
13
import eu.etaxonomy.cdm.model.name.Rank;
14
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
15
import eu.etaxonomy.cdm.model.taxon.Taxon;
16

    
17

    
18
public class DbTableDTO implements Serializable {
19

    
20
	private static final long serialVersionUID = 1L;
21

    
22
	private Taxon taxon;
23

    
24
	public Taxon getTaxon() {
25
		return taxon;
26
	}
27

    
28
	public void setTaxon(Taxon taxon) {
29
		this.taxon = taxon;
30
	}
31
	private Rank rank;
32

    
33
	private DistributionDTO dDTO;
34

    
35
	
36

    
37
	public DbTableDTO(Taxon taxon){
38
		this.taxon = CdmBase.deproxy(taxon, Taxon.class);
39
	}
40

    
41
	//----Getter - Setter - methods ----//
42
	
43
	public DistributionDTO getdDTO() {
44
		return dDTO;
45
	}
46

    
47
	public void setdDTO(DistributionDTO dDTO) {
48
		this.dDTO = dDTO;
49
	}
50

    
51
	/**
52
	 * 
53
	 * @return
54
	 */
55
	public String getFullTitleCache() {
56
		TaxonNameBase name = taxon.getName();
57
		name = CdmBase.deproxy(name, TaxonNameBase.class);
58
		if(name ==  null){
59
			return "-";
60
		}
61
		return name.getFullTitleCache();
62
	}
63
	/**
64
	 * 
65
	 * @param fullTitleCache
66
	 */
67
	public void setFullTitleCache(String fullTitleCache) {
68
		taxon.getName().setFullTitleCache(fullTitleCache, true);
69
		taxon.setTitleCache(fullTitleCache, true);
70
	}
71

    
72
	/**
73
	 * Returns the taxonomic {@link Rank rank} of <i>this</i> taxon name.
74
	 *
75
	 * @see 	Rank
76
	 */
77
	public String getRank(){
78
		rank = taxon.getName().getRank();
79
		if(rank == null){
80
			return "-";
81
		}
82
		return rank.toString();
83
	}
84

    
85
	public UUID getUUID(){
86
		return taxon.getUuid();
87
	}
88

    
89
	/**
90
	 * @see  #getRank()
91
	 */
92
	public void setRank(Rank rank){
93
		taxon.getName().setRank(rank);
94
	}
95
	/**
96
	 * 
97
	 * @return
98
	 */
99

    
100

    
101

    
102

    
103
	//----------- Detail View ------------------//
104

    
105
	/**
106
	 * 
107
	 * @return
108
	 */
109
	public String getTaxonNameCache(){
110
		return taxon.getName().getTitleCache();
111
	}
112

    
113
	public void setTaxonNameCache(String titlecache){
114
		taxon.getName().setTitleCache(titlecache, true);
115
	}
116
	/**
117
	 * 
118
	 * @return
119
	 */
120
	public String getNomenclaturalCode(){
121
		return taxon.getName().getNomenclaturalCode().getTitleCache();
122
	}
123
	/**
124
	 * 
125
	 * @return
126
	 */
127
	public String getSecundum(){
128
		return taxon.getSec().toString();
129
	}
130

    
131
}
(3-3/8)