* 修改系统参数
*/
public void doEdit(@FormGroup("systemParameterDetailInfo") Group systemParameterDetailInfo, Navigator nav)
throws Exception {
SystemParameter systemParameter = new SystemParameter();
systemParameterDetailInfo.setProperties(systemParameter);
String defaultAlarmReceiver = systemParameterDetailInfo.getField("defaultAlarmReceiver").getStringValue();
String defaultAlarmReceiverStrs[] = StringUtils.split(defaultAlarmReceiver, "=");
if (defaultAlarmReceiverStrs.length != 2) {
throw new ManagerException("defaultAlarmReceiver[" + defaultAlarmReceiver + "] is not valid!");
}
systemParameter.setDefaultAlarmReceiveKey(defaultAlarmReceiverStrs[0]);
systemParameter.setDefaultAlarmReceiver(defaultAlarmReceiverStrs[1]);
String alarmReceiver = systemParameterDetailInfo.getField("alarmReceiver").getStringValue();
List<String> alarmReceivers = new ArrayList<String>();
String alarmReceiver1[] = StringUtils.split(alarmReceiver, "\n");
for (String alarmReceiverStr : alarmReceiver1) {
String[] alarmReceiver2 = StringUtils.split(alarmReceiverStr, ";");
for (String alarmReceiverStr2 : alarmReceiver2) {
alarmReceivers.add(alarmReceiverStr2);
}
}
Map<String, String> alarmReceiverMap = new LinkedHashMap<String, String>();
for (String alarmReceiverStr : alarmReceivers) {
String alarmReceiverStrs[] = StringUtils.split(alarmReceiverStr, "=");
if (alarmReceiverStrs.length != 2) {
throw new ManagerException("alarmReceiver[" + alarmReceiver + "] is not valid!");
}
alarmReceiverMap.put(alarmReceiverStrs[0], alarmReceiverStrs[1]);
}
systemParameter.setAlarmReceiver(alarmReceiverMap);
systemParameterService.createOrUpdate(systemParameter);
nav.redirectToLocation("systemParameter.htm?edit=true");
}