use of org.olat.modules.gotomeeting.GoToMeeting in project openolat by klemens.
the class GoToRegistrantDAOTest method createRegistrant.
@Test
public void createRegistrant() {
String token = UUID.randomUUID().toString();
Identity trainee = JunitTestHelper.createAndPersistIdentityAsRndUser("trainee-2");
GoToOrganizer organizer = organizerDao.createOrganizer(null, token, token, token, null, null, null, null, 10l, null);
Assert.assertNotNull(organizer);
Date start = new Date();
Date end = new Date();
String trainingKey = Long.toString(CodeHelper.getForeverUniqueID());
GoToMeeting training = meetingDao.createTraining("New training", null, "Very interessant", trainingKey, start, end, organizer, null, null, null);
dbInstance.commit();
// create registrant
String registrantKey = Long.toString(CodeHelper.getForeverUniqueID());
String joinUrl = "http://openolat.com/join/" + registrantKey;
String confirmUrl = "http://openolat.com/confirm/" + registrantKey;
GoToRegistrant registrant = registrantDao.createRegistrant(training, trainee, registrantKey, joinUrl, confirmUrl);
Assert.assertNotNull(registrant);
dbInstance.commit();
// load
GoToRegistrant reloadRegistrant = registrantDao.getRegistrant(training, trainee);
Assert.assertNotNull(reloadRegistrant);
Assert.assertEquals(registrant, reloadRegistrant);
}
use of org.olat.modules.gotomeeting.GoToMeeting in project openolat by klemens.
the class GoToRegistrantDAOTest method getRegistrants.
@Test
public void getRegistrants() {
String token = UUID.randomUUID().toString();
Identity trainee = JunitTestHelper.createAndPersistIdentityAsRndUser("trainee-3");
GoToOrganizer organizer = organizerDao.createOrganizer(null, token, token, token, null, null, null, null, 10l, null);
Assert.assertNotNull(organizer);
Date start = new Date();
Date end = new Date();
String trainingKey = Long.toString(CodeHelper.getForeverUniqueID());
GoToMeeting training = meetingDao.createTraining("New training", null, "Very interessant", trainingKey, start, end, organizer, null, null, null);
dbInstance.commit();
// create registrant
String registrantKey = Long.toString(CodeHelper.getForeverUniqueID());
String joinUrl = "http://openolat.com/join/" + registrantKey;
String confirmUrl = "http://openolat.com/confirm/" + registrantKey;
GoToRegistrant registrant = registrantDao.createRegistrant(training, trainee, registrantKey, joinUrl, confirmUrl);
Assert.assertNotNull(registrant);
dbInstance.commit();
// load
List<GoToRegistrant> reloadRegistrants = registrantDao.getRegistrants(trainee, null, null, null);
Assert.assertNotNull(reloadRegistrants);
Assert.assertEquals(1, reloadRegistrants.size());
Assert.assertEquals(registrant, reloadRegistrants.get(0));
}
use of org.olat.modules.gotomeeting.GoToMeeting in project openolat by klemens.
the class GoToMeetingPeekViewController method filterMyFutureTrainings.
private void filterMyFutureTrainings(List<GoToMeeting> trainings) {
// only the trainings in the future
Date now = new Date();
for (Iterator<GoToMeeting> it = trainings.iterator(); it.hasNext(); ) {
GoToMeeting training = it.next();
Date end = training.getEndDate();
if (end.before(now)) {
it.remove();
}
}
}
use of org.olat.modules.gotomeeting.GoToMeeting in project openolat by klemens.
the class GoToMeetingsController method updateModel.
protected void updateModel() {
List<GoToMeeting> meetings = meetingMgr.getMeetings(GoToType.training, entry, subIdent, businessGroup);
List<GoToMeeting> upcomingMeetings = new ArrayList<>();
List<GoToMeeting> pastMeetings = new ArrayList<>();
Date now = new Date();
for (GoToMeeting meeting : meetings) {
Date endDate = meeting.getEndDate();
if (now.after(endDate)) {
pastMeetings.add(meeting);
} else {
upcomingMeetings.add(meeting);
}
}
upcomingTableModel.setObjects(upcomingMeetings);
upcomingTableEl.reloadData();
upcomingTableEl.reset();
pastTableModel.setObjects(pastMeetings);
pastTableEl.reloadData();
pastTableEl.reset();
pastTableEl.setVisible(pastMeetings.size() > 0);
}
use of org.olat.modules.gotomeeting.GoToMeeting in project openolat by klemens.
the class GoToMeetingsAdminController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (confirmDelete == source) {
if (DialogBoxUIFactory.isYesEvent(event)) {
GoToMeeting meeting = (GoToMeeting) confirmDelete.getUserObject();
doDelete(meeting);
}
cleanUp();
} else if (cmc == source) {
cleanUp();
}
super.event(ureq, source, event);
}
Aggregations