Subversion Repositories eFlore/Applications.del

Rev

Rev 887 | Rev 893 | 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
 
35
	public InterventionForum getParent() {
36
		return parent;
37
	}
38
 
39
	public void setObservation(Observation observation) {
40
		this.observation = observation;
41
	}
42
 
43
	public Observation getObservation() {
44
		return observation;
45
	}
46
 
658 benjamin 47
	public String getAuteur() {
690 gduche 48
		return contributeur.getNomComplet();
658 benjamin 49
	}
683 gduche 50
 
690 gduche 51
	public void setContributeur(Contributeur contributeur) {
52
		this.contributeur = contributeur;
658 benjamin 53
	}
690 gduche 54
 
55
	public Contributeur getContributeur() {
56
		return contributeur;
683 gduche 57
	}
58
 
658 benjamin 59
	public Date getDate() {
60
		return date;
61
	}
683 gduche 62
 
658 benjamin 63
	public void setDate(Date date) {
64
		this.date = date;
65
	}
683 gduche 66
 
663 benjamin 67
	public List<Commentaire> getListeCommentaires() {
68
		return listeCommentaires;
69
	}
658 benjamin 70
 
663 benjamin 71
	public void setListeCommentaires(List<Commentaire> listeCommentaires) {
72
		this.listeCommentaires = listeCommentaires;
73
	}
74
 
75
	public void ajouterCommentaire(Commentaire commentaire) {
76
		listeCommentaires.add(commentaire);
77
	}
887 aurelien 78
 
79
	public PropositionDetermination getPropositionParenteOuNulle() {
80
		InterventionForum parent = getParent();
81
		PropositionDetermination proposition = null;
82
		while(parent != null && !(parent instanceof PropositionDetermination)) {
83
			parent = parent.getParent();
84
		}
85
		if(parent != null) {
86
			proposition = (PropositionDetermination)parent;
87
		}
88
		return proposition;
89
	}
658 benjamin 90
}