OSID Logo
OSID Specifications
recipe package
Version 3.1.0
Interfaceosid.recipe.DirectionAdminSession
Implementsosid.OsidSession
Implemented Byosid.recipe.batch.DirectionBatchAdminSession
Used Byosid.recipe.RecipeManager
osid.recipe.RecipeProxyManager
Description

This session creates, updates, and deletes Directions. 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 getDirectionFormForCreate() specifying the desired recipe and record Types or none if no record Types are needed. The returned DirectionForm 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 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.

For updates, DirectionForms are requested to the Direction Id that is to be updated using getDirectionFormForUpdate(). 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.

The delete operations delete Directions. 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.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodgetCookbookId
Description

Gets the Cookbook Id associated with this session.

Returnosid.id.Id the Cookbook Id associated with this session
Compliancemandatory This method must be implemented.
MethodgetCookbook
Description

Gets the Cookbook associated with this session.

Returnosid.recipe.Cookbook the cookbook
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanCreateDirections
Description

Tests if this user can create Directions. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Direction will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if Direction creation is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodcanCreateDirectionWithRecordTypes
Description

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

Parametersosid.type.Type[]directionRecordTypes array of direction record types
Returnboolean true if Direction creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT directionRecordTypes is null
Compliancemandatory This method must be implemented.
MethodgetDirectionFormForCreate
Description

Gets the direction form for creating new directions. A new form should be requested for each create transaction.

Parametersosid.id.IdrecipeId a recipe Id
osid.type.Type[]directionRecordTypes array of direction record types
Returnosid.recipe.DirectionForm the direction form
ErrorsNOT_FOUND recipeId Is not found
NULL_ARGUMENT recipeId or directionRecordTypes is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED unable to get form for requested record types
Compliancemandatory This method must be implemented.
MethodcreateDirection
Description

Creates a new Direction.

Parametersosid.recipe.DirectionFormdirectionForm the form for this Direction
Returnosid.recipe.Direction the new Direction
ErrorsILLEGAL_STATE directionForm already used in a create transaction
INVALID_ARGUMENT one or more of the form elements is invalid
NULL_ARGUMENT directionForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED directionForm did not originate from getDirectionFormForCreate()
Compliancemandatory This method must be implemented.
MethodcanUpdateDirections
Description

Tests if this user can update Directions. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Direction will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returnboolean false if Direction modification is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodgetDirectionFormForUpdate
Description

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

Parametersosid.id.IddirectionId the Id of the Direction
Returnosid.recipe.DirectionForm the direction form
ErrorsNOT_FOUND directionId is not found
NULL_ARGUMENT directionId is null
OPERATION_FAILED unable to complete request
Compliancemandatory This method must be implemented.
MethodupdateDirection
Description

Updates an existing direction.

Parametersosid.recipe.DirectionFormdirectionForm the form containing the elements to be updated
ErrorsILLEGAL_STATE directionForm already used in an update transaction
INVALID_ARGUMENT the form contains an invalid value
NULL_ARGUMENT directionForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED directionForm did not originate from getDirectionFormForUpdate()
Compliancemandatory This method must be implemented.
MethodcanDeleteDirections
Description

Tests if this user can delete Directions. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Direction will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returnboolean false if Direction deletion is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethoddeleteDirection
Description

Deletes a Direction.

Parametersosid.id.IddirectionId the Id of the Direction to remove
ErrorsNOT_FOUND directionId not found
NULL_ARGUMENT directionId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanManageDirectionAliases
Description

Tests if this user can manage Id aliases for Directions. 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 Direction aliasing is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodaliasDirection
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 performs as an alias to the primary Id. If the alias is a pointer to another direction, it is reassigned to the given direction Id.

Parametersosid.id.IddirectionId the Id of a Direction
osid.id.IdaliasId the alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND directionId not found
NULL_ARGUMENT directionId or aliasId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanManageIngredients
Description

Tests if this user can manage Ingedredients. 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 sequencing operations to an unauthorized user.

Returnboolean false if Ingredient management is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodcanCreateIngredientWithRecordTypes
Description

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

Parametersosid.type.Type[]ingredientRecordTypes array of ingredient record types
Returnboolean true if Ingredient creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT ingredientRecordTypes is null
Compliancemandatory This method must be implemented.
MethodgetIngredientFormForCreate
Description

Gets the ingredient form for creating new ingredients. A new form should be requested for each create transaction.

Parametersosid.id.IddirectionId an ingredient Id
osid.type.Type[]ingredientRecordTypes array of ingredient record types
Returnosid.recipe.IngredientForm the ingredient form
ErrorsNOT_FOUND directionId Is not found
NULL_ARGUMENT directionId or ingredientRecordTypes is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED unable to get form for requested record types
Compliancemandatory This method must be implemented.
MethodcreateIngredient
Description

Creates a new Ingredient.

Parametersosid.recipe.IngredientFormingredientForm the form for this Ingredient
Returnosid.recipe.Ingredient the new Ingredient
ErrorsILLEGAL_STATE ingredientForm already used in a create transaction
INVALID_ARGUMENT one or more of the form elements is invalid
NULL_ARGUMENT ingredientForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED ingredientForm did not originate from geIngredientFormForCreate()
Compliancemandatory This method must be implemented.
MethodgetIngredientFormForUpdate
Description

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

Parametersosid.id.IdingredientId the Id of the Ingredient
Returnosid.recipe.IngredientForm the ingredient form
ErrorsNOT_FOUND ingredientId is not found
NULL_ARGUMENT ingredientId is null
OPERATION_FAILED unable to complete request
Compliancemandatory This method must be implemented.
MethodupdateIngredient
Description

Updates an existing ingredient.

Parametersosid.recipe.IngredientFormingredientForm the form containing the elements to be updated
ErrorsILLEGAL_STATE ingredientForm already used in an update transaction
INVALID_ARGUMENT the form contains an invalid value
NULL_ARGUMENT ingredientForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED ingredientForm did not originate from getIngredientFormForUpdate()
Compliancemandatory This method must be implemented.
MethoddeleteIngredient
Description

Deletes an Ingredient.

Parametersosid.id.IdingredientId the Id of the Ingredient to remove
ErrorsNOT_FOUND ingredientId not found
NULL_ARGUMENT ingredientId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanSequenceDirections
Description

Tests if this user can order Directions. 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 sequencing operations to an unauthorized user.

Returnboolean false if Direction ordering is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodmoveDirectionAhead
Description

Reorders directions in a recipe by moving the specified direction in front of a reference direction.

Parametersosid.id.IddirectionId the Id of a Direction
osid.id.IdrecipeId the Id of a Recipe
osid.id.IdreferenceId the reference direction Id
ErrorsNOT_FOUND directionId, recipeId, or referenceId not found or, directionId or referenceId not related to recipeId
NULL_ARGUMENT directionId, recipeId or referenceId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodmoveDirectionBehind
Description

Reorders directions in a recipe by moving the specified direction behind a reference direction.

Parametersosid.id.IddirectionId the Id of a Direction
osid.id.IdrecipeId the Id of a Recipe
osid.id.IdreferenceId the reference direction Id
ErrorsNOT_FOUND directionId, recipeId, or referenceId not found or, directionId or referenceId not related to recipeId
NULL_ARGUMENT directionId, recipeId or referenceId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodorderDirections
Description

Reorders a set of directions in a recipe.

Parametersosid.id.Id[]directionIds the Ids for a set of Directions
osid.id.IdrecipeId the Id of a Recipe
ErrorsNOT_FOUND recipeId not found or, a directionId not related to recipeId
NULL_ARGUMENT directionIds or recipeId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.