Ejemplo n.º 1
0
  public void populate(ActionForm form, HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();
    try {
      EscalationForm escalationForm = (EscalationForm) form;
      EscalationDao escalationDaoImpl = new EscalationDaoImpl();

      // Work Flow Rule Name
      List workflow_rule_name_list = escalationDaoImpl.getworkflow_rule_name_list();
      escalationForm.setWorkflow_rule_name_list(workflow_rule_name_list);

      // Flow Levels
      if (escalationForm.getEscalation_type() != null) {
        String escalation_type = escalationForm.getEscalation_type();
        List flow_level_list = escalationDaoImpl.getflow_levels_list(escalation_type);
        escalationForm.setFlow_level_list(flow_level_list);
      }

      // Escalation Type template
      List escalation_template_list = escalationDaoImpl.getEscalation_Template_List();
      escalationForm.setEscalation_template_list(escalation_template_list);
      System.out.println("escalation_template_list----" + escalation_template_list);
    } catch (Exception e) {
      logger.error("Exception Occurred" + e);
      errors.add("name", new ActionError("id"));
    }
  }
Ejemplo n.º 2
0
  public ActionForward fetchEscalationLevel(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    EscalationDao escalationDaoImpl = new EscalationDaoImpl();
    EscalationForm escalationForm = (EscalationForm) form;
    EscalationDTO escalationDTO = new EscalationDTO();
    String escalation_level_status = null;

    Document document = DocumentHelper.createDocument();
    Element root = document.addElement("options");
    Element optionElement, hiddenElement;

    try {
      String escalation_type = escalationForm.getEscalation_type();
      String workflow_step_id = escalationForm.getWorkflow_step_id();

      System.out.println("escalation_type---->" + escalation_type);
      System.out.println("workflow_step_id---->" + workflow_step_id);

      if (escalation_type != null && workflow_step_id != null) {
        populate(form, request);

        List escalation_level_list =
            escalationDaoImpl.getEscalation_Level(escalation_type, workflow_step_id);

        if (escalation_level_list != null && escalation_level_list.size() > 0) {
          escalationForm.setEscalation_level_list(escalation_level_list);
          for (int intCounter = 0; intCounter < escalation_level_list.size(); intCounter++) {
            optionElement = root.addElement("option");
            optionElement.addAttribute(
                "value",
                ((EscalationDTO) escalation_level_list.get(intCounter)).getEscalation_level());
            optionElement.addAttribute(
                "text",
                ((EscalationDTO) escalation_level_list.get(intCounter)).getEscalation_level());
            hiddenElement = root.addElement("hidden");
            hiddenElement.addAttribute(
                "status",
                ((EscalationDTO) escalation_level_list.get(intCounter))
                    .getEscalation_level_status());
          }
        }
        response.setContentType("text/xml");
        response.setHeader("Cache-Control", "No-Cache");
        PrintWriter out = response.getWriter();
        XMLWriter writer = new XMLWriter(out);
        writer.write(document);
        logger.info("document : \n\n" + document.asXML());
        writer.flush();
        out.flush();
      }
    } catch (Exception exception) {
      exception.printStackTrace();
    }
    return null;
  }
Ejemplo n.º 3
0
  public ActionForward fetchFlowList(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    EscalationDao escalationDaoImpl = new EscalationDaoImpl();
    EscalationForm escalationForm = (EscalationForm) form;
    EscalationDTO escalationDTO = new EscalationDTO();

    Document document = DocumentHelper.createDocument();
    Element root = document.addElement("options");
    Element optionElement;
    try {

      String escalation_type = escalationForm.getEscalation_type();
      System.out.println("escalation_type---->" + escalation_type);

      if (escalation_type != null) {
        // escalation_type = Long.parseLong(request.getParameter("circleID").toString());

        populate(form, request);

        List flow_level_list = escalationForm.getFlow_level_list();

        if (flow_level_list != null && flow_level_list.size() > 0) {
          for (int intCounter = 0; intCounter < flow_level_list.size(); intCounter++) {
            optionElement = root.addElement("option");
            optionElement.addAttribute(
                "value", ((EscalationDTO) flow_level_list.get(intCounter)).getWorkflow_step_id());
            optionElement.addAttribute(
                "text", ((EscalationDTO) flow_level_list.get(intCounter)).getWorkflow_step_id());
          }
        }
        response.setContentType("text/xml");
        response.setHeader("Cache-Control", "No-Cache");
        PrintWriter out = response.getWriter();
        XMLWriter writer = new XMLWriter(out);
        writer.write(document);
        logger.info("document : \n\n" + document.asXML());
        writer.flush();
        out.flush();
      }
    } catch (Exception exception) {
      exception.printStackTrace();
    }
    return null;
  }