Search in sources :

Example 61 with ControllerCreator

use of org.olat.core.gui.control.creator.ControllerCreator in project OpenOLAT by OpenOLAT.

the class StepsMainRunController method event.

@Override
protected /*
	 * (non-Javadoc)
	 * 
	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
	 *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
	 */
void event(final UserRequest ureq, Controller source, Event event) {
    /*
		 * FIXME:pb: 
		 */
    if (source == stepPagesController.peek()) {
        if (event == StepsEvent.ACTIVATE_NEXT && !finishCycle) {
            // intermediate steps wants to proceed - and next link was clicked
            lastEvent = event;
            doAfterDispatch = true;
            // activate next event on source
            Step current = steps.peek();
            // TODO:pb detach previous from "submit" cycle
            nextStep = current.nextStep();
            if (nextStep == Step.NOSTEP) {
                // next but no more step -> finish
                finishWizard(ureq);
            } else {
                nextChildCreator = new ControllerCreator() {

                    private final UserRequest ureqForAfterDispatch = ureq;

                    @Override
                    public Controller createController(UserRequest lureq, WindowControl lwControl) {
                        // taken
                        return nextStep.getStepController(ureqForAfterDispatch, lwControl, stepsContext, mainForm);
                    }
                };
            }
        // creation of controller and setting the controller is deferred to
        // the afterDispatch Cycle
        // 
        } else if (event == StepsEvent.ACTIVATE_NEXT && finishCycle) {
            // intermediate step wants to proceed - but finish link was clicked
            // this means current step validated and we are ready to terminate
            // the wizard.
            finishWizard(ureq);
        } else if (event == StepsEvent.INFORM_FINISHED) {
            // finish link was clicked -> step form controller has valid data ->
            // fires
            // FINISH EVENT
            // all relevant data for finishing the wizards work must now be
            // present in the stepsContext
            finishWizard(ureq);
        }
    }
}
Also used : WindowControl(org.olat.core.gui.control.WindowControl) Controller(org.olat.core.gui.control.Controller) FormBasicController(org.olat.core.gui.components.form.flexible.impl.FormBasicController) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 62 with ControllerCreator

use of org.olat.core.gui.control.creator.ControllerCreator in project OpenOLAT by OpenOLAT.

the class TURunController method doLaunch.

private void doLaunch(UserRequest ureq) {
    boolean iniframe = config.getBooleanSafe(TUConfigForm.CONFIG_IFRAME);
    // create the possibility to float
    CloneableController controller;
    if (iniframe) {
        // Do not dispose this controller if the course is closed...
        IframeTunnelController ifC = new IframeTunnelController(ureq, getWindowControl(), config);
        controller = ifC;
    } else {
        TunnelController tuC = new TunnelController(ureq, getWindowControl(), config);
        controller = tuC;
    }
    listenTo(controller);
    // create clone wrapper layout
    CloneLayoutControllerCreatorCallback clccc = new CloneLayoutControllerCreatorCallback() {

        public ControllerCreator createLayoutControllerCreator(UserRequest ureq, final ControllerCreator contentControllerCreator) {
            return BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, new ControllerCreator() {

                @SuppressWarnings("synthetic-access")
                public Controller createController(UserRequest lureq, WindowControl lwControl) {
                    // wrapp in column layout, popup window needs a layout controller
                    Controller ctr = contentControllerCreator.createController(lureq, lwControl);
                    LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, ctr);
                    layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(), courseEnv));
                    layoutCtr.addDisposableChildController(ctr);
                    return layoutCtr;
                }
            });
        }
    };
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, getWindowControl(), controller, courseNode, "o_tu_icon");
    if (ctrl instanceof CloneableController) {
        cloneC = new CloneController(ureq, getWindowControl(), (CloneableController) ctrl, clccc);
        listenTo(cloneC);
        main.setContent(cloneC.getInitialComponent());
    } else {
        throw new AssertException("Controller must be cloneable");
    }
}
Also used : AssertException(org.olat.core.logging.AssertException) CloneableController(org.olat.core.gui.control.generic.clone.CloneableController) WindowControl(org.olat.core.gui.control.WindowControl) CloneableController(org.olat.core.gui.control.generic.clone.CloneableController) TunnelController(org.olat.modules.tu.TunnelController) CloneController(org.olat.core.gui.control.generic.clone.CloneController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) IframeTunnelController(org.olat.modules.tu.IframeTunnelController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) CloneController(org.olat.core.gui.control.generic.clone.CloneController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) CloneLayoutControllerCreatorCallback(org.olat.core.gui.control.generic.clone.CloneLayoutControllerCreatorCallback) TunnelController(org.olat.modules.tu.TunnelController) IframeTunnelController(org.olat.modules.tu.IframeTunnelController) IframeTunnelController(org.olat.modules.tu.IframeTunnelController) UserRequest(org.olat.core.gui.UserRequest)

Example 63 with ControllerCreator

use of org.olat.core.gui.control.creator.ControllerCreator in project OpenOLAT by OpenOLAT.

the class EfficiencyStatementsPortletRunController method event.

/**
 * @see org.olat.core.gui.control.ControllerEventListener#dispatchEvent(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 */
public void event(UserRequest ureq, Controller source, Event event) {
    super.event(ureq, source, event);
    if (source == tableCtr) {
        if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
            TableEvent te = (TableEvent) event;
            String actionid = te.getActionId();
            if (actionid.equals(CMD_LAUNCH)) {
                int rowid = te.getRowId();
                final UserEfficiencyStatementLight statement = efficiencyStatementsListModel.getEfficiencyStatementAt(rowid);
                // will not be disposed on course run dispose, popus up as new browserwindow
                ControllerCreator ctrlCreator = new ControllerCreator() {

                    public Controller createController(UserRequest lureq, WindowControl lwControl) {
                        CertificateAndEfficiencyStatementController efficiencyCtrl = new CertificateAndEfficiencyStatementController(lwControl, lureq, statement.getArchivedResourceKey());
                        return new LayoutMain3ColsController(lureq, getWindowControl(), efficiencyCtrl);
                    }
                };
                // wrap the content controller into a full header layout
                ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
                // open in new browser window
                PopupBrowserWindow pbw = getWindowControl().getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq, layoutCtrlr);
                pbw.open(ureq);
            // 
            }
        }
    }
}
Also used : TableEvent(org.olat.core.gui.components.table.TableEvent) PopupBrowserWindow(org.olat.core.gui.control.generic.popup.PopupBrowserWindow) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) UserEfficiencyStatementLight(org.olat.course.assessment.model.UserEfficiencyStatementLight) CertificateAndEfficiencyStatementController(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController) WindowControl(org.olat.core.gui.control.WindowControl) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 64 with ControllerCreator

use of org.olat.core.gui.control.creator.ControllerCreator in project OpenOLAT by OpenOLAT.

the class ParticipantLecturesOverviewController method doPrint.

private void doPrint(UserRequest ureq) {
    ControllerCreator printControllerCreator = new ControllerCreator() {

        @Override
        public Controller createController(UserRequest lureq, WindowControl lwControl) {
            lwControl.getWindowBackOffice().getChiefController().addBodyCssClass("o_lectures_print");
            Controller printCtrl = new ParticipantLecturesOverviewController(lureq, lwControl, assessedIdentity, false, false, false, true);
            listenTo(printCtrl);
            return printCtrl;
        }
    };
    ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createPrintPopupLayout(printControllerCreator);
    openInNewBrowserWindow(ureq, layoutCtrlr);
}
Also used : WindowControl(org.olat.core.gui.control.WindowControl) FormBasicController(org.olat.core.gui.components.form.flexible.impl.FormBasicController) Controller(org.olat.core.gui.control.Controller) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 65 with ControllerCreator

use of org.olat.core.gui.control.creator.ControllerCreator in project OpenOLAT by OpenOLAT.

the class ParticipantListRepositoryController method doPrint.

private void doPrint(UserRequest ureq) {
    ControllerCreator printControllerCreator = new ControllerCreator() {

        @Override
        public Controller createController(UserRequest lureq, WindowControl lwControl) {
            lwControl.getWindowBackOffice().getChiefController().addBodyCssClass("o_lectures_print");
            Controller printCtrl = new ParticipantListRepositoryController(lureq, lwControl, entry, true, admin);
            listenTo(printCtrl);
            return printCtrl;
        }
    };
    ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createPrintPopupLayout(printControllerCreator);
    openInNewBrowserWindow(ureq, layoutCtrlr);
}
Also used : WindowControl(org.olat.core.gui.control.WindowControl) FormBasicController(org.olat.core.gui.components.form.flexible.impl.FormBasicController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) Controller(org.olat.core.gui.control.Controller) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Aggregations

ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)92 UserRequest (org.olat.core.gui.UserRequest)72 WindowControl (org.olat.core.gui.control.WindowControl)72 Controller (org.olat.core.gui.control.Controller)42 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)28 PopupBrowserWindow (org.olat.core.gui.control.generic.popup.PopupBrowserWindow)28 LockableController (org.olat.core.commons.fullWebApp.LockableController)20 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)12 Identity (org.olat.core.id.Identity)12 ArrayList (java.util.ArrayList)10 List (java.util.List)10 FormBasicController (org.olat.core.gui.components.form.flexible.impl.FormBasicController)10 TableEvent (org.olat.core.gui.components.table.TableEvent)10 AssertException (org.olat.core.logging.AssertException)10 UserInfoMainController (org.olat.user.UserInfoMainController)10 OlatFooterController (org.olat.gui.control.OlatFooterController)8 HashMap (java.util.HashMap)6 SingleIdentityChosenEvent (org.olat.basesecurity.events.SingleIdentityChosenEvent)6 TableMultiSelectEvent (org.olat.core.gui.components.table.TableMultiSelectEvent)6 Event (org.olat.core.gui.control.Event)6