Search in sources :

Example 6 with BornSiteInstance

use of org.olat.core.gui.control.navigation.BornSiteInstance in project OpenOLAT by OpenOLAT.

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 7 with BornSiteInstance

use of org.olat.core.gui.control.navigation.BornSiteInstance in project openolat by klemens.

the class BaseFullWebappController method doActivateSite.

private void doActivateSite(SiteInstance s, GuiStack gs) {
    removeCurrentCustomCSSFromView();
    // set curSite
    setCurrent(s, null);
    setGuiStack(gs);
    NavElement navEl = s.getNavElement();
    if (navEl != null) {
        getWindow().setTitle(getTranslator(), navEl.getTitle());
        setBodyDataResource("site", s.getClass().getSimpleName(), null);
    }
    // update marking of active site/tab
    navSitesVc.setDirty(true);
    navTabsVc.setDirty(true);
    // add css for this site
    BornSiteInstance bs = siteToBornSite.get(s);
    if (bs != null) {
        addCurrentCustomCSSToView(bs.getCustomCSS());
    }
}
Also used : BornSiteInstance(org.olat.core.gui.control.navigation.BornSiteInstance) NavElement(org.olat.core.gui.control.navigation.NavElement)

Example 8 with BornSiteInstance

use of org.olat.core.gui.control.navigation.BornSiteInstance in project openolat by klemens.

the class BaseFullWebappController method doDispose.

@Override
protected void doDispose() {
    // deregister for chief global sticky messages events
    GlobalStickyMessage.deregisterForGlobalStickyMessage(this);
    if (dtabs != null) {
        for (DTab tab : dtabs) {
            tab.dispose();
        }
        for (BornSiteInstance bornSite : siteToBornSite.values()) {
            bornSite.dispose();
        }
        dtabs = null;
        dtabsControllers = null;
        sites = null;
        siteToBornSite = null;
        siteToBusinessPath = null;
        dtabToBusinessPath = null;
    }
    // clear the DTabs Service
    WindowBackOffice wbackOffice = getWindowControl().getWindowBackOffice();
    wbackOffice.getWindow().setDTabs(null);
    wbackOffice.removeCycleListener(this);
    if (jsServerC != null) {
        jsServerC.dispose();
        jsServerC = null;
    }
    if (debugC != null) {
        debugC.dispose();
        debugC = null;
    }
    if (inlineTranslationC != null) {
        inlineTranslationC.dispose();
        inlineTranslationC = null;
    }
    if (developmentC != null) {
        developmentC.dispose();
        developmentC = null;
    }
    // deregister for assessment mode
    CoordinatorManager.getInstance().getCoordinator().getEventBus().deregisterFor(this, AssessmentModeNotificationEvent.ASSESSMENT_MODE_NOTIFICATION);
}
Also used : DTab(org.olat.core.gui.control.generic.dtabs.DTab) BornSiteInstance(org.olat.core.gui.control.navigation.BornSiteInstance) WindowBackOffice(org.olat.core.gui.control.WindowBackOffice)

Aggregations

BornSiteInstance (org.olat.core.gui.control.navigation.BornSiteInstance)8 DTab (org.olat.core.gui.control.generic.dtabs.DTab)4 GuiStack (org.olat.core.gui.control.guistack.GuiStack)4 BaseChiefController (org.olat.core.commons.chiefcontrollers.BaseChiefController)2 ResumeSessionController (org.olat.core.commons.controllers.resume.ResumeSessionController)2 ChiefController (org.olat.core.gui.control.ChiefController)2 Controller (org.olat.core.gui.control.Controller)2 VetoableCloseController (org.olat.core.gui.control.VetoableCloseController)2 WindowBackOffice (org.olat.core.gui.control.WindowBackOffice)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)2 NavElement (org.olat.core.gui.control.navigation.NavElement)2 SiteInstance (org.olat.core.gui.control.navigation.SiteInstance)2 AssessmentModeGuardController (org.olat.course.assessment.ui.mode.AssessmentModeGuardController)2 UserToolsMenuController (org.olat.gui.control.UserToolsMenuController)2