for (Iterator i = requestParameters.keySet().iterator(); i.hasNext();) {
Object key = i.next();
log.debug(" [" + key + "] = [" + requestParameters.get(key) + "]");
}
NamespaceMap notificationMap = new NamespaceMap(requestParameters, Notifier.PREFIX);
log.debug(" Notification parameters:");
for (Iterator i = notificationMap.getMap().keySet().iterator(); i.hasNext();) {
Object key = i.next();
log.debug(" [" + key + "] = [" + notificationMap.getMap().get(key) + "]");
}
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);
String toString = "";
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(toString)) {
toString += ",";
}
log.debug(" Adding notification address [" + toValues[i].trim() + "]");
toString += toValues[i].trim();
}
notificationMap.put(Notifier.PARAMETER_TO, toString);
setNotifying(notificationMap);
}
}