OSID Logo
OSID Specifications
recipe package
Version 3.0.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.Idthe Cookbook Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetCookbook
Description

Gets the Cookbook associated with this session.

Returnosid.recipe.Cookbookthe cookbook
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.

Returnbooleanfalse if Direction creation is not authorized, true otherwise
CompliancemandatoryThis 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[]directionRecordTypesarray of direction record types
Returnbooleantrue if Direction creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENTdirectionRecordTypes is null
CompliancemandatoryThis 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.IdrecipeIda recipe Id
osid.type.Type[]directionRecordTypesarray of direction record types
Returnosid.recipe.DirectionFormthe direction form
ErrorsNOT_FOUNDrecipeId Is not found
NULL_ARGUMENTrecipeId or directionRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateDirection
Description

Creates a new Direction .

Parametersosid.recipe.DirectionFormdirectionFormthe form for this Direction
Returnosid.recipe.Directionthe new Direction
ErrorsILLEGAL_STATEdirectionForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENTdirectionForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDdirectionForm did not originate from getDirectionFormForCreate()
CompliancemandatoryThis 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.

Returnbooleanfalse if Direction modification is not authorized, true otherwise
CompliancemandatoryThis 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.IddirectionIdthe Id of the Direction
Returnosid.recipe.DirectionFormthe direction form
ErrorsNOT_FOUNDdirectionId is not found
NULL_ARGUMENTdirectionId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodupdateDirection
Description

Updates an existing direction.

Parametersosid.recipe.DirectionFormdirectionFormthe form containing the elements to be updated
ErrorsILLEGAL_STATEdirectionForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENTdirectionForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDdirectionForm did not originate from getDirectionFormForUpdate()
CompliancemandatoryThis 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.

Returnbooleanfalse if Direction deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteDirection
Description

Deletes a Direction .

Parametersosid.id.IddirectionIdthe Id of the Direction to remove
ErrorsNOT_FOUNDdirectionId not found
NULL_ARGUMENTdirectionId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.

Returnbooleanfalse if Direction aliasing is not authorized, true otherwise
CompliancemandatoryThis 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.IddirectionIdthe Id of a Direction
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTSaliasId is already assigned
NOT_FOUNDdirectionId not found
NULL_ARGUMENTdirectionId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.

Returnbooleanfalse if Ingredient management is not authorized, true otherwise
CompliancemandatoryThis 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[]ingredientRecordTypesarray of ingredient record types
Returnbooleantrue if Ingredient creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENTingredientRecordTypes is null
CompliancemandatoryThis 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.IddirectionIdan ingredient Id
osid.type.Type[]ingredientRecordTypesarray of ingredient record types
Returnosid.recipe.IngredientFormthe ingredient form
ErrorsNOT_FOUNDdirectionId Is not found
NULL_ARGUMENTdirectionId or ingredientRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateIngredient
Description

Creates a new Ingredient .

Parametersosid.recipe.IngredientFormingredientFormthe form for this Ingredient
Returnosid.recipe.Ingredientthe new Ingredient
ErrorsILLEGAL_STATEingredientForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENTingredientForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDingredientForm did not originate from geIngredientFormForCreate()
CompliancemandatoryThis 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.IdingredientIdthe Id of the Ingredient
Returnosid.recipe.IngredientFormthe ingredient form
ErrorsNOT_FOUNDingredientId is not found
NULL_ARGUMENTingredientId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodupdateIngredient
Description

Updates an existing ingredient.

Parametersosid.recipe.IngredientFormingredientFormthe form containing the elements to be updated
ErrorsILLEGAL_STATEingredientForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENTingredientForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDingredientForm did not originate from getIngredientFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethoddeleteIngredient
Description

Deletes an Ingredient .

Parametersosid.id.IdingredientIdthe Id of the Ingredient to remove
ErrorsNOT_FOUNDingredientId not found
NULL_ARGUMENTingredientId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.

Returnbooleanfalse if Direction ordering is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodmoveDirectionAhead
Description

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

Parametersosid.id.IddirectionIdthe Id of a Direction
osid.id.IdrecipeIdthe Id of a Recipe
osid.id.IdreferenceIdthe reference direction Id
ErrorsNOT_FOUNDdirectionId, recipeId , or referenceId not found or, directionId or referenceId not related to recipeId
NULL_ARGUMENTdirectionId, recipeId or referenceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodmoveDirectionBehind
Description

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

Parametersosid.id.IddirectionIdthe Id of a Direction
osid.id.IdrecipeIdthe Id of a Recipe
osid.id.IdreferenceIdthe reference direction Id
ErrorsNOT_FOUNDdirectionId, recipeId , or referenceId not found or, directionId or referenceId not related to recipeId
NULL_ARGUMENTdirectionId, recipeId or referenceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodorderDirections
Description

Reorders a set of directions in a recipe.

Parametersosid.id.Id[]directionIdsthe Ids for a set of Directions
osid.id.IdrecipeIdthe Id of a Recipe
ErrorsNOT_FOUNDrecipeId not found or, a directionId not related to recipeId
NULL_ARGUMENTdirectionIds or recipeId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.