2212 |
arthur |
1 |
package org.tela_botanica.del.client.modeles;
|
|
|
2 |
|
|
|
3 |
import java.io.Serializable;
|
|
|
4 |
import java.util.HashMap;
|
|
|
5 |
import java.util.Map;
|
|
|
6 |
|
|
|
7 |
import com.google.gwt.user.client.Window;
|
|
|
8 |
|
|
|
9 |
public class PropositionDetermination extends InterventionForum implements Serializable {
|
|
|
10 |
|
|
|
11 |
private static final long serialVersionUID = 840032625524143547L;
|
|
|
12 |
private String id, espece, commentaire, numNomenclatural, referentiel, valideePar, dateValidation;
|
|
|
13 |
private int nbCommentaires = 0;
|
|
|
14 |
/** Doit valoir 1 s'il y a un commentaire initial, sinon 0 */
|
|
|
15 |
private int commentaireInitial = 0;
|
|
|
16 |
private boolean estPropositionInitiale = false;
|
|
|
17 |
private boolean estPropositionRetenue = false;
|
|
|
18 |
|
|
|
19 |
public boolean estPropositionInitiale() {
|
|
|
20 |
return estPropositionInitiale;
|
|
|
21 |
}
|
|
|
22 |
|
|
|
23 |
public void setEstPropositionInitiale(boolean estPropositionInitiale) {
|
|
|
24 |
this.estPropositionInitiale = estPropositionInitiale;
|
|
|
25 |
}
|
|
|
26 |
|
|
|
27 |
public boolean estPropositionRetenue() {
|
|
|
28 |
//return (this.espece.equals(this.observation.getNomRetenu()));
|
|
|
29 |
return estPropositionRetenue;
|
|
|
30 |
}
|
|
|
31 |
|
|
|
32 |
public void setEstPropositionRetenue(boolean estPropositionRetenue) {
|
|
|
33 |
this.estPropositionRetenue = estPropositionRetenue;
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
private Map<String, VoteDetermination> votesDeterminations = new HashMap<String, VoteDetermination>();
|
|
|
37 |
private Observation observation;
|
|
|
38 |
|
|
|
39 |
public PropositionDetermination(String id, Contributeur contributeur, String texte) {
|
|
|
40 |
setId(id);
|
|
|
41 |
setContributeur(contributeur);
|
|
|
42 |
setCommentaire(texte);
|
|
|
43 |
}
|
|
|
44 |
|
|
|
45 |
public PropositionDetermination(Observation observation) {
|
|
|
46 |
this.observation = observation;
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
protected void additionnerCommentaireInitial() {
|
|
|
50 |
if (this.commentaire != null && !this.commentaire.equals("")) {
|
|
|
51 |
commentaireInitial = 1;
|
|
|
52 |
} else {
|
|
|
53 |
commentaireInitial = 0;
|
|
|
54 |
}
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
public void ajouterVoteDetermination(VoteDetermination vd) {
|
|
|
58 |
votesDeterminations.put(vd.getContributeur(), vd);
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
public String getId() {
|
|
|
62 |
return id;
|
|
|
63 |
}
|
|
|
64 |
|
|
|
65 |
public void setId(String id) {
|
|
|
66 |
this.id = id;
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
public String getEspece() {
|
|
|
70 |
return espece;
|
|
|
71 |
}
|
|
|
72 |
|
|
|
73 |
public void setEspece(String espece) {
|
|
|
74 |
this.espece = espece;
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
public Map<String, VoteDetermination> getVotesDeterminations() {
|
|
|
78 |
return votesDeterminations;
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
public void setVotesDeterminations(Map<String, VoteDetermination> votesDeterminations) {
|
|
|
82 |
this.votesDeterminations = votesDeterminations;
|
|
|
83 |
}
|
|
|
84 |
|
|
|
85 |
public boolean utilisateurAVotePourDetermination(String idContributeur) {
|
|
|
86 |
return votesDeterminations.containsKey(idContributeur);
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
public Observation getObservation() {
|
|
|
90 |
return observation;
|
|
|
91 |
}
|
|
|
92 |
|
|
|
93 |
public void setObservation(Observation observation) {
|
|
|
94 |
this.observation = observation;
|
|
|
95 |
}
|
|
|
96 |
|
|
|
97 |
public void setCommentaire(String commentaire) {
|
|
|
98 |
this.commentaire = commentaire;
|
|
|
99 |
additionnerCommentaireInitial();
|
|
|
100 |
}
|
|
|
101 |
|
|
|
102 |
public String getCommentaire() {
|
|
|
103 |
return commentaire;
|
|
|
104 |
}
|
|
|
105 |
|
|
|
106 |
public void setNbCommentaires(int nbCommentaires) {
|
|
|
107 |
this.nbCommentaires = nbCommentaires;
|
|
|
108 |
}
|
|
|
109 |
|
|
|
110 |
public int getTotalCommentaires() {
|
|
|
111 |
if (nbCommentaires == 0 && this.listeCommentaires.size() != 0) {
|
|
|
112 |
// wtf ?
|
|
|
113 |
nbCommentaires = super.getTotalCommentaires();
|
|
|
114 |
}
|
|
|
115 |
|
|
|
116 |
return nbCommentaires + commentaireInitial;
|
|
|
117 |
}
|
|
|
118 |
|
|
|
119 |
public String getNumNomenclatural() {
|
|
|
120 |
return numNomenclatural;
|
|
|
121 |
}
|
|
|
122 |
|
|
|
123 |
public void setNumNomenclatural(String numNomenclatural) {
|
|
|
124 |
this.numNomenclatural = numNomenclatural;
|
|
|
125 |
}
|
|
|
126 |
|
|
|
127 |
public String getReferentiel() {
|
|
|
128 |
return referentiel;
|
|
|
129 |
}
|
|
|
130 |
|
|
|
131 |
public void setReferentiel(String referentiel) {
|
|
|
132 |
this.referentiel = referentiel;
|
|
|
133 |
}
|
|
|
134 |
|
|
|
135 |
public String getValideePar() {
|
|
|
136 |
return valideePar;
|
|
|
137 |
}
|
|
|
138 |
|
|
|
139 |
public void setValideePar(String idUtilisateur) {
|
|
|
140 |
valideePar = idUtilisateur;
|
|
|
141 |
}
|
|
|
142 |
|
|
|
143 |
public void setDateValidation(String dateValidation) {
|
|
|
144 |
this.dateValidation = dateValidation;
|
|
|
145 |
}
|
|
|
146 |
|
|
|
147 |
public String getDateValidation() {
|
|
|
148 |
return dateValidation;
|
|
|
149 |
}
|
|
|
150 |
}
|