Subversion Repositories eFlore/Applications.del

Rev

Rev 890 | Rev 918 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
658 benjamin 1
package org.tela_botanica.del.client.modeles;
2
 
663 benjamin 3
import java.util.ArrayList;
658 benjamin 4
import java.util.Date;
663 benjamin 5
import java.util.List;
881 aurelien 6
public class InterventionForum {
690 gduche 7
 
8
	private Contributeur contributeur;
658 benjamin 9
	private Date date;
890 gduche 10
	private String id, idParent;
881 aurelien 11
	private InterventionForum parent;
12
	private Observation observation;
663 benjamin 13
	public List<Commentaire> listeCommentaires = new ArrayList<Commentaire>();
683 gduche 14
 
881 aurelien 15
	public void setId(String id) {
16
		this.id = id;
17
	}
18
 
19
	public String getId() {
20
		return id;
21
	}
22
 
890 gduche 23
	public String getIdParent() {
24
		return idParent;
25
	}
26
 
27
	public void setIdParent(String idParent) {
28
		this.idParent = idParent;
29
	}
30
 
881 aurelien 31
	public void setParent(InterventionForum parent) {
32
		this.parent = parent;
33
	}
34
 
893 gduche 35
	public boolean estFils() {
36
		return (this.parent != null);
37
	}
38
 
881 aurelien 39
	public InterventionForum getParent() {
40
		return parent;
41
	}
42
 
43
	public void setObservation(Observation observation) {
44
		this.observation = observation;
45
	}
46
 
47
	public Observation getObservation() {
48
		return observation;
49
	}
50
 
658 benjamin 51
	public String getAuteur() {
690 gduche 52
		return contributeur.getNomComplet();
658 benjamin 53
	}
683 gduche 54
 
690 gduche 55
	public void setContributeur(Contributeur contributeur) {
56
		this.contributeur = contributeur;
658 benjamin 57
	}
690 gduche 58
 
59
	public Contributeur getContributeur() {
60
		return contributeur;
683 gduche 61
	}
62
 
658 benjamin 63
	public Date getDate() {
64
		return date;
65
	}
683 gduche 66
 
658 benjamin 67
	public void setDate(Date date) {
68
		this.date = date;
69
	}
683 gduche 70
 
663 benjamin 71
	public List<Commentaire> getListeCommentaires() {
72
		return listeCommentaires;
73
	}
658 benjamin 74
 
663 benjamin 75
	public void setListeCommentaires(List<Commentaire> listeCommentaires) {
76
		this.listeCommentaires = listeCommentaires;
77
	}
78
 
79
	public void ajouterCommentaire(Commentaire commentaire) {
80
		listeCommentaires.add(commentaire);
81
	}
887 aurelien 82
 
83
	public PropositionDetermination getPropositionParenteOuNulle() {
84
		InterventionForum parent = getParent();
85
		PropositionDetermination proposition = null;
86
		while(parent != null && !(parent instanceof PropositionDetermination)) {
87
			parent = parent.getParent();
88
		}
89
		if(parent != null) {
90
			proposition = (PropositionDetermination)parent;
91
		}
92
		return proposition;
93
	}
658 benjamin 94
}