Subversion Repositories eFlore/Applications.del

Rev

Rev 1775 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1775 Rev 1928
Line 2... Line 2...
2
 
2
 
3
import java.io.Serializable;
3
import java.io.Serializable;
4
import java.util.HashMap;
4
import java.util.HashMap;
Line -... Line 5...
-
 
5
import java.util.Map;
-
 
6
 
5
import java.util.Map;
7
import com.google.gwt.user.client.Window;
Line 6... Line 8...
6
 
8
 
7
public class PropositionDetermination extends InterventionForum implements Serializable {
9
public class PropositionDetermination extends InterventionForum implements Serializable {
8
 
10
 
-
 
11
	private static final long serialVersionUID = 840032625524143547L;
-
 
12
	private String id, espece, commentaire, numNomenclatural, referentiel, valideePar, dateValidation;
9
	private static final long serialVersionUID = 840032625524143547L;
13
	private int nbCommentaires = 0;
Line 10... Line 14...
10
	private String id, espece, commentaire, numNomenclatural, referentiel, valideePar, dateValidation;
14
	/** Doit valoir 1 s'il y a un commentaire initial, sinon 0 */
Line 11... Line 15...
11
	private int nbCommentaires = 0;
15
	private int commentaireInitial = 0;
Line 32... Line 36...
32
 
36
 
33
	public PropositionDetermination(Observation observation) {
37
	public PropositionDetermination(Observation observation) {
34
		this.observation = observation;
38
		this.observation = observation;
Line -... Line 39...
-
 
39
	}
-
 
40
 
-
 
41
	protected void additionnerCommentaireInitial() {
-
 
42
		if (this.commentaire != null && !this.commentaire.equals("")) {
-
 
43
			commentaireInitial = 1;
-
 
44
		} else {
-
 
45
			commentaireInitial = 0;
-
 
46
		}
35
	}
47
	}
36
 
48
 
37
	public boolean estPropositionRetenue() {
49
	public boolean estPropositionRetenue() {
Line 38... Line 50...
38
		return (this.espece.equals(this.observation.getNomRetenu()));
50
		return (this.espece.equals(this.observation.getNomRetenu()));
Line 78... Line 90...
78
		this.observation = observation;
90
		this.observation = observation;
79
	}
91
	}
Line 80... Line 92...
80
 
92
 
81
	public void setCommentaire(String commentaire) {
93
	public void setCommentaire(String commentaire) {
-
 
94
		this.commentaire = commentaire;
82
		this.commentaire = commentaire;
95
		additionnerCommentaireInitial();
Line 83... Line 96...
83
	}
96
	}
84
 
97
 
85
	public String getCommentaire() {
98
	public String getCommentaire() {
Line 89... Line 102...
89
	public void setNbCommentaires(int nbCommentaires) {
102
	public void setNbCommentaires(int nbCommentaires) {
90
		this.nbCommentaires = nbCommentaires;
103
		this.nbCommentaires = nbCommentaires;
91
	}
104
	}
Line 92... Line 105...
92
 
105
 
93
	public int getTotalCommentaires() {
-
 
94
		// le nombre de commentaire peut avoir été renvoyé par le web service
-
 
95
		// sans que l'on possède la liste des commentaires elle même, auquel cas, il sera différent de 0
-
 
96
		// et ne doit pas être recalculé
106
	public int getTotalCommentaires() {
-
 
107
		if (nbCommentaires == 0 && this.listeCommentaires.size() != 0) {
97
		if (nbCommentaires == 0 && this.listeCommentaires.size() != 0) {
108
			// wtf ?
98
			nbCommentaires = super.getTotalCommentaires();
-
 
99
			if (this.getCommentaire() != null&&this.getCommentaire()!="") {
-
 
100
				nbCommentaires += 1;
-
 
101
			}
-
 
102
		}
-
 
103
		if (this.commentaire != null && !this.commentaire.equals("")) {
-
 
104
			nbCommentaires ++;
109
			nbCommentaires = super.getTotalCommentaires();
Line 105... Line 110...
105
		}
110
		}
106
 
111
 
Line 107... Line 112...
107
		return nbCommentaires;
112
		return nbCommentaires + commentaireInitial;
108
	}
113
	}
109
	
114