Interface DocetBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, DocetAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Docets 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
Docet , an DocetForm is requested using
getDocetFormsForCreate() specifying the desired module, activity unit,
and record Types or none if no record Types are needed.
Each of the returned DocetForms 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 DocetForm is submiited to
a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each DocetForm
corresponds to an attempted transaction.
The DocetForms returned from getDocetFormsForCreate()
may be linked to the originating request through the peer Ids of
the DocetForm . In the case where there may be duplicates, any
DocetForm of the same peer Ids may be used for a create
operation.
Once a batch of DocetForms are submitted for create, a
CreateResponse is returned for each DocetForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createDocets() , errors specific to an
individual DocetForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
DocetForm through the DocetForm Id .
For updates, DocetForms are requested to the Docet
Id that is to be updated using getDocetFormsForUpdate()
where the reference Id in the DocetForm may be used to
link the request. Similarly, the DocetForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The DocetForm can only be used once for a successful
update and cannot be reused.
Once a batch of DocetForms are submitted for update, an
UpdateResponse is returned for each DocetForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateDocets() , errors specific to an
individual DocetForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
DocetForm through the DocetForm Id .
The delete operations delete Docets in bulk. To unmap an
Docet from the current CourseCatalog , the
DocetCourseCatalogAssignmentSession should be used. These delete
operations attempt to remove the Docet itself thus removing it
from all known CourseCatalog catalogs. Bulk delete operations
return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasDocets(AliasRequestList aliasRequests) Adds anIdto anDocetfor the purpose of creating compatibility.createDocets(DocetBatchFormList docetForms) Creates a new set ofDocets.Deletes allDocetsin thisCourseCatalog.deleteDocets(IdList docetIds) Deletes docets for the givenIds.deleteDocetsForActivityUnit(Id activityUnitId) Deletes docets for the given activity unit.deleteDocetsForModule(Id moduleId) Deletes docets for the given module.Deletes docets expired before the given date.getDocetFormsForCreate(DocetPeerList peers, Type[] docetRecordTypes) Gets the docet forms for creating a bunch of new docets.getDocetFormsForUpdate(IdList docetIds) Gets the docet forms for updating an existing set of docets.updateDocets(DocetBatchFormList docetForms) Updates existing docets.Methods inherited from interface DocetAdminSession
aliasDocet, canCreateDocets, canCreateDocetWithRecordTypes, canDeleteDocets, canManageDocetAliases, canSequenceDocets, canUpdateDocets, createDocet, deleteDocet, getCourseCatalog, getCourseCatalogId, getDocetFormForCreate, getDocetFormForUpdate, moveDocetAhead, moveDocetBehind, orderDocets, updateDocetModifier and TypeMethodDescriptionvoidaliasDocet(Id docetId, Id aliasId) Adds anIdto aDocetfor the purpose of creating compatibility.booleanTests if this user can createDocets.booleancanCreateDocetWithRecordTypes(Type[] docetRecordTypes) Tests if this user can create a singleDocetusing the desired record types.booleanTests if this user can deleteDocetsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forDocets.booleanTests if this user can orderDocets.booleanTests if this user can updateDocets.createDocet(DocetForm docetForm) Creates a newDocet.voiddeleteDocet(Id docetId) Deletes aDocet.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getDocetFormForCreate(Id moduleId, Id activityUnitId, Type[] docetRecordTypes) Gets the docet form for creating new docets.getDocetFormForUpdate(Id docetId) Gets the docet form for updating an existing docet.voidmoveDocetAhead(Id docetId, Id moduleId, Id referenceId) Reorders docets in a module by moving the specified docet in front of a reference docet.voidmoveDocetBehind(Id docetId, Id moduleId, Id referenceId) Reorders docets in a module by moving the specified docet behind a reference docet.voidorderDocets(Id[] docetIds, Id moduleId) Reorders a set of docets in a module.voidupdateDocet(DocetForm docetForm) Updates an existing docet.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
-
getDocetFormsForCreate
DocetBatchFormList getDocetFormsForCreate(DocetPeerList peers, Type[] docetRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the docet forms for creating a bunch of new docets. A form is returned for each activity and resource pair.- Parameters:
peers- the relationship peersdocetRecordTypes- array of docet record types to be included in each create operation or an empty list if none- Returns:
- the docet forms
- Throws:
NotFoundException- amoduleIdoractivityUnitIdis not foundNullArgumentException-peersordocetRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createDocets
CreateResponseList createDocets(DocetBatchFormList docetForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofDocets. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
docetForms- the docet forms- Returns:
- the create responses
- Throws:
NullArgumentException-docetFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getDocetFormsForUpdate
DocetBatchFormList getDocetFormsForUpdate(IdList docetIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the docet forms for updating an existing set of docets. A new docet form should be requested for each update transaction.- Parameters:
docetIds- theIdsof theDocet- Returns:
- the docet form
- Throws:
NotFoundException- andocetIdis not foundNullArgumentException-docetIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDocets
UpdateResponseList updateDocets(DocetBatchFormList docetForms) throws OperationFailedException, PermissionDeniedException Updates existing docets. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
docetForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-docetFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllDocets
Deletes allDocetsin thisCourseCatalog.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteDocets
DeleteResponseList deleteDocets(IdList docetIds) throws OperationFailedException, PermissionDeniedException Deletes docets for the givenIds.- Parameters:
docetIds- theIdsof the docets to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-docetIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteDocetsForModule
DeleteResponseList deleteDocetsForModule(Id moduleId) throws OperationFailedException, PermissionDeniedException Deletes docets for the given module.- Parameters:
moduleId- anIdof a module- Returns:
- the delete responses
- Throws:
NullArgumentException-moduleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteDocetsForActivityUnit
DeleteResponseList deleteDocetsForActivityUnit(Id activityUnitId) throws OperationFailedException, PermissionDeniedException Deletes docets for the given activity unit.- Parameters:
activityUnitId- anIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-activityUnitIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveDocetsByDate
DeleteResponseList deleteIneffectiveDocetsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes docets expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasDocets
AliasResponseList aliasDocets(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anDocetfor the purpose of creating compatibility. The primaryIdof theDocetis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another docet, it is reassigned to the given docetId.- 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.
-