OSID Logo
OSID Specifications
recipe batch package
Version 3.0.0
Release Candidate Preview
Interfaceosid.recipe.batch.DirectionBatchAdminSession
Implementsosid.recipe.DirectionAdminSession
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.IdListrecipieIdsa list of recipe Ids
osid.type.Type[]directionRecordTypesarray of direction record types to be included in each create operation or an empty list if none
Returnosid.recipe.batch.DirectionBatchFormListthe direction forms
ErrorsNOT_FOUNDa recipieId is not found
NULL_ARGUMENT recipeIds or directionRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to request forms with given record types
CompliancemandatoryThis 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.DirectionBatchFormListdirectionFormsthe direction forms
Returnosid.transaction.batch.CreateResponseListthe create responses
ErrorsNULL_ARGUMENT directionForms is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.IdListdirectionIdsthe Ids of the Directions
Returnosid.recipe.batch.DirectionBatchFormListthe direction forms
ErrorsNOT_FOUNDa directionId is not found
NULL_ARGUMENT directionIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.DirectionBatchFormListdirectionFormsthe form containing the elements to be updated
Returnosid.transaction.batch.UpdateResponseListthe update responses
ErrorsNULL_ARGUMENT directionForms is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteAllDirections
Description

Deletes all Directions in this Cookbook .

Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteDirections
Description

Deletes directions for the given Ids.

Parametersosid.id.IdListdirectionIdsthe Ids of the directions to delete
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT directionIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteDirectionsForRecipe
Description

Deletes directions for the given recipe.

Parametersosid.id.IdrecipeIdthe Id of a recipe
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT recipeId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.AliasRequestListaliasRequeststhe alias requests
Returnosid.transaction.batch.AliasResponseListthe alias responses
ErrorsNULL_ARGUMENT aliasRequests is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.IdListdirectionIdsa list of direction Ids
osid.type.Type[]ingredientRecordTypesarray of ingredient record types to be included in each create operation or an empty list if none
Returnosid.recipe.batch.IngredientBatchFormListthe ingredient forms
ErrorsNOT_FOUNDa directionId is not found
NULL_ARGUMENT directionIds or ingredientRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to request forms with given record types
CompliancemandatoryThis 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.IngredientBatchFormListingredientFormsthe ingredient forms
Returnosid.transaction.batch.CreateResponseListthe create responses
ErrorsNULL_ARGUMENT ingredientForms is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.IdListingredientIdsthe Ids of the Ingredients
Returnosid.recipe.batch.IngredientBatchFormListthe ingredient forms
ErrorsNOT_FOUNDan ingredientId is not found
NULL_ARGUMENT ingredientIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.IngredientBatchFormListingredientFormsthe form containing the elements to be updated
Returnosid.transaction.batch.UpdateResponseListthe update responses
ErrorsNULL_ARGUMENT ingredientForms is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteAllIngredients
Description

Deletes all Ingredients in this Cookbook .

Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteIngredients
Description

Deletes ingredients for the given Ids.

Parametersosid.id.IdListingredientsIdsthe Ids of the ingredients to delete
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT ingredientIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteIngredientsForDirection
Description

Deletes ingredients for the given direction.

Parametersosid.id.IddirectionIdthe Id of a direction
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT directionId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.