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

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

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

The delete operations delete Relevancies. To unmap a Relevancy from the current Ontology, the RelevancyOntologyAssignmentSession should be used. These delete operations attempt to remove the Relevancy 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.
MethodcanCreateRelevancies
Description

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

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

Parametersosid.type.Type[]relevancyRecordTypesarray of relevancy record types
Returnboolean true if Relevancy creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT relevancyRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetRelevancyFormForCreate
Description

Gets the relevancy form for creating new relevancies. A new form should be requested for each create transaction.

Parametersosid.id.IdsubjectIdthe Id of the Subject
osid.id.Idida mapped Id
osid.type.Type[]relevancyRecordTypesarray of relevancy record types
Returnosid.ontology.RelevancyFormthe relevancy form
ErrorsNOT_FOUND subjectId is not found
NULL_ARGUMENT subjectId or id is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateRelevancy
Description

Creates a new Relevancy.

Parametersosid.ontology.RelevancyFormrelevancyFormthe form for this Relevancy
Returnosid.ontology.Relevancythe new Relevancy
ErrorsILLEGAL_STATE relevancyForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT relevancyForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED relevancyForm did not originate from getRelevancyFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateRelevancies
Description

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

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

Parametersosid.id.IdrelevancyIdthe Id of the Relevancy
Returnosid.ontology.RelevancyFormthe relevancy form
ErrorsNOT_FOUND relevancyId is not found
NULL_ARGUMENT relevancyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateRelevancy
Description

Updates an existing relevancy.

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

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

Deletes the Relevancy identified by the given Id.

Parametersosid.id.IdrelevancyIdthe Id of the Relevancy to delete
ErrorsNOT_FOUNDa Relevancy was not found identified by the given Id
NULL_ARGUMENT relevancyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageRelevancyAliases
Description

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

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

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