org.olat.ims.cp
Class CPTreeDataModel

java.lang.Object
  extended by org.olat.core.gui.control.generic.ajax.tree.AjaxTreeModel
      extended by org.olat.ims.cp.CPTreeDataModel

public class CPTreeDataModel
extends AjaxTreeModel

Description:
This is the TreeDataModel which is used for the GUI. (Visual Representation of the manifest-data-model)

Initial Date: 23.07.2008

Author:
Sergio Trentini

Constructor Summary
CPTreeDataModel(java.lang.String orgaIdentifyer, java.lang.String rootNodeId)
          Constructor
 
Method Summary
 java.util.List<AjaxTreeNode> getChildrenFor(java.lang.String nodeId)
          Returns the list of children for this node.
 java.lang.String getIdentifierForNodeID(java.lang.String nodeID)
          manifest-node-identifiers are mapped to tree-model-node-id's Returns the corresponding identifier for the given nodeID
 java.lang.String getNodeIDForIdentifier(java.lang.String identifier)
          manifest-node-identifiers are mapped to tree-model-node-id's Returns the corresponding identifier for the given nodeID
 java.lang.String getPath(java.lang.String identifier)
          Returns the path of the given item in the tree.
 void setContentPackage(ContentPackage cp)
          Sets the contentPackage, this model belongs to
 
Methods inherited from class org.olat.core.gui.control.generic.ajax.tree.AjaxTreeModel
getCustomRootIconCssClass, getTreeModelIdentifyer, setCustomRootIconCssClass
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CPTreeDataModel

public CPTreeDataModel(java.lang.String orgaIdentifyer,
                       java.lang.String rootNodeId)
Constructor

Parameters:
orgaIdentifyer - The identifier of the organization element of the imsmanifest file.
rootNodeId - The root node id of the ext-js tree. (We use an md5 hash to make sure it doesn't contain any weird characters.)
Method Detail

setContentPackage

public void setContentPackage(ContentPackage cp)
Sets the contentPackage, this model belongs to

Parameters:
cp -

getIdentifierForNodeID

public java.lang.String getIdentifierForNodeID(java.lang.String nodeID)
manifest-node-identifiers are mapped to tree-model-node-id's Returns the corresponding identifier for the given nodeID

Parameters:
nodeID -
Returns:

getNodeIDForIdentifier

public java.lang.String getNodeIDForIdentifier(java.lang.String identifier)
manifest-node-identifiers are mapped to tree-model-node-id's Returns the corresponding identifier for the given nodeID

Parameters:
nodeID -
Returns:

getChildrenFor

public java.util.List<AjaxTreeNode> getChildrenFor(java.lang.String nodeId)
Description copied from class: AjaxTreeModel
Returns the list of children for this node.

Specified by:
getChildrenFor in class AjaxTreeModel
Parameters:
nodeId - The ID of the given node.
Returns:

getPath

public java.lang.String getPath(java.lang.String identifier)
Returns the path of the given item in the tree.

Example: /0/12/3

The empty string signifies the root node.

Parameters:
identifier - The identifier of the page
Returns:
The path to the node in the tree