OSID Logo
OSID Specifications
repository package
Version 3.0.0
Release Candidate Preview
Interfaceosid.repository.CompositionAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Compositions. To unmap a Composition from the current Repository, the CompositionRepositoryAssignmentSession should be used. These delete operations attempt to remove the Bid itself thus removing it from all known Repository catalogs.

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

MethodgetRepositoryId
Description

Gets the Repository Id associated with this session.

Returnosid.id.Idthe Repository Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetRepository
Description

Gets the Repository associated with this session.

Returnosid.repository.Repositorythe Repository associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateCompositions
Description

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

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

Parametersosid.type.Type[]compositionRecordTypesarray of composition record types
Returnboolean true if Composition creation using the specified Types is supported, false otherwise
ErrorsNULL_ARGUMENT compositionRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetCompositionFormForCreate
Description

Gets the composition form for creating new compositions. A new form should be requested for each create transaction.

Parametersosid.type.Type[]compositionRecordTypesarray of composition record types
Returnosid.repository.CompositionFormthe composition form
ErrorsNULL_ARGUMENT compositionRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateComposition
Description

Creates a new Composition.

Parametersosid.repository.CompositionFormcomposiitonFormthe form for this Composition
Returnosid.repository.Compositionthe new Composition
ErrorsILLEGAL_STATE compositionForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT compositionForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED compositionForm did not originate from getCompositionFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateCompositions
Description

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

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

Parametersosid.id.IdcompositionIdthe Id of the Composition
Returnosid.repository.CompositionFormthe composition form
ErrorsNOT_FOUND compositionId is not found
NULL_ARGUMENT compositionId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateComposition
Description

Updates an existing composition.

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

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

Deletes a Composition.

Parametersosid.id.IdcompositionIdthe Id of the Composition to remove
ErrorsNOT_FOUND compositionId not found
NULL_ARGUMENT compositionId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteCompositionNode
Description

Deletes a Composition and all contained children.

Parametersosid.id.IdcompositionIdthe Id of the Composition to remove
ErrorsNOT_FOUND compositionId not found
NULL_ARGUMENT compositionId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodaddCompositionChild
Description

Adds a composition to a parent composition.

Parametersosid.id.IdcompositionIdthe Id of a parent Composition
osid.id.IdchildCompositionIdthe Id of a child Composition
ErrorsALREADY_EXISTS childCompositionId is already a child of compositionId
NOT_FOUND compositionId or childCompositionId is not found
NULL_ARGUMENT compositionId or childCompositionId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodremoveCompositionChild
Description

Removes a composition from a parent composition.

Parametersosid.id.IdcompositionIdthe Id of a parent Composition
osid.id.IdchildCompositionIdthe Id of a child Composition
ErrorsNOT_FOUND compositionId or childCompositionId is not found or not related
NULL_ARGUMENT compositionId or childCompositionId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageCompositionAliases
Description

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

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

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