if (AuthLevelUtil.checkWebServiceLevel(user_level) || AuthLevelUtil.checkAdminLevel(user_level)) {
// fine
} else if (AuthLevelUtil.checkUserLevel(user_level)) {
// check if the appointment belongs to the current user
Appointment a = appointmentDao.get(appointmentId);
if (!a.getOwner().getUser_id().equals(users_id)) {
throw new AxisFault("The Appointment cannot be updated by the given user");
}
} else {
throw new AxisFault("Not allowed to preform that action, Authenticate the SID first");
}
Appointment a = appointmentDao.get(appointmentId);
a.setTitle(appointmentName);
a.setLocation(appointmentLocation);
a.setDescription(appointmentDescription);
a.setStart(appointmentstart.getTime());
a.setEnd(appointmentend.getTime());
a.setIsDaily(isDaily);
a.setIsWeekly(isWeekly);
a.setIsMonthly(isMonthly);
a.setIsYearly(isYearly);
a.setCategory(appointmentCategoryDao.get(categoryId));
a.setRemind(appointmentReminderTypDao.get(remind));
WebSession.get().setBaseUrl(baseurl); //TODO verify !!!!!
a.getRoom().setComment(appointmentDescription);
a.getRoom().setName(appointmentName);
a.getRoom().setRoomtype(roomTypeDao.get(roomType));
a.setOwner(userDao.get(users_id));
a.setPasswordProtected(isPasswordProtected);
a.setPassword(password);
a.setMeetingMembers(new ArrayList<MeetingMember>());
for (String singleClient : mmClient) {
MeetingMember mm = appointmentLogic.getMeetingMember(users_id, languageId, singleClient);
mm.setAppointment(a);
a.getMeetingMembers().add(mm);
}
return appointmentDao.update(a, baseurl, users_id).getId();
} catch (Exception err) {
log.error("[updateAppointment]", err);
throw new AxisFault(err.getMessage());