use of fr.univlorraine.ecandidat.utils.bean.presentation.SimpleTablePresentation in project esup-ecandidat by EsupPortail.
the class AdminCacheView method init.
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
/* Style */
setSizeFull();
setMargin(true);
setSpacing(true);
/* Titre */
Label titleNom = new Label(applicationContext.getMessage("adminCacheView.title", null, UI.getCurrent().getLocale()));
titleNom.addStyleName(StyleConstants.VIEW_TITLE);
addComponent(titleNom);
/*Label*/
CustomPanel cp = new CustomPanel(applicationContext.getMessage("cache.panel.caption", null, UI.getCurrent().getLocale()), applicationContext.getMessage("cache.panel.label", null, UI.getCurrent().getLocale()), FontAwesome.WARNING);
cp.setMargin(true);
addComponent(cp);
/*Reload ALL*/
OneClickButton button = new OneClickButton(applicationContext.getMessage("cache.action.btn.all", null, UI.getCurrent().getLocale()), FontAwesome.REFRESH);
button.addClickListener(e -> {
cacheController.askToReloadData(null);
reloadContainer();
});
addComponent(button);
cacheTable.addGeneratedColumn(SimpleTablePresentation.CHAMPS_ACTION, new ColumnGenerator() {
private static final long serialVersionUID = 7461290324017459118L;
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
final SimpleTablePresentation bean = (SimpleTablePresentation) itemId;
OneClickButton button = new OneClickButton(applicationContext.getMessage("cache.action.btn", null, UI.getCurrent().getLocale()), FontAwesome.REFRESH);
button.addClickListener(e -> {
cacheController.askToReloadData(bean.getCode());
reloadContainer();
});
return button;
}
});
cacheTable.setVisibleColumns((Object[]) FIELDS_ORDER);
for (String fieldName : FIELDS_ORDER) {
cacheTable.setColumnHeader(fieldName, applicationContext.getMessage("cache." + fieldName, null, UI.getCurrent().getLocale()));
}
cacheTable.setSortContainerPropertyId(SimpleTablePresentation.CHAMPS_TITLE);
cacheTable.setColumnCollapsingAllowed(false);
cacheTable.setColumnReorderingAllowed(false);
cacheTable.setSelectable(false);
cacheTable.setImmediate(true);
cacheTable.setCellStyleGenerator((components, itemId, columnId) -> {
if (columnId != null && columnId.equals(SimpleTablePresentation.CHAMPS_TITLE)) {
return (ValoTheme.LABEL_BOLD);
}
return null;
});
cacheTable.setSizeFull();
addComponent(cacheTable);
setExpandRatio(cacheTable, 1);
}
use of fr.univlorraine.ecandidat.utils.bean.presentation.SimpleTablePresentation in project esup-ecandidat by EsupPortail.
the class AdminVersionView method init.
/**
* Initialise la vue
*/
@PostConstruct
public void init() {
/* Style */
setSizeFull();
setMargin(true);
setSpacing(true);
/* Titre */
final Label titleNom = new Label(applicationContext.getMessage("adminVersionView.title", null, UI.getCurrent().getLocale()));
titleNom.addStyleName(StyleConstants.VIEW_TITLE);
addComponent(titleNom);
versionTable.addGeneratedColumn(SimpleTablePresentation.CHAMPS_ACTION, new ColumnGenerator() {
private static final long serialVersionUID = 7461290324017459118L;
@Override
public Object generateCell(final Table source, final Object itemId, final Object columnId) {
final SimpleTablePresentation bean = (SimpleTablePresentation) itemId;
final OneClickButton btnCheck = new OneClickButton(applicationContext.getMessage("btnCheck", null, UI.getCurrent().getLocale()), FontAwesome.ROTATE_RIGHT);
switch(bean.getCode()) {
case NomenclatureUtils.VERSION_DEMAT:
btnCheck.addClickListener(e -> {
fileController.testDemat(true);
});
return btnCheck;
case NomenclatureUtils.VERSION_SI_SCOL_COD:
btnCheck.addClickListener(e -> {
siScolController.testSiScolConnnexion();
});
return btnCheck;
case NomenclatureUtils.VERSION_WS:
btnCheck.addClickListener(e -> {
siScolController.testWSSiScolConnnexion();
});
return btnCheck;
case NomenclatureUtils.VERSION_WS_PJ:
btnCheck.addClickListener(e -> {
if (demoController.getDemoMode()) {
return;
}
final AdminWsPjWindow window = new AdminWsPjWindow();
UI.getCurrent().addWindow(window);
});
return btnCheck;
case NomenclatureUtils.VERSION_LS:
btnCheck.addClickListener(e -> {
formulaireController.testConnexionLS();
});
return btnCheck;
case NomenclatureUtils.VERSION_INES:
btnCheck.addClickListener(e -> {
final AdminInesWindow window = new AdminInesWindow();
UI.getCurrent().addWindow(window);
});
return btnCheck;
default:
return null;
}
}
});
versionTable.setVisibleColumns((Object[]) FIELDS_ORDER);
for (final String fieldName : FIELDS_ORDER) {
versionTable.setColumnHeader(fieldName, applicationContext.getMessage("version." + fieldName, null, UI.getCurrent().getLocale()));
}
versionTable.setSortContainerPropertyId(SimpleTablePresentation.CHAMPS_ORDER);
versionTable.setColumnCollapsingAllowed(false);
versionTable.setColumnReorderingAllowed(false);
versionTable.setSelectable(false);
versionTable.setImmediate(true);
versionTable.setColumnWidth(SimpleTablePresentation.CHAMPS_TITLE, 300);
versionTable.setCellStyleGenerator((components, itemId, columnId) -> {
if (columnId != null && columnId.equals(SimpleTablePresentation.CHAMPS_TITLE)) {
return (ValoTheme.LABEL_BOLD);
}
return null;
});
addComponent(versionTable);
setExpandRatio(versionTable, 1);
}
use of fr.univlorraine.ecandidat.utils.bean.presentation.SimpleTablePresentation in project esup-ecandidat by EsupPortail.
the class CandidatureController method getInformationsCandidature.
/**
* @param candidature
* @return une liste de données perso à afficher
*/
public List<SimpleTablePresentation> getInformationsCandidature(final Candidature candidature, final Boolean isCandidatOfCandidature) {
final List<SimpleTablePresentation> liste = new ArrayList<>();
final Formation formation = candidature.getFormation();
final TypeDecisionCandidature typeDecision = getLastTypeDecisionCandidature(candidature);
liste.add(new SimpleTablePresentation("candidature." + Candidature_.formation.getName() + "." + Formation_.libForm.getName(), applicationContext.getMessage("candidature." + Candidature_.formation.getName() + "." + Formation_.libForm.getName(), null, UI.getCurrent().getLocale()), formation.getLibForm()));
final SimpleTablePresentation stpStatutDossier = new SimpleTablePresentation("candidature." + ConstanteUtils.CANDIDATURE_LIB_STATUT, applicationContext.getMessage("candidature." + ConstanteUtils.CANDIDATURE_LIB_STATUT, null, UI.getCurrent().getLocale()), i18nController.getI18nTraduction(candidature.getTypeStatut().getI18nLibTypStatut()));
stpStatutDossier.setShortValue(candidature.getTypeStatut().getCodTypStatut());
liste.add(stpStatutDossier);
/* gestionnaire-->On affiche le type de traitement */
if (!isCandidatOfCandidature) {
String libTypTraitement = i18nController.getI18nTraduction(candidature.getTypeTraitement().getI18nLibTypTrait());
if (candidature.getTemValidTypTraitCand()) {
libTypTraitement = libTypTraitement + " (" + applicationContext.getMessage("valide", null, UI.getCurrent().getLocale()) + ")";
} else {
libTypTraitement = libTypTraitement + " (" + applicationContext.getMessage("non.valide", null, UI.getCurrent().getLocale()) + ")";
}
liste.add((new SimpleTablePresentation("candidature." + ConstanteUtils.CANDIDATURE_LIB_TYPE_TRAITEMENT, applicationContext.getMessage("candidature." + ConstanteUtils.CANDIDATURE_LIB_TYPE_TRAITEMENT, null, UI.getCurrent().getLocale()), libTypTraitement)));
}
String libTypDecision = getLibLastTypeDecisionCandidature(typeDecision, isCandidatOfCandidature);
String commentaire = null;
String codeTypeDecision = NomenclatureUtils.TYP_AVIS_ATTENTE;
/* La decision n'est pas null et le candidat est candidiat avec un avis validé */
if (typeDecision != null && (!isCandidatOfCandidature || (isCandidatOfCandidature && typeDecision.getTemValidTypeDecCand()))) {
if (typeDecision.getTemValidTypeDecCand()) {
if (!isCandidatOfCandidature) {
libTypDecision = libTypDecision + " (" + applicationContext.getMessage("valide.date", new Object[] { typeDecision.getDatValidTypeDecCand() != null ? formatterDate.format(typeDecision.getDatValidTypeDecCand()) : "" }, UI.getCurrent().getLocale()) + ")";
}
if (candidature.getTemAcceptCand() != null && candidature.getTemAcceptCand()) {
libTypDecision = libTypDecision + " : " + applicationContext.getMessage("candidature.confirm.label", null, UI.getCurrent().getLocale());
} else if (candidature.getTemAcceptCand() != null && !candidature.getTemAcceptCand()) {
libTypDecision = libTypDecision + " : " + applicationContext.getMessage("candidature.desist.label", null, UI.getCurrent().getLocale());
}
} else {
libTypDecision = libTypDecision + " (" + applicationContext.getMessage("non.valide", null, UI.getCurrent().getLocale()) + ")";
}
if (typeDecision.getTypeDecision().getTypeAvis().equals(tableRefController.getTypeAvisPreselect())) {
libTypDecision = libTypDecision + "<br>" + ctrCandCandidatureController.getComplementPreselectMail(typeDecision);
}
codeTypeDecision = typeDecision.getTypeDecision().getTypeAvis().getCodTypAvis();
if (!isCandidatOfCandidature || typeDecision.getTypeDecision().getTemAffCommentTypDec()) {
commentaire = typeDecision.getCommentTypeDecCand();
}
}
final SimpleTablePresentation stpDecision = new SimpleTablePresentation("candidature." + ConstanteUtils.CANDIDATURE_LIB_LAST_DECISION, applicationContext.getMessage("candidature." + ConstanteUtils.CANDIDATURE_LIB_LAST_DECISION, null, UI.getCurrent().getLocale()), libTypDecision);
stpDecision.setShortValue(codeTypeDecision);
liste.add(stpDecision);
/* Ajout de l'info de confirmation pour les gestionnaires */
if (!isCandidatOfCandidature) {
if (candidature.getTemAcceptCand() != null && candidature.getDatAcceptCand() != null && candidature.getUserAcceptCand() != null) {
final Object[] params = new Object[] { formatterDateTime.format(candidature.getDatAcceptCand()), candidature.getUserAcceptCand() };
String code = "candidature." + ConstanteUtils.CANDIDATURE_LIB_DESIST;
if (candidature.getTemAcceptCand()) {
code = "candidature." + ConstanteUtils.CANDIDATURE_LIB_CONFIRM;
}
liste.add((new SimpleTablePresentation(code, applicationContext.getMessage(code, null, UI.getCurrent().getLocale()), applicationContext.getMessage(code + ".val", params, UI.getCurrent().getLocale()))));
}
}
/* On ajoute le commentaire lié à l'avis à la suite */
if (commentaire != null && !commentaire.equals("")) {
liste.add(new SimpleTablePresentation("candidature." + ConstanteUtils.CANDIDATURE_COMMENTAIRE, applicationContext.getMessage("candidature." + ConstanteUtils.CANDIDATURE_COMMENTAIRE, null, UI.getCurrent().getLocale()), commentaire));
}
/* gestionnaire-->On affiche le numéro OPI */
if (!isCandidatOfCandidature) {
String opi = applicationContext.getMessage("candidature.no.opi", null, UI.getCurrent().getLocale());
if (candidature.getOpi() != null && candidature.getOpi().getDatPassageOpi() != null) {
if (candidature.getOpi().getCodOpi() != null) {
opi = candidature.getOpi().getCodOpi();
} else {
opi = parametreController.getPrefixeOPI() + candidature.getCandidat().getCompteMinima().getNumDossierOpiCptMin();
}
opi = applicationContext.getMessage("candidature.valOpi", new Object[] { opi, formatterDateTime.format(candidature.getOpi().getDatPassageOpi()) }, UI.getCurrent().getLocale());
}
liste.add(new SimpleTablePresentation("candidature." + ConstanteUtils.CANDIDATURE_OPI, applicationContext.getMessage("candidature." + ConstanteUtils.CANDIDATURE_OPI, null, UI.getCurrent().getLocale()), opi));
/* Exoneration */
if (candidature.getSiScolCatExoExt() != null) {
liste.add(new SimpleTablePresentation("candidature." + ConstanteUtils.CANDIDATURE_EXO, applicationContext.getMessage("candidature." + ConstanteUtils.CANDIDATURE_EXO, null, UI.getCurrent().getLocale()), candidature.getSiScolCatExoExt().getDisplayLibelle()));
}
/* Complément Exoneration */
if (candidature.getCompExoExtCand() != null) {
liste.add(new SimpleTablePresentation("candidature." + ConstanteUtils.CANDIDATURE_COMP_EXO, applicationContext.getMessage("candidature." + ConstanteUtils.CANDIDATURE_COMP_EXO, null, UI.getCurrent().getLocale()), candidature.getCompExoExtCand()));
}
} else {
if (candidature.getOpi() != null && candidature.getOpi().getDatPassageOpi() != null && candidature.getOpi().getCodOpi() != null) {
liste.add(new SimpleTablePresentation("candidature." + ConstanteUtils.CANDIDATURE_ID_INS, applicationContext.getMessage("candidature." + ConstanteUtils.CANDIDATURE_ID_INS, null, UI.getCurrent().getLocale()), candidature.getOpi().getCodOpi()));
}
}
/* Si montant on l'affiche */
if (candidature.getMntChargeCand() != null) {
liste.add(new SimpleTablePresentation("candidature." + ConstanteUtils.CANDIDATURE_MNT, applicationContext.getMessage("candidature." + ConstanteUtils.CANDIDATURE_MNT, null, UI.getCurrent().getLocale()), MethodUtils.parseBigDecimalAsString(candidature.getMntChargeCand()) + "€"));
}
return liste;
}
use of fr.univlorraine.ecandidat.utils.bean.presentation.SimpleTablePresentation in project esup-ecandidat by EsupPortail.
the class CandidatController method getInformationsAdresse.
/**
* @return une liste de données adresse à afficher
*/
public List<SimpleTablePresentation> getInformationsAdresse(final Adresse adresse) {
final List<SimpleTablePresentation> liste = new ArrayList<>();
if (adresse == null) {
return liste;
} else {
liste.add(new SimpleTablePresentation(1, Adresse_.siScolPays.getName(), applicationContext.getMessage("adresse." + Adresse_.siScolPays.getName(), null, UI.getCurrent().getLocale()), adresse.getSiScolPays().getLibPay()));
if (adresse.getSiScolCommune() == null) {
liste.add(new SimpleTablePresentation(2, Adresse_.libComEtrAdr.getName(), applicationContext.getMessage("adresse." + Adresse_.libComEtrAdr.getName(), null, UI.getCurrent().getLocale()), adresse.getLibComEtrAdr()));
} else {
liste.add(new SimpleTablePresentation(2, Adresse_.codBdiAdr.getName(), applicationContext.getMessage("adresse." + Adresse_.codBdiAdr.getName(), null, UI.getCurrent().getLocale()), adresse.getCodBdiAdr()));
liste.add(new SimpleTablePresentation(3, Adresse_.siScolCommune.getName(), applicationContext.getMessage("adresse." + Adresse_.siScolCommune.getName(), null, UI.getCurrent().getLocale()), adresse.getSiScolCommune().getLibCom()));
}
liste.add(new SimpleTablePresentation(4, Adresse_.adr1Adr.getName(), applicationContext.getMessage("adresse." + Adresse_.adr1Adr.getName(), null, UI.getCurrent().getLocale()), adresse.getAdr1Adr()));
liste.add(new SimpleTablePresentation(5, Adresse_.adr2Adr.getName(), applicationContext.getMessage("adresse." + Adresse_.adr2Adr.getName(), null, UI.getCurrent().getLocale()), adresse.getAdr2Adr()));
liste.add(new SimpleTablePresentation(6, Adresse_.adr3Adr.getName(), applicationContext.getMessage("adresse." + Adresse_.adr3Adr.getName(), null, UI.getCurrent().getLocale()), adresse.getAdr3Adr()));
}
return liste;
}
use of fr.univlorraine.ecandidat.utils.bean.presentation.SimpleTablePresentation in project esup-ecandidat by EsupPortail.
the class CandidatController method getInfoForAdmin.
/**
* @param cptMin
* @return les infos du compte a minima
*/
public List<SimpleTablePresentation> getInfoForAdmin(final CompteMinima cptMin) {
final List<SimpleTablePresentation> liste = new ArrayList<>();
liste.add(new SimpleTablePresentation(1, CompteMinima_.nomCptMin.getName(), applicationContext.getMessage("compteMinima.table." + CompteMinima_.nomCptMin.getName(), null, UI.getCurrent().getLocale()), cptMin.getNomCptMin()));
liste.add(new SimpleTablePresentation(2, CompteMinima_.prenomCptMin.getName(), applicationContext.getMessage("compteMinima.table." + CompteMinima_.prenomCptMin.getName(), null, UI.getCurrent().getLocale()), cptMin.getPrenomCptMin()));
liste.add(new SimpleTablePresentation(3, CompteMinima_.mailPersoCptMin.getName(), applicationContext.getMessage("compteMinima.table." + CompteMinima_.mailPersoCptMin.getName(), null, UI.getCurrent().getLocale()), cptMin.getMailPersoCptMin()));
liste.add(new SimpleTablePresentation(4, CompteMinima_.numDossierOpiCptMin.getName(), applicationContext.getMessage("compteMinima.table." + CompteMinima_.numDossierOpiCptMin.getName(), null, UI.getCurrent().getLocale()), cptMin.getNumDossierOpiCptMin()));
liste.add(new SimpleTablePresentation(5, CompteMinima_.loginCptMin.getName(), applicationContext.getMessage("compteMinima.table." + CompteMinima_.loginCptMin.getName(), null, UI.getCurrent().getLocale()), cptMin.getLoginCptMin()));
liste.add(new SimpleTablePresentation(6, CompteMinima_.supannEtuIdCptMin.getName(), applicationContext.getMessage("compteMinima.table." + CompteMinima_.supannEtuIdCptMin.getName(), null, UI.getCurrent().getLocale()), cptMin.getSupannEtuIdCptMin()));
liste.add(new SimpleTablePresentation(7, CompteMinima_.datCreCptMin.getName(), applicationContext.getMessage("compteMinima.table." + CompteMinima_.datCreCptMin.getName(), null, UI.getCurrent().getLocale()), (cptMin.getDatCreCptMin() != null ? formatterDate.format(cptMin.getDatCreCptMin()) : null)));
liste.add(new SimpleTablePresentation(8, CompteMinima_.datFinValidCptMin.getName(), applicationContext.getMessage("compteMinima.table." + CompteMinima_.datFinValidCptMin.getName(), null, UI.getCurrent().getLocale()), (cptMin.getDatFinValidCptMin() != null ? formatterDate.format(cptMin.getDatFinValidCptMin()) : null)));
liste.add(new SimpleTablePresentation(9, CompteMinima_.temValidCptMin.getName(), applicationContext.getMessage("compteMinima.table." + CompteMinima_.temValidCptMin.getName(), null, UI.getCurrent().getLocale()), cptMin.getTemValidCptMin()));
liste.add(new SimpleTablePresentation(10, CompteMinima_.temValidMailCptMin.getName(), applicationContext.getMessage("compteMinima.table." + CompteMinima_.temValidMailCptMin.getName(), null, UI.getCurrent().getLocale()), cptMin.getTemValidMailCptMin()));
liste.add(new SimpleTablePresentation(10, CompteMinima_.temFcCptMin.getName(), applicationContext.getMessage("compteMinima.table." + CompteMinima_.temFcCptMin.getName(), null, UI.getCurrent().getLocale()), cptMin.getTemFcCptMin()));
return liste;
}
Aggregations