Search in sources :

Example 1 with SiteInstance

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;
        }
    };
}
Also used : SiteInstance(org.olat.core.gui.control.navigation.SiteInstance) LockableController(org.olat.core.commons.fullWebApp.LockableController) BaseFullWebappControllerParts(org.olat.core.commons.fullWebApp.BaseFullWebappControllerParts) WindowControl(org.olat.core.gui.control.WindowControl) LockableController(org.olat.core.commons.fullWebApp.LockableController) Controller(org.olat.core.gui.control.Controller) UserRequest(org.olat.core.gui.UserRequest) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator)

Example 2 with SiteInstance

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;
}
Also used : SiteDefinition(org.olat.core.gui.control.navigation.SiteDefinition) SiteInstance(org.olat.core.gui.control.navigation.SiteInstance) ArrayList(java.util.ArrayList) SiteDefinitions(org.olat.core.gui.control.navigation.SiteDefinitions)

Example 3 with SiteInstance

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);
            }
        }
    }
}
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 4 with SiteInstance

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);
        }
    }
}
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) BornSiteInstance(org.olat.core.gui.control.navigation.BornSiteInstance) GuiStack(org.olat.core.gui.control.guistack.GuiStack)

Example 5 with SiteInstance

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;
}
Also used : SiteDefinition(org.olat.core.gui.control.navigation.SiteDefinition) SiteInstance(org.olat.core.gui.control.navigation.SiteInstance) ArrayList(java.util.ArrayList) SiteDefinitions(org.olat.core.gui.control.navigation.SiteDefinitions)

Aggregations

SiteInstance (org.olat.core.gui.control.navigation.SiteInstance)16 BornSiteInstance (org.olat.core.gui.control.navigation.BornSiteInstance)10 ArrayList (java.util.ArrayList)6 DTab (org.olat.core.gui.control.generic.dtabs.DTab)6 Link (org.olat.core.gui.components.link.Link)4 Controller (org.olat.core.gui.control.Controller)4 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)4 GuiStack (org.olat.core.gui.control.guistack.GuiStack)4 SiteDefinition (org.olat.core.gui.control.navigation.SiteDefinition)4 SiteDefinitions (org.olat.core.gui.control.navigation.SiteDefinitions)4 LandingPagesModule (org.olat.admin.landingpages.LandingPagesModule)2 LayoutModule (org.olat.admin.layout.LayoutModule)2 LogoInformations (org.olat.admin.layout.LogoInformations)2 BaseChiefController (org.olat.core.commons.chiefcontrollers.BaseChiefController)2 ResumeSessionController (org.olat.core.commons.controllers.resume.ResumeSessionController)2 BaseFullWebappControllerParts (org.olat.core.commons.fullWebApp.BaseFullWebappControllerParts)2 LockableController (org.olat.core.commons.fullWebApp.LockableController)2 UserRequest (org.olat.core.gui.UserRequest)2 Component (org.olat.core.gui.components.Component)2 CountDownComponent (org.olat.core.gui.components.countdown.CountDownComponent)2