org.kuali.student.lum.workflow
Class CourseStateChangeServiceImpl

java.lang.Object
  extended by org.kuali.student.lum.workflow.CourseStateChangeServiceImpl

@Transactional(noRollbackFor=DoesNotExistException.class,
               rollbackFor=java.lang.Throwable.class)
public class CourseStateChangeServiceImpl
extends Object


Field Summary
private  CourseService courseService
           
 
Constructor Summary
CourseStateChangeServiceImpl()
           
 
Method Summary
protected  void activateCourse(CourseInfo courseToActivate, String prevEndTermAtpId)
          Activate a course version.
 StatusInfo changeState(String courseId, String newState, String prevEndTermAtpId)
          Change the state of a course to a new state
protected  CourseInfo getCurrentVersionOfCourse(CourseInfo course)
          Get the current version of course from another version of course
protected  void retireCourse(CourseInfo courseToRetire)
          Retire a course version.
 void setCourseService(CourseService courseService)
           
private  void updateCourseVersionStates(CourseInfo thisVerCourse, String thisVerNewState, CourseInfo currVerCourse, String currVerNewState, boolean makeCurrent, String prevEndTermAtpId)
          Based on null values, updates states of thisVerCourse and currVerCourse and sets thisVerCourse as the current version.
 void updateStatementTreeViewInfoState(CourseInfo courseInfo)
          This method will load all the statements in a course from the course web service, recursively update the state of each statement in the statement tree, and save the update statements back to the web service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

courseService

private CourseService courseService
Constructor Detail

CourseStateChangeServiceImpl

public CourseStateChangeServiceImpl()
Method Detail

changeState

public StatusInfo changeState(String courseId,
                              String newState,
                              String prevEndTermAtpId)
                       throws Exception
Change the state of a course to a new state

Parameters:
courseId - id of course
newState - the new state for the course
prevEndTermAtpId - the current version end date of course
Returns:
Throws:
Exception

activateCourse

protected void activateCourse(CourseInfo courseToActivate,
                              String prevEndTermAtpId)
                       throws Exception
Activate a course version. Only course with a state of "Approved" can be activated.

Parameters:
courseToActivate -
prevEndTermAtpId - the end term we set on the current version
Throws:
Exception

retireCourse

protected void retireCourse(CourseInfo courseToRetire)
                     throws Exception
Retire a course version. Only course with a state of "Active" or "Suspended" can be retired

Parameters:
courseToRetire - the course to retire
Throws:
Exception

getCurrentVersionOfCourse

protected CourseInfo getCurrentVersionOfCourse(CourseInfo course)
                                        throws Exception
Get the current version of course from another version of course

Parameters:
verIndId -
Throws:
Exception

updateCourseVersionStates

@Transactional(readOnly=false)
private void updateCourseVersionStates(CourseInfo thisVerCourse,
                                                             String thisVerNewState,
                                                             CourseInfo currVerCourse,
                                                             String currVerNewState,
                                                             boolean makeCurrent,
                                                             String prevEndTermAtpId)
                                throws Exception
Based on null values, updates states of thisVerCourse and currVerCourse and sets thisVerCourse as the current version. Attempts to rollback transaction on exception.

Parameters:
thisVerCourse - this is the version that the user selected to change the state
thisVerNewState - this is state that the user selected to change thisVerCourse to
currVerCourse - this is the current version of the course (currentVersionStartDt <= now && currentVersionEndDt > now)
currVerNewState - this is the state that we need to set the current version to. Set to null to not update the currVerCourse state.
makeCurrent - if true we'll set thisVerCourse as the current version.
prevEndTermAtpId - the end term for the previous version to end on
Throws:
Exception

setCourseService

public void setCourseService(CourseService courseService)

updateStatementTreeViewInfoState

public void updateStatementTreeViewInfoState(CourseInfo courseInfo)
                                      throws DoesNotExistException,
                                             InvalidParameterException,
                                             MissingParameterException,
                                             OperationFailedException,
                                             PermissionDeniedException,
                                             DataValidationErrorException,
                                             CircularReferenceException,
                                             VersionMismatchException
This method will load all the statements in a course from the course web service, recursively update the state of each statement in the statement tree, and save the update statements back to the web service.

Parameters:
courseInfo - The course to update (call setState() in this object to set the state)
Throws:
DoesNotExistException
InvalidParameterException
MissingParameterException
OperationFailedException
PermissionDeniedException
DataValidationErrorException
CircularReferenceException
VersionMismatchException


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.