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

This session creates, updates, and deletes ActivityUnit. 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 getActivityUnitFormForCreate() specifying the desired course and record Types or none if no record Types are needed. The returned ActivityUnitForm 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 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.

For updates, ActivityUnitForms are requested to the ActivityUnit Id that is to be updated using getActivityUnitFormForUpdate(). 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.

The delete operations delete ActivityUnits. 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.

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.
MethodcanCreateActivityUnits
Description

Tests if this user can create ActivityUnits. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an ActivityUnit 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 ActivityUnit creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateActivityUnitWithRecordTypes
Description

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

Parametersosid.type.Type[]activityUnitRecordTypesarray of activity unit record types
Returnboolean true if ActivityUnit creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT activityUnitRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetActivityUnitFormForCreate
Description

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

Parametersosid.id.IdcourseIdthe course Id
osid.type.Type[]activityUnitRecordTypesarray of activity unit record types
Returnosid.course.ActivityUnitFormthe activity unit form
ErrorsNOT_FOUND courseId is not found
NULL_ARGUMENT courseId or activityUnitRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateActivityUnit
Description

Creates a new ActivityUnit.

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

Tests if this user can update ActivityUnits. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an ActivityUnit 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 ActivityUnit modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetActivityUnitFormForUpdate
Description

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

Parametersosid.id.IdactivityUnitIdthe Id of the ActivityUnit
Returnosid.course.ActivityUnitFormthe activity unit form
ErrorsNOT_FOUND activityUnitId is not found
NULL_ARGUMENT activityUnitId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateActivityUnit
Description

Updates an existing activity unit.

Parametersosid.course.ActivityUnitFormactivityUnitFormthe 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 courseForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED activityUnitForm did not originate from getActivityUnitFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteActivityUnits
Description

Tests if this user can delete ActivityUnits. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an ActivityUnit 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 ActivityUnit deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteActivityUnit
Description

Deletes an ActivityUnit.

Parametersosid.id.IdactivityUnitIdthe Id of the ActivityUnit to remove
ErrorsNOT_FOUND activityUnitId not found
NULL_ARGUMENT activityUnitId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageActivityUnitAliases
Description

Tests if this user can manage Id aliases for ActivityUnits. 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 ActivityUnit aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasActivityUnit
Description

Adds an Id to an ActivityUnit for the purpose of creating compatibility. The primary Id of the ActivityUnit 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 unit, it is reassigned to the given activity unit Id.

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