use of org.olat.modules.openmeetings.model.OpenMeetingsRoom in project OpenOLAT by OpenOLAT.
the class CollaborationTools method openOpenMeetingsRoom.
private void openOpenMeetingsRoom() {
OpenMeetingsModule omModule = CoreSpringFactory.getImpl(OpenMeetingsModule.class);
if (!omModule.isEnabled())
return;
OpenMeetingsManager omm = CoreSpringFactory.getImpl(OpenMeetingsManager.class);
Long roomId = omm.getRoomId(ores, null, null);
if (roomId == null) {
// create the room
OpenMeetingsRoom room = new OpenMeetingsRoom();
room.setComment(ores.getDescription());
room.setModerated(true);
room.setName(ores.getName());
room.setAudioOnly(true);
room.setResourceName(ores.getName());
room.setSize(25);
room.setType(RoomType.conference.type());
omm.addRoom(ores, null, null, room);
}
}
use of org.olat.modules.openmeetings.model.OpenMeetingsRoom in project OpenOLAT by OpenOLAT.
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 OpenOLAT.
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;
}
use of org.olat.modules.openmeetings.model.OpenMeetingsRoom in project OpenOLAT by OpenOLAT.
the class OpenMeetingsManagerImpl method getRoom.
@Override
public OpenMeetingsRoom getRoom(BusinessGroup group, OLATResourceable ores, String subIdentifier) throws OpenMeetingsException {
OpenMeetingsRoomReference prop = openMeetingsDao.getReference(group, ores, subIdentifier);
if (prop == null) {
return null;
}
Long roomId = prop.getRoomId();
if (roomId != null && roomId.longValue() > 0) {
try {
String sessionId = adminLogin();
OpenMeetingsRoom room = openMeetingsDao.deserializeRoom(prop.getConfig());
getRoomById(sessionId, room, roomId.longValue());
return room;
} catch (OpenMeetingsException e) {
throw e;
} catch (Exception e) {
log.error("", e);
throw translateException(e, 0);
}
}
return null;
}
use of org.olat.modules.openmeetings.model.OpenMeetingsRoom in project OpenOLAT by OpenOLAT.
the class OpenMeetingsManagerImpl method getRoomById.
private OpenMeetingsRoom getRoomById(String sid, OpenMeetingsRoom room, long roomId) throws OpenMeetingsException {
try {
RoomServicePortType roomWs = getRoomWebService();
Room omRoom = roomWs.getRoomById(sid, roomId);
if (omRoom != null) {
room.setComment(omRoom.getComment());
if (omRoom.isIsModeratedRoom() != null) {
room.setModerated(omRoom.isIsModeratedRoom());
}
if (omRoom.isIsAudioOnly() != null) {
room.setAudioOnly(omRoom.isIsAudioOnly());
}
room.setName(omRoom.getName());
if (omRoom.getRoomsId() != null) {
room.setRoomId(omRoom.getRoomsId());
} else {
room.setRoomId(roomId);
}
room.setSize(omRoom.getNumberOfPartizipants());
room.setType(omRoom.getRoomtype().getRoomtypesId());
room.setClosed(omRoom.isIsClosed());
return room;
} else {
return null;
}
} catch (Exception e) {
log.error("", e);
throw translateException(e, 0);
}
}
Aggregations