Package org.olat.core.gui.control.generic.layout

Examples of org.olat.core.gui.control.generic.layout.MainLayoutController


  /**
   * @see org.olat.navigation.SiteInstance#createController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
   */
  public MainLayoutController createController(UserRequest ureq, WindowControl wControl) {
    MainLayoutController c = new GUIDemoMainController(ureq, wControl);
    return c;
  }
View Full Code Here


  public BaseFullWebappPopupBrowserWindow(UserRequest ureq, WindowControl wControl,
      BaseFullWebappControllerParts baseFullWebappControllerParts) {
    super(ureq, wControl, baseFullWebappControllerParts);
    // apply custom css if available
    if (contentCtrl != null && contentCtrl instanceof MainLayoutController) {
      MainLayoutController mainLayoutCtr = (MainLayoutController) contentCtrl;
      addCurrentCustomCSSToView(mainLayoutCtr.getCustomCSS());
    }
  }
View Full Code Here

  /**
   * @see org.olat.navigation.SiteInstance#createController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
   */
  public MainLayoutController createController(UserRequest ureq, WindowControl wControl) {
    MainLayoutController c = ControllerFactory.createLaunchController(ORES_TESTING, null, ureq, wControl, true);
    return c;
  }
View Full Code Here

  /**
   * @see org.olat.navigation.SiteInstance#createController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
   */
  public MainLayoutController createController(UserRequest ureq, WindowControl wControl) {
    MainLayoutController c = ControllerFactory.createLaunchController(ORES_GUEST, null, ureq, wControl, true);
    return c;
  }
View Full Code Here

    boolean isDebug = Tracing.isDebugEnabled(CourseFactory.class);
    long startT = 0;
    if(isDebug){
      startT = System.currentTimeMillis();
    }
    MainLayoutController launchC = new RunMainController(ureq, wControl, course, initialViewIdentifier, true, true);
    if(isDebug){
      Tracing.logDebug("Runview for [["+course.getCourseTitle()+"]] took [ms]"+(System.currentTimeMillis() - startT), CourseFactory.class);
    }
   
    return launchC;
View Full Code Here

  /**
   * @see org.olat.navigation.SiteInstance#createController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
   */
  public MainLayoutController createController(UserRequest ureq, WindowControl wControl) {
    MainLayoutController c = ControllerFactory.createLaunchController(ORES_AUTHUSER, null, ureq, wControl, true);
    return c;
  }
View Full Code Here

    } else if (OresHelper.isOfType(olatResourceable, RepositoryEntry.class)) {
      // it this is a respository type, the resourceableID is the repository
      // entry key
      RepositoryManager rm = RepositoryManager.getInstance();
      RepositoryEntry re = rm.lookupRepositoryEntry(olatResourceable.getResourceableId());
      MainLayoutController ctrl = RepositoyUIFactory.createLaunchController(re, initialViewIdentifier, ureq, wControl);
      if (ctrl != null) return ctrl;

    } else if (OresHelper.isOfType(olatResourceable, CourseModule.class)) {
      // gets called by subscription launcher
      //FIXME:fj:make it clearer here: subscriptioncontext is always given by
      // the surrounding resource, but for launching we always need the
      // repoentry
      // if it is a course, we also take the repository entry, since a course
      // can only be called by a repoentry
      RepositoryManager rm = RepositoryManager.getInstance();
      RepositoryEntry re = rm.lookupRepositoryEntry(olatResourceable, false);
      MainLayoutController ctrl = RepositoyUIFactory.createLaunchController(re, initialViewIdentifier, ureq, wControl);
      if (ctrl != null) return ctrl;
    } else if (OresHelper.isOfType(olatResourceable, AssessmentManager.class)) {
      // gets called by subscription launcher
      //FIXME:fj:make it clearer here: subscriptioncontext is always given by
      // the surrounding resource, but for launching we always need the
      // repoentry
      // if it is a course, we also take the repository entry, since a course
      // can only be called by a repoentry
      RepositoryManager rm = RepositoryManager.getInstance();
      // launch course with view identifyer assessment tool. however notifications
      // publisher data provides not existing assessmentManager resource
      OLATResourceable fakedCourseResource = OresHelper.createOLATResourceableInstance(CourseModule.class, olatResourceable.getResourceableId());
      RepositoryEntry re = rm.lookupRepositoryEntry(fakedCourseResource, false);
      MainLayoutController ctrl = RepositoyUIFactory.createLaunchController(re, "assessmentTool", ureq, wControl);
     
      if (ctrl != null) return ctrl;
    } else if (OresHelper.isOfType(olatResourceable, DropboxController.class)) {
      // JumpIn-handling for task-dropbox notification
      RepositoryManager rm = RepositoryManager.getInstance();
      OLATResourceable fakedCourseResource = OresHelper.createOLATResourceableInstance(CourseModule.class, olatResourceable.getResourceableId());
      RepositoryEntry re = rm.lookupRepositoryEntry(fakedCourseResource,false);
      if (re == null) {
        return null;// found no repositoryEntry => return null
      }
      MainLayoutController ctrl = RepositoyUIFactory.createLaunchController(re, "assessmentTool:nodeChoose", ureq, wControl)
      if (ctrl != null) return ctrl;
    } else if (OresHelper.isOfType(olatResourceable, ReturnboxController.class)) {
      // JumpIn-handling for task-returnbox notification
      RepositoryManager rm = RepositoryManager.getInstance();
      OLATResourceable fakedCourseResource = OresHelper.createOLATResourceableInstance(CourseModule.class, olatResourceable.getResourceableId());
      RepositoryEntry re = rm.lookupRepositoryEntry(fakedCourseResource, false);
      MainLayoutController ctrl = RepositoyUIFactory.createLaunchController(re, initialViewIdentifier, ureq, wControl)
      if (ctrl != null) return ctrl;
    }

    // --- repository ---
    else if (OresHelper.isOfType(olatResourceable, RepositoryMainController.class)) {
      return new RepositoryMainController(ureq, wControl);
    }
    // --- home ---
    else if (OresHelper.isOfType(olatResourceable, HomeMainController.class)) {
      if (roles.isGuestOnly()) throw new OLATSecurityException("Tried to launch a HomeMainController, but is in guest group " + roles);
      return new HomeMainController(ureq, wControl);
    } else if (OresHelper.isOfType(olatResourceable, SystemAdminMainController.class)) {
      if (!roles.isOLATAdmin()) throw new OLATSecurityException("Tried to launch a SystemAdminMainController, but is not in admin group " + roles);
      return new SystemAdminMainController(ureq, wControl);
    } else if (OresHelper.isOfType(olatResourceable, UserAdminMainController.class)) {
      if (!roles.isUserManager()) throw new OLATSecurityException("Tried to launch a UserAdminMainController, but is not in admin group " + roles);
      return new UserAdminMainController(ureq, wControl);
    } else if (OresHelper.isOfType(olatResourceable, BGContextManagementController.class)) {
      if (!roles.isGroupManager()) throw new OLATSecurityException("Tried to launch a BGContextManagementController, but is not in group groupmanager "
          + roles);
      return new BGContextManagementController(ureq, wControl);
    } else if (OresHelper.isOfType(olatResourceable, GuestHomeMainController.class)) {
      if (!roles.isGuestOnly()) throw new OLATSecurityException("Tried to launch a GuestMainController, but is not in guest group " + roles);
      return new GuestHomeMainController(ureq, wControl);
    } else if (OresHelper.isOfType(olatResourceable, GUIDemoMainController.class)) {
      if (!roles.isOLATAdmin()) throw new OLATSecurityException("Tried to launch a GUIDemoMainController, but is not in admin group "
          + roles);
      return new GUIDemoMainController(ureq, wControl);
    } else { // ask the handlerfactory of the repository if it can handle it
      // a repository entry ?
      RepositoryManager rm = RepositoryManager.getInstance();
      //OLAT-1842
      //if the LaunchController is created from a link click in a
      //notification list/email then we cannot be strict in the repoentry lookup.
      //Because the notification can live longer then the resource it is pointing to.
      RepositoryEntry re = rm.lookupRepositoryEntry(olatResourceable, false);
      //but now we have to handle the NULL case.
      //from the method signature it follows that one can choose if the method
      //should throw the "Unable to creat..." exception or to return null.
      //Hence it follows to set the ctrl == null if no repoentry found.
      MainLayoutController ctrl;
      if(re == null){
        ctrl = null;
      }else{
        ctrl = RepositoyUIFactory.createLaunchController(re, initialViewIdentifier, ureq, wControl);
      }
View Full Code Here

TOP

Related Classes of org.olat.core.gui.control.generic.layout.MainLayoutController

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.