Search in sources :

Example 1 with TeamsMeeting

use of org.olat.modules.teams.TeamsMeeting in project OpenOLAT by OpenOLAT.

the class AppointmentsServiceImpl method removeTeamsMeeting.

@Override
public Appointment removeTeamsMeeting(Appointment appointment) {
    Appointment updated = appointment;
    TeamsMeeting meeting = appointment.getTeamsMeeting();
    if (meeting != null) {
        updated = appointmentDao.saveAppointment(appointment, appointment.getBBBMeeting(), null);
        teamsService.deleteMeeting(meeting);
    }
    return updated;
}
Also used : Appointment(org.olat.modules.appointments.Appointment) TeamsMeeting(org.olat.modules.teams.TeamsMeeting)

Example 2 with TeamsMeeting

use of org.olat.modules.teams.TeamsMeeting in project OpenOLAT by OpenOLAT.

the class TeamsCourseNode method cleanupOnDelete.

@Override
public void cleanupOnDelete(ICourse course) {
    TeamsService teamsService = CoreSpringFactory.getImpl(TeamsService.class);
    RepositoryEntry courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
    List<TeamsMeeting> meetings = teamsService.getMeetings(courseEntry, getIdent(), null);
    for (TeamsMeeting meeting : meetings) {
        teamsService.deleteMeeting(meeting);
    }
    super.cleanupOnDelete(course);
}
Also used : TeamsService(org.olat.modules.teams.TeamsService) TeamsMeeting(org.olat.modules.teams.TeamsMeeting) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 3 with TeamsMeeting

use of org.olat.modules.teams.TeamsMeeting in project OpenOLAT by OpenOLAT.

the class TeamsMeetingsCalendarController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    Kalendar calendar = new Kalendar("Teams.OnlineMeetings", "Teams.OnlineMeetings");
    KalendarRenderWrapper calendarWrapper = new KalendarRenderWrapper(calendar, "Teams Online-Meetings", "teams.calendar");
    calendarWrapper.setPrivateEventsVisible(true);
    calendarWrapper.setCssClass("o_cal_blue");
    calendarWrapper.setAccess(KalendarRenderWrapper.ACCESS_READ_ONLY);
    List<TeamsMeeting> meetings = teamsService.getAllMeetings();
    // Add events to the calendar
    for (TeamsMeeting meeting : meetings) {
        if (meeting.isPermanent()) {
            continue;
        }
        // Create a calendar event with the room name as subject
        String eventId = "teams.meeting." + meeting.getKey();
        KalendarEvent newEvent = new KalendarEvent(eventId, null, meeting.getSubject(), meeting.getStartDate(), meeting.getEndDate());
        newEvent.setDescription(meeting.getSubject());
        calendar.addEvent(newEvent);
    }
    Translator calTrans = Util.createPackageTranslator(CalendarManager.class, getLocale(), getTranslator());
    List<KalendarRenderWrapper> calendarWrappers = List.of(calendarWrapper);
    FullCalendarElement calComp = new FullCalendarElement(ureq, "calComp", calendarWrappers, calTrans);
    calComp.setView(FullCalendarViews.timeGridWeek);
    formLayout.add(calComp);
}
Also used : FullCalendarElement(org.olat.commons.calendar.ui.components.FullCalendarElement) Kalendar(org.olat.commons.calendar.model.Kalendar) TeamsMeeting(org.olat.modules.teams.TeamsMeeting) Translator(org.olat.core.gui.translator.Translator) KalendarEvent(org.olat.commons.calendar.model.KalendarEvent) KalendarRenderWrapper(org.olat.commons.calendar.ui.components.KalendarRenderWrapper)

Example 4 with TeamsMeeting

use of org.olat.modules.teams.TeamsMeeting in project OpenOLAT by OpenOLAT.

the class TeamsMeetingsController method updateModel.

protected void updateModel() {
    List<TeamsMeeting> meetings = teamsService.getMeetings(entry, subIdent, group);
    Date now = new Date();
    List<TeamsMeeting> pastMeetings = new ArrayList<>();
    List<TeamsMeeting> upcomingMeetings = new ArrayList<>();
    for (TeamsMeeting meeting : meetings) {
        if (meeting.getStartDate() == null || meeting.getEndDate() == null || now.compareTo(meeting.getEndDate()) <= 0) {
            upcomingMeetings.add(meeting);
        } else {
            pastMeetings.add(meeting);
        }
    }
    upcomingTableModel.setObjects(upcomingMeetings);
    upcomingTableEl.reset(true, true, true);
    pastTableModel.setObjects(pastMeetings);
    pastTableEl.reset(true, true, true);
    pastTableEl.setVisible(!pastMeetings.isEmpty());
}
Also used : TeamsMeeting(org.olat.modules.teams.TeamsMeeting) ArrayList(java.util.ArrayList) Date(java.util.Date)

Example 5 with TeamsMeeting

use of org.olat.modules.teams.TeamsMeeting in project OpenOLAT by OpenOLAT.

the class TeamsAdminMeetingsController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (confirmDelete == source) {
        if (DialogBoxUIFactory.isYesEvent(event) || DialogBoxUIFactory.isOkEvent(event)) {
            TeamsMeeting meeting = (TeamsMeeting) confirmDelete.getUserObject();
            doDelete(meeting);
        }
        cleanUp();
    } else if (confirmBatchDelete == source) {
        if (DialogBoxUIFactory.isYesEvent(event) || DialogBoxUIFactory.isOkEvent(event)) {
            @SuppressWarnings("unchecked") List<TeamsMeeting> meetings = (List<TeamsMeeting>) confirmBatchDelete.getUserObject();
            doDelete(meetings);
        }
        cleanUp();
    } else if (cmc == source) {
        cleanUp();
    }
    super.event(ureq, source, event);
}
Also used : TeamsMeeting(org.olat.modules.teams.TeamsMeeting) List(java.util.List)

Aggregations

TeamsMeeting (org.olat.modules.teams.TeamsMeeting)42 Date (java.util.Date)21 Test (org.junit.Test)19 RepositoryEntry (org.olat.repository.RepositoryEntry)19 Identity (org.olat.core.id.Identity)16 QueryBuilder (org.olat.core.commons.persistence.QueryBuilder)6 Appointment (org.olat.modules.appointments.Appointment)5 Topic (org.olat.modules.appointments.Topic)5 BigBlueButtonMeeting (org.olat.modules.bigbluebutton.BigBlueButtonMeeting)4 TeamsErrors (org.olat.modules.teams.model.TeamsErrors)4 SoftAssertions (org.assertj.core.api.SoftAssertions)3 OLATResourceable (org.olat.core.id.OLATResourceable)3 InstantMessage (org.olat.instantMessaging.InstantMessage)3 AppointmentSearchParams (org.olat.modules.appointments.AppointmentSearchParams)3 TeamsAttendee (org.olat.modules.teams.TeamsAttendee)3 TeamsMeetingEvent (org.olat.modules.teams.ui.TeamsMeetingEvent)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 BigBlueButtonErrors (org.olat.modules.bigbluebutton.model.BigBlueButtonErrors)2 TeamsUser (org.olat.modules.teams.TeamsUser)2