Search in sources :

Example 1 with TeamsMeetingImpl

use of org.olat.modules.teams.model.TeamsMeetingImpl in project OpenOLAT by OpenOLAT.

the class TeamsMeetingDAO method updateMeeting.

public TeamsMeeting updateMeeting(TeamsMeeting meeting) {
    TeamsMeetingImpl meetingImpl = (TeamsMeetingImpl) meeting;
    meetingImpl.setLastModified(new Date());
    updateDates(meetingImpl, meeting.getStartDate(), meeting.getLeadTime(), meeting.getEndDate(), meeting.getFollowupTime());
    return dbInstance.getCurrentEntityManager().merge(meeting);
}
Also used : TeamsMeetingImpl(org.olat.modules.teams.model.TeamsMeetingImpl) Date(java.util.Date)

Example 2 with TeamsMeetingImpl

use of org.olat.modules.teams.model.TeamsMeetingImpl in project OpenOLAT by OpenOLAT.

the class MicrosoftGraphDAOTest method canAttendeeOpenMeeting.

@Test
public void canAttendeeOpenMeeting() {
    TeamsMeetingImpl test = new TeamsMeetingImpl();
    // everyone
    test.setAllowedPresenters(OnlineMeetingPresenters.EVERYONE.name());
    test.setLobbyBypassScope(LobbyBypassScope.EVERYONE.name());
    Assert.assertTrue(MicrosoftGraphDAO.canAttendeeOpenMeeting(test));
    test.setAllowedPresenters(OnlineMeetingPresenters.ORGANIZATION.name());
    test.setLobbyBypassScope(LobbyBypassScope.ORGANIZER.name());
    Assert.assertFalse(MicrosoftGraphDAO.canAttendeeOpenMeeting(test));
}
Also used : TeamsMeetingImpl(org.olat.modules.teams.model.TeamsMeetingImpl) Test(org.junit.Test)

Example 3 with TeamsMeetingImpl

use of org.olat.modules.teams.model.TeamsMeetingImpl in project OpenOLAT by OpenOLAT.

the class MicrosoftGraphDAOTest method createUpdateDeleteOnBehalf.

@Test
public void createUpdateDeleteOnBehalf() {
    Assume.assumeTrue(StringHelper.containsNonWhitespace(teamsModule.getApiKey()));
    Assume.assumeTrue(StringHelper.containsNonWhitespace(teamsModule.getProducerId()));
    // create an OpenOlat meeting
    RepositoryEntry entry = JunitTestHelper.createAndPersistRepositoryEntry();
    String name = "Real-Online-Meeting - 1";
    Identity creator = JunitTestHelper.createAndPersistIdentityAsRndUser("teams-1");
    Date start = DateUtils.addMinutes(new Date(), 5);
    Date end = DateUtils.addMinutes(start, 5);
    TeamsMeeting meeting = teamsMeetingDao.createMeeting(name, start, end, entry, null, null, creator);
    meeting.setAccessLevel(AccessLevel.EVERYONE.name());
    meeting.setAllowedPresenters(OnlineMeetingPresenters.EVERYONE.name());
    meeting.setLobbyBypassScope(LobbyBypassScope.EVERYONE.name());
    meeting = teamsMeetingDao.updateMeeting(meeting);
    dbInstance.commitAndCloseSession();
    // create the online meeting
    String userId = teamsModule.getProducerId();
    User user = new User();
    user.id = userId;
    TeamsErrors errors = new TeamsErrors();
    OnlineMeeting onlineMeeting = microsoftGraphDao.createMeeting(meeting, user, OnlineMeetingRole.PRESENTER, errors);
    Assert.assertNotNull(onlineMeeting);
    Assert.assertNotNull(onlineMeeting.id);
    Assert.assertNotNull(onlineMeeting.joinUrl);
    Assert.assertEquals(name, onlineMeeting.subject);
    // update the meeting
    String updateName = "Update-Online-Meeting - 1";
    meeting.setSubject(updateName);
    ((TeamsMeetingImpl) meeting).setOnlineMeetingId(onlineMeeting.id);
    ((TeamsMeetingImpl) meeting).setOnlineMeetingJoinUrl(onlineMeeting.joinUrl);
    meeting = teamsMeetingDao.updateMeeting(meeting);
    dbInstance.commitAndCloseSession();
}
Also used : User(com.microsoft.graph.models.User) TeamsMeeting(org.olat.modules.teams.TeamsMeeting) OnlineMeeting(com.microsoft.graph.models.OnlineMeeting) TeamsErrors(org.olat.modules.teams.model.TeamsErrors) RepositoryEntry(org.olat.repository.RepositoryEntry) Identity(org.olat.core.id.Identity) Date(java.util.Date) TeamsMeetingImpl(org.olat.modules.teams.model.TeamsMeetingImpl) Test(org.junit.Test)

Example 4 with TeamsMeetingImpl

use of org.olat.modules.teams.model.TeamsMeetingImpl in project OpenOLAT by OpenOLAT.

the class TeamsMeetingDAO method createMeeting.

public TeamsMeeting createMeeting(String subject, Date startDate, Date endDate, RepositoryEntry entry, String subIdent, BusinessGroup businessGroup, Identity creator) {
    TeamsMeetingImpl meeting = new TeamsMeetingImpl();
    meeting.setCreationDate(new Date());
    meeting.setLastModified(meeting.getCreationDate());
    meeting.setSubject(subject);
    meeting.setStartDate(startDate);
    meeting.setLeadTime(0l);
    meeting.setEndDate(endDate);
    meeting.setFollowupTime(0l);
    // ID for OO internal dispatcher (guest access). BBB does not now this ID.
    meeting.setIdentifier(UUID.randomUUID().toString());
    meeting.setParticipantsCanOpen(false);
    meeting.setAllowedPresenters(OnlineMeetingPresenters.EVERYONE.name());
    meeting.setAccessLevel(AccessLevel.EVERYONE.name());
    meeting.setEntryExitAnnouncement(true);
    meeting.setLobbyBypassScope(LobbyBypassScope.ORGANIZATION.name());
    meeting.setEntry(entry);
    meeting.setSubIdent(subIdent);
    meeting.setBusinessGroup(businessGroup);
    meeting.setCreator(creator);
    dbInstance.getCurrentEntityManager().persist(meeting);
    return meeting;
}
Also used : TeamsMeetingImpl(org.olat.modules.teams.model.TeamsMeetingImpl) Date(java.util.Date)

Example 5 with TeamsMeetingImpl

use of org.olat.modules.teams.model.TeamsMeetingImpl in project OpenOLAT by OpenOLAT.

the class MicrosoftGraphDAOTest method canAttendeeOpenMeetingCheckNulls.

@Test
public void canAttendeeOpenMeetingCheckNulls() {
    Assert.assertFalse(MicrosoftGraphDAO.canAttendeeOpenMeeting(null));
    TeamsMeetingImpl test = new TeamsMeetingImpl();
    Assert.assertFalse(MicrosoftGraphDAO.canAttendeeOpenMeeting(test));
    test.setAllowedPresenters(OnlineMeetingPresenters.EVERYONE.name());
    Assert.assertFalse(MicrosoftGraphDAO.canAttendeeOpenMeeting(test));
    test.setLobbyBypassScope(LobbyBypassScope.EVERYONE.name());
    Assert.assertTrue(MicrosoftGraphDAO.canAttendeeOpenMeeting(test));
}
Also used : TeamsMeetingImpl(org.olat.modules.teams.model.TeamsMeetingImpl) Test(org.junit.Test)

Aggregations

TeamsMeetingImpl (org.olat.modules.teams.model.TeamsMeetingImpl)5 Date (java.util.Date)3 Test (org.junit.Test)3 OnlineMeeting (com.microsoft.graph.models.OnlineMeeting)1 User (com.microsoft.graph.models.User)1 Identity (org.olat.core.id.Identity)1 TeamsMeeting (org.olat.modules.teams.TeamsMeeting)1 TeamsErrors (org.olat.modules.teams.model.TeamsErrors)1 RepositoryEntry (org.olat.repository.RepositoryEntry)1