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

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

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

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

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

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

The delete operations delete Prices in bulk. To unmap a Price from the current Store, the PriceStoreAssignmentSession should be used. These delete operations attempt to remove the Price itself thus removing it from all known Store catalogs. Bulk delete operations return the results in DeleteResponses.

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

MethodgetPriceFormsForCreate
Description

Gets the price forms for creating a bunch of new prices. A form is returned for each supplied price schedule.

Parametersosid.id.IdListpriceScheduleIds a list of price schedule Ids
osid.type.Type[]priceRecordTypes array of price record types to be included in each create operation or an empty list if none
Returnosid.ordering.batch.PriceBatchFormList the price forms
ErrorsNOT_FOUND a priceScheduleId is not found
NULL_ARGUMENT priceScheduleIds or priceRecordTypes 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.
MethodcreatePrices
Description

Creates a new set of Prices. 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.PriceBatchFormListpriceForms the price forms
Returnosid.transaction.batch.CreateResponseList the create responses
ErrorsNULL_ARGUMENT priceForms is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodgetPriceFormsForUpdate
Description

Gets the price forms for updating an existing set of prices. A new price form should be requested for each update transaction.

Parametersosid.id.IdListpriceIds the Ids of the Prices
Returnosid.ordering.batch.PriceBatchFormList the price forms
ErrorsNOT_FOUND a priceId is not found
NULL_ARGUMENT priceIds is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdatePrices
Description

Updates existing prices. 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.PriceBatchFormListpriceForms the forms containing the elements to be updated
Returnosid.transaction.batch.UpdateResponseList the update responses
ErrorsNULL_ARGUMENT priceForms is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteAllPrices
Description

Deletes all Prices 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.
MethoddeletePrices
Description

Deletes prices for the given Ids.

Parametersosid.id.IdListpriceIds the Ids of the price to delete
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT priceIds is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeletePricesForPriceSchedule
Description

Deletes prices for the given price schedule.

Parametersosid.id.IdpriceScheduleId the Id ofa price schedule
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT priceScheduleId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodaliasPrices
Description

Adds an Id to a Price for the purpose of creating compatibility. The primary Id of the Price is determined by the provider. The new Id is an alias to the primary Id. If the alias is a pointer to another price, it is reassigned to the given price 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.