OSID Logo
OSID Specifications
offering package
Version 3.0.0
Release Candidate Preview
Interfaceosid.offering.CanonicalUnitAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete CanonicalUnits. To unmap a CanonicalUnit from the current Catalogue, the CanonicalUnitCatalogueAssignmentSession should be used. These delete operations attempt to remove the CanonicalUnit itself thus removing it from all known Catalogue catalogs.

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

MethodgetCatalogueId
Description

Gets the Catalogue Id associated with this session.

Returnosid.id.Idthe Catalogue Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetCatalogue
Description

Gets the Catalogue associated with this session.

Returnosid.offering.Cataloguethe catalogue
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateCanonicalUnits
Description

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

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

Parametersosid.type.Type[]canonicalUnitRecordTypesarray of canonical unit record types
Returnboolean true if CanonicalUnit creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT canonicalUnitRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetCanonicalUnitFormForCreate
Description

Gets the canonical unit form for creating new canonical units. A new form should be requested for each create transaction.

Parametersosid.type.Type[]canonicalUnitRecordTypesarray of canonical unit record types to be included in the create operation or an empty list if none
Returnosid.offering.CanonicalUnitFormthe canonical unit form
ErrorsNULL_ARGUMENT canonicalUnitRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDcannot get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateCanonicalUnit
Description

Creates a new CanonicalUnit.

Parametersosid.offering.CanonicalUnitFormcanonicalUnitFormthe form for this CanonicalUnit
Returnosid.offering.CanonicalUnitthe new CanonicalUnit
ErrorsILLEGAL_STATE canonicalUnitForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT canonicalUnitForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED canonicalUnitForm did not originate from getCanonicalUnitFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateCanonicalUnits
Description

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

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

Parametersosid.id.IdcanonicalUnitIdthe Id of the CanonicalUnit
Returnosid.offering.CanonicalUnitFormthe canonical unit form
ErrorsNOT_FOUND canonicalUnitId is not found
NULL_ARGUMENT canonicalUnitId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateCanonicalUnit
Description

Updates an existing canonical unit.

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

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

Deletes a CanonicalUnit.

Parametersosid.id.IdcanonicalUnitIdthe Id of the CanonicalUnit to remove
ErrorsNOT_FOUND canonicalUnitId not found
NULL_ARGUMENT canonicalUnitId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageCanonicalUnitAliases
Description

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

Adds an Id to a CanonicalUnit for the purpose of creating compatibility. The primary Id of the CanonicalUnit is determined by the provider. The new Id is an alias to the primary Id. If the alias is a pointer to another canonical unit, it is reassigned to the given canonical unit Id.

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