Subversion Repositories eFlore/Applications.del

Rev

Rev 658 | Rev 834 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.tela_botanica.del.client.modeles;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Observation implements Serializable {

        private static final long serialVersionUID = 840032625524143547L;
        private String id, auteur, nomRetenu, famille, localite, idLocalite, dateTransmission, numNomenclatural, nomCommun, lieuDit, milieu, commentaire, dateReleve;

        private List<String> motsClefs = new ArrayList<String>();

        // les propositions sont une liste ordonnée qui contient soit des
        // proposition de determinations, soit des commentaires
        private List<InterventionForum> propositions = new ArrayList<InterventionForum>();
        private List<Image> images = new ArrayList<Image>();

        public String getAuteur() {
                return auteur;
        }

        public void setAuteur(String auteur) {
                this.auteur = auteur;
        }

        public String getNomRetenu() {
                return nomRetenu;
        }

        public void setNomRetenu(String commonName) {
                this.nomRetenu = commonName;
        }

        public String getNomCommun() {
                return nomCommun;
        }

        public void setNomCommun(String nomCommun) {
                this.nomCommun = nomCommun;
        }

        public String getLieuDit() {
                return this.lieuDit;
        }

        public void setLieuDit(String lieuDit) {
                this.lieuDit = lieuDit;
        }

        public String getMilieu() {
                return milieu;
        }

        public void setMilieu(String milieu) {
                this.milieu = milieu;
        }

        public String getCommentaire() {
                return commentaire;
        }

        public void setCommentaire(String commentaire) {
                this.commentaire = commentaire;
        }

        public String getFamille() {
                return famille;
        }

        public void setFamille(String famille) {
                this.famille = famille;
        }

        public String getIdLocalite() {
                return idLocalite;
        }

        public void setIdLocalite(String idlocalite) {
                this.idLocalite = idlocalite;
        }

        public String getLocalite() {
                return localite;
        }

        public String getLocaliteAvecIdFormatee() {
                String localiteFormatee = this.localite;
                if (idLocalite != null && idLocalite.length() >= 2) {
                        localiteFormatee += " (" + idLocalite.substring(0, 2) + ")";
                }

                return localiteFormatee;
        }

        public void setLocalite(String localite) {
                this.localite = localite;
        }

        public String getDateTransmission() {
                return dateTransmission;
        }

        public void setDateTransmission(String date) {
                this.dateTransmission = date;
        }

        public String getDateReleve() {
                return dateReleve;
        }

        public void setDateReleve(String dateReleve) {
                this.dateReleve = dateReleve;
        }

        public String getNumNomenclatural() {
                return numNomenclatural;
        }

        public void setNumNomenclatural(String numNomenclatural) {
                this.numNomenclatural = numNomenclatural;
        }

        public List<InterventionForum> getInterventionsForum() {
                return propositions;
        }

        public void setInterventionsForum(List<InterventionForum> propositions) {
                this.propositions = propositions;
        }

        public List<String> getMotsClefs() {
                return motsClefs;
        }

        public void setMotsClefs(List<String> motsClefs) {
                this.motsClefs = motsClefs;
        }

        public void ajouterMotsClef(String motsClefs) {
                if (this.motsClefs == null) {
                        this.motsClefs = new ArrayList<String>();
                }
                this.motsClefs.add(motsClefs);
        }

        public void ajouterPropositionDetermination(PropositionDetermination observationValidation) {
                propositions.add(observationValidation);
        }

        public ArrayList<String> getPropositionsTaxonsData() {

                ArrayList<String> propositionsTaxonDatas = new ArrayList<String>();
                for (InterventionForum proposition : propositions) {
                        if (proposition instanceof PropositionDetermination) {
                                String espece = ((PropositionDetermination) proposition).getEspece();
                                if (espece != "" && !propositionsTaxonDatas.contains(espece)) {
                                        propositionsTaxonDatas.add(espece);
                                }
                        }
                }

                return propositionsTaxonDatas;
        }

        public List<PropositionDetermination> getPropositionDeterminations() {
                List<PropositionDetermination> determinations = new ArrayList<PropositionDetermination>();
                for (InterventionForum proposition : getInterventionsForum()) {
                        if (proposition instanceof PropositionDetermination) {
                                determinations.add((PropositionDetermination) proposition);
                        }
                }
                return determinations;
        }

        public List<Image> getImages() {
                return images;
        }

        public void setImages(List<Image> images) {
                this.images = images;
        }

        public String getId() {
                return id;
        }

        public void setId(String id) {
                this.id = id;
        }

}