Interface CourseEntryBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, CourseEntryAdminSession, OsidSession, OsidSession
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 .
-
Method Summary
Modifier and TypeMethodDescriptionaliasCourseEntries(AliasRequestList aliasRequests) Adds anIdto aCourseEntryfor the purpose of creating compatibility.createCourseEntries(CourseEntryBatchFormList courseEntryForms) Creates a new set ofCourseEntries.Deletes allCourseEntriesin thisCourseCatalog.deleteCourseEntries(IdList courseEntryIds) Deletes course entries for the givenIds.deleteCourseEntriesForCourse(Id courseId) Deletes course entries for the given course.deleteCourseEntriesForStudent(Id resourceId) Deletes course entries for the given student.Deletes course entries expired before the given date.getCourseEntryFormsForCreate(CourseEntryPeerList peers, Type[] courseEntryRecordTypes) Gets the course entry forms for creating a bunch of new course entries.getCourseEntryFormsForUpdate(IdList courseEntryIds) Gets the course entry forms for updating an existing set of course entries.updateCourseEntries(CourseEntryBatchFormList courseEntryForms) Updates existing course entries.Methods inherited from interface CourseEntryAdminSession
aliasCourseEntry, canCreateCourseEntries, canCreateCourseEntryWithRecordTypes, canDeleteCourseEntries, canManageCourseEntryAliases, canUpdateCourseEntries, createCourseEntry, deleteCourseEntry, getCourseCatalog, getCourseCatalogId, getCourseEntryFormForCreate, getCourseEntryFormForUpdate, updateCourseEntryModifier and TypeMethodDescriptionvoidaliasCourseEntry(Id courseEntryId, Id aliasId) Adds anIdto aCourseEntryfor the purpose of creating compatibility.booleanTests if this user can createCourseEntries.booleancanCreateCourseEntryWithRecordTypes(Type[] courseEntryRecordTypes) Tests if this user can create a singlePorgramusing the desired record types.booleanTests if this user can deleteCourseEntries.booleanTests if this user can manageIdaliases forCourseEntries.booleanTests if this user can updateCourseEntries.createCourseEntry(CourseEntryForm courseEntryForm) Creates a newCourseEntry.voiddeleteCourseEntry(Id courseEntryId) Deletes aCourseEntry.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getCourseEntryFormForCreate(Id courseId, Id resourceId, Type[] courseEntryRecordTypes) Gets the course entry form for creating new course entries.getCourseEntryFormForUpdate(Id courseEntryId) Gets the course entry form for updating an existing course entry.voidupdateCourseEntry(CourseEntryForm courseEntryForm) Updates an existing course entry.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
-
getCourseEntryFormsForCreate
CourseEntryBatchFormList getCourseEntryFormsForCreate(CourseEntryPeerList peers, Type[] courseEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the course entry forms for creating a bunch of new course entries. A form is returned for each course and resource pair.- Parameters:
peers- the relationship peerscourseEntryRecordTypes- array of course entry record types to be included in each create operation or an empty list if none- Returns:
- the course entry forms
- Throws:
NotFoundException- acourseIdorresourceIdis not foundNullArgumentException-peersorcourseEntryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createCourseEntries
CreateResponseList createCourseEntries(CourseEntryBatchFormList courseEntryForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofCourseEntries. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
courseEntryForms- the course entry forms- Returns:
- the create responses
- Throws:
NullArgumentException-courseEntryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCourseEntryFormsForUpdate
CourseEntryBatchFormList getCourseEntryFormsForUpdate(IdList courseEntryIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the course entry forms for updating an existing set of course entries. A new course entry form should be requested for each update transaction.- Parameters:
courseEntryIds- theIdsof theCourseEntry- Returns:
- the course entry form
- Throws:
NotFoundException- acourseEntryIdis not foundNullArgumentException-courseEntryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCourseEntries
UpdateResponseList updateCourseEntries(CourseEntryBatchFormList courseEntryForms) throws OperationFailedException, PermissionDeniedException Updates existing course entries. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
courseEntryForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-courseEntryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllCourseEntries
DeleteResponseList deleteAllCourseEntries() throws OperationFailedException, PermissionDeniedExceptionDeletes allCourseEntriesin thisCourseCatalog.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCourseEntries
DeleteResponseList deleteCourseEntries(IdList courseEntryIds) throws OperationFailedException, PermissionDeniedException Deletes course entries for the givenIds.- Parameters:
courseEntryIds- theIdsof the course entries to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-courseEntryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCourseEntriesForCourse
DeleteResponseList deleteCourseEntriesForCourse(Id courseId) throws OperationFailedException, PermissionDeniedException Deletes course entries for the given course.- Parameters:
courseId- theIdof a course- Returns:
- the delete responses
- Throws:
NullArgumentException-courseIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCourseEntriesForStudent
DeleteResponseList deleteCourseEntriesForStudent(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes course entries for the given student.- Parameters:
resourceId- theIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveCourseEntriesByDate
DeleteResponseList deleteIneffectiveCourseEntriesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes course 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.
-
aliasCourseEntries
AliasResponseList aliasCourseEntries(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aCourseEntryfor the purpose of creating compatibility. The primaryIdof theCourseEntryis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another course entry, it is reassigned to the given course 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.
-