Search in sources :

Example 16 with Recording

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

Example 17 with Recording

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;
}
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)

Example 18 with Recording

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;
}
Also used : HashPage(org.apache.openmeetings.web.pages.HashPage) User(org.apache.openmeetings.db.entity.user.User) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) Recording(org.apache.openmeetings.db.entity.record.Recording) Room(org.apache.openmeetings.db.entity.room.Room)

Example 19 with Recording

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);
}
Also used : User(org.apache.openmeetings.db.entity.user.User) AbstractJUnitDefaults.getUser(org.apache.openmeetings.AbstractJUnitDefaults.getUser) ServiceResult(org.apache.openmeetings.db.dto.basic.ServiceResult) RecordingDTO(org.apache.openmeetings.db.dto.record.RecordingDTO) Recording(org.apache.openmeetings.db.entity.record.Recording) Test(org.junit.Test)

Aggregations

Recording (org.apache.openmeetings.db.entity.record.Recording)19 ArrayList (java.util.ArrayList)4 RecordingMetaData (org.apache.openmeetings.db.entity.record.RecordingMetaData)4 User (org.apache.openmeetings.db.entity.user.User)4 File (java.io.File)3 BaseFileItem (org.apache.openmeetings.db.entity.file.BaseFileItem)3 FileItem (org.apache.openmeetings.db.entity.file.FileItem)3 Room (org.apache.openmeetings.db.entity.room.Room)3 OmFileHelper.getRecordingMetaData (org.apache.openmeetings.util.OmFileHelper.getRecordingMetaData)2 ProcessResultList (org.apache.openmeetings.util.process.ProcessResultList)2 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)2 Test (org.junit.Test)2 Serializer (org.simpleframework.xml.Serializer)2 Registry (org.simpleframework.xml.convert.Registry)2 RegistryStrategy (org.simpleframework.xml.convert.RegistryStrategy)2 Persister (org.simpleframework.xml.core.Persister)2 Strategy (org.simpleframework.xml.strategy.Strategy)2 JQueryBehavior (com.googlecode.wicket.jquery.core.JQueryBehavior)1 DialogButton (com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton)1 MessageDialog (com.googlecode.wicket.jquery.ui.widget.dialog.MessageDialog)1