org.sakaiproject.component.section
Class CourseManagerHibernateImpl

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.sakaiproject.component.section.CourseManagerHibernateImpl
All Implemented Interfaces:
CourseManager, org.springframework.beans.factory.InitializingBean

public class CourseManagerHibernateImpl
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements CourseManager

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

Author:
Josh Holtzman

Field Summary
 
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.
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, 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
 

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
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
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
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

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


Copyright © 2011 Sakai Project. All Rights Reserved.