org.olat.course.nodes
Class BCCourseNode

java.lang.Object
  extended by org.olat.core.util.nodes.GenericNode
      extended by org.olat.course.nodes.GenericCourseNode
          extended by org.olat.course.nodes.BCCourseNode
All Implemented Interfaces:
java.io.Serializable, ShortName, INode, CourseNode

public class BCCourseNode
extends GenericCourseNode

Description:

Author:
Felix Jost
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.olat.course.nodes.CourseNode
DISPLAY_OPTS_CONTENT, DISPLAY_OPTS_TITLE_CONTENT, DISPLAY_OPTS_TITLE_DESCRIPTION_CONTENT
 
Constructor Summary
BCCourseNode()
          Constructor for a course building block of type briefcase (folder)
 
Method Summary
 void cleanupOnDelete(ICourse course)
          Delete the folder if 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
 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)
          Default implementation of the peekview controller that returns NULL: no node specific peekview information should be shown
Override this method with a specific implementation if you have something interesting to show in the peekview
 Controller createPreviewController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne)
          default implementation of the previewController
 void exportNode(java.io.File exportDirectory, ICourse course)
          Export all node user data to the given directory.
 java.util.List getConditionExpressions()
           
static java.lang.String getFoldernodePathRelToFolderBase(CourseEnvironment courseEnv, CourseNode node)
           
static java.lang.String getFoldernodesPathRelToFolderBase(CourseEnvironment courseEnv)
           
static OlatNamedContainerImpl getNodeFolderContainer(BCCourseNode node, CourseEnvironment courseEnv)
          Get a named container of a node with the node title as its name.
 Condition getPreConditionDownloaders()
           
 Condition getPreConditionUploaders()
           
 RepositoryEntry getReferencedRepositoryEntry()
          used by the publish process to ensure the reference counters for a repository entry are correct.
 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)
          Generic interface implementation.
 StatusDescription isConfigValid()
           
 StatusDescription[] isConfigValid(CourseEditorEnv cev)
          must be implemented in the concrete subclasses as a translator is needed for the errormessages which comes with evaluating condition expressions
 boolean needsReferenceToARepositoryEntry()
           
 void setPreConditionDownloaders(Condition preConditionDownloaders)
           
 void setPreConditionUploaders(Condition preConditionUploaders)
           
 
Methods inherited from class org.olat.course.nodes.GenericCourseNode
archiveNodeData, createInstanceForCopy, createInstanceForCopy, eval, explainThisDuringPublish, getDisplayOption, getDisplayOption, getLearningObjectives, getLongTitle, getModuleConfiguration, getNoAccessExplanation, getPreConditionAccess, getPreConditionVisibility, getShortName, getShortTitle, getType, setDisplayOption, setLearningObjectives, setLongTitle, setModuleConfiguration, setNoAccessExplanation, setPreConditionVisibility, setShortTitle, setType, toString, updateModuleConfigDefaults
 
Methods inherited from class org.olat.core.util.nodes.GenericNode
addChild, findRoot, getChildAt, getChildCount, getIdent, getParent, getPosition, insert, remove, removeAllChildren, removeFromParent, setIdent, setParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.olat.course.nodes.CourseNode
setIdent
 
Methods inherited from interface org.olat.core.util.nodes.INode
addChild, getChildAt, getChildCount, getIdent, getParent, getPosition, insert, remove, removeAllChildren, removeFromParent, setParent
 

Constructor Detail

BCCourseNode

public BCCourseNode()
Constructor for a course building block of type briefcase (folder)

Method Detail

createEditController

public TabbableController createEditController(UserRequest ureq,
                                               WindowControl wControl,
                                               ICourse course,
                                               UserCourseEnvironment euce)
Description copied from interface: CourseNode
Create a node edit controller for this node to configure node specific features

Specified by:
createEditController in interface CourseNode
Specified by:
createEditController in class GenericCourseNode
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
See Also:
org.olat.course.nodes.CourseNode#createEditController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl, org.olat.course.ICourse)

createNodeRunConstructionResult

public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq,
                                                                 WindowControl wControl,
                                                                 UserCourseEnvironment userCourseEnv,
                                                                 NodeEvaluation ne,
                                                                 java.lang.String nodecmd)
Description copied from interface: CourseNode
Create a course run controller for this node

Specified by:
createNodeRunConstructionResult in interface CourseNode
Specified by:
createNodeRunConstructionResult in class GenericCourseNode
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!
See Also:
org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl, org.olat.course.run.userview.UserCourseEnvironment, org.olat.course.run.userview.NodeEvaluation)

createPeekViewRunController

public Controller createPeekViewRunController(UserRequest ureq,
                                              WindowControl wControl,
                                              UserCourseEnvironment userCourseEnv,
                                              NodeEvaluation ne)
Description copied from class: GenericCourseNode
Default implementation of the peekview controller that returns NULL: no node specific peekview information should be shown
Override this method with a specific implementation if you have something interesting to show in the peekview

Specified by:
createPeekViewRunController in interface CourseNode
Overrides:
createPeekViewRunController in class GenericCourseNode
Returns:
See Also:
GenericCourseNode.createPeekViewRunController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl, org.olat.course.run.userview.UserCourseEnvironment, org.olat.course.run.userview.NodeEvaluation)

createPreviewController

public Controller createPreviewController(UserRequest ureq,
                                          WindowControl wControl,
                                          UserCourseEnvironment userCourseEnv,
                                          NodeEvaluation ne)
Description copied from class: GenericCourseNode
default implementation of the previewController

Specified by:
createPreviewController in interface CourseNode
Overrides:
createPreviewController in class GenericCourseNode
Returns:
Controller
See Also:
GenericCourseNode.createPreviewController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl, org.olat.course.run.userview.UserCourseEnvironment, org.olat.course.run.userview.NodeEvaluation)

getFoldernodePathRelToFolderBase

public static java.lang.String getFoldernodePathRelToFolderBase(CourseEnvironment courseEnv,
                                                                CourseNode node)
Parameters:
courseEnv -
node -
Returns:
the relative folder base path for this folder node

getFoldernodesPathRelToFolderBase

public static java.lang.String getFoldernodesPathRelToFolderBase(CourseEnvironment courseEnv)
Parameters:
courseEnv -
Returns:
the relative folder base path for folder nodes

getNodeFolderContainer

public static OlatNamedContainerImpl getNodeFolderContainer(BCCourseNode node,
                                                            CourseEnvironment courseEnv)
Get a named container of a node with the node title as its name.

Parameters:
node -
courseEnv -
Returns:

exportNode

public void exportNode(java.io.File exportDirectory,
                       ICourse course)
Description copied from interface: CourseNode
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.

Specified by:
exportNode in interface CourseNode
Overrides:
exportNode in class GenericCourseNode
Parameters:
exportDirectory - The directory where the exported files should be put. This directory must exist prior to calling this method.
See Also:
GenericCourseNode.exportNode(java.io.File, org.olat.course.ICourse)

importNode

public Controller importNode(java.io.File importDirectory,
                             ICourse course,
                             boolean unattendedImport,
                             UserRequest ureq,
                             WindowControl wControl)
Description copied from interface: CourseNode
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.

Specified by:
importNode in interface CourseNode
Overrides:
importNode in class GenericCourseNode
Returns:
Controller for user driven import, or null after all import tasks have finished.
See Also:
org.olat.course.nodes.GenericCourseNode#importNode(java.io.File, org.olat.course.ICourse, org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)

getPreConditionDownloaders

public Condition getPreConditionDownloaders()
Returns:
Returns the preConditionDownloaders.

setPreConditionDownloaders

public void setPreConditionDownloaders(Condition preConditionDownloaders)
Parameters:
preConditionDownloaders - The preConditionDownloaders to set.

getPreConditionUploaders

public Condition getPreConditionUploaders()
Returns:
Returns the preConditionUploaders.

setPreConditionUploaders

public void setPreConditionUploaders(Condition preConditionUploaders)
Parameters:
preConditionUploaders - The preConditionUploaders to set.

isConfigValid

public StatusDescription isConfigValid()
Returns:
true if the course node configuration is correct without the course context.
See Also:
CourseNode.isConfigValid()

isConfigValid

public StatusDescription[] isConfigValid(CourseEditorEnv cev)
Description copied from class: GenericCourseNode
must be implemented in the concrete subclasses as a translator is needed for the errormessages which comes with evaluating condition expressions

Specified by:
isConfigValid in interface CourseNode
Specified by:
isConfigValid in class GenericCourseNode
Returns:
true if the course node configuration is valid for itself and also within the specified course environment.
See Also:
org.olat.course.nodes.CourseNode#isConfigValid(org.olat.course.run.userview.UserCourseEnvironment)

getReferencedRepositoryEntry

public RepositoryEntry getReferencedRepositoryEntry()
Description copied from interface: CourseNode
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
See Also:
CourseNode.getReferencedRepositoryEntry()

needsReferenceToARepositoryEntry

public 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.
See Also:
CourseNode.needsReferenceToARepositoryEntry()

informOnDelete

public java.lang.String informOnDelete(java.util.Locale locale,
                                       ICourse course)
Description copied from class: GenericCourseNode
Generic interface implementation. May be overriden by specific node's implementation.

Specified by:
informOnDelete in interface CourseNode
Overrides:
informOnDelete in class GenericCourseNode
course - The course
Returns:
The dialogue message if any data will be deleted in the next step
See Also:
org.olat.course.nodes.CourseNode#informOnDelete(org.olat.core.gui.UserRequest, org.olat.course.ICourse)

cleanupOnDelete

public void cleanupOnDelete(ICourse course)
Delete the folder if node is deleted.

Specified by:
cleanupOnDelete in interface CourseNode
Overrides:
cleanupOnDelete in class GenericCourseNode
Parameters:
course - The course
See Also:
CourseNode.cleanupOnDelete(org.olat.course.ICourse)

getConditionExpressions

public java.util.List getConditionExpressions()
Specified by:
getConditionExpressions in interface CourseNode
Overrides:
getConditionExpressions in class GenericCourseNode
Returns:
empty list, or list with active condition expressions of the course node
See Also:
GenericCourseNode.getConditionExpressions()