Search in sources :

Example 51 with StepRunnerCallback

use of org.olat.core.gui.control.generic.wizard.StepRunnerCallback 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());
}
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 52 with StepRunnerCallback

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

use of org.olat.core.gui.control.generic.wizard.StepRunnerCallback in project OpenOLAT by OpenOLAT.

the class QuestionListController method doChooseAuthors.

private void doChooseAuthors(UserRequest ureq, List<QuestionItemShort> items) {
    removeAsListenerAndDispose(importAuthorsWizard);
    Step start = new ImportAuthor_1_ChooseMemberStep(ureq, items);
    StepRunnerCallback finish = new StepRunnerCallback() {

        @Override
        public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
            addAuthors(runContext);
            return StepsMainRunController.DONE_MODIFIED;
        }
    };
    importAuthorsWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("author.item"), "o_sel_qpool_import_1_wizard");
    listenTo(importAuthorsWizard);
    getWindowControl().pushAsModalDialog(importAuthorsWizard.getInitialComponent());
}
Also used : ImportAuthor_1_ChooseMemberStep(org.olat.modules.qpool.ui.wizard.ImportAuthor_1_ChooseMemberStep) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) QImport_1_InputStep(org.olat.ims.qti21.questionimport.QImport_1_InputStep) Step(org.olat.core.gui.control.generic.wizard.Step) Export_1_TypeStep(org.olat.modules.qpool.ui.wizard.Export_1_TypeStep) ImportAuthor_1_ChooseMemberStep(org.olat.modules.qpool.ui.wizard.ImportAuthor_1_ChooseMemberStep) 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 54 with StepRunnerCallback

use of org.olat.core.gui.control.generic.wizard.StepRunnerCallback in project OpenOLAT by OpenOLAT.

the class QuestionListController method doOpenExcelImportQTI12.

private void doOpenExcelImportQTI12(UserRequest ureq) {
    removeAsListenerAndDispose(excelImportWizard);
    final ItemsPackage importPackage = new ItemsPackage();
    Step additionalStep = null;
    if (getSource().askEditable()) {
        additionalStep = new EditableStep(ureq);
    }
    final org.olat.ims.qti.questionimport.ImportOptions options = new org.olat.ims.qti.questionimport.ImportOptions();
    options.setShuffle(true);
    Step start = new org.olat.ims.qti.questionimport.QImport_1_InputStep(ureq, importPackage, options, additionalStep);
    StepRunnerCallback finish = new StepRunnerCallback() {

        @Override
        public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
            List<ItemAndMetadata> itemsToImport = importPackage.getItems();
            QTIQPoolServiceProvider spi = CoreSpringFactory.getImpl(QTIQPoolServiceProvider.class);
            List<QuestionItem> importItems = spi.importBeecomItem(getIdentity(), itemsToImport, getLocale());
            for (QuestionItem item : importItems) {
                QuestionItemAuditLogBuilder builder = qpoolService.createAuditLogBuilder(getIdentity(), Action.CREATE_QUESTION_ITEM_BY_IMPORT);
                builder.withAfter(item);
                qpoolService.persist(builder.create());
            }
            boolean editable = true;
            if (getSource().askEditable()) {
                Object editableCtx = runContext.get("editable");
                editable = (editableCtx instanceof Boolean) ? ((Boolean) editableCtx).booleanValue() : false;
            }
            qpoolService.index(importItems);
            int postImported = getSource().postImport(importItems, editable);
            if (postImported > 0) {
                getItemsTable().reset();
            }
            return StepsMainRunController.DONE_MODIFIED;
        }
    };
    excelImportWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("import.excellike.12"), "o_sel_qpool_excel_import_wizard");
    listenTo(excelImportWizard);
    getWindowControl().pushAsModalDialog(excelImportWizard.getInitialComponent());
}
Also used : QImport_1_InputStep(org.olat.ims.qti21.questionimport.QImport_1_InputStep) Step(org.olat.core.gui.control.generic.wizard.Step) Export_1_TypeStep(org.olat.modules.qpool.ui.wizard.Export_1_TypeStep) ImportAuthor_1_ChooseMemberStep(org.olat.modules.qpool.ui.wizard.ImportAuthor_1_ChooseMemberStep) WindowControl(org.olat.core.gui.control.WindowControl) StepsRunContext(org.olat.core.gui.control.generic.wizard.StepsRunContext) QImport_1_InputStep(org.olat.ims.qti21.questionimport.QImport_1_InputStep) QTIQPoolServiceProvider(org.olat.ims.qti.qpool.QTIQPoolServiceProvider) UserRequest(org.olat.core.gui.UserRequest) AssessmentItemsPackage(org.olat.ims.qti21.questionimport.AssessmentItemsPackage) ItemsPackage(org.olat.ims.qti.questionimport.ItemsPackage) QuestionItemAuditLogBuilder(org.olat.modules.qpool.QuestionItemAuditLogBuilder) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) AssessmentItemAndMetadata(org.olat.ims.qti21.questionimport.AssessmentItemAndMetadata) ItemAndMetadata(org.olat.ims.qti.questionimport.ItemAndMetadata) QuestionItem(org.olat.modules.qpool.QuestionItem) ImportOptions(org.olat.ims.qti21.questionimport.ImportOptions) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback)

Example 55 with StepRunnerCallback

use of org.olat.core.gui.control.generic.wizard.StepRunnerCallback in project openolat by klemens.

the class QuestionListController method doExport.

private void doExport(UserRequest ureq, List<QuestionItemShort> items) {
    removeAsListenerAndDispose(exportWizard);
    Step start = new Export_1_TypeStep(ureq, items);
    StepRunnerCallback finish = new StepRunnerCallback() {

        @Override
        public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
            return StepsMainRunController.DONE_MODIFIED;
        }
    };
    exportWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("export.item"), "o_sel_qpool_export_1_wizard");
    listenTo(exportWizard);
    getWindowControl().pushAsModalDialog(exportWizard.getInitialComponent());
}
Also used : Export_1_TypeStep(org.olat.modules.qpool.ui.wizard.Export_1_TypeStep) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) QImport_1_InputStep(org.olat.ims.qti21.questionimport.QImport_1_InputStep) Step(org.olat.core.gui.control.generic.wizard.Step) Export_1_TypeStep(org.olat.modules.qpool.ui.wizard.Export_1_TypeStep) ImportAuthor_1_ChooseMemberStep(org.olat.modules.qpool.ui.wizard.ImportAuthor_1_ChooseMemberStep) 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)

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