org.olat.course.editor
Class CourseEditorEnvImpl

java.lang.Object
  extended by org.olat.course.editor.CourseEditorEnvImpl
All Implemented Interfaces:
CourseEditorEnv

public class CourseEditorEnvImpl
extends java.lang.Object
implements CourseEditorEnv

Description:
TODO: guido Class Description for CourseEditorEnvImpl


Constructor Summary
CourseEditorEnvImpl(CourseEditorTreeModel cetm, CourseGroupManager cgm, java.util.Locale editorLocale)
           
 
Method Summary
 void addSoftReference(java.lang.String category, java.lang.String softReference)
           
 boolean existsArea(java.lang.String areaname)
           
 boolean existsGroup(java.lang.String groupname)
           
 boolean existsNode(java.lang.String nodeId)
           
 boolean existsRightGroup(java.lang.String groupname)
           
 CourseGroupManager getCourseGroupManager()
          Return CourseGroupManager for this course environment.
 StatusDescription[] getCourseStatus()
          lists problems and errors of the course at the very moment.
 java.lang.String getCurrentCourseNodeId()
           
 java.util.Locale getEditorEnvLocale()
          the locale of the editor environment to have the facility of providing localized messages within the course editor environment.
 java.util.List getReferencingNodeIdsFor(java.lang.String ident)
           
 boolean isAssessable(java.lang.String nodeId)
          checks for an existing node id if the underlying course node is assessable, e.g.
 boolean isEnrollmentNode(java.lang.String nodeId)
          check if the given node is of type enrollment
 java.util.Set<java.lang.String> listCycles()
          The specified visibility, accessability and score rules defined for a course node reference other couse nodes ids.
 void pushError(java.lang.Exception e)
           
 void setConditionInterpreter(ConditionInterpreter ci)
           
 void setCurrentCourseNodeId(java.lang.String courseNodeId)
           
 java.lang.String toString()
           
 ConditionErrorMessage[] validateConditionExpression(ConditionExpression condExpr)
          validates the condition expression within the condition interpreter.
 void validateCourse()
          after calling validate course, the course is checked for condition and configuration errors.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CourseEditorEnvImpl

public CourseEditorEnvImpl(CourseEditorTreeModel cetm,
                           CourseGroupManager cgm,
                           java.util.Locale editorLocale)
Method Detail

setConditionInterpreter

public void setConditionInterpreter(ConditionInterpreter ci)
Specified by:
setConditionInterpreter in interface CourseEditorEnv
Parameters:
ci -

isEnrollmentNode

public boolean isEnrollmentNode(java.lang.String nodeId)
Description copied from interface: CourseEditorEnv
check if the given node is of type enrollment

Specified by:
isEnrollmentNode in interface CourseEditorEnv
Returns:
See Also:
CourseEditorEnv.isEnrollmentNode(java.lang.String)

isAssessable

public boolean isAssessable(java.lang.String nodeId)
Description copied from interface: CourseEditorEnv
checks for an existing node id if the underlying course node is assessable, e.g. if it makes sense to be used in certain condition functions

Specified by:
isAssessable in interface CourseEditorEnv
Returns:
See Also:
CourseEditorEnv.isAssessable(java.lang.String)

existsNode

public boolean existsNode(java.lang.String nodeId)
Specified by:
existsNode in interface CourseEditorEnv
Returns:
See Also:
CourseEditorEnv.existsNode(java.lang.String)

existsGroup

public boolean existsGroup(java.lang.String groupname)
Specified by:
existsGroup in interface CourseEditorEnv
Returns:
See Also:
CourseEditorEnv.existsGroup(java.lang.String)

existsRightGroup

public boolean existsRightGroup(java.lang.String groupname)
Specified by:
existsRightGroup in interface CourseEditorEnv

existsArea

public boolean existsArea(java.lang.String areaname)
Specified by:
existsArea in interface CourseEditorEnv
Returns:
See Also:
CourseEditorEnv.existsArea(java.lang.String)

getCurrentCourseNodeId

public java.lang.String getCurrentCourseNodeId()
Specified by:
getCurrentCourseNodeId in interface CourseEditorEnv
Returns:
See Also:
CourseEditorEnv.getCurrentCourseNodeId()

setCurrentCourseNodeId

public void setCurrentCourseNodeId(java.lang.String courseNodeId)
Specified by:
setCurrentCourseNodeId in interface CourseEditorEnv
See Also:
CourseEditorEnv.setCurrentCourseNodeId(java.lang.String)

getEditorEnvLocale

public java.util.Locale getEditorEnvLocale()
Description copied from interface: CourseEditorEnv
the locale of the editor environment to have the facility of providing localized messages within the course editor environment.

Specified by:
getEditorEnvLocale in interface CourseEditorEnv
Returns:
Locale of editor environment
See Also:
CourseEditorEnv.getEditorEnvLocale()

validateConditionExpression

public ConditionErrorMessage[] validateConditionExpression(ConditionExpression condExpr)
Description copied from interface: CourseEditorEnv
validates the condition expression within the condition interpreter. If the condition expression is syntactically and semantically correct the method returns true, false otherwise.

The valid soft references found are accessible via the condition expression, and also the complete error summary for the condition expression.

Specified by:
validateConditionExpression in interface CourseEditorEnv
Returns:
See Also:
CourseEditorEnv.validateConditionExpression(org.olat.course.condition.interpreter.ConditionExpression)

addSoftReference

public void addSoftReference(java.lang.String category,
                             java.lang.String softReference)
Specified by:
addSoftReference in interface CourseEditorEnv
See Also:
CourseEditorEnv.addSoftReference(java.lang.String, java.lang.String)

pushError

public void pushError(java.lang.Exception e)
Specified by:
pushError in interface CourseEditorEnv
See Also:
CourseEditorEnv.pushError(java.lang.Exception)

validateCourse

public void validateCourse()
Description copied from interface: CourseEditorEnv
after calling validate course, the course is checked for condition and configuration errors. These validation messages are accessible via CourseEditorEnv

Specified by:
validateCourse in interface CourseEditorEnv
See Also:
CourseEditorEnv.validateCourse()

getCourseStatus

public StatusDescription[] getCourseStatus()
Description copied from interface: CourseEditorEnv
lists problems and errors of the course at the very moment. Should be called after validateCourse and before a next click in the course editor.

Specified by:
getCourseStatus in interface CourseEditorEnv
Returns:
See Also:
CourseEditorEnv.getCourseStatus()

getReferencingNodeIdsFor

public java.util.List getReferencingNodeIdsFor(java.lang.String ident)
Specified by:
getReferencingNodeIdsFor in interface CourseEditorEnv
Returns:
list of nodes referencing the specified node

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

listCycles

public java.util.Set<java.lang.String> listCycles()
Description copied from interface: CourseEditorEnv
The specified visibility, accessability and score rules defined for a course node reference other couse nodes ids. This references together with the course tree structure build a directed graph. An important precondition for publishing changes is the cycle freeness of this directed graph.

Specified by:
listCycles in interface CourseEditorEnv
Returns:
See Also:
CourseEditorEnv.listCycles()

getCourseGroupManager

public CourseGroupManager getCourseGroupManager()
Description copied from interface: CourseEditorEnv
Return CourseGroupManager for this course environment.

Specified by:
getCourseGroupManager in interface CourseEditorEnv
Returns:
CourseGroupManager for this course environment