Examples of MailConfig


Examples of com.agiletec.plugins.jpmail.aps.services.mail.MailConfig

public class SmtpConfigAction extends BaseAction implements ISmtpConfigAction {

  @Override
  public String edit() {
    try {
      MailConfig config = this.getMailManager().getMailConfig();
      this.populateForm(config);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "edit");
      return FAILURE;
    }
View Full Code Here

Examples of com.agiletec.plugins.jpmail.aps.services.mail.MailConfig

  }

  @Override
  public String save() {
    try {
      MailConfig config = this.prepareConfig();
      this.getMailManager().updateMailConfig(config);
      this.addActionMessage(this.getText("message.eMailConfig.savedConfirm"));
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "save");
      return FAILURE;
View Full Code Here

Examples of com.agiletec.plugins.jpmail.aps.services.mail.MailConfig

    return SUCCESS;
  }

  @Override
  public String testSmtp() {
    MailConfig config;
    try {
      config = this.prepareConfig();
      boolean smtpServerTest = this.getMailManager().smtpServerTest(config);
      if (!smtpServerTest) {
        this.addActionError(this.getText("note.smtp.ko"));
View Full Code Here

Examples of com.agiletec.plugins.jpmail.aps.services.mail.MailConfig

      this.setSmtpTimeout(config.getSmtpTimeout());
      this.setSmtpUserName(config.getSmtpUserName());
      this.setSmtpPassword(config.getSmtpPassword());
      this.setSmtpProtocol(config.getSmtpProtocol());
    } else {
      config = new MailConfig();
    }
  }
View Full Code Here

Examples of com.agiletec.plugins.jpmail.aps.services.mail.MailConfig

   *
   * @return a MailConfig starting from the action form fields.
   * @throws ApsSystemException In case of errors.
   */
  protected MailConfig prepareConfig() throws ApsSystemException {
    MailConfig config = this.getMailManager().getMailConfig();
    config.setActive(this.isActive());
    config.setDebug(this.isDebug());
    config.setSmtpHost(this.getSmtpHost());
    config.setSmtpPort(this.getSmtpPort());
    config.setSmtpTimeout(this.getSmtpTimeout());
    config.setSmtpProtocol(this.getSmtpProtocol());
    if (StringUtils.isBlank(this.getSmtpUserName()) && StringUtils.isBlank(this.getSmtpPassword())) {
      config.setSmtpUserName(this.getSmtpUserName());
      config.setSmtpPassword(this.getSmtpPassword());
    } else {
      if (StringUtils.isNotBlank(this.getSmtpPassword())) {
        config.setSmtpPassword(this.getSmtpPassword());
      }
      if (!config.getSmtpUserName().equals(this.getSmtpUserName())) {
        config.setSmtpUserName(this.getSmtpUserName());
      }
    }
    return config;
  }
View Full Code Here

Examples of com.agiletec.plugins.jpmail.aps.services.mail.MailConfig

  }
 
  @Override
  public String edit() {
    try {
      MailConfig config = this.getConfig();
      String code = this.getCode();
      String mail = config.getSender(code);
      if (mail==null || mail.length()==0) {
        this.addActionError(this.getText("error.config.sender.notExists"));
        return ERROR;
      }
      this.setCode(code);
View Full Code Here

Examples of com.agiletec.plugins.jpmail.aps.services.mail.MailConfig

  }
 
  @Override
  public String save() {
    try {
      MailConfig config = this.prepareConfig();
      this.getMailManager().updateMailConfig(config);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "save");
      return FAILURE;
    }
View Full Code Here

Examples of com.agiletec.plugins.jpmail.aps.services.mail.MailConfig

  }
 
  @Override
  public String trash() {
    try {
      MailConfig config = this.getConfig();
      String code = this.getCode();
      if (null == code && null == config.getSender(code)) {
        this.addActionError(this.getText("error.config.sender.notExists"));
        return INPUT;
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "remove");
View Full Code Here

Examples of com.agiletec.plugins.jpmail.aps.services.mail.MailConfig

  }
 
  @Override
  public String delete() {
    try {
      MailConfig config = this.getConfig();
      String code = this.getCode();
      if (null == code && null == config.getSender(code)) {
        this.addActionError(this.getText("error.config.sender.notExists"));
        return INPUT;
      } else {
        config.getSenders().remove(code);
        this.getMailManager().updateMailConfig(config);
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "remove");
      return FAILURE;
View Full Code Here

Examples of com.agiletec.plugins.jpmail.aps.services.mail.MailConfig

   * Prepares a MailConfig starting from the action form fields.
   * @return a MailConfig starting from the action form fields.
   * @throws ApsSystemException In case of errors.
   */
  protected MailConfig prepareConfig() throws ApsSystemException {
    MailConfig config = this.getConfig();
    Map<String, String> senders = config.getSenders();
    String code = this.getCode();
    String mail = this.getMail();
    senders.put(code, mail);
    return config;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.