Package org.olat.core.gui.components.panel

Examples of org.olat.core.gui.components.panel.Panel


  private static final String PROPERTY_CAT = "afterLogin";

  public AfterLoginInterceptionController(UserRequest ureq, WindowControl wControl) {
    super(ureq, wControl);
    vC = createVelocityContainer("afterlogin");
    actualPanel = new Panel("actualPanel");
    AfterLoginInterceptionManager aLIM = AfterLoginInterceptionManager.getInstance();
    if (!aLIM.containsAnyController()) return;   
    List<Map<String, Object>> aftctrlsTmp = aLIM.getAfterLoginControllerList();
    aftctrls = (List<Map<String, Object>>) ((ArrayList<Map<String, Object>>) aftctrlsTmp).clone();
    // load all UserProps concerning afterlogin/runOnce workflow => only 1
View Full Code Here


  public GenericArchiveController(UserRequest ureq, WindowControl wControl, OLATResourceable ores, CourseNode nodeType) {
    super(ureq, wControl);

    this.ores = ores;
    this.nodeType = nodeType;
    main = new Panel("main");
    nodeChoose = createVelocityContainer("nodechoose");
    nodeChoose.contextPut("nodeType",nodeType.getType());
    doNodeChoose(ureq);   
    putInitialPanel(main);
  }
View Full Code Here

    renderInstructions.put(RenderInstructions.KEY_STATICS_PATH, qtiPackage.getMediaBaseURL() + "/");
    renderInstructions.put(RenderInstructions.KEY_LOCALE, translator.getLocale());
    renderInstructions.put(RenderInstructions.KEY_RENDER_TITLE, Boolean.TRUE);
    main = new VelocityContainer("vcItemPreview", VC_ROOT + "/tab_itemPreview.html", translator, this);
    main.contextPut("itemPreview", getQuestionPreview(item));
    mainPanel = new Panel("itemPreviewPanel");
    mainPanel.setContent(main);
    setInitialComponent(mainPanel);
  }
View Full Code Here

    this.calendars = calendars;
       
    mainVC = new VelocityContainer("calSearchMain", VELOCITY_ROOT + "/calSearchMain.html", translator, this);
    backLink = LinkFactory.createLinkBack(mainVC, this);
    mainVC.contextPut("displayBackLink", Boolean.FALSE);
    panel = new Panel("panel");
    searchForm = new SearchAllCalendarsForm("calSearch", translator);
    searchForm.addListener(this);

    panel.setContent(searchForm);
    mainVC.put("panel", panel);
View Full Code Here

    // log shows who entered which course, this can then be further used to jump
    // to the courselog
    Tracing.logAudit("Entering course: [[["+courseTitle+"]]]", course.getResourceableId().toString(), RunMainController.class);
   
    // set up the components
    all = new Panel("allofcourse");
    luTree = new MenuTree("luTreeRun", this);
    contentP = new Panel("building_block_content");

    // get all group memberships for this course
    initGroupMemberships(identity);
    // Initialize the the users roles and right for this course
    // 1) is guest flag
    isGuest = ureq.getUserSession().getRoles().isGuestOnly();
    // 2) all course internal rights
    initUserRolesAndRights(identity);

    // preload user assessment data in assessmnt properties cache to speed up
    // course loading
    course.getCourseEnvironment().getAssessmentManager().preloadCache(identity);

    // build up the running structure for this user;
    uce = new UserCourseEnvironmentImpl(ureq.getUserSession().getIdentityEnvironment(), course.getCourseEnvironment());
    // build score now
    uce.getScoreAccounting().evaluateAll();
    navHandler = new NavigationHandler(uce, false);

    // jump to either the forum or the folder if the business-launch-path says
    // so.
    boolean showAssessmentTool = false;
   
    BusinessControl bc = getWindowControl().getBusinessControl();
    ContextEntry ce = bc.popLauncherContextEntry();
    if (ce != null) {
      logDebug("businesscontrol (for further jumps) would be:" + bc, null);
      OLATResourceable ores = ce.getOLATResourceable();
      logDebug("OLATResourceable=" + ores, null);
      if (OresHelper.isOfType(ores, CourseNode.class)) {
        // TODO, don't use CourseNode.class, but a lookup using the ClassToId
        // class
        // jump to the coursenode with id
        Long nodeId = ores.getResourceableId();
        String nodeIdS = nodeId.toString();
        currentCourseNode = course.getRunStructure().getNode(nodeIdS);
        if (currentCourseNode == null) {
          // (e.g. a coursenode that no longer is accessible or existing)
          // -> fallback to root node (automatically done later), and drop wrong
          // remaining contexts
          logDebug("currentCourseNode=null => dropLauncherEntries for nodeIdS=" + nodeIdS, null);
          bc.dropLauncherEntries();
        }
      } else if ("assessmentTool".equals(ores.getResourceableTypeName())) {
        showAssessmentTool = true;
      }
    }
    /*
     * ContextEntry curCe = bc.getCurrentEntryAndAdvance(); if (curCe != null) { //
     * e.g something like FOCourseNode:3243 or AssementTool:0 or AssmentTool:1
     * (0,1 must be dokumented) OLATResourceable ores =
     * curCe.getOLATResourceable(); if (OresHelper.isOfType(ores,
     * CourseNode.class)) { // TODO, don't use CourseNode.class, but a lookup
     * using the ClassToId class // jump to the coursenode with id Long nodeId =
     * ores.getResourceableId(); String nodeIdS = nodeId.toString();
     * currentCourseNode = course.getRunStructure().getNode(nodeIdS); } else {
     * //TODO assessment tool } }
     */
   
   
    String subsubId = null;
    String assessmentViewIdentifier = null;
    // activate assessent tool or node as the first screen
    if (initialViewIdentifier != null) {
      if (initialViewIdentifier.equals("assessmentTool")) {
        showAssessmentTool = true;
        // assessmentViewIdentifier must be null
      } else if (initialViewIdentifier.equals("assessmentTool:nodeChoose")) {
        showAssessmentTool = true;
        assessmentViewIdentifier = "node-choose";
      } else {
        // check for subsubIdent
        if (initialViewIdentifier.indexOf(":") != -1) {
          String[] viewIdentifier = initialViewIdentifier.split(":");
          currentCourseNode = course.getRunStructure().getNode(viewIdentifier[0]);
          subsubId = viewIdentifier[1];
        } else {
          currentCourseNode = course.getRunStructure().getNode(initialViewIdentifier);
        }
      }
    }

    updateTreeAndContent(ureq, currentCourseNode, subsubId);

    if (courseRepositoryEntry != null && RepositoryManager.getInstance().createRepositoryEntryStatus(courseRepositoryEntry.getStatusCode()).isClosed()) {
      wControl.setWarning(translate("course.closed"));
    }
   
    // instant messaging: send presence like "reading course: Biology I" as
    // awareness info. Important: do this before initializing the toolbox
    // controller!
    if (InstantMessagingModule.isEnabled() && CourseModule.isCourseChatEnabled() && !isGuest) {
      String intro = translate("course.presence.message.enter") + " " + getExtendedCourseTitle(ureq.getLocale());
      InstantMessagingModule.getAdapter().sendStatus(identity.getName(), intro);

      if (course.getCourseEnvironment().getCourseConfig().isChatEnabled()) {
        // create groupchat room link only if course chat is enabled
        createCourseGroupChatLink(ureq);
      }
    }

    // add text marker wrapper controller to implement course glossary
    // textMarkerCtr must be created before the toolC!
    CourseConfig cc = uce.getCourseEnvironment().getCourseConfig();
    glossaryMarkerCtr = CourseGlossaryFactory.createGlossaryMarkupWrapper(ureq, wControl, contentP, cc);
 
    boolean hasGlossaryRights = hasCourseRight(CourseRights.RIGHT_GLOSSARY) || isCourseAdmin;
    glossaryToolCtr = new CourseGlossaryToolLinkController(getWindowControl(), ureq, course, getTranslator(), hasGlossaryRights,
        uce.getCourseEnvironment(), glossaryMarkerCtr);
    listenTo(glossaryToolCtr);
    // init the menu and tool controller
    toolC = initToolController(identity, ureq);
    Component toolComp = (toolC == null ? null : toolC.getInitialComponent());

    if (glossaryMarkerCtr != null) {
      listenTo(glossaryMarkerCtr);
      // enable / disable glossary highlighting according to user prefs
      Preferences prefs = ureq.getUserSession().getGuiPreferences();
      Boolean state = (Boolean) prefs.get(CourseGlossaryToolLinkController.class, CourseGlossaryFactory.createGuiPrefsKey(course));

      //Glossary always on for guests. OLAT-4241
      if(ureq.getUserSession().getRoles().isGuestOnly()){
        state = Boolean.TRUE;
      }
     
      if (state == null) {
        glossaryMarkerCtr.setTextMarkingEnabled(false);
      } else {
        glossaryMarkerCtr.setTextMarkingEnabled(state.booleanValue());
      }
      columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), luTree, toolComp, glossaryMarkerCtr.getInitialComponent(), "course" + this.course.getResourceableId());       
    } else {
      columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), luTree, toolComp, contentP, "courseRun" + this.course.getResourceableId());             
    }
    listenTo(columnLayoutCtr);

    // activate the custom course css if any
    setCustomCSS(CourseFactory.getCustomCourseCss(ureq.getUserSession(), uce.getCourseEnvironment()));

    // decide what is show fist - a tool since activaded this way or the regular
    // course view
    if (showAssessmentTool) {
      launchAssessmentTool(ureq, assessmentViewIdentifier);
      coursemain = createVelocityContainer("index");
      coursemain.put("coursemain", all);
    } else {
      all.setContent(columnLayoutCtr.getInitialComponent());
      coursemain = createVelocityContainer("index");
      // see function gotonode in functions.js to see why we need the
      // repositoryentry-key here:
      // it is to correctly apply external links using course-internal links via
      // javascript
      coursemain.contextPut("courserepokey", courseRepositoryEntry.getKey());
      coursemain.put("coursemain", all);
    }
   
    putInitialPanel(coursemain);
   
    //disposed message controller
    //must be created beforehand
    Panel empty = new Panel("empty");//empty panel set as "menu" and "tool"
    Controller courseCloser = CourseFactory.createDisposedCourseRestartController(ureq, wControl, courseRepositoryEntry.getResourceableId());
    Controller disposedRestartController = new LayoutMain3ColsController(ureq, wControl, empty, empty, courseCloser.getInitialComponent(), "disposed course" + this.course.getResourceableId());
    setDisposedMsgController(disposedRestartController);
   
    // add as listener to course so we are being notified about course events:
View Full Code Here

    // if you need WindowControl, you -MUST- use WindowControl w2 = getWindowControl(); do not use variable wControl!
    // the windowcontrol is used e.g. for displaying info or error messages or to
    // push components to the main window. See further down for an example
   
    //create a panel where content is pushed and taken away.
    helloWorldPanel = new Panel("Hello World Panel");
   
    // create a new VelocityContainer that display helloworld.html, has its translator
    // for any i18n specifics in the container and registers this HelloWorldController
    // as its event dispatcher
    startPage = createVelocityContainer("helloworld");
View Full Code Here

    tabbedPane.addTab("Pane 1", pane1);
    tabbedPane.addTab("Pane 2", pane2);
    tabbedPane.addTab("Pane 3", pane3);
    tabbedPane.addTab("Pane 4", pane4);
    // add a disabled tab
    tabbedPane.addTab("Disabled pane", new Panel("disabled"));
    tabbedPane.setEnabled(4, false);
   
    vcMain.put("panes", tabbedPane);
   
    //add source view control
View Full Code Here

    linkjs2 = LinkFactory.createButtonSmall("link.js2", mainVc, this);
    jsVc2 = createVelocityContainer("jstest2");
    JSAndCSSComponent jstest2 = new JSAndCSSComponent("jstest1includes", this.getClass(), new String[]{"jsfuncdef2.js"}, null, false);
    jsVc2.put("jstest2includes", jstest2);
   
    jsTestP = new Panel("jstestP");
    mainVc.put("jstestpanel", jsTestP);
   
    jscssremove = LinkFactory.createButtonXSmall("link.jscssremove", mainVc, this);
    jscss = LinkFactory.createButtonXSmall("link.jscss", mainVc, this);
   
View Full Code Here

   * @param course
   */
  public CourseForumsArchiveController(UserRequest ureq, WindowControl wControl, OLATResourceable ores) {
    super(ureq, wControl);
    this.ores = ores;
    main = new Panel("main");
    nodeChoose = createVelocityContainer("fonodechoose");
    doNodeChoose(ureq);   
    putInitialPanel(main);
  }
View Full Code Here

    this.ores = ores;
    this.archiverCallback = archiverCallback;
    this.locale = ureq.getLocale();
   
    main = new Panel("archivermain");
   
    // Intro page, static
    intro = createVelocityContainer("archiver_index");
    main.setContent(intro);
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.panel.Panel

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.