appointmentStatus, appointmentId, userid, email, invitor,
jNameMemberTimeZone, false);
// DefaultInvitation
Appointment point = AppointmentLogic.getInstance().getAppointMentById(appointmentId);
MeetingMember member = getMemberById(memberId);
Long invitationId = null;
if(point.getRemind() == null){
log.error("Appointment has no assigned ReminderType!");
return null;
}
log.debug(":::: addMeetingMember ..... "+point.getRemind().getTypId());
Users us = Usermanagement.getInstance().getUserById(userid);
OmTimeZone omTimeZone = null;
String jNameTimeZone = null;
if (us != null && us.getOmTimeZone() != null) {
System.out.println("Internal User ");
//Internal User
jNameTimeZone = us.getOmTimeZone().getJname();
omTimeZone = OmTimeZoneDaoImpl.getInstance().getOmTimeZone(jNameTimeZone);
} else {
System.out.println("External User ");
//External User
jNameTimeZone = jNameMemberTimeZone;
omTimeZone = OmTimeZoneDaoImpl.getInstance().getOmTimeZone(jNameTimeZone);
}
//If everything fails
if (omTimeZone == null) {
Configuration conf = Configurationmanagement.getInstance().getConfKey(3L, "default.timezone");
if (conf != null) {
jNameTimeZone = conf.getConf_value();
}
omTimeZone = OmTimeZoneDaoImpl.getInstance().getOmTimeZone(jNameTimeZone);
}
String timeZoneName = omTimeZone.getIcal();
Calendar cal = Calendar.getInstance();
cal.setTimeZone(TimeZone.getTimeZone(omTimeZone.getIcal()));
int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
// System.out.println("1"+point.getAppointmentStarttime().getTime());
// System.out.println("2"+point.getAppointmentEndtime().getTime());
Date starttime = new Date(point.getAppointmentStarttime().getTime() + offset);
Date endtime = new Date(point.getAppointmentEndtime().getTime() + offset);
// System.out.println("jNameTimeZone "+jNameTimeZone);
// System.out.println("Ical "+omTimeZone.getIcal());
// System.out.println(offset);
// System.out.println("3"+starttime);
// System.out.println("4"+endtime);
Fieldlanguagesvalues labelid1151 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1151), language_id);
String message = labelid1151.getValue() + " " + point.getAppointmentName();
if (point.getAppointmentDescription().length() != 0) {
Fieldlanguagesvalues labelid1152 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1152), language_id);
message += labelid1152.getValue() + point.getAppointmentDescription();
}
Fieldlanguagesvalues labelid1153 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1153), language_id);
Fieldlanguagesvalues labelid1154 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1154), language_id);
message += "<br/>" + labelid1153.getValue() + ' '
+ CalendarPatterns.getDateWithTimeByMiliSeconds(starttime)
+ " (" + timeZoneName + ")"
+ "<br/>";
message += labelid1154.getValue() + ' '
+ CalendarPatterns.getDateWithTimeByMiliSeconds(endtime)
+ " (" + timeZoneName + ")"
+ "<br/>";
Fieldlanguagesvalues labelid1156 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1156), language_id);
message += labelid1156.getValue() + invitorName + "<br/>";
if(point.getRemind().getTypId() == 1){
log.debug("no reminder required");
} else if(point.getRemind().getTypId() == 2){
log.debug("Reminder for Appointment : simple email");
Invitations invitation = Invitationmanagement.getInstance().addInvitationLink(
new Long(2), //userlevel
firstname + " " + lastname, //username
message,
baseUrl, // baseURl
email, //email
labelid1151.getValue() + " " + point.getAppointmentName(), //subject
point.getRoom().getRooms_id(), // room_id
"public",
isPasswordProtected, // passwordprotected
password, // invitationpass
2, // valid type
starttime, // valid from
endtime, // valid to
meeting_organizer, // created by
baseUrl, language_id,
true, //really send mail sendMail
point.getAppointmentStarttime(),
point.getAppointmentEndtime(),
point.getAppointmentId()
);
invitationId = invitation.getInvitations_id();
} else if(point.getRemind().getTypId() == 3){
log.debug("Reminder for Appointment : iCal mail");
System.out.println("5"+starttime);
System.out.println("6"+endtime);
invitationId = Invitationmanagement.getInstance().addInvitationIcalLink(new Long(2), //userlevel
firstname + " " + lastname, //username
message,
baseUrl, // baseURl
email, //email
labelid1151.getValue() + " " + point.getAppointmentName(), //subject
point.getRoom().getRooms_id(), // room_id
"public",
isPasswordProtected, // passwordprotected
password, // invitationpass
2, // valid
starttime, // valid from
endtime, // valid to
meeting_organizer, // created by
point.getAppointmentId(),
member.getInvitor(), language_id,
jNameTimeZone,
point.getAppointmentStarttime(),
point.getAppointmentEndtime(),
point.getAppointmentId()
);
}
// Setting InvitationId within MeetingMember