public interface ModuleBatchAdminSession extends ModuleAdminSession
This session creates, updates, and deletes Modules 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
Module, a ModuleForm is requested using
getModuleFormsForCreate() specifying the desired syllabus and
record Types or none if no record Types are
needed. Each of the returned ModuleForms 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 ModuleForm
is submiited to a create operation, it cannot be reused with
another create operation unless the first operation was unsuccessful. Each
ModuleForm corresponds to an attempted transaction.
The ModuleForm returned from
getModuleFormsForCreate() may be linked to the originating request
through the peer Ids of the ModuleForm. In
the case where there may be duplicates, any ModuletForm of
the same peer Ids may be used for a create operation.
Once a batch of ModuleForms are submitted for create, a
CreateResponse is returned for each ModuleForm,
although the ordering is not defined. Only errors that pertain to
the entire create operation are returned from createModules(),
errors specific to an individual ModuleForm are
indicated in the corresponding CreateResponse.
CreateResponses may be linked to the originating ModuleForm
through the ModuleForm Id .
For updates, ModuleForms are requested to the
Module Id that is to be updated using
getModuleFormsForUpdate() where the reference Id in
the ModuleForm may be used to link the request. Similarly,
the ModuleForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
ModuleForm can only be used once for a successful update
and cannot be reused.
Once a batch of ModuleForms are submitted for update,
an UpdateResponse is returned for each ModuleForm,
although the ordering is not defined. Only errors that pertain to
the entire update operation are returned from updateModuleForms(),
errors specific to an individual ModuleForm are
indicated in the corresponding UpdateResponse.
UpdateResponses may be linked to the originating ModuleForm
through the ModuleForm Id.
The delete operations delete Modules in bulk. To unmap
s Module from the current CourseCatalog, the
ModuleCourseCatalogAssignmentSession should be used. These
delete operations attempt to remove the Module itself thus
removing it from all known CourseCatalog catalogs. Bulk
delete operations return the results in DeleteResponses.
| Modifier and Type | Method and Description |
|---|---|
AliasResponseList |
aliasModules(AliasRequestList aliasRequests)
Adds an
Id to a Module for the purpose
of creating compatibility. |
CreateResponseList |
createModules(ModuleBatchFormList moduleForms)
Creates a new set of
Modules. |
DeleteResponseList |
deleteAllModules()
Deletes all
Modules in this CourseCatalog
. |
DeleteResponseList |
deleteModules(IdList moduleIds)
Deletes modules for the given
Ids. |
DeleteResponseList |
deleteModulesForSyllabus(Id syllabusId)
Deletes modules for the given syllabus.
|
ModuleBatchFormList |
getModuleFormsForCreate(IdList syllabusIds,
Type[] moduleRecordTypes)
Gets the module forms for creating a bunch of new modules.
|
ModuleBatchFormList |
getModuleFormsForUpdate(IdList moduleIds)
Gets the module forms for updating an existing set of modules.
|
UpdateResponseList |
updateModules(ModuleBatchFormList moduleForms)
Updates existing modules.
|
aliasModule, canCreateModules, canCreateModuleWithRecordTypes, canDeleteModules, canManageModuleAliases, canSequenceModules, canUpdateModules, createModule, deleteModule, getCourseCatalog, getCourseCatalogId, getModuleFormForCreate, getModuleFormForUpdate, moveModuleAhead, moveModuleBehind, orderModules, updateModulegetAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseModuleBatchFormList getModuleFormsForCreate(IdList syllabusIds, Type[] moduleRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
syllabusIds - a list of syllabus Ids moduleRecordTypes - array of module record types to be included
in each create operation or an empty list if noneNotFoundException - a syllabusId is no
foundNullArgumentException - syllabusIds or
moduleRecordTypes is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to request forms with
given record typesmandatory - This method must be implemented. CreateResponseList createModules(ModuleBatchFormList moduleForms) throws OperationFailedException, PermissionDeniedException
Modules. This method returns an
error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse .moduleForms - the module formsNullArgumentException - moduleForms is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. ModuleBatchFormList getModuleFormsForUpdate(IdList moduleIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
moduleIds - the Ids of the Module NotFoundException - a moduleId is not
foundNullArgumentException - moduleIds is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. UpdateResponseList updateModules(ModuleBatchFormList moduleForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse .moduleForms - the form containing the elements to be updatedNullArgumentException - moduleForms is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteAllModules() throws OperationFailedException, PermissionDeniedException
Modules in this CourseCatalog
.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteModules(IdList moduleIds) throws OperationFailedException, PermissionDeniedException
Ids. moduleIds - the Ids of the modules to deleteNullArgumentException - moduleIds is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteModulesForSyllabus(Id syllabusId) throws OperationFailedException, PermissionDeniedException
syllabusId - the Id of a syllabusNullArgumentException - syllabusId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. AliasResponseList aliasModules(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id to a Module for the purpose
of creating compatibility. The primary Id of the
Module is determined by the provider. The new Id
is an alias to the primary Id. If the alias is
a pointer to another module, it is reassigned to the given module
Id. aliasRequests - the alias requestsNullArgumentException - aliasRequests is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.