use of org.olat.modules.openmeetings.model.OpenMeetingsRoomReference in project openolat by klemens.
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 klemens.
the class OpenMeetingsDAOTest method createReference.
@Test
public void createReference() {
OLATResourceable ores = OresHelper.createOLATResourceableInstance(UUID.randomUUID().toString(), 1l);
OpenMeetingsRoom room = new OpenMeetingsRoom();
room.setRoomId(123l);
OpenMeetingsRoomReference ref = openMeetingsDAO.createReference(null, ores, "hello", room);
Assert.assertNotNull(ref);
Assert.assertNotNull(ref.getKey());
Assert.assertNotNull(ref.getCreationDate());
Assert.assertNotNull(ref.getLastModified());
Assert.assertEquals(ores.getResourceableTypeName(), ref.getResourceTypeName());
Assert.assertEquals(ores.getResourceableId(), ref.getResourceTypeId());
Assert.assertEquals(123l, ref.getRoomId());
}
use of org.olat.modules.openmeetings.model.OpenMeetingsRoomReference in project openolat by klemens.
the class OpenMeetingsAdminRoomsController method openResource.
protected void openResource(UserRequest ureq, OpenMeetingsRoom room) {
OpenMeetingsRoomReference prop = room.getReference();
if (prop != null) {
String url;
if (prop.getGroup() != null) {
url = "[BusinessGroup:" + prop.getGroup().getKey() + "]";
} else {
OLATResourceable ores = OresHelper.createOLATResourceableInstance(prop.getResourceTypeName(), prop.getResourceTypeId());
RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(ores, false);
if (re != null) {
url = "[RepositoryEntry:" + re.getKey() + "]";
if (StringHelper.containsNonWhitespace(prop.getSubIdentifier()) && "CourseModule".equals(ores.getResourceableTypeName())) {
url += "[CourseNode:" + prop.getSubIdentifier() + "]";
}
} else {
showWarning("resource.dont.exist");
return;
}
}
BusinessControl bc = BusinessControlFactory.getInstance().createFromString(url);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
NewControllerFactory.getInstance().launch(ureq, bwControl);
}
}
use of org.olat.modules.openmeetings.model.OpenMeetingsRoomReference in project openolat by klemens.
the class OpenMeetingsDAO method updateReference.
public OpenMeetingsRoomReference updateReference(BusinessGroup group, OLATResourceable courseResource, String subIdentifier, OpenMeetingsRoom room) {
OpenMeetingsRoomReference property = getReference(group, courseResource, subIdentifier);
if (property == null) {
property = createReference(group, courseResource, subIdentifier, room);
} else {
String serialized = serializeRoom(room);
property.setLastModified(new Date());
property.setConfig(serialized);
property = dbInstance.getCurrentEntityManager().merge(property);
}
return property;
}
Aggregations