OSID Logo
OSID Specifications
course package
Version 3.0.0
Release Candidate Preview
Interfaceosid.course.ActivityAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes Activities. 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 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.

MethodgetCourseCatalogId
Description

Gets the CourseCatalog Id associated with this session.

Returnosid.id.Idthe CourseCatalog Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetCourseCatalog
Description

Gets the CourseCatalog associated with this session.

Returnosid.course.CourseCatalogthe course catalog
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateActivities
Description

Tests if this user can create Activities. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Activity will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if Activity creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateActivityWithRecordTypes
Description

Tests if this user can create a single Activity using the desired record types. While CourseManager.getActivityRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Activity. Providing an empty array tests if an Activity can be created with no records.

Parametersosid.type.Type[]activityRecordTypesarray of activity record types
Returnboolean true if Activity creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT activityRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetActivityFormForCreate
Description

Gets the activity form for creating new activities. A new form should be requested for each create transaction.

Parametersosid.id.IdactivityUnitIdan activity unit Id
osid.id.IdcourseOfferingIda course offering Id
osid.id.IdtermIda term Id
osid.type.Type[]activityRecordTypesarray of activity record types
Returnosid.course.ActivityFormthe activity form
ErrorsNOT_FOUND activityUnitId, courseOfferingId, or termId is not found
NULL_ARGUMENT activityUnitId, courseOfferingId, termId , or activityRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateActivity
Description

Creates a new Activity.

Parametersosid.course.ActivityFormactivityFormthe form for this Activity
Returnosid.course.Activitythe new Activity
ErrorsILLEGAL_STATE activityForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT activityForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED activityForm did not originate from getActivityFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateActivities
Description

Tests if this user can update Activities. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an Activity will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returnboolean false if Activity modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetActivityFormForUpdate
Description

Gets the activity form for updating an existing activity. A new activity form should be requested for each update transaction.

Parametersosid.id.IdactivityIdthe Id of the Activity
Returnosid.course.ActivityFormthe activity form
ErrorsNOT_FOUND activityId is not found
NULL_ARGUMENT activityId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateActivity
Description

Updates an existing activity.

Parametersosid.course.ActivityFormactivityFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE activityForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT activityForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED activityForm did not originate from getActivityFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteActivities
Description

Tests if this user can delete Activities. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Activity will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returnboolean false if Activity deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteActivity
Description

Deletes an Activity.

Parametersosid.id.IdactivityIdthe Id of the Activity to remove
ErrorsNOT_FOUND activityId not found
NULL_ARGUMENT activityId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageActivityAliases
Description

Tests if this user can manage Id aliases for Activities. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.

Returnboolean false if Activity aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasActivity
Description

Adds an Id to an Activity for the purpose of creating compatibility. The primary Id of the Activity is deactivityined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another activity, it is reassigned to the given activity Id.

Parametersosid.id.IdactivityIdthe Id of an Activity
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is in use as a primary Id
NOT_FOUND activityId not found
NULL_ARGUMENT activityId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanScheduleActivities
Description

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 a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if activity scheduling is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaddSchedule
Description

Adds a schedule to the activity.

Parametersosid.id.IdactivityIdan activity Id
osid.id.IdscheduleIda schedule Id
ErrorsALREADY_EXISTSschedule is already part of activity
NOT_FOUND activityId or scheduleId is not found
NULL_ARGUMENT activityId or scheduleId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodremoveSchedule
Description

Removes a schedule from a given activity.

Parametersosid.id.IdactivityIdan activity Id
osid.id.IdscheduleIdthe schedule Id
ErrorsNOT_FOUNDschedule not part of activity
NULL_ARGUMENT activityId or scheduleId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodaddMeetingTime
Description

Adds a specific meeting time to the given activity.

Parametersosid.id.IdactivityIdan activity Id
osid.calendaring.DateTimetimea time
osid.id.IdlocationIda location Id
ErrorsNOT_FOUND activityId or locationId is not found
NULL_ARGUMENT activityId, time, or locationId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodclearMeetingTimes
Description

Clears any specific meeting times between the given dates inclusive.

Parametersosid.id.IdactivityIdan activity Id
osid.calendaring.DateTimefromstart date inclusive
osid.calendaring.DateTimetoend date inclusive
ErrorsINVALID_ARGUMENT from is greater than to
NOT_FOUND activityId is not found
NULL_ARGUMENT activityId, from or to is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodaddBlackout
Description

Adds a blackout to the given activity that blocks events in the series.

Parametersosid.id.IdactivityIdan activity Id
osid.calendaring.DateTimefromstart date inclusive
osid.calendaring.DateTimetoend date inclusive
ErrorsINVALID_ARGUMENT from is greater than to
NOT_FOUND activityId is not found
NULL_ARGUMENT activityId, from or to is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodclearBlackout
Description

Clears any blackouts between the given dates inclusive.

Parametersosid.id.IdactivityIdan activity Id
osid.calendaring.DateTimefromstart date inclusive
osid.calendaring.DateTimetoend date inclusive
ErrorsINVALID_ARGUMENT from is greater than to
NOT_FOUND activityId is not found
NULL_ARGUMENT activityId, from or to is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.