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

compliance: mandatory – This method must be implemented.

commentor_id

Gets the Id of the resource who created this comment.

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

compliance: mandatory – This method must be implemented.

commentor

Gets the resource who created this comment.

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

compliance: mandatory – This method must be implemented.

commenting_agent_id

Gets the Id of the agent who created this comment.

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

compliance: mandatory – This method must be implemented.

commenting_agent

Gets the agent who created this comment.

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

compliance: mandatory – This method must be implemented.

text

Gets the comment text.

Returns:the comment text
Return type:osid.locale.DisplayText

compliance: mandatory – This method must be implemented.

has_rating()

Tests if this comment includes a rating.

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

compliance: mandatory – This method must be implemented.

rating_id

Gets the Id of the Grade.

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

compliance: mandatory – This method must be implemented.

rating

Gets the Grade.

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

compliance: mandatory – This method must be implemented.

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

compliance: mandatory – This method must be implemented.

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

compliance: mandatory – This method must be implemented.

text
rating_metadata

Gets the metadata for a rating.

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

compliance: mandatory – This method must be implemented.

rating
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

compliance: mandatory – This method must be implemented.

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

compliance: mandatory – This method must be implemented.

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

compliance: mandatory – This method must be implemented.

Book

class dlkit.commenting.objects.Book(abc_commenting_objects.Book, osid_objects.OsidCatalog)
:noindex:
get_book_record(book_record_type)

Gets the book record corresponding to the given Book record Type.

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

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

compliance: mandatory – This method must be implemented.

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

compliance: mandatory – This method must be implemented.

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

compliance: mandatory – This method must be implemented.

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

compliance: mandatory – This method must be implemented.

Book Node

class dlkit.commenting.objects.BookNode

Bases: dlkit.osid.objects.OsidNode

This interface is a container for a partial hierarchy retrieval.

The number of hierarchy levels traversable through this interface depend on the number of levels requested in the BookHierarchySession.

book

Gets the Book at this node.

Returns:the book represented by this node
Return type:osid.commenting.Book

compliance: mandatory – This method must be implemented.

parent_book_nodes

Gets the parents of this book.

Returns:the parents of this book
Return type:osid.commenting.BookNodeList

compliance: mandatory – This method must be implemented.

child_book_nodes

Gets the children of this book.

Returns:the children of this book
Return type:osid.commenting.BookNodeList

compliance: mandatory – This method must be implemented.

Book Node List

class dlkit.commenting.objects.BookNodeList

Bases: dlkit.osid.objects.OsidList

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

Examples: while (bnl.hasNext()) { BookNode node = bnl.getNextBookNode(); }

or
while (bnl.hasNext()) {
BookNode[] nodes = bnl.getNextBookNodes(bnl.available());

}

next_book_node

Gets the next BookNode in this list.

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

compliance: mandatory – This method must be implemented.

get_next_book_nodes(n)

Gets the next set of BookNode elements in this list.

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

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

compliance: mandatory – This method must be implemented.