use of org.olat.core.gui.control.navigation.SiteInstance in project OpenOLAT by OpenOLAT.
the class BaseFullWebappMinimalLayoutControllerCreator method getFullWebappParts.
/**
* @see org.olat.core.commons.fullWebApp.popup.BaseFullWebappPopupLayout#getFullWebappParts()
*/
@Override
public BaseFullWebappControllerParts getFullWebappParts() {
return new BaseFullWebappControllerParts() {
@Override
public List<SiteInstance> getSiteInstances(UserRequest ureq, WindowControl control) {
// no static sites
return null;
}
@Override
public Controller getContentController(UserRequest ureq, WindowControl wControl) {
// the content for the Pop-up Window
return contentControllerCreator.createController(ureq, wControl);
}
@Override
public LockableController createTopNavController(UserRequest ureq, WindowControl wControl) {
LockableController topnavCtr = null;
// ----------- topnav, optional (e.g. for imprint, logout) ------------------
if (CoreSpringFactory.containsBean("fullWebApp.MinimalTopNavControllerCreator")) {
ControllerCreator topnavControllerCreator = (ControllerCreator) CoreSpringFactory.getBean("fullWebApp.MinimalTopNavControllerCreator");
topnavCtr = (LockableController) topnavControllerCreator.createController(ureq, wControl);
}
return topnavCtr;
}
@Override
public Controller createHeaderController(UserRequest ureq, WindowControl control) {
Controller headerCtr = null;
// ----------- header, optional (e.g. for logo, advertising ) ------------------
if (CoreSpringFactory.containsBean("fullWebApp.MinimalHeaderControllerCreator")) {
ControllerCreator headerControllerCreator = (ControllerCreator) CoreSpringFactory.getBean("fullWebApp.MinimalHeaderControllerCreator");
headerCtr = headerControllerCreator.createController(ureq, control);
}
return headerCtr;
}
@Override
public LockableController createFooterController(UserRequest ureq, WindowControl control) {
Controller footerCtr = null;
// ----------- footer, optional (e.g. for copyright, powerd by) ------------------
if (CoreSpringFactory.containsBean("fullWebApp.MinimalFooterControllerCreator")) {
ControllerCreator footerCreator = (ControllerCreator) CoreSpringFactory.getBean("fullWebApp.MinimalFooterControllerCreator");
footerCtr = footerCreator.createController(ureq, control);
}
return (LockableController) footerCtr;
}
};
}
use of org.olat.core.gui.control.navigation.SiteInstance in project OpenOLAT by OpenOLAT.
the class AuthBFWCParts method getSiteInstances.
/**
* @see org.olat.core.commons.fullWebApp.BaseFullWebappControllerParts#getSiteInstances(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
*/
@Override
public List<SiteInstance> getSiteInstances(UserRequest ureq, WindowControl wControl) {
SiteDefinitions sitedefs = CoreSpringFactory.getImpl(SiteDefinitions.class);
List<SiteInstance> sites = new ArrayList<SiteInstance>();
for (SiteDefinition sitedef : sitedefs.getSiteDefList()) {
SiteInstance site = sitedef.createSite(ureq, wControl);
if (site != null) {
// site == null means that site is not visible to the current user
sites.add(site);
}
}
return sites;
}
use of org.olat.core.gui.control.navigation.SiteInstance 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);
}
}
}
}
use of org.olat.core.gui.control.navigation.SiteInstance in project openolat by klemens.
the class BaseFullWebappController method popTheTabState.
private void popTheTabState(UserRequest ureq) {
if (siteAndTabs.isEmpty() && sites != null) {
SiteInstance firstSite = sites.get(0);
BornSiteInstance bs = siteToBornSite.get(firstSite);
if (bs == null) {
activateSite(firstSite, ureq, null, false);
} else {
doActivateSite(firstSite, bs.getGuiStackHandle());
}
} else if (!siteAndTabs.isEmpty()) {
TabState state = siteAndTabs.remove(siteAndTabs.size() - 1);
if (state.getSite() != null) {
// latest selected static tab
// activate previous chosen static site -> this site has already been
// constructed and is thus in the cache
SiteInstance si = state.getSite();
BornSiteInstance bs = siteToBornSite.get(si);
// bs != null since clicked previously
GuiStack gsh = bs.getGuiStackHandle();
doActivateSite(si, gsh);
if (siteToBusinessPath.containsValue(si)) {
ureq.getUserSession().addToHistory(ureq, siteToBusinessPath.get(si));
}
} else if (state.getDtab() != null && !state.getDtab().getController().isDisposed()) {
DTab tab = state.getDtab();
doActivateDTab(tab);
if (dtabToBusinessPath.containsKey(tab)) {
ureq.getUserSession().addToHistory(ureq, dtabToBusinessPath.get(tab));
}
} else {
popTheTabState(ureq);
}
}
}
use of org.olat.core.gui.control.navigation.SiteInstance in project openolat by klemens.
the class GuestBFWCParts method getSiteInstances.
/**
* @see org.olat.core.commons.fullWebApp.BaseFullWebappControllerParts#getSiteInstances(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
*/
@Override
public List<SiteInstance> getSiteInstances(UserRequest ureq, WindowControl wControl) {
SiteDefinitions sitedefs = CoreSpringFactory.getImpl(SiteDefinitions.class);
List<SiteInstance> sites = new ArrayList<SiteInstance>();
for (SiteDefinition sitedef : sitedefs.getSiteDefList()) {
SiteInstance site = sitedef.createSite(ureq, wControl);
if (site != null) {
// site == null means that site is not visible to the current user
sites.add(site);
}
}
return sites;
}
Aggregations