Examples of NewsletterConfig


Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

//    }
  }
 
  public void setNewsletterManagerThreadDelay(long delayMillisec, boolean active,
      String allContentsAttributeName, INewsletterManager newsletterManager) throws Throwable {
    NewsletterConfig config = newsletterManager.getNewsletterConfig();
    config.setActive(active);
    config.setAllContentsAttributeName(allContentsAttributeName);
    Date schedulerStartTime = new Date(new Date().getTime() + delayMillisec);
    config.setStartScheduler(schedulerStartTime);
    newsletterManager.updateNewsletterConfig(config);
    ((INewsletterSchedulerManager) newsletterManager).refresh();
  }
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

    }
  }
 
  public void testSend() throws Throwable {
    try {
      NewsletterConfig config = this._newsletterManager.getNewsletterConfig();
      config.setActive(true);
      config.setHoursDelay(1);
      config.setStartScheduler(new Date(new Date().getTime()+2));
      _newsletterManager.updateNewsletterConfig(config);
     
      this.checkQueue(this._newsletterManager.getContentQueue(), new String[] { });
      String result = this.executeSend("admin");
      assertEquals(Action.SUCCESS, result);
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

   * @param xml The xml containing the configuration.
   * @return The newsletter configuration.
   * @throws ApsSystemException In case of parsing errors.
   */
  public NewsletterConfig extractConfig(String xml) throws ApsSystemException {
    NewsletterConfig config = new NewsletterConfig();
    Element root = this.getRootElement(xml);
    this.extractScheduler(root, config);
    this.extractSubscriptions(root, config);
    this.extractContentTypes(root, config);
    this.extractMailConfig(root, config);
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

        this.init();
        this.activeMailManager(false);
    }
 
  public NewsletterConfig createNewsletterConfig() {
    NewsletterConfig config = new NewsletterConfig();
    config.setSenderCode("senderCode");
    config.setMailAttrName("mailAttrName");
    config.setAlsoHtml(false);
    config.setUnsubscriptionPageCode("newsletter_unsubscribe");
    config.setSubject("subject");
    config.setHtmlHeader("htmlHeader");
    config.setHtmlFooter("htmlFooter");
    config.setHtmlSeparator("htmlSeparator");
    config.setTextHeader("textHeader");
    config.setTextFooter("textFooter");
    config.setTextSeparator("textSeparator");
    config.setSubscribersHtmlFooter("Clicca sul link per cancellare la sottoscrizione <a href=\"{unsubscribeLink}\" >CONFERMA</a></body></html>");
    config.setSubscribersTextFooter("Clicca sul link {unsubscribeLink} per cancellare la sottoscrizione");
   
    config.setSubscriptionPageCode("newsletter_terminatereg");
    config.setSubscriptionTokenValidityDays(90);
    config.setSubscriptionSubject("Conferma la sottoscrizione al servizio di Newsletter");
    config.setSubscriptionHtmlBody("<p>Clicca sul link per confermare <a href=\"{subscribeLink}\" >***CONFERMA***</a></p>");
    config.setSubscriptionTextBody("Clicca sul link {subscribeLink} per confermare");
   
    config.setAllContentsAttributeName("allContentsSubscription");
    config.addSubscription("Attach", "attachAttribute");
    config.addSubscription("Image", "imageAttribute");
    NewsletterContentType contentType = new NewsletterContentType();
    contentType.setContentTypeCode("EVN");
    contentType.setHtmlModel(1);
    contentType.setSimpleTextModel(2);
    config.addContentType(contentType);
    contentType = new NewsletterContentType();
    contentType.setContentTypeCode("ART");
    contentType.setHtmlModel(1);
    contentType.setSimpleTextModel(2);
    config.addContentType(contentType);
    return config;
  }
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

   * @param content Il contenuto per cui si vuole gestire la newsletter.
   * @return true se l'accesso è consentito, false in caso contrario.
   * @throws ApsSystemException
   */
  private boolean isContentAllowed(Content content) throws ApsSystemException {
    NewsletterConfig newsletterConfig = this.getNewsletterManager().getNewsletterConfig();
    NewsletterContentType contentType = newsletterConfig.getContentType(content.getTypeCode());
    if (contentType != null) {
      if (this.getNewsletterManager().getNewsletterConfig().getAllContentsAttributeName() != null) {
        return true;
      }
      Set<Object> categories = newsletterConfig.getSubscriptions().keySet();
      for (Category category : content.getCategories()) {
        if (this.isContained(category, categories)) {
          return true;
        }
      }
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

public class TestNewsletterConfigDOM extends ApsPluginBaseTestCase {
 
  public void testExtractConfig() throws Throwable {
    String xml = this._configManager.getConfigItem(JpnewsletterSystemConstants.NEWSLETTER_CONFIG_ITEM);
    NewsletterConfig config = new NewsletterConfigDOM().extractConfig(xml);
    this.checkOriginaryConfig(config);
  }
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

    this.checkOriginaryConfig(config);
  }
 
  public void testUpdateConfig() throws Throwable {
    NewsletterConfigDOM newsletterConfigDOM = new NewsletterConfigDOM();
    NewsletterConfig config = this.createNewsletterConfig();
    String xml = newsletterConfigDOM.createConfigXml(config);
    NewsletterConfig updatedConfig = newsletterConfigDOM.extractConfig(xml);
    this.compareConfigs(config, updatedConfig);
  }
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

import com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.Subscriber;

public class TestNewsletterManager extends ApsPluginBaseTestCase {
 
  public void testGetUpdateNewsletterConfig() throws Throwable {
    NewsletterConfig originaryConfig = this._newsletterManager.getNewsletterConfig();
    this.checkOriginaryConfig(originaryConfig);
    try {
      NewsletterConfig newConfig = this.createNewsletterConfig();
        this._newsletterManager.updateNewsletterConfig(newConfig);
        NewsletterConfig updatedConfig = this._newsletterManager.getNewsletterConfig();
        this.compareConfigs(newConfig, updatedConfig);
       
        this._newsletterManager.updateNewsletterConfig(originaryConfig);
        updatedConfig = this._newsletterManager.getNewsletterConfig();
        this.compareConfigs(originaryConfig, updatedConfig);
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

    userGroupCodes.add(Group.FREE_GROUP_NAME);
    NewsletterSearchBean searchBean = new NewsletterSearchBean();
    List<String> contentIds = this._newsletterManager.loadNewsletterContentIds(filters, userGroupCodes, searchBean);
    this.compareIds(contentIds, new String[] { "ART180" });
    // imposta l'attributo per tutti i contenuti, quindi cercherà su tutti e non più per categoria
    NewsletterConfig config = this._newsletterManager.getNewsletterConfig();
    try {
      config.setAllContentsAttributeName("allContents");
      config.setActive(false);
      this._newsletterManager.updateNewsletterConfig(config);
      userGroupCodes.add("customers");
      contentIds = this._newsletterManager.loadNewsletterContentIds(filters, userGroupCodes, searchBean);
      this.compareIds(contentIds, new String[] { "ART1", "ART112", "ART102", "ART111", "ART121", "ART122", "ART179", "ART180", "ART187" });
     
View Full Code Here

Examples of com.agiletec.plugins.jpnewsletter.aps.system.services.newsletter.model.NewsletterConfig

  public void testSendNewsletters() throws Throwable {
    try {
      String email = JpnewsletterTestHelper.MAIL_ADDRESS;
      this._helper.addUser("editorCoach_temp", "aaa", "bbb", email, true, true);
      this._helper.addUser("editorCustomers_temp", "aaa", "bbb", email, true, true);
      NewsletterConfig config = this._newsletterManager.getNewsletterConfig();
      config.setActive(true);
      config.setHoursDelay(1);
      config.setStartScheduler(new Date(new Date().getTime()+2000));
      _newsletterManager.updateNewsletterConfig(config);
      this._newsletterManager.addContentToQueue("ART1");
      this._newsletterManager.addContentToQueue("ART102");
      this._newsletterManager.addContentToQueue("ART180");
      assertNull(this._newsletterManager.getContentReport("ART1"));
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.