Package com.agiletec.aps.system.services.baseconfig

Examples of com.agiletec.aps.system.services.baseconfig.ConfigInterface


    protected void init() throws Exception {
      try {
        this._newsletterManager = (INewsletterManager) this.getService(JpnewsletterSystemConstants.NEWSLETTER_MANAGER);
        IUserManager userManager = (IUserManager) this.getService(SystemConstants.USER_MANAGER);
        IUserProfileManager profileManager = (IUserProfileManager) this.getService(SystemConstants.USER_PROFILE_MANAGER);
        ConfigInterface configManager = (ConfigInterface) this.getService(SystemConstants.BASE_CONFIG_MANAGER);
        this._helper = new JpnewsletterTestHelper(userManager, profileManager, configManager);
        DataSource dataSource = (DataSource) this.getApplicationContext().getBean("servDataSource");
        this._helper.setDataSource(dataSource);
    } catch (Exception e) {
      throw e;
View Full Code Here


    ApsSystemUtils.getLogger().info(this.getClass().getName() + " ready");
  }

  private void loadConfigs() throws ApsSystemException {
    try {
      ConfigInterface configManager = this.getConfigManager();
      String xml = configManager.getConfigItem(JpcontentfeedbackSystemConstants.GLOBAL_CONFIG_ITEM);
      if (xml == null) {
        throw new ApsSystemException("Configuration item not present: " + JpcontentfeedbackSystemConstants.GLOBAL_CONFIG_ITEM);
      }
      this.setConfig(new ContentFeedbackConfig(xml));
    } catch (Throwable t) {
View Full Code Here

    fieldErrors = this.getAction().getFieldErrors();
    assertEquals(4, fieldErrors.size());
  }

  public void testSave() throws Throwable {
    ConfigInterface configManager = (ConfigInterface) this.getService(SystemConstants.BASE_CONFIG_MANAGER);
    String originaryConfig = configManager.getConfigItem(JpwebdynamicformSystemConstants.MESSAGE_NOTIFIER_CONFIG_ITEM);
    MessageTypeNotifierConfig orginaryComConfig = this._messageManager.getNotifierConfig("COM");
    try {
      Map<String, Object> params = new HashMap<String, Object>();
      params.put("typeCode", "PER");
      params.put("store", "true");
      params.put("mailAttrName", "eMail");
      params.put("notifiable", "true");
      params.put("senderCode", "CODE1");
      params.put("bodyModel", "Mail Body");
      params.put("subjectModel", "Mail Subject");
      String[] recipientsTo = new String[] { "indirizzo1@inesistente.it" };
      String[] recipientsCc = new String[] { "indirizzo2@inesistente.it", "indirizzo3@inesistente.it" };
      String[] recipientsBcc = new String[] { "indirizzo1@inesistente.it", "indirizzo2@inesistente.it" };
      String result = this.executeSave("admin", params, recipientsTo, recipientsCc, recipientsBcc);
      assertEquals(Action.SUCCESS, result);
      String newConfig = configManager.getConfigItem(JpwebdynamicformSystemConstants.MESSAGE_NOTIFIER_CONFIG_ITEM);
      assertFalse(newConfig.equals(originaryConfig));
      MessageTypeNotifierConfig newComConfig = this._messageManager.getNotifierConfig("COM");
      this.checkConfigs(orginaryComConfig, newComConfig);

      MessageTypeNotifierConfig newPerConfig = this._messageManager.getNotifierConfig("PER");
      assertEquals("PER", newPerConfig.getTypeCode());
      assertTrue(newPerConfig.isStore());
      assertEquals("eMail", newPerConfig.getMailAttrName());
      assertTrue(newPerConfig.isNotifiable());
      assertEquals("CODE1", newPerConfig.getSenderCode());
      MessageModel model = newPerConfig.getMessageModel();
      assertEquals("Mail Body", model.getBodyModel());
      assertEquals("Mail Subject", model.getSubjectModel());
      this.checkStrings(recipientsTo, newPerConfig.getRecipientsTo());
      this.checkStrings(recipientsCc, newPerConfig.getRecipientsCc());
      this.checkStrings(recipientsBcc, newPerConfig.getRecipientsBcc());
    } catch (Throwable t) {
      throw t;
    } finally {
      configManager.updateConfigItem(JpwebdynamicformSystemConstants.MESSAGE_NOTIFIER_CONFIG_ITEM, originaryConfig);
    }
  }
View Full Code Here

   * Load the XML configuration containing service configuration.
   * @throws ApsSystemException
   */
  private void loadConfig() throws ApsSystemException {
    try {
      ConfigInterface configManager = this.getConfigManager();
      String xml = configManager.getConfigItem(JpAvatarSystemConstants.CONFIG_ITEM);
      if (xml == null) {
        throw new ApsSystemException("Configuration item not present: " + JpAvatarSystemConstants.CONFIG_ITEM);
      }
      AvatarConfigDOM configDOM = new AvatarConfigDOM();
      this.setConfig(configDOM.extractConfig(xml));
View Full Code Here

import com.agiletec.plugins.jpwebdynamicform.aps.system.services.message.parse.MessageNotifierConfigDOM;

public class TestMessageNotifierConfigDOM extends ApsPluginBaseTestCase {
 
  public void testExtractCreateConfig() throws Throwable {
    ConfigInterface configManager = (ConfigInterface) this.getService(SystemConstants.BASE_CONFIG_MANAGER);
    String xml = configManager.getConfigItem(JpwebdynamicformSystemConstants.MESSAGE_NOTIFIER_CONFIG_ITEM);
   
    MessageNotifierConfigDOM configDOM = new MessageNotifierConfigDOM();
    Map<String, MessageTypeNotifierConfig> config = configDOM.extractConfig(xml);
    this.checkOriginaryConfig(config);
   
View Full Code Here

 
    protected void init() throws Exception {
      try {
        IUserManager userManager = (IUserManager) this.getService(SystemConstants.USER_MANAGER);
        IUserProfileManager profileManager = (IUserProfileManager) this.getService(SystemConstants.USER_PROFILE_MANAGER);
        ConfigInterface configManager = (ConfigInterface) this.getService(SystemConstants.BASE_CONFIG_MANAGER);
        this._helper = new JpnewsletterTestHelper(userManager, profileManager, configManager);
        DataSource dataSource = (DataSource) this.getApplicationContext().getBean("servDataSource");
        this._helper.setDataSource(dataSource);
    } catch (Exception e) {
      throw e;
View Full Code Here

    protected void init() throws Exception {
      try {
        this._newsletterManager = (INewsletterManager) this.getService(JpnewsletterSystemConstants.NEWSLETTER_MANAGER);
        IUserManager userManager = (IUserManager) this.getService(SystemConstants.USER_MANAGER);
        IUserProfileManager profileManager = (IUserProfileManager) this.getService(SystemConstants.USER_PROFILE_MANAGER);
        ConfigInterface configManager = (ConfigInterface) this.getService(SystemConstants.BASE_CONFIG_MANAGER);
        this._helper = new JpnewsletterTestHelper(userManager, profileManager, configManager);
        DataSource dataSource = (DataSource) this.getApplicationContext().getBean("servDataSource");
        this._helper.setDataSource(dataSource);
    } catch (Exception e) {
      throw e;
View Full Code Here

    protected void init() throws Exception {
      try {
        this._newsletterManager = (INewsletterManager) this.getService(JpnewsletterSystemConstants.NEWSLETTER_MANAGER);
        IUserManager userManager = (IUserManager) this.getService(SystemConstants.USER_MANAGER);
        IUserProfileManager profileManager = (IUserProfileManager) this.getService(SystemConstants.USER_PROFILE_MANAGER);
        ConfigInterface configManager = (ConfigInterface) this.getService(SystemConstants.BASE_CONFIG_MANAGER);
        this._helper = new JpnewsletterTestHelper(userManager, profileManager, configManager);
        DataSource dataSource = (DataSource) this.getApplicationContext().getBean("servDataSource");
        this._helper.setDataSource(dataSource);
    } catch (Exception e) {
      throw e;
View Full Code Here

    this.setSmallMessageTypesMap(smallMessageTypes);
  }

  protected void loadNotifierConfig() throws ApsSystemException {
    try {
      ConfigInterface configManager = this.getConfigManager();
      String xml = configManager.getConfigItem(JpwebdynamicformSystemConstants.MESSAGE_NOTIFIER_CONFIG_ITEM);
      if (xml == null) {
        throw new ApsSystemException("Configuration item not present: " + JpwebdynamicformSystemConstants.MESSAGE_NOTIFIER_CONFIG_ITEM);
      }
      MessageNotifierConfigDOM configDOM = new MessageNotifierConfigDOM();
      this.setNotifierConfigMap(configDOM.extractConfig(xml));
View Full Code Here

      MessageNotifierConfigDOM configDOM = new MessageNotifierConfigDOM();
      Map<String, MessageTypeNotifierConfig> configMap = this.getNotifierConfigMap();
      configMap.put(config.getTypeCode(), config);

      String xml = configDOM.createConfigXml(configMap);
      ConfigInterface configManager = this.getConfigManager();
      configManager.updateConfigItem(JpwebdynamicformSystemConstants.MESSAGE_NOTIFIER_CONFIG_ITEM, xml);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "saveNotifierConfig");
      this.loadNotifierConfig();
      throw new ApsSystemException("Error updating notifier configuration");
    }
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.services.baseconfig.ConfigInterface

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.