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;
}
}
}
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"));
}
}
}
}
}
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);
}
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;
}
}
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();
}
}
Aggregations