use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class TableController 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)
*/
public void event(final UserRequest ureq, final Component source, final Event event) {
if (source == table) {
String cmd = event.getCommand();
if (cmd.equalsIgnoreCase(Table.COMMAND_SORTBYCOLUMN)) {
tableSort.setDirty(true);
} else if (!cmd.equalsIgnoreCase(Table.COMMAND_SHOW_PAGES) && !cmd.equalsIgnoreCase(Table.COMMAND_PAGEACTION_SHOWALL)) {
// forward to table controller listener
fireEvent(ureq, event);
}
} else if (source == contentVc) {
handleCommandsOfTableVcContainer(ureq, event);
} else if (source == preferenceLink && tableConfig.getPreferencesKey() != null) {
colsChoice = getColumnListAndTheirVisibility();
removeAsListenerAndDispose(cmc);
cmc = new CloseableCalloutWindowController(ureq, getWindowControl(), colsChoice, preferenceLink, translate("title.changecols"), true, "");
listenTo(cmc);
cmc.activate();
} else if (source == downloadLink && tableConfig.isDownloadOffered()) {
TableExporter tableExporter = tableConfig.getDownloadOffered();
MediaResource mr = tableExporter.export(table);
ureq.getDispatchResult().setResultingMediaResource(mr);
} else if (source == colsChoice) {
if (event == Choice.EVNT_VALIDATION_OK) {
// sideeffect on table and prefs
applyAndcheckChangedColumnsChoice(ureq, colsChoice.getSelectedRows());
} else if (event == Choice.EVNT_FORM_RESETED) {
// sideeffect on table and prefs
List<Integer> visibleCols = table.getDefaultVisibleColumnsToResetColumnsChoice();
applyAndcheckChangedColumnsChoice(ureq, visibleCols);
} else {
// cancelled
cmc.deactivate();
}
} else if (source == resetLink) {
table.setSearchString(null);
modelChanged();
}
}
use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class VFSContainerMapper method handle.
public MediaResource handle(String relPath, HttpServletRequest request) {
VFSItem vfsItem = container.resolve(relPath);
MediaResource mr;
if (vfsItem == null || !(vfsItem instanceof VFSLeaf)) {
mr = new NotFoundMediaResource();
} else {
mr = new VFSMediaResource((VFSLeaf) vfsItem);
}
return mr;
}
use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class QTI12AssessmentStatisticsController method doDownloadRawData.
private void doDownloadRawData(UserRequest ureq) {
MediaResource resource = new QTIStatisticsResource(resourceResult, getLocale());
ureq.getDispatchResult().setResultingMediaResource(resource);
}
use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class BinderPageListController method doExportBinderAsPdf.
private void doExportBinderAsPdf(UserRequest ureq) {
MediaResource resource = new ExportBinderAsPDFResource(binder, ureq, getLocale());
ureq.getDispatchResult().setResultingMediaResource(resource);
}
use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class BinderPageListController method doExportBinderAsCP.
private void doExportBinderAsCP(UserRequest ureq) {
MediaResource resource = new ExportBinderAsCPResource(binder, ureq, getLocale());
ureq.getDispatchResult().setResultingMediaResource(resource);
}
Aggregations