use of org.olat.core.commons.modules.bc.FileSelection in project openolat by klemens.
the class CmdDelete method execute.
public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl wContr, Translator trans) {
this.translator = trans;
this.folderComponent = fc;
this.fileSelection = new FileSelection(ureq, fc.getCurrentContainerPath());
VFSContainer currentContainer = folderComponent.getCurrentContainer();
List<String> lockedFiles = hasLockedFiles(currentContainer, fileSelection);
if (lockedFiles.isEmpty()) {
String msg = trans.translate("del.confirm") + "<p>" + fileSelection.renderAsHtml() + "</p>";
// create dialog controller
dialogCtr = activateYesNoDialog(ureq, trans.translate("del.header"), msg, dialogCtr);
} else {
String msg = FolderCommandHelper.renderLockedMessageAsHtml(trans, lockedFiles);
List<String> buttonLabels = Collections.singletonList(trans.translate("ok"));
lockedFiledCtr = activateGenericDialog(ureq, trans.translate("lock.title"), msg, buttonLabels, lockedFiledCtr);
}
return this;
}
use of org.olat.core.commons.modules.bc.FileSelection in project openolat by klemens.
the class CmdDownloadZip method execute.
@Override
public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wControl, Translator trans) {
currentContainer = folderComponent.getCurrentContainer();
status = FolderCommandHelper.sanityCheck(wControl, folderComponent);
if (status == FolderCommandStatus.STATUS_FAILED) {
return null;
}
selection = new FileSelection(ureq, folderComponent.getCurrentContainerPath());
status = FolderCommandHelper.sanityCheck3(wControl, folderComponent, selection);
if (status == FolderCommandStatus.STATUS_FAILED) {
return null;
}
MediaResource mr = new ZipMediaResource(currentContainer, selection);
ureq.getDispatchResult().setResultingMediaResource(mr);
return null;
}
Aggregations