@Override public void initialize() throws InitializationException { try { Config config = m_configDao.findByName(CONFIG_NAME, ConfigEntity.READSET_FULL); String content = config.getContent(); m_configId = config.getId(); m_domainGroup = DefaultSaxParser.parse(content); } catch (DalNotFoundException e) { try { String content = Files.forIO() .readFrom( this.getClass().getResourceAsStream("/config/default-domain-group-config.xml"), "utf-8"); Config config = m_configDao.createLocal(); config.setName(CONFIG_NAME); config.setContent(content); m_configDao.insert(config); m_configId = config.getId(); m_domainGroup = DefaultSaxParser.parse(content); } catch (Exception ex) { Cat.logError(ex); } } catch (Exception e) { Cat.logError(e); } if (m_domainGroup == null) { m_domainGroup = new DomainGroup(); } }
public boolean insert(String xml) { try { m_domainGroup = DefaultSaxParser.parse(xml); return storeConfig(); } catch (Exception e) { Cat.logError(e); return false; } }