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);
}
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));
}
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();
}
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;
}
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));
}
Aggregations