OSID Logo
OSID Specifications
ontology package
Version 3.0.0
Release Candidate Preview
Interfaceosid.ontology.SubjectAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Subjects. To unmap a Subject from the current Ontology, the SubjectOntologyAssignmentSession should be used. These delete operations attempt to remove the Subject itself thus removing it from all known Ontology catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodgetOntologyId
Description

Gets the Ontology Id associated with this session.

Returnosid.id.Idthe Ontology Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetOntology
Description

Gets the Ontology associated with this session.

Returnosid.ontology.Ontologythe Ontology associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateSubjects
Description

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

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

Parametersosid.type.Type[]subjectRecordTypesarray of subject record types
Returnboolean true if Subject creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT subjectRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetSubjectFormForCreate
Description

Gets the subject form for creating new subjects. A new form should be requested for each create transaction.

Parametersosid.type.Type[]subjectRecordTypesarray of subject record types
Returnosid.ontology.SubjectFormthe subject form
ErrorsNULL_ARGUMENT subjectRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateSubject
Description

Creates a new Subject.

Parametersosid.ontology.SubjectFormsubjectFormthe form for this Subject
Returnosid.ontology.Subjectthe new Subject
ErrorsILLEGAL_STATE subjectForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT subjectForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED subjectForm did not originate from getSubjectFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateSubjects
Description

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

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

Parametersosid.id.IdsubjectIdthe Id of the Subject
Returnosid.ontology.SubjectFormthe subject form
ErrorsNOT_FOUND subjectId is not found
NULL_ARGUMENT subjectId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateSubject
Description

Updates an existing subject.

Parametersosid.ontology.SubjectFormsubjectFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE subjectForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT subjectForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED subjectForm did not originate from getSubjectFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteSubjects
Description

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

Deletes the Subject identified by the given Id.

Parametersosid.id.IdsubjectIdthe Id of the Subject to delete
ErrorsNOT_FOUNDa Subject was not found identified by the given Id
NULL_ARGUMENT subjectId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageSubjectAliases
Description

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

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

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