use of org.olat.core.gui.control.generic.wizard.StepsRunContext in project OpenOLAT by OpenOLAT.
the class AssessmentTestComposerController method doImportTable.
private void doImportTable(UserRequest ureq) {
removeAsListenerAndDispose(importTableWizard);
final AssessmentItemsPackage importPackage = new AssessmentItemsPackage();
final ImportOptions options = new ImportOptions();
options.setShuffle(!survey);
Step start = new QImport_1_InputStep(ureq, importPackage, options, null);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
runContext.put("importPackage", importPackage);
return StepsMainRunController.DONE_MODIFIED;
}
};
importTableWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("tools.import.table"), "o_mi_table_import_wizard");
listenTo(importTableWizard);
getWindowControl().pushAsModalDialog(importTableWizard.getInitialComponent());
}
use of org.olat.core.gui.control.generic.wizard.StepsRunContext in project OpenOLAT by OpenOLAT.
the class BulkAssessmentOverviewController method doEditBulkAssessment.
private void doEditBulkAssessment(UserRequest ureq, TaskData data) {
removeAsListenerAndDispose(bulkAssessmentCtrl);
if (editedTask != null) {
// only for security purpose
taskManager.returnTaskAfterEdition(editedTask, null);
}
AssessableCourseNode courseNode = data.getCourseNode();
final Task editableTask = taskManager.pickTaskForEdition(data.getTask());
editedTask = editableTask;
if (editableTask == null) {
showWarning("task.edited");
} else {
BulkAssessmentTask runnable = taskManager.getPersistedRunnableTask(editableTask, BulkAssessmentTask.class);
BulkAssessmentDatas datas = runnable.getDatas();
Step start = new BulkAssessment_2_DatasStep(ureq, courseNode, datas, editableTask);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
Task task = (Task) runContext.get("task");
Date scheduledDate = (Date) runContext.get("scheduledDate");
AssessableCourseNode assessableCourseNode = (AssessableCourseNode) runContext.get("courseNode");
BulkAssessmentDatas bulkDatas = (BulkAssessmentDatas) runContext.get("datas");
Feedback feedback = doUpdateBulkAssessment(task, assessableCourseNode, scheduledDate, bulkDatas);
runContext.put("feedback", feedback);
editedTask = null;
return StepsMainRunController.DONE_MODIFIED;
}
};
StepRunnerCallback cancel = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
taskManager.returnTaskAfterEdition(editableTask, null);
editedTask = null;
return Step.NOSTEP;
}
};
bulkAssessmentCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, cancel, translate("bulk.wizard.title"), "o_sel_bulk_assessment_wizard");
listenTo(bulkAssessmentCtrl);
getWindowControl().pushAsModalDialog(bulkAssessmentCtrl.getInitialComponent());
}
}
use of org.olat.core.gui.control.generic.wizard.StepsRunContext in project OpenOLAT by OpenOLAT.
the class MembersOverviewController method doChooseMembers.
private void doChooseMembers(UserRequest ureq) {
removeAsListenerAndDispose(importMembersWizard);
Step start = new ImportMember_1b_ChooseMemberStep(ureq, repoEntry, null, overrideManaged);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
addMembers(uureq, runContext);
return StepsMainRunController.DONE_MODIFIED;
}
};
importMembersWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("add.member"), "o_sel_course_member_import_1_wizard");
listenTo(importMembersWizard);
getWindowControl().pushAsModalDialog(importMembersWizard.getInitialComponent());
}
use of org.olat.core.gui.control.generic.wizard.StepsRunContext in project OpenOLAT by OpenOLAT.
the class MembersOverviewController method doImportMembers.
private void doImportMembers(UserRequest ureq) {
removeAsListenerAndDispose(importMembersWizard);
Step start = new ImportMember_1a_LoginListStep(ureq, repoEntry, null, overrideManaged);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
addMembers(uureq, runContext);
if (runContext.containsKey("notFounds")) {
showWarning("user.notfound", runContext.get("notFounds").toString());
}
return StepsMainRunController.DONE_MODIFIED;
}
};
importMembersWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("import.member"), "o_sel_course_member_import_logins_wizard");
listenTo(importMembersWizard);
getWindowControl().pushAsModalDialog(importMembersWizard.getInitialComponent());
}
use of org.olat.core.gui.control.generic.wizard.StepsRunContext in project OpenOLAT by OpenOLAT.
the class GuiDemoStepsRunner 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 == startLink) {
/*
* start step which spawns the whole wizard
*/
Step start = new StartStepImpl(ureq);
/*
* wizard finish callback called after "finish" is called
*/
StepRunnerCallback finishCallback = new StepRunnerCallback() {
public Step execute(UserRequest ureq2, WindowControl control, StepsRunContext runContext) {
// finishing
return StepsMainRunController.DONE_UNCHANGED;
}
};
smrc = new StepsMainRunController(ureq, getWindowControl(), start, finishCallback, null, "A Workflow", "o_sel_demo_wizard");
listenTo(smrc);
getWindowControl().pushAsModalDialog(smrc.getInitialComponent());
}
}
Aggregations