Ejemplo n.º 1
0
 public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
   if (object == null) {
     return null;
   }
   if (object instanceof Excepcion) {
     Excepcion o = (Excepcion) object;
     return getStringKey(o.getId());
   } else {
     throw new IllegalArgumentException(
         "object "
             + object
             + " is of type "
             + object.getClass().getName()
             + "; expected type: "
             + ExcepcionController.class.getName());
   }
 }
Ejemplo n.º 2
0
 private void performDestroy() {
   fCtx = FacesContext.getCurrentInstance();
   Map<String, String> reqMap = fCtx.getExternalContext().getRequestParameterMap();
   String email = (String) reqMap.get("email_account");
   try {
     getFacade().remove(current);
     JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("ExcepcionDeleted"));
     util.sendEmailAccounts(
         email,
         ejbFacadeUsuario.findAll(),
         ResourceBundle.getBundle("/Bundle").getString("DELETE")
             + current.getId()
             + " - "
             + current.getNombre(),
         ResourceBundle.getBundle("/Bundle").getString("EVENTO_DELETE"));
   } catch (Exception e) {
     JsfUtil.addErrorMessage(
         e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured"));
   }
 }
Ejemplo n.º 3
0
 public String create() {
   fCtx = FacesContext.getCurrentInstance();
   Map<String, String> reqMap = fCtx.getExternalContext().getRequestParameterMap();
   String email = (String) reqMap.get("email_account");
   try {
     getFacade().create(current);
     JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("ExcepcionCreated"));
     util.sendEmailAccounts(
         email,
         ejbFacadeUsuario.findAll(),
         ResourceBundle.getBundle("/Bundle").getString("ADD")
             + current.getId()
             + " - "
             + current.getNombre(),
         ResourceBundle.getBundle("/Bundle").getString("EVENTO_ADD"));
     return prepareCreate();
   } catch (Exception e) {
     JsfUtil.addErrorMessage(
         e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured"));
     return null;
   }
 }