Interface CourseLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for retrieving courses. A Course
is a canonical course listed in a course catalog. A CourseOffering
is derived from a Course and maps to an offering time and
registered students.
This lookup session defines several views:
- comparative view: elements may be silently omitted or re-ordered
- plenary view: provides a complete result set or is an error condition
- isolated course catalog view: All course methods in this session
operate, retrieve and pertain to courses defined explicitly in the
current course catalog. Using an isolated view is useful for managing
Courseswith theCourseAdminSession. - federated course catalog view: All course lookup methods in this session operate, retrieve and pertain to all courses defined in this course catalog and any other courses implicitly available in this course catalog through course catalog inheritence.
- active course view: All course lookup methods return courses which are active.
- any active course view: Courses of any active or inactive status are returned from methods.
The methods useFederatedCourseCatalogView() and
useIsolatedCourseCatalogView() behave as a radio group and one should be
selected before invoking any lookup methods.
Courses may have an additional records indicated by their respective
record types. The record may not be accessed through a cast of the
Course .
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can performCourselookups.Gets theCoursespecified by itsId.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.Gets allCourses.getCoursesByConcurrentCourse(Id courseId) Gets aCourseListby the given concurrent course.getCoursesByGenusType(Type courseGenusType) Gets aCourseListcorresponding to the given course genusTypewhich does not include courses of types derived from the specifiedType.getCoursesByIds(IdList courseIds) Gets aCourseListcorresponding to the givenIdList.getCoursesByNumber(String number) Gets aCourseListby the given number.getCoursesByObjective(Id objectiveId) Gets aCourseListby the given learning objective.getCoursesByParentGenusType(Type courseGenusType) Gets aCourseListcorresponding to the given course genusTypeand include any additional courses with genus types derived from the specifiedType.getCoursesByRecordType(Type courseRecordType) Gets aCourseListcontaining the given course recordType.getCoursesBySponsor(Id sponsorId) Gets aCourseListby the given sponsor.voidOnly active courses are returned by methods in this session.voidAll courses of any active or inactive status are returned by methods in this session.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of theCoursereturns is desired.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getCourseCatalogId
Id getCourseCatalogId()Gets theCourseCatalogIdassociated with this session.- Returns:
- the
CourseCatalog Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCourseCatalog
Gets theCourseCatalogassociated with this session.- Returns:
- the course catalog
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupCourses
boolean canLookupCourses()Tests if this user can performCourselookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may not offer lookup operations to unauthorized users.- Returns:
falseif lookup methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeCourseView
void useComparativeCourseView()The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.- Compliance:
mandatory- This method is must be implemented.
-
usePlenaryCourseView
void usePlenaryCourseView()A complete view of theCoursereturns is desired. Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.- Compliance:
mandatory- This method is must be implemented.
-
useFederatedCourseCatalogView
void useFederatedCourseCatalogView()Federates the view for methods in this session. A federated view will include courses in catalogs which are children of this catalog in the course catalog hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedCourseCatalogView
void useIsolatedCourseCatalogView()Isolates the view for methods in this session. An isolated view restricts retrievals to this course catalog only.- Compliance:
mandatory- This method is must be implemented.
-
useActiveCourseView
void useActiveCourseView()Only active courses are returned by methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
useAnyStatusCourseView
void useAnyStatusCourseView()All courses of any active or inactive status are returned by methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
getCourse
Course getCourse(Id courseId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theCoursespecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedCoursemay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aCourseand retained for compatibility. In active mode, courses are returned that are currently active. In any status mode, active and inactive courses are returned.- Parameters:
courseId- theIdof theCourseto retrieve- Returns:
- the returned
Course - Throws:
NotFoundException- noCoursefound with the givenIdNullArgumentException-courseIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCoursesByIds
CourseList getCoursesByIds(IdList courseIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aCourseListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the courses specified in theIdlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessibleCoursesmay be omitted from the list and may present the elements in any order including returning a unique set. In active mode, courses are returned that are currently active. In any status mode, active and inactive courses are returned.- Parameters:
courseIds- the list ofIdsto retrieve- Returns:
- the returned
CourseListlist - Throws:
NotFoundException- anId wasnot foundNullArgumentException-courseIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCoursesByGenusType
CourseList getCoursesByGenusType(Type courseGenusType) throws OperationFailedException, PermissionDeniedException Gets aCourseListcorresponding to the given course genusTypewhich does not include courses of types derived from the specifiedType. In plenary mode, the returned list contains all known courses or an error results. Otherwise, the returned list may contain only those courses that are accessible through this session. In active mode, courses are returned that are currently active. In any status mode, active and inactive courses are returned.- Parameters:
courseGenusType- a course genus type- Returns:
- the returned
CourseListlist - Throws:
NullArgumentException-courseGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCoursesByParentGenusType
CourseList getCoursesByParentGenusType(Type courseGenusType) throws OperationFailedException, PermissionDeniedException Gets aCourseListcorresponding to the given course genusTypeand include any additional courses with genus types derived from the specifiedType. In plenary mode, the returned list contains all known courses or an error results. Otherwise, the returned list may contain only those courses that are accessible through this session. In active mode, courses are returned that are currently active. In any status mode, active and inactive courses are returned.- Parameters:
courseGenusType- a course genus type- Returns:
- the returned
CourseListlist - Throws:
NullArgumentException-courseGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCoursesByRecordType
CourseList getCoursesByRecordType(Type courseRecordType) throws OperationFailedException, PermissionDeniedException Gets aCourseListcontaining the given course recordType. In plenary mode, the returned list contains all known courses or an error results. Otherwise, the returned list may contain only those courses that are accessible through this session. In active mode, courses are returned that are currently active. In any status mode, active and inactive courses are returned.- Parameters:
courseRecordType- a course record type- Returns:
- the returned
CourseListlist - Throws:
NullArgumentException-courseRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCoursesByNumber
CourseList getCoursesByNumber(String number) throws OperationFailedException, PermissionDeniedException Gets aCourseListby the given number. In plenary mode, the returned list contains all known courses or an error results. Otherwise, the returned list may contain only those courses that are accessible through this session. In active mode, courses are returned that are currently active. In any status mode, active and inactive courses are returned.- Parameters:
number- a course number- Returns:
- the returned
CourseListlist - Throws:
NullArgumentException-numberisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCoursesBySponsor
CourseList getCoursesBySponsor(Id sponsorId) throws OperationFailedException, PermissionDeniedException Gets aCourseListby the given sponsor. In plenary mode, the returned list contains all known courses or an error results. Otherwise, the returned list may contain only those courses that are accessible through this session. In active mode, courses are returned that are currently active. In any status mode, active and inactive courses are returned.- Parameters:
sponsorId- a sponsorId- Returns:
- the returned
CourseListlist - Throws:
NullArgumentException-sponsorIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCoursesByObjective
CourseList getCoursesByObjective(Id objectiveId) throws OperationFailedException, PermissionDeniedException Gets aCourseListby the given learning objective. In plenary mode, the returned list contains all known courses or an error results. Otherwise, the returned list may contain only those courses that are accessible through this session. In active mode, courses are returned that are currently active. In any status mode, active and inactive courses are returned.- Parameters:
objectiveId- a learning objectiveId- Returns:
- the returned
CourseListlist - Throws:
NullArgumentException-objectiveIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCoursesByConcurrentCourse
CourseList getCoursesByConcurrentCourse(Id courseId) throws OperationFailedException, PermissionDeniedException Gets aCourseListby the given concurrent course. In plenary mode, the returned list contains all known courses or an error results. Otherwise, the returned list may contain only those courses that are accessible through this session. In active mode, courses are returned that are currently active. In any status mode, active and inactive courses are returned.- Parameters:
courseId- a courseId- Returns:
- the returned
CourseListlist - Throws:
NullArgumentException-courseIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCourses
Gets allCourses. In plenary mode, the returned list contains all known courses or an error results. Otherwise, the returned list may contain only those courses that are accessible through this session. In active mode, courses are returned that are currently active. In any status mode, active and inactive courses are returned.- Returns:
- a list of
Courses - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-