public interface RatingLookupSession extends OsidSession
This session defines methods for retrieving comments.
This lookup session defines several views:
CommentAdminSession.
The methods useFederatedBookView()
and
useIsolatedBookView()
behave as a radio group and one should be
selected before invoking any lookup methods.
Modifier and Type | Method and Description |
---|---|
boolean |
canLookupRatings()
Tests if this user can examine this book.
|
Book |
getBook()
Gets the
Book associated with this session. |
Id |
getBookId()
Gets the
Book Id associated with this
session. |
Grade |
getCumulativeRating()
Gets the cumulative rating for all the references in this book.
|
Grade |
getCumulativeRatingForCommentor(Id resourceId)
Gets the cumulative rating for a commentor.
|
Grade |
getCumulativeRatingForReference(Id referenceId)
Gets the cumulative rating for a reference.
|
Grade |
getReferences(Id gradeId)
Gets the references with ratings equal to or higher than the given
grade.
|
IdList |
getTopReferences(long max)
Gets the top rated references in this book.
|
void |
useComparativeCommentView()
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 |
useFederatedBookView()
Federates the view for methods in this session.
|
void |
useIsolatedBookView()
Isolates the view for methods in this session.
|
void |
usePlenaryCommentView()
A complete view of the
Comment returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getBookId()
Book
Id
associated with this
session. Book Id
associated with this sessionmandatory
- This method must be implemented. Book getBook() throws OperationFailedException, PermissionDeniedException
Book
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canLookupRatings()
PERMISSION_DENIED.
This is intended as a hint to an
application that may opt not to offer these operations. false
if book reading methods are not
authorized, true
otherwisemandatory
- This method must be implemented. void useComparativeCommentView()
mandatory
- This method is must be implemented. void usePlenaryCommentView()
Comment
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 useFederatedBookView()
mandatory
- This method is must be implemented. void useIsolatedBookView()
mandatory
- This method is must be implemented. Grade getCumulativeRating() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. Grade getCumulativeRatingForReference(Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
referenceId
- the Id
of the referenceNotFoundException
- no reference found with the given
Id
NullArgumentException
- referenceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. Grade getCumulativeRatingForCommentor(Id resourceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
resourceId
- the Id
of the resourceNotFoundException
- no resource found with the given
Id
NullArgumentException
- resourceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. IdList getTopReferences(long max) throws OperationFailedException, PermissionDeniedException
max
- the maximum number to returnOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. Grade getReferences(Id gradeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
gradeId
- the Id
of the gradeNotFoundException
- no reference found with the given
Id
NullArgumentException
- referenceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.