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

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

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

The delete operations delete Cookbooks.

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

MethodcanCreateCookbooks
Description

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

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

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

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

Gets the cookbook form for creating new cookbooks. A new form should be requested for each create transaction.

Parametersosid.type.Type[]cookbookRecordTypes array of cookbook types
Returnosid.recipe.CookbookForm the cookbook form
ErrorsNULL_ARGUMENT cookbookRecordTypes 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.
MethodcreateCookbook
Description

Creates a new Cookbook.

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

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

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

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

Parametersosid.id.IdcookbookId the Id of the Cookbook
Returnosid.recipe.CookbookForm the cookbook form
ErrorsNOT_FOUND cookbookId is not found
NULL_ARGUMENT cookbookId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdateCookbook
Description

Updates an existing cookbook.

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

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

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

Deletes an Cookbook.

Parametersosid.id.IdcookbookId the Id of the Cookbook to remove
ErrorsNOT_FOUND cookbookId not found
NULL_ARGUMENT cookbookId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanManageCookbookAliases
Description

Tests if this user can manage Id aliases for Cookbooks. 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 Cookbook aliasing is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodaliasCookbook
Description

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

Parametersosid.id.IdcookbookId the Id of an Cookbook
osid.id.IdaliasId the alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND cookbookId not found
NULL_ARGUMENT cookbookId or aliasId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.