use of org.olat.modules.openmeetings.model.OpenMeetingsRoomReference 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.OpenMeetingsRoomReference 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.OpenMeetingsRoomReference in project openolat by klemens.
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.OpenMeetingsRoomReference in project openolat by klemens.
the class OpenMeetingsDAO method createReference.
public OpenMeetingsRoomReference createReference(final BusinessGroup group, final OLATResourceable courseResource, String subIdentifier, OpenMeetingsRoom room) {
String serialized = serializeRoom(room);
OpenMeetingsRoomReference ref = new OpenMeetingsRoomReference();
ref.setLastModified(new Date());
ref.setRoomId(room.getRoomId());
ref.setConfig(serialized);
ref.setGroup(group);
if (courseResource != null) {
ref.setResourceTypeName(courseResource.getResourceableTypeName());
ref.setResourceTypeId(courseResource.getResourceableId());
}
ref.setSubIdentifier(subIdentifier);
dbInstance.getCurrentEntityManager().persist(ref);
return ref;
}
use of org.olat.modules.openmeetings.model.OpenMeetingsRoomReference in project openolat by klemens.
the class OpenMeetingsDAO method delete.
public void delete(OpenMeetingsRoomReference ref) {
OpenMeetingsRoomReference reloadedRef = dbInstance.getCurrentEntityManager().getReference(OpenMeetingsRoomReference.class, ref.getKey());
dbInstance.getCurrentEntityManager().remove(reloadedRef);
}
Aggregations