Interface ProgramEntryBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, 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 .
-
Method Summary
Modifier and TypeMethodDescriptionaliasProgramEntries(AliasRequestList aliasRequests) Adds anIdto aProgramEntryfor the purpose of creating compatibility.createProgramEntries(ProgramEntryBatchFormList programEntryForms) Creates a new set ofProgramEntries.Deletes allProgramEntriesin thisCourseCatalog.Deletes program entries expired before the given date.deleteProgramEntries(IdList programEntryIds) Deletes program entries for the givenIds.deleteProgramEntriesForProgram(Id programId) Deletes program entries for the given program.deleteProgramEntriesForStudent(Id resourceId) Deletes program entries for the given studentgetProgramEntryFormsForCreate(ProgramEntryPeerList peers, Type[] programEntryRecordTypes) Gets the program entry forms for creating a bunch of new program entries.getProgramEntryFormsForUpdate(IdList programEntryIds) Gets the program entry forms for updating an existing set of program entries.updateProgramEntries(ProgramEntryBatchFormList programEntryForms) Updates existing program entries.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.Methods inherited from interface ProgramEntryAdminSession
aliasProgramEntry, canCreateProgramEntries, canCreateProgramEntryWithRecordTypes, canDeleteProgramEntries, canDeleteProgramEntry, canManageProgramEntryAliases, canUpdateProgramEntries, createProgramEntry, deleteProgramEntry, getCourseCatalog, getCourseCatalogId, getProgramEntryFormForCreate, getProgramEntryFormForUpdate, updateProgramEntryModifier and TypeMethodDescriptionvoidaliasProgramEntry(Id programEntryId, Id aliasId) Adds anIdto aProgramEntryfor the purpose of creating compatibility.booleanTests if this user can createProgramEntries.booleancanCreateProgramEntryWithRecordTypes(Type[] programEntryRecordTypes) Tests if this user can create a singlePorgramusing the desired record types.booleanTests if this user can deleteProgramEntries.booleancanDeleteProgramEntry(Id programEntryId) Tests if this user can delete a specifiedProgramEntry.booleanTests if this user can manageIdaliases forProgramEntries.booleanTests if this user can updateProgramEntries.createProgramEntry(ProgramEntryForm programEntryForm) Creates a newProgramEntry.voiddeleteProgramEntry(Id programEntryId) Deletes aProgramEntry.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getProgramEntryFormForCreate(Id programId, Id resourceId, Type[] programEntryRecordTypes) Gets the program entry form for creating new program entries.getProgramEntryFormForUpdate(Id programEntryId) Gets the program entry form for updating an existing program entry.voidupdateProgramEntry(ProgramEntryForm programEntryForm) Updates an existing program entry.
-
Method Details
-
getProgramEntryFormsForCreate
ProgramEntryBatchFormList getProgramEntryFormsForCreate(ProgramEntryPeerList peers, Type[] programEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the program entry forms for creating a bunch of new program entries. AProgramEntryFormis returned for each program and student pair.- Parameters:
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 none- Returns:
- the program entry forms
- Throws:
NotFoundException- aprogramIdorstudentIdis not foundNullArgumentException-peersorprogramEntryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createProgramEntries
CreateResponseList createProgramEntries(ProgramEntryBatchFormList programEntryForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofProgramEntries. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
programEntryForms- the program entry forms- Returns:
- the create responses
- Throws:
NullArgumentException-programEntryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getProgramEntryFormsForUpdate
ProgramEntryBatchFormList getProgramEntryFormsForUpdate(IdList programEntryIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the program entry forms for updating an existing set of program entries. A new program entry form should be requested for each update transaction.- Parameters:
programEntryIds- theIdsof theProgramEntry- Returns:
- the program entry form
- Throws:
NotFoundException- aprogramEntryIdis not foundNullArgumentException-programEntryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateProgramEntries
UpdateResponseList updateProgramEntries(ProgramEntryBatchFormList programEntryForms) throws OperationFailedException, PermissionDeniedException Updates existing program entries. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
programEntryForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-programEntryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllProgramEntries
DeleteResponseList deleteAllProgramEntries() throws OperationFailedException, PermissionDeniedExceptionDeletes allProgramEntriesin thisCourseCatalog.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProgramEntries
DeleteResponseList deleteProgramEntries(IdList programEntryIds) throws OperationFailedException, PermissionDeniedException Deletes program entries for the givenIds.- Parameters:
programEntryIds- theIdsof the program entries to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-programEntryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProgramEntriesForProgram
DeleteResponseList deleteProgramEntriesForProgram(Id programId) throws OperationFailedException, PermissionDeniedException Deletes program entries for the given program.- Parameters:
programId- theIdof a program- Returns:
- the delete responses
- Throws:
NullArgumentException-programIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProgramEntriesForStudent
DeleteResponseList deleteProgramEntriesForStudent(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes program entries for the given student- Parameters:
resourceId- theIdof a student- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveProgramEntriesByDate
DeleteResponseList deleteIneffectiveProgramEntriesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes program entries 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.
-
aliasProgramEntries
AliasResponseList aliasProgramEntries(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aProgramEntryfor the purpose of creating compatibility. The primaryIdof theProgramEntryis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another program entry, it is reassigned to the given program entryId.- 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.
-