Interface ActivityUnitBatchAdminSession
- All Superinterfaces:
ActivityUnitAdminSession, AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes ActivityUnits 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
ActivityUnit , an ActivityUnitForm is requested using
getActivityUnitFormsForCreate() specifying the desired course and
record Types or none if no record Types are needed. Each
of the returned ActivityUnitForms 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 ActivityUnitForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
ActivityUnitForm corresponds to an attempted transaction.
The ActivityUnitForms returned from
getActivityUnitFormsForCreate() may be linked to the originating request
through the peer Ids of the ActivityUnitForm . In the case
where there may be duplicates, any ActivityUnitForm of the same
peer Ids may be used for a create operation.
Once a batch of ActivityUnitForms are submitted for create, a
CreateResponse is returned for each ActivityUnitForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createActivityUnits() ,
errors specific to an individual ActivityUnitForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating ActivityUnitForm through the
ActivityUnitForm Id .
For updates, ActivityUnitForms are requested to the
ActivityUnit Id that is to be updated using
getActivityUnitFormsForUpdate() where the reference Id in the
ActivityUnitForm may be used to link the request. Similarly, the
ActivityUnitForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
ActivityUnitForm can only be used once for a successful update and cannot
be reused.
Once a batch of ActivityUnitForms are submitted for update, an
UpdateResponse is returned for each ActivityUnitForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateActivityUnits() ,
errors specific to an individual ActivityUnitForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating ActivityUnitForm through the
ActivityUnitForm Id .
The delete operations delete ActivityUnits in bulk. To unmap
an ActivityUnit from the current CourseCatalog , the
ActivityUnitCourseCatalogAssignmentSession should be used. These
delete operations attempt to remove the ActivityUnit itself thus
removing it from all known CourseCatalog catalogs. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasActivityUnits(AliasRequestList aliasRequests) Adds anIdto anActivityUnitfor the purpose of creating compatibility.createActivityUnits(ActivityUnitBatchFormList activityUnitForms) Creates a new set ofActivityUnits.deleteActivityUnits(IdList activityUnitIds) Deletes activity units for the givenIds.deleteActivityUnitsForCourse(Id courseId) Deletes all activity units mapped to the given course.Deletes allActivityUnitsin thisCourseCatalog.getActivityUnitFormsForCreate(IdList courseIds, Type[] activityUnitRecordTypes) Gets the activity unitforms for creating a bunch of new activity units.getActivityUnitFormsForUpdate(IdList activityUnitIds) Gets the activity unit forms for updating an existing set of activity units.updateActivityUnits(ActivityUnitBatchFormList activityUnitForms) Updates existing activity units.Methods inherited from interface ActivityUnitAdminSession
aliasActivityUnit, canCreateActivityUnits, canCreateActivityUnitWithRecordTypes, canDeleteActivityUnits, canManageActivityUnitAliases, canUpdateActivityUnits, createActivityUnit, deleteActivityUnit, getActivityUnitFormForCreate, getActivityUnitFormForUpdate, getCourseCatalog, getCourseCatalogId, updateActivityUnitModifier and TypeMethodDescriptionvoidaliasActivityUnit(Id activityUnitId, Id aliasId) Adds anIdto anActivityUnitfor the purpose of creating compatibility.booleanTests if this user can createActivityUnits.booleancanCreateActivityUnitWithRecordTypes(Type[] activityUnitRecordTypes) Tests if this user can create a singleActivityUnitusing the desired record types.booleanTests if this user can deleteActivityUnits.booleanTests if this user can manageIdaliases forActivityUnits.booleanTests if this user can updateActivityUnits.createActivityUnit(ActivityUnitForm activityUnitForm) Creates a newActivityUnit.voiddeleteActivityUnit(Id activityUnitId) Deletes anActivityUnit.getActivityUnitFormForCreate(Id courseId, Type[] activityUnitRecordTypes) Gets the activity unit form for creating new activity units.getActivityUnitFormForUpdate(Id activityUnitId) Gets the activity unit form for updating an existing activity unit.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.voidupdateActivityUnit(ActivityUnitForm activityUnitForm) Updates an existing activity unit.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
-
getActivityUnitFormsForCreate
ActivityUnitBatchFormList getActivityUnitFormsForCreate(IdList courseIds, Type[] activityUnitRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the activity unitforms for creating a bunch of new activity units. A new activity form is returned for each supplied course.- Parameters:
courseIds- a list of courseIdsactivityUnitRecordTypes- array of activity unit record types to be included in each create operation or an empty list if none- Returns:
- the activity unitforms
- Throws:
NotFoundException- acourseIdis not foundNullArgumentException-courseIdsoractivityUnitRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createActivityUnits
CreateResponseList createActivityUnits(ActivityUnitBatchFormList activityUnitForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofActivityUnits. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
activityUnitForms- the activity unit forms- Returns:
- the create responses
- Throws:
NullArgumentException-activityUnitFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getActivityUnitFormsForUpdate
ActivityUnitBatchFormList getActivityUnitFormsForUpdate(IdList activityUnitIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the activity unit forms for updating an existing set of activity units. A new activity unitform should be requested for each update transaction.- Parameters:
activityUnitIds- theIdsof theActivityUnit- Returns:
- the activity unit form
- Throws:
NotFoundException- anactivityUnitIdis not foundNullArgumentException-activityUnitIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateActivityUnits
UpdateResponseList updateActivityUnits(ActivityUnitBatchFormList activityUnitForms) throws OperationFailedException, PermissionDeniedException Updates existing activity units. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
activityUnitForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-activityUnitFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllActivityUnits
DeleteResponseList deleteAllActivityUnits() throws OperationFailedException, PermissionDeniedExceptionDeletes allActivityUnitsin thisCourseCatalog.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteActivityUnits
DeleteResponseList deleteActivityUnits(IdList activityUnitIds) throws OperationFailedException, PermissionDeniedException Deletes activity units for the givenIds.- Parameters:
activityUnitIds- theIdsof the activity units to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-activityUnitIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteActivityUnitsForCourse
DeleteResponseList deleteActivityUnitsForCourse(Id courseId) throws OperationFailedException, PermissionDeniedException Deletes all activity units mapped to the given course.- Parameters:
courseId- anIdof a course- Returns:
- the delete responses
- Throws:
NullArgumentException-courseIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasActivityUnits
AliasResponseList aliasActivityUnits(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anActivityUnitfor the purpose of creating compatibility. The primaryIdof theActivityUnitis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another activity unit, it is reassigned to the given activity unitId.- 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.
-