OSID Logo
OSID Specifications
recipe package
Version 3.0.0
Release Candidate Preview
Interfaceosid.recipe.RecipeAdminSession
Implementsosid.OsidSession
Description

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

For updates, RecipeForms are requested to the Recipe Id that is to be updated using getRecipeFormForUpdate(). Similarly, the RecipeForm has metadata about the data that can be updated and it can perform validation before submitting the update. The RecipeForm can only be used once for a successful update and cannot be reused.

The delete operations delete Recipes. To unmap a Recipe from the current Cookbook, the RecipeCookbookAssignmentSession should be used. These delete operations attempt to remove the Recipe 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.
MethodcanCreateRecipes
Description

Tests if this user can create Recipes. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Recipe 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 Recipe creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateRecipeWithRecordTypes
Description

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

Parametersosid.type.Type[]recipeRecordTypesarray of recipe record types
Returnboolean true if Recipe creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT recipeRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetRecipeFormForCreate
Description

Gets the recipe form for creating new recipes. A new form should be requested for each create transaction.

Parametersosid.type.Type[]recipeRecordTypesarray of recipe record types
Returnosid.recipe.RecipeFormthe recipe form
ErrorsNULL_ARGUMENT recipeRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateRecipe
Description

Creates a new Recipe.

Parametersosid.recipe.RecipeFormrecipeFormthe form for this Recipe
Returnosid.recipe.Recipethe new Recipe
ErrorsILLEGAL_STATE recipeForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT recipeForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED recipeForm did not originate from getRecipeFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateRecipes
Description

Tests if this user can update Recipes. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Recipe 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 Recipe modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetRecipeFormForUpdate
Description

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

Parametersosid.id.IdrecipeIdthe Id of the Recipe
Returnosid.recipe.RecipeFormthe recipe form
ErrorsNOT_FOUND recipeId is not found
NULL_ARGUMENT recipeId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodupdateRecipe
Description

Updates an existing recipe.

Parametersosid.recipe.RecipeFormrecipeFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE recipeForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT recipeId or recipeForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED recipeForm did not originate from getRecipeFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteRecipes
Description

Tests if this user can delete Recipes. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Recipe 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 Recipe deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteRecipe
Description

Deletes a Recipe.

Parametersosid.id.IdrecipeIdthe Id of the Recipe to remove
ErrorsNOT_FOUND recipeId not found
NULL_ARGUMENT recipeId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageRecipeAliases
Description

Tests if this user can manage Id aliases for Recipes. 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 Recipe aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasRecipe
Description

Adds an Id to a Recipe for the purpose of creating compatibility. The primary Id of the Recipe is determined by the provider. The new Id performs as an alias to the primary Id. If the alias is a pointer to another recipe, it is reassigned to the given recipe Id.

Parametersosid.id.IdrecipeIdthe Id of a Recipe
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND recipeId not found
NULL_ARGUMENT recipeId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.