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

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

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

The delete operations delete Programs. To unmap a Program from the current CourseCatalog, the ProgramCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the Program 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.
MethodcanCreatePrograms
Description

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

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

Parametersosid.type.Type[]programRecordTypesarray of program record types
Returnboolean true if Program creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT programRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetProgramFormForCreate
Description

Gets the program form for creating new programs. A new form should be requested for each create transaction.

Parametersosid.type.Type[]programRecordTypesarray of program record types
Returnosid.course.program.ProgramFormthe program form
ErrorsNULL_ARGUMENT programRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateProgram
Description

Creates a new Program.

Parametersosid.course.program.ProgramFormprogramFormthe form for this Program
Returnosid.course.program.Programthe new Program
ErrorsILLEGAL_STATE programForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT programForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED programForm did not originate from getProgramFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdatePrograms
Description

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

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

Parametersosid.id.IdprogramIdthe Id of the Program
Returnosid.course.program.ProgramFormthe program form
ErrorsNOT_FOUND programId is not found
NULL_ARGUMENT programId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateProgram
Description

Updates an existing program.

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

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

Deletes a Program.

Parametersosid.id.IdprogramIdthe Id of the Program to remove
ErrorsNOT_FOUND programId not found
NULL_ARGUMENT programId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageProgramAliases
Description

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

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

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