Interface DirectionCookbookAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Directions to
Cookbook mappings. A Direction may appear in multiple
Cookbook objects and removing the last reference to a Direction
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 Direction to another Cookbook
is not a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignDirectionToCookbook(Id directionId, Id cookbookId) Adds an existingDirectionto aCookbook.booleanTests if this user can alter direction/cookbook mappings.booleancanAssignDirectionsToCookbook(Id cookbookId) Tests if this user can alter direction/cookbook mappings.getAssignableCookbookIds(Id cookbookId) Gets a list of cookbooks including and under the given cookbook node in which any direction can be assigned.getAssignableCookbookIdsForDirection(Id cookbookId, Id directionId) Gets a list of cookbooks including and under the given cookbook node in which a specific direction can be assigned.voidreassignDirectionToCookbook(Id directionId, Id fromCookbookId, Id toCookbookId) Moves aDirectionfrom oneCookbookto another.voidunassignDirectionFromCookbook(Id directionId, Id cookbookId) Removes aDirectionfrom 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
-
canAssignDirections
boolean canAssignDirections()Tests if this user can alter direction/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 direction is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignDirectionsToCookbook
Tests if this user can alter direction/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 direction 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.
-
getAssignableCookbookIdsForDirection
IdList getAssignableCookbookIdsForDirection(Id cookbookId, Id directionId) throws OperationFailedException Gets a list of cookbooks including and under the given cookbook node in which a specific direction can be assigned.- Parameters:
cookbookId- theIdof theCookbookdirectionId- theIdof theDirection- Returns:
- list of assignable cookbook
Ids - Throws:
NullArgumentException-cookbookIdordirectionIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignDirectionToCookbook
void assignDirectionToCookbook(Id directionId, Id cookbookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingDirectionto aCookbook.- Parameters:
directionId- theIdof theDirectioncookbookId- theIdof theCookbook- Throws:
AlreadyExistsException-directionIdis already assigned tocookbookIdNotFoundException-directionIdorcookbookIdnot foundNullArgumentException-directionIdorcookbookIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignDirectionFromCookbook
void unassignDirectionFromCookbook(Id directionId, Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aDirectionfrom aCookbook.- Parameters:
directionId- theIdof theDirectioncookbookId- theIdof theCookbook- Throws:
NotFoundException-directionIdorcookbookIdnot found ordirectionIdnot assigned tocookbookIdNullArgumentException-directionIdorcookbookIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignDirectionToCookbook
void reassignDirectionToCookbook(Id directionId, Id fromCookbookId, Id toCookbookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aDirectionfrom oneCookbookto another. Mappings to otherCookbooksare unaffected.- Parameters:
directionId- theIdof theDirectionfromCookbookId- theIdof the currentCookbooktoCookbookId- theIdof the destinationCookbook- Throws:
AlreadyExistsException-directionIdalready assigned totoCookbookIdNotFoundException-directionId, fromCookbookId, ortoCookbookIdnot found ordirectionIdnot mapped tofromCookbookIdNullArgumentException-directionId, fromCookbookId, ortoCookbookIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-