Search in sources :

Example 11 with StepsMainRunController

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

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

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

the class QTIEditorMainController method doImportTable.

private void doImportTable(UserRequest ureq) {
    removeAsListenerAndDispose(importTableWizard);
    final ItemsPackage importPackage = new ItemsPackage();
    final ImportOptions options = new ImportOptions();
    options.setShuffle(!qtiPackage.getQTIDocument().isSurvey());
    Step start = new QImport_1_InputStep(ureq, importPackage, options, null);
    StepRunnerCallback finish = new StepRunnerCallback() {

        @Override
        public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
            runContext.put("importPackage", importPackage);
            return StepsMainRunController.DONE_MODIFIED;
        }
    };
    importTableWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("tools.import.table"), "o_mi_table_import_wizard");
    listenTo(importTableWizard);
    getWindowControl().pushAsModalDialog(importTableWizard.getInitialComponent());
}
Also used : StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) QImport_1_InputStep(org.olat.ims.qti.questionimport.QImport_1_InputStep) 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) ItemsPackage(org.olat.ims.qti.questionimport.ItemsPackage) ImportOptions(org.olat.ims.qti.questionimport.ImportOptions) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback) UserRequest(org.olat.core.gui.UserRequest) QImport_1_InputStep(org.olat.ims.qti.questionimport.QImport_1_InputStep)

Example 13 with StepsMainRunController

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

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

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

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

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

the class LDAPAdminController 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 == syncStartLink) {
        // Start sync job
        // Disable start link during sync
        syncStartLink.setEnabled(false);
        LDAPEvent ldapEvent = new LDAPEvent(LDAPEvent.DO_SYNCHING);
        CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(ldapEvent, LDAPLoginManager.ldapSyncLockOres);
        showInfo("admin.synchronize.started");
    } else if (source == syncOneUserLink) {
        userSearchCtrl = new UserSearchController(ureq, getWindowControl(), false);
        listenTo(userSearchCtrl);
        calloutCtr = new CloseableCalloutWindowController(ureq, getWindowControl(), userSearchCtrl.getInitialComponent(), syncOneUserLink, null, true, null);
        calloutCtr.addDisposableChildController(userSearchCtrl);
        calloutCtr.activate();
        listenTo(calloutCtr);
    } else if (source == deletStartLink) {
        // cancel if some one else is making sync or delete job
        if (!ldapLoginManager.acquireSyncLock()) {
            showError("delete.error.lock");
        } else {
            deletStartLink.setEnabled(false);
            // check and get LDAP connection
            LdapContext ctx = ldapLoginManager.bindSystem();
            if (ctx == null) {
                showError("delete.error.connection");
                return;
            }
            // get deleted users
            identitiesToDelete = ldapLoginManager.getIdentitysDeletedInLdap(ctx);
            try {
                ctx.close();
            } catch (NamingException e) {
                showError("delete.error.connection.close");
                logError("Could not close LDAP connection on manual delete sync", e);
            }
            if (identitiesToDelete != null && identitiesToDelete.size() != 0) {
                hasIdentitiesToDelete = true;
                /*
					 * start step which spawns the whole wizard
					 */
                Step start = new DeletStep00(ureq, hasIdentitiesToDelete, identitiesToDelete);
                /*
					 * wizard finish callback called after "finish" is called
					 */
                StepRunnerCallback finishCallback = new StepRunnerCallback() {

                    public Step execute(UserRequest uureq, WindowControl control, StepsRunContext runContext) {
                        hasIdentitiesToDeleteAfterRun = ((Boolean) runContext.get("hasIdentitiesToDelete")).booleanValue();
                        if (hasIdentitiesToDeleteAfterRun) {
                            @SuppressWarnings("unchecked") List<Identity> idToDelete = (List<Identity>) runContext.get("identitiesToDelete");
                            amountUsersToDelete = idToDelete.size();
                            // Delete all identities now and tell everybody that
                            // we are finished
                            ldapLoginManager.deletIdentities(idToDelete);
                            return StepsMainRunController.DONE_MODIFIED;
                        } else {
                            return StepsMainRunController.DONE_UNCHANGED;
                        }
                    // otherwise return without deleting anything
                    }
                };
                deleteStepController = new StepsMainRunController(ureq, getWindowControl(), start, finishCallback, null, translate("admin.deleteUser.title"), "o_sel_ldap_delete_user_wizard");
                listenTo(deleteStepController);
                getWindowControl().pushAsModalDialog(deleteStepController.getInitialComponent());
            } else {
                hasIdentitiesToDelete = false;
                showInfo("delete.step.noUsers");
                deletStartLink.setEnabled(true);
                ldapLoginManager.freeSyncLock();
            }
        }
    } else if (source == removeFallBackAuthsLink) {
        removeFallBackAuthsLink.setEnabled(false);
        ldapLoginManager.removeFallBackAuthentications();
        showInfo("opsuccess");
    }
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) Step(org.olat.core.gui.control.generic.wizard.Step) UserSearchController(org.olat.admin.user.UserSearchController) WindowControl(org.olat.core.gui.control.WindowControl) StepsRunContext(org.olat.core.gui.control.generic.wizard.StepsRunContext) LDAPEvent(org.olat.ldap.LDAPEvent) NamingException(javax.naming.NamingException) List(java.util.List) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) Identity(org.olat.core.id.Identity) LdapContext(javax.naming.ldap.LdapContext) 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