Interface ProcedureCookbookAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Procedures to
Cookbooks . A Procedure may map to multiple Cookbooks and
removing the last reference to a Procedure 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 Procedure to another Cookbook
is not a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignProcedureToCookbook(Id procedureId, Id cookbookId) Adds an existingProcedureto anCookbook.booleanTests if this user can alter procedure/cookbook mappings.booleancanAssignProceduresToCookbook(Id cookbookId) Tests if this user can alter procedure/cookbook mappings.getAssignableCookbookIds(Id cookbookId) Gets a list of cookbooks including and under the given cookbook node in which any procedure can be assigned.getAssignableCookbookIdsForProcedure(Id cookbookId, Id procedureId) Gets a list of cookbooks including and under the given cookbook node in which a specific procedure can be assigned.voidreassignProcedureToCookbook(Id procedureId, Id fromCookbookId, Id toCookbookId) Moves aProcedurefrom oneCookbookto another.voidunassignProcedureFromCookbook(Id procedureId, Id cookbookId) Removes aProcedurefrom anCookbook.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
-
canAssignProcedures
boolean canAssignProcedures()Tests if this user can alter procedure/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 assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignProceduresToCookbook
Tests if this user can alter procedure/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 assignment 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 procedure 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.
-
getAssignableCookbookIdsForProcedure
IdList getAssignableCookbookIdsForProcedure(Id cookbookId, Id procedureId) throws OperationFailedException Gets a list of cookbooks including and under the given cookbook node in which a specific procedure can be assigned.- Parameters:
cookbookId- theIdof theCookbookprocedureId- theIdof theProcedure- Returns:
- list of assignable cookbook
Ids - Throws:
NullArgumentException-cookbookIdorprocedureIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignProcedureToCookbook
void assignProcedureToCookbook(Id procedureId, Id cookbookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingProcedureto anCookbook.- Parameters:
procedureId- theIdof theProcedurecookbookId- theIdof theCookbook- Throws:
AlreadyExistsException-procedureIdis already assigned tocookbookIdNotFoundException-procedureIdorcookbookIdnot foundNullArgumentException-procedureIdorcookbookIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignProcedureFromCookbook
void unassignProcedureFromCookbook(Id procedureId, Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aProcedurefrom anCookbook.- Parameters:
procedureId- theIdof theProcedurecookbookId- theIdof theCookbook- Throws:
NotFoundException-procedureIdorcookbookIdnot found orproecdureIdnot assigned tocookbookIdNullArgumentException-procedureIdorcookbookIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignProcedureToCookbook
void reassignProcedureToCookbook(Id procedureId, Id fromCookbookId, Id toCookbookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aProcedurefrom oneCookbookto another. Mappings to otherCookbooksare unaffected.- Parameters:
procedureId- theIdof theProcedurefromCookbookId- theIdof the currentCookbooktoCookbookId- theIdof the destinationCookbook- Throws:
AlreadyExistsException-procedureIdalready assigned totoCookbookIdNotFoundException-procedureId, fromCookbookId, ortoCookbookIdnot found orprocedureIdnot mapped tofromCookbookIdNullArgumentException-procedureId, fromCookbookId, ortoCookbookIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-