use of org.olat.core.gui.control.generic.wizard.StepRunnerCallback in project openolat by klemens.
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.StepRunnerCallback in project openolat by klemens.
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.StepRunnerCallback in project openolat by klemens.
the class BulkAssessmentOverviewController method doNewBulkAssessment.
private void doNewBulkAssessment(UserRequest ureq) {
removeAsListenerAndDispose(bulkAssessmentCtrl);
List<AssessableCourseNode> nodes = new ArrayList<>();
ICourse course = CourseFactory.loadCourse(courseEntry);
collectBulkAssessableCourseNode(course.getRunStructure().getRootNode(), nodes);
Step start;
if (nodes.size() > 1) {
start = new BulkAssessment_1_SelectCourseNodeStep(ureq, courseEntry);
} else if (nodes.size() == 1) {
start = new BulkAssessment_2_DatasStep(ureq, nodes.get(0));
} else {
showWarning("bulk.action.no.coursenodes");
return;
}
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
Date scheduledDate = (Date) runContext.get("scheduledDate");
AssessableCourseNode courseNode = (AssessableCourseNode) runContext.get("courseNode");
BulkAssessmentDatas datas = (BulkAssessmentDatas) runContext.get("datas");
Feedback feedback = doBulkAssessment(courseNode, scheduledDate, datas);
runContext.put("feedback", feedback);
return StepsMainRunController.DONE_MODIFIED;
}
};
bulkAssessmentCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("bulk.wizard.title"), "o_sel_bulk_assessment_wizard");
listenTo(bulkAssessmentCtrl);
getWindowControl().pushAsModalDialog(bulkAssessmentCtrl.getInitialComponent());
}
use of org.olat.core.gui.control.generic.wizard.StepRunnerCallback in project openolat by klemens.
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.StepRunnerCallback in project openolat by klemens.
the class AbstractBusinessGroupListController method doMerge.
/**
* @param ureq
* @param items
*/
private void doMerge(UserRequest ureq, List<? extends BusinessGroupRef> selectedItems) {
removeAsListenerAndDispose(businessGroupWizard);
if (selectedItems == null || selectedItems.size() < 2) {
showWarning("error.select.one");
return;
}
final List<BusinessGroup> groups = toBusinessGroups(ureq, selectedItems, true);
if (groups.size() < 2) {
showWarning("msg.alleasttwo.editable.group");
return;
}
if (selectedItems.size() != groups.size()) {
showWarning("msg.only.editable.group");
return;
}
StringBuilder managedNames = new StringBuilder();
for (BusinessGroup group : groups) {
String gname = group.getName() == null ? "???" : StringHelper.escapeHtml(group.getName());
if (StringHelper.containsNonWhitespace(group.getManagedFlagsString())) {
if (managedNames.length() > 0)
managedNames.append(", ");
managedNames.append(gname);
}
}
if (managedNames.length() > 0) {
showWarning("error.managed.group", managedNames.toString());
return;
}
Step start = new BGMergeStep(ureq, groups);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
BusinessGroup targetGroup = (BusinessGroup) runContext.get("targetGroup");
groups.remove(targetGroup);
businessGroupService.mergeBusinessGroups(getIdentity(), targetGroup, groups, null);
return StepsMainRunController.DONE_MODIFIED;
}
};
businessGroupWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("merge.group"), "o_sel_groups_merge_wizard");
listenTo(businessGroupWizard);
getWindowControl().pushAsModalDialog(businessGroupWizard.getInitialComponent());
}
Aggregations