Boolean isPasswordProtected, String password, String iCalTimeZone, String appointmentLocation) {
log.debug("AppointmentDAOImpl.updateAppointment");
try {
Appointment ap = this.getAppointmentById(appointmentId);
AppointmentReminderTyps appointmentReminderTyps = appointmentReminderTypDaoImpl
.getAppointmentReminderTypById(remind);
AppointmentCategory appointmentCategory = appointmentCategoryDaoImpl
.getAppointmentCategoryById(categoryId);
boolean sendMail = !ap.getAppointmentName().equals(appointmentName) ||
!ap.getAppointmentDescription().equals(appointmentDescription) ||
!ap.getAppointmentLocation().equals(appointmentLocation) ||
!ap.getAppointmentStarttime().equals(appointmentstart) ||
!ap.getAppointmentEndtime().equals(appointmentend);
// change connected events of other participants
if (ap.getIsConnectedEvent() != null && ap.getIsConnectedEvent()) {
this.updateConnectedEvents(ap, appointmentName,
appointmentDescription, appointmentstart,
appointmentend, isDaily, isWeekly, isMonthly, isYearly,
appointmentCategory, appointmentReminderTyps, mmClient,
users_id, baseUrl, language_id, isPasswordProtected,
password);
}
// Update Invitation hash to new time
invitationManager.updateInvitationByAppointment(appointmentId,
appointmentstart, appointmentend);
ap.setAppointmentName(appointmentName);
ap.setAppointmentLocation(appointmentLocation);
ap.setAppointmentStarttime(appointmentstart);
ap.setAppointmentEndtime(appointmentend);
ap.setAppointmentDescription(appointmentDescription);
ap.setUpdatetime(new Date());
ap.setRemind(appointmentReminderTyps);
ap.setIsDaily(isDaily);
ap.setIsWeekly(isWeekly);
ap.setIsMonthly(isMonthly);
ap.setIsYearly(isYearly);
ap.setLanguage_id(language_id);
ap.setIsPasswordProtected(isPasswordProtected);
ap.setPassword(password);
// ap.setUserId(usersDao.getUser(userId));
ap.setAppointmentCategory(appointmentCategory);
if (ap.getAppointmentId() == null) {
em.persist(ap);
} else {
if (!em.contains(ap)) {
em.merge(ap);
}
}
// Adding Invitor as Meetingmember
User user = userManager.getUserById(users_id);
String invitorName = user.getFirstname() + " " + user.getLastname()
+ " [" + user.getAdresses().getEmail() + "]";
List<MeetingMember> meetingsRemoteMembers = meetingMemberDao
.getMeetingMemberByAppointmentId(ap.getAppointmentId());
// to remove
for (MeetingMember memberRemote : meetingsRemoteMembers) {
boolean found = false;