Search in sources :

Example 21 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class EPMapRunController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == createMapLink) {
        // if only normal maps can be created, show popup immediately, else present selection in callout
        if (option.equals(EPMapRunViewOption.MY_DEFAULTS_MAPS)) {
            VelocityContainer mapCreateVC = createVelocityContainer("createMapCallout");
            createMapCalloutLink = LinkFactory.createLink("create.map.default", mapCreateVC, this);
            createMapCalloutLink.setElementCssClass("o_sel_create_default_map");
            createMapFromTemplateLink = LinkFactory.createLink("create.map.fromTemplate", mapCreateVC, this);
            createMapFromTemplateLink.setElementCssClass("o_sel_create_template_map");
            String title = translate("create.map");
            removeAsListenerAndDispose(mapCreateCalloutCtrl);
            mapCreateCalloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), mapCreateVC, createMapLink, title, true, null);
            listenTo(mapCreateCalloutCtrl);
            mapCreateCalloutCtrl.activate();
        } else {
            popUpCreateMapBox(ureq);
        }
    } else if (source == createMapFromTemplateLink) {
        closeCreateMapCallout();
        popUpCreateMapFromTemplateBox(ureq);
    } else if (source == createMapCalloutLink) {
        closeCreateMapCallout();
        popUpCreateMapBox(ureq);
    }
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Example 22 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class GuiDemoFlexiFormSubworkflow method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == choose) {
        // choose link clicked
        // show a subworkflow in a modal dialog without loosing fromdata
        // 
        // work around to disable orange button and alert box of "unsubmitted form onscreen"
        // this will change within the next release.
        this.flc.getRootForm().setDirtyMarking(false);
        // 
        // 
        subworkflowTheChooser = new GuiDemoFlexiFormSubworkflowTheChooser(ureq, getWindowControl(), values, institution.getValue());
        // get informed if subworkflow has submitted =>
        listenTo(subworkflowTheChooser);
        calloutWindowCtr = new CloseableCalloutWindowController(ureq, getWindowControl(), subworkflowTheChooser.getInitialComponent(), choose, null, true, null);
        // get informed if modal dialog is closed => this means canceling the workflow
        listenTo(calloutWindowCtr);
        // open callout window now
        calloutWindowCtr.activate();
        return;
    }
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)

Example 23 with CloseableCalloutWindowController

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

Example 24 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class RepositorySearchController method doOpenInfos.

private void doOpenInfos(UserRequest ureq, RepositoryEntry repositoryEntry, int rowId) {
    removeAsListenerAndDispose(calloutCtrl);
    removeAsListenerAndDispose(infosCtrl);
    infosCtrl = new RepositoryEntrySmallDetailsController(ureq, getWindowControl(), repositoryEntry);
    listenTo(infosCtrl);
    calloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), infosCtrl.getInitialComponent(), "ore" + rowId + "ref", null, true, null);
    listenTo(calloutCtrl);
    calloutCtrl.activate();
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) RepositoryEntrySmallDetailsController(org.olat.repository.ui.author.RepositoryEntrySmallDetailsController)

Example 25 with CloseableCalloutWindowController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController in project OpenOLAT by OpenOLAT.

the class BusinessGroupEditResourceController method doOpenInfos.

private void doOpenInfos(UserRequest ureq, RepositoryEntry repositoryEntry, int rowId) {
    removeAsListenerAndDispose(calloutCtrl);
    removeAsListenerAndDispose(infosCtrl);
    infosCtrl = new RepositoryEntrySmallDetailsController(ureq, getWindowControl(), repositoryEntry);
    listenTo(infosCtrl);
    calloutCtrl = new CloseableCalloutWindowController(ureq, getWindowControl(), infosCtrl.getInitialComponent(), "ore" + rowId + "ref", null, true, null);
    listenTo(calloutCtrl);
    calloutCtrl.activate();
}
Also used : CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) RepositoryEntrySmallDetailsController(org.olat.repository.ui.author.RepositoryEntrySmallDetailsController)

Aggregations

CloseableCalloutWindowController (org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)122 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)12 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)8 ArrayList (java.util.ArrayList)6 List (java.util.List)6 Component (org.olat.core.gui.components.Component)6 Link (org.olat.core.gui.components.link.Link)6 Identity (org.olat.core.id.Identity)6 RepositoryEntry (org.olat.repository.RepositoryEntry)6 RepositoryEntrySmallDetailsController (org.olat.repository.ui.author.RepositoryEntrySmallDetailsController)6 UserSearchController (org.olat.admin.user.UserSearchController)4 CalloutSettings (org.olat.core.gui.control.generic.closablewrapper.CalloutSettings)4 NamingException (javax.naming.NamingException)2 LdapContext (javax.naming.ldap.LdapContext)2 KalendarRenderWrapper (org.olat.commons.calendar.ui.components.KalendarRenderWrapper)2 UserRequest (org.olat.core.gui.UserRequest)2 Choice (org.olat.core.gui.components.choice.Choice)2 FormToggle (org.olat.core.gui.components.form.flexible.elements.FormToggle)2 SingleSelection (org.olat.core.gui.components.form.flexible.elements.SingleSelection)2 JSAndCSSComponent (org.olat.core.gui.components.htmlheader.jscss.JSAndCSSComponent)2