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

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

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

The delete operations delete Products. To unmap a Product from the current Store, the ProductStoreAssignmentSession should be used. These delete operations attempt to remove the Product itself thus removing it from all known Store catalogs.

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

MethodgetStoreId
Description

Gets the Store Id associated with this session.

Returnosid.id.Idthe Store Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetStore
Description

Gets the Store associated with this session.

Returnosid.ordering.Storethe store
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateProducts
Description

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

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

Parametersosid.type.Type[]productRecordTypesarray of product record types
Returnboolean true if Product creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT productRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetProductFormForCreate
Description

Gets the product form for creating new products. A new form should be requested for each create transaction.

Parametersosid.type.Type[]productRecordTypesarray of product record types
Returnosid.ordering.ProductFormthe product form
ErrorsNULL_ARGUMENT productRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateProduct
Description

Creates a new Product.

Parametersosid.ordering.ProductFormproductFormthe form for this Product
Returnosid.ordering.Productthe new Product
ErrorsILLEGAL_STATE productForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT productForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED productForm did not originate from getProductFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateProducts
Description

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

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

Parametersosid.id.IdproductIdthe Id of the Product
Returnosid.ordering.ProductFormthe product form
ErrorsNULL_ARGUMENT productId is null
CompliancemandatoryThis method must be implemented.
MethodupdateProduct
Description

Updates an existing product.

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

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

Deletes a Product.

Parametersosid.id.IdproductIdthe Id of the Product to remove
ErrorsNOT_FOUND productId not found
NULL_ARGUMENT productId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageProductAliases
Description

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

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

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