Search in sources :

Example 1 with Reminder

use of org.apache.openmeetings.db.entity.calendar.Appointment.Reminder in project openmeetings by apache.

the class InvitationManager method processInvitation.

@Override
public void processInvitation(Appointment a, MeetingMember mm, MessageType type, boolean sendMail) {
    Reminder reminder = a.getReminder();
    if (reminder == null) {
        log.error("Appointment doesn't have reminder set!");
        return;
    }
    if (Reminder.none == reminder) {
        log.error("MeetingMember should not have invitation!");
        return;
    }
    log.debug(":::: processInvitation ..... " + reminder);
    log.debug("Invitation for Appointment : simple email");
    try {
        mm.setInvitation(getInvitation(mm.getInvitation(), mm.getUser(), a.getRoom(), a.isPasswordProtected(), a.getPassword(), Valid.Period, a.getOwner(), null, a.getStart(), a.getEnd(), a));
        if (sendMail) {
            sendInvitionLink(a, mm, type, Reminder.ical == reminder);
        }
    } catch (Exception e) {
        log.error("Unexpected error while setting invitation", e);
    }
}
Also used : Reminder(org.apache.openmeetings.db.entity.calendar.Appointment.Reminder)

Example 2 with Reminder

use of org.apache.openmeetings.db.entity.calendar.Appointment.Reminder in project openmeetings by apache.

the class AppointmentParamConverter method fromString.

@Override
public AppointmentDTO fromString(String val) {
    JSONObject o = new JSONObject(val);
    if (o.has(ROOT)) {
        o = o.getJSONObject(ROOT);
    }
    AppointmentDTO a = new AppointmentDTO();
    a.setId(optLong(o, "id"));
    a.setTitle(o.optString("title"));
    a.setLocation(o.optString("location"));
    a.setOwner(UserDTO.get(o.optJSONObject("owner")));
    String tzId = a.getOwner() == null ? null : a.getOwner().getTimeZoneId();
    a.setStart(CalendarParamConverter.get(o.optString("start"), tzId));
    a.setEnd(CalendarParamConverter.get(o.optString("end"), tzId));
    a.setDescription(o.optString("description"));
    a.setInserted(DateParamConverter.get(o.optString("inserted")));
    a.setUpdated(DateParamConverter.get(o.optString("updated")));
    a.setDeleted(o.optBoolean("deleted"));
    a.setReminder(optEnum(Reminder.class, o, "reminder"));
    a.setRoom(RoomDTO.get(o.optJSONObject("room")));
    a.setIcalId(o.optString("icalId"));
    JSONArray mm = o.optJSONArray("meetingMembers");
    if (mm != null) {
        for (int i = 0; i < mm.length(); ++i) {
            a.getMeetingMembers().add(MeetingMemberDTO.get(mm.getJSONObject(i)));
        }
    }
    a.setLanguageId(o.optLong("languageId"));
    a.setPassword(o.optString("password"));
    a.setPasswordProtected(o.optBoolean("passwordProtected"));
    a.setConnectedEvent(o.optBoolean("connectedEvent"));
    a.setReminderEmailSend(o.optBoolean("reminderEmailSend"));
    return a;
}
Also used : Reminder(org.apache.openmeetings.db.entity.calendar.Appointment.Reminder) JSONObject(com.github.openjson.JSONObject) AppointmentDTO(org.apache.openmeetings.db.dto.calendar.AppointmentDTO) JSONArray(com.github.openjson.JSONArray)

Aggregations

Reminder (org.apache.openmeetings.db.entity.calendar.Appointment.Reminder)2 JSONArray (com.github.openjson.JSONArray)1 JSONObject (com.github.openjson.JSONObject)1 AppointmentDTO (org.apache.openmeetings.db.dto.calendar.AppointmentDTO)1