Interface ActivityBatchAdminSession
- All Superinterfaces:
ActivityAdminSession, AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Activities 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
Activity , an ActivityForm is requested using
getActivityFormsForCreate() specifying the desired activity,
courseoffering, term, record Types or none if no record
Types are needed. Each of the returned ActivityForms 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
ActivityForm is submiited to a create operation, it cannot be reused with
another create operation unless the first operation was unsuccessful. Each
ActivityForm corresponds to an attempted transaction.
The ActivityForms returned from
getActivityFormsForCreate() may be linked to the originating request
through the peer Ids of the ActivityForm . In the case
where there may be duplicates, any ActivityForm of the same peer
Ids may be used for a create operation.
Once a batch of ActivityForms are submitted for create, a
CreateResponse is returned for each ActivityForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createActivities() ,
errors specific to an individual ActivityForm are indicated in the
corresponding CreateResponse . CreateResponses may be
linked to the originating ActivityForm through the
ActivityForm Id .
For updates, ActivityForms are requested to the
Activity Id that is to be updated using
getActivityFormsForUpdate() where the reference Id in the
ActivityForm may be used to link the request. Similarly, the
ActivityForm has metadata about the data that can be updated and it can
perform validation before submitting the update. The ActivityForm
can only be used once for a successful update and cannot be reused.
Once a batch of ActivityForms are submitted for update, an
UpdateResponse is returned for each ActivityForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateActivities() ,
errors specific to an individual ActivityForm are indicated in the
corresponding UpdateResponse . UpdateResponses may be
linked to the originating ActivityForm through the
ActivityForm Id .
The delete operations delete Activities in bulk. To unmap an
Activity from the current CourseCatalog , the
ActivityCourseCatalogAssignmentSession should be used. These delete
operations attempt to remove the Activity itself thus removing it
from all known CourseCatalog catalogs. Bulk delete operations
return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasActivities(AliasRequestList aliasRequests) Adds anIdto anActivityfor the purpose of creating compatibility.createActivities(ActivityBatchFormList activityForms) Creates a new set ofActivities.deleteActivities(IdList activityIds) Deletes activities for the givenIds.deleteActivitiesForActivityUnit(Id activityUnitId) Deletes activities for the given activity unit.deleteActivitiesForActivityUnitAndTerm(Id activityUnitId, Id termId) Deletes activities related to the given activity unit and termdeleteActivitiesForCourseOffering(Id courseOfferingId) Deletes activities related to the given course offering.deleteActivitiesForTerm(Id termId) Deletes activities for the given term.Deletes allActivitiesin thisCourseCatalog.Deletes activities ineffective before the given date.getActivityFormsForCreate(ActivityPeerList peers, Type[] activityRecordTypes) Gets the activity forms for creating a bunch of new activities.getActivityFormsForUpdate(IdList activityIds) Gets the activity forms for updating an existing set of activities.updateActivities(ActivityBatchFormList activityForms) Updates existing activities.Methods inherited from interface ActivityAdminSession
addBlackout, addMeetingTime, addSchedule, aliasActivity, canCreateActivities, canCreateActivityWithRecordTypes, canDeleteActivities, canManageActivityAliases, canScheduleActivities, canUpdateActivities, clearBlackout, clearMeetingTimes, createActivity, deleteActivity, getActivityFormForCreate, getActivityFormForUpdate, getCourseCatalog, getCourseCatalogId, removeSchedule, updateActivityModifier and TypeMethodDescriptionvoidaddBlackout(Id activityId, DateTime from, DateTime to) Adds a blackout to the given activity that blocks events in the series.voidaddMeetingTime(Id activityId, DateTime time, Id locationId) Adds a specific meeting time to the given activity.voidaddSchedule(Id activityId, Id scheduleId) Adds a schedule to the activity.voidaliasActivity(Id activityId, Id aliasId) Adds anIdto anActivityfor the purpose of creating compatibility.booleanTests if this user can createActivities.booleancanCreateActivityWithRecordTypes(Type[] activityRecordTypes) Tests if this user can create a singleActivityusing the desired record types.booleanTests if this user can deleteActivities.booleanTests if this user can manageIdaliases forActivities.booleanTests if this user can schedule actviities.booleanTests if this user can updateActivities.voidclearBlackout(Id activityId, DateTime from, DateTime to) Clears any blackouts between the given dates inclusive.voidclearMeetingTimes(Id activityId, DateTime from, DateTime to) Clears any specific meeting times between the given dates inclusive.createActivity(ActivityForm activityForm) Creates a newActivity.voiddeleteActivity(Id activityId) Deletes anActivity.getActivityFormForCreate(Id activityUnitId, Id courseOfferingId, Id termId, Type[] activityRecordTypes) Gets the activity form for creating new activities.getActivityFormForUpdate(Id activityId) Gets the activity form for updating an existing activity.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.voidremoveSchedule(Id activityId, Id scheduleId) Removes a schedule from a given activity.voidupdateActivity(ActivityForm activityForm) Updates an existing activity.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
-
getActivityFormsForCreate
ActivityBatchFormList getActivityFormsForCreate(ActivityPeerList peers, Type[] activityRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the activity forms for creating a bunch of new activities. A form is returned for each canonical activity unit and term pair.- Parameters:
peers- the relationship peersactivityRecordTypes- array of activity record types to be included in each create operation or an empty list if none- Returns:
- the activity forms
- Throws:
NotFoundException- anactivityUnitId, courseId,ortermIdis not foundNullArgumentException-peersoractivityRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createActivities
CreateResponseList createActivities(ActivityBatchFormList activityForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofActivities. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
activityForms- the activity forms- Returns:
- the create responses
- Throws:
NullArgumentException-activityFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getActivityFormsForUpdate
ActivityBatchFormList getActivityFormsForUpdate(IdList activityIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the activity forms for updating an existing set of activities. A new activity form should be requested for each update transaction.- Parameters:
activityIds- theIdsof theActivity- Returns:
- the activity form
- Throws:
NotFoundException- anactivityIdis not foundNullArgumentException-activityIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateActivities
UpdateResponseList updateActivities(ActivityBatchFormList activityForms) throws OperationFailedException, PermissionDeniedException Updates existing activities. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
activityForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-activityFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllActivities
Deletes allActivitiesin thisCourseCatalog.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteActivities
DeleteResponseList deleteActivities(IdList activityIds) throws OperationFailedException, PermissionDeniedException Deletes activities for the givenIds.- Parameters:
activityIds- theIdsof the activities to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-activityIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteActivitiesForActivityUnit
DeleteResponseList deleteActivitiesForActivityUnit(Id activityUnitId) throws OperationFailedException, PermissionDeniedException Deletes activities for the given activity unit.- Parameters:
activityUnitId- anIdof an activity unit- Returns:
- the delete responses
- Throws:
NullArgumentException-activityUnitIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteActivitiesForActivityUnitAndTerm
DeleteResponseList deleteActivitiesForActivityUnitAndTerm(Id activityUnitId, Id termId) throws OperationFailedException, PermissionDeniedException Deletes activities related to the given activity unit and term- Parameters:
activityUnitId- anIdof an activity unittermId- anIdof a term- Returns:
- the delete responses
- Throws:
NullArgumentException-activityUnitIdortermIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteActivitiesForTerm
DeleteResponseList deleteActivitiesForTerm(Id termId) throws OperationFailedException, PermissionDeniedException Deletes activities for the given term.- Parameters:
termId- anIdof a term- Returns:
- the delete responses
- Throws:
NullArgumentException-termIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteActivitiesForCourseOffering
DeleteResponseList deleteActivitiesForCourseOffering(Id courseOfferingId) throws OperationFailedException, PermissionDeniedException Deletes activities related to the given course offering.- Parameters:
courseOfferingId- anIdof a courseOffering- Returns:
- the delete responses
- Throws:
NullArgumentException-courseOfferingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveActivitiesByDate
DeleteResponseList deleteIneffectiveActivitiesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes activities ineffective 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.
-
aliasActivities
AliasResponseList aliasActivities(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anActivityfor the purpose of creating compatibility. The primaryIdof theActivityis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another activity, it is reassigned to the given activityId.- 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.
-