Interface CommentLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for retrieving comments.
This lookup session defines several views:
- comparative view: elements may be silently omitted or re-ordered
- plenary view: provides a complete result set or is an error condition
- isolated book view: All comment methods in this session operate,
retrieve and pertain to comments defined explicitly in the current
book. Using an isolated view is useful for managing comments with the
CommentAdminSession. - federated book view: All comment lookup methods in this session operate, retrieve and pertain to all comments defined in this book and any other books implicitly available in this book through book inheritence.
- effective comment view: All comment lookup methods return comments where the current dates falls in between the effective dates inclusive.
- any effective comment view: Comments of any effective date are returned.
The methods useFederatedBookView() and
useIsolatedBookView() behave as a radio group and one should be selected
before invoking any lookup methods.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can examine this book.getBook()Gets theBookassociated with this session.Gets theBookIdassociated with this session.getComment(Id commentId) Gets theCommentspecified by itsId.Gets all comments.getCommentsByGenusType(Type commentGenusType) Gets aCommentListcorresponding to the given comment genusTypewhich does not include comments of genus types derived from the specifiedType.getCommentsByGenusTypeForCommentor(Id resourceId, Type commentGenusType) Gets a list of comments of the given genus type corresponding to a resourceId.getCommentsByGenusTypeForCommentorAndReference(Id resourceId, Id referenceId, Type commentGenusType) Gets a list of comments of the given genus type corresponding to a resource and referenceId.getCommentsByGenusTypeForCommentorAndReferenceOnDate(Id resourceId, Id referenceId, Type commentGenusType, DateTime from, DateTime to) Gets a list of all comments corresponding to a resource and referenceIdand effective during the entire given date range inclusive but not confined to the date range.getCommentsByGenusTypeForCommentorOnDate(Id resourceId, Type commentGenusType, DateTime from, DateTime to) Gets a list of all comments of the given genus type corresponding to a resourceIdand effective during the entire given date range inclusive but not confined to the date range.getCommentsByGenusTypeForReference(Id referenceId, Type commentGenusType) Gets a list of comments of the given genus type corresponding to a referenceId.getCommentsByGenusTypeForReferenceOnDate(Id referenceId, Type commentGenusType, DateTime from, DateTime to) Gets a list of all comments of the given genus type corresponding to a referenceIdand effective during the entire given date range inclusive but not confined to the date range.getCommentsByGenusTypeOnDate(Type commentGenusType, DateTime from, DateTime to) Gets aCommentListof a given genus type and effective during the entire given date range inclusive but not confined to the date range.getCommentsByIds(IdList commentIds) Gets aCommentListcorresponding to the givenIdList.getCommentsByParentGenusType(Type commentGenusType) Gets aCommentListcorresponding to the given comment genusTypeand include any additional comments with genus types derived from the specifiedType.getCommentsByRecordType(Type commentRecordType) Gets aCommentListcontaining the given comment recordType.getCommentsForCommentor(Id resourceId) Gets a list of comments corresponding to a resourceId.getCommentsForCommentorAndReference(Id resourceId, Id referenceId) Gets a list of comments corresponding to a resource and referenceId.getCommentsForCommentorAndReferenceOnDate(Id resourceId, Id referenceId, DateTime from, DateTime to) Gets a list of all comments corresponding to a resource and referenceIdand effective during the entire given date range inclusive but not confined to the date range.getCommentsForCommentorOnDate(Id resourceId, DateTime from, DateTime to) Gets a list of all comments corresponding to a resourceIdand effective during the entire given date range inclusive but not confined to the date range.getCommentsForReference(Id referenceId) Gets a list of comments corresponding to a referenceId.getCommentsForReferenceOnDate(Id referenceId, DateTime from, DateTime to) Gets a list of all comments corresponding to a referenceIdand effective during the entire given date range inclusive but not confined to the date range.getCommentsOnDate(DateTime from, DateTime to) Gets aCommentListeffective during the entire given date range inclusive but not confined to the date range.voidAll comments of any effective dates are returned by all methods in this session.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidOnly comments whose effective dates are current are returned by methods in this session.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of theCommentreturns is desired.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getBookId
Id getBookId()Gets theBookIdassociated with this session.- Returns:
- the
Book Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBook
Gets theBookassociated with this session.- Returns:
- the book
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupComments
boolean canLookupComments()Tests if this user can examine this book. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer these operations.- Returns:
falseif book reading methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeCommentView
void useComparativeCommentView()The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.- Compliance:
mandatory- This method is must be implemented.
-
usePlenaryCommentView
void usePlenaryCommentView()A complete view of theCommentreturns is desired. Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.- Compliance:
mandatory- This method is must be implemented.
-
useFederatedBookView
void useFederatedBookView()Federates the view for methods in this session. A federated view will include comments in books which are children of this book in the book hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedBookView
void useIsolatedBookView()Isolates the view for methods in this session. An isolated view restricts retrievals to this book only.- Compliance:
mandatory- This method is must be implemented.
-
useEffectiveCommentView
void useEffectiveCommentView()Only comments whose effective dates are current are returned by methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
useAnyEffectiveCommentView
void useAnyEffectiveCommentView()All comments of any effective dates are returned by all methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
getComment
Comment getComment(Id commentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theCommentspecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedCommentmay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aCommentand retained for compatibility. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
commentId- theIdof theCommentto retrieve- Returns:
- the returned
Comment - Throws:
NotFoundException- noCommentfound with the givenIdNullArgumentException-commentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsByIds
CommentList getCommentsByIds(IdList commentIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aCommentListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the comments specified in theIdlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessible comments may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
commentIds- the list ofIdsto retrieve- Returns:
- the returned
Comment list - Throws:
NotFoundException- anId wasnot foundNullArgumentException-commentIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsByGenusType
CommentList getCommentsByGenusType(Type commentGenusType) throws OperationFailedException, PermissionDeniedException Gets aCommentListcorresponding to the given comment genusTypewhich does not include comments of genus types derived from the specifiedType. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
commentGenusType- a comment genus type- Returns:
- the returned
Commentlist - Throws:
NullArgumentException-commentGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsByParentGenusType
CommentList getCommentsByParentGenusType(Type commentGenusType) throws OperationFailedException, PermissionDeniedException Gets aCommentListcorresponding to the given comment genusTypeand include any additional comments with genus types derived from the specifiedType. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
commentGenusType- a comment genus type- Returns:
- the returned
Commentlist - Throws:
NullArgumentException-commentGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsByRecordType
CommentList getCommentsByRecordType(Type commentRecordType) throws OperationFailedException, PermissionDeniedException Gets aCommentListcontaining the given comment recordType. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
commentRecordType- a comment record type- Returns:
- the returned
Commentlist - Throws:
NullArgumentException-commentRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsOnDate
CommentList getCommentsOnDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aCommentListeffective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
from- starting dateto- ending date- Returns:
- the returned
Commentlist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsByGenusTypeOnDate
CommentList getCommentsByGenusTypeOnDate(Type commentGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aCommentListof a given genus type and effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
commentGenusType- a comment genus typefrom- starting dateto- ending date- Returns:
- the returned
Commentlist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-commentGenusType, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsForCommentor
CommentList getCommentsForCommentor(Id resourceId) throws OperationFailedException, PermissionDeniedException Gets a list of comments corresponding to a resourceId. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
resourceId- theIdof the resource- Returns:
- the returned
CommentList - Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsForCommentorOnDate
CommentList getCommentsForCommentorOnDate(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of all comments corresponding to a resourceIdand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
resourceId- theIdof the resourcefrom- from dateto- to date- Returns:
- the returned
CommentList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-resourceId, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsByGenusTypeForCommentor
CommentList getCommentsByGenusTypeForCommentor(Id resourceId, Type commentGenusType) throws OperationFailedException, PermissionDeniedException Gets a list of comments of the given genus type corresponding to a resourceId. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
resourceId- theIdof the resourcecommentGenusType- the comment genus type- Returns:
- the returned
CommentList - Throws:
NullArgumentException-resourceIdorcommentGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsByGenusTypeForCommentorOnDate
CommentList getCommentsByGenusTypeForCommentorOnDate(Id resourceId, Type commentGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of all comments of the given genus type corresponding to a resourceIdand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
resourceId- theIdof the resourcecommentGenusType- the comment genus typefrom- from dateto- to date- Returns:
- the returned
CommentList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-resourceId, commentGenusType, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsForReference
CommentList getCommentsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException Gets a list of comments corresponding to a referenceId. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
referenceId- theIdof the reference- Returns:
- the returned
CommentList - Throws:
NullArgumentException-referenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsForReferenceOnDate
CommentList getCommentsForReferenceOnDate(Id referenceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of all comments corresponding to a referenceIdand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
referenceId- a referenceIdfrom- from dateto- to date- Returns:
- the returned
CommentList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-referenceId, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsByGenusTypeForReference
CommentList getCommentsByGenusTypeForReference(Id referenceId, Type commentGenusType) throws OperationFailedException, PermissionDeniedException Gets a list of comments of the given genus type corresponding to a referenceId. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
referenceId- theIdof the referencecommentGenusType- the comment genus type- Returns:
- the returned
CommentList - Throws:
NullArgumentException-referenceIdorcommentGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsByGenusTypeForReferenceOnDate
CommentList getCommentsByGenusTypeForReferenceOnDate(Id referenceId, Type commentGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of all comments of the given genus type corresponding to a referenceIdand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
referenceId- a referenceIdcommentGenusType- the comment genus typefrom- from dateto- to date- Returns:
- the returned
CommentList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-referenceId, commentGenusType, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsForCommentorAndReference
CommentList getCommentsForCommentorAndReference(Id resourceId, Id referenceId) throws OperationFailedException, PermissionDeniedException Gets a list of comments corresponding to a resource and referenceId. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
resourceId- theIdof the resourcereferenceId- theIdof the reference- Returns:
- the returned
CommentList - Throws:
NullArgumentException-resourceIdorreferenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsForCommentorAndReferenceOnDate
CommentList getCommentsForCommentorAndReferenceOnDate(Id resourceId, Id referenceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of all comments corresponding to a resource and referenceIdand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
resourceId- theIdof the resourcereferenceId- a referenceIdfrom- from dateto- to date- Returns:
- the returned
CommentList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-resourceId, referenceId, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsByGenusTypeForCommentorAndReference
CommentList getCommentsByGenusTypeForCommentorAndReference(Id resourceId, Id referenceId, Type commentGenusType) throws OperationFailedException, PermissionDeniedException Gets a list of comments of the given genus type corresponding to a resource and referenceId. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
resourceId- theIdof the resourcereferenceId- theIdof the referencecommentGenusType- the comment genus type- Returns:
- the returned
CommentList - Throws:
NullArgumentException-resourceId, referenceIdorcommentGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommentsByGenusTypeForCommentorAndReferenceOnDate
CommentList getCommentsByGenusTypeForCommentorAndReferenceOnDate(Id resourceId, Id referenceId, Type commentGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of all comments corresponding to a resource and referenceIdand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Parameters:
resourceId- theIdof the resourcereferenceId- a referenceIdcommentGenusType- the comment genus typefrom- from dateto- to date- Returns:
- the returned
CommentList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-resourceId, referenceId, commentGenusType, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getComments
Gets all comments. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.- Returns:
- a list of comments
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-