use of org.olat.core.gui.control.generic.wizard.StepRunnerCallback in project openolat by klemens.
the class CourseHandler method createWizardController.
@Override
public StepsMainRunController createWizardController(OLATResourceable res, UserRequest ureq, WindowControl wControl) {
// load the course structure
final RepositoryEntry repoEntry = (RepositoryEntry) res;
ICourse course = CourseFactory.loadCourse(repoEntry);
Translator cceTranslator = Util.createPackageTranslator(CourseCreationHelper.class, ureq.getLocale());
final CourseCreationConfiguration courseConfig = new CourseCreationConfiguration(course.getCourseTitle(), Settings.getServerContextPathURI() + "/url/RepositoryEntry/" + repoEntry.getKey());
// wizard finish callback called after "finish" is called
final CourseCreationHelper ccHelper = new CourseCreationHelper(ureq.getLocale(), repoEntry, courseConfig, course);
StepRunnerCallback finishCallback = new StepRunnerCallback() {
public Step execute(UserRequest uureq, WindowControl control, StepsRunContext runContext) {
// retrieve access and properties
CourseAccessAndProperties accessAndProps = (CourseAccessAndProperties) runContext.get("accessAndProperties");
courseConfig.setAccessAndProperties(accessAndProps);
// here goes the code which reads out the wizards data from the runContext and then does some wizardry
ccHelper.finalizeWorkflow(uureq);
control.setInfo(CourseCreationMailHelper.getSuccessMessageString(uureq));
// send notification mail
final MailerResult mr = CourseCreationMailHelper.sentNotificationMail(uureq, ccHelper.getConfiguration());
MailHelper.printErrorsAndWarnings(mr, control, uureq.getUserSession().getRoles().isOLATAdmin(), uureq.getLocale());
return StepsMainRunController.DONE_MODIFIED;
}
};
Step start = new CcStep00(ureq, courseConfig, repoEntry);
StepsMainRunController ccSMRC = new StepsMainRunController(ureq, wControl, start, finishCallback, null, cceTranslator.translate("coursecreation.title"), "o_sel_course_create_wizard");
return ccSMRC;
}
use of org.olat.core.gui.control.generic.wizard.StepRunnerCallback in project openolat by klemens.
the class RepositoryMembersController method doImportMembers.
private void doImportMembers(UserRequest ureq) {
removeAsListenerAndDispose(importMembersWizard);
Step start = new ImportMember_1a_LoginListStep(ureq, repoEntry, null, false);
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_group_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 ArtefactWizzardStepsController method initCollectionStepWizzard.
private void initCollectionStepWizzard(UserRequest ureq) {
if (artefact == null && ores != null)
prepareNewArtefact();
Step start = new EPCollectStep00(ureq, artefact);
StepRunnerCallback finish = new EPArtefactWizzardStepCallback(tmpFolder);
collectStepsCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("collect.wizzard.title"), "o_sel_artefact_add_wizard");
listenTo(collectStepsCtrl);
getWindowControl().pushAsModalDialog(collectStepsCtrl.getInitialComponent());
}
use of org.olat.core.gui.control.generic.wizard.StepRunnerCallback in project openolat by klemens.
the class EPAddArtefactController method prepareFileArtefactWizzard.
/**
* prepare a file artefact and open with wizzard initialized with a special
* first step for file-artefacts
*
* @param ureq
*/
private void prepareFileArtefactWizzard(UserRequest ureq) {
EPArtefactHandler<?> artHandler = portfolioModule.getArtefactHandler(FileArtefact.FILE_ARTEFACT_TYPE);
AbstractArtefact artefact1 = artHandler.createArtefact();
artefact1.setAuthor(getIdentity());
artefact1.setSource(translate("file.artefact.source.info"));
artefact1.setCollectionDate(new Date());
artefact1.setSignature(-30);
vfsTemp = ePFMgr.getArtefactsTempContainer(getIdentity());
Step start = new EPCreateFileArtefactStep00(ureq, artefact1, preSelectedStruct, vfsTemp);
StepRunnerCallback finish = new EPArtefactWizzardStepCallback(vfsTemp);
collectStepsCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("create.file.artefact.wizzard.title"), "o_sel_artefact_add_wizard o_sel_artefact_add_file_wizard");
listenTo(collectStepsCtrl);
getWindowControl().pushAsModalDialog(collectStepsCtrl.getInitialComponent());
}
use of org.olat.core.gui.control.generic.wizard.StepRunnerCallback in project openolat by klemens.
the class EPAddArtefactController method prepareNewTextArtefactWizzard.
/**
* prepare a new text artefact and open with wizzard initialized with a
* special first step for text-artefacts
*
* @param ureq
*/
private void prepareNewTextArtefactWizzard(UserRequest ureq) {
EPArtefactHandler<?> artHandler = portfolioModule.getArtefactHandler(EPTextArtefact.TEXT_ARTEFACT_TYPE);
AbstractArtefact artefact1 = artHandler.createArtefact();
artefact1.setAuthor(getIdentity());
artefact1.setSource(translate("text.artefact.source.info"));
artefact1.setCollectionDate(new Date());
artefact1.setSignature(-20);
vfsTemp = ePFMgr.getArtefactsTempContainer(getIdentity());
Step start = new EPCreateTextArtefactStep00(ureq, artefact1, preSelectedStruct, vfsTemp);
StepRunnerCallback finish = new EPArtefactWizzardStepCallback(vfsTemp);
collectStepsCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("create.text.artefact.wizzard.title"), "o_sel_artefact_add_wizard o_sel_artefact_add_text_wizard");
listenTo(collectStepsCtrl);
getWindowControl().pushAsModalDialog(collectStepsCtrl.getInitialComponent());
}
Aggregations