use of fr.univlorraine.ecandidat.views.windows.InputWindow in project esup-ecandidat by EsupPortail.
the class FormulaireController method testConnexionLS.
/**
* Teste la connexion à LimeSurvey
*/
public void testConnexionLS() {
final InputWindow inputWindow = new InputWindow(applicationContext.getMessage("version.ls.message", null, UI.getCurrent().getLocale()), applicationContext.getMessage("version.ls.title", null, UI.getCurrent().getLocale()), false, 15);
inputWindow.addBtnOkListener(text -> {
if (text instanceof String && !text.isEmpty()) {
if (text != null) {
try {
final Integer idForm = Integer.valueOf(text);
final List<SurveyReponse> listeReponse = getListeReponseDedoublonneCandidat(limeSurveyRest.exportResponse(idForm, "fr"));
final StringBuilder sb = new StringBuilder();
sb.append("<b>" + applicationContext.getMessage("version.ls.resultTxt", new Object[] { listeReponse.size() }, UI.getCurrent().getLocale()) + "</b>");
sb.append("<br><br>");
listeReponse.forEach(e -> {
sb.append("<b>NumDossier : " + e.getNumDossier() + ", date : " + e.getDatestamp() + "</b><br>");
if (e.getMapReponses() != null) {
for (final Entry<String, Object> entry : e.getMapReponses().entrySet()) {
sb.append(entry.getKey() + " : " + entry.getValue() + "<br>");
}
}
sb.append("<br>");
});
UI.getCurrent().addWindow(new InfoWindow(applicationContext.getMessage("version.ls.result", null, UI.getCurrent().getLocale()), sb.toString(), 500, 40));
} catch (final Exception e) {
Notification.show(applicationContext.getMessage("version.ls.error", null, UI.getCurrent().getLocale()), Type.WARNING_MESSAGE);
}
}
}
});
UI.getCurrent().addWindow(inputWindow);
}
use of fr.univlorraine.ecandidat.views.windows.InputWindow in project esup-ecandidat by EsupPortail.
the class SiScolController method testWSSiScolConnnexion.
/**
* Teste la connexion au WS Apogée
*/
public void testWSSiScolConnnexion() {
final InputWindow inputWindow = new InputWindow(applicationContext.getMessage("version.ws.message", null, UI.getCurrent().getLocale()), applicationContext.getMessage("version.ws.title", null, UI.getCurrent().getLocale()), false, 15);
inputWindow.addBtnOkListener(text -> {
if (text instanceof String && !text.isEmpty()) {
if (text != null) {
try {
WSIndividu ind;
if (demoController.getDemoMode()) {
ind = demoController.recupInfoEtudiant("0000000000");
} else {
ind = siScolService.getIndividu(text, null, null);
}
String ret = "Pas d'info";
if (ind != null) {
ret = "<u>Individu</u> : <br>" + ind + "<br><br><u>Adresse</u> : <br>" + ind.getAdresse() + "<br><br><u>Bac</u> : <br>" + ind.getBac() + "<br><br><u>Cursus interne</u> : <br>" + ind.getListCursusInterne();
}
UI.getCurrent().addWindow(new InfoWindow(applicationContext.getMessage("version.ws.result", null, UI.getCurrent().getLocale()), ret, 500, 70));
} catch (final Exception e) {
Notification.show(applicationContext.getMessage("version.ws.error", null, UI.getCurrent().getLocale()), Type.WARNING_MESSAGE);
}
}
}
});
UI.getCurrent().addWindow(inputWindow);
}
use of fr.univlorraine.ecandidat.views.windows.InputWindow in project esup-ecandidat by EsupPortail.
the class UiController method sendMessage.
/**
* Permet la saisie et l'envoi d'un message à tous les clients connectés
*/
public void sendMessage() {
InputWindow inputWindow = new InputWindow(applicationContext.getMessage("admin.sendMessage.message", null, UI.getCurrent().getLocale()), applicationContext.getMessage("admin.sendMessage.title", null, UI.getCurrent().getLocale()), true, 255);
inputWindow.addBtnOkListener(text -> {
if (text instanceof String && !text.isEmpty()) {
Notification notification = new Notification(applicationContext.getMessage("admin.sendMessage.notificationCaption", new Object[] { text }, UI.getCurrent().getLocale()), null, Type.TRAY_NOTIFICATION, true);
notification.setDelayMsec(-1);
notification.setDescription("\n" + applicationContext.getMessage("admin.sendMessage.notificationDescription", null, UI.getCurrent().getLocale()));
notification.setPosition(Position.TOP_CENTER);
sendNotification(notification);
}
});
UI.getCurrent().addWindow(inputWindow);
}
Aggregations