Package com.agiletec.plugins.jpcontentworkflow.aps.system.services.notifier.model

Examples of com.agiletec.plugins.jpcontentworkflow.aps.system.services.notifier.model.NotifierConfig


  }
 
  public void testSetNotifierConfig() throws Throwable {
    WorkflowNotifierDOM configDOM = new WorkflowNotifierDOM();
   
    NotifierConfig newConfig = this.prepareNotifierConfig();
    String xml = configDOM.createConfigXml(newConfig);
   
    NotifierConfig extractedConfig = configDOM.extractConfig(xml);
    this.compareNotifiers(newConfig, extractedConfig);
  }
View Full Code Here


    NotifierConfig extractedConfig = configDOM.extractConfig(xml);
    this.compareNotifiers(newConfig, extractedConfig);
  }
 
  private NotifierConfig prepareNotifierConfig() {
    NotifierConfig notifierConfig = new NotifierConfig();
   
    notifierConfig.setActive(true);
    notifierConfig.setHoursDelay(23);
    notifierConfig.setStartScheduler(new Date());
   
    notifierConfig.setSenderCode("CODE2");
    //notifierConfig.setMailAttrName("eMail");
    notifierConfig.setHtml(true);
    notifierConfig.setSubject("Oggetto");
    notifierConfig.setHeader("header");
    notifierConfig.setTemplate("template");
    notifierConfig.setFooter("footer");
   
    return notifierConfig;
  }
View Full Code Here

    assertEquals("userNotAllowed", result);
   
    result = this.executeConfig("admin");
    assertEquals(Action.SUCCESS, result);
    WorkflowNotifierConfigAction action = (WorkflowNotifierConfigAction) this.getAction();
    NotifierConfig config = action.getConfig();
    assertFalse(config.isActive());
    assertEquals(24, config.getHoursDelay());
    assertEquals("CODE1", config.getSenderCode());
    //assertEquals("email", config.getMailAttrName());
    assertEquals("04/12/2008", action.getStartDate());
    assertEquals(16, action.getHour());
    assertEquals(8, action.getMinute());
   
    assertFalse(config.isHtml());
                assertEquals("[My Own Portal]: A content changed", config.getSubject());
                assertEquals("Hi {user},<br />these contents require your attention<br /><br />", config.getHeader());
                assertEquals("<br />Content {type} - {descr} - Status {status}<br />", config.getTemplate());
                assertEquals("<br />End (footer)", config.getFooter());
  }
View Full Code Here

      params.put("config.template", "template");
      params.put("config.footer", "footer");
     
      String result = this.executeSave("admin", params);
      assertEquals(Action.SUCCESS, result);
      NotifierConfig updatedNotifierConfig = this._notifierManager.getNotifierConfig();
     
      assertTrue(updatedNotifierConfig.isActive());
      assertEquals(10, updatedNotifierConfig.getHoursDelay());
      String startDate = DateFormatter.format(updatedNotifierConfig.getStartScheduler());
      assertEquals("19/11/2009 20:40", startDate);
      assertEquals("CODE1", updatedNotifierConfig.getSenderCode());
      //assertEquals("email", updatedNotifierConfig.getMailAttrName());
      assertTrue(updatedNotifierConfig.isHtml());
      assertEquals("subject", updatedNotifierConfig.getSubject());
      assertEquals("header", updatedNotifierConfig.getHeader());
      assertEquals("template", updatedNotifierConfig.getTemplate());
      assertEquals("footer", updatedNotifierConfig.getFooter());
    } catch(Throwable t) {
      throw t;
    } finally {
      this._configManager.updateConfigItem(JpcontentworkflowSystemConstants.WORKFLOW_NOTIFIER_CONFIG_ITEM, config);
    }
View Full Code Here

    this.activeMailManager(true);
    super.tearDown();
  }
 
  public void testGetNotifierConfig() throws Throwable {
    NotifierConfig notifierConfig = this._notifierManager.getNotifierConfig();
    assertFalse(notifierConfig.isActive());
    assertEquals(24, notifierConfig.getHoursDelay());
    assertEquals("CODE1", notifierConfig.getSenderCode());
    //assertEquals("email", notifierConfig.getMailAttrName());
    assertFalse(notifierConfig.isHtml());
    assertEquals("[My Own Portal]: A content changed", notifierConfig.getSubject());
    assertEquals("Hi {user},<br />these contents require your attention<br /><br />", notifierConfig.getHeader());
    assertEquals("<br />Content {type} - {descr} - Status {status}<br />", notifierConfig.getTemplate());
    assertEquals("<br />End (footer)", notifierConfig.getFooter());
  }
View Full Code Here

    assertEquals("<br />End (footer)", notifierConfig.getFooter());
  }
 
  public void testSetNotifierConfig() throws Throwable {
    String config = this._configManager.getConfigItem(JpcontentworkflowSystemConstants.WORKFLOW_NOTIFIER_CONFIG_ITEM);
    NotifierConfig originaryNotifierConfig = this._notifierManager.getNotifierConfig();
    NotifierConfig newNotifierConfig = this.prepareNotifierConfig();
    try {
      this._notifierManager.saveNotifierConfig(newNotifierConfig);
      NotifierConfig updatedNotifierConfig = this._notifierManager.getNotifierConfig();
      this.compareNotifiers(newNotifierConfig, updatedNotifierConfig);
     
      this._notifierManager.saveNotifierConfig(originaryNotifierConfig);
      updatedNotifierConfig = this._notifierManager.getNotifierConfig();
      this.compareNotifiers(originaryNotifierConfig, updatedNotifierConfig);
View Full Code Here

    }
  }
 
  public void testSendEMails() throws Throwable {
    String config = this._configManager.getConfigItem(JpcontentworkflowSystemConstants.WORKFLOW_NOTIFIER_CONFIG_ITEM);
    NotifierConfig notifierConfig = this._notifierManager.getNotifierConfig();
    try {
      this.addContentStatusChangedEvent("ART1", Content.STATUS_READY);
      this.addContentStatusChangedEvent("ART180", Content.STATUS_DRAFT);
      this.addContentStatusChangedEvent("EVN41", Content.STATUS_READY);
      assertEquals(0, this._helper.getEventsToNotify().size());
      assertEquals(0, this._helper.getNotifiedEvents().size());
     
      notifierConfig.setActive(true);
      this._notifierManager.saveNotifierConfig(notifierConfig);
     
      this.addContentStatusChangedEvent("ART1", Content.STATUS_DRAFT);
      this.addContentStatusChangedEvent("ART180", Content.STATUS_READY);
      this.addContentStatusChangedEvent("EVN41", Content.STATUS_DRAFT);
View Full Code Here

      this._configManager.updateConfigItem(JpcontentworkflowSystemConstants.WORKFLOW_NOTIFIER_CONFIG_ITEM, config);
    }
  }
 
  private NotifierConfig prepareNotifierConfig() {
    NotifierConfig notifierConfig = new NotifierConfig();
   
    notifierConfig.setActive(true);
    notifierConfig.setHoursDelay(23);
    notifierConfig.setStartScheduler(new Date());
   
    notifierConfig.setSenderCode("CODE2");
    //notifierConfig.setMailAttrName("eMail");
    notifierConfig.setHtml(true);
    notifierConfig.setSubject("Oggetto");
    notifierConfig.setHeader("header");
    notifierConfig.setTemplate("template");
    notifierConfig.setFooter("footer");
   
    return notifierConfig;
  }
View Full Code Here

public class WorkflowNotifierConfigAction extends BaseAction implements IWorkflowNotifierConfigAction {
 
  @Override
  public String config() {
    try {
      NotifierConfig notifierConfig = this.getNotifierManager().getNotifierConfig();
      this.valueFormForEdit(notifierConfig);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "config");
      return FAILURE;
    }
View Full Code Here

  }
 
  @Override
  public String save() {
    try {
      NotifierConfig notifierConfig = this.getUpdatedConfig();
      this.getNotifierManager().saveNotifierConfig(notifierConfig);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "save");
      return FAILURE;
    }
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpcontentworkflow.aps.system.services.notifier.model.NotifierConfig

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.