Interface GradebookBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, GradebookAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Gradebooks 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
Gradebook , a GradebookForm is requested using
getGradebookFormsForCreate() specifying the desired record Types
or none if no record Types are needed. Each of the returned
GradebookForms 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 GradebookForm is submiited to a create operation,
it cannot be reused with another create operation unless the first
operation was unsuccessful. Each GradebookForm corresponds to an
attempted transaction.
The GradebookForms returned from
getGradebookFormForCreate() may be linked to the originating request
through the peer Ids of the GradebookForm In the case
where there may be duplicates, any GradebookForm of the same peer
Ids may be used for a create operation.
Once a batch of GradebookForm are submitted for create, a
CreateResponse is returned for each GradebookForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createGradebooks() ,
errors specific to an individual GradebookForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating GradebookForm through the
GradebookForm Id .
For updates, GradebookForm are requested to the
Gradebook Id that is to be updated using
getGradebookFormsForUpdate() where the reference Id in the
Gradebook may be used to link the request. Similarly, the
Gradebook has metadata about the data that can be updated and it can
perform validation before submitting the update. The Gradebook can
only be used once for a successful update and cannot be reused.
Once a batch of GradebookForms are submitted for update, an
UpdateResponse is returned for each GradebookForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateGradebooks() ,
errors specific to an individual GradebookForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating GradebookForm through the
GradebookForm Id .
The delete operations delete Gradebooks in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasGradebooks(AliasRequestList aliasRequests) Adds anIdto aGradebookfor the purpose of creating compatibility.createGradebooks(GradebookBatchFormList gradebookForms) Creates a new set ofGradebooks.Deletes allGradebooks.deleteGradebooks(IdList gradebookIds) Deletes gradebooks for the givenIds.getGradebookFormsForCreate(long number, Type[] gradebookRecordTypes) Gets the gradebook forms for creating a bunch of new gradebooks.getGradebookFormsForUpdate(IdList gradebookIds) Gets the gradebook forms for updating an existing set of gradebooks.updateGradebooks(GradebookBatchFormList gradebookForms) Updates existing gradebooks.Methods inherited from interface GradebookAdminSession
aliasGradebook, canCreateGradebooks, canCreateGradebookWithRecordTypes, canDeleteGradebooks, canManageGradebookAliases, canUpdateGradebooks, createGradebook, deleteGradebook, getGradebookFormForCreate, getGradebookFormForUpdate, updateGradebookModifier and TypeMethodDescriptionvoidaliasGradebook(Id gradebookId, Id aliasId) Adds anIdto aGradebookfor the purpose of creating compatibility.booleanTests if this user can createGradebooks.booleancanCreateGradebookWithRecordTypes(Type[] gradebookRecordTypes) Tests if this user can create a singleGradebookusing the desired record types.booleanTests if this user can delete gradebooks.booleanTests if this user can manageIdaliases forGradebooks.booleanTests if this user can updateGradebooks.createGradebook(GradebookForm gradebookForm) Creates a newGradebook.voiddeleteGradebook(Id gradebookId) Deletes aGradebook.getGradebookFormForCreate(Type[] gradebookRecordTypes) Gets the gradebook form for creating new gradebooks.getGradebookFormForUpdate(Id gradebookId) Gets the gradebook form for updating an existing gradebook.voidupdateGradebook(GradebookForm gradebookForm) Updates an existing gradebook.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
-
getGradebookFormsForCreate
GradebookBatchFormList getGradebookFormsForCreate(long number, Type[] gradebookRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the gradebook forms for creating a bunch of new gradebooks.- Parameters:
number- the number of forms to retrievegradebookRecordTypes- array of gradebook record types to be included in each create operation or an empty list if none- Returns:
- the gradebook forms
- Throws:
NullArgumentException-gradebookRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createGradebooks
CreateResponseList createGradebooks(GradebookBatchFormList gradebookForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofGradebooks. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
gradebookForms- the gradebook forms- Returns:
- the create responses
- Throws:
NullArgumentException-gradebookFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getGradebookFormsForUpdate
GradebookBatchFormList getGradebookFormsForUpdate(IdList gradebookIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the gradebook forms for updating an existing set of gradebooks. A new gradebook form should be requested for each update transaction.- Parameters:
gradebookIds- theIdsof theGradebook- Returns:
- the gradebook forms
- Throws:
NotFoundException- agradebookIdis not foundNullArgumentException-gradebookIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateGradebooks
UpdateResponseList updateGradebooks(GradebookBatchFormList gradebookForms) throws OperationFailedException, PermissionDeniedException Updates existing gradebooks. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
gradebookForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-gradebookFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllGradebooks
Deletes allGradebooks.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteGradebooks
DeleteResponseList deleteGradebooks(IdList gradebookIds) throws OperationFailedException, PermissionDeniedException Deletes gradebooks for the givenIds.- Parameters:
gradebookIds- theIdsof the gradebooks to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-gradebookIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasGradebooks
AliasResponseList aliasGradebooks(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aGradebookfor the purpose of creating compatibility. The primaryIdof theGradebookis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another gradebook, it is reassigned to the given gradebookId.- 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.
-