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);
}
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());
}
}
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);
}
Aggregations