} else {
settingName = DirectoryUtil.IMPL_PROPERTIES;
}
//save plugin
Setting setting = setupManager.getSettingByProperty("directoryManagerImpl");
if (setting == null) {
setting = new Setting();
setting.setProperty("directoryManagerImpl");
}
setting.setValue(id);
setupManager.saveSetting(setting);
Setting propertySetting = setupManager.getSettingByProperty(settingName);
if (propertySetting == null) {
propertySetting = new Setting();
propertySetting.setProperty(settingName);
}
if (pluginProperties == null) {
//request params
Map<String, String> propertyMap = new HashMap();
Enumeration<String> e = request.getParameterNames();
while (e.hasMoreElements()) {
String paramName = e.nextElement();
if (!paramName.startsWith("param_")) {
String[] paramValue = (String[]) request.getParameterValues(paramName);
propertyMap.put(paramName, CsvUtil.getDeliminatedString(paramValue));
}
}
// form csv properties
StringWriter sw = new StringWriter();
try {
CSVWriter writer = new CSVWriter(sw);
Iterator it = propertyMap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, String> pairs = (Map.Entry) it.next();
writer.writeNext(new String[]{pairs.getKey(), pairs.getValue()});
}
writer.close();
} catch (Exception ex) {
LogUtil.error(getClass().getName(), ex, "");
}
String pluginProps = sw.toString();
propertySetting.setValue(pluginProps);
} else {
propertySetting.setValue(PropertyUtil.propertiesJsonStoreProcessing(propertySetting.getValue(), pluginProperties));
}
setupManager.saveSetting(propertySetting);
String contextPath = WorkflowUtil.getHttpServletRequest().getContextPath();
String url = contextPath + "/web/console/setting/directory";