Search in sources :

Example 1 with OpenMeetingsRecording

use of org.olat.modules.openmeetings.model.OpenMeetingsRecording in project OpenOLAT by OpenOLAT.

the class OpenMeetingsManagerImpl method getRecordings.

@Override
public List<OpenMeetingsRecording> getRecordings(long roomId) throws OpenMeetingsException {
    try {
        String adminSID = adminLogin();
        RoomServicePortType roomWs = getRoomWebService();
        List<FlvRecording> recordings = roomWs.getFlvRecordingByRoomId(adminSID, roomId);
        List<OpenMeetingsRecording> recList = new ArrayList<OpenMeetingsRecording>();
        if (recordings != null) {
            for (FlvRecording recording : recordings) {
                if (recording != null) {
                    OpenMeetingsRecording rec = new OpenMeetingsRecording();
                    rec.setRoomId(recording.getRoomId());
                    rec.setRecordingId(recording.getFlvRecordingId());
                    rec.setFilename(recording.getFileName());
                    rec.setDownloadName(recording.getFileHash());
                    rec.setDownloadNameAlt(recording.getAlternateDownload());
                    rec.setPreviewImage(recording.getPreviewImage());
                    rec.setWidth(recording.getFlvWidth());
                    rec.setHeight(recording.getFlvHeight());
                    recList.add(rec);
                }
            }
        }
        return recList;
    } catch (Exception e) {
        log.error("", e);
        throw translateException(e, 0);
    }
}
Also used : FlvRecording(org.apache.openmeetings.persistence.beans.flvrecord.xsd.FlvRecording) OpenMeetingsRecording(org.olat.modules.openmeetings.model.OpenMeetingsRecording) ArrayList(java.util.ArrayList) RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) ConnectException(java.net.ConnectException)

Example 2 with OpenMeetingsRecording

use of org.olat.modules.openmeetings.model.OpenMeetingsRecording in project OpenOLAT by OpenOLAT.

the class OpenMeetingsRecordingsController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == tableCtr) {
        if (event instanceof TableEvent) {
            TableEvent e = (TableEvent) event;
            int row = e.getRowId();
            OpenMeetingsRecording recording = (OpenMeetingsRecording) tableCtr.getTableDataModel().getObject(row);
            if ("view".equals(e.getActionId())) {
                doView(ureq, recording);
            } else if ("delete".equals(e.getActionId())) {
                String text = getTranslator().translate("recording.remove", new String[] { recording.getFilename() });
                confirmRemoveRecording = activateYesNoDialog(ureq, null, text, confirmRemoveRecording);
                confirmRemoveRecording.setUserObject(recording);
            }
        }
    } else if (source == confirmRemoveRecording) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            // yes case
            OpenMeetingsRecording recording = (OpenMeetingsRecording) confirmRemoveRecording.getUserObject();
            doDelete(recording);
        }
    }
}
Also used : OpenMeetingsRecording(org.olat.modules.openmeetings.model.OpenMeetingsRecording) TableEvent(org.olat.core.gui.components.table.TableEvent)

Example 3 with OpenMeetingsRecording

use of org.olat.modules.openmeetings.model.OpenMeetingsRecording in project openolat by klemens.

the class OpenMeetingsRecordingsController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == tableCtr) {
        if (event instanceof TableEvent) {
            TableEvent e = (TableEvent) event;
            int row = e.getRowId();
            OpenMeetingsRecording recording = (OpenMeetingsRecording) tableCtr.getTableDataModel().getObject(row);
            if ("view".equals(e.getActionId())) {
                doView(ureq, recording);
            } else if ("delete".equals(e.getActionId())) {
                String text = getTranslator().translate("recording.remove", new String[] { recording.getFilename() });
                confirmRemoveRecording = activateYesNoDialog(ureq, null, text, confirmRemoveRecording);
                confirmRemoveRecording.setUserObject(recording);
            }
        }
    } else if (source == confirmRemoveRecording) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            // yes case
            OpenMeetingsRecording recording = (OpenMeetingsRecording) confirmRemoveRecording.getUserObject();
            doDelete(recording);
        }
    }
}
Also used : OpenMeetingsRecording(org.olat.modules.openmeetings.model.OpenMeetingsRecording) TableEvent(org.olat.core.gui.components.table.TableEvent)

Example 4 with OpenMeetingsRecording

use of org.olat.modules.openmeetings.model.OpenMeetingsRecording in project OpenOLAT by OpenOLAT.

the class OpenMeetingsRecordingsController method loadModel.

private void loadModel() {
    try {
        List<OpenMeetingsRecording> recordings = openMeetingsManager.getRecordings(roomId);
        List<OpenMeetingsRecording> readyRecordings = new ArrayList<OpenMeetingsRecording>(recordings.size());
        for (OpenMeetingsRecording recording : recordings) {
            if (StringHelper.containsNonWhitespace(recording.getDownloadName())) {
                readyRecordings.add(recording);
            }
        }
        ((OpenMeetingsRecordingsDataModel) tableCtr.getTableDataModel()).setObjects(readyRecordings);
        tableCtr.modelChanged();
    } catch (OpenMeetingsException e) {
        showError(e.i18nKey());
    }
}
Also used : OpenMeetingsRecording(org.olat.modules.openmeetings.model.OpenMeetingsRecording) ArrayList(java.util.ArrayList) OpenMeetingsException(org.olat.modules.openmeetings.manager.OpenMeetingsException)

Example 5 with OpenMeetingsRecording

use of org.olat.modules.openmeetings.model.OpenMeetingsRecording in project openolat by klemens.

the class OpenMeetingsRecordingsController method loadModel.

private void loadModel() {
    try {
        List<OpenMeetingsRecording> recordings = openMeetingsManager.getRecordings(roomId);
        List<OpenMeetingsRecording> readyRecordings = new ArrayList<OpenMeetingsRecording>(recordings.size());
        for (OpenMeetingsRecording recording : recordings) {
            if (StringHelper.containsNonWhitespace(recording.getDownloadName())) {
                readyRecordings.add(recording);
            }
        }
        ((OpenMeetingsRecordingsDataModel) tableCtr.getTableDataModel()).setObjects(readyRecordings);
        tableCtr.modelChanged();
    } catch (OpenMeetingsException e) {
        showError(e.i18nKey());
    }
}
Also used : OpenMeetingsRecording(org.olat.modules.openmeetings.model.OpenMeetingsRecording) ArrayList(java.util.ArrayList) OpenMeetingsException(org.olat.modules.openmeetings.manager.OpenMeetingsException)

Aggregations

OpenMeetingsRecording (org.olat.modules.openmeetings.model.OpenMeetingsRecording)6 ArrayList (java.util.ArrayList)4 ConnectException (java.net.ConnectException)2 RoomServicePortType (org.apache.openmeetings.axis.services.RoomServicePortType)2 FlvRecording (org.apache.openmeetings.persistence.beans.flvrecord.xsd.FlvRecording)2 TableEvent (org.olat.core.gui.components.table.TableEvent)2 OpenMeetingsException (org.olat.modules.openmeetings.manager.OpenMeetingsException)2