Search in sources :

Example 31 with FacesMessage

use of javax.faces.application.FacesMessage in project microservices by pwillhan.

the class Base64Converter method getString.

public String getString(Object value) {
    if (!(value instanceof Serializable))
        throw new ConverterException(new FacesMessage("Must be java.io.Serializable: " + value));
    try (ByteArrayOutputStream bo = new ByteArrayOutputStream();
        ObjectOutputStream so = new ObjectOutputStream(MimeUtility.encode(bo, "base64"))) {
        so.writeObject(value);
        so.flush();
        return bo.toString();
    } catch (Exception ex) {
        throw new RuntimeException(ex);
    }
}
Also used : ConverterException(javax.faces.convert.ConverterException) FacesMessage(javax.faces.application.FacesMessage) ConverterException(javax.faces.convert.ConverterException)

Example 32 with FacesMessage

use of javax.faces.application.FacesMessage in project rubia-forums by flashboss.

the class ModeratorAction method setInfoBundleMessage.

private void setInfoBundleMessage(String bundleKey) {
    String message = getBundleMessage("ResourceJSF", bundleKey);
    getCurrentInstance().addMessage("message", new FacesMessage(SEVERITY_INFO, message, "moderate"));
}
Also used : FacesMessage(javax.faces.application.FacesMessage)

Example 33 with FacesMessage

use of javax.faces.application.FacesMessage in project rubia-forums by flashboss.

the class ModeratorAction method setWarnBundleMessage.

private void setWarnBundleMessage(String bundleKey) {
    String message = getBundleMessage("ResourceJSF", bundleKey);
    getCurrentInstance().addMessage("message", new FacesMessage(SEVERITY_WARN, message, "moderate"));
}
Also used : FacesMessage(javax.faces.application.FacesMessage)

Example 34 with FacesMessage

use of javax.faces.application.FacesMessage in project rubia-forums by flashboss.

the class SplitTopic method setInfoBundleMessage.

private void setInfoBundleMessage(String bundleKey) {
    String message = getBundleMessage("ResourceJSF", bundleKey);
    getCurrentInstance().addMessage("message", new FacesMessage(SEVERITY_INFO, message, "moderate"));
}
Also used : FacesMessage(javax.faces.application.FacesMessage)

Example 35 with FacesMessage

use of javax.faces.application.FacesMessage in project rubia-forums by flashboss.

the class PollValidator method throwValidationException.

private void throwValidationException(String exceptionMsg) throws ValidatorException {
    FacesMessage message = new FacesMessage();
    message.setDetail(getBundleMessage(BUNDLE_NAME, exceptionMsg));
    message.setSummary(getBundleMessage(BUNDLE_NAME, exceptionMsg));
    message.setSeverity(FacesMessage.SEVERITY_ERROR);
    throw new ValidatorException(message);
}
Also used : ValidatorException(javax.faces.validator.ValidatorException) FacesMessage(javax.faces.application.FacesMessage)

Aggregations

FacesMessage (javax.faces.application.FacesMessage)370 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)43 SQLException (java.sql.SQLException)40 Connection (java.sql.Connection)34 FacesContext (javax.faces.context.FacesContext)25 ArrayList (java.util.ArrayList)24 UIInput (javax.faces.component.UIInput)24 ValidatorException (javax.faces.validator.ValidatorException)24 GroupHelper (mom.trd.opentheso.bdd.helper.GroupHelper)22 NodeAutoCompletion (mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion)22 CandidateHelper (mom.trd.opentheso.bdd.helper.CandidateHelper)19 UserHelper2 (mom.trd.opentheso.bdd.helper.UserHelper2)19 IOException (java.io.IOException)16 NoteHelper (mom.trd.opentheso.bdd.helper.NoteHelper)15 Test (org.junit.Test)13 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)12 Term (mom.trd.opentheso.bdd.datas.Term)11 UploadedFile (org.primefaces.model.UploadedFile)11 HikariDataSource (com.zaxxer.hikari.HikariDataSource)10 Date (java.util.Date)10