public interface TermLookupSession extends OsidSession
This session provides methods for retrieving Term
objects. The Term
represents a time period in which courses
are offered.
This session defines views that offer differing behaviors when retrieving multiple objects.
Terms
with the TermAdminSession.
Generally, the comparative view should be used for most applications
as it permits operation even if there is data that cannot be accessed. The
methods useFederatedCourseCatalogView()
and
useIsolatedCourseCatalogView()
behave as a radio group and one
should be selected before invoking any lookup methods.
Modifier and Type | Method and Description |
---|---|
boolean |
canLookupTerms()
Tests if this user can perform
Term lookups. |
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
Term |
getTerm(Id termId)
Gets the
Term specified by its Id. |
TermList |
getTerms()
Gets all
Terms. |
TermList |
getTermsByClassesDate(DateTime datetime)
Gets a
TermList where to the given DateTime
falls within the classes date range inclusive. |
TermList |
getTermsByGenusType(Type termGenusType)
Gets a
TermList corresponding to the given term genus
Type which does not include terms of genus types
derived from the specified Type. |
TermList |
getTermsByIds(IdList termIds)
Gets a
TermList corresponding to the given
IdList. |
TermList |
getTermsByParentGenusType(Type termGenusType)
Gets a
TermList corresponding to the given term genus
Type and include any additional terms with genus types
derived from the specified Type. |
TermList |
getTermsByRecordType(Type termRecordType)
Gets a
TermList containing the given term record
Type. |
void |
useComparativeTermView()
The returns from the lookup methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
useFederatedCourseCatalogView()
Federates the view for methods in this session.
|
void |
useIsolatedCourseCatalogView()
Isolates the view for methods in this session.
|
void |
usePlenaryTermView()
A complete view of the
Term returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getCourseCatalogId()
CourseCatalog
Id
associated
with this session. CourseCatalog Id
associated with this
sessionmandatory
- This method must be implemented. CourseCatalog getCourseCatalog() throws OperationFailedException, PermissionDeniedException
CourseCatalog
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canLookupTerms()
Term
lookups. 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
a PERMISSION_DENIED.
This is intended as a hint to an
application that may opt not to offer lookup operations to
unauthorized users. false
if lookup methods are not authorized,
true
otherwisemandatory
- This method must be implemented. void useComparativeTermView()
mandatory
- This method is must be implemented. void usePlenaryTermView()
Term
returns 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.mandatory
- This method is must be implemented. void useFederatedCourseCatalogView()
mandatory
- This method is must be implemented. void useIsolatedCourseCatalogView()
mandatory
- This method is must be implemented. Term getTerm(Id termId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Term
specified by its Id.
In
plenary mode, the exact Id
is found or a
NOT_FOUND
results. Otherwise, the returned Term
may have a different Id
than requested, such as the
case where a duplicate Id
was assigned to a Term
and retained for compatibility.termId
- Id
of the Term
NotFoundException
- termId
not foundNullArgumentException
- termId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. TermList getTermsByIds(IdList termIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
TermList
corresponding to the given
IdList.
In plenary mode, the returned list contains all of the
terms specified in the Id
list, in the order of the
list, including duplicates, or an error results if an Id
in the supplied list is not found or inaccessible. Otherwise,
inaccessible Terms
may be omitted from the list and may
present the elements in any order including returning a unique set.termIds
- the list of Ids
to retrieve Term
listNotFoundException
- an Id was
not foundNullArgumentException
- termIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. TermList getTermsByGenusType(Type termGenusType) throws OperationFailedException, PermissionDeniedException
TermList
corresponding to the given term genus
Type
which does not include terms of genus types
derived from the specified Type.
In plenary mode, the
returned list contains all known terms or an error results. Otherwise,
the returned list may contain only those terms that are accessible
through this session.termGenusType
- a term genus type Term
listNullArgumentException
- termGenusType
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. TermList getTermsByParentGenusType(Type termGenusType) throws OperationFailedException, PermissionDeniedException
TermList
corresponding to the given term genus
Type
and include any additional terms with genus types
derived from the specified Type.
In plenary mode, the
returned list contains all known terms or an error results. Otherwise,
the returned list may contain only those terms that are accessible
through this session.termGenusType
- a term genus type Term
listNullArgumentException
- termGenusType
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. TermList getTermsByRecordType(Type termRecordType) throws OperationFailedException, PermissionDeniedException
TermList
containing the given term record
Type.
In plenary mode, the returned list contains all known
terms or an error results. Otherwise, the returned list may contain
only those terms that are accessible through this session.termRecordType
- a term record type Term
listNullArgumentException
- termRecordType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. TermList getTermsByClassesDate(DateTime datetime) throws OperationFailedException, PermissionDeniedException
TermList
where to the given DateTime
falls within the classes date range inclusive. Terms
containing the given date are matched. In plenary mode, the returned
list contains all of the terms specified in the Id
list, in the order of the list, including duplicates, or an error
results if an Id
in the supplied list is not found or
inaccessible. Otherwise, inaccessible Terms
may be
omitted from the list including returning a unique set.datetime
- a date Term
listNullArgumentException
- datetime
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. TermList getTerms() throws OperationFailedException, PermissionDeniedException
Terms.
In plenary mode, the returned list
contains all known terms or an error results. Otherwise, the returned
list may contain only those terms that are accessible through this
session. Terms
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.