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

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

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

The delete operations delete Orders. To unmap an Order from the current Store, the OrderStoreAssignmentSession should be used. These delete operations attempt to remove the Order 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.
MethodcanCreateOrders
Description

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

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

Parametersosid.type.Type[]orderRecordTypesarray of order record types
Returnboolean true if Order creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT orderRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetOrderFormForCreate
Description

Gets the order form for creating new entries. A new form should be requested for each create transaction.

Parametersosid.type.Type[]orderRecordTypesarray of order record types
Returnosid.ordering.OrderFormthe order form
ErrorsNULL_ARGUMENT orderRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateOrder
Description

Creates a new Order.

Parametersosid.ordering.OrderFormorderFormthe form for this Order
Returnosid.ordering.Orderthe new Order
ErrorsILLEGAL_STATE orderForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT orderForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED orderForm did not originate from getOrderFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateOrders
Description

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

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

Parametersosid.id.IdorderIdthe Id of the Order
Returnosid.ordering.OrderFormthe order form
ErrorsNOT_FOUND orderId is not found
NULL_ARGUMENT orderId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateOrder
Description

Updates an existing order.

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

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

Deletes an Order.

Parametersosid.id.IdorderIdthe Id of the Order to remove
ErrorsNOT_FOUND orderId not found
NULL_ARGUMENT orderId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageOrderAliases
Description

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

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

Parametersosid.id.IdorderIdthe Id of an Order
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND orderId not found
NULL_ARGUMENT orderId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.