org.sakaiproject.component.legacy.coursemanagement
Class BasicCourseManagementService

java.lang.Object
  extended byorg.sakaiproject.component.legacy.coursemanagement.BasicCourseManagementService
All Implemented Interfaces:
CourseManagementService

public class BasicCourseManagementService
extends Object
implements CourseManagementService

BasicCourseManagementService is a course management services implemented as a Turbine Service.

Version:
$Revision: 6474 $
Author:
University of Michigan, CHEF Software Development Team

Field Summary
protected  Logger m_logger
          Dependency: logging service
protected  CourseManagementProvider m_provider
          A course management provider.
protected  List m_terms
          The term information
 
Fields inherited from interface org.sakaiproject.service.legacy.coursemanagement.CourseManagementService
SECURE_ADD_TERM, SECURE_REMOVE_TERM, SECURE_UPDATE_COURSE_ANY, SERVICE_NAME
 
Constructor Summary
BasicCourseManagementService()
           
 
Method Summary
 void destroy()
          Returns to uninitialized state.
protected  Course findCourse(String courseId)
          Find the course object (only - no provider check).
 Course getCourse(String id)
          Get the course object with the course provider id specified
 String getCourseId(Term term, List requiredFields)
          Construct course id based on provided information
 List getCourseIdRequiredFields()
          Return a list of field (labels) required for constructing course id
 List getCourseIdRequiredFieldsSizes()
          Return a list of maximum field size for course id required fields
 List getCourseMembers(String id)
          Get the list of CourseMember objects with the course provider id specified
 String getCourseName(String id)
          Get the course name by id
 List getInstructorCourses(String instructorId, String termYear, String termTerm)
          Get all the course objects in specific term and with the user as the instructor
 Term getTerm(String termId)
          Access a term
 List getTerms()
          Access all terms
 void init()
          Final initialization, once all dependencies are set.
 void setLogger(Logger service)
          Dependency: logging service.
 void setProvider(CourseManagementProvider provider)
          Configuration: set the course management provider helper service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_provider

protected CourseManagementProvider m_provider
A course management provider.


m_terms

protected List m_terms
The term information


m_logger

protected Logger m_logger
Dependency: logging service

Constructor Detail

BasicCourseManagementService

public BasicCourseManagementService()
Method Detail

setLogger

public void setLogger(Logger service)
Dependency: logging service.

Parameters:
service - The logging service.

setProvider

public void setProvider(CourseManagementProvider provider)
Configuration: set the course management provider helper service.

Parameters:
provider - the user directory provider helper service.

init

public void init()
Final initialization, once all dependencies are set.


destroy

public void destroy()
Returns to uninitialized state. You can use this method to release resources thet your Service allocated when Turbine shuts down.


getCourseIdRequiredFields

public List getCourseIdRequiredFields()
Description copied from interface: CourseManagementService
Return a list of field (labels) required for constructing course id

Specified by:
getCourseIdRequiredFields in interface CourseManagementService

getCourseIdRequiredFieldsSizes

public List getCourseIdRequiredFieldsSizes()
Description copied from interface: CourseManagementService
Return a list of maximum field size for course id required fields

Specified by:
getCourseIdRequiredFieldsSizes in interface CourseManagementService

getCourseId

public String getCourseId(Term term,
                          List requiredFields)
Description copied from interface: CourseManagementService
Construct course id based on provided information

Specified by:
getCourseId in interface CourseManagementService

getTerms

public List getTerms()
Access all terms

Specified by:
getTerms in interface CourseManagementService
Returns:
A course object containing the coure information
Throws:
IdUnusedException - if not found

getTerm

public Term getTerm(String termId)
Access a term

Specified by:
getTerm in interface CourseManagementService
Parameters:
termId - The term id
Returns:
The Term object
Throws:
IdUnusedException - if not found

findCourse

protected Course findCourse(String courseId)
Find the course object (only - no provider check).

Returns:
The course object found, or null if not found.

getCourse

public Course getCourse(String id)
                 throws IdUnusedException
Description copied from interface: CourseManagementService
Get the course object with the course provider id specified

Specified by:
getCourse in interface CourseManagementService
Returns:
The Course object
Throws:
IdUnusedException

getCourseMembers

public List getCourseMembers(String id)
                      throws IdUnusedException
Description copied from interface: CourseManagementService
Get the list of CourseMember objects with the course provider id specified

Specified by:
getCourseMembers in interface CourseManagementService
Returns:
a list of CourseMember objects
Throws:
IdUnusedException

getCourseName

public String getCourseName(String id)
                     throws IdUnusedException
Description copied from interface: CourseManagementService
Get the course name by id

Specified by:
getCourseName in interface CourseManagementService
Parameters:
id - The course Id
Returns:
The course name
Throws:
IdUnusedException

getInstructorCourses

public List getInstructorCourses(String instructorId,
                                 String termYear,
                                 String termTerm)
Description copied from interface: CourseManagementService
Get all the course objects in specific term and with the user as the instructor

Specified by:
getInstructorCourses in interface CourseManagementService
Parameters:
instructorId - The id for the instructor
termYear - The term year
termTerm - The term term
Returns:
The list of courses