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

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

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

The delete operations delete Repositories. This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodcanCreateRepositories
Description

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

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

Parametersosid.type.Type[]repositoryRecordTypesarray of repository record types
Returnboolean true if Repository creation using the specified Types is supported, false otherwise
ErrorsNULL_ARGUMENT repositoryRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetRepositoryFormForCreate
Description

Gets the repository form for creating new repositories. A new form should be requested for each create transaction.

Parametersosid.type.Type[]repositoryRecordTypesarray of repository record types
Returnosid.repository.RepositoryFormthe repository form
ErrorsNULL_ARGUMENT repositoryRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateRepository
Description

Creates a new Repository.

Parametersosid.repository.RepositoryFormrepositoryFormthe form for this Repository
Returnosid.repository.Repositorythe new Repository
ErrorsILLEGAL_STATE repositoryForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT repositoryForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED repositoryForm did not originate from getRepositoryFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateRepositories
Description

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

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

Parametersosid.id.IdrepositoryIdthe Id of the Repository
Returnosid.repository.RepositoryFormthe repository form
ErrorsNOT_FOUND repositoryId is not found
NULL_ARGUMENT repositoryId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateRepository
Description

Updates an existing repository.

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

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

Deletes a Repository.

Parametersosid.id.IdrepositoryIdthe Id of the Repository to remove
ErrorsNOT_FOUND repositoryId not found
NULL_ARGUMENT repositoryId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageRepositoryAliases
Description

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

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

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