Package org.olat.core.gui.components.htmlsite

Examples of org.olat.core.gui.components.htmlsite.OlatCmdEvent


  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == idc) {
      if (event instanceof OlatCmdEvent) {
        //TODO:gs legacy code???
        //FIXME:fj:b move to other place (whole class) since single page controller could be used generically
        OlatCmdEvent oce = (OlatCmdEvent) event;
        String nodeId = oce.getSubcommand();
        ThreadLocalUserActivityLogger.log(CourseLoggingAction.COURSE_BROWSE_GOTO_NODE, getClass(),
            CoreLoggingResourceable.wrapSpUri(GOTO_NID+nodeId));
        // refire to listening controllers
        fireEvent(ureq, event);
      } else if (event instanceof NewIframeUriEvent) {
        NewIframeUriEvent iframeEvent = (NewIframeUriEvent) event;
        String newUri = iframeEvent.getNewUri();
        setCurURI(newUri);
       
        // log this uri change
        ThreadLocalUserActivityLogger.log(CourseLoggingAction.NODE_SINGLEPAGE_GET_FILE, getClass(),
            CoreLoggingResourceable.wrapSpUri(newUri));

      }
    } else if (source == htmlEditorController) {
      htmlEditorController.dispose();
      cmc.deactivate();
      if (g_inIframe) {
        idc.setCurrentURI(g_curURI);
      } else
        cpc.setCurrentURI(g_curURI);
     
    } else if (source == cpc) {
      if (event instanceof OlatCmdEvent) {
        OlatCmdEvent oce = (OlatCmdEvent) event;
        String nodeId = oce.getSubcommand();
        ThreadLocalUserActivityLogger.log(CourseLoggingAction.COURSE_BROWSE_GOTO_NODE, getClass(),
            CoreLoggingResourceable.wrapSpUri(GOTO_NID+nodeId));
        // refire to listening controllers
        fireEvent(ureq, event);
      }
View Full Code Here


   *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == currentNodeController) {
      if (event instanceof OlatCmdEvent) {
        OlatCmdEvent oe = (OlatCmdEvent) event;
        String cmd = oe.getCommand();
        if (cmd.equals(OlatCmdEvent.GOTONODE_CMD)) {
          String subcmd = oe.getSubcommand(); // "69680861018558";
          CourseNode identNode = uce.getCourseEnvironment().getRunStructure().getNode(subcmd);
          updateTreeAndContent(ureq, identNode);
          oe.accept();
        }
      }
    }
  }
View Full Code Here

          currentToolCtr = null;
        }
      }
    } else if (source == currentNodeController) {
      if (event instanceof OlatCmdEvent) {
        OlatCmdEvent oe = (OlatCmdEvent) event;
        String cmd = oe.getCommand();
        if (cmd.equals(OlatCmdEvent.GOTONODE_CMD)) {
          String subcmd = oe.getSubcommand(); // "69680861018558/node-specific-data";
          CourseNode identNode;
          String nodecmd = null;
          int slPos = subcmd.indexOf('/');
          if (slPos != -1) {
            nodecmd = subcmd.substring(slPos + 1);
            identNode = course.getRunStructure().getNode(subcmd.substring(0, slPos));
          } else {
            identNode = course.getRunStructure().getNode(subcmd);
          }
          currentCourseNode = identNode;
          updateTreeAndContent(ureq, identNode, nodecmd);
          oe.accept();
        }
      } else if (event == Event.DONE_EVENT) {
        // the controller is done.
        // we have a chance here to test if we need to refresh the evalution.
        // this is the case when a test was submitted and scoring has changed ->
View Full Code Here

  @Override
  protected void event(UserRequest ureq, Component source, Event event) {
    if (source == nodeLink) {
      // get node ID and fire activation event
      String nodeID = (String) nodeLink.getUserObject();
      fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeID));
    }
  }
View Full Code Here

  protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
      Link nodeLink = (Link) source;
      String messageId = (String) nodeLink.getUserObject();
      if (messageId == null) {
        fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId));               
      } else {
        fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId + "/" + messageId));       
      }
    }
  }
View Full Code Here

  protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
      Link nodeLink = (Link) source;
      String itemId = (String) nodeLink.getUserObject();
      if (itemId == null) {
        fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId));
      } else {
        fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId + "/" + itemId));
      }
    }
  }
View Full Code Here

  protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
      Link nodeLink = (Link) source;
      // get node ID and fire activation event
      String nodeId = (String) nodeLink.getUserObject();
      fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId));     
    }
  }
View Full Code Here

  protected void event(UserRequest ureq, Component source, Event event) {
    if (source instanceof Link) {
      Link nodeLink = (Link) source;
      String relPath = (String) nodeLink.getUserObject();
      if (relPath == null) {
        fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId));               
      } else {
        fireEvent(ureq, new OlatCmdEvent(OlatCmdEvent.GOTONODE_CMD, nodeId + "/" + relPath));       
      }
    }
  }
View Full Code Here

   * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
   *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Controller source, Event event) {
    if (event instanceof OlatCmdEvent) {
      OlatCmdEvent gotoNodeEvent = (OlatCmdEvent) event;     
      String subcommand = gotoNodeEvent.getSubcommand();
      // subcommand consists of node id and path
      int slashpos = subcommand.indexOf("/");
      String nodeId = subcommand;
      String path = "";
      if (slashpos != -1) {
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.htmlsite.OlatCmdEvent

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.