public interface DocetBatchAdminSession extends DocetAdminSession
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.
Modifier and Type | Method and Description |
---|---|
AliasResponseList |
aliasDocets(AliasRequestList aliasRequests)
Adds an
Id to an Docet for the purpose
of creating compatibility. |
CreateResponseList |
createDocets(DocetBatchFormList docetForms)
Creates a new set of
Docets. |
DeleteResponseList |
deleteAllDocets()
Deletes all
Docets in this CourseCatalog
. |
DeleteResponseList |
deleteDocets(IdList docetIds)
Deletes docets for the given
Ids. |
DeleteResponseList |
deleteDocetsForActivityUnit(Id activityUnitId)
Deletes docets for the given activity unit.
|
DeleteResponseList |
deleteDocetsForModule(Id moduleId)
Deletes docets for the given module.
|
DeleteResponseList |
deleteIneffectiveDocetsByDate(DateTime date)
Deletes docets expired before the given date.
|
DocetBatchFormList |
getDocetFormsForCreate(DocetPeerList peers,
Type[] docetRecordTypes)
Gets the docet forms for creating a bunch of new docets.
|
DocetBatchFormList |
getDocetFormsForUpdate(IdList docetIds)
Gets the docet forms for updating an existing set of docets.
|
UpdateResponseList |
updateDocets(DocetBatchFormList docetForms)
Updates existing docets.
|
aliasDocet, canCreateDocets, canCreateDocetWithRecordTypes, canDeleteDocets, canManageDocetAliases, canSequenceDocets, canUpdateDocets, createDocet, deleteDocet, getCourseCatalog, getCourseCatalogId, getDocetFormForCreate, getDocetFormForUpdate, moveDocetAhead, moveDocetBehind, orderDocets, updateDocet
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
DocetBatchFormList getDocetFormsForCreate(DocetPeerList peers, Type[] docetRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
peers
- the relationship peersdocetRecordTypes
- array of docet record types to be included in
each create operation or an empty list if noneNotFoundException
- a moduleId
or
activityUnitId
is not foundNullArgumentException
- peers
or
docetRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to request forms with
given record typesmandatory
- This method must be implemented. CreateResponseList createDocets(DocetBatchFormList docetForms) throws OperationFailedException, PermissionDeniedException
Docets.
This method returns an
error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse
.docetForms
- the docet formsNullArgumentException
- docetForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DocetBatchFormList getDocetFormsForUpdate(IdList docetIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
docetIds
- the Ids
of the Docet
NotFoundException
- an docetId
is not
foundNullArgumentException
- docetIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. UpdateResponseList updateDocets(DocetBatchFormList docetForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse
.docetForms
- the form containing the elements to be updatedNullArgumentException
- docetForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAllDocets() throws OperationFailedException, PermissionDeniedException
Docets
in this CourseCatalog
.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteDocets(IdList docetIds) throws OperationFailedException, PermissionDeniedException
Ids.
docetIds
- the Ids
of the docets to deleteNullArgumentException
- docetIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteDocetsForModule(Id moduleId) throws OperationFailedException, PermissionDeniedException
moduleId
- an Id
of a moduleNullArgumentException
- moduleId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteDocetsForActivityUnit(Id activityUnitId) throws OperationFailedException, PermissionDeniedException
activityUnitId
- an Id
of a resourceNullArgumentException
- activityUnitId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteIneffectiveDocetsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException
date
- a dateNullArgumentException
- date
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AliasResponseList aliasDocets(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id
to an Docet
for the purpose
of creating compatibility. The primary Id
of the
Docet
is determined by the provider. The new Id
is an alias to the primary Id.
If the alias is a
pointer to another docet, it is reassigned to the given docet
Id.
aliasRequests
- the alias requestsNullArgumentException
- aliasRequests
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.