org.sakaiproject.component.section
Class CourseManagerHibernateImpl

java.lang.Object
  extended byorg.springframework.dao.support.DaoSupport
      extended byorg.springframework.orm.hibernate.support.HibernateDaoSupport
          extended byorg.sakaiproject.component.section.CourseManagerHibernateImpl
All Implemented Interfaces:
CourseManager, InitializingBean

public class CourseManagerHibernateImpl
extends HibernateDaoSupport
implements CourseManager

Hibernate implementation of CourseManager. Useful for loading data in standalone mode.

Author:
Josh Holtzman

Field Summary
protected  UuidManager uuidManager
           
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
CourseManagerHibernateImpl()
           
 
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.
 void setUuidManager(UuidManager uuidManager)
           
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, closeSessionIfNecessary, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uuidManager

protected UuidManager uuidManager
Constructor Detail

CourseManagerHibernateImpl

public CourseManagerHibernateImpl()
Method Detail

createCourse

public Course createCourse(String siteContext,
                           String title,
                           boolean selfRegAllowed,
                           boolean selfSwitchingAllowed,
                           boolean externallyManaged)
Description copied from interface: CourseManager
Creates a new Course object for this site.

Specified by:
createCourse in interface CourseManager
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)
Description copied from interface: CourseManager
Checks to see whether a course exists in this site.

Specified by:
courseExists in interface CourseManager
Parameters:
siteContext - The site context
Returns:

addInstructor

public ParticipationRecord addInstructor(User user,
                                         Course course)
Description copied from interface: CourseManager
Adds an instructor to a course. Useful for dataloading in standalone mode.

Specified by:
addInstructor in interface CourseManager
Parameters:
user -
course -
Returns:

addEnrollment

public ParticipationRecord addEnrollment(User user,
                                         Course course)
Description copied from interface: CourseManager
Adds a student to a course. Useful for dataloading in standalone mode.

Specified by:
addEnrollment in interface CourseManager
Parameters:
user -
course -
Returns:

addTA

public ParticipationRecord addTA(User user,
                                 Course course)
Description copied from interface: CourseManager
Adds a TA to a course. Useful for dataloading in standalone mode.

Specified by:
addTA in interface CourseManager
Parameters:
user -
course -
Returns:

removeCourseMembership

public void removeCourseMembership(String userUid,
                                   Course course)
Description copied from interface: CourseManager
Removes a user from the course.

Specified by:
removeCourseMembership in interface CourseManager
Parameters:
userUid -
course -

removeOrphans

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

Specified by:
removeOrphans in interface CourseManager
Parameters:
siteContext - The site context from which to remove the orphaned records

setUuidManager

public void setUuidManager(UuidManager uuidManager)