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 requestcompliance: 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 requestcompliance: 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
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
rating_id
¶ Gets the
Id
of theGrade
.Returns: the Agent
Id
Return type: osid.id.Id
Raise: IllegalState
–has_rating()
isfalse
compliance: mandatory – This method must be implemented.
-
rating
¶ Gets the
Grade
.Returns: the Grade
Return type: osid.grading.Grade
Raise: IllegalState
–has_rating()
isfalse
Raise: OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.
-
get_comment_record
(comment_record_type)¶ Gets the comment record corresponding to the given
Comment
recordType
.This method is used to retrieve an object implementing the requested record. The
comment_record_type
may be theType
returned inget_record_types()
or any of its parents in aType
hierarchy wherehas_record_type(comment_record_type)
istrue
.Parameters: comment_record_type ( osid.type.Type
) – the type of comment record to retrieveReturns: the comment record Return type: osid.commenting.records.CommentRecord
Raise: NullArgument
–comment_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(comment_record_type)
isfalse
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 theCommentAdminSession
. 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 recordType
.Parameters: comment_record_type ( osid.type.Type
) – the comment record typeReturns: the comment form record Return type: osid.commenting.records.CommentFormRecord
Raise: NullArgument
–comment_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(comment_record_type)
isfalse
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 accessingComment
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. Thehas_next()
method should be used to test that a nextComment
is available before calling this method.Return type: osid.commenting.Comment
Raise: IllegalState
– no more elements available in this listRaise: OperationFailed
– unable to complete requestcompliance: 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 ofComment
elements requested which must be less than or equal toavailable()
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 listRaise: OperationFailed
– unable to complete requestcompliance: 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
recordType
.This method is used to retrieve an object implementing the requested record. The
book_record_type
may be theType
returned inget_record_types()
or any of its parents in aType
hierarchy wherehas_record_type(book_record_type)
istrue
.Parameters: book_record_type ( osid.type.Type
) – the type of book record to retrieveReturns: the book record Return type: osid.commenting.records.BookRecord
Raise: NullArgument
–book_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(book_record_type)
isfalse
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 theBookAdminSession
. 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 recordType
.Parameters: book_record_type ( osid.type.Type
) – the book record typeReturns: the book form record Return type: osid.commenting.records.BookFormRecord
Raise: NullArgument
–book_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(book_record_type)
isfalse
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 accessingBook
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. Thehas_next()
method should be used to test that a nextBook
is available before calling this method.Return type: osid.commenting.Book
Raise: IllegalState
– no more elements available in this listRaise: OperationFailed
– unable to complete requestcompliance: 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 ofBook
elements requested which must be less than or equal toavailable()
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 listRaise: OperationFailed
– unable to complete requestcompliance: 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 accessingBookNode
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. Thehas_next()
method should be used to test that a nextBookNode
is available before calling this method.Return type: osid.commenting.BookNode
Raise: IllegalState
– no more elements available in this listRaise: OperationFailed
– unable to complete requestcompliance: 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 ofBookNode
elements requested which must be less than or equal toavailable()
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 listRaise: OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.