public interface ProgramEntryBatchAdminSession extends ProgramEntryAdminSession
This session creates, updates, and deletes ProgramEntries
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
ProgramEntry,
a ProgramEntryForm
is requested using
getProgramEntryFormsForCreate()
specifying the desired
program, student, and record Types
or none if no record
Types
are needed. Each of the returned
ProgramEntryForms
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 ProgramEntryForm
is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each ProgramEntryForm
corresponds to an attempted transaction.
The ProgramEntryForms
returned from
getProgramEntryFormsForCreate()
may be linked to the originating
request through the peer Ids
of the
ProgramEntryForm.
In the case where there may be duplicates, any
ProgramEntryForm
of the same peer Ids
may be
used for a create operation.
Once a batch of ProgramEntryForms
are submitted for
create, a CreateResponse
is returned for each
ProgramEntryForm,
although the ordering is not defined. Only
errors that pertain to the entire create operation are returned from
createProgramEntries(),
errors specific to an individual
ProgramEntryForm
are indicated in the corresponding
CreateResponse.
CreateResponses
may be linked to
the originating ProgramEntryForm
through the
ProgramEntryForm
Id
.
For updates, ProgramEntryForms
are requested to the
ProgramEntry
Id
that is to be updated using
getProgramEntryFormsForUpdate()
where the reference
Id
in the ProgramEntryForm
may be used to link the
request. Similarly, the ProgramEntryForm
has metadata about
the data that can be updated and it can perform validation before
submitting the update. The ProgramEntryForm
can only be
used once for a successful update and cannot be reused.
Once a batch of ProgramEntryForms
are submitted for
update, an UpdateResponse
is returned for each
ProgramEntryForm,
although the ordering is not defined. Only
errors that pertain to the entire update operation are returned from
updateProgramEntries(),
errors specific to an individual
ProgramEntryForm
are indicated in the corresponding
UpdateResponse.
UpdateResponses
may be linked to
the originating ProgramEntryForm
through the
ProgramEntryForm
Id.
The delete operations delete ProgramEntries
in bulk. To
unmap a ProgramEntry
from the current CourseCatalog,
the ProgramEntryCourseCatalogAssignmentSession
should be used. These delete operations attempt to remove the
ProgramEntry
itself thus removing it from all known
CourseCatalog
catalogs. Bulk delete operations return the results
in DeleteResponses.
Modifier and Type | Method and Description |
---|---|
AliasResponseList |
aliasProgramEntries(AliasRequestList aliasRequests)
Adds an
Id to a ProgramEntry for the
purpose of creating compatibility. |
CreateResponseList |
createProgramEntries(ProgramEntryBatchFormList programEntryForms)
Creates a new set of
ProgramEntries. |
DeleteResponseList |
deleteAllProgramEntries()
Deletes all
ProgramEntries in this CourseCatalog
. |
DeleteResponseList |
deleteIneffectiveProgramEntriesByDate(DateTime date)
Deletes program entries expired before the given date.
|
DeleteResponseList |
deleteProgramEntries(IdList programEntryIds)
Deletes program entries for the given
Ids. |
DeleteResponseList |
deleteProgramEntriesForProgram(Id programId)
Deletes program entries for the given program.
|
DeleteResponseList |
deleteProgramEntriesForStudent(Id resourceId)
Deletes program entries for the given student
|
ProgramEntryBatchFormList |
getProgramEntryFormsForCreate(ProgramEntryPeerList peers,
Type[] programEntryRecordTypes)
Gets the program entry forms for creating a bunch of new program
entries.
|
ProgramEntryBatchFormList |
getProgramEntryFormsForUpdate(IdList programEntryIds)
Gets the program entry forms for updating an existing set of program
entries.
|
UpdateResponseList |
updateProgramEntries(ProgramEntryBatchFormList programEntryForms)
Updates existing program entries.
|
aliasProgramEntry, canCreateProgramEntries, canCreateProgramEntryWithRecordTypes, canDeleteProgramEntries, canDeleteProgramEntry, canManageProgramEntryAliases, canUpdateProgramEntries, createProgramEntry, deleteProgramEntry, getCourseCatalog, getCourseCatalogId, getProgramEntryFormForCreate, getProgramEntryFormForUpdate, updateProgramEntry
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
ProgramEntryBatchFormList getProgramEntryFormsForCreate(ProgramEntryPeerList peers, Type[] programEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
ProgramEntryForm
is returned for each
program and student pair.peers
- a list of program entry peersprogramEntryRecordTypes
- array of program entry record types to
be included in each create operation or an empty list if noneNotFoundException
- a programId
or
studentId
is not foundNullArgumentException
- peers
or
programEntryRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to request forms with
given record typesmandatory
- This method must be implemented. CreateResponseList createProgramEntries(ProgramEntryBatchFormList programEntryForms) throws OperationFailedException, PermissionDeniedException
ProgramEntries.
This method
returns an error if the entire operation fails. Otherwise, the status
of an individual create operation is indicated in the
BatchCreateResponse
.programEntryForms
- the program entry formsNullArgumentException
- programEntryForms
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ProgramEntryBatchFormList getProgramEntryFormsForUpdate(IdList programEntryIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
programEntryIds
- the Ids
of the
ProgramEntry
NotFoundException
- a programEntryId
is
not foundNullArgumentException
- programEntryIds
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. UpdateResponseList updateProgramEntries(ProgramEntryBatchFormList programEntryForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse
.programEntryForms
- the form containing the elements to be
updatedNullArgumentException
- programEntryForms
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAllProgramEntries() throws OperationFailedException, PermissionDeniedException
ProgramEntries
in this CourseCatalog
.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteProgramEntries(IdList programEntryIds) throws OperationFailedException, PermissionDeniedException
Ids.
programEntryIds
- the Ids
of the program entries
to deleteNullArgumentException
- programEntryIds
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteProgramEntriesForProgram(Id programId) throws OperationFailedException, PermissionDeniedException
programId
- the Id
of a programNullArgumentException
- programId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteProgramEntriesForStudent(Id resourceId) throws OperationFailedException, PermissionDeniedException
resourceId
- the Id
of a studentNullArgumentException
- resourceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteIneffectiveProgramEntriesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException
date
- a dateNullArgumentException
- date
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AliasResponseList aliasProgramEntries(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id
to a ProgramEntry
for the
purpose of creating compatibility. The primary Id
of
the ProgramEntry
is determined by the provider. The new
Id
is an alias to the primary Id.
If the
alias is a pointer to another program entry, it is reassigned to the
given program entry Id.
aliasRequests
- the alias requestsNullArgumentException
- aliasRequests
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.