OSID Logo
OSID Specifications
recipe package
Version 3.0.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.

Returnbooleanfalse if Cookbook creation is not authorized, true otherwise
CompliancemandatoryThis 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[]cookbookRecordTypesarray of cookbook types
Returnbooleantrue if Cookbook creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENTcookbookRecordTypes is null
CompliancemandatoryThis 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[]cookbookRecordTypesarray of cookbook types
Returnosid.recipe.CookbookFormthe cookbook form
ErrorsNULL_ARGUMENTcookbookRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateCookbook
Description

Creates a new Cookbook .

Parametersosid.recipe.CookbookFormcookbookFormthe form for this Cookbook
Returnosid.recipe.Cookbookthe new Cookbook
ErrorsILLEGAL_STATEcookbookForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENTcookbookForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDcookbookForm did not originate from getCookbookFormForCreate()
CompliancemandatoryThis 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.

Returnbooleanfalse if Cookbook modification is not authorized, true otherwise
CompliancemandatoryThis 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.IdcookbookIdthe Id of the Cookbook
Returnosid.recipe.CookbookFormthe cookbook form
ErrorsNOT_FOUNDcookbookId is not found
NULL_ARGUMENTcookbookId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateCookbook
Description

Updates an existing cookbook.

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

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

Deletes an Cookbook .

Parametersosid.id.IdcookbookIdthe Id of the Cookbook to remove
ErrorsNOT_FOUNDcookbookId not found
NULL_ARGUMENTcookbookId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.

Returnbooleanfalse if Cookbook aliasing is not authorized, true otherwise
CompliancemandatoryThis 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.IdcookbookIdthe Id of an Cookbook
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTSaliasId is already assigned
NOT_FOUNDcookbookId not found
NULL_ARGUMENTcookbookId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.