Search in sources :

Example 56 with StepsMainRunController

use of org.olat.core.gui.control.generic.wizard.StepsMainRunController 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 57 with StepsMainRunController

use of org.olat.core.gui.control.generic.wizard.StepsMainRunController 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)

Example 58 with StepsMainRunController

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

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 59 with StepsMainRunController

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

the class RepositoryMembersController method doChooseMembers.

private void doChooseMembers(UserRequest ureq) {
    removeAsListenerAndDispose(importMembersWizard);
    Step start = new ImportMember_1b_ChooseMemberStep(ureq, repoEntry, null, false);
    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_group_import_1_wizard");
    listenTo(importMembersWizard);
    getWindowControl().pushAsModalDialog(importMembersWizard.getInitialComponent());
}
Also used : ImportMember_1b_ChooseMemberStep(org.olat.course.member.wizard.ImportMember_1b_ChooseMemberStep) 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) 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 60 with StepsMainRunController

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

the class EPAddArtefactController method prepareNewLiveBlogArtefactWizzard.

private void prepareNewLiveBlogArtefactWizzard(UserRequest ureq) {
    EPArtefactHandler<?> artHandler = portfolioModule.getArtefactHandler(LiveBlogArtefact.TYPE);
    AbstractArtefact artefact1 = artHandler.createArtefact();
    artefact1.setAuthor(getIdentity());
    artefact1.setCollectionDate(new Date());
    // preset as signed by 60%
    artefact1.setSignature(60);
    Step start = new EPCreateLiveBlogArtefactStep00(ureq, preSelectedStruct, artefact1);
    // no vfsTemp!, blog doesn't need a directory
    StepRunnerCallback finish = new EPArtefactWizzardStepCallback();
    collectStepsCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("create.blog.artefact.wizzard.title"), "o_sel_artefact_add_wizard o_sel_artefact_add_blog_wizard");
    listenTo(collectStepsCtrl);
    getWindowControl().pushAsModalDialog(collectStepsCtrl.getInitialComponent());
}
Also used : EPCreateLiveBlogArtefactStep00(org.olat.modules.webFeed.portfolio.EPCreateLiveBlogArtefactStep00) 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

StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)72 Step (org.olat.core.gui.control.generic.wizard.Step)70 StepRunnerCallback (org.olat.core.gui.control.generic.wizard.StepRunnerCallback)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