OSID Logo
OSID Specifications
ordering package
Version 3.0.0
Release Candidate Preview
Interfaceosid.ordering.StoreAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Stores.

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

MethodcanCreateStores
Description

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

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

Parametersosid.type.Type[]storeRecordTypesarray of store record types
Returnboolean true if Store creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT storeRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetStoreFormForCreate
Description

Gets the store form for creating new stores. A new form should be requested for each create transaction.

Parametersosid.type.Type[]storeRecordTypesarray of store record types
Returnosid.ordering.StoreFormthe store form
ErrorsNULL_ARGUMENT storeRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateStore
Description

Creates a new Store.

Parametersosid.ordering.StoreFormstoreFormthe form for this Store
Returnosid.ordering.Storethe new Store
ErrorsILLEGAL_STATE storeForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT storeForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED storeForm did not originate from getStoreFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateStores
Description

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

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

Parametersosid.id.IdstoreIdthe Id of the Store
Returnosid.ordering.StoreFormthe store form
ErrorsNULL_ARGUMENT storeId is null
CompliancemandatoryThis method must be implemented.
MethodupdateStore
Description

Updates an existing store.

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

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

Deletes a Store.

Parametersosid.id.IdstoreIdthe Id of the Store to remove
ErrorsNOT_FOUND storeId not found
NULL_ARGUMENT storeId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageStoreAliases
Description

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

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

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