Package org.olat.core.id.context

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


    }
  }
 
   
  private static WindowControl updateBusinessPath(UserRequest ureq, WindowControl wControl) {
    ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ureq.getIdentity());
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, wControl);
    return bwControl;
  }
View Full Code Here


   * @return
   */
  public Controller createWikiController(UserRequest ureq, WindowControl wControl) {
    // Check for jumping to certain wiki page
    BusinessControl bc = wControl.getBusinessControl();
    ContextEntry ce = bc.popLauncherContextEntry();
   
    SubscriptionContext subContext = new SubscriptionContext(ores, WikiManager.WIKI_RESOURCE_FOLDER_NAME);
    boolean isOlatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
    boolean isGuestOnly = ureq.getUserSession().getRoles().isGuestOnly();
    boolean isResourceOwner = ManagerFactory.getManager().isIdentityPermittedOnResourceable(ureq.getIdentity(), Constants.PERMISSION_ACCESS, ores);
    WikiSecurityCallback callback = new WikiSecurityCallbackImpl(null, isOlatAdmin, isGuestOnly, true, isResourceOwner, subContext);
    if ( ce != null ) { //jump to a certain context
      OLATResourceable ceOres = ce.getOLATResourceable();
      String typeName = ceOres.getResourceableTypeName();
      String page = typeName.substring("page=".length());
      if(page != null && page.endsWith(":0")) {
        page = page.substring(0, page.length() - 2);
      }
View Full Code Here

      // Increment launch counter
      rm.incrementLaunchCounter(entry);
      OLATResource ores = entry.getOlatResource();
      ICourse course = loadCourse(ores);
     
      ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(entry);
      WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, wControl)
     
      RunMainController launchC = new RunMainController(ureq, bwControl, course, null, false, false);
      return launchC;     
    }   
View Full Code Here

   * @param ureq
   * @param wControl
   */
  public void launch(UserRequest ureq, WindowControl wControl) {
    BusinessControl bc = wControl.getBusinessControl();
    ContextEntry mainCe = bc.popLauncherContextEntry();
    OLATResourceable ores = mainCe.getOLATResourceable();

    // Check for RepositoryEntry resource
    boolean ceConsumed = false;
    if (ores.getResourceableTypeName().equals(OresHelper.calculateTypeName(RepositoryEntry.class))) {
      // It is a repository-entry => get OLATResourceable from RepositoryEntry
      RepositoryManager repom = RepositoryManager.getInstance();
      RepositoryEntry re = repom.lookupRepositoryEntry(ores.getResourceableId());
      ores = re.getOlatResource();
      ceConsumed = true;
    }

    // was brasato:: DTabs dts = wControl.getDTabs();
    Window window = Windows.getWindows(ureq.getUserSession()).getWindow(ureq);

    if (window == null) {
      logDebug("Found no window for jumpin => take WindowBackOffice", null);
      window = wControl.getWindowBackOffice().getWindow();
    }
    DTabs dts = (DTabs) window.getAttribute("DTabs");
    DTab dt = dts.getDTab(ores);
    if (dt != null) {
      // tab already open => close it
      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
View Full Code Here

TOP

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

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.