Interface CommentBookAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CommentBookAssignmentSession extends OsidSession

This session provides methods to re-assign Comments to Books . A Comment may map to multiple Books and removing the last reference to a Comment is the equivalent of deleting it. Each Book may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a Comment to another Book is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignComments

      boolean canAssignComments()
      Tests if this user can alter comment/book mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping 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 assignment operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignCommentsToBook

      boolean canAssignCommentsToBook(Id bookId)
      Tests if this user can alter comment/book mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping 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 assignment operations to unauthorized users.
      Parameters:
      bookId - the Id of the Book
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - bookId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBookIds

      IdList getAssignableBookIds(Id bookId) throws OperationFailedException
      Gets a list of books including and under the given book node in which any comment can be assigned.
      Parameters:
      bookId - the Id of the Book
      Returns:
      list of assignable book Ids
      Throws:
      NullArgumentException - bookId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBookIdsForComment

      IdList getAssignableBookIdsForComment(Id bookId, Id commentId) throws OperationFailedException
      Gets a list of books including and under the given book node in which a specific comment can be assigned.
      Parameters:
      bookId - the Id of the Book
      commentId - the Id of the Comment
      Returns:
      list of assignable book Ids
      Throws:
      NullArgumentException - bookId or commentId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignCommentToBook

      void assignCommentToBook(Id commentId, Id bookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Comment to a Book .
      Parameters:
      commentId - the Id of the Comment
      bookId - the Id of the Book
      Throws:
      AlreadyExistsException - commentId is already assigned to bookId
      NotFoundException - commentId or bookId not found
      NullArgumentException - commentId or bookId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignCommentFromBook

      void unassignCommentFromBook(Id commentId, Id bookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Comment from a Book .
      Parameters:
      commentId - the Id of the Comment
      bookId - the Id of the Book
      Throws:
      NotFoundException - commentId or bookId not found or commentId not assigned to bookId
      NullArgumentException - commentId or bookId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignCommentToBook

      void reassignCommentToBook(Id commentId, Id fromBookId, Id toBookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Credit from one Book to another. Mappings to other Books are unaffected.
      Parameters:
      commentId - the Id of the Comment
      fromBookId - the Id of the current Book
      toBookId - the Id of the destination Book
      Throws:
      AlreadyExistsException - commentId already assigned to toBookId
      NotFoundException - commentId, fromBookId , or toBookId not found or comment not mapped to fromBookId
      NullArgumentException - commentId, bookIdId , or toBookId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.