Interface BlogBatchAdminSession
- All Superinterfaces:
AutoCloseable, BlogAdminSession, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Blogs 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 an
Blog , an BlogForm is requested using
getBlogFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
BlogForms 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 an
BlogForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each BlogForm corresponds to an attempted transaction.
The BlogForms returned from getBlogFormsForCreate()
may be linked to the originating request through the peer Ids of
the BlogForm . In the case where there may be duplicates, any
BlogForm of the same peer Ids may be used for a create
operation.
Once a batch of BlogForms are submitted for create, a
CreateResponse is returned for each BlogForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createBlogs() , errors specific to an
individual BlogForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
BlogForm through the BlogForm Id .
For updates, BlogForms are requested to the Blog
Id that is to be updated using getBlogFormsForUpdate()
where the reference Id in the BlogForm may be used to link
the request. Similarly, the BlogForm has metadata about the data
that can be updated and it can perform validation before submitting the
update. The BlogForm can only be used once for a successful update
and cannot be reused.
Once a batch of BlogForms are submitted for update, an
UpdateResponse is returned for each BlogForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateBlogs() , errors specific to an
individual BlogForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
BlogForm through the BlogForm Id .
The delete operations delete Blogs in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasBlogs(AliasRequestList aliasRequests) Adds anIdto anBlogfor the purpose of creating compatibility.createBlogs(BlogBatchFormList blogForms) Creates a new set ofBlogs.Deletes allBlogs.deleteBlogs(IdList blogIds) Deletes blogs for the givenIds.getBlogFormsForCreate(long number, Type[] blogRecordTypes) Gets the blog forms for creating a bunch of new blogs.getBlogFormsForUpdate(IdList blogIds) Gets the blog forms for updating an existing set of blogs.updateBlogs(BlogBatchFormList blogForms) Updates existing blogs.Methods inherited from interface BlogAdminSession
aliasBlog, canCreateBlogs, canCreateBlogWithRecordTypes, canDeleteBlogs, canManageBlogAliases, canUpdateBlogs, createBlog, deleteBlog, getBlogFormForCreate, getBlogFormForUpdate, updateBlogModifier and TypeMethodDescriptionvoidAdds anIdto aBlogfor the purpose of creating compatibility.booleanTests if this user can createBlogs.booleancanCreateBlogWithRecordTypes(Type[] blogRecordTypes) Tests if this user can create a singleBlogusing the desired record types.booleanTests if this user can deleteBlogs.booleanTests if this user can manageIdaliases forBlogs.booleanTests if this user can updateBlogs.createBlog(BlogForm blogForm) Creates a newBlog.voiddeleteBlog(Id blogId) Deletes aBlog.getBlogFormForCreate(Type[] blogRecordTypes) Gets the blog form for creating new blogs.getBlogFormForUpdate(Id blogId) Gets the blog form for updating an existing blog.voidupdateBlog(BlogForm blogForm) Updates an existing blog.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
-
getBlogFormsForCreate
BlogBatchFormList getBlogFormsForCreate(long number, Type[] blogRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the blog forms for creating a bunch of new blogs.- Parameters:
number- the number of forms to retrieveblogRecordTypes- array of blog record types to be included in each create operation or an empty list if none- Returns:
- the blog forms
- Throws:
NullArgumentException-blogRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createBlogs
CreateResponseList createBlogs(BlogBatchFormList blogForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofBlogs. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
blogForms- the blog forms- Returns:
- the create responses
- Throws:
NullArgumentException-blogFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBlogFormsForUpdate
BlogBatchFormList getBlogFormsForUpdate(IdList blogIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the blog forms for updating an existing set of blogs. A new blog form should be requested for each update transaction.- Parameters:
blogIds- theIdsof theBlog- Returns:
- the blog form
- Throws:
NotFoundException- anblogIdis not foundNullArgumentException-blogIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateBlogs
UpdateResponseList updateBlogs(BlogBatchFormList blogForms) throws OperationFailedException, PermissionDeniedException Updates existing blogs. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
blogForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-blogFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllBlogs
Deletes allBlogs.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteBlogs
DeleteResponseList deleteBlogs(IdList blogIds) throws OperationFailedException, PermissionDeniedException Deletes blogs for the givenIds.- Parameters:
blogIds- theIdsof the blogs to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-blogIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasBlogs
AliasResponseList aliasBlogs(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anBlogfor the purpose of creating compatibility. The primaryIdof theBlogis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another blog, it is reassigned to the given 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.
-