Search in sources :

Example 1 with OpenMeetingsRoom

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);
    }
}
Also used : OpenMeetingsRoom(org.olat.modules.openmeetings.model.OpenMeetingsRoom) OpenMeetingsModule(org.olat.modules.openmeetings.OpenMeetingsModule) OpenMeetingsManager(org.olat.modules.openmeetings.manager.OpenMeetingsManager)

Example 2 with OpenMeetingsRoom

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);
        }
    }
}
Also used : Condition(org.olat.course.condition.Condition) OpenMeetingsRoom(org.olat.modules.openmeetings.model.OpenMeetingsRoom) ModuleConfiguration(org.olat.modules.ModuleConfiguration)

Example 3 with OpenMeetingsRoom

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;
}
Also used : OpenMeetingsRoom(org.olat.modules.openmeetings.model.OpenMeetingsRoom) ModuleConfiguration(org.olat.modules.ModuleConfiguration)

Example 4 with OpenMeetingsRoom

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;
}
Also used : OpenMeetingsRoom(org.olat.modules.openmeetings.model.OpenMeetingsRoom) OpenMeetingsRoomReference(org.olat.modules.openmeetings.model.OpenMeetingsRoomReference) ConnectException(java.net.ConnectException)

Example 5 with OpenMeetingsRoom

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);
    }
}
Also used : RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) OpenMeetingsRoom(org.olat.modules.openmeetings.model.OpenMeetingsRoom) Room(org.apache.openmeetings.persistence.beans.room.xsd.Room) ConnectException(java.net.ConnectException)

Aggregations

OpenMeetingsRoom (org.olat.modules.openmeetings.model.OpenMeetingsRoom)28 OpenMeetingsRoomReference (org.olat.modules.openmeetings.model.OpenMeetingsRoomReference)12 ConnectException (java.net.ConnectException)6 Test (org.junit.Test)6 OLATResourceable (org.olat.core.id.OLATResourceable)6 RoomServicePortType (org.apache.openmeetings.axis.services.RoomServicePortType)4 ModuleConfiguration (org.olat.modules.ModuleConfiguration)4 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 GetRoomsWithCurrentUsersByListAndType (org.apache.openmeetings.axis.services.GetRoomsWithCurrentUsersByListAndType)2 RoomReturn (org.apache.openmeetings.axis.services.xsd.RoomReturn)2 RoomUser (org.apache.openmeetings.axis.services.xsd.RoomUser)2 Room (org.apache.openmeetings.persistence.beans.room.xsd.Room)2 TableEvent (org.olat.core.gui.components.table.TableEvent)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 Condition (org.olat.course.condition.Condition)2 OpenMeetingsModule (org.olat.modules.openmeetings.OpenMeetingsModule)2 OpenMeetingsException (org.olat.modules.openmeetings.manager.OpenMeetingsException)2 OpenMeetingsManager (org.olat.modules.openmeetings.manager.OpenMeetingsManager)2 RoomReturnInfo (org.olat.modules.openmeetings.model.RoomReturnInfo)2