use of org.apache.openmeetings.db.entity.record.Recording in project openmeetings by apache.
the class RecordingDao method updateEndTime.
public void updateEndTime(Long recordingId, Date recordEnd) {
try {
Recording fId = get(recordingId);
fId.setRecordEnd(recordEnd);
update(fId);
} catch (Exception ex2) {
log.error("[updateEndTime]: ", ex2);
}
}
use of org.apache.openmeetings.db.entity.record.Recording in project openmeetings by apache.
the class RecordingDao method getContainerData.
public RecordingContainerData getContainerData(long userId) {
try {
RecordingContainerData containerData = new RecordingContainerData();
// User Home Recordings
List<Recording> homes = getRootByOwner(userId);
long homeFileSize = 0;
for (Recording home : homes) {
homeFileSize += getSize(home);
}
containerData.setUserHomeSize(homeFileSize);
// Public Recordings
long publicFileSize = 0;
// get all groups the user can view
for (GroupUser ou : userDao.get(userId).getGroupUsers()) {
List<Recording> publicRecordings = getRootByPublic(ou.getGroup().getId());
// get sizes
for (Recording r : publicRecordings) {
publicFileSize += getSize(r);
}
}
containerData.setPublicFileSize(publicFileSize);
return containerData;
} catch (Exception ex2) {
log.error("[getRecordingContainerData]: ", ex2);
}
return null;
}
use of org.apache.openmeetings.db.entity.record.Recording in project openmeetings by apache.
the class Application method getInvitationLink.
// END hack for email templates support (should be in separate module for now
public static String getInvitationLink(Invitation i, String baseUrl) {
String link = "";
Room r = i.getRoom();
User u = i.getInvitee();
if (r != null) {
if (r.isAppointment() && i.getInvitedBy().getId().equals(u.getId())) {
link = getRoomUrlFragment(r.getId()).getLink();
} else {
boolean allowed = Type.contact != u.getType() && Type.external != u.getType();
if (allowed) {
allowed = get().mainService.isRoomAllowedToUser(r, u);
}
if (allowed) {
link = getRoomUrlFragment(r.getId()).getLink();
} else {
PageParameters pp = new PageParameters();
pp.add(INVITATION_HASH, i.getHash());
if (u.getLanguageId() > 0) {
pp.add("language", u.getLanguageId());
}
link = urlForPage(HashPage.class, pp, baseUrl);
}
}
}
Recording rec = i.getRecording();
if (rec != null) {
link = urlForPage(HashPage.class, new PageParameters().add(INVITATION_HASH, i.getHash()), baseUrl);
}
return link;
}
use of org.apache.openmeetings.db.entity.record.Recording in project openmeetings by apache.
the class TestRecordingService method testExternal.
@Test
public void testExternal() throws Exception {
User u = getExternalUser();
Recording r = new Recording();
r.setInsertedBy(u.getId());
r.setComment("Created by Unit Tests");
r.setRoomId(5L);
r = getBean(RecordingDao.class).update(r);
ServiceResult sr = login();
Collection<? extends RecordingDTO> recs = getClient(getRecordUrl()).path("/" + UNIT_TEST_EXT_TYPE).query("sid", sr.getMessage()).getCollection(RecordingDTO.class);
assertNotNull("Valid collection should be returned", recs);
assertFalse("Collection of the recordings should not be empty", recs.isEmpty());
boolean found = false;
for (RecordingDTO rdo : recs) {
if (r.getId().equals(rdo.getId())) {
// TODO check room, user
found = true;
break;
}
}
assertTrue("Just created recording was not found by the service", found);
}
Aggregations