Interface RecipeCookbookAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignRecipeToCookbook(Id recipeId, Id cookbookId) Adds an existingRecipeto aCookbook.booleanTests if this user can alter recipe/cookbook mappings.booleancanAssignRecipesToCookbook(Id cookbookId) Tests if this user can alter recipe/cookbook mappings.getAssignableCookbookIds(Id cookbookId) Gets a list of cookbooks including and under the given cookbook node in which any recipe can be assigned.getAssignableCookbookIdsForRecipe(Id cookbookId, Id recipeId) Gets a list of cookbooks including and under the given cookbook node in which a specific recipe can be assigned.voidreassignRecipeToCookbook(Id recipeId, Id fromCookbookId, Id toCookbookId) Moves aRecipefrom oneCookbookto another.voidunassignRecipeFromCookbook(Id recipeId, Id cookbookId) Removes aRecipefrom aCookbook.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
canAssignRecipes
boolean canAssignRecipes()Tests if this user can alter recipe/cookbook mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.- Returns:
falseif ingredient is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignRecipesToCookbook
Tests if this user can alter recipe/cookbook mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.- Parameters:
cookbookId- theIdof theCookbook- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-cookbookIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableCookbookIds
Gets a list of cookbooks including and under the given cookbook node in which any recipe can be assigned.- Parameters:
cookbookId- theIdof theCookbook- Returns:
- list of assignable cookbook
Ids - Throws:
NullArgumentException-cookbookIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableCookbookIdsForRecipe
IdList getAssignableCookbookIdsForRecipe(Id cookbookId, Id recipeId) throws OperationFailedException Gets a list of cookbooks including and under the given cookbook node in which a specific recipe can be assigned.- Parameters:
cookbookId- theIdof theCookbookrecipeId- theIdof theRecipe- Returns:
- list of assignable cookbook
Ids - Throws:
NullArgumentException-cookbookIdorrecipeIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignRecipeToCookbook
void assignRecipeToCookbook(Id recipeId, Id cookbookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingRecipeto aCookbook.- Parameters:
recipeId- theIdof theRecipecookbookId- theIdof theCookbook- Throws:
AlreadyExistsException-recipeIdis not assigned tocookbookIdNotFoundException-recipeIdorcookbookIdnot foundNullArgumentException-recipeIdorcookbookIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignRecipeFromCookbook
void unassignRecipeFromCookbook(Id recipeId, Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aRecipefrom aCookbook.- Parameters:
recipeId- theIdof theRecipecookbookId- theIdof theCookbook- Throws:
NotFoundException-recipeIdorcookbookIdnot found orrecipeIdnot assigned tocookbookIdNullArgumentException-recipeIdorcookbookIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignRecipeToCookbook
void reassignRecipeToCookbook(Id recipeId, Id fromCookbookId, Id toCookbookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aRecipefrom oneCookbookto another. Mappings to otherCookbooksare unaffected.- Parameters:
recipeId- theIdof theRecipefromCookbookId- theIdof the currentCookbooktoCookbookId- theIdof the destinationCookbook- Throws:
AlreadyExistsException-recipeIdalready assigned totoCookbookIdNotFoundException-recipeId, fromCookbookId, ortoCookbookIdnot found orrecipeIdnot mapped tofromCookbookIdNullArgumentException-recipeId, fromCookbookId, ortoCookbookIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-