示例#1
0
 private List<Group> getData() {
   List<Group> results = null;
   int numeroRegistro = 0;
   paginationContext.setMaxResults(10000);
   List<Group> auxResults;
   results = new ArrayList<Group>();
   results.addAll(service.getPaginated(Constants.FRIST, paginationContext));
   numeroRegistro = results.size();
   while (numeroRegistro < paginationContext.getTotalCount()) {
     auxResults = service.getPaginated(Constants.NEXT, paginationContext);
     numeroRegistro += auxResults.size();
     results.addAll(auxResults);
   }
   return results;
 }
示例#2
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 "";
 }