Interface CourseManagementService
-
public interface CourseManagementServiceA read-only service that queries enterprise course, section, membership, and enrollment data.- Author:
- Josh Holtzman
-
-
Field Summary
Fields Modifier and Type Field Description static StringENTITY_CM_ADMINstatic StringSECURE_CM_ADMINSecurity function and entity reference for use in SecurityAdivsors to permit CM admin functions without setting a session to admin
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<CourseOffering>findActiveCourseOfferingsInCanonicalCourse(String eid)Find the currently offered course offerings in the cannonical courseMap<String,String>findCourseOfferingRoles(String userEid)Finds the CourseOfferings (and roles) for which a user is a member.Set<CourseOffering>findCourseOfferings(String courseSetEid, String academicSessionEid)Finds all of the course offerings in a course set that are current for any given academic session (regardless of the courseOffering's start and end dates).Map<String,String>findCourseSetRoles(String userEid)Finds the CourseSets (and roles) for which a user is a member.List<CourseSet>findCourseSets(String category)Finds all course sets in a given category.Set<EnrollmentSet>findCurrentlyEnrolledEnrollmentSets(String userEid)Finds the set of current EnrollmentSets for which a user is enrolled but not dropped.Set<EnrollmentSet>findCurrentlyInstructingEnrollmentSets(String userEid)Finds the set of current EnrollmentSets for which a user is an instructor of record.Set<Section>findEnrolledSections(String userEid)Finds all Sections that are linked to an EnrollmentSet for which a user is enrolled (but not dropped).EnrollmentfindEnrollment(String userEid, String enrollmentSetEid)Finds the Enrollment for a user in an EnrollmentSet.Set<Section>findInstructingSections(String userEid)Finds all Sections that are linked to an EnrollmentSet for which a user is an instructor of record.Set<Section>findInstructingSections(String userEid, String academicSessionEid)Finds all Sections that are linked to an EnrollmentSet for which a user is an instructor of record and which are part of a CourseOffering in a given AcademicSession.Map<String,String>findSectionRoles(String userEid)Finds the Sections (and roles) for which a user is a member.Map<String,String>findSectionRoles(String userEid, String academicSessionEid)Finds the Sections (and roles) for which a user is a member and which are part of a CourseOffering in a given AcademicSession.AcademicSessiongetAcademicSession(String eid)Gets a AcademicSession by its eid.List<AcademicSession>getAcademicSessions()Gets the list of all known AcademicSessions, sorted by start date.CanonicalCoursegetCanonicalCourse(String canonicalCourseEid)Gets a CanonicalCourse by its eid.Set<CanonicalCourse>getCanonicalCourses(String courseSetEid)Gets the CanonicalCourses in a CourseSet.Set<CourseSet>getChildCourseSets(String parentCourseSetEid)Gets the child CourseSet from a parent CourseSet.Set<Section>getChildSections(String parentSectionEid)Gets the child Sections from a parent Section.CourseOfferinggetCourseOffering(String courseOfferingEid)Gets a CourseOffering by its eid.Set<Membership>getCourseOfferingMemberships(String courseOfferingEid)Gets the memberships directly contained by this CourseOffering.Set<CourseOffering>getCourseOfferingsInCanonicalCourse(String canonicalCourseEid)Finds all course offerings belonging to a canonical course.Set<CourseOffering>getCourseOfferingsInCourseSet(String courseSetEid)Gets the CourseOfferings in a CourseSet.CourseSetgetCourseSet(String courseSetEid)Gets a CourseSet by its eid.Set<Membership>getCourseSetMemberships(String courseSetEid)Gets the memberships directly contained by this CourseSet.Set<CourseSet>getCourseSets()Gets all of the top level CourseSetsList<AcademicSession>getCurrentAcademicSessions()Gets the list of current AcademicSessions, sorted by start date.Set<Enrollment>getEnrollments(String enrollmentSetEid)Gets the Enrollments in an EnrollmentSet (including dropped enrollments)EnrollmentSetgetEnrollmentSet(String enrollmentSetEid)Gets an EnrollmentSet by its eid.Set<EnrollmentSet>getEnrollmentSets(String courseOfferingEid)Gets the EnrollmentSets associated with a CourseOfferingStringgetEnrollmentStatusDescription(String statusId)Gets the known enrollment status code for the idMap<String,String>getEnrollmentStatusDescriptions(Locale locale)Gets the known enrollment status codes and descriptions for Enrollments.Set<CanonicalCourse>getEquivalentCanonicalCourses(String canonicalCourseEid)Gets the equivalent CanonicalCourses.Set<CourseOffering>getEquivalentCourseOfferings(String courseOfferingEid)Gets any equivalent CourseOfferings.Map<String,String>getGradingSchemeDescriptions(Locale locale)Gets the known grading scheme codes and descriptions for Enrollments.Set<String>getInstructorsOfRecordIds(String enrollmentSetEid)Gets the set of user ids that are, according to the enterprise, responsible for the EnrollmentSet.Map<String,String>getMembershipStatusDescriptions(Locale locale)Gets the known membership status codes and descriptions for Memberships.SectiongetSection(String sectionEid)Gets a Section by its eid.List<String>getSectionCategories()Gets the list of section categories defined by the institution.StringgetSectionCategoryDescription(String categoryCode)Gets the description for a category, identified by the category code, or null if the category code can not be found.Set<Membership>getSectionMemberships(String sectionEid)Gets the members directly contained by this Section.Set<Section>getSections(String courseOfferingEid)Gets the top-level Sections associated with a CourseOfferingbooleanisAcademicSessionDefined(String eid)Checks whether an AcademicSession exists.booleanisCanonicalCourseDefined(String eid)Checks whether a CanonicalCourse exists.booleanisCourseOfferingDefined(String eid)Checks whether a CourseOffering exists.booleanisCourseSetDefined(String eid)Checks whether a CourseSet exists.booleanisEmpty(String courseSetEid)Determines whether a CourseSet has any CanonicalCourses or CourseSets.booleanisEnrolled(String userEid, String enrollmentSetEid)Convenience method for checking whether a user is enrolled (and not dropped) in an EnrollmentSet.booleanisEnrolled(String userEid, Set<String> enrollmentSetEids)Determines whether a user is enrolled (and not dropped) in an EnrollmentSet.booleanisEnrollmentSetDefined(String eid)Checks whether an EnrollmentSet exists.booleanisSectionDefined(String eid)Checks whether a Section exists.
-
-
-
Field Detail
-
SECURE_CM_ADMIN
static final String SECURE_CM_ADMIN
Security function and entity reference for use in SecurityAdivsors to permit CM admin functions without setting a session to admin- See Also:
- Constant Field Values
-
ENTITY_CM_ADMIN
static final String ENTITY_CM_ADMIN
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCourseSet
CourseSet getCourseSet(String courseSetEid) throws IdNotFoundException
Gets a CourseSet by its eid.- Parameters:
courseSetEid- The CourseSet's unique eid- Returns:
- The CourseSet
- Throws:
IdNotFoundException- If the eid is not associated with any CourseSet
-
isCourseSetDefined
boolean isCourseSetDefined(String eid)
Checks whether a CourseSet exists.- Parameters:
eid- The enterprise id- Returns:
- Whether the object exists
-
getChildCourseSets
Set<CourseSet> getChildCourseSets(String parentCourseSetEid) throws IdNotFoundException
Gets the child CourseSet from a parent CourseSet.- Parameters:
parentCourseSetEid- The parent CourseSet eid- Returns:
- The Set of child CourseSets
- Throws:
IdNotFoundException
-
getCourseSets
Set<CourseSet> getCourseSets()
Gets all of the top level CourseSets- Returns:
- The Set of CourseSets that have no parent CourseSet
-
getCourseSetMemberships
Set<Membership> getCourseSetMemberships(String courseSetEid) throws IdNotFoundException
Gets the memberships directly contained by this CourseSet.- Parameters:
courseSetEid-- Returns:
- The set of memberships in this CourseSet. This is not a transitive set.
- Throws:
IdNotFoundException- If the eid is not associated with any CourseSet
-
getCanonicalCourse
CanonicalCourse getCanonicalCourse(String canonicalCourseEid) throws IdNotFoundException
Gets a CanonicalCourse by its eid.- Parameters:
canonicalCourseEid-- Returns:
- The CanonicalCourse
- Throws:
IdNotFoundException- If the eid is not associated with any CanonicalCourse
-
isCanonicalCourseDefined
boolean isCanonicalCourseDefined(String eid)
Checks whether a CanonicalCourse exists.- Parameters:
eid- The enterprise id- Returns:
- Whether the object exists
-
getEquivalentCanonicalCourses
Set<CanonicalCourse> getEquivalentCanonicalCourses(String canonicalCourseEid) throws IdNotFoundException
Gets the equivalent CanonicalCourses.- Parameters:
canonicalCourseEid- The eid of the CanonicalCourse to use in finding equivalents- Returns:
- The set of CanonicalCourses that are equivalent (in the Enterprise view, not in the Java view -- this is independent of CanonicalCourse.equals()).
- Throws:
IdNotFoundException
-
getCanonicalCourses
Set<CanonicalCourse> getCanonicalCourses(String courseSetEid) throws IdNotFoundException
Gets the CanonicalCourses in a CourseSet.- Parameters:
courseSetEid- The eid of the CourseSet- Returns:
- The set of CanonicalCourses in the CourseSet
- Throws:
IdNotFoundException- If the eid is not associated with any CourseSet
-
getAcademicSessions
List<AcademicSession> getAcademicSessions()
Gets the list of all known AcademicSessions, sorted by start date.- Returns:
-
getCurrentAcademicSessions
List<AcademicSession> getCurrentAcademicSessions()
Gets the list of current AcademicSessions, sorted by start date.- Returns:
-
getAcademicSession
AcademicSession getAcademicSession(String eid) throws IdNotFoundException
Gets a AcademicSession by its eid.- Parameters:
eid-- Returns:
- The AcademicSession
- Throws:
IdNotFoundException- If the eid is not associated with any AcademicSession
-
isAcademicSessionDefined
boolean isAcademicSessionDefined(String eid)
Checks whether an AcademicSession exists.- Parameters:
eid- The enterprise id- Returns:
- Whether the object exists
-
getCourseOffering
CourseOffering getCourseOffering(String courseOfferingEid) throws IdNotFoundException
Gets a CourseOffering by its eid.- Parameters:
courseOfferingEid-- Returns:
- The CourseOffering
- Throws:
IdNotFoundException- If the eid is not associated with any CourseOffering
-
isCourseOfferingDefined
boolean isCourseOfferingDefined(String eid)
Checks whether a CourseOffering exists.- Parameters:
eid- The enterprise id- Returns:
- Whether the object exists
-
getEquivalentCourseOfferings
Set<CourseOffering> getEquivalentCourseOfferings(String courseOfferingEid) throws IdNotFoundException
Gets any equivalent CourseOfferings.- Parameters:
courseOfferingEid- The eid of the CourseOffering to use in finding equivalents- Returns:
- The set of CourseOfferings that are equivalent (in the Enterprise view, not in the Java view -- this is independent of CourseOffering.equals()).
- Throws:
IdNotFoundException- If the eid is not associated with any CourseOffering
-
getCourseOfferingMemberships
Set<Membership> getCourseOfferingMemberships(String courseOfferingEid) throws IdNotFoundException
Gets the memberships directly contained by this CourseOffering.- Parameters:
courseOfferingEid-- Returns:
- The set of memberships in this CourseOffering. This is not a recursive set of Memberships.
- Throws:
IdNotFoundException- If the eid is not associated with any CourseOffering
-
getCourseOfferingsInCourseSet
Set<CourseOffering> getCourseOfferingsInCourseSet(String courseSetEid) throws IdNotFoundException
Gets the CourseOfferings in a CourseSet.- Parameters:
courseSetEid- The eid of the CourseSet- Returns:
- The set of CourseOfferings in the CourseSet
- Throws:
IdNotFoundException- If the eid is not associated with any CourseSet
-
findCourseOfferings
Set<CourseOffering> findCourseOfferings(String courseSetEid, String academicSessionEid) throws IdNotFoundException
Finds all of the course offerings in a course set that are current for any given academic session (regardless of the courseOffering's start and end dates).- Parameters:
courseSetEid-academicSessionEid-- Returns:
- The set of course offerings
- Throws:
IdNotFoundException
-
getCourseOfferingsInCanonicalCourse
Set<CourseOffering> getCourseOfferingsInCanonicalCourse(String canonicalCourseEid) throws IdNotFoundException
Finds all course offerings belonging to a canonical course.- Parameters:
canonicalCourseEid- The enterprise id of the canonical course- Returns:
- The set of course offerings
- Throws:
IdNotFoundException
-
findCourseSets
List<CourseSet> findCourseSets(String category)
Finds all course sets in a given category. Useful for listing the departments- Parameters:
category-- Returns:
- The list of course sets, sorted by title, ascending
-
isEmpty
boolean isEmpty(String courseSetEid)
Determines whether a CourseSet has any CanonicalCourses or CourseSets.- Parameters:
courseSetEid-- Returns:
-
getSection
Section getSection(String sectionEid) throws IdNotFoundException
Gets a Section by its eid.- Parameters:
sectionEid-- Returns:
- The Section
- Throws:
IdNotFoundException- If the eid is not associated with any Section
-
isSectionDefined
boolean isSectionDefined(String eid)
Checks whether a Section exists.- Parameters:
eid- The enterprise id- Returns:
- Whether the object exists
-
getSections
Set<Section> getSections(String courseOfferingEid) throws IdNotFoundException
Gets the top-level Sections associated with a CourseOffering- Parameters:
courseOfferingEid-- Returns:
- The Set of Sections
- Throws:
IdNotFoundException- If the eid is not associated with any CourseOffering
-
getSectionCategories
List<String> getSectionCategories()
Gets the list of section categories defined by the institution.- Returns:
-
getSectionCategoryDescription
String getSectionCategoryDescription(String categoryCode)
Gets the description for a category, identified by the category code, or null if the category code can not be found.- Parameters:
sectionCategoryCode-- Returns:
-
getChildSections
Set<Section> getChildSections(String parentSectionEid) throws IdNotFoundException
Gets the child Sections from a parent Section.- Parameters:
parentSectionEid- The parent Section eid- Returns:
- The Set of child Sections
- Throws:
IdNotFoundException- If the eid is not associated with any parent Section
-
getSectionMemberships
Set<Membership> getSectionMemberships(String sectionEid) throws IdNotFoundException
Gets the members directly contained by this Section.- Parameters:
sectionEid-- Returns:
- The set of members in this Section. This is not a transitive set.
- Throws:
IdNotFoundException- If the eid is not associated with any Section
-
getEnrollmentSet
EnrollmentSet getEnrollmentSet(String enrollmentSetEid) throws IdNotFoundException
Gets an EnrollmentSet by its eid.- Parameters:
enrollmentSetEid-- Returns:
- The EnrollmentSet
- Throws:
IdNotFoundException- If the eid is not associated with any EnrollmentSet
-
isEnrollmentSetDefined
boolean isEnrollmentSetDefined(String eid)
Checks whether an EnrollmentSet exists.- Parameters:
eid- The enterprise id- Returns:
- Whether the object exists
-
getEnrollmentSets
Set<EnrollmentSet> getEnrollmentSets(String courseOfferingEid) throws IdNotFoundException
Gets the EnrollmentSets associated with a CourseOffering- Parameters:
courseOfferingEid-- Returns:
- The Set of EnrollmentSets
- Throws:
IdNotFoundException- If the eid is not associated with any CourseOffering
-
getEnrollments
Set<Enrollment> getEnrollments(String enrollmentSetEid) throws IdNotFoundException
Gets the Enrollments in an EnrollmentSet (including dropped enrollments)- Parameters:
enrollmentSetEid-- Returns:
- The Set of Enrollments
- Throws:
IdNotFoundException- If the eid is not associated with any EnrollmentSet
-
getEnrollmentStatusDescription
String getEnrollmentStatusDescription(String statusId)
Gets the known enrollment status code for the id- Returns:
- the status description as an Optional
-
getEnrollmentStatusDescriptions
Map<String,String> getEnrollmentStatusDescriptions(Locale locale)
Gets the known enrollment status codes and descriptions for Enrollments.- Returns:
-
getGradingSchemeDescriptions
Map<String,String> getGradingSchemeDescriptions(Locale locale)
Gets the known grading scheme codes and descriptions for Enrollments.- Returns:
-
getMembershipStatusDescriptions
Map<String,String> getMembershipStatusDescriptions(Locale locale)
Gets the known membership status codes and descriptions for Memberships.- Returns:
-
getInstructorsOfRecordIds
Set<String> getInstructorsOfRecordIds(String enrollmentSetEid) throws IdNotFoundException
Gets the set of user ids that are, according to the enterprise, responsible for the EnrollmentSet. Responsibilities usually include submitting the final grades for students enrolled in the EnrollmentSet.- Parameters:
enrollmentSetEid-- Returns:
- The set of ids for users who are responsible for this EnrollmentSet
- Throws:
IdNotFoundException- If the eid is not associated with any EnrollmentSet
-
isEnrolled
boolean isEnrolled(String userEid, Set<String> enrollmentSetEids)
Determines whether a user is enrolled (and not dropped) in an EnrollmentSet. This method is needed to implement Sakai's GroupProvider.- Parameters:
userEid- The student's userEidenrollmentSetEids- The set of EnrollmentSetEids- Returns:
-
isEnrolled
boolean isEnrolled(String userEid, String enrollmentSetEid)
Convenience method for checking whether a user is enrolled (and not dropped) in an EnrollmentSet.- Parameters:
userEid-enrollmentSetEid-- Returns:
-
findEnrollment
Enrollment findEnrollment(String userEid, String enrollmentSetEid)
Finds the Enrollment for a user in an EnrollmentSet. If the user isn't in the EnrollmentSet, or the EnrollmentSet doesn't exist, this returns null. Note that this method will return enrollments flagged as "dropped". TODO Should this throw more descriptive exceptions e.g. when the EnrollmentSet doesn't exist?- Parameters:
userEid-enrollmentSetEid-- Returns:
-
findCurrentlyEnrolledEnrollmentSets
Set<EnrollmentSet> findCurrentlyEnrolledEnrollmentSets(String userEid)
Finds the set of current EnrollmentSets for which a user is enrolled but not dropped. An EnrollmentSet is considered current if its CourseOffering's start date (is null or prior to the current date/time) and its end date (is null or after the current date/time).- Parameters:
userEid-- Returns:
-
findCurrentlyInstructingEnrollmentSets
Set<EnrollmentSet> findCurrentlyInstructingEnrollmentSets(String userEid)
Finds the set of current EnrollmentSets for which a user is an instructor of record. An EnrollmentSet is considered current if its CourseOffering's start date (is null or prior to the current date/time) and its end date (is null or after the current date/time).- Parameters:
userEid-- Returns:
-
findInstructingSections
Set<Section> findInstructingSections(String userEid)
Finds all Sections that are linked to an EnrollmentSet for which a user is an instructor of record.- Parameters:
userEid-- Returns:
-
findEnrolledSections
Set<Section> findEnrolledSections(String userEid)
Finds all Sections that are linked to an EnrollmentSet for which a user is enrolled (but not dropped).- Parameters:
userEid-- Returns:
-
findInstructingSections
Set<Section> findInstructingSections(String userEid, String academicSessionEid) throws IdNotFoundException
Finds all Sections that are linked to an EnrollmentSet for which a user is an instructor of record and which are part of a CourseOffering in a given AcademicSession.- Parameters:
userEid-academicSessionEid-- Returns:
- Throws:
IdNotFoundException
-
findSectionRoles
Map<String,String> findSectionRoles(String userEid)
Finds the Sections (and roles) for which a user is a member.- Parameters:
userEid-- Returns:
- A Map of Section EIDs to roles for the user
-
findSectionRoles
Map<String,String> findSectionRoles(String userEid, String academicSessionEid)
Finds the Sections (and roles) for which a user is a member and which are part of a CourseOffering in a given AcademicSession.- Parameters:
userEid-academicSessionEid-- Returns:
- A Map of Section EIDs to roles for the user
-
findCourseOfferingRoles
Map<String,String> findCourseOfferingRoles(String userEid)
Finds the CourseOfferings (and roles) for which a user is a member.- Parameters:
userEid-- Returns:
- A Map of CourseOffering EIDs to roles for the user
-
findCourseSetRoles
Map<String,String> findCourseSetRoles(String userEid)
Finds the CourseSets (and roles) for which a user is a member.- Parameters:
userEid-- Returns:
- A Map of CourseSet EIDs to roles for the user
-
findActiveCourseOfferingsInCanonicalCourse
List<CourseOffering> findActiveCourseOfferingsInCanonicalCourse(String eid)
Find the currently offered course offerings in the cannonical course- Parameters:
eid-- Returns:
-
-