OSID Logo
OSID Specifications
billing package
Version 3.0.0
Release Candidate Preview
Interfaceosid.billing.CategoryBusinessAssignmentSession
Implementsosid.OsidSession
Description

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 ).

MethodcanAssignCategories
Description

Tests if this user can alter category/business 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 a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.

Returnboolean false if mapping is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanAssignCategoryToBusiness
Description

Tests if this user can alter category/business 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 a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.

Parametersosid.id.IdbusinessIdthe Id of the Business
Returnboolean false if mapping is not authorized, true otherwise
ErrorsNULL_ARGUMENT businessId is null
CompliancemandatoryThis method must be implemented.
MethodgetAssignableBusinessIds
Description

Gets a list of businesses including and under the given business node in which any category can be assigned.

Parametersosid.id.IdbusinessIdthe Id of the Business
Returnosid.id.IdListlist of assignable business Ids
ErrorsNULL_ARGUMENT businessId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodgetAssignableBusinessIdsForCategory
Description

Gets a list of businesses including and under the given business node in which a specific category can be assigned.

Parametersosid.id.IdbusinessIdthe Id of the Business
osid.id.IdcategoryIdthe Id of the Category
Returnosid.id.IdListlist of assignable business Ids
ErrorsNULL_ARGUMENT businessId or categoryId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodassignCategoryToBusiness
Description

Adds an existing Category to a Business.

Parametersosid.id.IdcategoryIdthe Id of the Category
osid.id.IdbusinessIdthe Id of the Business
ErrorsALREADY_EXISTS categoryId is already assigned to businessId
NOT_FOUND categoryId or businessId not found
NULL_ARGUMENT categoryId or businessId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodunassignCategoryFromBusiness
Description

Removes a Category from a Business.

Parametersosid.id.IdcategoryIdthe Id of the Category
osid.id.IdbusinessIdthe Id of the Business
ErrorsNOT_FOUND categoryId or businessId not found or categoryId not assigned to businessId
NULL_ARGUMENT categoryId or businessId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodreassignCategoryToBusiness
Description

Moves a Category from one Business to another. Mappings to other Businesses are unaffected.

Parametersosid.id.IdcategoryIdthe Id of the Category
osid.id.IdfromBusinessIdthe Id of the current Business
osid.id.IdtoBusinessIdthe Id of the destination Business
ErrorsNOT_FOUND categoryId, fromBusinessId, or toBusinessId not found or categoryId not mapped to fromBusinessId
NULL_ARGUMENT categoryId, fromBusinessId, or toBusinessId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.