Exemple #1
0
 private boolean dataCheckRequiredGroup() {
   boolean required = true;
   if (dualListModelUser.getTarget() == null || dualListModelUser.getTarget().size() == 0) {
     MessageManager.createErrorMessage(
         "editFormGroup:message", JSFUtils.getStringFromBundle("ErrorNoSelectUser"));
     required = false;
   }
   return required;
 }
Exemple #2
0
  public void handleFileUpload(FileUploadEvent event) {

    if (!auxCodeSecureAction.equals(codeSecureAction)) {
      generateRandom();
      throw new ValidatorException(
          new FacesMessage(
              FacesMessage.SEVERITY_ERROR,
              JSFUtils.getStringFromBundle(Constants.ERROR_VALIDATION),
              JSFUtils.getStringFromBundle(Constants.ERROR_VALIDATION)));
    }

    String importProcessResult = importer.importFile(event.getFile());

    if (importProcessResult.contains("Error")) {
      MessageManager.createErrorMessage(
          "importForm:message", JSFUtils.getStringFromBundle("ImportKO"));
    } else {
      MessageManager.createInfoMessage(
          "importForm:message", JSFUtils.getStringFromBundle("ImportOK"));
    }
  }
Exemple #3
0
 public String addCurrentGroup() {
   try {
     if (!auxCodeSecureAction.equals(codeSecureAction)) {
       generateRandom();
       throw new ValidatorException(
           new FacesMessage(
               FacesMessage.SEVERITY_ERROR,
               JSFUtils.getStringFromBundle(Constants.ERROR_VALIDATION),
               JSFUtils.getStringFromBundle(Constants.ERROR_VALIDATION)));
     }
     generateRandom();
     LOGGER.debug(
         "Create a new Group by :" + userLogged.getUsername() + " :" + currentEntity.toString());
     service.add(currentEntity);
     MessageManager.createInfoMessage("newForm:message", JSFUtils.getStringFromBundle("CreateOK"));
   } catch (Exception ex) {
     LOGGER.error("Error add group: " + ex.getMessage(), ex);
     MessageManager.createErrorMessage("newForm:message", ex.getLocalizedMessage());
   }
   reload();
   return "";
 }
Exemple #4
0
 public String updateCurrentGroupPermissionView() {
   try {
     if (!dataCheckRequiredPermission()) {
       return "";
     }
     if (!auxCodeSecureAction.equals(codeSecureAction)) {
       generateRandom();
       throw new ValidatorException(
           new FacesMessage(
               FacesMessage.SEVERITY_ERROR,
               JSFUtils.getStringFromBundle(Constants.ERROR_VALIDATION),
               JSFUtils.getStringFromBundle(Constants.ERROR_VALIDATION)));
     }
     security.addManyGroupPermissionEdit(
         currentEntity.getId().toString(), dualListModelPermission.getTarget());
     MessageManager.createInfoMessage(
         "editFormPermission:message", JSFUtils.getStringFromBundle("UpdateOK"));
   } catch (Exception ex) {
     LOGGER.error("Error update Gruop with permissions: " + ex.getMessage(), ex);
     MessageManager.createErrorMessage("editFormPermission:message", ex.getLocalizedMessage());
   }
   reload();
   return null;
 }