Long users_id = sessionManagement.checkSession(SID);
Long user_level = userManagement.getUserLevelByID(users_id);
if (authLevelManagement.checkUserLevel(user_level)) {
// check if the appointment belongs to the current user
Appointment appointment = appointmentLogic
.getAppointMentById(appointmentId);
if (!appointment.getUserId().getUser_id().equals(users_id)) {
throw new AxisFault(
"The Appointment cannot be updated by the given user");
}
} else if (authLevelManagement.checkUserLevel(user_level)) {
// fine
} else {
throw new AxisFault(
"Not allowed to preform that action, Authenticate the SID first");
}
List<Map<String, String>> newList = new ArrayList<Map<String, String>>();
for (String singleClient : mmClient) {
String[] params = singleClient.split(",");
Map<String, String> map = new HashMap<String, String>();
map.put("meetingMemberId", params[0]);
map.put("firstname", params[1]);
map.put("lastname", params[2]);
map.put("email", params[3]);
map.put("userId", params[4]);
map.put("jNameTimeZone", params[5]);
newList.add(map);
}
log.debug("updateAppointment");
RoomTypes rt = roommanagement.getRoomTypesById(roomType);
Appointment app = appointmentLogic
.getAppointMentById(appointmentId);
Rooms room = app.getRoom();
if (room != null) {
room.setComment(appointmentDescription);
room.setName(appointmentName);
room.setRoomtype(rt);