OSID Logo
OSID Specifications
commenting package
Version 3.0.0
Release Candidate Preview
Interfaceosid.commenting.CommentBookAssignmentSession
Implementsosid.OsidSession
Description

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 ).

MethodcanAssignComments
Description

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.

Returnboolean false if mapping is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanAssignCommentsToBook
Description

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.

Parametersosid.id.IdbookIdthe Id of the Book
Returnboolean false if mapping is not authorized, true otherwise
ErrorsNULL_ARGUMENT bookId is null
CompliancemandatoryThis method must be implemented.
MethodgetAssignableBookIds
Description

Gets a list of books including and under the given book node in which any comment can be assigned.

Parametersosid.id.IdbookIdthe Id of the Book
Returnosid.id.IdListlist of assignable book Ids
ErrorsNULL_ARGUMENT bookId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodgetAssignableBookIdsForComment
Description

Gets a list of books including and under the given book node in which a specific comment can be assigned.

Parametersosid.id.IdbookIdthe Id of the Book
osid.id.IdcommentIdthe Id of the Comment
Returnosid.id.IdListlist of assignable book Ids
ErrorsNULL_ARGUMENT bookId or commentId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodassignCommentToBook
Description

Adds an existing Comment to a Book.

Parametersosid.id.IdcommentIdthe Id of the Comment
osid.id.IdbookIdthe Id of the Book
ErrorsALREADY_EXISTS commentId is already assigned to bookId
NOT_FOUND commentId or bookId not found
NULL_ARGUMENT commentId or bookId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodunassignCommentFromBook
Description

Removes a Comment from a Book.

Parametersosid.id.IdcommentIdthe Id of the Comment
osid.id.IdbookIdthe Id of the Book
ErrorsNOT_FOUND commentId or bookId not found or commentId not assigned to bookId
NULL_ARGUMENT commentId or bookId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodreassignCommentToBook
Description

Moves a Credit from one Book to another. Mappings to other Books are unaffected.

Parametersosid.id.IdcommentIdthe Id of the Comment
osid.id.IdfromBookIdthe Id of the current Book
osid.id.IdtoBookIdthe Id of the destination Book
ErrorsNOT_FOUND commentId, fromBookId, or toBookId not found or comment not mapped to fromBookId
NULL_ARGUMENT commentId, bookIdId, or toBookId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.