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

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

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

The delete operations delete Lessons. To unmap a Lesson from the current CourseCatalog, the LessonCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the Lesson 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.
MethodcanCreateLessons
Description

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

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

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

Parametersosid.type.Type[]lessonRecordTypesarray of lesson record types
Returnboolean true if Lesson creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT lessonRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetLessonFormForCreate
Description

Gets the lesson form for creating new lessons. A new form should be requested for each create transaction.

Parametersosid.id.IdplanIda plan Id
osid.id.IddocetIda docet Id
osid.type.Type[]lessonRecordTypesarray of lesson record types
Returnosid.course.plan.LessonFormthe lesson form
ErrorsNOT_FOUND planId or docetId is not found
NULL_ARGUMENT planId, docetId or lessonRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateLesson
Description

Creates a new Lesson.

Parametersosid.course.plan.LessonFormlessonFormthe form for this Lesson
Returnosid.course.plan.Lessonthe new Lesson
ErrorsILLEGAL_STATE lessonForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT lessonForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED lessonForm did not originate from getLessonFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateLessons
Description

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

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

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

Parametersosid.id.IdlessonIdthe Id of the Lesson
Returnosid.course.plan.LessonFormthe lesson form
ErrorsNOT_FOUND lessonId is not found
NULL_ARGUMENT lessonId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateLesson
Description

Updates an existing lesson.

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

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

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

Deletes a Lesson.

Parametersosid.id.IdlessonIdthe Id of the Lesson to remove
ErrorsNOT_FOUND lessonId not found
NULL_ARGUMENT lessonId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageLessonAliases
Description

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

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

Parametersosid.id.IdlessonIdthe Id of a Lesson
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND lessonId not found
NULL_ARGUMENT lessonId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.