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
).
| Modifier and Type | Method and Description |
|---|---|
void |
assignCommentToBook(Id commentId,
Id bookId)
Adds an existing
Comment to a Book. |
boolean |
canAssignComments()
Tests if this user can alter comment/book mappings.
|
boolean |
canAssignCommentsToBook(Id bookId)
Tests if this user can alter comment/book mappings.
|
IdList |
getAssignableBookIds(Id bookId)
Gets a list of books including and under the given book node in which
any comment can be assigned.
|
IdList |
getAssignableBookIdsForComment(Id bookId,
Id commentId)
Gets a list of books including and under the given book node in which
a specific comment can be assigned.
|
void |
reassignCommentToBook(Id commentId,
Id fromBookId,
Id toBookId)
Moves a
Credit from one Book to another. |
void |
unassignCommentFromBook(Id commentId,
Id bookId)
Removes a
Comment from a Book. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canAssignComments()
PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer assignment operations to
unauthorized users. false if mapping is not authorized, true
otherwisemandatory - This method must be implemented. boolean canAssignCommentsToBook(Id bookId)
PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer assignment operations to
unauthorized users.bookId - the Id of the Book false if mapping is not authorized, true
otherwiseNullArgumentException - bookId is
null mandatory - This method must be implemented. IdList getAssignableBookIds(Id bookId) throws OperationFailedException
bookId - the Id of the Book Ids NullArgumentException - bookId is
null OperationFailedException - unable to complete requestmandatory - This method must be implemented. IdList getAssignableBookIdsForComment(Id bookId, Id commentId) throws OperationFailedException
bookId - the Id of the Book commentId - the Id of the Comment Ids NullArgumentException - bookId or
commentId is null OperationFailedException - unable to complete requestmandatory - This method must be implemented. void assignCommentToBook(Id commentId, Id bookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Comment to a Book. commentId - the Id of the Comment bookId - the Id of the Book AlreadyExistsException - commentId is
already assigned to bookId NotFoundException - commentId or
bookId not foundNullArgumentException - commentId or
bookId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void unassignCommentFromBook(Id commentId, Id bookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Comment from a Book. commentId - the Id of the Comment bookId - the Id of the Book NotFoundException - commentId or
bookId not found or commentId not
assigned to bookId NullArgumentException - commentId or
bookId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void reassignCommentToBook(Id commentId, Id fromBookId, Id toBookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Credit from one Book to another.
Mappings to other Books are unaffected.commentId - the Id of the Comment fromBookId - the Id of the current Book
toBookId - the Id of the destination Book
NotFoundException - commentId, fromBookId,
or toBookId not found or comment
not mapped to fromBookId NullArgumentException - commentId, bookIdId,
or toBookId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.