Search in sources :

Example 1 with PeopleLdap

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;
}
Also used : PeopleLdap(fr.univlorraine.ecandidat.services.ldap.PeopleLdap) ArrayList(java.util.ArrayList)

Example 2 with PeopleLdap

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;
        }
    }
}
Also used : PeopleLdap(fr.univlorraine.ecandidat.services.ldap.PeopleLdap) Individu(fr.univlorraine.ecandidat.entities.ecandidat.Individu) CustomException(fr.univlorraine.ecandidat.utils.CustomException)

Example 3 with PeopleLdap

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);
}
Also used : CompteMinima(fr.univlorraine.ecandidat.entities.ecandidat.CompteMinima) PeopleLdap(fr.univlorraine.ecandidat.services.ldap.PeopleLdap) CandidatCompteMinimaWindow(fr.univlorraine.ecandidat.views.windows.CandidatCompteMinimaWindow)

Example 4 with PeopleLdap

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;
    }
}
Also used : DroitProfil(fr.univlorraine.ecandidat.entities.ecandidat.DroitProfil) PeopleLdap(fr.univlorraine.ecandidat.services.ldap.PeopleLdap)

Aggregations

PeopleLdap (fr.univlorraine.ecandidat.services.ldap.PeopleLdap)4 CompteMinima (fr.univlorraine.ecandidat.entities.ecandidat.CompteMinima)1 DroitProfil (fr.univlorraine.ecandidat.entities.ecandidat.DroitProfil)1 Individu (fr.univlorraine.ecandidat.entities.ecandidat.Individu)1 CustomException (fr.univlorraine.ecandidat.utils.CustomException)1 CandidatCompteMinimaWindow (fr.univlorraine.ecandidat.views.windows.CandidatCompteMinimaWindow)1 ArrayList (java.util.ArrayList)1