OSID Logo
OSID Specifications
ordering batch package
Version 3.1.0
Interfaceosid.ordering.batch.OrderItemBatchAdminSession
Implementsosid.ordering.OrderItemAdminSession
Used Byosid.ordering.batch.OrderingBatchManager
osid.ordering.batch.OrderingBatchProxyManager
Description

This session creates, updates, and deletes OrderItems in bulk. 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 OrderItem, an OrderItemForm is requested using getOrderItemFormsForCreate() specifying the desired order, product, and record Types or none if no record Types are needed. Each of the returned OrderItemForms will indicate that it is to be used with a create operation and can be used to examine metadata or validate data prior to creation. Once an OrderItemForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each OrderItemForm corresponds to an attempted transaction.

The OrderItemForms returned from getOrderItemFormsForCreate() may be linked to the originating request through the peer Ids of the OrderItemForm. In the case where there may be duplicates, any OrderItemForm of the same peer Ids may be used for a create operation.

Once a batch of OrderItemForms are submitted for create, a CreateResponse is returned for each OrderItemForm, although the ordering is not defined. Only errors that pertain to the entire create operation are returned from createOrderItems(), errors specific to an individual OrderItemForm are indicated in the corresponding CreateResponse . CreateResponses may be linked to the originating OrderItemForm through the OrderItemForm Id.

For updates, OrderItemForms are requested to the OrderItem Id that is to be updated using getOrderItemFormsForUpdate() where the reference Id in the OrderItemForm may be used to link the request. Similarly, the OrderItemForm has metadata about the data that can be updated and it can perform validation before submitting the update. The OrderItemForm can only be used once for a successful update and cannot be reused.

Once a batch of OrderItemForms are submitted for update, an UpdateResponse is returned for each OrderItemForm, although the ordering is not defined. Only errors that pertain to the entire update operation are returned from updateOrderItems(), errors specific to an individual OrderItemForm are indicated in the corresponding UpdateResponse . UpdateResponses may be linked to the originating OrderItemForm through the OrderItemForm Id.

The delete operations delete OrderItems in bulk. To unmap an OrderItem from the current Store, the OrderItemStoreAssignmentSession should be used. These delete operations attempt to remove the OrderItem itself thus removing it from all known Store catalogs. Bulk delete operations return the results in DeleteResponses.

Like all OsidSessions, OrderItemBatchAdminSessions are dedicated to single processing threads and a single authenticated user.

MethodgetOrderItemFormsForCreate
Description

Gets the order item forms for creating a bunch of new order items. An OrderItemForm is returned for each order and product pair.

Parametersosid.ordering.batch.OrderItemPeerListpeers the relationship peers
osid.type.Type[]orderItemRecordTypes array of order item record types to be included in each create operation or an empty list if none
Returnosid.ordering.batch.OrderItemBatchFormList the order item forms
ErrorsNOT_FOUND an orderId or productId is not found
NULL_ARGUMENT peers or orderItemRecordTypes is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED unable to request forms with given record types
Compliancemandatory This method must be implemented.
MethodcreateOrderItems
Description

Creates a new set of OrderItems. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in the BatchCreateResponse.

Parametersosid.ordering.batch.OrderItemBatchFormListorderItemForms the order item forms
Returnosid.transaction.batch.CreateResponseList the create responses
ErrorsNULL_ARGUMENT orderItemForms is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodgetOrderItemFormsForUpdate
Description

Gets the order item forms for updating an existing set of order items. A new order item form should be requested for each update transaction.

Parametersosid.id.IdListorderItemIds the Ids of the OrderItem
Returnosid.ordering.batch.OrderItemBatchFormList the order item form
ErrorsNOT_FOUND an orderItemId is not found
NULL_ARGUMENT orderItemIds is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdateOrderItems
Description

Updates existing order items. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in the BatchCreateResponse.

Parametersosid.ordering.batch.OrderItemBatchFormListorderItemForms the form containing the elements to be updated
Returnosid.transaction.batch.UpdateResponseList the update responses
ErrorsNULL_ARGUMENT orderItemForms is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteAllOrderItems
Description

Deletes all OrderItems in this Store.

Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteOrderItems
Description

Deletes order items for the given Ids.

Parametersosid.id.IdListorderItemIds the Ids of the order items to delete
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT orderItemIds is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteOrderItemsForProduct
Description

Deletes all order items for the given product.

Parametersosid.id.IdproductId an Id of a product
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT productId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteOrderItemsForOrder
Description

Deletes all order items for the given order.

Parametersosid.id.IdorderId an Id of an order
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT orderId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteIneffectiveOrderItemsByDate
Description

Deletes order items expired before the given date.

Parametersosid.calendaring.DateTimedate a date
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT date is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodaliasOrderItems
Description

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

Parametersosid.transaction.batch.AliasRequestListaliasRequests the alias requests
Returnosid.transaction.batch.AliasResponseList the alias responses
ErrorsNULL_ARGUMENT aliasRequests is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.