Interface ForumBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, ForumAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Forums 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
Forum , a ForumForm is requested using
getForumFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
ForumForms 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 ForumForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each ForumForm corresponds to an attempted
transaction.
The ForumForms returned from getForumFormsForCreate()
may be linked to the originating request through the peer Ids of
the ForumForm . In the case where there may be duplicates, any
ForumForm of the same peer Ids may be used for a create
operation.
Once a batch of ForumForms are submitted for create, a
CreateResponse is returned for each ForumForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createForums() , errors specific to an
individual ForumForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
ForumForm through the ForumForm Id .
For updates, ForumForms are requested to the Forum
Id that is to be updated using getForumFormsForUpdate()
where the reference Id in the ForumForm may be used to
link the request. Similarly, the ForumForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The ForumForm can only be used once for a successful
update and cannot be reused.
Once a batch of ForumForms are submitted for update, an
UpdateResponse is returned for each ForumForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateForums() , errors specific to an
individual ForumForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
ForumForm through the ForumForm Id .
The delete operations delete Forums in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasForums(AliasRequestList aliasRequests) Adds anIdto aForumfor the purpose of creating compatibility.createForums(ForumBatchFormList forumForms) Creates a new set ofForums.Deletes allForums.deleteForums(IdList forumIds) Deletes forums for the givenIds.getForumFormsForCreate(long number, Type[] forumRecordTypes) Gets the forum forms for creating a bunch of new forums.getForumFormsForUpdate(IdList forumIds) Gets the forum forms for updating an existing set of forums.updateForums(ForumBatchFormList forumForms) Updates existing forums.Methods inherited from interface ForumAdminSession
aliasForum, canCreateForums, canCreateForumWithRecordTypes, canDeleteForums, canManageForumAliases, canUpdateForums, createForum, deleteForum, getForumFormForCreate, getForumFormForUpdate, updateForumModifier and TypeMethodDescriptionvoidaliasForum(Id forumId, Id aliasId) Adds anIdto aForumfor the purpose of creating compatibility.booleanTests if this user can createForums.booleancanCreateForumWithRecordTypes(Type[] forumRecordTypes) Tests if this user can create a singleForumusing the desired record types.booleanTests if this user can deleteForumsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forForums.booleanTests if this user can updateForums.createForum(ForumForm forumForm) Creates a newForum.voiddeleteForum(Id forumId) Deletes aForum.getForumFormForCreate(Type[] forumRecordTypes) Gets the forum form for creating new forums.getForumFormForUpdate(Id forumId) Gets the forum form for updating an existing forum.voidupdateForum(ForumForm forumForm) Updates an existing forum.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
-
getForumFormsForCreate
ForumBatchFormList getForumFormsForCreate(long number, Type[] forumRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the forum forms for creating a bunch of new forums.- Parameters:
number- the number of forms to retrieveforumRecordTypes- array of forum record types to be included in each create operation or an empty list if none- Returns:
- the forum forms
- Throws:
NullArgumentException-forumRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createForums
CreateResponseList createForums(ForumBatchFormList forumForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofForums. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
forumForms- the forum forms- Returns:
- the create responses
- Throws:
NullArgumentException-forumFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getForumFormsForUpdate
ForumBatchFormList getForumFormsForUpdate(IdList forumIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the forum forms for updating an existing set of forums. A new forum form should be requested for each update transaction.- Parameters:
forumIds- theIdsof theForum- Returns:
- the forum form
- Throws:
NotFoundException- aforumIdis not foundNullArgumentException-forumIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateForums
UpdateResponseList updateForums(ForumBatchFormList forumForms) throws OperationFailedException, PermissionDeniedException Updates existing forums. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
forumForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-forumFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllForums
Deletes allForums.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteForums
DeleteResponseList deleteForums(IdList forumIds) throws OperationFailedException, PermissionDeniedException Deletes forums for the givenIds.- Parameters:
forumIds- theIdsof the forums to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-forumIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasForums
AliasResponseList aliasForums(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aForumfor the purpose of creating compatibility. The primaryIdof theForumis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another forum, it is reassigned to the given forumId.- 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.
-