}
// user properties
Node ndUser = (Node) xpath.evaluate("users", ndLdap, XPathConstants.NODE);
if (ndUser != null) {
LdapUserProperties props = ldapConfig.getUserProperties();
props.setUserDisplayNameAttribute(xpath.evaluate("@displayNameAttribute",
ndUser));
props.setPasswordEncryptionAlgorithm(xpath.evaluate(
"@passwordEncryptionAlgorithm", ndUser));
props.setUserDNPattern(xpath.evaluate("@newUserDNPattern", ndUser));
props.setUsernameSearchPattern(xpath.evaluate("@usernameSearchPattern",
ndUser));
props.setUserRequestsSearchPattern(xpath.evaluate("@newUserRequestSearchPattern",
ndUser));
props.setUserSearchDIT(xpath.evaluate("@searchDIT", ndUser));
NodeList nlObj = (NodeList) xpath.evaluate(
"requiredObjectClasses/objectClass/@name", ndUser,
XPathConstants.NODESET);
for (int i = 0; i < nlObj.getLength(); i++) {
props.addUserObjectClass(nlObj.item(i).getNodeValue());
}
}
// user profile parameters
UserAttributeMap uaMap = idConfig.getUserAttributeMap();
NodeList nlUserAttr = (NodeList) xpath.evaluate(
"users/userAttributeMap/attribute", ndLdap, XPathConstants.NODESET);
for (int i = 0; i < nlUserAttr.getLength(); i++) {
UserAttribute attr = new UserAttribute();
attr.setKey(xpath.evaluate("@key", nlUserAttr.item(i)));
attr.setLdapName(xpath.evaluate("@ldapName", nlUserAttr.item(i)));
// TODO: need to do a better check to filter out badly defined
// parameters
boolean bIsLdap = (idConfig.getAdapterClassName().indexOf("Ldap") != -1);
if (bIsLdap && (attr.getLdapName().length() > 0)) {
uaMap.add(attr);
}
}
ldapConfig.getUserProperties().getUserProfileMapping().configureFromUserAttributes(uaMap);
// group properties
Node ndGroup = (Node) xpath.evaluate("groups", ndLdap, XPathConstants.NODE);
if (ndGroup != null) {
LdapGroupProperties props = ldapConfig.getGroupProperties();
props.setGroupDisplayNameAttribute(xpath.evaluate(
"@displayNameAttribute", ndGroup));
props.setGroupDynamicMemberAttribute(xpath.evaluate(
"@dynamicMemberOfGroupsAttribute", ndGroup));
props.setGroupDynamicMembersAttribute(xpath.evaluate(
"@dynamicMembersAttribute", ndGroup));
props.setGroupMemberAttribute(xpath.evaluate("@memberAttribute", ndGroup));
props.setGroupMemberSearchPattern(xpath.evaluate("@memberSearchPattern",
ndGroup));
props.setGroupNameSearchPattern(xpath.evaluate("@nameSearchPattern",
ndGroup));
props.setGroupSearchDIT(xpath.evaluate("@searchDIT", ndGroup));
}
// metadata management groups
NodeList nlMmg = (NodeList) xpath.evaluate("groups/metadataManagementGroup",ndLdap,XPathConstants.NODESET);
for (int i = 0; i < nlMmg.getLength(); i++) {