use of org.apache.openmeetings.db.dto.record.RecordingContainerData in project openmeetings by apache.
the class RoomFilePanel method updateSizes.
@Override
public void updateSizes() {
RecordingContainerData sizeData = recDao.getContainerData(getUserId());
long userSize = fileDao.getOwnSize(getUserId());
long roomSize = fileDao.getRoomSize(room.getRoom().getId());
if (sizeData != null) {
userSize += sizeData.getUserHomeSize();
roomSize += sizeData.getPublicFileSize();
}
homeSize.setObject(getHumanSize(userSize));
publicSize.setObject(getHumanSize(roomSize));
}
use of org.apache.openmeetings.db.dto.record.RecordingContainerData in project openmeetings by apache.
the class RecordingsPanel method onInitialize.
@Override
protected void onInitialize() {
final NameDialog addFolder = new NameDialog("addFolder", getString("712")) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
fileTree.createFolder(target, getModelObject());
}
};
add(fileTree = new FileTreePanel("tree", null, addFolder, null) {
private static final long serialVersionUID = 1L;
@Override
public void updateSizes() {
RecordingContainerData sizeData = recDao.getContainerData(getUserId());
if (sizeData != null) {
homeSize.setObject(getHumanSize(sizeData.getUserHomeSize()));
publicSize.setObject(getHumanSize(sizeData.getPublicFileSize()));
}
}
@Override
protected void update(AjaxRequestTarget target, BaseFileItem f) {
video.update(target, f);
info.update(target, f);
}
});
add(video, info, addFolder);
super.onInitialize();
}
use of org.apache.openmeetings.db.dto.record.RecordingContainerData 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;
}
Aggregations