Package com.agiletec.plugins.jpwtt.aps.system.services.ticket.alerter.mail.model

Examples of com.agiletec.plugins.jpwtt.aps.system.services.ticket.alerter.mail.model.MailTemplate


    config.setSubject(mailElem.getChildText(MAIL_SUBJECT_CHILD));
   
    Element templatesElem = mailElem.getChild(MAIL_TEMPLATES_CHILD);
    List<Element> templates = templatesElem.getChildren(MAIL_TEMPLATE_CHILD);
    for (Element templateElem : templates) {
      MailTemplate template = new MailTemplate();
      String operationString = templateElem.getAttributeValue(MAIL_TEMPLATE_OPERATION_ATTR);
      Integer operation = Integer.valueOf(operationString);
      template.setOperation(operationString);
      List<Element> bodyElements = templateElem.getChildren(MAIL_TEMPLATE_BODY_CHILD);
      for (Element bodyElement : bodyElements) {
        String type = bodyElement.getAttributeValue(MAIL_TEMPLATE_BODY_TYPE_ATTR);
        String body = bodyElement.getText();
        template.addTemplateBody(type, body);
      }
      config.addTemplate(operation, template);
    }
  }
View Full Code Here


    thread.startTicketOperationThread(this, ticket, operation, interventionType, threadName);
  }
 
  @Override
  public void sendAlertOnAddedTicket(Ticket ticket, InterventionType interventionType) {
    MailTemplate template = this.getConfig().getTemplates().get(new Integer(0));
    try {
      this.sendAlert(ticket, null, interventionType, template);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "sendAlertOnAddedTicket");
    }
View Full Code Here

  }
 
  @Override
  public void sendAlertOnTicketOperation(Ticket ticket, TicketOperation operation, InterventionType interventionType) {
    Integer operationCode = new Integer(operation.getOperationCode());
    MailTemplate template = this.getConfig().getTemplates().get(operationCode);
    try {
      this.sendAlert(ticket, operation, interventionType, template);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "sendAlertOnTicketOperation");
    }
View Full Code Here

    assertEquals("email", config.getMailAttrName());
    assertEquals("Wtt Alert", config.getSubject());

    Map<Integer, MailTemplate> templates = config.getTemplates();
    assertEquals(6, templates.size());
    MailTemplate mailTemplate = templates.get(new Integer(5));
    Map<String, String> bodies = mailTemplate.getTemplateBodies();
    assertEquals("Op3: Testo della mail admin", bodies.get(MailTemplate.TEMPLATE_TYPE_ADMIN));
    assertEquals("Op3: Testo della mail user", bodies.get(MailTemplate.TEMPLATE_TYPE_USER));
    assertEquals("Op3: Testo della mail allOperators", bodies.get(MailTemplate.TEMPLATE_TYPE_ALLOPERATORS));

    List<String> adminAddresses = config.getCommonAdminAddresses();
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpwtt.aps.system.services.ticket.alerter.mail.model.MailTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.