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

This session creates, updates, and deletes Courses. 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 a Course, a CourseForm is requested using getCourseFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned CourseForm 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 CourseForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each CourseForm corresponds to an attempted transaction.

For updates, CourseForms are requested to the Course Id that is to be updated using getCourseFormForUpdate(). Similarly, the CourseForm has metadata about the data that can be updated and it can perform validation before submitting the update. The CourseForm can only be used once for a successful update and cannot be reused.

The delete operations delete Courses. To unmap a Course from the current CourseCatalog, the CourseCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the Course 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.
MethodcanCreateCourses
Description

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

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

Parametersosid.type.Type[]courseRecordTypesarray of course record types
Returnboolean true if Course creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT courseRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetCourseFormForCreate
Description

Gets the course form for creating new courses. A new form should be requested for each create transaction.

Parametersosid.type.Type[]courseRecordTypesarray of course record types
Returnosid.course.CourseFormthe course form
ErrorsNULL_ARGUMENT courseRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateCourse
Description

Creates a new Course.

Parametersosid.course.CourseFormcourseFormthe form for this Course
Returnosid.course.Coursethe new Course
ErrorsILLEGAL_STATE courseForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT courseForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED courseForm did not originate from getCourseFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateCourses
Description

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

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

Parametersosid.id.IdcourseIdthe Id of the Course
Returnosid.course.CourseFormthe course form
ErrorsNOT_FOUND courseId is not found
NULL_ARGUMENT courseId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateCourse
Description

Updates an existing course.

Parametersosid.course.CourseFormcourseFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE courseForm 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 courseForm did not originate from getCourseFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteCourses
Description

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

Deletes a Course.

Parametersosid.id.IdcourseIdthe Id of the Course to remove
ErrorsNOT_FOUND courseId not found
NULL_ARGUMENT courseId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageCourseAliases
Description

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

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

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