Objects¶
Comment¶
-
class
dlkit.commenting.objects.Comment¶ Bases:
dlkit.osid.objects.OsidRelationshipA
Commentrepresents a comment and/or rating related to a reference object in a book.-
reference_id¶ Gets the
Idof the referenced object to which this comment pertains.Returns: the reference IdReturn type: osid.id.Id
-
commentor_id¶ Gets the
Idof the resource who created this comment.Returns: the ResourceIdReturn type: osid.id.Id
-
commentor¶ Gets the resource who created this comment.
Returns: the ResourceReturn type: osid.resource.ResourceRaise: OperationFailed– unable to complete request
-
commenting_agent_id¶ Gets the
Idof the agent who created this comment.Returns: the AgentIdReturn type: osid.id.Id
-
commenting_agent¶ Gets the agent who created this comment.
Returns: the AgentReturn type: osid.authentication.AgentRaise: 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: trueif this comment includes a rating,falseotherwiseReturn type: boolean
-
rating_id¶ Gets the
Idof theGrade.Returns: the AgentIdReturn type: osid.id.IdRaise: IllegalState–has_rating()isfalse
-
rating¶ Gets the
Grade.Returns: the GradeReturn type: osid.grading.GradeRaise: IllegalState–has_rating()isfalseRaise: OperationFailed– unable to complete request
-
get_comment_record(comment_record_type)¶ Gets the comment record corresponding to the given
CommentrecordType.This method is used to retrieve an object implementing the requested record. The
comment_record_typemay be theTypereturned inget_record_types()or any of its parents in aTypehierarchy 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.CommentRecordRaise: NullArgument–comment_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: Unsupported–has_record_type(comment_record_type)isfalse
-
Comment Form¶
-
class
dlkit.commenting.objects.CommentForm¶ Bases:
dlkit.osid.objects.OsidRelationshipFormThis is the form for creating and updating
Commentobjects.Like all
OsidFormobjects, 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
-
text¶ Sets the text.
Parameters: text ( string) – the new textRaise: InvalidArgument–textis invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–textisnull
-
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 ratingRaise: InvalidArgument–grade_idis invalidRaise: NoAccess–Metadata.isReadOnly()istrueRaise: NullArgument–grade_idisnull
-
get_comment_form_record(comment_record_type)¶ Gets the
CommentFormRecordcorresponding 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.CommentFormRecordRaise: NullArgument–comment_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: Unsupported–has_record_type(comment_record_type)isfalse
-
Comment List¶
-
class
dlkit.commenting.objects.CommentList¶ Bases:
dlkit.osid.objects.OsidListLike all
OsidLists,CommentListprovides a means for accessingCommentelements 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
Commentin this list.Returns: the next Commentin this list. Thehas_next()method should be used to test that a nextCommentis available before calling this method.Return type: osid.commenting.CommentRaise: IllegalState– no more elements available in this listRaise: OperationFailed– unable to complete request
-
get_next_comments(n)¶ Gets the next set of
Commentelements in this list.The specified amount must be less than or equal to the return from
available().Parameters: n ( cardinal) – the number ofCommentelements requested which must be less than or equal toavailable()Returns: an array of Commentelements.The length of the array is less than or equal to the number specified.Return type: osid.commenting.CommentRaise: IllegalState– no more elements available in this listRaise: OperationFailed– unable to complete request
Book Form¶
-
class
dlkit.commenting.objects.BookForm¶ Bases:
dlkit.osid.objects.OsidCatalogFormThis is the form for creating and updating
Books.Like all
OsidFormobjects, 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
BookFormRecordcorresponding 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.BookFormRecordRaise: NullArgument–book_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: Unsupported–has_record_type(book_record_type)isfalse
-
Book List¶
-
class
dlkit.commenting.objects.BookList¶ Bases:
dlkit.osid.objects.OsidListLike all
OsidLists,BookListprovides a means for accessingBookelements 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
Bookin this list.Returns: the next Bookin this list. Thehas_next()method should be used to test that a nextBookis available before calling this method.Return type: osid.commenting.BookRaise: IllegalState– no more elements available in this listRaise: OperationFailed– unable to complete request
-
get_next_books(n)¶ Gets the next set of
Bookelements in this list.The specified amount must be less than or equal to the return from
available().Parameters: n ( cardinal) – the number ofBookelements requested which must be less than or equal toavailable()Returns: an array of Bookelements.The length of the array is less than or equal to the number specified.Return type: osid.commenting.BookRaise: IllegalState– no more elements available in this listRaise: OperationFailed– unable to complete request