Package org.olat.core.extensions

Examples of org.olat.core.extensions.ExtManager


        }
      }
    }

    // add extension menues
    ExtManager extm = ExtManager.getInstance();
    int cnt = extm.getExtensionCnt();
    int j = 0;
    for (int i = 0; i < cnt; i++) {
      Extension anExt = extm.getExtension(i);
      // check for sites
      GenericActionExtension ae = (GenericActionExtension) anExt.getExtensionFor(className);
      if (ae != null) {
        gtnChild = new GenericTreeNode();
        String menuText = ae.getActionText(getLocale());
View Full Code Here


           */
          if (sessionFactory == null) {
            Configuration cfg = DatabaseSetup.datastoreConfiguration();

            // let all extensions add hibernate configuration, if needed
            ExtManager extm = null;
            try {
              extm = ExtManager.getInstance();
            } catch (Exception e) {
              throw new OLATRuntimeException(this.getClass(), "Can not load extensions. Check xml files.", e);
            }
            Class extensionPoint = this.getClass();
            int cnt = extm.getExtensionCnt();
            for (int i = 0; i < cnt; i++) {
              Extension anExt = extm.getExtension(i);
              HibernateConfigurator hibconfigure = (HibernateConfigurator) anExt.getExtensionFor(extensionPoint.getName());
              if (hibconfigure != null) {
                hibconfigure.extend(cfg);
                extm.inform(extensionPoint, anExt, "added hibernate configuration");
              }
            }

            // set audit interceptor that traces lastChanged
            cfg.setInterceptor(new AuditInterceptor());
View Full Code Here

    gtn.setUserObject(MENU_OTHERUSERS);
    gtn.setAltText(translate("menu.otherusers.alt"));
    root.addChild(gtn);

    // add extension menues
    ExtManager extm = ExtManager.getInstance();
    Class<? extends HomeMainController> extensionPointMenu = this.getClass();
    int cnt = extm.getExtensionCnt();
    for (int i = 0; i < cnt; i++) {
      Extension anExt = extm.getExtension(i);
      // check for sites
      ActionExtension ae = (ActionExtension) anExt.getExtensionFor(extensionPointMenu.getName());
      if (ae != null) {
        gtn = new GenericTreeNode();
        String menuText = ae.getActionText(getLocale());
        gtn.setTitle(menuText);
        gtn.setUserObject(ae);
        gtn.setAltText(ae.getDescription(getLocale()));
        root.addChild(gtn);
        // inform only once
        if (!extensionLogged) {
          extensionLogged = true;
          extm.inform(extensionPointMenu, anExt, "added menu entry (for locale " + getLocale().toString() + " '" + menuText + "'");
        }
      }
    }

    return gtm;
View Full Code Here

        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

        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

      gtn.setAltText(translate("menu.wikis.alt"));
      root.addChild(gtn);
    }
   
    //add extension menues
    ExtManager extm = ExtManager.getInstance();
    Class extensionPointMenu = this.getClass();
    int cnt = extm.getExtensionCnt();
    for (int i = 0; i < cnt; i++) {
      Extension anExt = extm.getExtension(i);
      // check for sites
      ActionExtension ae = (ActionExtension) anExt.getExtensionFor(extensionPointMenu.getName());
      if (ae != null) {
        gtn = new GenericTreeNode();
        String menuText = ae.getActionText(locale);
        gtn.setTitle(menuText);
        gtn.setUserObject(ae);
        gtn.setAltText(ae.getDescription(locale));
        root.addChild(gtn);
        // inform only once
        if (!extensionLogged) {
          extensionLogged = true;
          extm.inform(extensionPointMenu, anExt, "added menu entry (for locale " + locale.toString() + " '" + menuText + "'");
        }
      }
    }

    return gtm;
View Full Code Here

//    gtnChild.setUserObject("jmx");
//    gtnChild.setAltText(translator.translate("menu.jmx.alt"));
//    admin.addChild(gtnChild);

    //add extension menues
    ExtManager extm = ExtManager.getInstance();
    int cnt = extm.getExtensionCnt();
    for (int i = 0; i < cnt; i++) {
      Extension anExt = extm.getExtension(i);
      // 1) general menu extensions
      ActionExtension ae = (ActionExtension) anExt.getExtensionFor(SystemAdminMainController.class.getName());
      if (ae != null) {
        gtnChild = new GenericTreeNode();
        String menuText = ae.getActionText(getLocale());
        gtnChild.setTitle(menuText);
        gtnChild.setUserObject(ae);
        gtnChild.setAltText(ae.getDescription(getLocale()));
        admin.addChild(gtnChild);
        // inform only once
        if (!extensionLogged) {
          extensionLogged = true;
          extm.inform(SystemAdminMainController.class, anExt, "added menu entry (for locale " + getLocale().toString() + " '" + menuText + "'");
        }
      }
      // 2) check for system configuration submenu extensions
      ae = (ActionExtension) anExt.getExtensionFor(SystemAdminMainController.class.getName() + "_configuration");
      if (ae != null) {
        gtnChild = new GenericTreeNode();
        String menuText = ae.getActionText(getLocale());
        gtnChild.setTitle(menuText);
        gtnChild.setUserObject(ae);
        gtnChild.setAltText(ae.getDescription(getLocale()));
        confSub.addChild(gtnChild);
        // inform only once
        if (!configExtensionLogged) {
          configExtensionLogged = true;
          extm.inform(SystemAdminMainController.class, anExt, "added configuration submenu entry (for locale " + getLocale().toString() + " '" + menuText + "'");
        }
      }
    }
   
    return gtm;
View Full Code Here

    gtnChild.setUserObject("created.newUsersNotification");
    gtnChild.setAltText(translator.translate("menu.created.newUsersNotification.alt"));
    gtn3.addChild(gtnChild);

    //add extension menues as child items
    ExtManager extm = ExtManager.getInstance();
    int cnt = extm.getExtensionCnt();
    for (int i = 0; i < cnt; i++) {
      Extension anExt = extm.getExtension(i);
      // 1) general menu extensions
      ActionExtension ae = (ActionExtension) anExt.getExtensionFor(UserAdminMainController.class.getName() + EXTENSIONPOINT_MENU_MENUQUERIES);
      if (ae != null) {
        gtnChild = new GenericTreeNode();
        String menuText = ae.getActionText(getLocale());
View Full Code Here

    } else {
      log.info("LDAP cron sync is disabled");
    }
   
    // Add admin console to admin site menu
    ExtManager extManager = ExtManager.getInstance();
    List<LDAPAdminExtension> extensions = extManager.getExtensions();
    extensions.add(new LDAPAdminExtension());
    extManager.setExtensions(extensions);
   
    // OK, everything finished checkes passed
    log.info("LDAP login is enabled");
  }
View Full Code Here

    // get CourseNodeFactory... will initialize and bossibly throw
    // StartupException
    CourseNodeFactory.getInstance();
   
    //
    ExtManager extManager = ExtManager.getInstance();
    List extensions = extManager.getExtensions();
    extensions.add(new AdminCourseExtension());
    extManager.setExtensions(extensions);
   
   
   
   
   
View Full Code Here

TOP

Related Classes of org.olat.core.extensions.ExtManager

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.