Node propertyNode = propertyNodes.item(j);
String propertyName = xmlXPath.getPropertyNameExpression().evaluate(propertyNode);
String propertyValue = xmlXPath.getPropertyValueExpression().evaluate(propertyNode);
userProps.put(propertyName, propertyValue);
}
GeoServerUser user=createUserObject(userName, userPassword, userEnabled);
helper.userMap.put(user.getUsername(), user);
user.getProperties().clear(); // set properties
for (Object key: userProps.keySet()) {
user.getProperties().put(key, userProps.get(key));
SortedSet<GeoServerUser> propUsers = helper.propertyMap.get(key);
if (propUsers==null) {
propUsers=new TreeSet<GeoServerUser>();
helper.propertyMap.put((String)key, propUsers);
}
propUsers.add(user);
}
}
NodeList groupNodes = (NodeList) xmlXPath.getGroupListExpression().evaluate(doc,XPathConstants.NODESET);
for ( int i=0 ; i <groupNodes.getLength();i++) {
Node groupNode = groupNodes.item(i);
String groupName = xmlXPath.getGroupNameExpression().evaluate(groupNode);
boolean groupEnabled = Util.convertToBoolean(xmlXPath.getGroupEnabledExpression().evaluate(groupNode),true);
GeoServerUserGroup group= createGroupObject(groupName, groupEnabled);
helper.groupMap.put(groupName, group);
NodeList memberNodes = (NodeList) xmlXPath.getGroupMemberListExpression().evaluate(groupNode,XPathConstants.NODESET);
for ( int j=0 ; j <memberNodes.getLength();j++) {
Node memberNode = memberNodes.item(j);
String memberName = xmlXPath.getGroupMemberNameExpression().evaluate(memberNode);
GeoServerUser member=helper.userMap.get(memberName);
SortedSet<GeoServerUser> members=helper.group_userMap.get(group);
if (members==null) {
members=new TreeSet<GeoServerUser>();
helper.group_userMap.put(group, members);