Interface PostEntryBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, PostEntryAdminSession
This session creates, updates, and deletes PostEntries 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
PostEntry , a PostEntryForm is requested using
getPostEntryFormsForCreate() specifying the desired post entry peers and
record Types or none if no record Types are needed. Each
of the returned PostEntryForms 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 PostEntryForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each PostEntryForm
corresponds to an attempted transaction.
The PostEntryForms returned from
getPostEntryFormsForCreate() may be linked to the originating request
through the peer Ids of the PostEntryForm . In the case
where there may be duplicates, any PostEntryForm of the same peer
Ids may be used for a create operation.
Once a batch of PostEntryForms are submitted for create, a
CreateResponse is returned for each PostEntryForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createPostEntries() ,
errors specific to an individual PostEntryForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating PostEntryForm through the
PostEntryForm Id .
For updates, PostEntryForms are requested to the
PostEntry Id that is to be updated using
getPostEntryFormsForUpdate() where the reference Id in the
PostEntryForm may be used to link the request. Similarly, the
PostEntryForm has metadata about the data that can be updated and it can
perform validation before submitting the update. The PostEntryForm
can only be used once for a successful update and cannot be reused.
Once a batch of PostEntryForms are submitted for update, an
UpdateResponse is returned for each PostEntryForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updatePostEntries() ,
errors specific to an individual PostEntryForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating PostEntryForm through the
PostEntryForm Id .
The delete operations delete PostEntries in bulk. To unmap a
PostEntry from the current Business , the
PostEntryBusinessAssignmentSession should be used. These delete
operations attempt to remove the PostEntry itself thus removing it
from all known Business catalogs. Bulk delete operations return
the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasPostEntries(AliasRequestList aliasRequests) Adds anIdto aPostEntryfor the purpose of creating compatibility.createPostEntries(PostEntryBatchFormList postEntryForms) Creates a new set ofPostEntries.Deletes allPostEntriesin thisBusiness.deletePostEntries(IdList postEntryIds) Deletes post entries for the givenIds.deletePostEntriesForPost(Id postId) Deletes post entries for the given post.getPostEntryFormsForCreate(IdList postIds, Type[] postRecordTypes) Gets the post entry forms for creating a bunch of new posts.getPostEntryFormsForUpdate(IdList postEntryIds) Gets the post entry forms for updating an existing set of posts.updatePostEntries(PostEntryBatchFormList postEntryForms) Updates existing posts.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 PostEntryAdminSession
aliasPostEntry, canCreatePostEntries, canCreatePostEntryWithRecordTypes, canDeletePostEntries, canManagePostEntryAliases, canUpdatePostEntries, createPostEntry, deletePostEntry, getBusiness, getBusinessId, getPostEntryFormForCreate, getPostEntryFormForUpdate, updatePostEntryModifier and TypeMethodDescriptionvoidaliasPostEntry(Id postEntryId, Id aliasId) Adds anIdto aPostEntryfor the purpose of creating compatibility.booleanTests if this user can createPostEntries.booleancanCreatePostEntryWithRecordTypes(Type[] postEntryRecordTypes) Tests if this user can create a singlePostEntryusing the desired record types.booleanTests if this user can deletePostEntries.booleanTests if this user can manageIdaliases forPostEntries.booleanTests if this user can updatePostEntries.createPostEntry(PostEntryForm entryForm) Creates a newPostEntry.voiddeletePostEntry(Id postEntryId) Deletes aPostEntry.Gets theBusinessassociated with this session.Gets theBusinessIdassociated with this session.getPostEntryFormForCreate(Id postId, Type[] postEntryRecordTypes) Gets the post entry form for creating new post entries.getPostEntryFormForUpdate(Id postEntryId) Gets the post entry form for updating an existing post entries.voidupdatePostEntry(PostEntryForm entryForm) Updates an existing post entries.
-
Method Details
-
getPostEntryFormsForCreate
PostEntryBatchFormList getPostEntryFormsForCreate(IdList postIds, Type[] postRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the post entry forms for creating a bunch of new posts. A form is returned for each supplied post.- Parameters:
postIds- a list of postIdspostRecordTypes- array of post entry record types to be included in each create operation or an empty list if none- Returns:
- the post entry forms
- Throws:
NotFoundException- apostIdis not foundNullArgumentException-peersorpostRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createPostEntries
CreateResponseList createPostEntries(PostEntryBatchFormList postEntryForms) throws NotFoundException, OperationFailedException, PermissionDeniedException Creates a new set ofPostEntries. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
postEntryForms- the post entry forms- Returns:
- the create responses
- Throws:
NotFoundException-postEntryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPostEntryFormsForUpdate
PostEntryBatchFormList getPostEntryFormsForUpdate(IdList postEntryIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the post entry forms for updating an existing set of posts. A new post entry form should be requested for each update transaction.- Parameters:
postEntryIds- theIdsof thePostEntry- Returns:
- the post entry form
- Throws:
NotFoundException- apostEntryIdis not foundNullArgumentException-postEntryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updatePostEntries
UpdateResponseList updatePostEntries(PostEntryBatchFormList postEntryForms) throws OperationFailedException, PermissionDeniedException Updates existing posts. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
postEntryForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-postEntryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllPostEntries
DeleteResponseList deleteAllPostEntries() throws OperationFailedException, PermissionDeniedExceptionDeletes allPostEntriesin thisBusiness.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deletePostEntries
DeleteResponseList deletePostEntries(IdList postEntryIds) throws OperationFailedException, PermissionDeniedException Deletes post entries for the givenIds.- Parameters:
postEntryIds- theIdsof the post entries to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-postEntryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deletePostEntriesForPost
DeleteResponseList deletePostEntriesForPost(Id postId) throws OperationFailedException, PermissionDeniedException Deletes post entries for the given post.- Parameters:
postId- theIdof a post- Returns:
- the delete responses
- Throws:
NullArgumentException-postIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasPostEntries
AliasResponseList aliasPostEntries(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aPostEntryfor the purpose of creating compatibility. The primaryIdof thePostEntryis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another post entry, it is reassigned to the given post entryId.- 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.
-