public interface CourseEntryBatchAdminSession extends CourseEntryAdminSession
This session creates, updates, and deletes CourseEntries
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
CourseEntry,
a CourseEntryForm
is requested using
getCourseEntryFormsForCreate()
specifying the desired
course, student and record Types
or none if no record
Types
are needed. Each of the returned
CourseEntryForms
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 CourseEntryForm
is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each CourseEntryForm
corresponds to an attempted transaction.
The CourseEntryForms
returned from
getCourseEntryFormsForCreate()
may be linked to the originating
request through the peer Ids
of the CourseEntryForm.
In the case where there may be duplicates, any
CourseEntryForm
of the same peer Ids
may be used
for a create operation.
Once a batch of CourseEntryForms
are submitted for
create, a CreateResponse
is returned for each
CourseEntryForm,
although the ordering is not defined. Only errors
that pertain to the entire create operation are returned from
createCourseEntries(),
errors specific to an individual
CourseEntryForm
are indicated in the corresponding
CreateResponse.
CreateResponses
may be linked to
the originating CourseEntryForm
through the
CourseEntryForm
Id
.
For updates, CourseEntryForms
are requested to the
CourseEntry
Id
that is to be updated using
getCourseEntryFormsForUpdate()
where the reference
Id
in the CourseEntryForm
may be used to link the
request. Similarly, the CourseEntryForm
has metadata about
the data that can be updated and it can perform validation before
submitting the update. The CourseEntryForm
can only be used
once for a successful update and cannot be reused.
Once a batch of CourseEntryForms
are submitted for
update, an UpdateResponse
is returned for each
CourseEntryForm,
although the ordering is not defined. Only errors
that pertain to the entire update operation are returned from
updateCourseEntries(),
errors specific to an individual
CourseEntryForm
are indicated in the corresponding
UpdateResponse.
UpdateResponses
may be linked to
the originating CourseEntryForm
through the
CourseEntryForm
Id.
The delete operations delete CourseEntries
in bulk. To
unmap a CourseEntry
from the current CourseCatalog,
the CourseEntryCourseCatalogAssignmentSession
should be used. These delete operations attempt to remove the
CourseEntry
itself thus removing it from all known
CourseCatalog
catalogs. Bulk delete operations return the results
in DeleteResponses.
Modifier and Type | Method and Description |
---|---|
AliasResponseList |
aliasCourseEntries(AliasRequestList aliasRequests)
Adds an
Id to a CourseEntry for the
purpose of creating compatibility. |
CreateResponseList |
createCourseEntries(CourseEntryBatchFormList courseEntryForms)
Creates a new set of
CourseEntries. |
DeleteResponseList |
deleteAllCourseEntries()
Deletes all
CourseEntries in this CourseCatalog
. |
DeleteResponseList |
deleteCourseEntries(IdList courseEntryIds)
Deletes course entries for the given
Ids. |
DeleteResponseList |
deleteCourseEntriesForCourse(Id courseId)
Deletes course entries for the given course.
|
DeleteResponseList |
deleteCourseEntriesForStudent(Id resourceId)
Deletes course entries for the given student.
|
DeleteResponseList |
deleteIneffectiveCourseEntriesByDate(DateTime date)
Deletes course entries expired before the given date.
|
CourseEntryBatchFormList |
getCourseEntryFormsForCreate(CourseEntryPeerList peers,
Type[] courseEntryRecordTypes)
Gets the course entry forms for creating a bunch of new course
entries.
|
CourseEntryBatchFormList |
getCourseEntryFormsForUpdate(IdList courseEntryIds)
Gets the course entry forms for updating an existing set of course
entries.
|
UpdateResponseList |
updateCourseEntries(CourseEntryBatchFormList courseEntryForms)
Updates existing course entries.
|
aliasCourseEntry, canCreateCourseEntries, canCreateCourseEntryWithRecordTypes, canDeleteCourseEntries, canManageCourseEntryAliases, canUpdateCourseEntries, createCourseEntry, deleteCourseEntry, getCourseCatalog, getCourseCatalogId, getCourseEntryFormForCreate, getCourseEntryFormForUpdate, updateCourseEntry
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
CourseEntryBatchFormList getCourseEntryFormsForCreate(CourseEntryPeerList peers, Type[] courseEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
peers
- the relationship peerscourseEntryRecordTypes
- array of course entry record types to
be included in each create operation or an empty list if noneNotFoundException
- a courseId
or
resourceId
is not foundNullArgumentException
- peers
or
courseEntryRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to request forms with
given record typesmandatory
- This method must be implemented. CreateResponseList createCourseEntries(CourseEntryBatchFormList courseEntryForms) throws OperationFailedException, PermissionDeniedException
CourseEntries.
This method returns
an error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse
.courseEntryForms
- the course entry formsNullArgumentException
- courseEntryForms
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CourseEntryBatchFormList getCourseEntryFormsForUpdate(IdList courseEntryIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
courseEntryIds
- the Ids
of the
CourseEntry
NotFoundException
- a courseEntryId
is
not foundNullArgumentException
- courseEntryIds
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. UpdateResponseList updateCourseEntries(CourseEntryBatchFormList courseEntryForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse
.courseEntryForms
- the form containing the elements to be
updatedNullArgumentException
- courseEntryForms
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAllCourseEntries() throws OperationFailedException, PermissionDeniedException
CourseEntries
in this CourseCatalog
.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteCourseEntries(IdList courseEntryIds) throws OperationFailedException, PermissionDeniedException
Ids.
courseEntryIds
- the Ids
of the course entries to
deleteNullArgumentException
- courseEntryIds
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteCourseEntriesForCourse(Id courseId) throws OperationFailedException, PermissionDeniedException
courseId
- the Id
of a courseNullArgumentException
- courseId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteCourseEntriesForStudent(Id resourceId) throws OperationFailedException, PermissionDeniedException
resourceId
- the Id
of a resourceNullArgumentException
- resourceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteIneffectiveCourseEntriesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException
date
- a dateNullArgumentException
- date
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AliasResponseList aliasCourseEntries(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id
to a CourseEntry
for the
purpose of creating compatibility. The primary Id
of
the CourseEntry
is determined by the provider. The new
Id
is an alias to the primary Id.
If the
alias is a pointer to another course entry, it is reassigned to the
given course entry Id.
aliasRequests
- the alias requestsNullArgumentException
- aliasRequests
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.