public interface CategoryBusinessAssignmentSession extends OsidSession
This session provides methods to re-assign Categories to
Business objects A Category may appear in
multiple Business objects and removing the last reference
to a Category is the equivalent of deleting it. Each
Business may have its own authorizations governing who is allowed
to operate on it.
Adding a reference of a Category to another
Business is not a copy operation (eg: does not change its
Id ).
| Modifier and Type | Method and Description |
|---|---|
void |
assignCategoryToBusiness(Id categoryId,
Id businessId)
Adds an existing
Category to a Business. |
boolean |
canAssignCategories()
Tests if this user can alter category/business mappings.
|
boolean |
canAssignCategoryToBusiness(Id businessId)
Tests if this user can alter category/business mappings.
|
IdList |
getAssignableBusinessIds(Id businessId)
Gets a list of businesses including and under the given business node
in which any category can be assigned.
|
IdList |
getAssignableBusinessIdsForCategory(Id businessId,
Id categoryId)
Gets a list of businesses including and under the given business node
in which a specific category can be assigned.
|
void |
reassignCategoryToBusiness(Id categoryId,
Id fromBusinessId,
Id toBusinessId)
Moves a
Category from one Business to
another. |
void |
unassignCategoryFromBusiness(Id categoryId,
Id businessId)
Removes a
Category from a Business. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canAssignCategories()
PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer assignment operations to
unauthorized users. false if mapping is not authorized, true
otherwisemandatory - This method must be implemented. boolean canAssignCategoryToBusiness(Id businessId)
PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer lookup operations to
unauthorized users.businessId - the Id of the Business
false if mapping is not authorized, true
otherwiseNullArgumentException - businessId is
null mandatory - This method must be implemented. IdList getAssignableBusinessIds(Id businessId) throws OperationFailedException
businessId - the Id of the Business
Ids NullArgumentException - businessId is
null OperationFailedException - unable to complete requestmandatory - This method must be implemented. IdList getAssignableBusinessIdsForCategory(Id businessId, Id categoryId) throws OperationFailedException
businessId - the Id of the Business
categoryId - the Id of the Category
Ids NullArgumentException - businessId or
categoryId is null OperationFailedException - unable to complete requestmandatory - This method must be implemented. void assignCategoryToBusiness(Id categoryId, Id businessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Category to a Business. categoryId - the Id of the Category
businessId - the Id of the Business
AlreadyExistsException - categoryId is
already assigned to businessId NotFoundException - categoryId or
businessId not foundNullArgumentException - categoryId or
businessId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void unassignCategoryFromBusiness(Id categoryId, Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Category from a Business. categoryId - the Id of the Category
businessId - the Id of the Business
NotFoundException - categoryId or
businessId not found or categoryId not
assigned to businessId NullArgumentException - categoryId or
businessId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void reassignCategoryToBusiness(Id categoryId, Id fromBusinessId, Id toBusinessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Category from one Business to
another. Mappings to other Businesses are unaffected.categoryId - the Id of the Category
fromBusinessId - the Id of the current
Business toBusinessId - the Id of the destination
Business NotFoundException - categoryId, fromBusinessId,
or toBusinessId not found or
categoryId not mapped to fromBusinessId NullArgumentException - categoryId,
fromBusinessId, or toBusinessId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.