use of fr.univlorraine.ecandidat.services.ldap.PeopleLdap in project esup-ecandidat by EsupPortail.
the class DemoController method findListIndividuLdapDemo.
/**
* @return une liste de peopleLdap anonyme pour la recherche Ldap
*/
public List<PeopleLdap> findListIndividuLdapDemo() {
final List<PeopleLdap> liste = new ArrayList<>();
for (int i = 0; i < 6; i++) {
final String login = RandomStringUtils.randomAlphabetic(8).toLowerCase() + RandomStringUtils.randomNumeric(1);
final PeopleLdap people = new PeopleLdap(login, "displayName-" + login, "sn-" + login, "cn-" + login, "mail-" + login, null, "M.", "givenName-" + login);
liste.add(people);
}
return liste;
}
use of fr.univlorraine.ecandidat.services.ldap.PeopleLdap in project esup-ecandidat by EsupPortail.
the class DroitProfilIndividuWindow method getIndividu.
/**
* Renvoi l'individu construit a partir du people Ldap
* @return l'individu
*/
protected Individu getIndividu() {
if (isModificationMode) {
return null;
} else {
final PeopleLdap people = grid.getSelectedItem();
final Individu individu = new Individu(people);
try {
individuController.validateIndividuBean(individu);
return individu;
} catch (final CustomException e) {
Notification.show(e.getMessage(), Notification.Type.WARNING_MESSAGE);
return null;
}
}
}
use of fr.univlorraine.ecandidat.services.ldap.PeopleLdap in project esup-ecandidat by EsupPortail.
the class CandidatController method createCompteMinima.
/**
* Creation d'un compte a minima
*/
public void createCompteMinima(final Boolean createByGest) {
final CompteMinima cptMin = new CompteMinima();
if (!createByGest) {
final String login = userController.getCurrentNoDossierCptMinOrLogin();
if (login != null && !login.equals("")) {
cptMin.setLoginCptMin(login);
final PeopleLdap p = ldapController.findByPrimaryKey(login);
if (p != null) {
if (p.getSupannEtuId() != null && !p.getSupannEtuId().equals("")) {
cptMin.setSupannEtuIdCptMin(p.getSupannEtuId());
}
if (p.getSn() != null && !p.getSn().equals("")) {
cptMin.setNomCptMin(p.getSn());
}
if (p.getGivenName() != null && !p.getGivenName().equals("")) {
cptMin.setPrenomCptMin(p.getGivenName());
}
if (p.getMail() != null && !p.getMail().equals("")) {
cptMin.setMailPersoCptMin(p.getMail());
}
}
}
}
final CandidatCompteMinimaWindow cptMinWin = new CandidatCompteMinimaWindow(cptMin, false, createByGest);
cptMinWin.addCompteMinimaWindowListener(compteMinima -> {
final CompteMinima cpt = saveCompteMinima(compteMinima);
if (cpt != null && !createByGest) {
userController.alimenteSecurityUserCptMin(cpt);
MainUI.getCurrent().reconstructMainMenu();
}
});
UI.getCurrent().addWindow(cptMinWin);
}
use of fr.univlorraine.ecandidat.services.ldap.PeopleLdap in project esup-ecandidat by EsupPortail.
the class DroitProfilIndividuWindow method checkData.
/**
* @return true si les données sont bonnes
*/
protected Boolean checkData() {
final PeopleLdap valPeople = grid.getSelectedItem();
final DroitProfil valDroit = (DroitProfil) cbDroitProfil.getValue();
if (!isModificationMode && valPeople == null) {
Notification.show(applicationContext.getMessage("window.search.selectrow", null, UI.getCurrent().getLocale()), Notification.Type.WARNING_MESSAGE);
return false;
} else if (valDroit == null) {
Notification.show(applicationContext.getMessage("window.search.noright", null, UI.getCurrent().getLocale()), Notification.Type.WARNING_MESSAGE);
return false;
} else {
return true;
}
}
Aggregations