/** * Add template(s) to the {@link #PARAM_TEMPLATES_NAME} list if not already present * * @param templatesToAdd Comma separated templates to add * @since 5.5 */ public void addTemplate(String templatesToAdd) throws ConfigurationException { List<String> templatesList = getTemplateList(); List<String> templatesToAddList = asList(templatesToAdd.split(TEMPLATE_SEPARATOR)); if (templatesList.addAll(templatesToAddList)) { String newTemplatesStr = String.join(TEMPLATE_SEPARATOR, templatesList); HashMap<String, String> parametersToSave = new HashMap<>(); parametersToSave.put(PARAM_TEMPLATES_NAME, newTemplatesStr); saveFilteredConfiguration(parametersToSave); changeTemplates(newTemplatesStr); } }
/** * Remove template(s) from the {@link #PARAM_TEMPLATES_NAME} list * * @param templatesToRm Comma separated templates to remove * @since 5.5 */ public void rmTemplate(String templatesToRm) throws ConfigurationException { List<String> templatesList = getTemplateList(); List<String> templatesToRmList = asList(templatesToRm.split(TEMPLATE_SEPARATOR)); if (templatesList.removeAll(templatesToRmList)) { String newTemplatesStr = String.join(TEMPLATE_SEPARATOR, templatesList); Map<String, String> parametersToSave = new HashMap<>(); parametersToSave.put(PARAM_TEMPLATES_NAME, newTemplatesStr); saveFilteredConfiguration(parametersToSave); changeTemplates(newTemplatesStr); } }
/** * Set a property in nuxeo configuration * * @return The old value * @since 5.5 */ public String setProperty(String key, String value) throws ConfigurationException { String oldValue = getStoredConfig().getProperty(key); if (PARAM_TEMPLATES_NAME.equals(key)) { templates = StringUtils.isBlank(value) ? null : value; } HashMap<String, String> newParametersToSave = new HashMap<>(); newParametersToSave.put(key, value); saveFilteredConfiguration(newParametersToSave); setBasicConfiguration(); return oldValue; }
/** * Set properties in nuxeo configuration * * @return The old values * @since 7.4 */ public Map<String, String> setProperties(Map<String, String> newParametersToSave) throws ConfigurationException { Map<String, String> oldValues = new HashMap<>(); for (String key : newParametersToSave.keySet()) { oldValues.put(key, getStoredConfig().getProperty(key)); if (PARAM_TEMPLATES_NAME.equals(key)) { String value = newParametersToSave.get(key); templates = StringUtils.isBlank(value) ? null : value; } } saveFilteredConfiguration(newParametersToSave); setBasicConfiguration(); return oldValues; }
HashMap::putAll); try { setupConfigGenerator.saveFilteredConfiguration(customParameters); } catch (ConfigurationException e) { log.error(e, e);
customParameters.putAll(advancedParameters); try { setupConfigGenerator.saveFilteredConfiguration(customParameters); } catch (ConfigurationException e) { log.error(e, e);
params.put(Framework.NUXEO_DEV_SYSTEM_PROP, Boolean.toString(value)); try { conf.saveFilteredConfiguration(params); conf.getServerConfigurator().dumpProperties(conf.getUserConfig());
params.put(Framework.NUXEO_DEV_SYSTEM_PROP, Boolean.toString(value)); try { conf.saveFilteredConfiguration(params); conf.getServerConfigurator().dumpProperties(conf.getUserConfig());