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

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

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

The delete operations delete Results. To unmap an Result from the current Catalogue, the ResultCatalogueAssignmentSession should be used. These delete operations attempt to remove the Result 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.
MethodcanCreateResults
Description

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

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

Parametersosid.type.Type[]resultRecordTypesarray of result record types
Returnboolean true if Result creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT resultRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetResultFormForCreate
Description

Gets the result form for creating new results. A new form should be requested for each create transaction.

Parametersosid.id.IdcanonicalUnitIdthe canonical unit Id
osid.id.IdparticpantIdthe particpant Id
osid.type.Type[]resultRecordTypesarray of result record types to be included in the create operation or an empty list if none
Returnosid.offering.ResultFormthe result form
ErrorsNOT_FOUND canonicalUnitId or particpantId is not found
NULL_ARGUMENT canonicalUnitId, particpantId, or resultRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDcannot get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateResult
Description

Creates a new Result.

Parametersosid.offering.ResultFormresultFormthe form for this Result
Returnosid.offering.Resultthe new Result
ErrorsILLEGAL_STATE resultForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT resultForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED resultForm did not originate from getResultFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateResults
Description

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

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

Parametersosid.id.IdresultIdthe Id of the Result
Returnosid.offering.ResultFormthe result form
ErrorsNOT_FOUND resultId is not found
NULL_ARGUMENT resultId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateResult
Description

Updates an existing result.

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

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

Deletes an Result.

Parametersosid.id.IdresultIdthe Id of the Result to remove
ErrorsNOT_FOUND resultId not found
NULL_ARGUMENT resultId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageResultAliases
Description

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

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

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