OSID Logo
OSID Specifications
recipe batch package
Version 3.1.0
Interfaceosid.recipe.batch.DirectionBatchAdminSession
Implementsosid.recipe.DirectionAdminSession
Used Byosid.recipe.batch.RecipeBatchManager
osid.recipe.batch.RecipeBatchProxyManager
Description

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

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

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

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

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

The delete operations delete Directions in bulk. To unmap a Direction from the current Cookbook, the DirectionCookbookAssignmentSession should be used. These delete operations attempt to remove the Direction itself thus removing it from all known Cookbook catalogs. Bulk delete operations return the results in DeleteResponses.

MethodgetDirectionFormsForCreate
Description

Gets the direction forms for creating a bunch of new directions. A form is returned for each supplied recipe.

Parametersosid.id.IdListrecipeIds a list of recipe Ids
osid.type.Type[]directionRecordTypes array of direction record types to be included in each create operation or an empty list if none
Returnosid.recipe.batch.DirectionBatchFormList the direction forms
ErrorsNOT_FOUND a recipeId is not found
NULL_ARGUMENT recipeIds or directionRecordTypes 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.
MethodcreateDirections
Description

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

Parametersosid.recipe.batch.DirectionBatchFormListdirectionForms the direction forms
Returnosid.transaction.batch.CreateResponseList the create responses
ErrorsNULL_ARGUMENT directionForms is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodgetDirectionFormsForUpdate
Description

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

Parametersosid.id.IdListdirectionIds the Ids of the Directions
Returnosid.recipe.batch.DirectionBatchFormList the direction forms
ErrorsNOT_FOUND a directionId is not found
NULL_ARGUMENT directionIds is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdateDirections
Description

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

Parametersosid.recipe.batch.DirectionBatchFormListdirectionForms the form containing the elements to be updated
Returnosid.transaction.batch.UpdateResponseList the update responses
ErrorsNULL_ARGUMENT directionForms is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteAllDirections
Description

Deletes all Directions in this Cookbook.

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

Deletes directions for the given Ids.

Parametersosid.id.IdListdirectionIds the Ids of the directions to delete
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT directionIds is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteDirectionsForRecipe
Description

Deletes directions for the given recipe.

Parametersosid.id.IdrecipeId the Id of a recipe
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT recipeId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodaliasDirections
Description

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

Gets the ingredient forms for creating a bunch of new ingredients. A form is returned for each supplied recipe.

Parametersosid.id.IdListdirectionIds a list of direction Ids
osid.type.Type[]ingredientRecordTypes array of ingredient record types to be included in each create operation or an empty list if none
Returnosid.recipe.batch.IngredientBatchFormList the ingredient forms
ErrorsNOT_FOUND a directionId is not found
NULL_ARGUMENT directionIds or ingredientRecordTypes 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.
MethodcreateIngredients
Description

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

Parametersosid.recipe.batch.IngredientBatchFormListingredientForms the ingredient forms
Returnosid.transaction.batch.CreateResponseList the create responses
ErrorsNULL_ARGUMENT ingredientForms is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodgetIngredientFormsForUpdate
Description

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

Parametersosid.id.IdListingredientIds the Ids of the Ingredients
Returnosid.recipe.batch.IngredientBatchFormList the ingredient forms
ErrorsNOT_FOUND an ingredientId is not found
NULL_ARGUMENT ingredientIds is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdateIngredients
Description

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

Parametersosid.recipe.batch.IngredientBatchFormListingredientForms the form containing the elements to be updated
Returnosid.transaction.batch.UpdateResponseList the update responses
ErrorsNULL_ARGUMENT ingredientForms is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteAllIngredients
Description

Deletes all Ingredients in this Cookbook.

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

Deletes ingredients for the given Ids.

Parametersosid.id.IdListingredientsIds the Ids of the ingredients to delete
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT ingredientIds is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteIngredientsForDirection
Description

Deletes ingredients for the given direction.

Parametersosid.id.IddirectionId the Id of a direction
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT directionId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.