use of org.olat.modules.openmeetings.model.OpenMeetingsRoom in project OpenOLAT by OpenOLAT.
the class OpenMeetingsRoomEditController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (room == null) {
room = new OpenMeetingsRoom();
}
room.setComment(commentEl.getValue());
room.setModerated(moderationModeEl.isOneSelected() && moderationModeEl.isSelected(0));
room.setName(roomNameEl.getValue());
if (roomSizeEl.isOneSelected()) {
String key = roomSizeEl.getSelectedKey();
if (StringHelper.isLong(key)) {
room.setSize(Long.parseLong(key));
} else {
room.setSize(16l);
}
}
room.setAudioOnly(avModeEl.isOneSelected() && avModeEl.isSelected(0));
if (roomTypeEl.isOneSelected()) {
String type = roomTypeEl.getSelectedKey();
long roomType = Long.parseLong(type);
room.setType(roomType);
}
if (room.getRoomId() > 0) {
room = openMeetingsManager.updateRoom(group, ores, subIdentifier, room);
fireEvent(ureq, Event.CHANGED_EVENT);
} else {
room = openMeetingsManager.addRoom(group, ores, subIdentifier, room);
fireEvent(ureq, Event.DONE_EVENT);
}
}
use of org.olat.modules.openmeetings.model.OpenMeetingsRoom in project OpenOLAT by OpenOLAT.
the class OpenMeetingsDAOTest method createAndGetReference.
@Test
public void createAndGetReference() {
OLATResourceable ores = OresHelper.createOLATResourceableInstance(UUID.randomUUID().toString(), 1l);
OpenMeetingsRoom room = new OpenMeetingsRoom();
room.setRoomId(123l);
OpenMeetingsRoomReference ref = openMeetingsDAO.createReference(null, ores, "world", room);
Assert.assertNotNull(ref);
dbInstance.commitAndCloseSession();
OpenMeetingsRoomReference loadedRef = openMeetingsDAO.getReference(null, ores, "world");
Assert.assertNotNull(loadedRef);
Assert.assertNotNull(loadedRef.getKey());
Assert.assertNotNull(loadedRef.getCreationDate());
Assert.assertNotNull(loadedRef.getLastModified());
Assert.assertEquals(ores.getResourceableTypeName(), loadedRef.getResourceTypeName());
Assert.assertEquals(ores.getResourceableId(), loadedRef.getResourceTypeId());
Assert.assertEquals(123l, loadedRef.getRoomId());
}
use of org.olat.modules.openmeetings.model.OpenMeetingsRoom in project OpenOLAT by OpenOLAT.
the class OpenMeetingsDAOTest method testGetReferences.
@Test
public void testGetReferences() {
OLATResourceable ores = OresHelper.createOLATResourceableInstance(UUID.randomUUID().toString(), 1l);
OpenMeetingsRoom room = new OpenMeetingsRoom();
room.setRoomId(123l);
OpenMeetingsRoomReference ref = openMeetingsDAO.createReference(null, ores, "hello", room);
dbInstance.commitAndCloseSession();
List<OpenMeetingsRoomReference> refs = openMeetingsDAO.getReferences();
Assert.assertNotNull(refs);
Assert.assertFalse(refs.isEmpty());
Assert.assertTrue(refs.contains(ref));
}
use of org.olat.modules.openmeetings.model.OpenMeetingsRoom in project openolat by klemens.
the class OpenMeetingsEditController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == accessibilityCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondContr.getCondition();
courseNode.setPreConditionAccess(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == editForm) {
// config form action
if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
OpenMeetingsRoom room = editForm.getRoom();
if (room != null) {
ModuleConfiguration moduleConfiguration = courseNode.getModuleConfiguration();
moduleConfiguration.set(CONFIG_ROOM_NAME, room.getName());
moduleConfiguration.set(CONFIG_ROOM_SIZE, new Long(room.getSize()));
moduleConfiguration.set(CONFIG_ROOM_MODERATION, new Boolean(room.isModerated()));
moduleConfiguration.set(CONFIG_ROOM_AUDIO_ONLY, new Boolean(room.isAudioOnly()));
moduleConfiguration.set(CONFIG_ROOM_COMMENT, room.getComment());
moduleConfiguration.set(CONFIG_ROOM_TYPE, new Long(room.getType()));
}
}
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
use of org.olat.modules.openmeetings.model.OpenMeetingsRoom in project openolat by klemens.
the class OpenMeetingsEditController method getDefaultValues.
private OpenMeetingsRoom getDefaultValues() {
OpenMeetingsRoom room = new OpenMeetingsRoom();
ModuleConfiguration moduleConfiguration = courseNode.getModuleConfiguration();
Object name = moduleConfiguration.get(CONFIG_ROOM_NAME);
if (name instanceof String) {
room.setName((String) name);
}
Object size = moduleConfiguration.get(CONFIG_ROOM_SIZE);
if (size instanceof Long) {
room.setSize(((Long) size).longValue());
}
Object moderated = moduleConfiguration.get(CONFIG_ROOM_MODERATION);
if (moderated instanceof Boolean) {
room.setModerated(((Boolean) moderated).booleanValue());
} else if (moderated == null) {
room.setModerated(true);
}
Object comment = moduleConfiguration.get(CONFIG_ROOM_COMMENT);
if (comment instanceof String) {
room.setComment((String) comment);
}
Object type = moduleConfiguration.get(CONFIG_ROOM_TYPE);
if (type instanceof Long) {
room.setType(((Long) type).longValue());
} else if (type == null) {
room.setType(3);
}
Object isAudioOnly = moduleConfiguration.get(CONFIG_ROOM_AUDIO_ONLY);
if (isAudioOnly instanceof Boolean) {
room.setAudioOnly(((Boolean) isAudioOnly).booleanValue());
} else if (isAudioOnly == null) {
room.setAudioOnly(true);
}
return room;
}
Aggregations