// create mappings from form
MappingSet mappingSet = new MappingSet();
// users
UserManager userManager = new UserManager(locale,session);
long[] sourceUserIds = f.getSourceUserIds();
if (sourceUserIds != null){ // at least one mapping
long[] selectedUserIds = f.getSelectedUserIds();
for (int i = 0; i < sourceUserIds.length; i++){
long sourceUserId = sourceUserIds[i];
User sourceUser = userManager.getUserDetails(sourceUserId);
if (sourceUser == null){
throw new InputException(getResources(req).getMessage(locale, "smssvc.SourceUserNotAvailableAnymore"),"user #" + sourceUserId + " not found",null,null);
}
checkAccessRights(req,sourceUser.getGroup());
long selectedUserId = selectedUserIds[i];
if (selectedUserId <= 0){
throw new InputException(getResources(req).getMessage(locale, "smssvc.UserMappingSelectionMissing"),"sourceUserId = " + sourceUserId,null,null);
}
User selectedUser = userManager.getUserDetails(selectedUserId);
if (selectedUser == null){
throw new InputException(getResources(req).getMessage(locale, "smssvc.SelectedUserNotAvaliableAnymore"),"user #" + selectedUserId + " not found",null,null);
}
checkAccessRights(req,selectedUser.getGroup());
mappingSet.add(new Entry(sourceUser), new Entry(selectedUser));