Long user_id = importLongType(unformatString(organisationObject.element("user_id").getText()));
Boolean isModerator = importBooleanType(unformatString(organisationObject.element("isModerator").getText()));
String commentOrg = unformatString(organisationObject.element("comment").getText());
String deleted = unformatString(organisationObject.element("deleted").getText());
Organisation_Users orgUser = new Organisation_Users();
orgUser.setOrganisation(Organisationmanagement.getInstance().getOrganisationByIdBackup(organisation_id));
orgUser.setUser_id(user_id);
orgUser.setIsModerator(isModerator);
orgUser.setComment(commentOrg);
orgUser.setStarttime(new Date());
orgUser.setDeleted(deleted);
orgUsers.add(orgUser);
}
}
Long userId = us.getUser_id();
//check if login does already exists, but only for users that have been created in the OpenMeetings Administration
//maybe we should check status too
/*
if ((us.getExternalUserId() == null || us.getExternalUserId() == 0) && email != null && email.length() > 0){
Users storedUser = Usermanagement.getInstance().getUserByLoginOrEmail(us.getLogin());
if (storedUser != null) {
log.info("A user with the given login does already exist "+us.getLogin());
} else {
storedUser = Usermanagement.getInstance().getUserByLoginOrEmail(email);
if (storedUser != null) {
log.info("A user with the given email as login does already exist "+email);
}
}
if (storedUser != null) {
usersMap.put(userId, storedUser.getUser_id());
continue;
}
}
*/
log.debug("Import User ID "+userId);
us.setUser_id(null);
us.setStarttime(new Date());
Long actualNewUserId = Usermanagement.getInstance().addUserBackup(us);
usersMap.put(userId, actualNewUserId);
for (Iterator<Organisation_Users> orgUserIterator = orgUsers.iterator();orgUserIterator.hasNext();) {
Organisation_Users organisationUsers = orgUserIterator.next();
organisationUsers.setUser_id(actualNewUserId);
Organisationmanagement.getInstance().addOrganisationUserObj(organisationUsers);
}