Package org.olat.course.tree

Examples of org.olat.course.tree.CourseEditorTreeModel


    CourseNode clonedCourseNode = (CourseNode) ObjectCloner.deepCopy(resultingCourseRun.getRootNode());
    CourseEditorTreeNode clonedRoot = new CourseEditorTreeNode(clonedCourseNode);
    convertInCourseEditorTreeNode(clonedRoot, clonedCourseNode);
    clonedCourseNode.removeAllChildren(); // Do remove all children after convertInCourseEditorTreeNode
    CourseEditorTreeModel cloneCETM = new CourseEditorTreeModel();
    cloneCETM.setRootNode(clonedRoot);

    /*
     * now we have the cloned editor tree synchronized with the pre-published
     * runstructure. The cloned editor tree is used within a new
     * CourseEditorEnvironment which is placed in a new Editor User Course
     * Session for evaluation only. This is like opening the runstructure in a
     * virtual course editor for using the validation facilities of the editor
     * environment.
     */
    CourseEditorEnv tmpCEV = new CourseEditorEnvImpl(cloneCETM, course.getCourseEnvironment().getCourseGroupManager(), locale);
    // the resulting object is not needed, but constructor makes
    // initializations within tmpCEV!! thus important step.
    new EditorUserCourseEnvironmentImpl(tmpCEV);
    //
    tmpCEV.setCurrentCourseNodeId(cloneCETM.getRootNode().getIdent());
    tmpCEV.validateCourse();
    StatusDescription[] status = tmpCEV.getCourseStatus();
    // check if the resulting course contains cycles.
    Set<String> nodesInCycle = tmpCEV.listCycles();
    if (nodesInCycle.size() > 0) {
      // there are nodes generating cylces -> error! this is not a publishable
      // set!
      StringBuilder sb = new StringBuilder();
      for (Iterator<String> iter = nodesInCycle.iterator(); iter.hasNext();) {
        String id = iter.next();
        String title = editorTreeModel.getCourseEditorNodeById(id).getTitle();
        sb.append("<b>").append(title).append("</b>");
        sb.append("(id:").append(id).append(")<br />");
      }
      StatusDescription sd = new StatusDescription(ValidationStatus.ERROR, "pbl.error.cycles", "pbl.error.cycles", new String[] { sb
          .toString() }, PACKAGE);
      status = new StatusDescription[] { sd };
    } else {
      /*
       * these are now status description as they are helpful in the editor
       * context. The same errors in the publish context have a kind of
       * different meaning --- Let the nodes explain what it means in publish
       * mode.
       */
      for (int i = 0; i < status.length; i++) {
        StatusDescription description = status[i];
        String nodeId = description.getDescriptionForUnit();
        CourseNode cn = cloneCETM.getCourseNode(nodeId);
        status[i] = cn.explainThisDuringPublish(description);
      }
    }
    return status;
  }
View Full Code Here


   
    if(nodeIdsToPublish == null){
      return msg.toString();
    }
   
    CourseEditorTreeModel cetm = course.getEditorTreeModel();
    for (int i = 0; i < nodeIdsToPublish.size(); i++) {
      msg.append("<li>");
      String nodeId = (String) nodeIdsToPublish.get(i);
      CourseEditorTreeNode cetn = (CourseEditorTreeNode) cetm.getNodeById(nodeId);
      CourseNode cn = cetm.getCourseNode(nodeId);
      msg.append(cn.getShortTitle());
      if (cetn.isDeleted() && !cetn.isNewnode()) {
        //use locale of this initialized translator.
        String onDeleteMessage = cn.informOnDelete(translator.getLocale(), course);
        if (onDeleteMessage != null) {
View Full Code Here

  /*
   * FIXME:pb:b never used...
   */
  private Map<String, List<String>> checkReferencesFor(TreeNode tn) {
    final CourseEditorTreeModel cetm = CourseFactory.getCourseEditSession(ores.getResourceableId()).getEditorTreeModel();
     //create a list of all nodes in the selected subtree
    final Set<String> allSubTreeids = new HashSet<String>();
    TreeVisitor tv = new TreeVisitor(new Visitor() {
      public void visit(INode node) {
        allSubTreeids.add(node.getIdent());
      }
    }, tn, true);
    tv.visitAll();
     //find all references pointing from outside the subtree into the subtree or
     //on the subtree root node.
    final Map<String, List<String>> allRefs = new HashMap<String, List<String>>();
    tv = new TreeVisitor(new Visitor() {
      public void visit(INode node) {
        List referencingNodes = euce.getCourseEditorEnv().getReferencingNodeIdsFor(node.getIdent());
        // subtract the inner nodes. This allows to delete a whole subtree if
        // only references residing completly inside the subtree are active.
        referencingNodes.removeAll(allSubTreeids);
        if (referencingNodes.size() > 0) {
          List<String> nodeNames = new ArrayList<String>();
          for (Iterator iter = referencingNodes.iterator(); iter.hasNext();) {
            String nodeId = (String) iter.next();
            CourseNode cn = cetm.getCourseNode(nodeId);
            nodeNames.add(cn.getShortTitle());
          }
          allRefs.put(node.getIdent(), nodeNames);
        }
      }
View Full Code Here

    tuConfigForm = new TUConfigForm("tuConfigForm", getTranslator(), config, false);
    tuConfigForm.addListener(this);
    myContent.put(tuConfigForm.getComponentName(), tuConfigForm);

    CourseGroupManager groupMgr = course.getCourseEnvironment().getCourseGroupManager();
    CourseEditorTreeModel editorModel = course.getEditorTreeModel();
    //Accessibility precondition
    Condition accessCondition = courseNode.getPreConditionAccess();
    accessibilityCondContr = new ConditionEditController(ureq, getWindowControl(), groupMgr, accessCondition, "accessabilityConditionForm",
        AssessmentHelper.getAssessableNodes(editorModel, tuCourseNode), euce);   
    this.listenTo(accessibilityCondContr);
View Full Code Here

    main = new Panel("calmain");

    editAccessVc = createVelocityContainer("edit_access");
    CourseGroupManager groupMgr = course.getCourseEnvironment().getCourseGroupManager();
    CourseEditorTreeModel editorModel = course.getEditorTreeModel();
    // Accessibility precondition
    Condition accessCondition = calCourseNode.getPreConditionAccess();
    accessCondContr = new ConditionEditController(ureq, getWindowControl(), groupMgr, accessCondition, "accessConditionForm",
        AssessmentHelper.getAssessableNodes(editorModel, calCourseNode), euce);
    this.listenTo(accessCondContr);
View Full Code Here

    configurationVC = this.createVelocityContainer("edit");
    editScoringConfigButton = LinkFactory.createButtonSmall("scoring.config.enable.button", configurationVC, this);
   
    CourseGroupManager groupMgr = course.getCourseEnvironment().getCourseGroupManager();
    UserNodeAuditManager auditManager = course.getCourseEnvironment().getAuditManager();
    CourseEditorTreeModel editorModel = course.getEditorTreeModel();

    // Accessibility precondition
    Condition accessCondition = msNode.getPreConditionAccess();
    accessibilityCondContr = new ConditionEditController(ureq, getWindowControl(), groupMgr, accessCondition, "accessabilityConditionForm",
        AssessmentHelper.getAssessableNodes(editorModel, msNode), euce);   
View Full Code Here

    this.foNode = forumNode;
   
    myContent = this.createVelocityContainer("edit");   

    CourseGroupManager groupMgr = course.getCourseEnvironment().getCourseGroupManager();
    CourseEditorTreeModel editorModel = course.getEditorTreeModel();
    // Reader precondition
    Condition readerCondition = foNode.getPreConditionReader();
    readerCondContr = new ConditionEditController(ureq, getWindowControl(), groupMgr, readerCondition, "readerConditionForm",
        AssessmentHelper.getAssessableNodes(editorModel, forumNode), euce);   
    this.listenTo(readerCondContr);
View Full Code Here

    Component fcContent = fccecontr.getInitialComponent();
    fcPanel.setContent(fcContent);
    myContent.put(fcPanel.getComponentName(), fcPanel);
   
    CourseGroupManager groupMgr = course.getCourseEnvironment().getCourseGroupManager();
    CourseEditorTreeModel editorModel = course.getEditorTreeModel();
    //Accessibility precondition
    Condition accessCondition = courseNode.getPreConditionAccess();
    accessibilityCondContr = new ConditionEditController(ureq, getWindowControl(), groupMgr, accessCondition,
        "accessabilityConditionForm", AssessmentHelper.getAssessableNodes(editorModel, spCourseNode), euce);   
    this.listenTo(accessibilityCondContr);
View Full Code Here

    this.getClass().getSuperclass();
    // Accessibility tab
    accessVC = new VelocityContainer("accessVC", FeedNodeEditController.class, "access", getTranslator(), this);
    CourseGroupManager groupMgr = course.getCourseEnvironment().getCourseGroupManager();
    CourseEditorTreeModel editorModel = course.getEditorTreeModel();

    // Moderator precondition
    Condition moderatorCondition = node.getPreConditionModerator();
    moderatroCtr = new ConditionEditController(ureq, getWindowControl(), groupMgr, moderatorCondition, "moderatorConditionForm",
        AssessmentHelper.getAssessableNodes(editorModel, node), uce);
View Full Code Here

    chooseButton = LinkFactory.createButtonSmall("command.create", content, this);
    changeButton = LinkFactory.createButtonSmall("command.change", content, this);
       
    editAccessVc = this.createVelocityContainer("edit_access");
    CourseGroupManager groupMgr = course.getCourseEnvironment().getCourseGroupManager();
    CourseEditorTreeModel editorModel = course.getEditorTreeModel();
    // Accessibility precondition
    Condition accessCondition = wikiCourseNode.getPreConditionAccess();
    accessCondContr = new ConditionEditController(ureq, getWindowControl(), groupMgr, accessCondition, "accessConditionForm",
        AssessmentHelper.getAssessableNodes(editorModel, wikiCourseNode), euce);   
    this.listenTo(accessCondContr);
View Full Code Here

TOP

Related Classes of org.olat.course.tree.CourseEditorTreeModel

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.