use of javax.faces.application.FacesMessage in project oxAuth by GluuFederation.
the class LogoutAction method logoutFailed.
public void logoutFailed() {
String message = languageBean.getMessage("logout.failedToProceed");
facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
facesService.redirect("/error.xhtml");
}
use of javax.faces.application.FacesMessage in project opentheso by miledrousset.
the class AutoCompletBean method addTGeneOtherGroup.
/**
* Cette fonction permet d'ajouter une relation TG d'unn autre Group
* Le TG existe déjà dans le thésaurus, donc c'est une relation à créer
* en ajoutant en plus le nouveau domaine à la branche
*
* // Auteur Miled Rousset
*
* @return
*/
public boolean addTGeneOtherGroup() {
if (selectedAtt == null || selectedAtt.getIdConcept().equals("")) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("autoComp.error1")));
return false;
}
if (selectedAtt.getIdConcept().equals(terme.getIdC())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("autoComp.impossible")));
return false;
}
if (!terme.addTermeGeneOtherGroup(terme.getIdC(), terme.getIdDomaine(), selectedAtt.getIdConcept())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("autoComp.error2")));
return false;
}
tree.reInit();
tree.reExpand();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", selectedAtt.getTermLexicalValue() + " " + langueBean.getMsg("autoComp.info1")));
selectedAtt = new NodeAutoCompletion();
return true;
}
use of javax.faces.application.FacesMessage in project opentheso by miledrousset.
the class AutoCompletBean method newTSpe.
/**
* Permet de créer un nouveau concept en vérifiant sa validité
*/
public void newTSpe() {
createValid = false;
terme.setValueEdit(terme.getSelectedTermComp().getTermLexicalValue());
if (terme.getValueEdit().trim().equals("")) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("tree.error1")));
return;
}
String valueEdit = terme.getValueEdit().trim();
// vérification si c'est le même nom, on fait rien
if (valueEdit.equalsIgnoreCase(terme.getNom())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("autoComp.impossible")));
return;
}
// vérification si le term à ajouter existe déjà
if (terme.isTermExist(valueEdit) != null) {
duplicate = true;
// FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error6")));
return;
}
if (!terme.creerTermeSpe(((MyTreeNode) tree.getSelectedNode()))) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("error")));
return;
} else {
tree.reInit();
tree.reExpand();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", valueEdit + " " + langueBean.getMsg("tree.info1")));
}
terme.setSelectedTermComp(new NodeAutoCompletion());
createValid = true;
PrimeFaces pf = PrimeFaces.current();
if (pf.isAjaxRequest()) {
pf.ajax().update("idNtEditDlg");
}
// RequestContext.getCurrentInstance().update("idNtEditDlg");
}
use of javax.faces.application.FacesMessage in project opentheso by miledrousset.
the class AutoCompletBean method addTGene.
/**
* Cette fonction permet d'ajouter une relation TG à un concept Le TG existe
* déjà dans le thésaurus, donc c'est une relation à créer
*
* @return
*/
public boolean addTGene() {
// terme.getIdTheso() est l'id du thésaurus
if (selectedAtt == null || selectedAtt.getIdConcept().equals("")) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("autoComp.error1")));
return false;
}
if (selectedAtt.getIdConcept().equals(terme.getIdC())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("autoComp.impossible")));
return false;
}
// addTermeGene(idNT, idBT)
if (!terme.addTermeGene(terme.getIdC(), selectedAtt.getIdConcept())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("autoComp.error2")));
return false;
}
tree.reInit();
tree.reExpand();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", selectedAtt.getTermLexicalValue() + " " + langueBean.getMsg("autoComp.info1")));
selectedAtt = new NodeAutoCompletion();
return true;
}
use of javax.faces.application.FacesMessage in project opentheso by miledrousset.
the class CurrentUser method updateAlertMail.
public boolean updateAlertMail() {
try {
UserHelper userHelper = new UserHelper();
Connection conn = connect.getPoolConnexion().getConnection();
conn.setAutoCommit(false);
if (!userHelper.setAlertMailForUser(connect.getPoolConnexion().getConnection(), user.getId(), alertmail)) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("error.BDD")));
conn.rollback();
conn.close();
return false;
}
conn.commit();
conn.close();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(langueBean.getMsg("info") + " :", langueBean.getMsg("conf.alertMailMessage")));
return true;
} catch (SQLException ex) {
Logger.getLogger(CurrentUser.class.getName()).log(Level.SEVERE, null, ex);
}
return false;
}
Aggregations