Package org.olat.core.gui.control.navigation

Examples of org.olat.core.gui.control.navigation.SiteDefinition


    List<SiteInstance>sites = new ArrayList<SiteInstance>();
    SiteDefinitions sitedefs = (SiteDefinitions) ExtensionManager.getInstance().getBean("olatsites");
    List<SiteDefinition> sitedeflist = sitedefs.getSiteDefList();

    for (Iterator<SiteDefinition> it_sites = sitedeflist.iterator(); it_sites.hasNext();) {
      SiteDefinition sitedef = it_sites.next();
      SiteInstance site = sitedef.createSite(ureq, wControl);
      if (site != null) {
        // site == null means that site is not visible to the current user
        sites.add(site);
      }
    }

    // let all extensions add sitedefinitions
    ExtManager extm = ExtManager.getInstance();
    Class extensionPointSites = DTabs.class;
    int cnt = extm.getExtensionCnt();
    for (int i = 0; i < cnt; i++) {
      Extension anExt = extm.getExtension(i);
      // check for sites
      SitesCreator sc = (SitesCreator) anExt.getExtensionFor(extensionPointSites.getName());
      if (sc != null) {
        List extsitedefs = sc.createSiteDefinitions();
        for (Iterator it_extsites = extsitedefs.iterator(); it_extsites.hasNext();) {
          SiteDefinition sdef = (SiteDefinition) it_extsites.next();
          SiteInstance si = sdef.createSite(ureq, wControl);
          sites.add(si);
          extm.inform(extensionPointSites, anExt, "added sitedefinition " + sdef.getClass().getName());
        }
      }
    }
   
    return sites;
View Full Code Here


    List<SiteInstance>sites = new ArrayList<SiteInstance>();
    SiteDefinitions sitedefs = (SiteDefinitions) ExtensionManager.getInstance().getBean("olatsites");
    List<SiteDefinition> sitedeflist = sitedefs.getSiteDefList();

    for (Iterator<SiteDefinition> it_sites = sitedeflist.iterator(); it_sites.hasNext();) {
      SiteDefinition sitedef = it_sites.next();
      SiteInstance site = sitedef.createSite(ureq, wControl);
      if (site != null) {
        // site == null means that site is not visible to the current user
        sites.add(site);
      }
    }

    // let all extensions add sitedefinitions
    ExtManager extm = ExtManager.getInstance();
    Class extensionPointSites = DTabs.class;
    int cnt = extm.getExtensionCnt();
    for (int i = 0; i < cnt; i++) {
      Extension anExt = extm.getExtension(i);
      // check for sites
      SitesCreator sc = (SitesCreator) anExt.getExtensionFor(extensionPointSites.getName());
      if (sc != null) {
        List extsitedefs = sc.createSiteDefinitions();
        for (Iterator it_extsites = extsitedefs.iterator(); it_extsites.hasNext();) {
          SiteDefinition sdef = (SiteDefinition) it_extsites.next();
          SiteInstance si = sdef.createSite(ureq, wControl);
          sites.add(si);
          extm.inform(extensionPointSites, anExt, "added sitedefinition " + sdef.getClass().getName());
        }
      }
    }
   
    return sites;
View Full Code Here

        return dsc;
      }
    });

    // --- create a new site:
    SiteDefinition s1 = new DemoSiteDef();
    final List sitedefs = new ArrayList();
    sitedefs.add(s1);
    elements.putExtensionElement(DTabs.class.getName(), new SitesCreator() {
      public List createSiteDefinitions() {
        return sitedefs;
View Full Code Here

TOP

Related Classes of org.olat.core.gui.control.navigation.SiteDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.