Ejemplo n.º 1
0
  /**
   * Checks for errors in the error map and transforms them to struts action messages then stores in
   * the request.
   */
  private void publishMessages(HttpServletRequest request) {
    MessageMap errorMap = GlobalVariables.getMessageMap();
    if (!errorMap.hasNoErrors()) {
      ErrorContainer errorContainer = new ErrorContainer(errorMap);

      request.setAttribute("ErrorContainer", errorContainer);
      request.setAttribute(Globals.ERROR_KEY, errorContainer.getRequestErrors());
      request.setAttribute("ErrorPropertyList", errorContainer.getErrorPropertyList());
    }

    if (errorMap.hasWarnings()) {
      WarningContainer warningsContainer = new WarningContainer(errorMap);

      request.setAttribute("WarningContainer", warningsContainer);
      request.setAttribute("WarningActionMessages", warningsContainer.getRequestMessages());
      request.setAttribute("WarningPropertyList", warningsContainer.getMessagePropertyList());
    }

    if (errorMap.hasInfo()) {
      InfoContainer infoContainer = new InfoContainer(errorMap);

      request.setAttribute("InfoContainer", infoContainer);
      request.setAttribute("InfoActionMessages", infoContainer.getRequestMessages());
      request.setAttribute("InfoPropertyList", infoContainer.getMessagePropertyList());
    }
  }
Ejemplo n.º 2
0
  /**
   * @see
   *     org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase#processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument)
   */
  @Override
  protected boolean processCustomRouteDocumentBusinessRules(MaintenanceDocument document) {

    boolean isValid = true;
    isValid &= super.processCustomRouteDocumentBusinessRules(document);
    MessageMap errorMap = GlobalVariables.getMessageMap();
    isValid &= errorMap.hasNoErrors();

    if (isValid) {

      isValid = validateReportingGroupOrder(newReportingGroup);
    }

    return isValid;
  }