use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class BusinessGroupMembersController method doChooseMembers.
private void doChooseMembers(UserRequest ureq) {
removeAsListenerAndDispose(importMembersWizard);
Step start = new ImportMember_1b_ChooseMemberStep(ureq, null, businessGroup, false);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
addMembers(runContext);
return StepsMainRunController.DONE_MODIFIED;
}
};
importMembersWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("add.member"), "o_sel_group_import_1_wizard");
listenTo(importMembersWizard);
getWindowControl().pushAsModalDialog(importMembersWizard.getInitialComponent());
}
use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class MathWebDispatcher method execute.
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) {
UserRequest ureq = null;
try {
// upon creation URL is checked for
ureq = new UserRequestImpl("math", request, response);
} catch (NumberFormatException nfe) {
DispatcherModule.sendBadRequest(request.getPathInfo(), response);
return;
}
String asciiMathInput = ureq.getParameter("input");
Map<String, String> upConvertedAsciiMathInput;
if (StringHelper.containsNonWhitespace(asciiMathInput)) {
XsltStylesheetCache stylesheetCache = CoreSpringFactory.getImpl(QTI21Service.class).getXsltStylesheetCache();
AsciiMathHelper asciiMathHelper = new AsciiMathHelper(new XsltStylesheetCacheAdapter(stylesheetCache));
upConvertedAsciiMathInput = asciiMathHelper.upConvertAsciiMathInput(asciiMathInput);
} else {
upConvertedAsciiMathInput = Collections.emptyMap();
}
try {
JSONObject object = new JSONObject();
for (Map.Entry<String, String> entry : upConvertedAsciiMathInput.entrySet()) {
object.append(entry.getKey(), entry.getValue());
}
object.write(response.getWriter());
} catch (JSONException | IOException e) {
log.error("", e);
}
}
use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class AssessmentResultController method doPrint.
private void doPrint(UserRequest ureq) {
ControllerCreator creator = (uureq, wwControl) -> {
AssessmentResultController printViewCtrl = new AssessmentResultController(uureq, wwControl, assessedIdentity, anonym, candidateSession, fUnzippedDirRoot, mapperUri, submissionMapperUri, options, false, true, false);
printViewCtrl.flc.contextPut("printCommand", Boolean.TRUE);
listenTo(printViewCtrl);
return printViewCtrl;
};
openInNewBrowserWindow(ureq, creator);
}
use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class CorrectionAssessmentItemListController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (tableEl == source) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
CorrectionAssessmentItemRow row = tableModel.getObject(se.getIndex());
if ("select".equals(cmd)) {
// accept all
doSelect(ureq, row, r -> true);
} else if ("answered".equals(cmd)) {
// accept all
doSelect(ureq, row, new ResponsedPredicate(row, true));
} else if ("notAnswered".equals(cmd)) {
// accept all
doSelect(ureq, row, new ResponsedPredicate(row, false));
} else if ("autoCorrected".equals(cmd)) {
doSelect(ureq, row, entry -> !row.isManualCorrection() && entry.getManualScore() == null);
} else if ("corrected".equals(cmd)) {
doSelect(ureq, row, entry -> entry.getManualScore() != null);
} else if ("notCorrected".equals(cmd)) {
doSelect(ureq, row, entry -> row.isManualCorrection() && entry.getManualScore() == null);
} else if ("toReview".equals(cmd)) {
doSelect(ureq, row, AssessmentItemListEntry::isToReview);
}
}
} else if (saveTestsButton == source) {
doConfirmSaveTests(ureq);
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
if ("tools".equals(link.getCmd())) {
doOpenTools(ureq, (CorrectionAssessmentItemRow) link.getUserObject(), link);
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.UserRequest in project openolat by klemens.
the class CloneController 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(UserRequest ureq, Component source, Event event) {
if (source == mainVC) {
if (event.getCommand().equals(CMD_CLONE)) {
// clone request
// TODO:pb: -> link component add new method / rename setTarget() to setPopupeable()
// setPopup() -> deactivate AJAX on link
ControllerCreator cloneControllerCreator = new ControllerCreator() {
@SuppressWarnings("synthetic-access")
public Controller createController(UserRequest lureq, WindowControl lwControl) {
return readyToCloneC.cloneController(lureq, lwControl);
}
};
ControllerCreator newWindowContent;
if (layoutCreator != null) {
// wrap with layout
newWindowContent = layoutCreator.createLayoutControllerCreator(ureq, cloneControllerCreator);
} else {
// use default layout
newWindowContent = cloneControllerCreator;
}
// open in new window
openInNewBrowserWindow(ureq, newWindowContent);
return;
}
}
}
Aggregations