// ignore existing accounts, add info message
idents.add(ident);
} else {
// no identity/user yet, create
UserManager um = UserManager.getInstance();
UserPropertyHandler userPropertyHandler;
String thisKey = "";
String thisValue = "";
// check that no user with same login name is already in list
for (Iterator<List<String>> it_news = newIdents.iterator(); it_news.hasNext();) {
List<String> singleUser = it_news.next();
if (singleUser.get(1).equalsIgnoreCase(login)) {
textAreaElement.setErrorKey("error.login.douplicate", new String[] { String.valueOf(i + 1), login });
importDataError = true;
break;
}
}
List<String> ud = new ArrayList<String>();
// insert fix fields: login, pwd, lang from above
ud.add("false"); // used for first column in model (user existing)
ud.add(login);
ud.add(pwd);
ud.add(lang);
for (int j = 0; j < userPropertyHandlers.size(); j++) {
userPropertyHandler = userPropertyHandlers.get(j);
thisKey = userPropertyHandler.getName();
// last columns may be empty if not mandatory
if (parts.length <= columnId) {
thisValue = "";
} else {
thisValue = parts[columnId].trim();
}
boolean isMandatoryField = um.isMandatoryUserProperty(usageIdentifyer, userPropertyHandler);
if (isMandatoryField && !StringHelper.containsNonWhitespace(thisValue)) {
textAreaElement.setErrorKey("error.mandatory", new String[] { String.valueOf(i + 1), translate(userPropertyHandler.i18nFormElementLabelKey()) });
importDataError = true;
break;
}
// used for call-back value depending on PropertyHandler
ValidationError validationError = new ValidationError();
if (!userPropertyHandler.isValidValue(thisValue, validationError, getLocale())) {
textAreaElement.setErrorKey("error.lengthorformat", new String[] { String.valueOf(i + 1), translate(userPropertyHandler.i18nFormElementLabelKey()),
translate(validationError.getErrorKey()) });
importDataError = true;
break;
}
// check that no user with same email is already in list