Package org.olat.core.id.context

Examples of org.olat.core.id.context.ContextEntryControllerCreator


   *
   * @param key
   * @param controllerCreator
   */
  public synchronized void addContextEntryControllerCreator(String key, ContextEntryControllerCreator controllerCreator) {
    ContextEntryControllerCreator oldCreator = contextEntryControllerCreators.get(key);
    contextEntryControllerCreators.put(key, controllerCreator);
    // Add config logging to console
    logInfo("Adding context entry controller creator for key::" + key + " and value::" + controllerCreator.getClass().getCanonicalName()
        + (oldCreator == null ? "" : " replaceing existing controller creator ::" + oldCreator.getClass().getCanonicalName()), null);
  }
View Full Code Here


      dts.removeDTab(dt);// disposes also dt and controllers
    }

    String firstType = mainCe.getOLATResourceable().getResourceableTypeName();
    // String firstTypeId = ClassToId.getInstance().lookup() BusinessGroup
    ContextEntryControllerCreator typeHandler = contextEntryControllerCreators.get(firstType);
    if (typeHandler == null) throw new AssertException("Unable to get a handler for the type: " + firstType);

    String siteClassName = typeHandler.getSiteClassName(mainCe);
    // open in existing site
    if (siteClassName != null) {
      // use special activation key to trigger the activate method
      String viewIdentifyer = null;
      if (bc.hasContextEntry()) {
        ContextEntry subContext = bc.popLauncherContextEntry();
        if (subContext != null) {
          OLATResourceable subResource = subContext.getOLATResourceable();
          if (subResource != null) {
            viewIdentifyer = subResource.getResourceableTypeName();
            if (subResource.getResourceableId() != null) {
              // add resource instance id if available. The ':' is a common
              // separator in the activatable interface
              viewIdentifyer = viewIdentifyer + ":" + subResource.getResourceableId();
            }
          }
        }
      } else if (!ceConsumed) {
        //the olatresourceable is not in a dynamic tab but in a fix one
        if(ores != null) {
          viewIdentifyer = ores.getResourceableTypeName();
          if (ores.getResourceableId() != null) {
            // add resource instance id if available. The ':' is a common
            // separator in the activatable interface
            viewIdentifyer = viewIdentifyer + ":" + ores.getResourceableId();
          }
        }
      }
      dts.activateStatic(ureq, siteClassName, viewIdentifyer);
    } else {
      // or create new tab
      String tabName = typeHandler.getTabName(mainCe);
      // create and add Tab
      dt = dts.createDTab(ores, tabName);
      if (dt == null) {
        // tabs are full: TODO
        // user error message is generated in BaseFullWebappController, nothing
        // to do here
      } else {

        WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, dt.getWindowControl());
        Controller launchC = typeHandler.createController(mainCe, ureq, bwControl);

        dt.setController(launchC);
        dts.addDTab(dt);
      }
View Full Code Here

TOP

Related Classes of org.olat.core.id.context.ContextEntryControllerCreator

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.