Search in sources :

Example 1 with RecordingContainerData

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));
}
Also used : RecordingContainerData(org.apache.openmeetings.db.dto.record.RecordingContainerData)

Example 2 with RecordingContainerData

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();
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) BaseFileItem(org.apache.openmeetings.db.entity.file.BaseFileItem) NameDialog(org.apache.openmeetings.web.common.NameDialog) RecordingContainerData(org.apache.openmeetings.db.dto.record.RecordingContainerData) FileTreePanel(org.apache.openmeetings.web.common.tree.FileTreePanel)

Example 3 with RecordingContainerData

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;
}
Also used : GroupUser(org.apache.openmeetings.db.entity.user.GroupUser) RecordingContainerData(org.apache.openmeetings.db.dto.record.RecordingContainerData) Recording(org.apache.openmeetings.db.entity.record.Recording)

Aggregations

RecordingContainerData (org.apache.openmeetings.db.dto.record.RecordingContainerData)3 BaseFileItem (org.apache.openmeetings.db.entity.file.BaseFileItem)1 Recording (org.apache.openmeetings.db.entity.record.Recording)1 GroupUser (org.apache.openmeetings.db.entity.user.GroupUser)1 NameDialog (org.apache.openmeetings.web.common.NameDialog)1 FileTreePanel (org.apache.openmeetings.web.common.tree.FileTreePanel)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1