Search in sources :

Example 6 with OpenMeetingsRoom

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

Example 7 with OpenMeetingsRoom

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());
}
Also used : OpenMeetingsRoom(org.olat.modules.openmeetings.model.OpenMeetingsRoom) OLATResourceable(org.olat.core.id.OLATResourceable) OpenMeetingsRoomReference(org.olat.modules.openmeetings.model.OpenMeetingsRoomReference) Test(org.junit.Test)

Example 8 with OpenMeetingsRoom

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));
}
Also used : OpenMeetingsRoom(org.olat.modules.openmeetings.model.OpenMeetingsRoom) OLATResourceable(org.olat.core.id.OLATResourceable) OpenMeetingsRoomReference(org.olat.modules.openmeetings.model.OpenMeetingsRoomReference) Test(org.junit.Test)

Example 9 with OpenMeetingsRoom

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

Example 10 with OpenMeetingsRoom

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

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