org.olat.course.tree
Class CourseEditorTreeModel

java.lang.Object
  extended by org.olat.core.gui.components.tree.GenericTreeModel
      extended by org.olat.course.tree.CourseEditorTreeModel
All Implemented Interfaces:
java.io.Serializable, TreeModel

public class CourseEditorTreeModel
extends GenericTreeModel

Description:

Author:
Felix Jost
See Also:
Serialized Form

Constructor Summary
CourseEditorTreeModel()
           
 
Method Summary
 void addCourseNode(CourseNode newNode, CourseNode parentNode)
          append new course
 Structure createStructureForPreview()
           
 CourseEditorTreeNode getCourseEditorNodeById(java.lang.String nodeId)
           
 CourseEditorTreeNode getCourseEditorNodeContaining(CourseNode cn)
           
 CourseNode getCourseNode(java.lang.String nodeId)
           
 long getHighestNodeId()
          FIXME: use this method for node generation
 long getLatestPublishTimestamp()
           
 int getVersion()
           
 void incHighestNodeId()
          increments the highestnodeid: for the next new node in the editor.
 void insertCourseNodeAt(CourseNode newNode, CourseNode parentNode, int pos)
           
 boolean isVersionUpToDate()
           
 void markDeleted(CourseNode courseNode)
          marks an couse node and all it's children as deleted
 void markUnDeleted(CourseEditorTreeNode cetNode)
           
 void markUnDeleted(CourseNode courseNode)
          marks an couse node and all it's children as undeleted
 void nodeConfigChanged(INode node)
           
 void removeCourseNode(CourseNode courseNode)
          Deprecated. REVIEW:pb: no longer used? it is not referenced from java, and also not found in velocity *.html
 void setLatestPublishTimestamp(long latestPublishTimestamp)
           
 void setVersion(int version)
           
 
Methods inherited from class org.olat.core.gui.components.tree.GenericTreeModel
findNodeByUserObject, getNodeById, getRootNode, setRootNode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CourseEditorTreeModel

public CourseEditorTreeModel()
Method Detail

getCourseNode

public CourseNode getCourseNode(java.lang.String nodeId)
Parameters:
nodeId -
Returns:
the course node

insertCourseNodeAt

public void insertCourseNodeAt(CourseNode newNode,
                               CourseNode parentNode,
                               int pos)
Parameters:
newNode -
parentNode -
pos -

addCourseNode

public void addCourseNode(CourseNode newNode,
                          CourseNode parentNode)
append new course

Parameters:
newNode -
parentNode -

markDeleted

public void markDeleted(CourseNode courseNode)
marks an couse node and all it's children as deleted

Parameters:
courseNode -

markUnDeleted

public void markUnDeleted(CourseNode courseNode)
marks an couse node and all it's children as undeleted

Parameters:
courseNode -

markUnDeleted

public void markUnDeleted(CourseEditorTreeNode cetNode)

removeCourseNode

public void removeCourseNode(CourseNode courseNode)
Deprecated. REVIEW:pb: no longer used? it is not referenced from java, and also not found in velocity *.html

Parameters:
courseNode -

getCourseEditorNodeById

public CourseEditorTreeNode getCourseEditorNodeById(java.lang.String nodeId)
Parameters:
nodeId -
Returns:
null if not found, or the CourseEditorTreeNode with the given nodeId

getCourseEditorNodeContaining

public CourseEditorTreeNode getCourseEditorNodeContaining(CourseNode cn)

nodeConfigChanged

public void nodeConfigChanged(INode node)
Parameters:
courseNode -

getLatestPublishTimestamp

public long getLatestPublishTimestamp()

setLatestPublishTimestamp

public void setLatestPublishTimestamp(long latestPublishTimestamp)
Parameters:
latestPublishTimestamp - The latestPublishTimestamp to set.

getHighestNodeId

public long getHighestNodeId()
FIXME: use this method for node generation

Returns:
the highest used node id so far

incHighestNodeId

public void incHighestNodeId()
increments the highestnodeid: for the next new node in the editor. does not persist.


createStructureForPreview

public Structure createStructureForPreview()
Returns:
a deep clone of the current (run) structure of this editortreemodel

getVersion

public int getVersion()
Returns:
Returns the version.

setVersion

public void setVersion(int version)
Parameters:
version - The version to set.

isVersionUpToDate

public boolean isVersionUpToDate()