Search in sources :

Example 26 with RedirectMediaResource

use of org.olat.core.gui.media.RedirectMediaResource in project OpenOLAT by OpenOLAT.

the class RecordingsTableModel method openWimbaUrl.

private void openWimbaUrl(UserRequest ureq, String target) {
    boolean success = false;
    if (target.equals(COMMAND_OPEN_WIZARD)) {
        String url = wimba.createServiceUrl(target, null);
        RedirectMediaResource rmr = new RedirectMediaResource(url);
        ureq.getDispatchResult().setResultingMediaResource(rmr);
    } else {
        success = wimba.createModerator(ureq.getIdentity(), roomId);
        if (success) {
            wimba.login(ureq.getIdentity(), null);
            String url = wimba.createServiceUrl(target, roomId);
            RedirectMediaResource rmr = new RedirectMediaResource(url);
            ureq.getDispatchResult().setResultingMediaResource(rmr);
        } else {
            // could not create moderator or update the rights
            getWindowControl().setError(translate("error.update.rights"));
            return;
        }
    }
}
Also used : RedirectMediaResource(org.olat.core.gui.media.RedirectMediaResource)

Example 27 with RedirectMediaResource

use of org.olat.core.gui.media.RedirectMediaResource in project OpenOLAT by OpenOLAT.

the class RecordingsTableModel method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == recTable) {
        if (event instanceof TableEvent) {
            TableEvent tEvent = (TableEvent) event;
            String action = tEvent.getActionId();
            int row = tEvent.getRowId();
            String key = (String) recTable.getTableDataModel().getValueAt(row, 0);
            if (action.equals(COMMAND_OPEN_RECORDING)) {
                wimba.login(ureq.getIdentity(), null);
                URL url = wimba.createClassroomRecordingUrl(key, ureq.getIdentity());
                RedirectMediaResource rmr = new RedirectMediaResource(url.toString());
                ureq.getDispatchResult().setResultingMediaResource(rmr);
                return;
            } else if (action.equals(COMMAND_TOGGLESTATUS_RECORDING)) {
                Object[] entry = (Object[]) recTable.getTableDataModel().getObject(row);
                Boolean preview = (Boolean) entry[2];
                if (wimba.setPreviewMode(key, !preview, true)) {
                    String text = preview ? "table.recordings.unclose.success" : "table.recordings.close.success";
                    getWindowControl().setInfo(translate(text));
                    recTableModel.toggleStatus(row);
                    recTable.modelChanged();
                    runVC.setDirty(true);
                } else {
                    String text = preview ? "table.recordings.unclose.error" : "table.recordings.close.error";
                    getWindowControl().setError(translate(text));
                }
            } else if (action.equals(COMMAND_DELETE_RECORDING)) {
                if (wimba.removeClassroomRecording(key)) {
                    getWindowControl().setInfo(translate("table.recordings.delete.success"));
                    recTableModel.removeRecording(row);
                    recTable.modelChanged();
                    runVC.setDirty(true);
                } else {
                    getWindowControl().setError(translate("table.recordings.delete.error"));
                }
            }
        }
    }
}
Also used : TableEvent(org.olat.core.gui.components.table.TableEvent) RedirectMediaResource(org.olat.core.gui.media.RedirectMediaResource) URL(java.net.URL)

Example 28 with RedirectMediaResource

use of org.olat.core.gui.media.RedirectMediaResource in project OpenOLAT by OpenOLAT.

the class RecordingsTableModel method joinMeeting.

private void joinMeeting(UserRequest ureq, boolean guest) {
    URL url;
    if (guest) {
        url = wimba.createClassroomGuestUrl(roomId, ureq.getIdentity(), config);
    } else {
        boolean success = wimba.login(ureq.getIdentity(), null);
        // no success, maybe the user account doesn't exist, create it and try the login again
        if (!success)
            wimba.createUser(ureq.getIdentity(), roomId);
        wimba.login(ureq.getIdentity(), null);
        url = wimba.createClassroomUrl(roomId, ureq.getIdentity(), config);
    }
    RedirectMediaResource rmr = new RedirectMediaResource(url.toString());
    ureq.getDispatchResult().setResultingMediaResource(rmr);
}
Also used : RedirectMediaResource(org.olat.core.gui.media.RedirectMediaResource) URL(java.net.URL)

Example 29 with RedirectMediaResource

use of org.olat.core.gui.media.RedirectMediaResource in project OpenOLAT by OpenOLAT.

the class WimbaConfigController method openWimbaUrl.

private void openWimbaUrl(UserRequest ureq, String target) {
    boolean success = wimba.createModerator(ureq.getIdentity(), roomId);
    if (success) {
        wimba.login(ureq.getIdentity(), null);
        String url = wimba.createServiceUrl(target, roomId);
        RedirectMediaResource rmr = new RedirectMediaResource(url);
        ureq.getDispatchResult().setResultingMediaResource(rmr);
    } else {
        // could not create moderator or update the rights
        getWindowControl().setError(translate("error.update.rights"));
        return;
    }
}
Also used : RedirectMediaResource(org.olat.core.gui.media.RedirectMediaResource)

Example 30 with RedirectMediaResource

use of org.olat.core.gui.media.RedirectMediaResource in project OpenOLAT by OpenOLAT.

the class DefaultMinimalTopNavController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.components.Component,
 *      org.olat.core.gui.control.Event)
 */
@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == closeLink) {
        // close window (a html page which calls Window.close onLoad
        ureq.getDispatchResult().setResultingMediaResource(new RedirectMediaResource(StaticMediaDispatcher.createStaticURIFor("closewindow.html")));
        // release all resources and close window
        WindowBackOffice wbo = getWindowControl().getWindowBackOffice();
        Window w = wbo.getWindow();
        Windows.getWindows(ureq).deregisterWindow(w);
        wbo.dispose();
    }
}
Also used : Window(org.olat.core.gui.components.Window) RedirectMediaResource(org.olat.core.gui.media.RedirectMediaResource) WindowBackOffice(org.olat.core.gui.control.WindowBackOffice)

Aggregations

RedirectMediaResource (org.olat.core.gui.media.RedirectMediaResource)48 MediaResource (org.olat.core.gui.media.MediaResource)16 Identity (org.olat.core.id.Identity)8 URL (java.net.URL)6 UserRequest (org.olat.core.gui.UserRequest)6 Window (org.olat.core.gui.components.Window)6 UserSession (org.olat.core.util.UserSession)6 IOException (java.io.IOException)4 HttpSession (javax.servlet.http.HttpSession)4 ChiefController (org.olat.core.gui.control.ChiefController)4 WindowBackOffice (org.olat.core.gui.control.WindowBackOffice)4 StringOutput (org.olat.core.gui.render.StringOutput)4 URLBuilder (org.olat.core.gui.render.URLBuilder)4 AssertException (org.olat.core.logging.AssertException)4 UserRequestImpl (org.olat.core.gui.UserRequestImpl)3 GoToError (org.olat.modules.gotomeeting.model.GoToError)3 OpenMeetingsException (org.olat.modules.openmeetings.manager.OpenMeetingsException)3 ArrayList (java.util.ArrayList)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 HttpServletResponse (javax.servlet.http.HttpServletResponse)2