Interface RatingLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface RatingLookupSession extends OsidSession

This session defines methods for retrieving ratings.

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 book view: All comment methods in this session operate, retrieve and pertain to comments defined explicitly in the current book. Using an isolated view is useful for managing comments with the CommentAdminSession .
  • federated book view: All comment lookup methods in this session operate, retrieve and pertain to all comments defined in this book and any other books implicitly available in this book through book inheritence.

The methods useFederatedBookView() and useIsolatedBookView() behave as a radio group and one should be selected before invoking any lookup methods.

  • Method Details

    • getBookId

      Id getBookId()
      Gets the Book Id associated with this session.
      Returns:
      the Book Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getBook

      Gets the Book associated with this session.
      Returns:
      the book
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canLookupRatings

      boolean canLookupRatings()
      Tests if this user can examine this book. 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 these operations.
      Returns:
      false if book reading methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useComparativeCommentView

      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. This view is used when greater interoperability is desired at the expense of precision.
      Compliance:
      mandatory - This method is must be implemented.
    • usePlenaryCommentView

      void usePlenaryCommentView()
      A complete view of the 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.
      Compliance:
      mandatory - This method is must be implemented.
    • useFederatedBookView

      void useFederatedBookView()
      Federates the view for methods in this session. A federated view will include ratings in books which are children of this book in the book hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedBookView

      void useIsolatedBookView()
      Isolates the view for methods in this session. An isolated view restricts retrievals to this book only.
      Compliance:
      mandatory - This method is must be implemented.
    • getCumulativeRating

      Gets the cumulative rating for all the references in this book.
      Returns:
      the cumulative rating
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCumulativeRatingForReference

      Grade getCumulativeRatingForReference(Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the cumulative rating for a reference.
      Parameters:
      referenceId - the Id of the reference
      Returns:
      the cumulative rating
      Throws:
      NotFoundException - no reference found with the given Id
      NullArgumentException - referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCumulativeRatingForCommentor

      Grade getCumulativeRatingForCommentor(Id resourceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the cumulative rating for a commentor.
      Parameters:
      resourceId - the Id of the resource
      Returns:
      the cumulative rating
      Throws:
      NotFoundException - no resource found with the given Id
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getTopReferences

      IdList getTopReferences(long max) throws OperationFailedException, PermissionDeniedException
      Gets the top rated references in this book.
      Parameters:
      max - the maximum number to return
      Returns:
      the top references
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getReferences

      Gets the references with ratings equal to or higher than the given grade.
      Parameters:
      gradeId - the Id of the grade
      Returns:
      the cumulative rating
      Throws:
      NotFoundException - no reference found with the given Id
      NullArgumentException - referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.