Search in sources :

Example 26 with StepRunnerCallback

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;
}
Also used : CcStep00(de.tuchemnitz.wizard.workflows.coursecreation.steps.CcStep00) MailerResult(org.olat.core.util.mail.MailerResult) CourseCreationHelper(de.tuchemnitz.wizard.workflows.coursecreation.CourseCreationHelper) ICourse(org.olat.course.ICourse) RepositoryEntry(org.olat.repository.RepositoryEntry) Step(org.olat.core.gui.control.generic.wizard.Step) WindowControl(org.olat.core.gui.control.WindowControl) StepsRunContext(org.olat.core.gui.control.generic.wizard.StepsRunContext) CourseAccessAndProperties(org.olat.course.editor.CourseAccessAndProperties) Translator(org.olat.core.gui.translator.Translator) CourseCreationConfiguration(de.tuchemnitz.wizard.workflows.coursecreation.model.CourseCreationConfiguration) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback) UserRequest(org.olat.core.gui.UserRequest)

Example 27 with StepRunnerCallback

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());
}
Also used : StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) ImportMember_1a_LoginListStep(org.olat.course.member.wizard.ImportMember_1a_LoginListStep) Step(org.olat.core.gui.control.generic.wizard.Step) ImportMember_1b_ChooseMemberStep(org.olat.course.member.wizard.ImportMember_1b_ChooseMemberStep) ImportMember_1a_LoginListStep(org.olat.course.member.wizard.ImportMember_1a_LoginListStep) WindowControl(org.olat.core.gui.control.WindowControl) StepsRunContext(org.olat.core.gui.control.generic.wizard.StepsRunContext) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback) UserRequest(org.olat.core.gui.UserRequest)

Example 28 with StepRunnerCallback

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());
}
Also used : StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) Step(org.olat.core.gui.control.generic.wizard.Step) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback)

Example 29 with StepRunnerCallback

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());
}
Also used : AbstractArtefact(org.olat.portfolio.model.artefacts.AbstractArtefact) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) Step(org.olat.core.gui.control.generic.wizard.Step) Date(java.util.Date) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback)

Example 30 with StepRunnerCallback

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());
}
Also used : AbstractArtefact(org.olat.portfolio.model.artefacts.AbstractArtefact) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) Step(org.olat.core.gui.control.generic.wizard.Step) Date(java.util.Date) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback)

Aggregations

Step (org.olat.core.gui.control.generic.wizard.Step)70 StepRunnerCallback (org.olat.core.gui.control.generic.wizard.StepRunnerCallback)70 StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)70 StepsRunContext (org.olat.core.gui.control.generic.wizard.StepsRunContext)58 UserRequest (org.olat.core.gui.UserRequest)56 WindowControl (org.olat.core.gui.control.WindowControl)56 ArrayList (java.util.ArrayList)14 Date (java.util.Date)12 List (java.util.List)12 ImportMember_1a_LoginListStep (org.olat.course.member.wizard.ImportMember_1a_LoginListStep)12 ImportMember_1b_ChooseMemberStep (org.olat.course.member.wizard.ImportMember_1b_ChooseMemberStep)12 Identity (org.olat.core.id.Identity)10 QImport_1_InputStep (org.olat.ims.qti21.questionimport.QImport_1_InputStep)10 BusinessGroup (org.olat.group.BusinessGroup)8 BGConfigBusinessGroup (org.olat.group.ui.wizard.BGConfigBusinessGroup)8 BGConfigToolsStep (org.olat.group.ui.wizard.BGConfigToolsStep)8 BGCopyBusinessGroup (org.olat.group.ui.wizard.BGCopyBusinessGroup)8 BGCopyPreparationStep (org.olat.group.ui.wizard.BGCopyPreparationStep)8 BGEmailSelectReceiversStep (org.olat.group.ui.wizard.BGEmailSelectReceiversStep)8 BGMergeStep (org.olat.group.ui.wizard.BGMergeStep)8