Interface ReplyBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, ReplyAdminSession
This session creates, updates, and deletes Replies 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
Reply , a ReplyForm is requested using
getReplyFormsForCreate() specifying the desired post and record
Types or none if no record Types are needed. Each of the returned
ReplyForms 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 ReplyForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each ReplyForm corresponds to an attempted
transaction.
The ReplyForms returned from getReplyFormsForCreate()
may be linked to the originating request through the peer Ids of
the ReplyForm . In the case where there may be duplicates, any
ReplyForm of the same peer Ids may be used for a create
operation.
Once a batch of ReplyForms are submitted for create, a
CreateResponse is returned for each ReplyForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createReplies() , errors specific to
an individual ReplyForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
ReplyForm through the ReplyForm Id .
For updates, ReplyForms are requested to the Reply
Id that is to be updated using getReplyFormsForUpdate()
where the reference Id in the ReplyForm may be used to
link the request. Similarly, the ReplyForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The ReplyForm can only be used once for a successful
update and cannot be reused.
Once a batch of ReplyForms are submitted for update, an
UpdateResponse is returned for each ReplyForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateReplies() , errors specific to
an individual ReplyForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
ReplyForm through the ReplyForm Id .
The delete operations delete Replies in bulk. To unmap a
Reply from the current Forum , the
ReplyForumAssignmentSession should be used. These delete operations
attempt to remove the Reply itself thus removing it from all known
Forum catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasReplies(AliasRequestList aliasRequests) Adds anIdto aReplyfor the purpose of creating compatibility.createReplies(ReplyBatchFormList replyForms) Creates a new set ofReplies.Deletes allRepliesin thisForum.deleteChildReplies(Id replyId) Deletes replies under the given reply.deleteReplies(IdList replyIds) Deletes replies for the givenIds.deleteRepliesByPoster(Id resourceId) Deletes replies for the given poster.deleteRepliesForPost(Id postId) Deletes replies for the given post.getReplyFormsForCreate(IdList postIds, Type[] replyRecordTypes) Gets the reply forms for creating a bunch of new replies.getReplyFormsForUpdate(IdList replyIds) Gets the reply forms for updating an existing set of replies.updateReplies(ReplyBatchFormList replyForms) Updates existing replies.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.Methods inherited from interface ReplyAdminSession
aliasReply, canCreateReplies, canCreateReplyWithRecordTypes, canDeleteReplies, canManageReplyAliases, canUpdateReplies, createReply, deleteReply, getForum, getForumId, getReplyFormForCreateToPost, getReplyFormForCreateToReply, getReplyFormForUpdate, updateReplyModifier and TypeMethodDescriptionvoidaliasReply(Id replyId, Id aliasId) Adds anIdto aReplyfor the purpose of creating compatibility.booleanTests if this user can create hournal entries.booleancanCreateReplyWithRecordTypes(Type[] replyRecordTypes) Tests if this user can create a singleReplyusing the desired record types.booleanTests if this user can delete replies.booleanTests if this user can manageIdaliases forComnents.booleanTests if this user can update replies.createReply(ReplyForm replyForm) Creates a newReply.voiddeleteReply(Id replyId) Deletes anReply.getForum()Gets theForumassociated with this session.Gets theForumIdassociated with this session.getReplyFormForCreateToPost(Id postId, Type[] replyRecordTypes) Gets the reply form for creating new replies to a post.getReplyFormForCreateToReply(Id replyId, Type[] replyRecordTypes) Gets the reply form for creating new replies to another reply.getReplyFormForUpdate(Id replyId) Gets the reply form for updating an existing reply.voidupdateReply(ReplyForm replyForm) Updates an existing reply.
-
Method Details
-
getReplyFormsForCreate
ReplyBatchFormList getReplyFormsForCreate(IdList postIds, Type[] replyRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the reply forms for creating a bunch of new replies. A form is returned for each supplied post or reply.- Parameters:
postIds- the post or replyIdsreplyRecordTypes- array of reply record types to be included in each create operation or an empty list if none- Returns:
- the reply forms
- Throws:
NotFoundException- apostIdis not foundNullArgumentException-postIdsorreplyRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createReplies
CreateResponseList createReplies(ReplyBatchFormList replyForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofReplies. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
replyForms- the reply forms- Returns:
- the create responses
- Throws:
NullArgumentException-replyFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getReplyFormsForUpdate
ReplyBatchFormList getReplyFormsForUpdate(IdList replyIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the reply forms for updating an existing set of replies. A new reply form should be requested for each update transaction.- Parameters:
replyIds- theIdsof theReply- Returns:
- the reply form
- Throws:
NotFoundException- areplyIdis not foundNullArgumentException-replyIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateReplies
UpdateResponseList updateReplies(ReplyBatchFormList replyForms) throws OperationFailedException, PermissionDeniedException Updates existing replies. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
replyForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-replyFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllReplies
Deletes allRepliesin thisForum.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteReplies
DeleteResponseList deleteReplies(IdList replyIds) throws OperationFailedException, PermissionDeniedException Deletes replies for the givenIds.- Parameters:
replyIds- theIdsof the replies to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-replyIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRepliesForPost
DeleteResponseList deleteRepliesForPost(Id postId) throws OperationFailedException, PermissionDeniedException Deletes replies for the given post.- Parameters:
postId- anIdof a post- Returns:
- the delete responses
- Throws:
NullArgumentException-postIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRepliesByPoster
DeleteResponseList deleteRepliesByPoster(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes replies for the given poster.- Parameters:
resourceId- anIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteChildReplies
DeleteResponseList deleteChildReplies(Id replyId) throws OperationFailedException, PermissionDeniedException Deletes replies under the given reply.- Parameters:
replyId- anIdof a reply- Returns:
- the delete responses
- Throws:
NullArgumentException-replyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasReplies
AliasResponseList aliasReplies(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aReplyfor the purpose of creating compatibility. The primaryIdof theReplyis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another reply, it is reassigned to the given replyId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-