OSID Logo
OSID Specifications
commenting package
Version 3.1.0
Interfaceosid.commenting.CommentAdminSession
Implementsosid.OsidSession
Implemented Byosid.commenting.batch.CommentBatchAdminSession
Used Byosid.commenting.CommentingManager
osid.commenting.CommentingProxyManager
Description

This session creates, updates, and deletes Comments. The data for create and update is provided by the consumer via the form object. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Comment, a CommentForm is requested using getCommentFormForCreate() specifying the desired relationship peers and record Types or none if no record Types are needed. The returned CommentForm will indicate that it is to be used with a create operation and can be used to examine metdata or validate data prior to creation. Once the CommentForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each CommentForm corresponds to an attempted transaction.

For updates, CommentForms are requested to the Comment Id that is to be updated using getCommentFormForUpdate(). Similarly, the CommentForm has metadata about the data that can be updated and it can perform validation before submitting the update. The CommentForm can only be used once for a successful update and cannot be reused.

The delete operations delete Comments. To unmap a Comment from the current Book, the CommentBookAssignmentSession should be used. These delete operations attempt to remove the Comment itself thus removing it from all known Book catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodgetBookId
Description

Gets the Book Id associated with this session.

Returnosid.id.Id the Book Id associated with this session
Compliancemandatory This method must be implemented.
MethodgetBook
Description

Gets the Book associated with this session.

Returnosid.commenting.Book the book
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanCreateComments
Description

Tests if this user can create comments. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Comment will result in a PERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.

Returnboolean false if Comment creation is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodcanCreateCommentWithRecordTypes
Description

Tests if this user can create a single Comment using the desired record types. While CommentingManager.getCommentRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Comment. Providing an empty array tests if a Comment can be created with no records.

Parametersosid.type.Type[]commentRecordTypes array of comment record types
Returnboolean true if Comment creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT commentRecordTypes is null
Compliancemandatory This method must be implemented.
MethodgetCommentFormForCreate
Description

Gets the comment form for creating new comments. A new form should be requested for each create transaction.

Parametersosid.id.IdreferenceId the Id for the reference object
osid.type.Type[]commentRecordTypes array of comment record types
Returnosid.commenting.CommentForm the comment form
ErrorsNULL_ARGUMENT referenceId or commentRecordTypes is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED unable to get form for requested record types
Compliancemandatory This method must be implemented.
MethodcreateComment
Description

Creates a new Comment.

Parametersosid.commenting.CommentFormcommentForm the form for this Comment
Returnosid.commenting.Comment the new Comment
ErrorsILLEGAL_STATE commentForm already used in a create transaction
INVALID_ARGUMENT one or more of the form elements is invalid
NULL_ARGUMENT commentForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED commentForm did not originate from getCommentFormForCreate()
Compliancemandatory This method must be implemented.
MethodcanUpdateComments
Description

Tests if this user can update comments. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Comment will result in a PERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.

Returnboolean false if Comment modification is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodgetCommentFormForUpdate
Description

Gets the comment form for updating an existing comment. A new comment form should be requested for each update transaction.

Parametersosid.id.IdcommentId the Id of the Comment
Returnosid.commenting.CommentForm the comment form
ErrorsNOT_FOUND commentId is not found
NULL_ARGUMENT commentId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdateComment
Description

Updates an existing comment.

Parametersosid.commenting.CommentFormcommentForm the form containing the elements to be updated
ErrorsILLEGAL_STATE commentForm already used in an update transaction
INVALID_ARGUMENT the form contains an invalid value
NULL_ARGUMENT commentForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED commentForm did not originate from getCommentFormForUpdate()
Compliancemandatory This method must be implemented.
MethodcanDeleteComments
Description

Tests if this user can delete comments. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Comment will result in a PERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.

Returnboolean false if Comment deletion is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethoddeleteComment
Description

Deletes a Comment.

Parametersosid.id.IdcommentId the Id of the Comment to remove
ErrorsNOT_FOUND commentId not found
NULL_ARGUMENT commentId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanManageCommentAliases
Description

Tests if this user can manage Id aliases for Comnents. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.

Returnboolean false if Comment aliasing is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodaliasComment
Description

Adds an Id to a Comment for the purpose of creating compatibility. The primary Id of the Comment is determined by the provider. The new Id performs as an alias to the primary Id. If the alias is a pointer to another comment, it is reassigned to the given comment Id.

Parametersosid.id.IdcommentId the Id of a Comment
osid.id.IdaliasId the alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND commentId not found
NULL_ARGUMENT commentId or aliasId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.