1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
package fr.gouv.persee.compte;
import java.text.Normalizer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.swing.text.AbstractDocument.LeafElement;
import fr.gouv.persee.business.PerseeUserBusiness;
import fr.gouv.persee.business.api.persee.administration.CompteDto;
import fr.gouv.persee.business.api.persee.administration.CompteService_Itf;
import fr.gouv.persee.business.api.persee.administration.ProfilDto;
import fr.gouv.persee.business.api.persee.administration.ProfilService_Itf;
import fr.gouv.persee.business.api.persee.programmation.EscadronDto;
import fr.gouv.persee.business.api.persee.programmation.EscadronService_Itf;
import fr.gouv.persee.common.AbstractPageBean;
import fr.gouv.persee.common.JsfUtils;
import fr.spi4j.exception.Spi4jValidationException;
@ManagedBean
@ViewScoped
public class ModifierCompteBean extends AbstractPageBean {
// ************************* Constantes ***************************************
private String CHAMP_NON_VALIDE = "/resources/images/Icon-warning2";
private String CHAMP_VALIDE = "/resources/images/ui-icons_persee_greenTick";
// ************************* Variables ****************************************
@EJB
private CompteService_Itf serviceCompte;
@EJB
private EscadronService_Itf serviceEscadron;
@EJB
private ProfilService_Itf serviceProfil;
private String nom;
private String prenom;
private EscadronDto unite;
private String identifiant;
private Collection<EscadronDto> listeEscadrons;
private boolean identifiantOk;
private CompteDto compteSelectionnee;
private Collection<ProfilDto> listeProfils;
private List<ProfilDto> profilsSelectionnes;
private String champsObligatoirePrenom;
private String champsObligatoireNom;
private String champsObligatoireUnite;
private String champsObligatoireProfils;
private boolean afficherFormModif;
private Collection<CompteDto> listeComptes;
private List<CompteDto> lstComptesFiltre;
// ************************* Constructeurs ***********************************
public ModifierCompteBean() {
}
@PostConstruct
private void initCreationCompte() {
serviceEscadron = PerseeUserBusiness.getEscadronService();
serviceCompte = PerseeUserBusiness.getCompteService();
serviceProfil = PerseeUserBusiness.getProfilService();
listeEscadrons = serviceEscadron.findAll();
identifiantOk = false;
compteSelectionnee = new CompteDto();
listeProfils = serviceProfil.findAll();
listeComptes = serviceCompte.findAll();
champsObligatoireNom = CHAMP_NON_VALIDE;
champsObligatoirePrenom = CHAMP_NON_VALIDE;
champsObligatoireProfils = CHAMP_NON_VALIDE;
champsObligatoireUnite = CHAMP_NON_VALIDE;
afficherFormModif = false;
}
public boolean afficherFormulaire(){
if ((compteSelectionnee.get_nom() != null) || (compteSelectionnee.get_nom() == "")){
afficherFormModif = true;
}
else {
afficherFormModif = false;
}
return afficherFormModif;
}
+ tous les getters / setters !!!
} |
Partager