Search in sources :

Example 26 with StepsMainRunController

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

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

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

Example 29 with StepsMainRunController

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

the class BulkAssessmentToolController method doOpen.

private void doOpen(UserRequest ureq) {
    StepRunnerCallback finish = new StepRunnerCallback() {

        @Override
        public Step execute(UserRequest uureq, WindowControl bwControl, StepsRunContext runContext) {
            Date scheduledDate = (Date) runContext.get("scheduledDate");
            BulkAssessmentDatas datas = (BulkAssessmentDatas) runContext.get("datas");
            Feedback feedback = doBulkAssessment(scheduledDate, datas);
            runContext.put("feedback", feedback);
            return StepsMainRunController.DONE_MODIFIED;
        }
    };
    Step start = new BulkAssessment_2_DatasStep(ureq, courseNode);
    bulkAssessmentCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("bulk.wizard.title"), "o_sel_bulk_assessment_wizard");
    listenTo(bulkAssessmentCtrl);
    getWindowControl().pushAsModalDialog(bulkAssessmentCtrl.getInitialComponent());
}
Also used : BulkAssessmentDatas(org.olat.course.assessment.model.BulkAssessmentDatas) BulkAssessmentFeedback(org.olat.course.assessment.model.BulkAssessmentFeedback) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) 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) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback) UserRequest(org.olat.core.gui.UserRequest) Date(java.util.Date)

Example 30 with StepsMainRunController

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

the class AbstractBusinessGroupListController method doConfiguration.

/**
 * @param ureq
 * @param items
 */
private void doConfiguration(UserRequest ureq, List<? extends BusinessGroupRef> selectedItems) {
    removeAsListenerAndDispose(businessGroupWizard);
    if (selectedItems == null || selectedItems.isEmpty()) {
        showWarning("error.select.one");
        return;
    }
    final List<BusinessGroup> groups = toBusinessGroups(ureq, selectedItems, true);
    if (groups.isEmpty()) {
        showWarning("msg.alleastone.editable.group");
        return;
    }
    if (selectedItems.size() != groups.size()) {
        showWarning("msg.only.editable.group");
        return;
    }
    if (CollaborationToolsFactory.getInstance().getAvailableTools() == null) {
        // init the available tools
        CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(groups.get(0));
    }
    StringBuilder managedNames = new StringBuilder();
    for (BusinessGroup group : groups) {
        String gname = group.getName() == null ? "???" : group.getName();
        if (BusinessGroupManagedFlag.isManaged(group, BusinessGroupManagedFlag.resources) || BusinessGroupManagedFlag.isManaged(group, BusinessGroupManagedFlag.tools)) {
            if (managedNames.length() > 0)
                managedNames.append(", ");
            managedNames.append(gname);
        }
    }
    if (managedNames.length() > 0) {
        showWarning("error.managed.group", managedNames.toString());
        return;
    }
    boolean isAuthor = ureq.getUserSession().getRoles().isAuthor() || ureq.getUserSession().getRoles().isInstitutionalResourceManager();
    Step start = new BGConfigToolsStep(ureq, isAuthor);
    StepRunnerCallback finish = new StepRunnerCallback() {

        @Override
        public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
            // configuration
            BGConfigBusinessGroup configuration = (BGConfigBusinessGroup) runContext.get("configuration");
            if (!configuration.getToolsToEnable().isEmpty() || !configuration.getToolsToDisable().isEmpty()) {
                for (BusinessGroup group : groups) {
                    CollaborationTools tools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(group);
                    for (String enabledTool : configuration.getToolsToEnable()) {
                        tools.setToolEnabled(enabledTool, true);
                        if (CollaborationTools.TOOL_FOLDER.equals(enabledTool)) {
                            tools.saveFolderAccess(new Long(configuration.getFolderAccess()));
                            Quota quota = configuration.getQuota();
                            if (quota != null) {
                                String path = tools.getFolderRelPath();
                                Quota fQuota = QuotaManager.getInstance().createQuota(path, quota.getQuotaKB(), quota.getUlLimitKB());
                                QuotaManager.getInstance().setCustomQuotaKB(fQuota);
                            }
                        } else if (CollaborationTools.TOOL_CALENDAR.equals(enabledTool)) {
                            tools.saveCalendarAccess(new Long(configuration.getCalendarAccess()));
                        }
                    }
                    for (String disabledTool : configuration.getToolsToDisable()) {
                        tools.setToolEnabled(disabledTool, false);
                    }
                }
            }
            if (configuration.getResources() != null && !configuration.getResources().isEmpty()) {
                businessGroupService.addResourcesTo(groups, configuration.getResources());
            }
            return StepsMainRunController.DONE_MODIFIED;
        }
    };
    businessGroupWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("config.group"), "o_sel_groups_config_wizard");
    listenTo(businessGroupWizard);
    getWindowControl().pushAsModalDialog(businessGroupWizard.getInitialComponent());
}
Also used : BGConfigBusinessGroup(org.olat.group.ui.wizard.BGConfigBusinessGroup) BGCopyBusinessGroup(org.olat.group.ui.wizard.BGCopyBusinessGroup) BGConfigBusinessGroup(org.olat.group.ui.wizard.BGConfigBusinessGroup) BusinessGroup(org.olat.group.BusinessGroup) Step(org.olat.core.gui.control.generic.wizard.Step) BGCopyPreparationStep(org.olat.group.ui.wizard.BGCopyPreparationStep) BGMergeStep(org.olat.group.ui.wizard.BGMergeStep) BGConfigToolsStep(org.olat.group.ui.wizard.BGConfigToolsStep) BGEmailSelectReceiversStep(org.olat.group.ui.wizard.BGEmailSelectReceiversStep) WindowControl(org.olat.core.gui.control.WindowControl) StepsRunContext(org.olat.core.gui.control.generic.wizard.StepsRunContext) Quota(org.olat.core.util.vfs.Quota) BGConfigToolsStep(org.olat.group.ui.wizard.BGConfigToolsStep) CollaborationTools(org.olat.collaboration.CollaborationTools) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback) UserRequest(org.olat.core.gui.UserRequest)

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