public interface CommentBatchAdminSession extends CommentAdminSession
This session creates, updates, and deletes Comments
in
bulk. The data for create and update is provided by the consumer via the
form object. OsidForms
are requested for each create or
update and may not be reused.
Create and update operations differ in their usage. To create a
Comment,
a CommentForm
is requested using
getCommentFormsForCreate()
specifying the desired reference and
and record Types
or none if no record Types
are needed. Each of the returned CommentForms
will indicate
that it is to be used with a create operation and can be used to examine
metdata or validate data prior to creation. Once a CommentForm
is submiited to a create operation, it cannot be reused with
another create operation unless the first operation was unsuccessful. Each
CommentForm
corresponds to an attempted transaction.
The CommentForms
returned from
getCommentFormsForCreate()
may be linked to the originating
request through the peer Ids
of the CommentForm.
In the case where there may be duplicates, any CommentForm
of the same peer Ids
may be used for a create
operation.
Once a batch of CommentForms
are submitted for create,
a CreateResponse
is returned for each CommentForm,
although the ordering is not defined. Only errors that pertain to
the entire create operation are returned from createComments(),
errors specific to an individual CommentForm
are
indicated in the corresponding CreateResponse.
CreateResponses
may be linked to the originating
CommentForm
through the CommentForm
Id
.
For updates, CommentForms
are requested to the
Comment
Id
that is to be updated using
getCommentFormsForUpdate()
where the reference Id
in the CommentForm
may be used to link the request.
Similarly, the CommentForm
has metadata about the data that
can be updated and it can perform validation before submitting the update.
The CommentForm
can only be used once for a successful
update and cannot be reused.
Once a batch of CommentForms
are submitted for update,
an UpdateResponse
is returned for each CommentForm,
although the ordering is not defined. Only errors that pertain to
the entire update operation are returned from updateComments(),
errors specific to an individual CommentForm
are
indicated in the corresponding UpdateResponse.
UpdateResponses
may be linked to the originating
CommentForm
through the CommentForm
Id.
The delete operations delete Comments
in bulk. To unmap
a Comment
from the current Book,
the
CommentBookAssignmentSession
should be used. These delete
operations attempt to remove the Comment
itself thus
removing it from all known Book
catalogs. Bulk delete
operations return the results in DeleteResponses.
Modifier and Type | Method and Description |
---|---|
AliasResponseList |
aliasComments(AliasRequestList aliasRequests)
Adds an
Id to a Comment for the purpose
of creating compatibility. |
CreateResponseList |
createComments(CommentBatchFormList commentForms)
Creates a new set of
Comments. |
DeleteResponseList |
deleteAllComments()
Deletes all
Comments in this Book . |
DeleteResponseList |
deleteComments(IdList commentIds)
Deletes comments for the given
Ids. |
DeleteResponseList |
deleteCommentsForCommentor(Id commentorId)
Deletes comments for the given commentor.
|
DeleteResponseList |
deleteCommentsForReference(Id referenceId)
Deletes comments for the given reference.
|
DeleteResponseList |
deleteIneffectiveCommentsByDate(DateTime date)
Deletes comments expired before the given date.
|
CommentBatchFormList |
getCommentFormsForCreate(IdList referenceIds,
Type[] commentRecordTypes)
Gets the comment forms for creating a bunch of new comments.
|
CommentBatchFormList |
getCommentFormsForUpdate(IdList commentIds)
Gets the comment forms for updating an existing set of comments.
|
UpdateResponseList |
updateComments(CommentBatchFormList commentForms)
Updates existing comments.
|
aliasComment, canCreateComments, canCreateCommentWithRecordTypes, canDeleteComments, canManageCommentAliases, canUpdateComments, createComment, deleteComment, getBook, getBookId, getCommentFormForCreate, getCommentFormForUpdate, updateComment
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
CommentBatchFormList getCommentFormsForCreate(IdList referenceIds, Type[] commentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
referenceIds
- the reference Ids
commentRecordTypes
- array of comment record types to be
included in each create operation or an empty list if noneNotFoundException
- a referenceId
is not
foundNullArgumentException
- commentRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to request forms with
given record typesmandatory
- This method must be implemented. CreateResponseList createComments(CommentBatchFormList commentForms) throws OperationFailedException, PermissionDeniedException
Comments.
This method returns an
error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse
.commentForms
- the comment formsNullArgumentException
- commentForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CommentBatchFormList getCommentFormsForUpdate(IdList commentIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
commentIds
- the Ids
of the Comment
NotFoundException
- a commentId
is not
foundNullArgumentException
- commentIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. UpdateResponseList updateComments(CommentBatchFormList commentForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse
.commentForms
- the form containing the elements to be updatedNullArgumentException
- commentForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAllComments() throws OperationFailedException, PermissionDeniedException
Comments
in this Book
.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteComments(IdList commentIds) throws OperationFailedException, PermissionDeniedException
Ids.
commentIds
- the Ids
of the comments to deleteNullArgumentException
- commentIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteCommentsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException
referenceId
- the Id
of a referenceNullArgumentException
- referenceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteCommentsForCommentor(Id commentorId) throws OperationFailedException, PermissionDeniedException
commentorId
- the Id
of a commentorNullArgumentException
- commentorId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteIneffectiveCommentsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException
date
- a dateNullArgumentException
- date
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AliasResponseList aliasComments(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id
to a Comment
for the purpose
of creating compatibility. The primary Id
of the
Comment
is determined by the provider. The new Id
is an alias to the primary Id.
If the alias is
a pointer to another comment, it is reassigned to the given entry
Id.
aliasRequests
- the alias requestsNullArgumentException
- aliasRequests
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.