org.sakaiproject.coursemanagement.impl
Class CourseManagementAdministrationHibernateImpl

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.sakaiproject.coursemanagement.impl.CourseManagementAdministrationHibernateImpl
All Implemented Interfaces:
CourseManagementAdministration, org.springframework.beans.factory.InitializingBean

public class CourseManagementAdministrationHibernateImpl
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements CourseManagementAdministration

Manipulates course and enrollment data stored in sakai's local hibernate tables.

Author:
Josh Holtzman

Field Summary
protected  Authentication authn
           
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
CourseManagementAdministrationHibernateImpl()
           
 
Method Summary
 void addCanonicalCourseToCourseSet(String courseSetEid, String canonicalCourseEid)
          Adds a CanonicalCourse to a CourseSet.
 void addCourseOfferingToCourseSet(String courseSetEid, String courseOfferingEid)
          Adds a CourseOffering to a CourseSet.
 Membership addOrUpdateCourseOfferingMembership(String userId, String role, String courseOfferingEid, String status)
          Adds a user to a CourseOffering.
 Membership addOrUpdateCourseSetMembership(String userId, String role, String courseSetEid, String status)
          Adds a user to a CourseSet.
 Enrollment addOrUpdateEnrollment(String userId, String enrollmentSetEid, String enrollmentStatus, String credits, String gradingScheme)
          Adds an Enrollment to an EnrollmentSet.
 Membership addOrUpdateSectionMembership(String userId, String role, String sectionEid, String status)
          Adds a user to a Section.
 SectionCategory addSectionCategory(String categoryCode, String categoryDescription)
           
 AcademicSession createAcademicSession(String eid, String title, String description, Date startDate, Date endDate)
          Creates a new AcademicSession.
 CanonicalCourse createCanonicalCourse(String eid, String title, String description)
          Creates a new CanonicalCourse.
 CourseOffering createCourseOffering(String eid, String title, String description, String status, String academicSessionEid, String canonicalCourseEid, Date startDate, Date endDate)
          Creates a new CourseOffering.
 CourseSet createCourseSet(String eid, String title, String description, String category, String parentCourseSetEid)
          Creates a new CourseSet.
 EnrollmentSet createEnrollmentSet(String eid, String title, String description, String category, String defaultEnrollmentCredits, String courseOfferingEid, Set officialGraders)
          Creates a new EnrollmentSet.
 Section createSection(String eid, String title, String description, String category, String parentSectionEid, String courseOfferingEid, String enrollmentSetEid)
          Creates a new Section.
 void destroy()
           
 void init()
           
 Meeting newSectionMeeting(String sectionEid, String location, Time startTime, Time finishTime, String notes)
          Creates a new meeting instance.
 void removeAcademicSession(String eid)
          Removes an academic session and all CourseOfferings associated with this academic session.
 void removeCanonicalCourse(String eid)
          Removes a canonical course and any course offerings associated with this canonical course.
 boolean removeCanonicalCourseFromCourseSet(String courseSetEid, String canonicalCourseEid)
          Removes a CanonicalCourse from a CourseSet.
 void removeCourseOffering(String eid)
          Removes a course offering, any memberships in the course offering, as well as sections and enrollment sets that belong to this course offering.
 boolean removeCourseOfferingFromCourseSet(String courseSetEid, String courseOfferingEid)
          Removes a CourseOffering from a CourseSet.
 boolean removeCourseOfferingMembership(String userId, String courseOfferingEid)
          Removes a user from a CourseOffering.
 void removeCourseSet(String eid)
          Removes a course set and any memberships in the course set.
 boolean removeCourseSetMembership(String userId, String courseSetEid)
          Removes a user from a CourseSet.
 boolean removeEnrollment(String userId, String enrollmentSetEid)
          Removes an Enrollment from an EnrollmentSet by setting the Enrollment to dropped=true.
 void removeEnrollmentSet(String eid)
          Removes an enrollment set and all associated enrollments.
 boolean removeEquivalency(CanonicalCourse canonicalCourse)
          Removes a CanonicalCourse from its set of equivalent CanonicalCourses, if it is a member of such a set.
 boolean removeEquivalency(CourseOffering courseOffering)
          Removes a CourseOffering from its set of equivalent CourseOfferings, if it is a member of such a set.
 void removeSection(String eid)
          Removes a section and any memberships in the section.
 boolean removeSectionMembership(String userId, String sectionEid)
          Removes a user from a Section.
 void setAuthn(Authentication authn)
           
 void setCurrentAcademicSessions(List<String> academicSessionEids)
          Determines which sessions will be returned by getCurrentAcademicSessions().
 void setEquivalentCanonicalCourses(Set canonicalCourses)
          Creates an equivalency (cross listing) between CanonicalCourses
 void setEquivalentCourseOfferings(Set courseOfferings)
          Creates an equivalency (cross listing) betweencourseOfferings
 void updateAcademicSession(AcademicSession academicSession)
          Updates an existing AcademicSession.
 void updateCanonicalCourse(CanonicalCourse canonicalCourse)
          Updates an existing CanonicalCourse.
 void updateCourseOffering(CourseOffering courseOffering)
          Updates an existing CourseOffering.
 void updateCourseSet(CourseSet courseSet)
          Updates an existing CourseSet.
 void updateEnrollmentSet(EnrollmentSet enrollmentSet)
          Updates an existing EnrollmentSet.
 void updateSection(Section section)
          Updates an existing Section.
 
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
 

Field Detail

authn

protected Authentication authn
Constructor Detail

CourseManagementAdministrationHibernateImpl

public CourseManagementAdministrationHibernateImpl()
Method Detail

setAuthn

public void setAuthn(Authentication authn)

init

public void init()

destroy

public void destroy()

createAcademicSession

public AcademicSession createAcademicSession(String eid,
                                             String title,
                                             String description,
                                             Date startDate,
                                             Date endDate)
                                      throws IdExistsException
Description copied from interface: CourseManagementAdministration
Creates a new AcademicSession.

Specified by:
createAcademicSession in interface CourseManagementAdministration
Throws:
IdExistsException

updateAcademicSession

public void updateAcademicSession(AcademicSession academicSession)
Description copied from interface: CourseManagementAdministration
Updates an existing AcademicSession.

Specified by:
updateAcademicSession in interface CourseManagementAdministration
Parameters:
academicSession - The AcademicSession to be updated

createCourseSet

public CourseSet createCourseSet(String eid,
                                 String title,
                                 String description,
                                 String category,
                                 String parentCourseSetEid)
                          throws IdExistsException
Description copied from interface: CourseManagementAdministration
Creates a new CourseSet.

Specified by:
createCourseSet in interface CourseManagementAdministration
parentCourseSetEid - The parent CourseSet's eid, or null if none.
Throws:
IdExistsException

updateCourseSet

public void updateCourseSet(CourseSet courseSet)
Description copied from interface: CourseManagementAdministration
Updates an existing CourseSet.

Specified by:
updateCourseSet in interface CourseManagementAdministration

createCanonicalCourse

public CanonicalCourse createCanonicalCourse(String eid,
                                             String title,
                                             String description)
                                      throws IdExistsException
Description copied from interface: CourseManagementAdministration
Creates a new CanonicalCourse.

Specified by:
createCanonicalCourse in interface CourseManagementAdministration
Throws:
IdExistsException

updateCanonicalCourse

public void updateCanonicalCourse(CanonicalCourse canonicalCourse)
Description copied from interface: CourseManagementAdministration
Updates an existing CanonicalCourse.

Specified by:
updateCanonicalCourse in interface CourseManagementAdministration

addCanonicalCourseToCourseSet

public void addCanonicalCourseToCourseSet(String courseSetEid,
                                          String canonicalCourseEid)
                                   throws IdNotFoundException
Description copied from interface: CourseManagementAdministration
Adds a CanonicalCourse to a CourseSet.

Specified by:
addCanonicalCourseToCourseSet in interface CourseManagementAdministration
Throws:
IdNotFoundException

removeCanonicalCourseFromCourseSet

public boolean removeCanonicalCourseFromCourseSet(String courseSetEid,
                                                  String canonicalCourseEid)
Description copied from interface: CourseManagementAdministration
Removes a CanonicalCourse from a CourseSet.

Specified by:
removeCanonicalCourseFromCourseSet in interface CourseManagementAdministration
Returns:
Whether the CanonicalCourse was a member of the CourseSet and was successfully removed.

setEquivalentCanonicalCourses

public void setEquivalentCanonicalCourses(Set canonicalCourses)
Description copied from interface: CourseManagementAdministration
Creates an equivalency (cross listing) between CanonicalCourses

Specified by:
setEquivalentCanonicalCourses in interface CourseManagementAdministration

removeEquivalency

public boolean removeEquivalency(CanonicalCourse canonicalCourse)
Description copied from interface: CourseManagementAdministration
Removes a CanonicalCourse from its set of equivalent CanonicalCourses, if it is a member of such a set.

Specified by:
removeEquivalency in interface CourseManagementAdministration
Returns:
Whether the equivalency existed and was removed.

createCourseOffering

public CourseOffering createCourseOffering(String eid,
                                           String title,
                                           String description,
                                           String status,
                                           String academicSessionEid,
                                           String canonicalCourseEid,
                                           Date startDate,
                                           Date endDate)
                                    throws IdExistsException
Description copied from interface: CourseManagementAdministration
Creates a new CourseOffering.

Specified by:
createCourseOffering in interface CourseManagementAdministration
Throws:
IdExistsException

updateCourseOffering

public void updateCourseOffering(CourseOffering courseOffering)
Description copied from interface: CourseManagementAdministration
Updates an existing CourseOffering.

Specified by:
updateCourseOffering in interface CourseManagementAdministration

setEquivalentCourseOfferings

public void setEquivalentCourseOfferings(Set courseOfferings)
Description copied from interface: CourseManagementAdministration
Creates an equivalency (cross listing) betweencourseOfferings

Specified by:
setEquivalentCourseOfferings in interface CourseManagementAdministration

removeEquivalency

public boolean removeEquivalency(CourseOffering courseOffering)
Description copied from interface: CourseManagementAdministration
Removes a CourseOffering from its set of equivalent CourseOfferings, if it is a member of such a set.

Specified by:
removeEquivalency in interface CourseManagementAdministration
Returns:
Whether the equivalency existed and was removed.

addCourseOfferingToCourseSet

public void addCourseOfferingToCourseSet(String courseSetEid,
                                         String courseOfferingEid)
Description copied from interface: CourseManagementAdministration
Adds a CourseOffering to a CourseSet.

Specified by:
addCourseOfferingToCourseSet in interface CourseManagementAdministration

removeCourseOfferingFromCourseSet

public boolean removeCourseOfferingFromCourseSet(String courseSetEid,
                                                 String courseOfferingEid)
Description copied from interface: CourseManagementAdministration
Removes a CourseOffering from a CourseSet.

Specified by:
removeCourseOfferingFromCourseSet in interface CourseManagementAdministration
Returns:
Whether the CourseOffering was in the CourseSet and was removed.

createEnrollmentSet

public EnrollmentSet createEnrollmentSet(String eid,
                                         String title,
                                         String description,
                                         String category,
                                         String defaultEnrollmentCredits,
                                         String courseOfferingEid,
                                         Set officialGraders)
                                  throws IdExistsException
Description copied from interface: CourseManagementAdministration
Creates a new EnrollmentSet.

Specified by:
createEnrollmentSet in interface CourseManagementAdministration
Throws:
IdExistsException

updateEnrollmentSet

public void updateEnrollmentSet(EnrollmentSet enrollmentSet)
Description copied from interface: CourseManagementAdministration
Updates an existing EnrollmentSet.

Specified by:
updateEnrollmentSet in interface CourseManagementAdministration

addOrUpdateEnrollment

public Enrollment addOrUpdateEnrollment(String userId,
                                        String enrollmentSetEid,
                                        String enrollmentStatus,
                                        String credits,
                                        String gradingScheme)
Description copied from interface: CourseManagementAdministration
Adds an Enrollment to an EnrollmentSet. If the user is already enrolled in the EnrollmentSet, the Enrollment record is updated for the user.

Specified by:
addOrUpdateEnrollment in interface CourseManagementAdministration

removeEnrollment

public boolean removeEnrollment(String userId,
                                String enrollmentSetEid)
Description copied from interface: CourseManagementAdministration
Removes an Enrollment from an EnrollmentSet by setting the Enrollment to dropped=true.

Specified by:
removeEnrollment in interface CourseManagementAdministration
Returns:
Whether the enrollment existed and was removed.

createSection

public Section createSection(String eid,
                             String title,
                             String description,
                             String category,
                             String parentSectionEid,
                             String courseOfferingEid,
                             String enrollmentSetEid)
                      throws IdExistsException
Description copied from interface: CourseManagementAdministration
Creates a new Section.

Specified by:
createSection in interface CourseManagementAdministration
Throws:
IdExistsException

updateSection

public void updateSection(Section section)
Description copied from interface: CourseManagementAdministration
Updates an existing Section.

Specified by:
updateSection in interface CourseManagementAdministration

addOrUpdateCourseSetMembership

public Membership addOrUpdateCourseSetMembership(String userId,
                                                 String role,
                                                 String courseSetEid,
                                                 String status)
                                          throws IdNotFoundException
Description copied from interface: CourseManagementAdministration
Adds a user to a CourseSet. If the user is already a member of the CourseSet, update the user's role.

Specified by:
addOrUpdateCourseSetMembership in interface CourseManagementAdministration
Throws:
IdNotFoundException - If the CourseSet can not be found

removeCourseSetMembership

public boolean removeCourseSetMembership(String userId,
                                         String courseSetEid)
Description copied from interface: CourseManagementAdministration
Removes a user from a CourseSet.

Specified by:
removeCourseSetMembership in interface CourseManagementAdministration
Returns:
Whether the user was a member of the CourseSet and was removed.

addOrUpdateCourseOfferingMembership

public Membership addOrUpdateCourseOfferingMembership(String userId,
                                                      String role,
                                                      String courseOfferingEid,
                                                      String status)
Description copied from interface: CourseManagementAdministration
Adds a user to a CourseOffering. If the user is already a member of the CourseOffering, update the user's role.

Specified by:
addOrUpdateCourseOfferingMembership in interface CourseManagementAdministration

removeCourseOfferingMembership

public boolean removeCourseOfferingMembership(String userId,
                                              String courseOfferingEid)
Description copied from interface: CourseManagementAdministration
Removes a user from a CourseOffering.

Specified by:
removeCourseOfferingMembership in interface CourseManagementAdministration
Returns:
Whether the user was a member of the CourseOffering and was removed.

addOrUpdateSectionMembership

public Membership addOrUpdateSectionMembership(String userId,
                                               String role,
                                               String sectionEid,
                                               String status)
Description copied from interface: CourseManagementAdministration
Adds a user to a Section. If the user is already a member of the Section, update the user's role.

Specified by:
addOrUpdateSectionMembership in interface CourseManagementAdministration

removeSectionMembership

public boolean removeSectionMembership(String userId,
                                       String sectionEid)
Description copied from interface: CourseManagementAdministration
Removes a user from a Section.

Specified by:
removeSectionMembership in interface CourseManagementAdministration
Returns:
Whether the user was a member of the Section and was removed.

newSectionMeeting

public Meeting newSectionMeeting(String sectionEid,
                                 String location,
                                 Time startTime,
                                 Time finishTime,
                                 String notes)
Description copied from interface: CourseManagementAdministration
Creates a new meeting instance. The meeting must be associated with a section and the section must be updated for the meeting to be persisted.

Specified by:
newSectionMeeting in interface CourseManagementAdministration
location - The location of the meeting
startTime - The time that the section starts
notes - Optional notes about this meeting

removeAcademicSession

public void removeAcademicSession(String eid)
Description copied from interface: CourseManagementAdministration
Removes an academic session and all CourseOfferings associated with this academic session.

Specified by:
removeAcademicSession in interface CourseManagementAdministration
Parameters:
eid - The enterprise id of the academic session

removeCanonicalCourse

public void removeCanonicalCourse(String eid)
Description copied from interface: CourseManagementAdministration
Removes a canonical course and any course offerings associated with this canonical course.

Specified by:
removeCanonicalCourse in interface CourseManagementAdministration
Parameters:
eid - The enterprise id of the canonical course

removeCourseOffering

public void removeCourseOffering(String eid)
Description copied from interface: CourseManagementAdministration
Removes a course offering, any memberships in the course offering, as well as sections and enrollment sets that belong to this course offering.

Specified by:
removeCourseOffering in interface CourseManagementAdministration
Parameters:
eid - The enterprise id of the course offering

removeCourseSet

public void removeCourseSet(String eid)
Description copied from interface: CourseManagementAdministration
Removes a course set and any memberships in the course set.

Specified by:
removeCourseSet in interface CourseManagementAdministration
Parameters:
eid - The enterprise id of the course set

removeEnrollmentSet

public void removeEnrollmentSet(String eid)
Description copied from interface: CourseManagementAdministration
Removes an enrollment set and all associated enrollments.

Specified by:
removeEnrollmentSet in interface CourseManagementAdministration
Parameters:
eid - The enterprise id of the enrollment set

removeSection

public void removeSection(String eid)
Description copied from interface: CourseManagementAdministration
Removes a section and any memberships in the section. If an enrollment set is attached to this section, it must be removed via removeEnrollmentSet before removing the section.

Specified by:
removeSection in interface CourseManagementAdministration
Parameters:
eid - The enterprise id of the section

addSectionCategory

public SectionCategory addSectionCategory(String categoryCode,
                                          String categoryDescription)
Specified by:
addSectionCategory in interface CourseManagementAdministration

setCurrentAcademicSessions

public void setCurrentAcademicSessions(List<String> academicSessionEids)
Description copied from interface: CourseManagementAdministration
Determines which sessions will be returned by getCurrentAcademicSessions().

Specified by:
setCurrentAcademicSessions in interface CourseManagementAdministration


Copyright © 2011 Sakai Project. All Rights Reserved.