org.olat.course.nodes
Interface CourseNode

All Superinterfaces:
INode, ShortName
All Known Subinterfaces:
AssessableCourseNode, SelfAssessableCourseNode
All Known Implementing Classes:
AbstractAccessableCourseNode, AbstractFeedCourseNode, BCCourseNode, BlogCourseNode, CalCourseNode, ChecklistCourseNode, COCourseNode, CPCourseNode, DENCourseNode, DialogCourseNode, ENCourseNode, FOCourseNode, GenericCourseNode, IQSELFCourseNode, IQSURVCourseNode, IQTESTCourseNode, LLCourseNode, MSCourseNode, PodcastCourseNode, ProjectBrokerCourseNode, ScormCourseNode, SPCourseNode, STCourseNode, TACourseNode, TUCourseNode, WikiCourseNode

public interface CourseNode
extends INode, ShortName

Initial Date: Feb 9, 2004

Author:
Felix Jost, BPS (BPS Bildungsportal Sachsen GmbH)

Field Summary
static java.lang.String DISPLAY_OPTS_CONTENT
           
static java.lang.String DISPLAY_OPTS_TITLE_CONTENT
           
static java.lang.String DISPLAY_OPTS_TITLE_DESCRIPTION_CONTENT
           
 
Method Summary
 void archiveNodeData(java.util.Locale locale, ICourse course, java.io.File exportDirectory, java.lang.String charset)
          Archive all node user data to the given directory.
 void cleanupOnDelete(ICourse course)
          Called if this node is deleted.
 TabbableController createEditController(UserRequest ureq, WindowControl wControl, ICourse course, UserCourseEnvironment euce)
          Create a node edit controller for this node to configure node specific features
 CourseNode createInstanceForCopy()
          Create an instance for the copy process.
 CourseNode createInstanceForCopy(boolean isNewTitle)
          Create an instance for the copy process.
 NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, java.lang.String nodecmd)
          Create a course run controller for this node
 Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne)
          Create a minimised view for this course node that gives some insight about the real content of the view in a limited space.
 Controller createPreviewController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne)
           
 NodeEvaluation eval(ConditionInterpreter ci, TreeEvaluation treeEval)
          this method must generate a nodeevaluation and take care of (if any) child nodeevaluations.
 StatusDescription explainThisDuringPublish(StatusDescription description)
          explain what the given status description means in the publish environment
 void exportNode(java.io.File exportDirectory, ICourse course)
          Export all node user data to the given directory.
 java.util.List getConditionExpressions()
           
 java.lang.String getDisplayOption()
           
 java.lang.String getLearningObjectives()
           
 java.lang.String getLongTitle()
           
 ModuleConfiguration getModuleConfiguration()
          special configuration, used by the module, e.g.
 java.lang.String getNoAccessExplanation()
          Get the text that will show up when no access is granted to this node but the node is still visible to the user
 Condition getPreConditionAccess()
          Get the access precondition.
 Condition getPreConditionVisibility()
          Get the visibility precondition.
 RepositoryEntry getReferencedRepositoryEntry()
          used by the publish process to ensure the reference counters for a repository entry are correct.
 java.lang.String getShortTitle()
           
 java.lang.String getType()
           
 Controller importNode(java.io.File importDirectory, ICourse course, boolean unattendedImport, UserRequest ureq, WindowControl wControl)
          Import a course node's data.
 java.lang.String informOnDelete(java.util.Locale locale, ICourse course)
          Called if this node is ABOUT TO BE deleted.
 StatusDescription isConfigValid()
           
 StatusDescription[] isConfigValid(CourseEditorEnv cev)
           
 boolean needsReferenceToARepositoryEntry()
           
 void setDisplayOption(java.lang.String displayOption)
          Set display option
 void setIdent(java.lang.String ident)
          Set this node's ident.
 void setLearningObjectives(java.lang.String learningObjectives)
          Sets the learningObjectives.
 void setLongTitle(java.lang.String longTitle)
          Sets the longTitle.
 void setNoAccessExplanation(java.lang.String noAccessExplanation)
          Set the text that will show up when no access is granted to this node but the node is still visible to the user
 void setPreConditionVisibility(Condition visibilityCondition)
          Set the visibility precondition.
 void setShortTitle(java.lang.String shortTitle)
          Sets the shortTitle.
 void updateModuleConfigDefaults(boolean isNewNode)
          Update the module configuration to have all mandatory configuration flags set to usefull default values
 
Methods inherited from interface org.olat.core.util.nodes.INode
addChild, getChildAt, getChildCount, getIdent, getParent, getPosition, insert, remove, removeAllChildren, removeFromParent, setParent
 
Methods inherited from interface org.olat.core.gui.ShortName
getShortName
 

Field Detail

DISPLAY_OPTS_TITLE_DESCRIPTION_CONTENT

static final java.lang.String DISPLAY_OPTS_TITLE_DESCRIPTION_CONTENT
See Also:
Constant Field Values

DISPLAY_OPTS_TITLE_CONTENT

static final java.lang.String DISPLAY_OPTS_TITLE_CONTENT
See Also:
Constant Field Values

DISPLAY_OPTS_CONTENT

static final java.lang.String DISPLAY_OPTS_CONTENT
See Also:
Constant Field Values
Method Detail

getLearningObjectives

java.lang.String getLearningObjectives()
Returns:
String

getLongTitle

java.lang.String getLongTitle()
Returns:
String

getShortTitle

java.lang.String getShortTitle()
Returns:
String

getDisplayOption

java.lang.String getDisplayOption()
Returns:
String

getType

java.lang.String getType()
Returns:
String

setIdent

void setIdent(java.lang.String ident)
Set this node's ident.

Parameters:
ident -

setLearningObjectives

void setLearningObjectives(java.lang.String learningObjectives)
Sets the learningObjectives.

Parameters:
learningObjectives - The learningObjectives to set

setLongTitle

void setLongTitle(java.lang.String longTitle)
Sets the longTitle.

Parameters:
longTitle - The longTitle to set

setShortTitle

void setShortTitle(java.lang.String shortTitle)
Sets the shortTitle.

Parameters:
shortTitle - The shortTitle to set

setDisplayOption

void setDisplayOption(java.lang.String displayOption)
Set display option

Parameters:
displayOption -

setNoAccessExplanation

void setNoAccessExplanation(java.lang.String noAccessExplanation)
Set the text that will show up when no access is granted to this node but the node is still visible to the user

Parameters:
noAccessExplanation -

getNoAccessExplanation

java.lang.String getNoAccessExplanation()
Get the text that will show up when no access is granted to this node but the node is still visible to the user

Returns:
String

setPreConditionVisibility

void setPreConditionVisibility(Condition visibilityCondition)
Set the visibility precondition. If this condition is true, the node is visible to the user

Parameters:
visibilityCondition -

getPreConditionVisibility

Condition getPreConditionVisibility()
Get the visibility precondition. If this condition is true, the node is visible to the user

Returns:
String

getPreConditionAccess

Condition getPreConditionAccess()
Get the access precondition. If this condition is true, the node is accessable for the user

Returns:
String

getReferencedRepositoryEntry

RepositoryEntry getReferencedRepositoryEntry()
used by the publish process to ensure the reference counters for a repository entry are correct. (you can only delete Repositoryentries if there are no references to it) returns exception when called even !needsReferenceToARespositoryEntry return the referenced RepositoryEntry if it can be found return null if the referenced RepositoryEntry could not be found

Returns:
the RepositoryEntry (if it still exists in the repository) which is referenced in this course node if there is a reference, or null otherwise

needsReferenceToARepositoryEntry

boolean needsReferenceToARepositoryEntry()
Returns:
true if this node type potentially has a repository entry reference, false otherwhise. Attention: this method does not test if ther is actually such a reference. Use getReferencedRepository() to get this information.

getModuleConfiguration

ModuleConfiguration getModuleConfiguration()
special configuration, used by the module, e.g. briefcase: quota, singlepage:chosen file, tunneling: chosen site, etc.

Returns:
ModuleConfiguration

createNodeRunConstructionResult

NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq,
                                                          WindowControl wControl,
                                                          UserCourseEnvironment userCourseEnv,
                                                          NodeEvaluation ne,
                                                          java.lang.String nodecmd)
Create a course run controller for this node

Parameters:
ureq - The user request
wControl - The current window controller
userCourseEnv - The course environment
ne - The node evaluation
Returns:
The node run controller ATTENTION: udpateModuleConfigDefaults(false) should be called inside from the courseNode.createNodeRunConstructionResult(ureq, bwControl, userCourseEnv, nodeEval, nodecmd) to set the course node specific configuration default values!

createEditController

TabbableController createEditController(UserRequest ureq,
                                        WindowControl wControl,
                                        ICourse course,
                                        UserCourseEnvironment euce)
Create a node edit controller for this node to configure node specific features

Parameters:
ureq - The user request
wControl - The current window controller
course - The course
euce - the editor user course environment provides syntax/semantic check methods for conditions
Returns:
A tabbable node edit controller

createPreviewController

Controller createPreviewController(UserRequest ureq,
                                   WindowControl wControl,
                                   UserCourseEnvironment userCourseEnv,
                                   NodeEvaluation ne)
Parameters:
ureq -
wControl -
userCourseEnv -
ne -
Returns:
Controller

createPeekViewRunController

Controller createPeekViewRunController(UserRequest ureq,
                                       WindowControl wControl,
                                       UserCourseEnvironment userCourseEnv,
                                       NodeEvaluation ne)
Create a minimised view for this course node that gives some insight about the real content of the view in a limited space. E.g. a forum could list the two most recent postings or active threads, a folder could show the newest files.

Parameters:
ureq -
wContro -
userCourseEnv -
ne -
Returns:

eval

NodeEvaluation eval(ConditionInterpreter ci,
                    TreeEvaluation treeEval)
this method must generate a nodeevaluation and take care of (if any) child nodeevaluations. A nodeevaluation is done in the context of ci (an interpreter per user is needed at the moment) and a treeeval

Parameters:
ci -
treeEval -
Returns:
NodeEvaluation

isConfigValid

StatusDescription isConfigValid()
Returns:
true if the course node configuration is correct without the course context.
See Also:
for a config validation method taking the course environment into account.

isConfigValid

StatusDescription[] isConfigValid(CourseEditorEnv cev)
Parameters:
userCourseEnv -
Returns:
true if the course node configuration is valid for itself and also within the specified course environment.

informOnDelete

java.lang.String informOnDelete(java.util.Locale locale,
                                ICourse course)
Called if this node is ABOUT TO BE deleted. For the time being, the node may provide a user message which is shown to the user within the publish confirm dialog.

Parameters:
ureq - The user request
course - The course
Returns:
The dialogue message if any data will be deleted in the next step

cleanupOnDelete

void cleanupOnDelete(ICourse course)
Called if this node is deleted. Do any cleanup work here.

Parameters:
course - The course

archiveNodeData

void archiveNodeData(java.util.Locale locale,
                     ICourse course,
                     java.io.File exportDirectory,
                     java.lang.String charset)
Archive all node user data to the given directory. This might be one file or multiple files depending on what data is available. The archived data is not intendet to be imported again. The files should be viewable, e.g. as XML or excel files.

Parameters:
locale - The users locale
course - The course
exportDirectory - The directory where the exported files should be put. This directory must exist prior to calling this method.
value - of charset property of current user

exportNode

void exportNode(java.io.File exportDirectory,
                ICourse course)
Export all node user data to the given directory. This might be one file or multiple files depending on what data is available. The archived data is intendet to be imported again if the course this node is attached to gets imported.

Parameters:
exportDirectory - The directory where the exported files should be put. This directory must exist prior to calling this method.
course -

importNode

Controller importNode(java.io.File importDirectory,
                      ICourse course,
                      boolean unattendedImport,
                      UserRequest ureq,
                      WindowControl wControl)
Import a course node's data. The import directory is the root of the directory with all the data that the node has written previousely during the export. The node can provide a Controller if any user intervention is needed. The controller should send a Event.DONE_EVENT after finishing the user driven import. If no user driven import is necessary, just return null right away after finishing all importing tasks.

Parameters:
importDirectory -
course -
ureq -
wControl -
Returns:
Controller for user driven import, or null after all import tasks have finished.

createInstanceForCopy

CourseNode createInstanceForCopy()
Create an instance for the copy process. The copy must have a different unique ID and may take some of the configuration values configured for this node.

Returns:

createInstanceForCopy

CourseNode createInstanceForCopy(boolean isNewTitle)
Create an instance for the copy process. The copy must have a different unique ID and may take some of the configuration values configured for this node.

Parameters:
isNewTitle -
Returns:

getConditionExpressions

java.util.List getConditionExpressions()
Returns:
empty list, or list with active condition expressions of the course node

explainThisDuringPublish

StatusDescription explainThisDuringPublish(StatusDescription description)
explain what the given status description means in the publish environment

Parameters:
description -
Returns:

updateModuleConfigDefaults

void updateModuleConfigDefaults(boolean isNewNode)
Update the module configuration to have all mandatory configuration flags set to usefull default values

Parameters:
isNewNode - true: an initial configuration is set; false: upgrading from previous node configuration version, set default to maintain previous behaviour This is the workflow: On every click on a entry of the navigation tree, this method will be called to ensure a valid configration of the depending module. This is only done in RAM. If the user clicks on that node in course editor and publishes the course after that, then the updated config will be persisted to disk. Otherwise everything what is done here has to be done once at every course start. // TODO: Every click is too much. Only call this method on course start since changed config will be cached. If you cache something in course nodes be aware to set such a variable TRANSIENT, otherwise the editortree.xml and runstructure.xml of old courses would no longer be compatible.