Search in sources :

Example 1 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class PortalSite method createController.

@Override
protected Controller createController(UserRequest ureq, WindowControl wControl, SiteConfiguration config) {
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ORES));
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ureq, ORES, new StateSite(this), wControl, true);
    PortalMainController c = new PortalMainController(ureq, bwControl);
    return new LayoutMain3ColsController(ureq, wControl, c);
}
Also used : StateSite(org.olat.core.id.context.StateSite) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) WindowControl(org.olat.core.gui.control.WindowControl)

Example 2 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class CourseSiteContextEntryControllerCreator method messageController.

private Controller messageController(UserRequest ureq, WindowControl wControl, String i18nMesageKey) {
    Translator trans = Util.createPackageTranslator(RepositoryService.class, ureq.getLocale());
    String text = trans.translate(i18nMesageKey);
    Controller c = MessageUIFactory.createInfoMessage(ureq, wControl, null, text);
    // use on column layout
    LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, c);
    // dispose content on layout dispose
    layoutCtr.addDisposableChildController(c);
    return layoutCtr;
}
Also used : Translator(org.olat.core.gui.translator.Translator) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Controller(org.olat.core.gui.control.Controller)

Example 3 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class NotesPortletRunController 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 NotePortletEntry pe = (NotePortletEntry) notesListModel.getObject(rowid);
                final Note note = pe.getValue();
                // will not be disposed on course run dispose, popus up as new browserwindow
                ControllerCreator ctrlCreator = new ControllerCreator() {

                    public Controller createController(UserRequest lureq, WindowControl lwControl) {
                        Controller nc = new NoteController(lureq, lwControl, note);
                        // use on column layout
                        LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, nc);
                        // dispose content on layout dispose
                        layoutCtr.addDisposableChildController(nc);
                        return layoutCtr;
                    }
                };
                // 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) WindowControl(org.olat.core.gui.control.WindowControl) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) AbstractPortletRunController(org.olat.core.gui.control.generic.portal.AbstractPortletRunController) Controller(org.olat.core.gui.control.Controller) TableController(org.olat.core.gui.components.table.TableController) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 4 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class PortfolioConfigForm method doPreview.

private void doPreview(UserRequest ureq) {
    removeAsListenerAndDispose(previewCtr);
    removeAsListenerAndDispose(columnLayoutCtr);
    if (map != null) {
        EPSecurityCallback secCallback = new EPSecurityCallbackImpl(false, true);
        previewCtr = EPUIFactory.createPortfolioStructureMapPreviewController(ureq, getWindowControl(), map, secCallback);
    } else if (binder != null && stackPanel instanceof TooledStackedPanel) {
        BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getReadOnlyCallback();
        BinderConfiguration bConfig = BinderConfiguration.createTemplateConfig(false);
        previewCtr = new BinderController(ureq, getWindowControl(), (TooledStackedPanel) stackPanel, secCallback, binder, bConfig);
    } else {
        return;
    }
    listenTo(previewCtr);
    columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), previewCtr);
    stackPanel.pushController(translate("preview.map"), columnLayoutCtr);
    listenTo(columnLayoutCtr);
}
Also used : TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) BinderController(org.olat.modules.portfolio.ui.BinderController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) EPSecurityCallback(org.olat.portfolio.EPSecurityCallback) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) EPSecurityCallbackImpl(org.olat.portfolio.EPSecurityCallbackImpl) BinderConfiguration(org.olat.modules.portfolio.BinderConfiguration)

Example 5 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class STCourseNode method createNodeRunConstructionResult.

/**
 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl,
 *      org.olat.course.run.userview.UserCourseEnvironment,
 *      org.olat.course.run.userview.NodeEvaluation)
 */
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, final UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    Controller cont;
    String displayType = getModuleConfiguration().getStringValue(STCourseNodeEditController.CONFIG_KEY_DISPLAY_TYPE);
    String relPath = STCourseNodeEditController.getFileName(getModuleConfiguration());
    if (relPath != null && displayType.equals(STCourseNodeEditController.CONFIG_VALUE_DISPLAY_FILE)) {
        // we want a user chosen overview, so display the chosen file from the
        // material folder, otherwise display the normal overview
        // reuse the Run controller from the "Single Page" building block, since
        // we need to do exactly the same task
        Boolean allowRelativeLinks = getModuleConfiguration().getBooleanEntry(STCourseNodeEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS);
        if (allowRelativeLinks == null) {
            allowRelativeLinks = Boolean.FALSE;
        }
        DeliveryOptions deliveryOptions = (DeliveryOptions) getModuleConfiguration().get(SPEditController.CONFIG_KEY_DELIVERYOPTIONS);
        OLATResourceable ores = OresHelper.createOLATResourceableInstance(CourseModule.class, userCourseEnv.getCourseEnvironment().getCourseResourceableId());
        SinglePageController spCtr = new SinglePageController(ureq, wControl, userCourseEnv.getCourseEnvironment().getCourseFolderContainer(), relPath, allowRelativeLinks.booleanValue(), null, ores, deliveryOptions, userCourseEnv.getCourseEnvironment().isPreview());
        // check if user is allowed to edit the page in the run view
        CourseGroupManager cgm = userCourseEnv.getCourseEnvironment().getCourseGroupManager();
        boolean hasEditRights = (cgm.isIdentityCourseAdministrator(ureq.getIdentity()) || cgm.hasRight(ureq.getIdentity(), CourseRights.RIGHT_COURSEEDITOR)) || (getModuleConfiguration().getBooleanSafe(SPEditController.CONFIG_KEY_ALLOW_COACH_EDIT, false) && cgm.isIdentityCourseCoach(ureq.getIdentity()));
        if (hasEditRights) {
            spCtr.allowPageEditing();
            // set the link tree model to internal for the HTML editor
            CustomLinkTreeModel linkTreeModel = new CourseInternalLinkTreeModel(userCourseEnv.getCourseEnvironment().getRunStructure().getRootNode());
            spCtr.setInternalLinkTreeModel(linkTreeModel);
        }
        spCtr.addLoggingResourceable(LoggingResourceable.wrap(this));
        // create clone wrapper layout, allow popping into second window
        CloneLayoutControllerCreatorCallback clccc = new CloneLayoutControllerCreatorCallback() {

            @Override
            public ControllerCreator createLayoutControllerCreator(final UserRequest uureq, final ControllerCreator contentControllerCreator) {
                return BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(uureq, new ControllerCreator() {

                    @Override
                    public Controller createController(UserRequest lureq, WindowControl lwControl) {
                        // wrap 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(), userCourseEnv.getCourseEnvironment()));
                        Controller wrappedCtrl = TitledWrapperHelper.getWrapper(lureq, lwControl, ctr, STCourseNode.this, ICON_CSS_CLASS);
                        layoutCtr.addDisposableChildController(wrappedCtrl);
                        return layoutCtr;
                    }
                });
            }
        };
        Controller wrappedCtrl = TitledWrapperHelper.getWrapper(ureq, wControl, spCtr, this, ICON_CSS_CLASS);
        if (wrappedCtrl instanceof CloneableController) {
            cont = new CloneController(ureq, wControl, (CloneableController) wrappedCtrl, clccc);
        } else {
            throw new AssertException("Need to be a cloneable");
        }
    } else {
        // evaluate the score accounting for this node. this uses the score accountings local
        // cache hash map to reduce unnecessary calculations
        ScoreEvaluation se = userCourseEnv.getScoreAccounting().evalCourseNode(this);
        cont = TitledWrapperHelper.getWrapper(ureq, wControl, new STCourseNodeRunController(ureq, wControl, userCourseEnv, this, se, ne), this, ICON_CSS_CLASS);
    }
    // displayed in the ST-Runcontroller
    return new NodeRunConstructionResult(cont);
}
Also used : STCourseNodeRunController(org.olat.course.nodes.st.STCourseNodeRunController) CourseGroupManager(org.olat.course.groupsandrights.CourseGroupManager) ScoreEvaluation(org.olat.course.run.scoring.ScoreEvaluation) AssertException(org.olat.core.logging.AssertException) OLATResourceable(org.olat.core.id.OLATResourceable) CloneableController(org.olat.core.gui.control.generic.clone.CloneableController) SinglePageController(org.olat.core.commons.modules.singlepage.SinglePageController) SPPeekviewController(org.olat.course.nodes.sp.SPPeekviewController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) NodeEditController(org.olat.course.editor.NodeEditController) STCourseNodeRunController(org.olat.course.nodes.st.STCourseNodeRunController) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) CloneableController(org.olat.core.gui.control.generic.clone.CloneableController) AssessmentCourseNodeController(org.olat.course.assessment.ui.tool.AssessmentCourseNodeController) SPEditController(org.olat.course.nodes.sp.SPEditController) CloneController(org.olat.core.gui.control.generic.clone.CloneController) STCourseNodeEditController(org.olat.course.nodes.st.STCourseNodeEditController) Controller(org.olat.core.gui.control.Controller) STPeekViewController(org.olat.course.nodes.st.STPeekViewController) STIdentityListCourseNodeController(org.olat.course.nodes.st.STIdentityListCourseNodeController) SinglePageController(org.olat.core.commons.modules.singlepage.SinglePageController) WindowControl(org.olat.core.gui.control.WindowControl) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) CustomLinkTreeModel(org.olat.core.commons.controllers.linkchooser.CustomLinkTreeModel) 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) DeliveryOptions(org.olat.core.gui.control.generic.iframe.DeliveryOptions) UserRequest(org.olat.core.gui.UserRequest) CourseInternalLinkTreeModel(org.olat.course.tree.CourseInternalLinkTreeModel)

Aggregations

LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)80 WindowControl (org.olat.core.gui.control.WindowControl)38 Controller (org.olat.core.gui.control.Controller)36 UserRequest (org.olat.core.gui.UserRequest)34 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)28 Panel (org.olat.core.gui.components.panel.Panel)12 BasicController (org.olat.core.gui.control.controller.BasicController)12 RepositoryEntry (org.olat.repository.RepositoryEntry)12 MainLayoutController (org.olat.core.gui.control.generic.layout.MainLayoutController)10 PopupBrowserWindow (org.olat.core.gui.control.generic.popup.PopupBrowserWindow)10 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)8 OLATResourceable (org.olat.core.id.OLATResourceable)8 ContextEntry (org.olat.core.id.context.ContextEntry)8 AssertException (org.olat.core.logging.AssertException)8 ICourse (org.olat.course.ICourse)8 GlossaryMainController (org.olat.core.commons.modules.glossary.GlossaryMainController)6 Component (org.olat.core.gui.components.Component)6 TooledStackedPanel (org.olat.core.gui.components.stack.TooledStackedPanel)6 CloneController (org.olat.core.gui.control.generic.clone.CloneController)6 CertificateAndEfficiencyStatementController (org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController)6