Interface ActivityAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ActivityBatchAdminSession
This session creates, updates, and deletes Activities . The
data for create and update is provided by the consumer via the form.
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
getActivityFormForCreate() specifying the desired activity unit, course
offering, term, and record Types or none if no record
Types are needed. The returned ActivityForm 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 the 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.
For updates, ActivityForms are requested to the
Activity Id that is to be updated using
getActivityFormForUpdate() . 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.
The delete operations delete ActivityForms . To unmap an
Activity from the current CourseCatalog , the
ActivityCourseCatalogAssignmentSession should be used. These delete
operations attempt to remove the ActivityForm itself thus removing
it from all known CourseCatalog catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier 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
-
getCourseCatalogId
Id getCourseCatalogId()Gets theCourseCatalogIdassociated with this session.- Returns:
- the
CourseCatalog Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCourseCatalog
Gets theCourseCatalogassociated with this session.- Returns:
- the course catalog
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateActivities
boolean canCreateActivities()Tests if this user can createActivities. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anActivitywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifActivitycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateActivityWithRecordTypes
Tests if this user can create a singleActivityusing the desired record types. WhileCourseManager.getActivityRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificActivity. Providing an empty array tests if anActivitycan be created with no records.- Parameters:
activityRecordTypes- array of activity record types- Returns:
trueifActivitycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-activityRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getActivityFormForCreate
ActivityForm getActivityFormForCreate(Id activityUnitId, Id courseOfferingId, Id termId, Type[] activityRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the activity form for creating new activities. A new form should be requested for each create transaction.- Parameters:
activityUnitId- an activity unitIdcourseOfferingId- a course offeringIdtermId- a termIdactivityRecordTypes- array of activity record types- Returns:
- the activity form
- Throws:
NotFoundException-activityUnitId, courseOfferingId, ortermIdis not foundNullArgumentException-activityUnitId, courseOfferingId, termId, oractivityRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createActivity
Activity createActivity(ActivityForm activityForm) throws OperationFailedException, PermissionDeniedException Creates a newActivity.- Parameters:
activityForm- the form for thisActivity- Returns:
- the new
Activity - Throws:
IllegalStateException-activityFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-activityFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-activityFormdid not originate fromgetActivityFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateActivities
boolean canUpdateActivities()Tests if this user can updateActivities. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anActivitywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifActivitymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getActivityFormForUpdate
ActivityForm getActivityFormForUpdate(Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the activity form for updating an existing activity. A new activity form should be requested for each update transaction.- Parameters:
activityId- theIdof theActivity- Returns:
- the activity form
- Throws:
NotFoundException-activityIdis not foundNullArgumentException-activityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateActivity
void updateActivity(ActivityForm activityForm) throws OperationFailedException, PermissionDeniedException Updates an existing activity.- Parameters:
activityForm- the form containing the elements to be updated- Throws:
IllegalStateException-activityFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-activityFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-activityFormdid not originate fromgetActivityFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteActivities
boolean canDeleteActivities()Tests if this user can deleteActivities. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anActivitywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifActivitydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteActivity
void deleteActivity(Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anActivity.- Parameters:
activityId- theIdof theActivityto remove- Throws:
NotFoundException-activityIdnot foundNullArgumentException-activityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageActivityAliases
boolean canManageActivityAliases()Tests if this user can manageIdaliases forActivities. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifActivityaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasActivity
void aliasActivity(Id activityId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anActivityfor the purpose of creating compatibility. The primaryIdof theActivityis deactivityined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another activity, it is reassigned to the given activityId.- Parameters:
activityId- theIdof anActivityaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-activityIdnot foundNullArgumentException-activityIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canScheduleActivities
boolean canScheduleActivities()Tests if this user can schedule actviities. A return of true does not guarantee successful authorization. A return of false indicates that it is known scheduling methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseif activity scheduling is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
addSchedule
void addSchedule(Id activityId, Id scheduleId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds a schedule to the activity.- Parameters:
activityId- an activityIdscheduleId- a scheduleId- Throws:
AlreadyExistsException- schedule is already part of activityNotFoundException-activityIdorscheduleIdis not foundNullArgumentException-activityIdorscheduleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
removeSchedule
void removeSchedule(Id activityId, Id scheduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes a schedule from a given activity.- Parameters:
activityId- an activityIdscheduleId- the scheduleId- Throws:
NotFoundException- schedule not part of activityNullArgumentException-activityIdorscheduleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
addMeetingTime
void addMeetingTime(Id activityId, DateTime time, Id locationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Adds a specific meeting time to the given activity.- Parameters:
activityId- an activityIdtime- a timelocationId- a locationId- Throws:
NotFoundException-activityIdorlocationIdis not foundNullArgumentException-activityId, time, or locationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
clearMeetingTimes
void clearMeetingTimes(Id activityId, DateTime from, DateTime to) throws NotFoundException, OperationFailedException, PermissionDeniedException Clears any specific meeting times between the given dates inclusive.- Parameters:
activityId- an activityIdfrom- start date inclusiveto- end date inclusive- Throws:
InvalidArgumentException-fromis greater thantoNotFoundException-activityIdis not foundNullArgumentException-activityId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
addBlackout
void addBlackout(Id activityId, DateTime from, DateTime to) throws NotFoundException, OperationFailedException, PermissionDeniedException Adds a blackout to the given activity that blocks events in the series.- Parameters:
activityId- an activityIdfrom- start date inclusiveto- end date inclusive- Throws:
InvalidArgumentException-fromis greater thantoNotFoundException-activityIdis not foundNullArgumentException-activityId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
clearBlackout
void clearBlackout(Id activityId, DateTime from, DateTime to) throws NotFoundException, OperationFailedException, PermissionDeniedException Clears any blackouts between the given dates inclusive.- Parameters:
activityId- an activityIdfrom- start date inclusiveto- end date inclusive- Throws:
InvalidArgumentException-fromis greater thantoNotFoundException-activityIdis not foundNullArgumentException-activityId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-