OSID Logo
OSID Specifications
inventory package
Version 3.0.0
Release Candidate Preview
Interfaceosid.inventory.InventoryAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Inventories. To unmap an Inventory from the current Warehouse, the InventoryWarehouseAssignmentSession should be used. These delete operations attempt to remove the Inventory itself thus removing it from all known Warehouse catalogs.

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

MethodgetWarehouseId
Description

Gets the Warehouse Id associated with this session.

Returnosid.id.Idthe Warehouse Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetWarehouse
Description

Gets the Warehouse associated with this session.

Returnosid.inventory.Warehousethe warehouse
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateInventories
Description

Tests if this user can create Inventories. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Inventory will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if Inventory creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateInventoryWithRecordTypes
Description

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

Parametersosid.type.Type[]inventoryRecordTypesarray of inventory record types
Returnboolean true if Inventory creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT inventoryRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetInventoryFormForCreate
Description

Gets the inventory form for creating new inventories. A new form should be requested for each create transaction.

Parametersosid.id.IdstockIda stock Id
osid.type.Type[]inventoryRecordTypesarray of inventory record types
Returnosid.inventory.InventoryFormthe inventory form
ErrorsNOT_FOUND stockId is not found
NULL_ARGUMENT stockId or inventoryRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateInventory
Description

Creates a new Inventory.

Parametersosid.inventory.InventoryForminventoryFormthe form for this Inventory
Returnosid.inventory.Inventorythe new Inventory
ErrorsILLEGAL_STATE inventoryForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT inventoryForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED inventoryForm did not originate from getInventoryFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateInventories
Description

Tests if this user can update Inventories. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an Inventory will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returnboolean false if Inventory modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetInventoryFormForUpdate
Description

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

Parametersosid.id.IdinventoryIdthe Id of the Inventory
Returnosid.inventory.InventoryFormthe inventory form
ErrorsNOT_FOUND inventoryId is not found
NULL_ARGUMENT inventoryId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateInventory
Description

Updates an existing inventory.

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

Tests if this user can delete Inventories. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Inventory will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returnboolean false if Inventory deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanDeleteInventory
Description

Tests if this user can delete a specified Inventory. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting the Inventory will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer a delete operation to an unauthorized user for this inventory.

Parametersosid.id.IdinventoryIdthe Id of the Inventory
Returnboolean false if deletion of this Inventory is not authorized, true otherwise
ErrorsNULL_ARGUMENT inventoryId is null
CompliancemandatoryThis method must be implemented.
Provider Notes

If the inventoryId is not found, then it is acceptable to return false to indicate the lack of a delete available.

MethoddeleteInventory
Description

Deletes an Inventory.

Parametersosid.id.IdinventoryIdthe Id of the Inventory to remove
ErrorsNOT_FOUND inventoryId not found
NULL_ARGUMENT inventoryId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageInventoryAliases
Description

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

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

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