OSID Logo
OSID Specifications
recipe package
Version 3.0.0
Release Candidate Preview
Interfaceosid.recipe.CookbookAdminSession
Implementsosid.OsidSession
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
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 cook book types
Returnboolean true if Cookbook creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT cookbookRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetCookbookFormForCreate
Description

Gets the cook book form for creating new cook books. A new form should be requested for each create transaction.

Parametersosid.type.Type[]cookbookRecordTypesarray of cook book types
Returnosid.recipe.CookbookFormthe cook book form
ErrorsNULL_ARGUMENT cookbookRecordTypes 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_STATE cookbookForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT cookbookForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED cookbookForm 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.

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

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

Parametersosid.id.IdcookbookIdthe Id of the Cookbook
Returnosid.recipe.CookbookFormthe cook book form
ErrorsNOT_FOUND cookbookId is not found
NULL_ARGUMENT cookbookId 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_STATE cookbookForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT cookbookForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED cookbookForm 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.

Returnboolean false 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_FOUND cookbookId not found
NULL_ARGUMENT cookbookId 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.

Returnboolean false 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 cook book, it is reassigned to the given cook book Id.

Parametersosid.id.IdcookbookIdthe Id of an Cookbook
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND cookbookId not found
NULL_ARGUMENT cookbookId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.