Interface ActivityRegistrationBatchAdminSession
- All Superinterfaces:
ActivityRegistrationAdminSession, AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes
ActivityRegistrations 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
ActivityRegistration , an ActivityRegistrationForm is
requested using getActivityRegistrationFormsForCreate() specifying
the desired registration, activity, student, and record Types or
none if no record Types are needed. Each of the returned
ActivityRegistrationForms 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 ActivityRegistrationForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each
ActivityRegistrationForm corresponds to an attempted transaction.
The ActivityRegistrationForms returned from
getActivityRegistrationFormsForCreate() may be linked to the originating
request through the peer Ids of the
ActivityRegistrationForm . In the case where there may be duplicates, any
ActivityRegistrationForm of the same peer Ids may be used
for a create operation.
Once a batch of ActivityRegistrationForms are submitted for
create, a CreateResponse is returned for each
ActivityRegistrationForm , although the ordering is not defined. Only
errors that pertain to the entire create operation are returned from
createActivityRegistrations() , errors specific to an individual
ActivityRegistrationForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
ActivityRegistrationForm through the
ActivityRegistrationForm Id .
For updates, ActivityRegistrationForms are requested to the
ActivityRegistration Id that is to be updated using
getActivityRegistrationFormsForUpdate() where the reference Id in
the ActivityRegistrationForm may be used to link the request.
Similarly, the ActivityRegistrationForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The ActivityRegistrationForm can only be used once for
a successful update and cannot be reused.
Once a batch of ActivityRegistrationForms are submitted for
update, an UpdateResponse is returned for each
ActivityRegistrationForm , although the ordering is not defined. Only
errors that pertain to the entire update operation are returned from
updateActivityRegistrations() , errors specific to an individual
ActivityRegistrationForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
ActivityRegistrationForm through the
ActivityRegistrationForm Id .
The delete operations delete ActivityRegistrations in bulk. To
unmap an ActivityRegistration from the current
CourseCatalog , the
ActivityRegistrationCourseCatalogAssignmentSession should be used. These
delete operations attempt to remove the ActivityRegistration
itself thus removing it from all known CourseCatalog catalogs.
Bulk delete operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasActivityRegistrations(AliasRequestList aliasRequests) Adds anIdto anActivityRegistrationfor the purpose of creating compatibility.createActivityRegistrations(ActivityRegistrationBatchFormList activityRegistrationForms) Creates a new set ofActivityRegistrations.deleteActivityRegistrations(IdList activityRegistrationIds) Deletes activity registrations for the givenIds.deleteActivityRegistrationsForActivity(Id activityId) Deletes activity registrations for the given activity.deleteActivityRegistrationsForRegistration(Id registrationId) Deletes activity registrations for the given registration.deleteActivityRegistrationsForStudent(Id resourceId) Deletes activity registrations for the given student resource.Deletes allActivityRegistrationsin thisCourseCatalog.Deletes activity registrations expired before the given date.getActivityRegistrationFormsForCreate(ActivityRegistrationPeerList peers, Type[] activityRegistrationRecordTypes) Gets the activity registration forms for creating a bunch of new activity registrations.getActivityRegistrationFormsForUpdate(IdList activityRegistrationIds) Gets the activity registration forms for updating an existing set of activity registrations.updateActivityRegistrations(ActivityRegistrationBatchFormList activityRegistrationForms) Updates existing activity registrations.Methods inherited from interface ActivityRegistrationAdminSession
aliasActivityRegistration, canCreateActivityRegistrations, canCreateActivityRegistrationWithRecordTypes, canDeleteActivityRegistrations, canManageActivityRegistrationAliases, canUpdateActivityRegistrations, createActivityRegistration, deleteActivityRegistration, getActivityRegistrationFormForCreate, getActivityRegistrationFormForUpdate, getCourseCatalog, getCourseCatalogId, updateActivityRegistrationModifier and TypeMethodDescriptionvoidaliasActivityRegistration(Id activityRegistrationId, Id aliasId) Adds anIdto anActivityRegistrationfor the purpose of creating compatibility.booleanTests if this user can createActivityRegistrations.booleancanCreateActivityRegistrationWithRecordTypes(Type[] activityRegistrationRecordTypes) Tests if this user can create a singleActivityRegistrationusing the desired record types.booleanTests if this user can deleteActivityRegistrations.booleanTests if this user can manageIdaliases forActivityRegistrations.booleanTests if this user can updateActivityRegistrations.createActivityRegistration(ActivityRegistrationForm activityRegistrationForm) Creates a newActivityRegistration.voiddeleteActivityRegistration(Id activityRegistrationId) Deletes anActivityRegistration.getActivityRegistrationFormForCreate(Id courseRegistrationId, Id activityId, Id resourceId, Type[] activityRegistrationRecordTypes) Gets the course form for creating new activity registrations.getActivityRegistrationFormForUpdate(Id activityRegistrationId) Gets the activity registration form for updating an existing activity registration.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.voidupdateActivityRegistration(ActivityRegistrationForm activityRegistrationForm) Updates an existing activity 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
-
getActivityRegistrationFormsForCreate
ActivityRegistrationBatchFormList getActivityRegistrationFormsForCreate(ActivityRegistrationPeerList peers, Type[] activityRegistrationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the activity registration forms for creating a bunch of new activity registrations. A form is returned for each activity and resource pair.- Parameters:
peers- the relationship peersactivityRegistrationRecordTypes- array of activity registration record types to be included in each create operation or an empty list if none- Returns:
- the activity registration forms
- Throws:
NotFoundException- aregistrationIdorresourceIdis not foundNullArgumentException-peersoractivityRegistrationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createActivityRegistrations
CreateResponseList createActivityRegistrations(ActivityRegistrationBatchFormList activityRegistrationForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofActivityRegistrations. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
activityRegistrationForms- the activity registration forms- Returns:
- the create responses
- Throws:
NullArgumentException-activityRegistrationFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getActivityRegistrationFormsForUpdate
ActivityRegistrationBatchFormList getActivityRegistrationFormsForUpdate(IdList activityRegistrationIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the activity registration forms for updating an existing set of activity registrations. A new activity registration form should be requested for each update transaction.- Parameters:
activityRegistrationIds- theIdsof theActivityRegistrations- Returns:
- the activity registration form
- Throws:
NotFoundException- anactivityRegistrationIdis not foundNullArgumentException-activityRegistrationIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateActivityRegistrations
UpdateResponseList updateActivityRegistrations(ActivityRegistrationBatchFormList activityRegistrationForms) throws OperationFailedException, PermissionDeniedException Updates existing activity registrations. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
activityRegistrationForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-activityRegistrationFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllActivityRegistrations
DeleteResponseList deleteAllActivityRegistrations() throws OperationFailedException, PermissionDeniedExceptionDeletes allActivityRegistrationsin thisCourseCatalog.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteActivityRegistrations
DeleteResponseList deleteActivityRegistrations(IdList activityRegistrationIds) throws OperationFailedException, PermissionDeniedException Deletes activity registrations for the givenIds.- Parameters:
activityRegistrationIds- theIdsof the activity registrations to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-activityRegistrationIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteActivityRegistrationsForRegistration
DeleteResponseList deleteActivityRegistrationsForRegistration(Id registrationId) throws OperationFailedException, PermissionDeniedException Deletes activity 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.
-
deleteActivityRegistrationsForActivity
DeleteResponseList deleteActivityRegistrationsForActivity(Id activityId) throws OperationFailedException, PermissionDeniedException Deletes activity registrations for the given activity.- Parameters:
activityId- anIdof an activity- Returns:
- the delete responses
- Throws:
NullArgumentException-activityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteActivityRegistrationsForStudent
DeleteResponseList deleteActivityRegistrationsForStudent(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes activity 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.
-
deleteIneffectiveActivityRegistrationsByDate
DeleteResponseList deleteIneffectiveActivityRegistrationsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes activity 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.
-
aliasActivityRegistrations
AliasResponseList aliasActivityRegistrations(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anActivityRegistrationfor the purpose of creating compatibility. The primaryIdof theActivityRegistrationis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another activity registration, it is reassigned to the given activity 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.
-