public interface RecipeCookbookAssignmentSession extends OsidSession
This session provides methods to re-assign Recipes
to
Cookbook
mappings. A Recipe
may appear in
multiple Cookbook
objects and removing the last reference
to a Recipe
is the equivalent of deleting it. Each
Cookbook
may have its own authorizations governing who is allowed
to operate on it.
Adding a reference of a Recipe
to another
Cookbook
is not a copy operation (eg: does not change its
Id
).
Modifier and Type | Method and Description |
---|---|
void |
assignRecipeToCookbook(Id recipeId,
Id cookbookId)
Adds an existing
Recipe to a Cookbook. |
boolean |
canAssignRecipes()
Tests if this user can alter recipe/cook book mappings.
|
boolean |
canAssignRecipesToCookbook(Id cookbookId)
Tests if this user can alter recipe/cook book mappings.
|
IdList |
getAssignableCookbookIds(Id cookbookId)
Gets a list of cook books including and under the given cook book node
in which any recipe can be assigned.
|
IdList |
getAssignableCookbookIdsForRecipe(Id cookbookId,
Id recipeId)
Gets a list of cook books including and under the given cook book node
in which a specific recipe can be assigned.
|
void |
unassignRecipeFromCookbook(Id recipeId,
Id cookbookId)
Removes a
Recipe from a Cookbook. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canAssignRecipes()
PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer lookup operations to
unauthorized users. false
if ingredient is not authorized,
true
otherwisemandatory
- This method must be implemented. boolean canAssignRecipesToCookbook(Id cookbookId)
PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer lookup operations to
unauthorized users.cookbookId
- the Id
of the Cookbook
false
if mapping is not authorized, true
otherwiseNullArgumentException
- cookbookId
is
null
mandatory
- This method must be implemented. IdList getAssignableCookbookIds(Id cookbookId) throws OperationFailedException
cookbookId
- the Id
of the Cookbook
Ids
NullArgumentException
- cookbookId
is
null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. IdList getAssignableCookbookIdsForRecipe(Id cookbookId, Id recipeId) throws OperationFailedException
cookbookId
- the Id
of the Cookbook
recipeId
- the Id
of the Recipe
Ids
NullArgumentException
- cookbookId
or
recipeId
is null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void assignRecipeToCookbook(Id recipeId, Id cookbookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Recipe
to a Cookbook.
recipeId
- the Id
of the Recipe
cookbookId
- the Id
of the Cookbook
AlreadyExistsException
- recipeId
is not
assigned to cookbookId
NotFoundException
- recipeId
or
cookbookId
not foundNullArgumentException
- recipeId
or
cookbookId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void unassignRecipeFromCookbook(Id recipeId, Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Recipe
from a Cookbook.
recipeId
- the Id
of the Recipe
cookbookId
- the Id
of the Cookbook
NotFoundException
- recipeId
or
cookbookId
not found or recipeId
not
assigned to cookbookId
NullArgumentException
- recipeId
or
cookbookId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.