Search in sources :

Example 1 with IframeTunnelController

use of org.olat.modules.tu.IframeTunnelController in project OpenOLAT by OpenOLAT.

the class TUEditController 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)
 */
public void event(UserRequest ureq, Component source, Event event) {
    if (source == previewButton) {
        // those must be links
        Controller tunnelRunCtr;
        if (config.getBooleanSafe(TUConfigForm.CONFIG_IFRAME)) {
            tunnelRunCtr = new IframeTunnelController(ureq, getWindowControl(), config);
        } else {
            tunnelRunCtr = new TURunController(getWindowControl(), config, ureq, courseNode, PreviewConfigHelper.getPreviewCourseEnvironment(true, true, course));
        }
        if (previewLayoutCtr != null)
            previewLayoutCtr.dispose();
        // preview layout: only center column (col3) used
        previewLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), tunnelRunCtr);
        stackPanel.pushController(translate("preview"), previewLayoutCtr);
    }
}
Also used : LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) ActivateableTabbableDefaultController(org.olat.core.gui.control.generic.tabbable.ActivateableTabbableDefaultController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) IframeTunnelController(org.olat.modules.tu.IframeTunnelController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) ConditionEditController(org.olat.course.condition.ConditionEditController) IframeTunnelController(org.olat.modules.tu.IframeTunnelController)

Example 2 with IframeTunnelController

use of org.olat.modules.tu.IframeTunnelController in project openolat by klemens.

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 3 with IframeTunnelController

use of org.olat.modules.tu.IframeTunnelController 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 4 with IframeTunnelController

use of org.olat.modules.tu.IframeTunnelController in project openolat by klemens.

the class TUEditController 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)
 */
public void event(UserRequest ureq, Component source, Event event) {
    if (source == previewButton) {
        // those must be links
        Controller tunnelRunCtr;
        if (config.getBooleanSafe(TUConfigForm.CONFIG_IFRAME)) {
            tunnelRunCtr = new IframeTunnelController(ureq, getWindowControl(), config);
        } else {
            tunnelRunCtr = new TURunController(getWindowControl(), config, ureq, courseNode, PreviewConfigHelper.getPreviewCourseEnvironment(true, true, course));
        }
        if (previewLayoutCtr != null)
            previewLayoutCtr.dispose();
        // preview layout: only center column (col3) used
        previewLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), tunnelRunCtr);
        stackPanel.pushController(translate("preview"), previewLayoutCtr);
    }
}
Also used : LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) ActivateableTabbableDefaultController(org.olat.core.gui.control.generic.tabbable.ActivateableTabbableDefaultController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) IframeTunnelController(org.olat.modules.tu.IframeTunnelController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) ConditionEditController(org.olat.course.condition.ConditionEditController) IframeTunnelController(org.olat.modules.tu.IframeTunnelController)

Aggregations

LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)4 Controller (org.olat.core.gui.control.Controller)4 IframeTunnelController (org.olat.modules.tu.IframeTunnelController)4 UserRequest (org.olat.core.gui.UserRequest)2 WindowControl (org.olat.core.gui.control.WindowControl)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)2 CloneController (org.olat.core.gui.control.generic.clone.CloneController)2 CloneLayoutControllerCreatorCallback (org.olat.core.gui.control.generic.clone.CloneLayoutControllerCreatorCallback)2 CloneableController (org.olat.core.gui.control.generic.clone.CloneableController)2 ActivateableTabbableDefaultController (org.olat.core.gui.control.generic.tabbable.ActivateableTabbableDefaultController)2 AssertException (org.olat.core.logging.AssertException)2 ConditionEditController (org.olat.course.condition.ConditionEditController)2 NodeEditController (org.olat.course.editor.NodeEditController)2 TunnelController (org.olat.modules.tu.TunnelController)2