Search in sources :

Example 21 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.

the class BaseFullWebappController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
        Link link = (Link) source;
        String mC = link.getCommand().substring(0, 1);
        if (mC.equals("t")) {
            // activate normal tab
            SiteInstance s = (SiteInstance) link.getUserObject();
            // fix the state of the last tab/site
            updateBusinessPath(ureq);
            HistoryPoint point = null;
            if (siteToBusinessPath.containsKey(s)) {
                point = siteToBusinessPath.get(s);
            }
            activateSite(s, ureq, null, true);
            if (point != null) {
                BusinessControlFactory.getInstance().addToHistory(ureq, point);
            }
            updateBusinessPath(ureq, s);
        } else if (mC.equals("a")) {
            // activate dyntab
            DTab dt = (DTab) link.getUserObject();
            // fix the state of the last tab/site
            updateBusinessPath(ureq);
            HistoryPoint point = null;
            if (dtabToBusinessPath.containsKey(dt)) {
                point = dtabToBusinessPath.get(dt);
            }
            doActivateDTab(dt);
            if (dt.getController() instanceof Activateable2) {
                ((Activateable2) dt.getController()).activate(ureq, null, new ReloadEvent());
            }
            if (point != null) {
                BusinessControlFactory.getInstance().addToHistory(ureq, point);
            }
        } else if (mC.equals("c")) {
            // close dyntab
            DTab dt = (DTab) link.getUserObject();
            requestCloseTab(ureq, dt);
        }
    } else if (source == getWindowControl().getWindowBackOffice().getWindow()) {
        if (event == Window.OLDTIMESTAMPCALL) {
            getLogger().info("RELOAD");
            HistoryPoint point = ureq.getUserSession().popLastHistoryEntry();
            if (point != null) {
                back(ureq, point);
            }
        }
    }
}
Also used : BornSiteInstance(org.olat.core.gui.control.navigation.BornSiteInstance) SiteInstance(org.olat.core.gui.control.navigation.SiteInstance) DTab(org.olat.core.gui.control.generic.dtabs.DTab) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) Link(org.olat.core.gui.components.link.Link) HistoryPoint(org.olat.core.id.context.HistoryPoint)

Example 22 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.

the class BaseFullWebappController method activateSite.

/**
 * Activate a site if not locked
 *
 * @param s
 * @param ureq
 * @param entries
 * @param forceReload
 */
private void activateSite(SiteInstance s, UserRequest ureq, List<ContextEntry> entries, boolean forceReload) {
    if (lockResource != null)
        return;
    BornSiteInstance bs = siteToBornSite.get(s);
    GuiStack gs;
    Controller resC;
    // PB//WindowControl site_wControl;
    if (bs != null && s != curSite) {
        // single - click -> fetch guistack from cache
        gs = bs.getGuiStackHandle();
        resC = bs.getController();
    } else if (bs != null && s == curSite && !forceReload) {
        // via activate, don't force the reload
        gs = bs.getGuiStackHandle();
        resC = bs.getController();
    } else {
        // dispose old controller
        if (bs != null) {
            // already in cache -> dispose old
            bs.getController().dispose();
        }
        // reset site and create new controller
        s.reset();
        resC = s.createController(ureq, getWindowControl());
        gs = getWindowControl().getWindowBackOffice().createGuiStack(resC.getInitialComponent());
        // PB//site_wControl = bwControl;
        // PB//siteToBornSite.put(s, new BornSiteInstance(gs, resC, bwControl));
        siteToBornSite.put(s, new BornSiteInstance(gs, resC));
    }
    doActivateSite(s, gs);
    if (resC instanceof Activateable2) {
        ((Activateable2) resC).activate(ureq, entries, null);
    }
    // perhaps has activation changed the gui stack and it need to be updated
    setGuiStack(gs);
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) BornSiteInstance(org.olat.core.gui.control.navigation.BornSiteInstance) GuiStack(org.olat.core.gui.control.guistack.GuiStack) ResumeSessionController(org.olat.core.commons.controllers.resume.ResumeSessionController) AssessmentModeGuardController(org.olat.course.assessment.ui.mode.AssessmentModeGuardController) BasicController(org.olat.core.gui.control.controller.BasicController) ChiefController(org.olat.core.gui.control.ChiefController) BaseChiefController(org.olat.core.commons.chiefcontrollers.BaseChiefController) VetoableCloseController(org.olat.core.gui.control.VetoableCloseController) Controller(org.olat.core.gui.control.Controller) UserToolsMenuController(org.olat.gui.control.UserToolsMenuController)

Example 23 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.

the class BusinessGroupMainRunController method doPortfolio.

private Activateable2 doPortfolio(UserRequest ureq) {
    addLoggingResourceable(LoggingResourceable.wrap(ORES_TOOLPORTFOLIO, OlatResourceableType.portfolio));
    ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ORES_TOOLPORTFOLIO);
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapPortfolioOres(ce.getOLATResourceable()));
    addToHistory(ureq, bwControl);
    CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(businessGroup);
    collabToolCtr = collabTools.createPortfolioController(ureq, bwControl, toolbarPanel, businessGroup);
    listenTo(collabToolCtr);
    toolbarPanel.popUpToRootController(ureq);
    toolbarPanel.pushController("Portfolio", collabToolCtr);
    List<ContextEntry> entries = BusinessControlFactory.getInstance().createCEListFromResourceType("Toc");
    ((Activateable2) collabToolCtr).activate(ureq, entries, null);
    return (Activateable2) collabToolCtr;
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) CollaborationTools(org.olat.collaboration.CollaborationTools) WindowControl(org.olat.core.gui.control.WindowControl) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 24 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.

the class BusinessGroupMainRunController method doAccessControlHistory.

private Activateable2 doAccessControlHistory(UserRequest ureq) {
    removeAsListenerAndDispose(bgACHistoryCtrl);
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ORES_TOOLBOOKING, null, getWindowControl());
    addToHistory(ureq, bwControl);
    OLATResource resource = businessGroup.getResource();
    bgACHistoryCtrl = new OrdersAdminController(ureq, bwControl, toolbarPanel, resource);
    listenTo(bgACHistoryCtrl);
    mainPanel.setContent(bgACHistoryCtrl.getInitialComponent());
    return (Activateable2) bgACHistoryCtrl;
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) OrdersAdminController(org.olat.resource.accesscontrol.ui.OrdersAdminController) OLATResource(org.olat.resource.OLATResource) WindowControl(org.olat.core.gui.control.WindowControl)

Example 25 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.

the class AssessmentIdentityListCourseTreeController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == menuTree) {
        if (event.getCommand().equals(MenuTree.COMMAND_TREENODE_CLICKED)) {
            Object uo = menuTree.getSelectedNode().getUserObject();
            if (uo instanceof CourseNode) {
                CourseNode cn = (CourseNode) uo;
                Controller ctrl = doSelectCourseNode(ureq, cn);
                if (ctrl instanceof Activateable2) {
                    ((Activateable2) ctrl).activate(ureq, null, null);
                }
                fireEvent(ureq, new CourseNodeEvent(CourseNodeEvent.SELECT_COURSE_NODE, cn.getIdent()));
            }
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) CourseNode(org.olat.course.nodes.CourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) CourseNodeEvent(org.olat.course.assessment.ui.tool.event.CourseNodeEvent)

Aggregations

Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)78 ContextEntry (org.olat.core.id.context.ContextEntry)44 Controller (org.olat.core.gui.control.Controller)28 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)22 TreeNode (org.olat.core.gui.components.tree.TreeNode)16 WindowControl (org.olat.core.gui.control.WindowControl)16 BasicController (org.olat.core.gui.control.controller.BasicController)14 CourseNode (org.olat.course.nodes.CourseNode)12 CollaborationTools (org.olat.collaboration.CollaborationTools)10 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)10 MainLayoutBasicController (org.olat.core.gui.control.controller.MainLayoutBasicController)10 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)10 GTACourseNode (org.olat.course.nodes.GTACourseNode)10 FlexiTableSearchEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent)8 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)8 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)6 ChiefController (org.olat.core.gui.control.ChiefController)6 VetoableCloseController (org.olat.core.gui.control.VetoableCloseController)6 BornSiteInstance (org.olat.core.gui.control.navigation.BornSiteInstance)6 OLATResourceable (org.olat.core.id.OLATResourceable)5