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

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


    }
    // either sites is null or contains at least one SiteInstance.
    if (sites != null) {
      // create the links for the sites
      for (Iterator<SiteInstance> iterator = sites.iterator(); iterator.hasNext();) {
        SiteInstance si = iterator.next();
        Link link = LinkFactory.createCustomLink("t" + navLinkCounter, "t", "", Link.NONTRANSLATED, navVc, this);
        link.setCustomDisplayText(si.getNavElement().getTitle());
        link.setTitle(si.getNavElement().getDescription());
        link.setUserObject(si);
        Character accessKey = si.getNavElement().getAccessKey();
        if (accessKey != null && StringHelper.containsNonWhitespace(accessKey.toString())) {
          link.setAccessKey(accessKey.toString());         
        }
        navLinkCounter++;
      }
View Full Code Here


  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();
        activateSite(s, ureq, null);
      } else if (mC.equals("a")) { // activate dyntab
        DTab dt = (DTab) link.getUserObject();
        doActivateDTab((DTabImpl) dt);
      } else if (mC.equals("u")) { // undock dyntab
View Full Code Here

      if (delt == curDTab) { // if we close the current tab -> return to the
        // latest selected static tab
        // pre: prevSite != null
        // activate previous chosen static site -> this site has already been
        // constructed and is thus in the cache
        SiteInstance si = prevSite;
        BornSiteInstance bs = siteToBornSite.get(si);
        // bs != null since clicked previously
        GuiStack gsh = bs.getGuiStackHandle();
        doActivateSite(si, gsh);
      } // else just remove the dtabs
View Full Code Here

   *      java.lang.String, java.lang.String)
   */
  // brasato:: remove
  public void activateStatic(UserRequest ureq, String className, String viewIdentifier) {
    for (Iterator it_sites = sites.iterator(); it_sites.hasNext();) {
      SiteInstance site = (SiteInstance) it_sites.next();
      String cName = site.getClass().getName();
      if (cName.equals(className)) {
        activateSite(site, ureq, viewIdentifier);
        return;
      }
    }
View Full Code Here

    // empty-string-case
    char ch = state.charAt(0);
    switch (ch) {
      case 's': // static site selection
        int pos = Integer.parseInt(state.substring(1));
        SiteInstance s = sites.get(pos);
        activateSite(s, ureq, null);
        break;
      case 'd': // dynamic tab selection
        String oresString = state.substring(1);
        for (int i = 0; i < dtabs.size(); i++) {
View Full Code Here

    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());
        }
      }
    }
View Full Code Here

    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());
        }
      }
    }
View Full Code Here

 
  /**
   * @see org.olat.navigation.SiteDefinition#createSite(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
   */
  public SiteInstance createSite(UserRequest ureq, WindowControl wControl) {
    SiteInstance si = null;
    if (ureq.getUserSession().getRoles().isUserManager()) {
      // only open for olat-usermanagers
      si = new UserAdminSite(ureq.getLocale());
    }
    return si;
View Full Code Here

 
  /**
   * @see org.olat.navigation.SiteDefinition#createSite(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
   */
  public SiteInstance createSite(UserRequest ureq, WindowControl wControl) {
    SiteInstance si = null;
    if (ureq.getUserSession().getRoles().isOLATAdmin()) {
      // only open for olat-admins
      si = new AdminSite(ureq.getLocale());
    }
    return si;
View Full Code Here

  /**
   * @see org.olat.navigation.SiteDefinition#createSite(org.olat.core.gui.UserRequest,
   *      org.olat.core.gui.control.WindowControl)
   */
  public SiteInstance createSite(UserRequest ureq, WindowControl wControl) {
    SiteInstance si = null;
    if (!ureq.getUserSession().getRoles().isGuestOnly()) {
      // all except guests see this site
      si = new GroupsSite(ureq.getLocale());
    }
    return si;
View Full Code Here

TOP

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

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.