Interface ProductStoreAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Products to
Stores . A Product may map to multiple Stores and
removing the last reference to a Product is the equivalent of
deleting it. Each Store may have its own authorizations governing
who is allowed to operate on it.
Adding a reference of a Product to another Store is
not a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignProductToStore(Id productId, Id storeId) Adds an existingProductto aStore.booleanTests if this user can alter product/store mappings.booleancanAssignProductsToStore(Id storeId) Tests if this user can alter product/store mappings.getAssignableStoreIds(Id storeId) Gets a list of stores including and under the given store node in which any product can be assigned.getAssignableStoreIdsForProduct(Id storeId, Id productId) Gets a list of stores including and under the given store node in which a specific product can be assigned.voidreassignProductToStore(Id productId, Id fromStoreId, Id toStoreId) Moves aProductfrom oneStoreto another.voidunassignProductFromStore(Id productId, Id storeId) Removes aProductfrom aStore.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
-
canAssignProducts
boolean canAssignProducts()Tests if this user can alter product/store 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.
-
canAssignProductsToStore
Tests if this user can alter product/store 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:
storeId- theIdof theStore- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-storeIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableStoreIds
Gets a list of stores including and under the given store node in which any product can be assigned.- Parameters:
storeId- theIdof theStore- Returns:
- list of assignable store
Ids - Throws:
NullArgumentException-storeIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableStoreIdsForProduct
Gets a list of stores including and under the given store node in which a specific product can be assigned.- Parameters:
storeId- theIdof theStoreproductId- theIdof theProduct- Returns:
- list of assignable store
Ids - Throws:
NullArgumentException-storeIdorproductIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignProductToStore
void assignProductToStore(Id productId, Id storeId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingProductto aStore.- Parameters:
productId- theIdof theProductstoreId- theIdof theStore- Throws:
AlreadyExistsException-productIdis already assigned tostoreIdNotFoundException-productIdorstoreIdnot foundNullArgumentException-productIdorstoreIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignProductFromStore
void unassignProductFromStore(Id productId, Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aProductfrom aStore.- Parameters:
productId- theIdof theProductstoreId- theIdof theStore- Throws:
NotFoundException-productIdorstoreIdnot found orproductIdnot assigned tostoreIdNullArgumentException-productIdorstoreIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignProductToStore
void reassignProductToStore(Id productId, Id fromStoreId, Id toStoreId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aProductfrom oneStoreto another. Mappings to otherStoresare unaffected.- Parameters:
productId- theIdof theProductfromStoreId- theIdof the currentStoretoStoreId- theIdof the destinationStore- Throws:
AlreadyExistsException-productIdalready assigned tostoreIdNotFoundException-productId, fromStoreId, ortoStoreIdnot found orproductIdnot mapped tofromStoreIdNullArgumentException-productId, fromStoreId, ortoStoreIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-