Objects

Comment

class dlkit.commenting.objects.Comment

Bases: dlkit.osid.objects.OsidRelationship

A Comment represents a comment and/or rating related to a reference object in a book.

reference_id

Gets the Id of the referenced object to which this comment pertains.

Returns:the reference Id
Return type:osid.id.Id
commentor_id

Gets the Id of the resource who created this comment.

Returns:the Resource Id
Return type:osid.id.Id
commentor

Gets the resource who created this comment.

Returns:the Resource
Return type:osid.resource.Resource
Raise:OperationFailed – unable to complete request
commenting_agent_id

Gets the Id of the agent who created this comment.

Returns:the Agent Id
Return type:osid.id.Id
commenting_agent

Gets the agent who created this comment.

Returns:the Agent
Return type:osid.authentication.Agent
Raise:OperationFailed – unable to complete request
text

Gets the comment text.

Returns:the comment text
Return type:osid.locale.DisplayText
has_rating()

Tests if this comment includes a rating.

Returns:true if this comment includes a rating, false otherwise
Return type:boolean
rating_id

Gets the Id of the Grade.

Returns:the Agent Id
Return type:osid.id.Id
Raise:IllegalStatehas_rating() is false
rating

Gets the Grade.

Returns:the Grade
Return type:osid.grading.Grade
Raise:IllegalStatehas_rating() is false
Raise:OperationFailed – unable to complete request
get_comment_record(comment_record_type)

Gets the comment record corresponding to the given Comment record Type.

This method is used to retrieve an object implementing the requested record. The comment_record_type may be the Type returned in get_record_types() or any of its parents in a Type hierarchy where has_record_type(comment_record_type) is true .

Parameters:comment_record_type (osid.type.Type) – the type of comment record to retrieve
Returns:the comment record
Return type:osid.commenting.records.CommentRecord
Raise:NullArgumentcomment_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(comment_record_type) is false

Comment Form

class dlkit.commenting.objects.CommentForm

Bases: dlkit.osid.objects.OsidRelationshipForm

This is the form for creating and updating Comment objects.

Like all OsidForm objects, various data elements may be set here for use in the create and update methods in the CommentAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.

text_metadata

Gets the metadata for the text.

Returns:metadata for the text
Return type:osid.Metadata
text

Sets the text.

Parameters:text (string) – the new text
Raise:InvalidArgumenttext is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumenttext is null
rating_metadata

Gets the metadata for a rating.

Returns:metadata for the rating
Return type:osid.Metadata
rating

Sets the rating.

Parameters:grade_id (osid.id.Id) – the new rating
Raise:InvalidArgumentgrade_id is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumentgrade_id is null
get_comment_form_record(comment_record_type)

Gets the CommentFormRecord corresponding to the given comment record Type.

Parameters:comment_record_type (osid.type.Type) – the comment record type
Returns:the comment form record
Return type:osid.commenting.records.CommentFormRecord
Raise:NullArgumentcomment_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(comment_record_type) is false

Comment List

class dlkit.commenting.objects.CommentList

Bases: dlkit.osid.objects.OsidList

Like all OsidLists, CommentList provides a means for accessing Comment elements sequentially either one at a time or many at a time.

Examples: while (cl.hasNext()) { Comment comment = cl.getNextComment(); }

or
while (cl.hasNext()) {
Comment[] comments = cl.getNextComments(cl.available());

}

next_comment

Gets the next Comment in this list.

Returns:the next Comment in this list. The has_next() method should be used to test that a next Comment is available before calling this method.
Return type:osid.commenting.Comment
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request
get_next_comments(n)

Gets the next set of Comment elements in this list.

The specified amount must be less than or equal to the return from available().

Parameters:n (cardinal) – the number of Comment elements requested which must be less than or equal to available()
Returns:an array of Comment elements.The length of the array is less than or equal to the number specified.
Return type:osid.commenting.Comment
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

Book Form

class dlkit.commenting.objects.BookForm

Bases: dlkit.osid.objects.OsidCatalogForm

This is the form for creating and updating Books.

Like all OsidForm objects, various data elements may be set here for use in the create and update methods in the BookAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.

get_book_form_record(book_record_type)

Gets the BookFormRecord corresponding to the given book record Type.

Parameters:book_record_type (osid.type.Type) – the book record type
Returns:the book form record
Return type:osid.commenting.records.BookFormRecord
Raise:NullArgumentbook_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(book_record_type) is false

Book List

class dlkit.commenting.objects.BookList

Bases: dlkit.osid.objects.OsidList

Like all OsidLists, BookList provides a means for accessing Book elements sequentially either one at a time or many at a time.

Examples: while (bl.hasNext()) { Book book = bl.getNextBook(); }

or
while (bl.hasNext()) {
Book[] books = bl.getNextBooks(bl.available());

}

next_book

Gets the next Book in this list.

Returns:the next Book in this list. The has_next() method should be used to test that a next Book is available before calling this method.
Return type:osid.commenting.Book
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request
get_next_books(n)

Gets the next set of Book elements in this list.

The specified amount must be less than or equal to the return from available().

Parameters:n (cardinal) – the number of Book elements requested which must be less than or equal to available()
Returns:an array of Book elements.The length of the array is less than or equal to the number specified.
Return type:osid.commenting.Book
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request