org.sakaiproject.api.section
Interface CourseManager

All Known Implementing Classes:
CourseManagerHibernateImpl, CourseManagerImpl

public interface CourseManager

Provides methods for adding a top-level course object, to which CourseSections can be associated, and for associating users with the course. The membership-related methods are intended for use in testing the standalone application only. In sakai, we will can use this as an external interface that allows for Course creation, but does not alter membership in the course.

Author:
Josh Holtzman

Method Summary
 ParticipationRecord addEnrollment(User user, Course course)
          Adds a student to a course.
 ParticipationRecord addInstructor(User user, Course course)
          Adds an instructor to a course.
 ParticipationRecord addTA(User user, Course course)
          Adds a TA to a course.
 boolean courseExists(String siteContext)
          Checks to see whether a course exists in this site.
 Course createCourse(String siteContext, String title, boolean selfRegAllowed, boolean selfSwitchingAllowed, boolean externallyManaged)
          Creates a new Course object for this site.
 void removeCourseMembership(String userUid, Course course)
          Removes a user from the course.
 void removeOrphans(String siteContext)
          Removes any section membership record from a site that belongs to a user who is no longer associated with the site.
 

Method Detail

createCourse

public Course createCourse(String siteContext,
                           String title,
                           boolean selfRegAllowed,
                           boolean selfSwitchingAllowed,
                           boolean externallyManaged)
Creates a new Course object for this site.

Parameters:
siteContext - The site context
title - The title of the course or site
selfRegAllowed - Whether to allow students to register for sections in this course.
selfSwitchingAllowed - Whether to allow students to switch sections in this course.
externallyManaged - Whether to flag this course as externally manager (read-only to the app).
Returns:
The newly created Course object.

courseExists

public boolean courseExists(String siteContext)
Checks to see whether a course exists in this site.

Parameters:
siteContext - The site context
Returns:

addEnrollment

public ParticipationRecord addEnrollment(User user,
                                         Course course)
Adds a student to a course. Useful for dataloading in standalone mode.

Parameters:
user -
course -
Returns:

addTA

public ParticipationRecord addTA(User user,
                                 Course course)
Adds a TA to a course. Useful for dataloading in standalone mode.

Parameters:
user -
course -
Returns:

addInstructor

public ParticipationRecord addInstructor(User user,
                                         Course course)
Adds an instructor to a course. Useful for dataloading in standalone mode.

Parameters:
user -
course -
Returns:

removeCourseMembership

public void removeCourseMembership(String userUid,
                                   Course course)
Removes a user from the course.

Parameters:
userUid -
course -

removeOrphans

public void removeOrphans(String siteContext)
Removes any section membership record from a site that belongs to a user who is no longer associated with the site.

Parameters:
siteContext - The site context from which to remove the orphaned records