Пример #1
0
 private ActionForward doEndDateConfirmation(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response,
     String questionId,
     String yesMethodName)
     throws Exception {
   List<ErrorMessage> errors =
       GlobalVariables.getMessageMap()
           .getErrorMessagesForProperty(ProposalHierarchyKeyConstants.FIELD_CHILD_NUMBER);
   List<String> proposalNumbers = new ArrayList<String>();
   for (ErrorMessage error : errors) {
     if (error
         .getErrorKey()
         .equals(ProposalHierarchyKeyConstants.QUESTION_EXTEND_PROJECT_DATE_CONFIRM)) {
       proposalNumbers.add(error.getMessageParameters()[0]);
     }
   }
   String proposalNumberList = StringUtils.join(proposalNumbers, ',');
   StrutsConfirmation question =
       buildParameterizedConfirmationQuestion(
           mapping,
           form,
           request,
           response,
           questionId,
           ProposalHierarchyKeyConstants.QUESTION_EXTEND_PROJECT_DATE_CONFIRM,
           proposalNumberList);
   GlobalVariables.getMessageMap().getErrorMessages().clear();
   GlobalVariables.getMessageMap().getWarningMessages().clear();
   GlobalVariables.getMessageMap().getInfoMessages().clear();
   return confirm(question, yesMethodName, "hierarchyActionCanceled");
 }
Пример #2
0
 protected boolean updateSubAwardBudgetDetails(Budget budget, BudgetSubAwards subAward)
     throws Exception {
   List<String[]> errorMessages = new ArrayList<String[]>();
   boolean success =
       getKcBusinessRulesEngine().applyRules(new BudgetSubAwardsEvent(subAward, budget, ""));
   if (subAward.getNewSubAwardFile().getBytes().length == 0) {
     success = false;
   }
   if (success) {
     getPropDevBudgetSubAwardService()
         .updateSubAwardBudgetDetails(budget, subAward, errorMessages);
   }
   if (!errorMessages.isEmpty()) {
     for (String[] message : errorMessages) {
       String[] messageParameters = null;
       if (message.length > 1) {
         messageParameters = Arrays.copyOfRange(message, 1, message.length);
       }
       if (success) {
         GlobalVariables.getMessageMap()
             .putWarning(Constants.SUBAWARD_FILE_FIELD_NAME, message[0], messageParameters);
       } else {
         GlobalVariables.getMessageMap()
             .putError(Constants.SUBAWARD_FILE_FIELD_NAME, message[0], messageParameters);
       }
     }
   }
   if (success && errorMessages.isEmpty()) {
     GlobalVariables.getMessageMap()
         .putInfo(Constants.SUBAWARD_FILE_FIELD_NAME, Constants.SUBAWARD_FILE_DETAILS_UPDATED);
   }
   return success;
 }