Map props = propsManager.getProperties();
request.setAttribute("RollerProps", props);
// only set values for properties that are already defined
String propName = null;
RollerPropertyData updProp = null;
String incomingProp = null;
Iterator propsIT = props.keySet().iterator();
while(propsIT.hasNext()) {
propName = (String) propsIT.next();
updProp = (RollerPropertyData) props.get(propName);
incomingProp = request.getParameter(updProp.getName());
mLogger.debug("Checking property ["+propName+"]");
// some special treatment for booleans
// this is a bit hacky since we are assuming that any prop
// with a value of "true" or "false" is meant to be a boolean
// it may not always be the case, but we should be okay for now
if( updProp.getValue() != null // null check needed w/Oracle
&& (updProp.getValue().equals("true") || updProp.getValue().equals("false"))) {
if(incomingProp == null || !incomingProp.equals("on"))
incomingProp = "false";
else
incomingProp = "true";
}
// only work on props that were submitted with the request
if(incomingProp != null) {
mLogger.debug("Setting new value for ["+propName+"]");
// NOTE: the old way had some locale sensitive way to do this??
updProp.setValue(incomingProp.trim());
}
}
// save it
propsManager.saveProperties(props);