key = (String) entry.getKey();
value = (String) entry.getValue();
log.debug(" [" + key + "] = [" + value + "]");
}
NamespaceMap notificationMap = new NamespaceMap(requestParameters, Notifier.PREFIX);
log.debug(" Notification parameters:");
for (Iterator iter = notificationMap.getMap().entrySet().iterator(); iter.hasNext();) {
entry = (Map.Entry) iter.next();
key = (String) entry.getKey();
value = (String) entry.getValue();
log.debug(" [" + key + "] = [" + value + "]");
}
if (notificationMap.getMap().isEmpty()) {
log.debug(" No notification parameters found.");
} else {
log.debug(" Initializing notification");
Identity identity = Identity.getIdentity(request.getSession());
User user = identity.getUser();
String eMail = user.getEmail();
notificationMap.put(Notifier.PARAMETER_FROM, eMail);
log.debug(" Setting from address [" + Notifier.PARAMETER_FROM + "] = [" + eMail
+ "]");
String toKey = NamespaceMap.getFullName(Notifier.PREFIX, Notifier.PARAMETER_TO);
StringBuffer buf = new StringBuffer();
String[] toValues = request.getParameterValues(toKey);
if (toValues == null) {
throw new IllegalStateException("You must specify at least one [notification.tolist] request parameter!");
}
for (int i = 0; i < toValues.length; i++) {
if (i > 0 && !"".equals(buf.toString())) {
buf.append(",");
}
log.debug(" Adding notification address [" + toValues[i].trim() + "]");
buf.append(toValues[i].trim());
}
notificationMap.put(Notifier.PARAMETER_TO, buf.toString());
setNotifying(notificationMap);
}
}