Examples of ICourse


Examples of org.olat.course.ICourse

        businessPath = NotificationsUpgradeHelper.getCourseNodePath(publisher);
      } else {
        try {
          String courseNodeId = courseNode.substring(0, courseNode.indexOf(':'));
          Long resId = publisher.getResId();
          ICourse course = CourseFactory.loadCourse(resId);
          RepositoryManager rm = RepositoryManager.getInstance();
          OLATResource rsrc = OLATResourceManager.getInstance().findResourceable(course.getResourceableId(), course.getResourceableTypeName());
          RepositoryEntry re = rm.lookupRepositoryEntry(rsrc, true);
          //node forum
          businessPath = "[RepositoryEntry:" + re.getKey() + "][CourseNode:" + courseNodeId + "]";
        } catch (Exception e) {
          businessPath = null;
View Full Code Here

Examples of org.olat.course.ICourse

        TableEvent te = (TableEvent) event;
        String actionid = te.getActionId();
        if (actionid.equals(CMD_SELECT_NODE)) {
          int rowid = te.getRowId();
          Map nodeData = (Map) nodeTableModel.getObject(rowid);
          ICourse course = CourseFactory.loadCourse(ores);
          CourseNode node = course.getRunStructure().getNode((String) nodeData.get(AssessmentHelper.KEY_IDENTIFYER));
          this.currentCourseNode = (FOCourseNode) node;
          // cast should be save, only ta course nodes nodes are selectable
          archiveForumNode(ureq);
          getWindowControl().setInfo(translate("archive.fo.successfully"));     
        }
View Full Code Here

Examples of org.olat.course.ICourse

        null, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, new IndentedNodeRenderer()));
    nodeListCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.action.select", 1,
        CMD_SELECT_NODE, ureq.getLocale()));
   
    // get list of course node data and populate table data model
    ICourse course = CourseFactory.loadCourse(ores);
    CourseNode rootNode = course.getRunStructure().getRootNode();
    List nodesTableObjectArrayList = addForumNodesAndParentsToList(0, rootNode);
   
    // only populate data model if data available
    if (nodesTableObjectArrayList == null) {
      nodeChoose.contextPut("hasForumNodes", Boolean.FALSE);
View Full Code Here

Examples of org.olat.course.ICourse

    }
    return null;
  }
 
  private boolean archiveForumNode(UserRequest ureq){
    ICourse course = CourseFactory.loadCourse(ores);
    File exportDir = CourseFactory.getOrCreateDataExportDirectory(ureq.getIdentity(), course.getCourseTitle());
    UserManager um = UserManager.getInstance();
    String charset = um.getUserCharset(ureq.getIdentity());
    currentCourseNode.archiveNodeData(ureq.getLocale(), course, exportDir, charset);
    return true;
  }
View Full Code Here

Examples of org.olat.course.ICourse

    try {
      if("BusinessGroup".equals(type)) {
        BusinessGroup bg = BusinessGroupManagerImpl.getInstance().loadBusinessGroup(resId, false);
        title = translator.translate("notifications.header.group", new String[]{bg.getName()});
      } else if ("CourseModule".equals(type)) {
        ICourse course = CourseFactory.loadCourse(resId);
        title = translator.translate("notifications.header.course", new String[]{course.getCourseTitle()});
      } else {
        title = translator.translate("notifications.header");
      }
    } catch (Exception e) {
      log.error("Error while creating assessment notifications for publisher: " + p.getKey(), e);
View Full Code Here

Examples of org.olat.course.ICourse

   * @param cmd
   */
  private void launchExtensionController(UserRequest ureq, Object cmd) {
    ActionExtension ae = (ActionExtension) cmd;
    removeAsListenerAndDispose(resC);
    ICourse course = CourseFactory.loadCourse(ores);
    this.resC = ae.createController(ureq, getWindowControl(), course);
    listenTo(resC);
    main.setContent(this.resC.getInitialComponent());
  }
View Full Code Here

Examples of org.olat.course.ICourse

    try {
      if (NotificationsManager.getInstance().isPublisherValid(p) && compareDate.before(latestNews)) {
        OLATResourceable ores = null;
        if (p.getResName().equals( CourseModule.getCourseTypeName() ) ) {
          // resId = CourseResourceableId           p.getSubidentifier() = wikiCourseNode.getIdent()
          ICourse course = CourseFactory.loadCourse(resId);
          CourseEnvironment cenv = course.getCourseEnvironment();
          CourseNode courseNode = cenv.getRunStructure().getNode(p.getSubidentifier());
          if(courseNode == null){
            //OLAT-3356 because removing wikicoursenodes was not propagated to
            // disable subcriptions, we may end up here with a NULL wikicoursenode
            // Best we can do here -> return noSubsInfo and clean up
View Full Code Here

Examples of org.olat.course.ICourse

    String title;
    if("BusinessGroup".equals(type)) {
      BusinessGroup bg = BusinessGroupManagerImpl.getInstance().loadBusinessGroup(resId, false);
      title = translator.translate("notifications.header.group", new String[]{bg.getName()});
    } else if (CourseModule.getCourseTypeName().equals(type)) {
      ICourse course = CourseFactory.loadCourse(resId);
      title = translator.translate("notifications.header.course", new String[]{course.getCourseTitle()});
    } else {
      title = translator.translate("notifications.header");
    }

    return new TitleItem(title, Wiki.CSS_CLASS_WIKI_ICON);
View Full Code Here

Examples of org.olat.course.ICourse

    try {     
    ThreadLocalUserActivityLogger.log(CourseLoggingAction.COURSE_EDITOR_OPEN, getClass());

    if (lockEntry.isSuccess()) {     
      ICourse course = CourseFactory.openCourseEditSession(ores.getResourceableId());
      main = createVelocityContainer("index");
     
      undelButton = LinkFactory.createButton("undeletenode.button", main, this);
      keepClosedErrorButton = LinkFactory.createCustomLink("keepClosedErrorButton", CMD_KEEPCLOSED_ERROR, "keep.closed", Link.BUTTON_SMALL, main, this);
      keepOpenErrorButton = LinkFactory.createCustomLink("keepOpenErrorButton", CMD_KEEPOPEN_ERROR, "keep.open", Link.BUTTON_SMALL, main, this);
      keepClosedWarningButton = LinkFactory.createCustomLink("keepClosedWarningButton", CMD_KEEPCLOSED_WARNING, "keep.closed", Link.BUTTON_SMALL, main, this);
      keepOpenWarningButton = LinkFactory.createCustomLink("keepOpenWarningButton", CMD_KEEPOPEN_WARNING, "keep.open", Link.BUTTON_SMALL, main, this);
     
      // set the custom course css
      enableCustomCss(ureq);

      menuTree = new MenuTree("luTree");
           

      /*
       * create editor user course environment for enhanced syntax/semantic
       * checks. Initialize it with the current course node id, which is not set
       * yet. Furthermore the course is refreshed, e.g. as it get's loaded by
       * XSTREAM constructors are not called, but transient data must be
       * caculated and initialized
       */
      cetm = CourseFactory.getCourseEditSession(ores.getResourceableId()).getEditorTreeModel();
      CourseEditorEnv cev = new CourseEditorEnvImpl(cetm, course.getCourseEnvironment().getCourseGroupManager(), ureq.getLocale());
      euce = new EditorUserCourseEnvironmentImpl(cev);
      euce.getCourseEditorEnv().setCurrentCourseNodeId(null);
      /*
       * validate course and update course status
       */
      euce.getCourseEditorEnv().validateCourse();
      StatusDescription[] courseStatus = euce.getCourseEditorEnv().getCourseStatus();
      updateCourseStatusMessages(ureq.getLocale(), courseStatus);

      long lpTimeStamp = cetm.getLatestPublishTimestamp();
      if (lpTimeStamp == -1) {       
        showInfo(NLS_PUBLISHED_NEVER_YET);
      } else { // course has been published before
        Date d = new Date(lpTimeStamp);
        getWindowControl().setInfo(translate(NLS_PUBLISHED_LATEST, Formatter.getInstance(ureq.getLocale()).formatDateAndTime(d)));
      }
      menuTree.setTreeModel(cetm);
      menuTree.addListener(this);

      selTree = new SelectionTree("selection", getTranslator());
      selTree.setTreeModel(cetm);
      selTree.setActionCommand("processpublish");
      selTree.setFormButtonKey("publizieren");
      selTree.addListener(this);

      tabbedNodeConfig = new TabbedPane("tabbedNodeConfig", ureq.getLocale());
      main.put(tabbedNodeConfig.getComponentName(), tabbedNodeConfig);

      toolC = ToolFactory.createToolController(getWindowControl());
      listenTo(toolC);
      toolC.addHeader(translate(NLS_HEADER_TOOLS));
      toolC.addLink(CMD_COURSEFOLDER, translate(NLS_COMMAND_COURSEFOLDER), CMD_COURSEFOLDER, "o_toolbox_coursefolder");
      toolC.addLink(CMD_COURSEPREVIEW, translate(NLS_COMMAND_COURSEPREVIEW), CMD_COURSEPREVIEW, "b_toolbox_preview" );
      toolC.addLink(CMD_PUBLISH, translate(NLS_COMMAND_PUBLISH), CMD_PUBLISH,"b_toolbox_publish" );
      toolC.addLink(CMD_CLOSEEDITOR, translate(NLS_COMMAND_CLOSEEDITOR), null, "b_toolbox_close");

      toolC.addHeader(translate(NLS_HEADER_INSERTNODES));
      CourseNodeFactory cnf = CourseNodeFactory.getInstance();
      for (Iterator<String> iter = cnf.getRegisteredCourseNodeAliases().iterator(); iter.hasNext();) {
        String courseNodeAlias = iter.next();
        CourseNodeConfiguration cnConfig = cnf.getCourseNodeConfiguration(courseNodeAlias);
        toolC.addLink(TB_ACTION + courseNodeAlias, cnConfig.getLinkText(ureq.getLocale()), courseNodeAlias, cnConfig.getIconCSSClass());
      }

      toolC.addHeader(translate(NLS_COMMAND_DELETENODE_HEADER));
      toolC.addLink(CMD_DELNODE, translate(NLS_COMMAND_DELETENODE), CMD_DELNODE, "b_toolbox_delete");
      toolC.addLink(CMD_MOVENODE, translate(NLS_COMMAND_MOVENODE), CMD_MOVENODE, "b_toolbox_move");
      toolC.addLink(CMD_COPYNODE, translate(NLS_COMMAND_COPYNODE), CMD_COPYNODE, "b_toolbox_copy");
     
      columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), menuTree, toolC.getInitialComponent(), main, "course" + course.getResourceableId());     
      columnLayoutCtr.addCssClassToMain("o_editor");
      listenTo(columnLayoutCtr);
      putInitialPanel(columnLayoutCtr.getInitialComponent());

      // add as listener to course so we are being notified about course events:
View Full Code Here

Examples of org.olat.course.ICourse

   * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
   *      org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Component source, Event event) {
    try {
    ICourse course = CourseFactory.getCourseEditSession(ores.getResourceableId());
   
    if (source == menuTree) {
      if (event.getCommand().equals(MenuTree.COMMAND_TREENODE_CLICKED)) {
        // goto node in edit mode
        TreeEvent te = (TreeEvent) event;
        String nodeId = te.getNodeId();
        updateViewForSelectedNodeId(ureq, nodeId);       
      }
    } else if (source == main) {
      if (event.getCommand().startsWith(NLS_START_HELP_WIZARD)) {
        String findThis = event.getCommand().substring(NLS_START_HELP_WIZARD.length());
        StatusDescription[] courseStatus = euce.getCourseEditorEnv().getCourseStatus();
        for (int i = 0; i < courseStatus.length; i++) {
          String key = courseStatus[i].getDescriptionForUnit() + "." + courseStatus[i].getShortDescriptionKey();
          if (key.equals(findThis)) {
            menuTree.setSelectedNodeId(courseStatus[i].getDescriptionForUnit());
            euce.getCourseEditorEnv().setCurrentCourseNodeId(courseStatus[i].getDescriptionForUnit());
            jumpToNodeEditor(courseStatus[i].getActivateableViewIdentifier(), ureq, cetm.getCourseNode(courseStatus[i]
                .getDescriptionForUnit()), course.getCourseEnvironment().getCourseGroupManager());
            break;
          }
        }
        euce.getCourseEditorEnv().validateCourse();
        courseStatus = euce.getCourseEditorEnv().getCourseStatus();
        updateCourseStatusMessages(ureq.getLocale(), courseStatus);
      }
    } else if (source == keepClosedErrorButton){
      errorIsOpen = Boolean.FALSE;
      main.contextPut("errorIsOpen", errorIsOpen);
    } else if (source == keepOpenErrorButton){
      errorIsOpen = Boolean.TRUE;
      main.contextPut("errorIsOpen", errorIsOpen);
    } else if (source == keepClosedWarningButton){
      warningIsOpen = Boolean.FALSE;
      main.contextPut("warningIsOpen", warningIsOpen);
    } else if (source == keepOpenWarningButton){
      warningIsOpen = Boolean.TRUE;
      main.contextPut("warningIsOpen", warningIsOpen);
    } else if (source == undelButton){
      String ident = menuTree.getSelectedNode().getIdent();
      CourseEditorTreeNode activeNode = (CourseEditorTreeNode) cetm.getNodeById(ident);
      euce.getCourseEditorEnv().setCurrentCourseNodeId(activeNode.getIdent());
     
      CourseFactory.saveCourseEditorTreeModel(course.getResourceableId());
      cetm.markUnDeleted(activeNode);
      menuTree.setDirty(true);
      // show edit panels again
      initNodeEditor(ureq, activeNode.getCourseNode());
      tabbedNodeConfig.setVisible(true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.