Esempio n. 1
0
  @Override
  public void initialize() throws InitializationException {
    try {
      Config config = m_configDao.findByName(CONFIG_NAME, ConfigEntity.READSET_FULL);
      String content = config.getContent();

      m_thirdPartyConfig = DefaultSaxParser.parse(content);
      m_configId = config.getId();
    } catch (DalNotFoundException e) {
      try {
        String content = m_getter.getConfigContent(CONFIG_NAME);
        Config config = m_configDao.createLocal();

        config.setName(CONFIG_NAME);
        config.setContent(content);
        m_configDao.insert(config);

        m_thirdPartyConfig = DefaultSaxParser.parse(content);
        m_configId = config.getId();
      } catch (Exception ex) {
        Cat.logError(ex);
      }
    } catch (Exception e) {
      Cat.logError(e);
    }
    if (m_thirdPartyConfig == null) {
      m_thirdPartyConfig = new ThirdPartyConfig();
    }
  }
Esempio n. 2
0
  public boolean insert(String xml) {
    try {
      m_thirdPartyConfig = DefaultSaxParser.parse(xml);

      return storeConfig();
    } catch (Exception e) {
      Cat.logError(e);
      return false;
    }
  }