Search in sources :

Example 51 with LayoutMain3ColsController

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

the class ForumUIFactory method getPopupableForumController.

/**
 * Provides a popable ForumController wrapped in a titled controller.
 * @param ureq
 * @param forum
 * @param forumCallback
 * @param title
 * @return a ChiefController
 */
public static PopupBrowserWindow getPopupableForumController(UserRequest ureq, WindowControl wControl, final Forum forum, final ForumCallback forumCallback, final TitleInfo titleInfo) {
    ControllerCreator ctrlCreator = new ControllerCreator() {

        public Controller createController(UserRequest lureq, WindowControl lwControl) {
            Controller forumWrapperController = getTitledForumController(lureq, lwControl, forum, forumCallback, titleInfo);
            // use on column layout
            LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, forumWrapperController);
            // dispose content on layout dispose
            layoutCtr.addDisposableChildController(forumWrapperController);
            return layoutCtr;
        }
    };
    // wrap the content controller into a full header layout
    ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
    PopupBrowserWindow pbw = wControl.getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq, layoutCtrlr);
    return pbw;
}
Also used : PopupBrowserWindow(org.olat.core.gui.control.generic.popup.PopupBrowserWindow) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) WindowControl(org.olat.core.gui.control.WindowControl) TitledWrapperController(org.olat.core.gui.control.generic.title.TitledWrapperController) ForumController(org.olat.modules.fo.ui.ForumController) Controller(org.olat.core.gui.control.Controller) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 52 with LayoutMain3ColsController

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

the class BinderInvitationContextEntryControllerCreator method createController.

@Override
public Controller createController(List<ContextEntry> ces, UserRequest ureq, WindowControl wControl) {
    if (!ureq.getUserSession().getRoles().isInvitee()) {
        return null;
    }
    Binder binder = getBinderFromContext(ces.get(0));
    BinderConfiguration config = BinderConfiguration.createInvitationConfig();
    List<AccessRights> rights = CoreSpringFactory.getImpl(PortfolioService.class).getAccessRights(binder, ureq.getIdentity());
    BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForInvitation(rights);
    Controller binderCtrl = new PortfolioInvitationController(ureq, wControl, secCallback, binder, config);
    LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, binderCtrl);
    layoutCtr.addDisposableChildController(binderCtrl);
    return layoutCtr;
}
Also used : AccessRights(org.olat.modules.portfolio.model.AccessRights) PortfolioInvitationController(org.olat.modules.portfolio.ui.PortfolioInvitationController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) PortfolioInvitationController(org.olat.modules.portfolio.ui.PortfolioInvitationController) Controller(org.olat.core.gui.control.Controller) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController)

Example 53 with LayoutMain3ColsController

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

the class GenericMainController method init.

/**
 * use after optional addChildNodeToAppend() or addChildNodeToPrepend() calls
 * to initialize MainController and set Panel
 *
 * @param ureq
 */
public void init(UserRequest ureq) {
    olatMenuTree = new MenuTree("olatMenuTree");
    TreeModel tm = buildTreeModel(ureq);
    olatMenuTree.setTreeModel(tm);
    content = new Panel("content");
    TreeNode firstNode = tm.getRootNode();
    TreeNode nodeToSelect = getLastDelegate(firstNode);
    olatMenuTree.setSelectedNodeId(nodeToSelect.getIdent());
    olatMenuTree.addListener(this);
    // default is to not display the root element and to let user open/close sub elements
    olatMenuTree.setRootVisible(false);
    olatMenuTree.setExpandSelectedNode(false);
    Object uobject = nodeToSelect.getUserObject();
    contentCtr = getContentCtr(uobject, ureq);
    // auto dispose later
    listenTo(contentCtr);
    Component resComp = contentCtr.getInitialComponent();
    content.setContent(resComp);
    columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), olatMenuTree, content, className);
    // auto dispose later
    listenTo(columnLayoutCtr);
    // create the stack
    stackVC = new BreadcrumbedStackedPanel("genericStack", getTranslator(), this);
    stackVC.pushController("content", columnLayoutCtr);
    putInitialPanel(stackVC);
}
Also used : MenuTree(org.olat.core.gui.components.tree.MenuTree) TreeModel(org.olat.core.gui.components.tree.TreeModel) GenericTreeModel(org.olat.core.gui.components.tree.GenericTreeModel) BreadcrumbPanel(org.olat.core.gui.components.stack.BreadcrumbPanel) Panel(org.olat.core.gui.components.panel.Panel) BreadcrumbedStackedPanel(org.olat.core.gui.components.stack.BreadcrumbedStackedPanel) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Component(org.olat.core.gui.components.Component) BreadcrumbedStackedPanel(org.olat.core.gui.components.stack.BreadcrumbedStackedPanel)

Example 54 with LayoutMain3ColsController

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

the class AbstractSiteInstance method getAlternativeController.

protected MainLayoutController getAlternativeController(UserRequest ureq, WindowControl wControl, SiteConfiguration config) {
    String altControllerId = config.getAlternativeControllerBeanId();
    MainLayoutController c;
    if (StringHelper.containsNonWhitespace(altControllerId)) {
        AutoCreator creator = (AutoCreator) CoreSpringFactory.getBean(altControllerId);
        Controller ac = creator.createController(ureq, wControl);
        if (ac instanceof MainLayoutController) {
            c = (MainLayoutController) ac;
        } else {
            c = new LayoutMain3ColsController(ureq, wControl, ac);
        }
    } else {
        Controller ctrl = new ForbiddenCourseSiteController(ureq, wControl);
        c = new LayoutMain3ColsController(ureq, wControl, ctrl);
    }
    return c;
}
Also used : AutoCreator(org.olat.core.gui.control.creator.AutoCreator) ForbiddenCourseSiteController(org.olat.course.site.ui.ForbiddenCourseSiteController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController) ForbiddenCourseSiteController(org.olat.course.site.ui.ForbiddenCourseSiteController) Controller(org.olat.core.gui.control.Controller) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController)

Example 55 with LayoutMain3ColsController

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

the class ModifyCourseEvent method createHelpCourseLaunchController.

/**
 * Create a user locale dependent help-course run controller
 *
 * @param ureq The user request
 * @param wControl The current window controller
 * @return The help-course run controller
 */
public static Controller createHelpCourseLaunchController(UserRequest ureq, WindowControl wControl) {
    // Find repository entry for this course
    String helpCourseSoftKey = CoreSpringFactory.getImpl(CourseModule.class).getHelpCourseSoftKey();
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryService rs = CoreSpringFactory.getImpl(RepositoryService.class);
    RepositoryEntry entry = null;
    if (StringHelper.containsNonWhitespace(helpCourseSoftKey)) {
        entry = rm.lookupRepositoryEntryBySoftkey(helpCourseSoftKey, false);
    }
    if (entry == null) {
        Translator translator = Util.createPackageTranslator(CourseFactory.class, ureq.getLocale());
        wControl.setError(translator.translate("error.helpcourse.not.configured"));
        // create empty main controller
        LayoutMain3ColsController emptyCtr = new LayoutMain3ColsController(ureq, wControl, null, null, null);
        return emptyCtr;
    } else {
        // Increment launch counter
        rs.incrementLaunchCounter(entry);
        ICourse course = loadCourse(entry);
        ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(entry);
        WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, wControl);
        RepositoryEntrySecurity reSecurity = new RepositoryEntrySecurity(false, false, false, false, false, false, false, true, false);
        RunMainController launchC = new RunMainController(ureq, bwControl, null, course, entry, reSecurity, null);
        return launchC;
    }
}
Also used : Translator(org.olat.core.gui.translator.Translator) RepositoryEntrySecurity(org.olat.repository.model.RepositoryEntrySecurity) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) RunMainController(org.olat.course.run.RunMainController) RepositoryManager(org.olat.repository.RepositoryManager) RepositoryEntry(org.olat.repository.RepositoryEntry) WindowControl(org.olat.core.gui.control.WindowControl) ContextEntry(org.olat.core.id.context.ContextEntry) RepositoryService(org.olat.repository.RepositoryService)

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