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

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

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

The delete operations delete Terms. To unmap a Term from the current CourseCatalog, the TermCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the Term 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.
MethodcanCreateTerms
Description

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

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

Parametersosid.type.Type[]termRecordTypesarray of term record types
Returnboolean true if Term creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT termRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetTermFormForCreate
Description

Gets the term form for creating new terms. A new form should be requested for each create transaction.

Parametersosid.type.Type[]termRecordTypesarray of term record types
Returnosid.course.TermFormthe term form
ErrorsNULL_ARGUMENT termRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateTerm
Description

Creates a new Term.

Parametersosid.course.TermFormtermFormthe form for this Term
Returnosid.course.Termthe new Term
ErrorsILLEGAL_STATE termForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT termForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED termForm did not originate from getTermFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateTerms
Description

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

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

Parametersosid.id.IdtermIdthe Id of the Term
Returnosid.course.TermFormthe term form
ErrorsNOT_FOUND termId is not found
NULL_ARGUMENT termId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateTerm
Description

Updates an existing term.

Parametersosid.course.TermFormtermFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE termForm already used in anjupdate transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT termId or termForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED termForm did not originate from getTermFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteTerms
Description

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

Deletes a Term.

Parametersosid.id.IdtermIdthe Id of the Term to remove
ErrorsNOT_FOUND termId not found
NULL_ARGUMENT termId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageTermAliases
Description

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

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

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