Package com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.INewsletterManager


 
  @Override
  public String addSubscription() {
    try {
      String mailAddress = this.getMailAddress();
      INewsletterManager newsletterManager = this.getNewsletterManager();
      Subscriber subscriber = newsletterManager.loadSubscriber(mailAddress);
      if (subscriber == null) {
        newsletterManager.addSubscriber(mailAddress);
      } else if (!subscriber.isActive()) {
        newsletterManager.resetSubscriber(mailAddress);
      } else {
        return INPUT;
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "addSubscription", "Errore durante l'aggiunta di una sottoscrizione");
View Full Code Here


 
  @Override
  public String activateSubscription() {
    try {
      String token = this.getToken();
      INewsletterManager newsletterManager = this.getNewsletterManager();
      String mailAddress = newsletterManager.getAddressFromToken(token);
      if (mailAddress!=null && mailAddress.equals(this.getMailAddress())) {
        newsletterManager.activateSubscriber(mailAddress, token);
      } else {
        return INPUT;
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "activateSubscription", "Errore durante l'aggiunta di una sottoscrizione");
View Full Code Here

  }
 
  @Override
  public String deleteSubscription() {
    try {
      INewsletterManager newsletterManager = this.getNewsletterManager();
      Subscriber subscriber = newsletterManager.loadSubscriber(this.getMailAddress());
      if (null != subscriber) {
        newsletterManager.deleteSubscriber(this.getMailAddress());
      } else {
        String[] args = {this.getMailAddress()};
        this.addActionError(this.getText("jpnewsletter.messsage.emailNotPresent", args));
        return INPUT;
      }
View Full Code Here

  }
 
  @Override
  public String addToQueue() {
    try {
      INewsletterManager newsletterManager = this.getNewsletterManager();
      Set<String> contentIds = this.getContentIds();
      if (contentIds!=null && contentIds.size()>0) {
        List<String> newsletterQueue = newsletterManager.getContentQueue();
        for (String contentId : contentIds) {
          Content content = this.getContentManager().loadContent(contentId, true);
          if (this.checkContent(content)) {
            if (newsletterQueue.contains(contentId)) {
              this.addActionError(this.getText("Errors.newsletter.contentAlreadyAdded", new String[] { content.getDescr() }));
            } else {
              newsletterManager.addContentToQueue(contentId);
              this.addActionMessage(this.getText("Messages.newsletter.addedContent", new String[] { content.getDescr() }));
            }
          }
        }
      }
View Full Code Here

  }
 
  @Override
  public String removeFromQueue() {
    try {
      INewsletterManager newsletterManager = this.getNewsletterManager();
      Set<String> contentIds = this.getContentIds();
      if (contentIds!=null && contentIds.size()>0) {
        for (String contentId : contentIds) {
          newsletterManager.removeContentFromQueue(contentId);
        }
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "removeFromQueue");
      return FAILURE;
View Full Code Here

  }
 
  @Override
  public String removeFromQueue() {
    try {
      INewsletterManager newsletterManager = this.getNewsletterManager();
      String contentId = this.getContentId();
      if (contentId != null) {
        newsletterManager.removeContentFromQueue(contentId);
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "removeFromQueue");
      return FAILURE;
    }
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.INewsletterManager

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.