List<CmsProperty> propertiesToWrite = new ArrayList<CmsProperty>();
// check all property definitions of the resource for new values
Iterator<CmsPropertyDefinition> i = propertyDef.iterator();
while (i.hasNext()) {
CmsPropertyDefinition curPropDef = i.next();
String propName = CmsEncoder.escapeXml(curPropDef.getName());
String valueStructure = null;
String valueResource = null;
if (key(Messages.GUI_PROPERTIES_INDIVIDUAL_0).equals(activeTab)) {
// get parameters from the structure tab
valueStructure = request.getParameter(PREFIX_VALUE + propName);
valueResource = request.getParameter(PREFIX_RESOURCE + propName);
if (valueStructure != null
&& !"".equals(valueStructure.trim())
&& valueStructure.equals(valueResource)) {
// the resource value was shown/entered in input field, set structure value to empty String
valueStructure = "";
}
} else {
// get parameters from the resource tab
valueStructure = request.getParameter(PREFIX_STRUCTURE + propName);
valueResource = request.getParameter(PREFIX_VALUE + propName);
}
// check values for blanks and null
if (valueStructure != null) {
valueStructure = valueStructure.trim();
} else {
// This value was not part of the properties
continue;
}
if (valueResource != null) {
valueResource = valueResource.trim();
}
// create new CmsProperty object to store
CmsProperty newProperty = new CmsProperty();
newProperty.setName(curPropDef.getName());
newProperty.setStructureValue(valueStructure);
newProperty.setResourceValue(valueResource);
// get the old property values
CmsProperty oldProperty = activeProperties.get(curPropDef.getName());
if (oldProperty == null) {
// property was not set, create new empty property object
oldProperty = new CmsProperty();
oldProperty.setName(curPropDef.getName());
}
boolean writeStructureValue = false;
boolean writeResourceValue = false;
String oldValue = oldProperty.getStructureValue();