Interface CourseRegistrationBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, CourseRegistrationAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes CourseRegistration
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
CourseRegistration , an CourseRegistrationForm is
requested using getCourseRegistrationFormsForCreate() specifying
the desired registration, course offering, student, and record
Types or none if no record Types are needed. Each of the returned
CourseRegistrationForms 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 CourseRegistrationForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each CourseRegistrationForm
corresponds to an attempted transaction.
The CourseRegistrationForms returned from
getCourseRegistrationFormsForCreate() may be linked to the originating
request through the peer Ids of the CourseRegistrationForm
. In the case where there may be duplicates, any
CourseRegistrationForm of the same peer Ids may be used for a
create operation.
Once a batch of CourseRegistrationForms are submitted for
create, a CreateResponse is returned for each
CourseRegistrationForm , although the ordering is not defined. Only
errors that pertain to the entire create operation are returned from
createCourseRegistrations() , errors specific to an individual
CourseRegistrationForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
CourseRegistrationForm through the CourseRegistrationForm
Id .
For updates, CourseRegistrationForms are requested to the
CourseRegistration Id that is to be updated using
getCourseRegistrationFormsForUpdate() where the reference Id in
the CourseRegistrationForm may be used to link the request.
Similarly, the CourseRegistrationForm has metadata about the data
that can be updated and it can perform validation before submitting the
update. The CourseRegistrationForm can only be used once for a
successful update and cannot be reused.
Once a batch of CourseRegistrationForms are submitted for
update, an UpdateResponse is returned for each
CourseRegistrationForm , although the ordering is not defined. Only
errors that pertain to the entire update operation are returned from
updateCourseRegistrations() , errors specific to an individual
CourseRegistrationForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
CourseRegistrationForm through the CourseRegistrationForm
Id .
The delete operations delete CourseRegistrationForms in bulk.
To unmap a CourseRegistrationForm from the current
CourseCatalog , the
CourseRegistrationFormCourseCatalogAssignmentSession should be used.
These delete operations attempt to remove the CourseRegistration
itself thus removing it from all known CourseCatalog catalogs.
Bulk delete operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasCourseRegistrations(AliasRequestList aliasRequests) Adds anIdto aCourseRegistrationfor the purpose of creating compatibility.createCourseRegistrations(CourseRegistrationBatchFormList courseRegistrationForms) Creates a new set ofCourseRegistrations.Deletes allCourseRegistrationsin thisCourseCatalog.deleteCourseRegistrations(IdList courseRegistrationIds) Deletes course registrations for the givenIds.deleteCourseRegistrationsForCourseOffering(Id courseOfferingId) Deletes course registrations for the given course offering.deleteCourseRegistrationsForRegistration(Id registrationId) Deletes course registrations for the given registration.deleteCourseRegistrationsForStudent(Id resourceId) Deletes course registrations for the given student resource.Deletes course registrations expired before the given date.getCourseRegistrationFormsForCreate(CourseRegistrationPeerList peers, Type[] courseRegistrationRecordTypes) Gets the course registration forms for creating a bunch of new course registrations.getCourseRegistrationFormsForUpdate(IdList courseRegistrationIds) Gets the course registration forms for updating an existing set of course registrations.updateCourseRegistrations(CourseRegistrationBatchFormList courseRegistrationForms) Updates existing course registrations.Methods inherited from interface CourseRegistrationAdminSession
aliasCourseRegistration, canCreateCourseRegistrations, canCreateCourseRegistrationWithRecordTypes, canDeleteCourseRegistrations, canManageCourseRegistrationAliases, canUpdateCourseRegistrations, createCourseRegistration, deleteCourseRegistration, getCourseCatalog, getCourseCatalogId, getCourseRegistrationFormForCreate, getCourseRegistrationFormForUpdate, updateCourseRegistrationModifier and TypeMethodDescriptionvoidaliasCourseRegistration(Id courseRegistrationId, Id aliasId) Adds anIdto aCourseRegistration for the purpose of creating compatibility.booleanTests if this user can createCourseRegistrations.booleancanCreateCourseRegistrationWithRecordTypes(Type[] courseRegistrationRecordTypes) Tests if this user can create a singleCourseRegistration using the desired record types.booleanTests if this user can deleteCourseRegistrations.booleanTests if this user can manageIdaliases forCourseRegistrations A return of true does not guarantee successful authorization.booleanTests if this user can updateCourseRegistrations.createCourseRegistration(CourseRegistrationForm courseRegistrationForm) Creates a newCourseRegistration.voiddeleteCourseRegistration(Id courseRegistrationId) Deletes aCourseRegistration.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getCourseRegistrationFormForCreate(Id courseOfferingId, Id resourceId, Type[] courseRegistrationRecordTypes) Gets the course registration form for creating new course registrations.getCourseRegistrationFormForUpdate(Id courseRegistrationId) Gets the course registration form for updating an existing course registration.voidupdateCourseRegistration(CourseRegistrationForm courseRegistrationForm) Updates an existing course registration.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
-
getCourseRegistrationFormsForCreate
CourseRegistrationBatchFormList getCourseRegistrationFormsForCreate(CourseRegistrationPeerList peers, Type[] courseRegistrationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the course registration forms for creating a bunch of new course registrations. A form is returned for each course offering and resource pair.- Parameters:
peers- the relationship peerscourseRegistrationRecordTypes- array of course registration record types to be included in each create operation or an empty list if none- Returns:
- the course registration forms
- Throws:
NotFoundException- aregistrationIdorresourceIdis not foundNullArgumentException-peersorcourseRegistrationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createCourseRegistrations
CreateResponseList createCourseRegistrations(CourseRegistrationBatchFormList courseRegistrationForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofCourseRegistrations. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
courseRegistrationForms- the course registration forms- Returns:
- the create responses
- Throws:
NullArgumentException-courseRegistrationFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCourseRegistrationFormsForUpdate
CourseRegistrationBatchFormList getCourseRegistrationFormsForUpdate(IdList courseRegistrationIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the course registration forms for updating an existing set of course registrations. A new course registration form should be requested for each update transaction.- Parameters:
courseRegistrationIds- theIdsof theCourseRegistrations- Returns:
- the course registration form
- Throws:
NotFoundException- acourseRegistrationIdis not foundNullArgumentException-courseRegistrationIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCourseRegistrations
UpdateResponseList updateCourseRegistrations(CourseRegistrationBatchFormList courseRegistrationForms) throws OperationFailedException, PermissionDeniedException Updates existing course registrations. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
courseRegistrationForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-courseRegistrationFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllCourseRegistrations
DeleteResponseList deleteAllCourseRegistrations() throws OperationFailedException, PermissionDeniedExceptionDeletes allCourseRegistrationsin thisCourseCatalog.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCourseRegistrations
DeleteResponseList deleteCourseRegistrations(IdList courseRegistrationIds) throws OperationFailedException, PermissionDeniedException Deletes course registrations for the givenIds.- Parameters:
courseRegistrationIds- theIdsof the course registrations to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-courseRegistrationIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCourseRegistrationsForRegistration
DeleteResponseList deleteCourseRegistrationsForRegistration(Id registrationId) throws OperationFailedException, PermissionDeniedException Deletes course registrations for the given registration.- Parameters:
registrationId- anIdof a registration- Returns:
- the delete responses
- Throws:
NullArgumentException-registrationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCourseRegistrationsForCourseOffering
DeleteResponseList deleteCourseRegistrationsForCourseOffering(Id courseOfferingId) throws OperationFailedException, PermissionDeniedException Deletes course registrations for the given course offering.- Parameters:
courseOfferingId- anIdof a course offering- Returns:
- the delete responses
- Throws:
NullArgumentException-courseOfferingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCourseRegistrationsForStudent
DeleteResponseList deleteCourseRegistrationsForStudent(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes course registrations for the given student resource.- Parameters:
resourceId- anIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveCourseRegistrationsByDate
DeleteResponseList deleteIneffectiveCourseRegistrationsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes course registrations 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.
-
aliasCourseRegistrations
AliasResponseList aliasCourseRegistrations(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aCourseRegistrationfor the purpose of creating compatibility. The primaryIdof theCourseRegistrationis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another course registration, it is reassigned to the given course registrationId.- 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.
-